`@push-based/create-ngp`: scaffold an Angular app on vite-plugin-ngp, for `vp create @push-based/ngp` and `npm create @push-based/ngp`
I maintainer di solito rispondono entro 1 giorno
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 4/5
- Tempo stimato
- 3-5 giorni
- Idoneità per principianti
- 48/100
- Tipo di issue
- Funzionalità
- Chiarezza
- Specificata chiaramente
- Stato di attività
- Attiva
- Stack tecnologico
- angular, node.js, typescript, vite
- Ambito
- build-system, cli, testing
Direzione di ricerca
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.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
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.
- Lingua principale
- TypeScript
- Stelle
- 7
- Fork
- 0
- Merge medio
- 12h 24m
- PR unite (30g)
- 13
Preparare l'ambiente
Questo progetto non fornisce container di sviluppo, Dockerfile né guida per i contributori, quindi l'ambiente è a tuo carico: parti dal suo README e consulta la nostra guida al primo contributo per i passaggi generali.
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di push-based/vite-plugin-ngp
-
bug
Difficoltà 2/5 1-3 ore Idoneità per principianti 77/100
push-based/vite-plugin-ngp#33 ·
I maintainer di solito rispondono entro 1 giorno
-
bug
Difficoltà 3/5 1-2 giorni Idoneità per principianti 55/100
push-based/vite-plugin-ngp#42 ·
I maintainer di solito rispondono entro 1 giorno
-
feature
Difficoltà 4/5 3-5 giorni Idoneità per principianti 52/100
push-based/vite-plugin-ngp#41 ·
I maintainer di solito rispondono entro 1 giorno
-
feature
Difficoltà 4/5 3-5 giorni Idoneità per principianti 50/100
push-based/vite-plugin-ngp#40 ·
I maintainer di solito rispondono entro 1 giorno
-
feature
Difficoltà 3/5 1-2 giorni Idoneità per principianti 55/100
push-based/vite-plugin-ngp#39 ·
I maintainer di solito rispondono entro 1 giorno
Tutte le issue di push-based/vite-plugin-ngp
Issue simili
-
nb stats: the high-error-rate anomaly and the error-causes line give different cause splits for the same errorsForse già presa @jeanibarz l’ha presa oggi. Apertabug
Difficoltà 2/5 1-3 ore Idoneità per principianti 89/100
jeanibarz/agent-notebook#418 ·
I maintainer di solito rispondono entro 1 giorno
-
Page sections overlap each other on every page (e.g. Seasons, Actors and Reviews on show pages)Aperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 65/100
I maintainer di solito rispondono entro 1 giorno
-
enhancement
Difficoltà 2/5 1-3 ore Idoneità per principianti 68/100
josephfung/curia#2563 ·
I maintainer di solito rispondono entro 1 giorno
-
README demo: offer a controlled video variant next to the GIF for reduced motion and mobile dataApertaaccessibility
Difficoltà 2/5 1-3 ore Idoneità per principianti 76/100
onetechgroupll/eigen-beam#26 ·
I maintainer di solito rispondono entro 1 giorno
-
maintenance
Difficoltà 2/5 1-3 ore Idoneità per principianti 77/100
killi199/time-tracking#532 ·
I maintainer di solito rispondono entro 1 giorno