Skip to content

Commit 3fcf46c

Browse files
committed
feat: add npmSpec config item
1 parent 110b63a commit 3fcf46c

File tree

12 files changed

+33
-29
lines changed

12 files changed

+33
-29
lines changed

.github/workflows/audit.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,8 +27,8 @@ jobs:
2727
uses: actions/setup-node@v3
2828
with:
2929
node-version: 18.x
30-
- name: Install npm@latest
31-
run: npm i --prefer-online --no-fund --no-audit -g npm@latest
30+
- name: Install npm@8
31+
run: npm i --prefer-online --no-fund --no-audit -g npm@8
3232
- name: npm Version
3333
run: npm -v
3434
- name: Install Dependencies

.github/workflows/ci-release.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -82,8 +82,8 @@ jobs:
8282
uses: actions/setup-node@v3
8383
with:
8484
node-version: 18.x
85-
- name: Install npm@latest
86-
run: npm i --prefer-online --no-fund --no-audit -g npm@latest
85+
- name: Install npm@8
86+
run: npm i --prefer-online --no-fund --no-audit -g npm@8
8787
- name: npm Version
8888
run: npm -v
8989
- name: Install Dependencies
@@ -196,9 +196,9 @@ jobs:
196196
- name: Install npm@7
197197
if: startsWith(matrix.node-version, '10.')
198198
run: npm i --prefer-online --no-fund --no-audit -g npm@7
199-
- name: Install npm@latest
199+
- name: Install npm@8
200200
if: ${{ !startsWith(matrix.node-version, '10.') }}
201-
run: npm i --prefer-online --no-fund --no-audit -g npm@latest
201+
run: npm i --prefer-online --no-fund --no-audit -g npm@8
202202
- name: npm Version
203203
run: npm -v
204204
- name: Install Dependencies

.github/workflows/ci-test-workspace.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -36,8 +36,8 @@ jobs:
3636
uses: actions/setup-node@v3
3737
with:
3838
node-version: 18.x
39-
- name: Install npm@latest
40-
run: npm i --prefer-online --no-fund --no-audit -g npm@latest
39+
- name: Install npm@8
40+
run: npm i --prefer-online --no-fund --no-audit -g npm@8
4141
- name: npm Version
4242
run: npm -v
4343
- name: Install Dependencies
@@ -98,9 +98,9 @@ jobs:
9898
- name: Install npm@7
9999
if: startsWith(matrix.node-version, '10.')
100100
run: npm i --prefer-online --no-fund --no-audit -g npm@7
101-
- name: Install npm@latest
101+
- name: Install npm@8
102102
if: ${{ !startsWith(matrix.node-version, '10.') }}
103-
run: npm i --prefer-online --no-fund --no-audit -g npm@latest
103+
run: npm i --prefer-online --no-fund --no-audit -g npm@8
104104
- name: npm Version
105105
run: npm -v
106106
- name: Install Dependencies

.github/workflows/ci.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -36,8 +36,8 @@ jobs:
3636
uses: actions/setup-node@v3
3737
with:
3838
node-version: 18.x
39-
- name: Install npm@latest
40-
run: npm i --prefer-online --no-fund --no-audit -g npm@latest
39+
- name: Install npm@8
40+
run: npm i --prefer-online --no-fund --no-audit -g npm@8
4141
- name: npm Version
4242
run: npm -v
4343
- name: Install Dependencies
@@ -98,9 +98,9 @@ jobs:
9898
- name: Install npm@7
9999
if: startsWith(matrix.node-version, '10.')
100100
run: npm i --prefer-online --no-fund --no-audit -g npm@7
101-
- name: Install npm@latest
101+
- name: Install npm@8
102102
if: ${{ !startsWith(matrix.node-version, '10.') }}
103-
run: npm i --prefer-online --no-fund --no-audit -g npm@latest
103+
run: npm i --prefer-online --no-fund --no-audit -g npm@8
104104
- name: npm Version
105105
run: npm -v
106106
- name: Install Dependencies

