Skip to content

Commit 838db41

Browse files
authored
chore: migrate core repo to pnpm (#705)
1 parent 1ed581a commit 838db41

31 files changed

Lines changed: 7512 additions & 12748 deletions

File tree

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
name: Setup .NET
2+
description: Setup .NET SDK
3+
4+
runs:
5+
using: composite
6+
steps:
7+
- uses: actions/setup-dotnet@v5
8+
with:
9+
dotnet-version: |
10+
8.0.x
11+
9.0.x
12+
10.0.x
Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
name: Setup JS
2+
description: Setup Node.js, pnpm, and install dependencies
3+
4+
inputs:
5+
working-directory:
6+
description: Directory to run pnpm install in
7+
required: false
8+
default: ${{ github.workspace }}
9+
skip-install:
10+
description: Skip running pnpm install
11+
required: false
12+
default: "false"
13+
runs:
14+
using: composite
15+
steps:
16+
- uses: actions/setup-node@v6
17+
with:
18+
node-version: 24.x
19+
registry-url: "https://registry.npmjs.org"
20+
21+
- name: Enable corepack
22+
shell: bash
23+
run: corepack enable
24+
25+
- name: Install dependencies
26+
if: inputs.skip-install != 'true'
27+
shell: bash
28+
working-directory: ${{ inputs.working-directory }}
29+
run: pnpm install --frozen-lockfile
30+
31+
- name: Set package versions
32+
if: env.COALESCE_VERSION != ''
33+
shell: bash
34+
run: pnpm -r exec sed -i "s/0.1.0-local/$COALESCE_VERSION/g" package.json

.github/workflows/copilot-setup-steps.yml

Lines changed: 4 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -27,16 +27,8 @@ jobs:
2727
- name: Checkout code
2828
uses: actions/checkout@v6
2929

30-
- name: Setup dotnet
31-
uses: actions/setup-dotnet@v5
32-
with:
33-
dotnet-version: |
34-
8.0.x
35-
9.0.x
36-
10.0.x
37-
38-
- name: Install JavaScript dependencies
39-
run: npm ci
30+
- uses: ./.github/actions/setup-dotnet
31+
- uses: ./.github/actions/setup-js
4032

4133
- name: Restore .NET packages
4234
run: dotnet restore
@@ -47,5 +39,5 @@ jobs:
4739
- name: Build coalesce-vue-vuetify3
4840
working-directory: src/coalesce-vue-vuetify3
4941
run: |
50-
npm run build-local-deps
51-
npm run build
42+
pnpm build-local-deps
43+
pnpm build

.github/workflows/part-build.yml

Lines changed: 34 additions & 78 deletions
Original file line numberDiff line numberDiff line change
@@ -16,14 +16,8 @@ jobs:
1616

1717
steps:
1818
- uses: actions/checkout@v6
19-
- name: Setup dotnet
20-
uses: actions/setup-dotnet@v5
21-
with:
22-
dotnet-version: |
23-
8.0.x
24-
9.0.x
25-
26-
- run: npm ci
19+
- uses: ./.github/actions/setup-dotnet
20+
- uses: ./.github/actions/setup-js
2721
- run: dotnet restore
2822
- run: dotnet build --no-restore --configuration Release /WarnAsError
2923
- run: dotnet test --no-build --configuration Release
@@ -44,17 +38,11 @@ jobs:
4438
steps:
4539
- uses: actions/checkout@v6
4640

47-
- uses: actions/setup-dotnet@v5
48-
with:
49-
dotnet-version: |
50-
8.0.x
51-
9.0.x
52-
53-
- run: npm ci
54-
working-directory: ${{ github.workspace }}
41+
- uses: ./.github/actions/setup-dotnet
42+
- uses: ./.github/actions/setup-js
5543

56-
- run: npm run coalesce
57-
- run: npm run build
44+
- run: pnpm coalesce
45+
- run: pnpm build
5846
- run: dotnet build --configuration Release
5947

6048
build-coalesce-vue:
@@ -69,29 +57,15 @@ jobs:
6957
steps:
7058
- uses: actions/checkout@v6
7159

72-
# setup-node and update npm are only here to preemptively test
73-
# the required install of npm@11 that's needed for OIDC npm publish
74-
- uses: actions/setup-node@v6
75-
with:
76-
node-version: 24.x
77-
registry-url: "https://registry.npmjs.org"
78-
79-
- name: Update npm
80-
run: npm install -g npm@latest
81-
82-
- run: npm ci
83-
working-directory: ${{ github.workspace }}
60+
- uses: ./.github/actions/setup-js
8461

85-
- run: npm run lint
62+
- run: pnpm lint
8663

87-
- name: npm run test
88-
run: npm run test -- --coverage --reporter=default --reporter=junit --outputFile coalesce-vue.results.xml
64+
- name: pnpm test
65+
run: pnpm test -- --coverage --reporter=default --reporter=junit --outputFile coalesce-vue.results.xml
8966

90-
- name: update version
91-
run: sed -i "s/0.1.0-local/$COALESCE_VERSION/g" package.json
92-
93-
- run: npm run build
94-
- run: npm pack
67+
- run: pnpm build
68+
- run: pnpm pack
9569

9670
- name: Upload Artifact
9771
uses: actions/upload-artifact@v7
@@ -111,17 +85,13 @@ jobs:
11185
steps:
11286
- uses: actions/checkout@v6
11387

114-
- run: npm ci
115-
working-directory: ${{ github.workspace }}
116-
117-
- name: npm run test
118-
run: npm run test
88+
- uses: ./.github/actions/setup-js
11989

120-
- name: update version
121-
run: sed -i "s/0.1.0-local/$COALESCE_VERSION/g" package.json
90+
- name: pnpm test
91+
run: pnpm test
12292

123-
- run: npm run build
124-
- run: npm pack
93+
- run: pnpm build
94+
- run: pnpm pack
12595

12696
- name: Upload Artifact
12797
uses: actions/upload-artifact@v7
@@ -141,22 +111,18 @@ jobs:
141111
steps:
142112
- uses: actions/checkout@v6
143113

144-
- run: npm ci
145-
working-directory: ${{ github.workspace }}
114+
- uses: ./.github/actions/setup-js
146115

147-
- name: npm run test
148-
run: npm run test
149-
150-
- name: update version
151-
run: sed -i "s/0.1.0-local/$COALESCE_VERSION/g" package.json
116+
- name: pnpm test
117+
run: pnpm test
152118

153119
- name: update template dependency versions
154120
shell: pwsh
155121
working-directory: ./templates/Coalesce.Vue.Template
156122
run: ./Update-CoalesceVersions.ps1 -Version $env:COALESCE_VERSION
157123

158-
- run: npm run build
159-
- run: npm pack
124+
- run: pnpm build
125+
- run: pnpm pack
160126

161127
- name: Upload Artifact
162128
uses: actions/upload-artifact@v7
@@ -176,22 +142,14 @@ jobs:
176142
steps:
177143
- uses: actions/checkout@v6
178144

179-
- uses: actions/setup-node@v6
180-
with:
181-
node-version: 24.x
145+
- uses: ./.github/actions/setup-js
182146

183-
- run: npm ci
184-
working-directory: ${{ github.workspace }}
147+
- run: pnpm build-local-deps # build coalesce-vue
148+
- run: pnpm build
149+
- run: pnpm lint
150+
- run: pnpm test
185151

186-
- run: npm run build-local-deps # build coalesce-vue
187-
- run: npm run build
188-
- run: npm run lint
189-
- run: npm run test
190-
191-
- name: update version
192-
run: sed -i "s/0.1.0-local/$COALESCE_VERSION/g" package.json
193-
194-
- run: npm pack
152+
- run: pnpm pack
195153

196154
- name: Upload Artifact
197155
uses: actions/upload-artifact@v7
@@ -212,11 +170,10 @@ jobs:
212170
# fetch all commits to get last updated time or other git log info
213171
fetch-depth: 0
214172

215-
- run: npm ci
216-
working-directory: ${{ github.workspace }}
173+
- uses: ./.github/actions/setup-js
217174

218175
- name: Build docs
219-
run: npm run build
176+
run: pnpm build
220177

221178
- name: Upload Artifact
222179
uses: actions/upload-artifact@v7
@@ -260,12 +217,11 @@ jobs:
260217
steps:
261218
- uses: actions/checkout@v6
262219

263-
- name: Setup dotnet
264-
uses: actions/setup-dotnet@v5
220+
- uses: ./.github/actions/setup-dotnet
221+
222+
- uses: ./.github/actions/setup-js
265223
with:
266-
dotnet-version: |
267-
8.0.x
268-
9.0.x
224+
skip-install: "true"
269225

270226
- name: Download Artifacts
271227
uses: actions/download-artifact@v8

.github/workflows/part-publish.yml

Lines changed: 6 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -22,32 +22,18 @@ jobs:
2222
id-token: write
2323

2424
steps:
25+
- uses: actions/checkout@v6
26+
2527
- name: Download all workflow run artifacts
2628
uses: actions/download-artifact@v8
2729

28-
- uses: actions/setup-node@v6
30+
- uses: ./.github/actions/setup-js
2931
with:
30-
node-version: 24.x
31-
registry-url: "https://registry.npmjs.org"
32-
33-
- name: Update npm
34-
run: npm install -g npm@latest
35-
36-
- name: npm publish coalesce-vue
37-
if: ${{ !inputs.skipNpm }}
38-
run: npm publish ./coalesce-vue/*.tgz --tag ${{ inputs.prereleaseSlug || 'latest' }} --access public
39-
40-
- name: npm publish coalesce-mcp
41-
if: ${{ !inputs.skipNpm }}
42-
run: npm publish ./coalesce-mcp/*.tgz --tag ${{ inputs.prereleaseSlug || 'latest' }} --access public
43-
44-
- name: npm publish coalesce-vue-vuetify
45-
if: ${{ !inputs.skipNpm }}
46-
run: for f in ./coalesce-vue-vuetify*/*.tgz; do npm publish $f --tag ${{ inputs.prereleaseSlug || 'latest' }} --access public; done
32+
skip-install: "true"
4733

48-
- name: npm publish eslint-plugin-coalesce
34+
- name: pnpm publish
4935
if: ${{ !inputs.skipNpm }}
50-
run: npm publish ./eslint-plugin-coalesce/*.tgz --tag ${{ inputs.prereleaseSlug || 'latest' }} --access public
36+
run: for f in ./**/*.tgz; do pnpm publish "$f" --tag ${{ inputs.prereleaseSlug || 'latest' }} --access public --no-git-checks; done
5137

5238
nuget:
5339
runs-on: ubuntu-latest

.github/workflows/part-template-build.yml

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -25,12 +25,7 @@ jobs:
2525
steps:
2626
- uses: actions/checkout@v6
2727

28-
- name: Setup dotnet
29-
uses: actions/setup-dotnet@v5
30-
with:
31-
dotnet-version: |
32-
8.0.x
33-
9.0.x
28+
- uses: ./.github/actions/setup-dotnet
3429

3530
- name: "Set dependency versions"
3631
if: success() && env.COALESCE_VERSION

.npmrc

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

AGENTS.md

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -25,25 +25,25 @@ After making changes, use these to validate changes:
2525
### Run builds
2626

2727
```bash
28-
npm ci
28+
pnpm install
2929
dotnet build
30-
cd src/coalesce-vue && npm run build
31-
cd ../coalesce-vue-vuetify3 && npm run build
32-
cd ../coalesce-mcp && npm run build
33-
cd ../eslint-plugin-coalesce && npm run build
30+
cd src/coalesce-vue && pnpm build
31+
cd ../coalesce-vue-vuetify3 && pnpm build
32+
cd ../coalesce-mcp && pnpm build
33+
cd ../eslint-plugin-coalesce && pnpm build
3434
```
3535

3636
### Run tests
3737

3838
```bash
3939
dotnet test
40-
cd src/coalesce-vue && npm test run
41-
cd ../coalesce-vue-vuetify3 && npm test run
42-
cd ../coalesce-mcp && npm test run
43-
cd ../eslint-plugin-coalesce && npm test run
40+
cd src/coalesce-vue && pnpm test run
41+
cd ../coalesce-vue-vuetify3 && pnpm test run
42+
cd ../coalesce-mcp && pnpm test run
43+
cd ../eslint-plugin-coalesce && pnpm test run
4444
```
4545

46-
Use `npm test run` for Vitest / JS tests - this will make the process exit when complete.
46+
Use `pnpm test run` for Vitest / JS tests - this will make the process exit when complete.
4747

4848
The .NET test projects use TUnit. To filter tests, pass `--treenode-filter` (run in the working directory of the specific test project):
4949

@@ -62,4 +62,4 @@ If you make changes to the template in the `templates` directory, validate the c
6262

6363
### Documentation
6464

65-
If the documentation was updated, run `npm run build` in the docs folder.
65+
If the documentation was updated, run `pnpm build` in the docs folder.

docs/package.json

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,15 +10,16 @@
1010
"dev": "vitepress dev",
1111
"build-only": "cspell \"**/*.md\" && vitepress build --outDir .vitepress/dist",
1212
"linkcheck": "node check-links.mjs",
13-
"build": "npm run build-only && npm run linkcheck"
13+
"build": "pnpm build-only && pnpm linkcheck"
1414
},
1515
"dependencies": {
1616
"shiki": "1.4.0"
1717
},
1818
"devDependencies": {
1919
"gray-matter": "^4.0.3",
20+
"oxc-minify": "^0.128.0",
2021
"serve-handler": "^6.1.6",
21-
"vitepress": "2.0.0-alpha.12",
22+
"vitepress": "2.0.0-alpha.17",
2223
"wait-on": "^8.0.4"
2324
}
2425
}

0 commit comments

Comments
 (0)