feat: integrate oxc_transformer for TypeScript-to-JS post-processing#62
feat: integrate oxc_transformer for TypeScript-to-JS post-processing#62Brooooooklyn wants to merge 1 commit intomainfrom
Conversation
fe15097 to
a543ad1
Compare
a543ad1 to
21fe4de
Compare
Non-Angular class decorators (e.g., @UntilDestroy()) were left as raw decorator syntax in the compiled output because the Angular compiler only strips Angular-specific decorators. Since the Vite plugin's transform hook replaces default TS→JS processing, these decorators never get lowered, causing parse errors downstream. Add an optional `typescript` transform step that runs oxc_transformer + oxc_codegen after Angular compilation to strip TypeScript types and lower decorators. Supports auto-discovery of tsconfig.json via oxc_resolver, explicit tsconfig paths, or pre-resolved options. Closes #44 Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
21fe4de to
69b4ccf
Compare
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 2 potential issues.
Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
| // verbatimModuleSyntax maps to onlyRemoveTypeImports in the Rust compiler | ||
| onlyRemoveTypeImports: compilerOptions.verbatimModuleSyntax, | ||
| } | ||
| } |
There was a problem hiding this comment.
tsconfig extends chains are not resolved
Medium Severity
readTsCompilerOptions reads the tsconfig.json directly with JSON.parse but does not follow extends chains. Most Angular projects use tsconfig.json that extends a base config (e.g., "extends": "./tsconfig.base.json"), where settings like experimentalDecorators are commonly defined in the base. This means the pre-resolved options will have undefined for those fields, falling back to NAPI defaults, which may not match the project's actual configuration.
| // Remove trailing commas before } or ] | ||
| result = result.replace(/,\s*([}\]])/g, '$1') | ||
| return result | ||
| } |
There was a problem hiding this comment.
Naive comment stripping corrupts strings containing //
Low Severity
stripJsonComments uses regex \/\/.*$ to strip single-line comments, but this also matches // inside JSON string values. A tsconfig.json containing a string with // (e.g., a URL in a path mapping or plugin config) would have the string value truncated, producing invalid JSON and a confusing parse error.



Non-Angular class decorators (e.g., @UntilDestroy()) were left as raw
decorator syntax in the compiled output because the Angular compiler
only strips Angular-specific decorators. Since the Vite plugin's
transform hook replaces default TS→JS processing, these decorators
never get lowered, causing parse errors downstream.
Add an optional
typescripttransform step that runs oxc_transformerlower decorators. Supports auto-discovery of tsconfig.json via
oxc_resolver, explicit tsconfig paths, or pre-resolved options.
Closes #44
Co-Authored-By: Claude Opus 4.6 noreply@anthropic.com
Note
Cursor Bugbot is generating a summary for commit fe15097. Configure here.