Skip to content

Commit 1d4cc20

Browse files
committed
template: use pnpm instead of npm
1 parent 838db41 commit 1d4cc20

16 files changed

Lines changed: 3863 additions & 6014 deletions

File tree

.github/workflows/part-build.yml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -223,6 +223,14 @@ jobs:
223223
with:
224224
skip-install: "true"
225225

226+
- name: Use Node.js
227+
uses: actions/setup-node@v6
228+
with:
229+
node-version: 24.x
230+
231+
- name: Install pnpm
232+
run: npm install -g pnpm@11
233+
226234
- name: Download Artifacts
227235
uses: actions/download-artifact@v8
228236
with:

CHANGELOG.md

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,12 +7,21 @@
77
- `UseViteDevelopmentServer` now exposes a `PackageManagerCommand` option (defaults to "npm") to configure which package manager runs the dev script. Improved error messages when the configured package manager is not installed.
88
- Fix: `no-sort-in-computed` eslint rule false positive when sorting a locally-declared array variable inside `computed()`.
99
- Fix: Handle the possibility that Audit logging's `AuditInterceptor` can end up singleton under specific EF usage patterns (e.g. `AddDbContextFactory` + not using `OnConfiguring`).
10+
- Re-exported `isAxiosError` from `coalesce-vue` to avoid phantom dependency on `axios`.
1011

1112
## Template Changes
1213
- Added Vuetify 4 CSS layer ordering to `index.html` to work around Vite 8/Rolldown CSS ordering bugs.
13-
- Replaced deprecated `typeface-roboto` with `@fontsource/roboto/latin.css` and `@fontsource/roboto/latin-italic.css`.
14+
- Replaced deprecated `typeface-roboto` package with `@fontsource/roboto/latin.css` and `@fontsource/roboto/latin-italic.css`.
15+
- The template now uses pnpm instead of npm for better DX. To migrate an existing project:
16+
1. Install pnpm: `npm install -g pnpm@11`
17+
2. Delete `package-lock.json` and `node_modules`.
18+
3. Run `pnpm install` to generate `pnpm-lock.yaml`.
19+
4. In `package.json`, change the `"dev"` script to `"pnpm install && vite"`.
20+
5. In `Program.cs`, add `c.PackageManagerCommand = "pnpm";` to `UseViteDevelopmentServer` options.
21+
6. Add any phantom dependencies that pnpm's strict `node_modules` structure reveals (e.g. `date-fns`, `date-fns-tz`). Build errors or runtime import failures will indicate which ones are missing.
22+
7. Update CI/CD scripts to use `pnpm` instead of `npm`, ensuring to add a step to install `pnpm` itself. Replace `npm ci` with `pnpm install --frozen-lockfile`.
1423
- The first-party password/passkey login flow is now two-stage: enter username first, then choose between password, passkey, or a one-time email code. When `Passkeys` is enabled, users who sign in with password or email code are then prompted to create a passkey.
15-
- `Role.Permissions` are no longer EF-mapped as enums. The EF property is now `List<string>`, with a `[NotMapped]` `PermissionEnums` wrapper that silently drops unrecognized values. This prevents `InvalidOperationException` when a `Permission` enum member is removed but old values remain in the database.
24+
- `Role.Permissions` are no longer EF-mapped as enums. The EF property is now `List<string>`, with a `[NotMapped] PermissionEnums` wrapper that drops unrecognized values. This prevents `InvalidOperationException` when a `Permission` enum member is removed but old values remain in the database.
1625
- Added rate limiting to authentication pages (sign-in, register, forgot password, reset password, email confirmation, external login) to mitigate brute-force abuse.
1726

1827
# 6.4.0

docs/stacks/vue/getting-started.md

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ Before you begin, ensure that you have all the required tools installed:
66

