feat: transform entrypoint.#88
Conversation
There was a problem hiding this comment.
Pull request overview
Adds a new @knighted/jsx/transform entrypoint to transform raw JSX/TSX source text while also returning normalized import metadata and structured diagnostics, with Vitest coverage to lock down output stability.
Changes:
- Introduces
transformJsxSource()(parser + import metadata extraction + diagnostics), with optional TypeScript stripping viaoxc-transformor the existing manual stripper. - Adds unit tests + snapshots for import metadata determinism, diagnostics shape, and strip-backend behavior.
- Exposes the new
./transformsubpath export and adds theoxc-transformdependency; removes the related “next steps” doc item.
Reviewed changes
Copilot reviewed 5 out of 6 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| test/transform.test.ts | Adds coverage for transform behavior, diagnostics normalization, import metadata ordering, and TS strip backends. |
| test/snapshots/transform.test.ts.snap | Stores snapshots for diagnostics shape and import metadata determinism. |
| src/transform.ts | New transform implementation combining oxc parsing, import metadata extraction, diagnostics mapping, and TS strip + JSX transpile pipeline. |
| package.json | Bumps version, adds ./transform export, and adds oxc-transform dependency. |
| package-lock.json | Locks oxc-transform and platform bindings. |
| docs/next-steps.md | Removes the “evaluate oxc-transform” roadmap bullet now that it’s implemented. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #88 +/- ##
==========================================
- Coverage 88.21% 87.85% -0.37%
==========================================
Files 25 26 +1
Lines 2019 2107 +88
Branches 547 584 +37
==========================================
+ Hits 1781 1851 +70
- Misses 77 83 +6
- Partials 161 173 +12 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
There was a problem hiding this comment.
Pull request overview
This PR introduces a new transformJsxSource entrypoint that augments the existing JSX source transpilation flow with parser-backed import metadata and structured diagnostics, and wires it into the published package exports and documentation.
Changes:
- Add
src/transform.tsimplementingtransformJsxSource()(imports metadata + diagnostics + optional TS strip viaoxc-transform). - Add Vitest coverage and snapshots for the new transform behavior.
- Publish the new subpath export (
@knighted/jsx/transform) and document usage in the README.
Reviewed changes
Copilot reviewed 6 out of 7 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
src/transform.ts |
New transform entrypoint combining parsing (imports/diagnostics) with JSX transpilation and optional TS stripping via oxc-transform. |
test/transform.test.ts |
New unit tests covering determinism, diagnostics shape, TS strip backends, and error handling. |
test/__snapshots__/transform.test.ts.snap |
Snapshots for parser diagnostics shape and deterministic import metadata. |
package.json |
Bump version, add ./transform export, add oxc-transform dependency. |
package-lock.json |
Lockfile updates for oxc-transform and its platform bindings. |
README.md |
Document the new @knighted/jsx/transform API and add environment notes. |
docs/next-steps.md |
Remove the “evaluate oxc-transform” next-step now that it’s implemented. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
No description provided.