Repository navigation
docs(site): add a tutorial that walks a new app through edits, a type error and a build - #170
Merged
Merged
Conversation
… error and a build The page creates an app with create-ngp, edits a template while the page holds state, edits the class to show the reload, plants a template type error in the terminal and overlay, then runs the spec and the build. Every step was run on create-ngp 0.4.4 and the excerpts are from that run. Closes #159 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
ChristopherPHolder
force-pushed
the
docs/tutorial
branch
from
December 4, 2026 04:34
6c9a8ee to
cd2dcdb
Compare
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.
Closes #159
What changed
site/content/tutorial.md, a new page. It walks someone who has never used the plugin through it in four steps. Each step shows the terminal output and says what the browser shows.npm create @push-based/ngp@latest -- shop --template app --no-monorepo, install it and runnpm run dev.app.html: the template updates in place and the count stays at 3. Next, edit the class (n + 1→n + 2): the page reloads. The page explains the rule and links How it works § Component HMR. An inlinetemplateedit inhome.tsalso updates in place.clicks()asclikcs()in the template. Then fix it and watch the overlay close and the terminal printtype-check: no errors.npm testfails because of the step-2 change, so the spec gets fixed. Thennpm run buildpasses, and fails with the typo put back.npm run previewserves the result.site/src/app/docs.ts: aTutorialentry in Guide, right after Creating an app. The tutorial starts by creating an app, so it comes after the page that documents that command. Readers with an existing app still find Getting started first.site/content/creating-an-app.md: one new line under "After you scaffold" that links the tutorial. The open PRs that edit this page don't touch that spot: feat(create-ngp): publish an unscoped create-ngp so vp create ngp works #136 changes lines 7–65 and ci(workflows): run the packed plugin on windows with the wasm engine #149 line ~226.site/content/changelog.md: one line under 4 December 2026 → Docs.How I checked it
I ran every step as written. The app was in a temp directory outside the repo, on create-ngp 0.4.4 from npm, Angular 22.3.2, Vite 8.3.4 and Node 26.12.1, on an Apple M4 Max. The dev server ran on port 5401. I deleted the app afterwards.
Observed in a browser preview tab (DOM reads and screenshots):
app.htmledit the<h1>changed andClicks: 3stayed. Awindowmarker I set before the edit was still there, so the page didn't reload. The terminal printedhmr update src/app/app.ts@App..tsedit the marker was gone, the counter was back at 0 and one click gave 2. The terminal printedpage reload src/app/app.ts.home.tsinline-template edit updated in place and kept the marker and the count.TS2551 … 'clikcs' … Did you mean 'clicks'?atapp.html:9:54. After the fix, the overlay element was gone.Two things I found while running it, and the page says both:
ctx.clikcs is not a functionand the plugin reloads the page (HMR failed … Reloading.). The type-check reports about 100 ms later.vite buildemptiesdist/. A preview right after the failure returned 404, so the page says to build again before serving.Also:
npm test(fail, then pass),npm run build(pass, then fail on the typo, then pass), andnpm run preview(fetched/, got the builtindex.html).The timings in the terminal excerpts are from that one run, and the page names the date, versions and machine. It gives no other timings.
Site:
pnpm docs:checkpassed (20 pages, 471 links).pnpm site:buildpassed. I servedsite/dist/clientunder/vite-plugin-ngp/on port 4336 and looked at the page at 1280 and 390 px, in light and dark. The sidebar entry sits under Guide, and nothing scrolls sideways at 390 px. Wide terminal lines scroll inside their code block.Not done
🤖 Generated with Claude Code