Repository navigation
feat(vite-plugin-ngp): add routes, library exports and an application schematic to ngp-generate - #150
Merged
Merged
Conversation
… schematic to ngp-generate - `--route <path>` on a component adds a lazy route to `src/app/app.routes.ts`. - In a library with `src/index.ts`, generated code is exported from the index, unless `--no-export`. - `ngp-generate application <name>` writes `apps/<name>` from create-ngp's `app` template and adds its dev, build and preview scripts to the top `package.json`. `scripts/application-files.mjs` copies the template into the plugin; its `--check` runs in the plugin's tests. Closes #144, closes #145, closes #146 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Collaborator
Author
|
LGTM. I checked:
|
This was referenced Dec 4, 2026
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.
Follow-ups to #139, from the recommendations in that thread.
--route <path>on a component adds{ path, loadComponent }at the end ofexport const routes: Routes = [...]insrc/app/app.routes.ts. It finds the end by counting brackets, skipping strings and comments. A routes file in another shape, a path that's already there, or a schematic other thancomponentstops it before it writes anything.src/libandsrc/index.ts, every schematic addsexport * from './lib/...'to the index.--no-exportskips that.ngp-generate application <name>writesapps/<name>and addsdev:,build:andpreview:<name>to the toppackage.json. The scripts usevpwhen the existingbuildscript does, elsevite. The files are create-ngp'sapptemplate as--monorepolays it out.scripts/application-files.mjscopies them intosrc/application-files.ts, and its--checkruns in the plugin's tests.Docs: Generating code (new Applications and Routes sections, plus the options table and how it differs), Creating an app, Status, the changelog, and decision 85 with its
design.mdrow.Tests:
app-ssrmonorepo test now checks the library index export, generatesapps/adminwith a routedorderscomponent, runsbuild:admin, finds theorders-chunk, and expects 6 specs to pass.docs:check.Closes #144, closes #145, closes #146
🤖 Generated with Claude Code