Build and publish JS and TS defaults from one TypeScript source - #320
Open
bcomnes wants to merge 2 commits into
Open
Build and publish JS and TS defaults from one TypeScript source#320bcomnes wants to merge 2 commits into
bcomnes wants to merge 2 commits into
Conversation
Coverage Report for CI Build 34790038278Coverage increased (+1.1%) to 95.294%Details
Uncovered ChangesNo uncovered changes found. Coverage RegressionsNo coverage regressions found. Coverage Stats💛 - Coveralls |
Contributor
There was a problem hiding this comment.
🟡 Changes recommended
The fallback warning still inaccurately refers to root.layout.js instead of the canonical TypeScript layout.
Get a fresh assessment by requesting another Copilot review.
Pull request overview
This PR makes the bundled TypeScript layout canonical and adds language-aware, non-interactive layout ejection.
Changes:
- Adds scoped TypeScript loading and packages the canonical layout.
- Adds
--language js|tsand--yesejection options. - Updates runtime discovery, documentation, and validation tests.
File summaries
| File | Summary |
|---|---|
test-cases/cli-errors/eject.test.js |
Tests ejection formats, prompts, and validation. |
scripts/test-packed-types.js |
Validates packed layouts and generated TypeScript consumers. |
package.json |
Packages the canonical TypeScript layout. |
lib/identify-pages.js |
Discovers the TypeScript fallback layout; warning text still references root.layout.js. |
lib/defaults/load-layout.js |
Loads the packaged TypeScript layout with scoped stripping. |
lib/defaults/default.root.layout.ts |
Defines the canonical typed layout. |
lib/defaults/default.root.layout.test.js |
Tests the canonical layout directly. |
lib/build-pages/page-data.js |
Uses the specialized layout loader. |
docs/layouts/README.md |
Documents layout loading and ejection. |
docs/cli/README.md |
Documents ejection options and formats. |
bin.js |
Implements language-aware ejection and confirmation bypass. |
Review details
- Files reviewed: 11/11 changed files
- Comments generated: 1
- Review effort level: Lite
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
| defaultLayout = true | ||
|
|
||
| const defaultLayoutBasename = 'default.root.layout.js' | ||
| const defaultLayoutBasename = 'default.root.layout.ts' |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Maintain one canonical TypeScript default layout, generate its JavaScript counterpart at build time, and publish both formats for language-aware eject.
Versioning and packaging
Validation
Downstream
Unblocks bcomnes/create-domstack-app#2.
Publish this upstream change first, then update the generator dependency range before releasing create-app.