-
Notifications
You must be signed in to change notification settings - Fork 6
More refactoring of the weak-node-api generator
#330
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
There was a problem hiding this 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
WeakNodeApiHosttoNodeApiHostthroughout the codebase - Extracted
NodeApiHoststruct 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 |
weak-node-api generator
cf5e056 to
bd952a6
Compare
More refactoring (following up on #327 and #328), preparing for #329.