Skip to content

Conversation

@kraenhansen
Copy link
Collaborator

More refactoring (following up on #327 and #328), preparing for #329.

@kraenhansen kraenhansen self-assigned this Nov 13, 2025
@kraenhansen kraenhansen added C++ Apple 🍎 Anything related to the Apple platform (iOS, macOS, Cocoapods, Xcode, XCFrameworks, etc.) Android 🤖 Anything related to the Android platform (Gradle, NDK, Android SDK) weak-node-api labels Nov 13, 2025
@kraenhansen kraenhansen requested a review from Copilot November 13, 2025 10:27
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR refactors the weak-node-api package by renaming WeakNodeApiHost to NodeApiHost and reorganizing code generation. The changes improve code organization by separating the NodeApiHost struct generation into its own file and enhancing generated file documentation with structured comments.

Key changes:

  • Renamed WeakNodeApiHost to NodeApiHost throughout the codebase
  • Extracted NodeApiHost struct generation to a dedicated generator file
  • Added JSDoc-style file headers to all generated files
  • Consolidated npm scripts with consistent naming conventions (e.g., prebuild:* prefix)

Reviewed Changes

Copilot reviewed 12 out of 12 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
packages/weak-node-api/tests/test_inject.cpp Updated test references from WeakNodeApiHost to NodeApiHost
packages/weak-node-api/scripts/generators/weak-node-api.ts Removed NodeApiHost struct generation, now imports from separate file
packages/weak-node-api/scripts/generators/NodeApiHost.ts New file containing extracted NodeApiHost struct generation logic
packages/weak-node-api/scripts/generate.ts Added file header generation with JSDoc comments for all output files
packages/weak-node-api/package.json Renamed scripts to use consistent prebuild:* and generate naming
packages/weak-node-api/CMakeLists.txt Added NodeApiHost.hpp to the list of public headers
packages/weak-node-api/.gitignore Simplified to ignore entire /generated/ directory
packages/host/scripts/generate-injector.mts Updated struct name from WeakNodeApiHost to NodeApiHost
packages/host/package.json Renamed script to injector:generate for consistency
package.json Removed unused prerelease script
.github/workflows/check.yml Updated workflow to use renamed npm scripts
.changeset/slimy-parts-admire.md Changeset documenting the rename

@kraenhansen kraenhansen changed the title Kh/weak node api refactored generator 3 More refactoring of the weak-node-api generator Nov 13, 2025
@kraenhansen kraenhansen force-pushed the kh/weak-node-api-refactored-generator-3 branch from cf5e056 to bd952a6 Compare November 13, 2025 13:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Android 🤖 Anything related to the Android platform (Gradle, NDK, Android SDK) Apple 🍎 Anything related to the Apple platform (iOS, macOS, Cocoapods, Xcode, XCFrameworks, etc.) C++ weak-node-api

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants