`@push-based/create-ngp`: scaffold an Angular app on vite-plugin-ngp, for `vp create @push-based/ngp` and `npm create @push-based/ngp`
Maintainers usually reply within 1 day
Nobody has claimed this yet.
Assessment
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Newbie friendliness
- 48/100
- Issue type
- Feature
- Clarity
- Clearly specified
- Activity status
- Active
- Tech stack
- angular, node.js, typescript, vite
- Domain
- build-system, cli, testing
Research direction
Read the Getting started and Testing pages, the Server rendering page, and packages/vite-plugin-ngp/package.json plus toolchain/versions.env for the template details and pinned versions. Start by checking the create-vite argument and scaffold patterns, then build both templates under packages/create-ngp/templates/ and add the listed unit and integration coverage. Done means each template scaffolds successfully and the specified build, test, SSR, and available Vite+ checks pass.
Written by the indexing model from the issue text.
Description
Part of #13. Labels: feature.
What a user does
vp create @push-based/ngp my-app # Vite+
npm create @push-based/ngp@latest my-app # npm
pnpm create @push-based/ngp my-app # pnpm
Then cd my-app and vp dev (or pnpm dev). The app is the one Getting started describes, generated instead of typed.
Behaviour
Arguments and flags (parse with mri, like create-vite):
[directory] |
Target. Prompted ("Project name:", default ngp-app) when absent and interactive |
-t, --template <app|app-ssr> |
Template. Prompted when absent and interactive. Default app when non-interactive |
--overwrite |
Empty a non-empty target without asking. Without it, interactive asks; non-interactive aborts |
--interactive / --no-interactive |
Default process.stdin.isTTY |
-h, --help |
No --immediate, no git init, no install. Vite+ does install, git, hooks and formatting itself after the template exits, and a second git init is what create-analog gets wrong. Print "Done. Now run:" with cd, <pm> install, <pm> dev, where <pm> comes from npm_config_user_agent. Under vp the install line is harmless because vp installs right after.
Remember that vp does not prepend the target directory and does not forward --no-interactive; vp create @push-based/ngp -- --no-interactive --template app is the unattended form, and the docs show it.
Templates, as packages/create-ngp/templates/<name>/, copied file by file, with _gitignore → .gitignore, package.json#name set to the valid package name derived from the directory, and <title> in index.html replaced. Nothing else is templated: no placeholders, no engine.
app:index.html,vite.config.ts(defineConfigfromvite,ngp()with no options),tsconfig.json+tsconfig.app.json+tsconfig.spec.jsonasng newwrites them,src/main.ts,src/app/app.ts+app.html+app.css,app.config.tswithprovideRouter,routes.tswith one route,src/styles.css,src/app/app.spec.ts,src/test-setup.ts,vitest.config.tsper the Testing page,public/favicon.svg,README.md,_gitignore.package.jsonscripts:dev,build,preview,test. Dependencies: the exact pins from Getting started (@angular/*at the plugin's pinned version,typescript 6.0.3,vite 8.3.4,vitest,jsdom, the plugin at the version released alongside).app-ssr:appplussrc/main.server.ts(the Server rendering page's entry,allowedHosts: ['localhost']),provideClientHydration(withEventReplay())inapp.config.ts,ngp({ssr: true}),server.mjscopied from the playground, and astartscript.
The pinned versions come from one place: a versions.json that the build writes from packages/vite-plugin-ngp/package.json and toolchain/versions.env, so a plugin release can't ship a template pinned to an older Angular.
Vite+ handling. The output is a plain Vite project. vite is in devDependencies so that vp's post-create rewrite aliases it to @voidzero-dev/vite-plus-core; without that line the plugin can't load under vp (see the epic). Verify in a test that after vp create @push-based/ngp, vp build, vp test run and vp check --fix && vp check all pass. If vp's injected fmt: {} formats Angular sources to double quotes, add fmt: {singleQuote: true} to the template config; vp keeps a template's own fmt/lint keys.
Tests
- Unit: argument parsing, package-name derivation, overwrite rules, the rename map.
- Integration (
node --test, like the plugin): scaffold each template into a temp dir,pnpm installwith the workspace plugin linked,vite build,vitest run. Forapp-ssr, alsonode server.mjsand fetch/. - Under Vite+: the same, through
vp create ./packages/create-ngp -- --no-interactive, whenvpis onPATH; skipped otherwise. CI installsvite-plusin that job.
Docs
Covered by the docs sub-issue; this issue is done when the package scaffolds both templates and the tests above pass.
Out of scope
Tailwind, Angular Material, i18n, Nx workspaces, --immediate, an ng new-compatible flag set.
- Dominant language
- TypeScript
- Stars
- 7
- Forks
- 1
- Avg merge
- 12h 24m
- Merged PRs (30d)
- 13
Getting set up
This project ships no dev container, Dockerfile or contributing guide, so setting up is up to you: start from its README, and see our first-contribution guide for the general steps.
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from push-based/vite-plugin-ngp
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 77/100
push-based/vite-plugin-ngp#33 ·
Maintainers usually reply within 1 day
-
bug
Difficulty 3/5 1-2 days Newbie friendliness 55/100
push-based/vite-plugin-ngp#42 ·
Maintainers usually reply within 1 day
-
feature
Difficulty 4/5 3-5 days Newbie friendliness 52/100
push-based/vite-plugin-ngp#41 ·
Maintainers usually reply within 1 day
-
feature
Difficulty 4/5 3-5 days Newbie friendliness 50/100
push-based/vite-plugin-ngp#40 ·
Maintainers usually reply within 1 day
-
feature
Difficulty 3/5 1-2 days Newbie friendliness 55/100
push-based/vite-plugin-ngp#39 ·
Maintainers usually reply within 1 day
All issues in push-based/vite-plugin-ngp
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
vercel-labs/ui#540 ·
Maintainers usually reply within 1 day
-
accepted ai-dev ai-implementing
Difficulty 2/5 1-3 hours Newbie friendliness 74/100
livesport/homer#218 · 1 comment ·
Maintainers usually reply within 1 day
-
normalizePropName strips `#` characters from Figma property names instead of only the `#id` suffixOpen
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
figma/code-connect#419 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
-
Negative values skip k/M abbreviation and medium decimal format on line, stacked-area, and tooltipOpen
Difficulty 2/5 1-3 hours Newbie friendliness 84/100
britecharts/britecharts#1255 ·
Maintainers usually reply within 1 day