.github/workflows/post-dependabot.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,8 +28,8 @@ jobs:
2828
uses: actions/setup-node@v3
2929
with:
3030
node-version: 18.x
31-
- name: Install npm@latest
32-
run: npm i --prefer-online --no-fund --no-audit -g npm@latest
31+
- name: Install npm@8
32+
run: npm i --prefer-online --no-fund --no-audit -g npm@8
3333
- name: npm Version
3434
run: npm -v
3535
- name: Install Dependencies

.github/workflows/pull-request.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,8 +31,8 @@ jobs:
3131
uses: actions/setup-node@v3
3232
with:
3333
node-version: 18.x
34-
- name: Install npm@latest
35-
run: npm i --prefer-online --no-fund --no-audit -g npm@latest
34+
- name: Install npm@8
35+
run: npm i --prefer-online --no-fund --no-audit -g npm@8
3636
- name: npm Version
3737
run: npm -v
3838
- name: Install Dependencies

.github/workflows/release.yml

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -42,8 +42,8 @@ jobs:
4242
uses: actions/setup-node@v3
4343
with:
4444
node-version: 18.x
45-
- name: Install npm@latest
46-
run: npm i --prefer-online --no-fund --no-audit -g npm@latest
45+
- name: Install npm@8
46+
run: npm i --prefer-online --no-fund --no-audit -g npm@8
4747
- name: npm Version
4848
run: npm -v
4949
- name: Install Dependencies
@@ -156,8 +156,8 @@ jobs:
156156
uses: actions/setup-node@v3
157157
with:
158158
node-version: 18.x
159-
- name: Install npm@latest
160-
run: npm i --prefer-online --no-fund --no-audit -g npm@latest
159+
- name: Install npm@8
160+
run: npm i --prefer-online --no-fund --no-audit -g npm@8
161161
- name: npm Version
162162
run: npm -v
163163
- name: Install Dependencies
@@ -286,8 +286,8 @@ jobs:
286286
uses: actions/setup-node@v3
287287
with:
288288
node-version: 18.x
289-
- name: Install npm@latest
290-
run: npm i --prefer-online --no-fund --no-audit -g npm@latest
289+
- name: Install npm@8
290+
run: npm i --prefer-online --no-fund --no-audit -g npm@8
291291
- name: npm Version
292292
run: npm -v
293293
- name: Install Dependencies

lib/content/_step-node.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,12 +20,12 @@
2020
- name: Install npm@7
2121
if: startsWith(matrix.node-version, '10.')
2222
run: npm i --prefer-online --no-fund --no-audit -g npm@7
23-
- name: Install npm@latest
23+
- name: Install npm@{{ npmSpec }}
2424
if: $\{{ !startsWith(matrix.node-version, '10.') }}
2525
{{else}}
26-
- name: Install npm@latest
26+
- name: Install npm@{{ npmSpec }}
2727
{{/if}}
28-
run: npm i --prefer-online --no-fund --no-audit -g npm@latest
28+
run: npm i --prefer-online --no-fund --no-audit -g npm@{{ npmSpec }}
2929
- name: npm Version
3030
run: npm -v
3131
{{/if}}

lib/content/index.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -152,6 +152,7 @@ module.exports = {
152152
lockfile: false,
153153
npm: 'npm',
154154
npx: 'npx',
155+
npmSpec: 'latest',
155156
dependabot: 'increase-if-necessary',
156157
unwantedPackages: [
157158
'eslint',

package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,8 @@
7676
"test-ignore": "^(workspace/test-workspace)/"
7777
},
7878
"templateOSS": {
79-
"//@npmcli/template-oss": "This file is partially managed by @npmcli/template-oss. Edits may be overwritten."
79+
"//@npmcli/template-oss": "This file is partially managed by @npmcli/template-oss. Edits may be overwritten.",
80+
"npmSpec": "8"
8081
},
8182
"engines": {
8283
"node": "^14.17.0 || ^16.13.0 || >=18.0.0"

0 commit comments

Comments
 (0)