77
- Recent version of the [.NET SDK](https://dotnet.microsoft.com/en-us/download). If you have Visual Studio, you already have this.
88
- A recent version of [Node.js](https://nodejs.org/) (an LTS version is recommended).
9+
- [pnpm](https://pnpm.io/) - install with `npm install -g pnpm@11`
910
- A compatible IDE
1011
- Recommended:
1112
- Visual Studio for backend (C#) development
@@ -58,8 +59,8 @@ font-weight: 600;
5859
dotnet new install IntelliTect.Coalesce.Vue.Template
5960
dotnet new coalescevue -n {{effectiveNamespace}} -o {{effectiveFolder}} {{templateParams}}
6061
cd {{effectiveFolder}}/*.Web
61-
npm i --min-release-age=0
62-
npm run lint:fix
62+
pnpm install
63+
pnpm lint:fix
6364
dotnet restore
6465
dotnet coalesce
6566
@@ -98,7 +99,7 @@ The structure of the Web project follows the conventions of both ASP.NET Core an
9899
The frontend build system uses [Vite](https://vitejs.dev/). You are strongly encouraged to read through at least the first few pages of the [Vite Documentation](https://vitejs.dev/guide/) before getting started on any development.
99100
:::
100101

101-
During development, no special effort is required to build your frontend code. Coalesce's `UseViteDevelopmentServer` in ASP.NET Core will take care of that automatically when the application starts. Just make sure NPM packages have been installed (`npm ci`). For more details on how the Vite integration works, see [Vite Integration](/topics/vite-integration.md).
102+
During development, no special effort is required to build your frontend code. Coalesce's `UseViteDevelopmentServer` in ASP.NET Core will take care of that automatically when the application starts. Package install is automatic via the `dev` script in `package.json`. For more details on how the Vite integration works, see [Vite Integration](/topics/vite-integration.md).
102103
103104
@[import-md "after":"MARKER:data-modeling", "before":"MARKER:data-modeling-end"](../agnostic/getting-started-modeling.md)
104105

src/coalesce-mcp/src/tools/upgrade-prompt.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -306,6 +306,7 @@ Use \`read_template_file\` to read the template versions of these files, then co
306306
- **vite.config.ts** — New plugins, build config changes, code splitting strategy
307307
- **eslint.config.mjs** — New rules, plugin changes. If the user is still on \`.eslintrc\`, suggest migrating to flat config.
308308
- **tsconfig.json**, **tsconfig.node.json**
309+
- **pnpm-workspace.yaml** — overrides, allowBuilds, and other pnpm settings (if using or switching to pnpm)
309310
- **.npmrc**
310311
- **.editorconfig**
311312
- **.vscode/settings.json**

templates/Coalesce.Vue.Template/TestLocal.ps1

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -37,10 +37,10 @@ Push-Location $outDir/*.Web
3737
try {
3838
dotnet restore
3939
dotnet coalesce
40-
npm i
40+
pnpm install
4141
npx tsc -p ./tsconfig.node.json
42-
npm run build
43-
npm run lint:fix # ensure all lint issues are auto-fixable
42+
pnpm build
43+
pnpm lint:fix # ensure all lint issues are auto-fixable
4444
# CS9113: Parameter '<param>' is unread. (too annoying to fix this for every possible combination of template params)
4545
dotnet build .. /nowarn:CS9113
4646

templates/Coalesce.Vue.Template/content/.github/workflows/build-test-and-deploy.yml

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -49,8 +49,11 @@ jobs:
4949
with:
5050
node-version: 24.x
5151

52-
- name: npm ci
53-
run: npm ci
52+
- name: Install pnpm
53+
run: npm install -g pnpm@11
54+
55+
- name: pnpm install
56+
run: pnpm install --frozen-lockfile
5457
working-directory: Coalesce.Starter.Vue.Web
5558

5659
- name: Restore Nuget packages
@@ -60,12 +63,12 @@ jobs:
6063
run: dotnet coalesce --what-if --verify
6164
working-directory: Coalesce.Starter.Vue.Web
6265

63-
- name: npm run lint
64-
run: npm run lint
66+
- name: pnpm lint
67+
run: pnpm lint
6568
working-directory: Coalesce.Starter.Vue.Web
6669

67-
- name: npm run build
68-
run: npm run build
70+
- name: pnpm build
71+
run: pnpm build
6972
working-directory: Coalesce.Starter.Vue.Web
7073

7174
- name: dotnet build

templates/Coalesce.Vue.Template/content/.template.config/template.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -308,6 +308,7 @@
308308
"**/*.g.ts",
309309
"**/*.lock.json",
310310
"**/package-lock.json",
311+
"**/pnpm-lock.yaml",
311312
"**/DEVELOPMENT.md"
312313
]
313314
},

templates/Coalesce.Vue.Template/content/.vscode/settings.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
"xml.format.maxLineWidth": 0,
1313
"chat.tools.terminal.autoApprove": {
1414
"dotnet test": true,
15-
"npm test": true,
15+
"pnpm test": true,
1616
"dotnet tool restore": true,
1717
"dotnet restore": true,
1818
"dotnet build": true

templates/Coalesce.Vue.Template/content/AGENTS.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,13 +10,13 @@ An `IntelliTect Coalesce`–based project. Projects:
1010
- Data: EF Core entity models, services, business logic, etc
1111
- Data.Test: TUnit automated tests for the Data project.
1212
- Migrations: EF Core Migrations assembly. Create and manage migrations here, e.g. `dotnet ef migrations add MigrationName`. Run `dotnet ef` in this project's working directory, don't pass extra args like startup-project to `dotnet ef` calls.
13-
- Web: ASP.NET Core server. Serves both API endpoints and frontend Vue assets. Automatically launches Vite dev server - don't do `npm run dev` manually.
13+
- Web: ASP.NET Core server. Serves both API endpoints and frontend Vue assets. Automatically launches Vite dev server - don't do `pnpm dev` manually.
1414
- Web/src: Vite, Vue 3, Vuetify 4, and Coalesce for data binding and API access.
1515

1616
- Coalesce generates DTOs, controllers, and TypeScript from your models. After making changes to your models, invoke code generation with the `coalesce_generate` tool. The `coalesce.json` file is in the workspace root.
17-
- If you run tests with `npm test`, pass `--run` to avoid running in interactive mode. E.g. `npm test -- --run`.
17+
- If you run tests with `pnpm test`, pass `--run` to avoid running in interactive mode. E.g. `pnpm test --run`.
1818
- In Vue files, you don't need to add import statements for components nor composables from `vue`, `vue-router`, or those defined by the project's source code - they will be auto-imported by Vite.
19-
- Do not run `npm run build` to validate changes unless the user asks because this ruins HMR if the app is running. Instead, validate frontend changes by checking for problems with `read/problems`.
19+
- Do not run `pnpm build` to validate changes unless the user asks because this ruins HMR if the app is running. Instead, validate frontend changes by checking for problems with `read/problems`.
2020
- Use SCSS for all styles - `lang="scss"` in .vue files.
2121
- Use `date-fns` for date manipulation and formatting, or `.$display(propName)` on Coalesce ViewModel instances, or `c-display` in Vue templates.
2222

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +0,0 @@
1-
min-release-age=2
2-
ignore-scripts=true
3-
fund=false

0 commit comments

Comments
 (0)