Getting started
Scripts
Every npm script in package.json and the quality gates to run before you ship.
Development and build
Script | What it does |
|---|---|
npm run dev | Starts the development server with hot reload on port 3000. |
npm run build | Builds the server-rendered app into .output/. |
npm run preview | Serves the production build locally so you can test it. |
npm run generate | Pre-renders every route into static HTML in .output/public/. |
npm run postinstall | Runs nuxt prepare to generate types. npm runs it after npm install. |
Quality gates
Run these before every release. The project passes all of them out of the box.
Script | What it checks |
|---|---|
npm run lint | ESLint with the Nuxt and Vue rules, Prettier compatibility and @intlify/vue-i18n/no-missing-keys, which fails when a $t() key is missing from locales/. |
npm run lint:fix | Fixes what ESLint can fix on its own. |
npm run typecheck | Runs vue-tsc over the whole project through nuxt typecheck. |
npm run test | Runs the Vitest tests: the unit tests in tests/unit/ and the component, composable and store tests in tests/nuxt/. |
npm run test:coverage | Runs the same tests with a V8 coverage report (HTML in coverage/). |
npm run test:e2e | Builds the app and runs the Playwright tests in tests/e2e/ against the production server. |
npm run format | Formats every file with Prettier. |
npm run format:check | Fails if a file is not formatted. Useful in CI. |
End-to-end tests
Playwright starts node .output/server/index.mjs on port 4173 and uses the Chrome installed on your machine. Two variables change that:
Variable | Default | Use it to |
|---|---|---|
E2E_PORT | 4173 | Run the tests on another port. |
E2E_BROWSER_CHANNEL | chrome | Use another browser channel, such as msedge or chromium after npx playwright install chromium. |
Helpers
Script | What it does |
|---|---|
npm run icons:sync | Scans the source for Lucide icon names and rewrites config/lucide-icons.ts, so only the icons you use are bundled. It runs on its own when npm run dev starts and before build and generate. |
npm run fonts:sync | Writes the --v-font-* variables of BRAND_FONTS (config/brand.config.ts) and the fallback @font-face of the body and heading fonts in assets/styles/_typography.scss, so the text does not shift when the font loads. It runs on its own when npm run dev starts and only writes when something changed. Fonts outside the metrics database are read from their file in public/ or assets/. |
npm run brand:icons | Regenerates public/favicon.svg, favicon.ico and apple-touch-icon.png from assets/logo/mark.svg with the colours of LOGO_COLORS. Run it after changing the logo. It renders with Playwright; E2E_BROWSER_CHANNEL picks an installed browser, and --out <dir> writes elsewhere to preview. |
npm run quality:sync | Counts the unit tests (Vitest) and the end-to-end tests (Playwright) and writes them to quality in content/template/shared.ts, with the number of English docs pages in counts.docsPages: the figures shown on the sales page. It runs on its own before build and generate and keeps the old figures if it cannot count. The starter removes it. |
npm run starter -- <folder> | Creates a clean copy of the project without the demos. See Starter kit. |
npm run screenshots | Captures the screenshots used by the template landing page. It needs npm run dev running. |
Documentation
Script | What it does |
|---|---|
npm run docs:dev | Starts this documentation on port 3100. |
npm run docs:build | Builds the documentation into docs-site/.output/. |
npm run docs:generate | Pre-renders the documentation as a static site. |
npm run docs:preview | Serves the documentation build locally. |
npm run docs:typecheck | Type checks the documentation app. |