Skip to content

Comments

refactor(napi/parser): move generated JS into src-js#16957

Merged
graphite-app[bot] merged 1 commit intomainfrom
c/12-16-refator_napi_parser_move_generated_js_into_src-js_
Dec 17, 2025
Merged

refactor(napi/parser): move generated JS into src-js#16957
graphite-app[bot] merged 1 commit intomainfrom
c/12-16-refator_napi_parser_move_generated_js_into_src-js_

Conversation

@camc314
Copy link
Contributor

@camc314 camc314 commented Dec 16, 2025

moves the generated code into src-js to keep the same pattern as oxlint

@github-actions github-actions bot added A-parser Area - Parser A-ast-tools Area - AST tools labels Dec 16, 2025
Copy link
Contributor Author

camc314 commented Dec 16, 2025


How to use the Graphite Merge Queue

Add either label to this PR to merge it via the merge queue:

  • 0-merge - adds this PR to the back of the merge queue
  • hotfix - for urgent hot fixes, skip the queue and merge this PR next

You must have a Graphite account in order to use the merge queue. Sign up using this link.

An organization admin has enabled the Graphite Merge Queue in this repository.

Please do not merge from GitHub as this will restart CI on PRs being processed by the merge queue.

This stack of pull requests is managed by Graphite. Learn more about stacking.

@camc314 camc314 marked this pull request as ready for review December 16, 2025 15:51
Copilot AI review requested due to automatic review settings December 16, 2025 15:51
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 NAPI parser code generation paths to move generated JavaScript files into the src-js directory, aligning with the pattern used in oxlint. The changes update both the code generators (in tasks/ast_tools) and the import paths in the runtime code.

  • Updates code generation output paths from generated/ to src-js/generated/
  • Adjusts import paths in runtime code to reflect the new directory structure
  • Maintains consistency with existing project patterns

Reviewed changes

Copilot reviewed 10 out of 38 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
tasks/ast_tools/src/generators/raw_transfer_lazy.rs Updates output paths for lazy transfer generators and import paths within generated code
tasks/ast_tools/src/generators/raw_transfer.rs Updates output paths for constants and deserializer files
tasks/ast_tools/src/generators/estree_visit.rs Updates output paths for visitor-related generated files
napi/parser/src-js/visit/visitor.js Adjusts import path for type_ids to remove extra directory traversal
napi/parser/src-js/visit/index.js Adjusts import path for walk.js to remove extra directory traversal
napi/parser/src-js/raw-transfer/visitor.js Adjusts import path for type_ids to remove extra directory traversal
napi/parser/src-js/raw-transfer/lazy.js Adjusts import paths for constants, constructors, and walk to remove extra directory traversal
napi/parser/src-js/raw-transfer/eager.js Adjusts require path for deserializers to remove extra directory traversal
napi/parser/src-js/raw-transfer/common.js Adjusts import path for constants to remove extra directory traversal
napi/parser/src-js/index.js Adjusts export path for visitorKeys to remove directory traversal

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@camc314 camc314 changed the title refator(napi/parser): move generated JS into src-js refactor(napi/parser): move generated JS into src-js Dec 16, 2025
@github-actions github-actions bot added the C-cleanup Category - technical debt or refactoring. Solution not expected to change behavior label Dec 16, 2025
Copy link
Member

@overlookmotel overlookmotel left a comment

Choose a reason for hiding this comment

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

I think need to update the files list in package.json too.

Note: We don't include all the files in generated folder in the NPM package. Some of the generated deserializers are only for testing, and not actually referenced in the package. So we shouldn't just include the whole src-js directory.

@camc314 camc314 force-pushed the c/12-16-refator_napi_parser_move_generated_js_into_src-js_ branch from 959b50c to 8c8b4ea Compare December 17, 2025 09:31
@camc314
Copy link
Contributor Author

camc314 commented Dec 17, 2025

Yep you're right 🫣 - fixed

Copy link
Member

@overlookmotel overlookmotel left a comment

Choose a reason for hiding this comment

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

Looks good. But let's test the NPM package after next release.

We should really run tests on the built package. Right now it's too easy for tests to all pass, but for the published package to be broken. (I guess if we bundled it, that would mostly solve the problem)

@overlookmotel overlookmotel added the 0-merge Merge with Graphite Merge Queue label Dec 17, 2025
Copy link
Member

overlookmotel commented Dec 17, 2025

Merge activity

moves the generated code into src-js to keep the same pattern as oxlint
@graphite-app graphite-app bot force-pushed the c/12-16-refator_napi_parser_move_generated_js_into_src-js_ branch from 08b2295 to 5d211a8 Compare December 17, 2025 11:43
@graphite-app graphite-app bot merged commit 5d211a8 into main Dec 17, 2025
18 checks passed
@graphite-app graphite-app bot deleted the c/12-16-refator_napi_parser_move_generated_js_into_src-js_ branch December 17, 2025 11:49
@graphite-app graphite-app bot removed the 0-merge Merge with Graphite Merge Queue label Dec 17, 2025
graphite-app bot pushed a commit that referenced this pull request Dec 18, 2025
Lazy deserialization in `oxc-parser` was broken by #16957. Fix it.
qinyuhang pushed a commit to qinyuhang/oxc that referenced this pull request Jan 22, 2026
…6957)

moves the generated code into src-js to keep the same pattern as oxlint
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

A-ast-tools Area - AST tools A-parser Area - Parser C-cleanup Category - technical debt or refactoring. Solution not expected to change behavior

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants