Skip to content

Commit aac01b8

Browse files
committed
deps: @npmcli/template-oss@3.2.1
- `no-shadow` was disabled for the cli and arborist due to the amount of changes required. These should be fixed later. - Manually updated linting in the cli root to match closer to what template-oss does - Included docs to be managed with template-oss. This required adding an empty test for now, with the plan to add real tests later.
1 parent b48a2bf commit aac01b8

File tree

114 files changed

+2451
-4139
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

114 files changed

+2451
-4139
lines changed

.eslintrc.js

+13
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
const { readdirSync: readdir } = require('fs')
2+
3+
const localConfigs = readdir(__dirname)
4+
.filter((file) => file.startsWith('.eslintrc.local.'))
5+
.map((file) => `./${file}`)
6+
7+
module.exports = {
8+
root: true,
9+
extends: [
10+
'@npmcli',
11+
...localConfigs,
12+
],
13+
}

.eslintrc.json

-15
This file was deleted.

.eslintrc.local.json

+21
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
{
2+
"ignorePatterns": [
3+
"docs/",
4+
"workspaces/*"
5+
],
6+
"rules": {
7+
"no-shadow": "off",
8+
"no-console": "error"
9+
},
10+
"overrides": [{
11+
"files": [
12+
"scripts/**",
13+
"smoke-tests/**",
14+
"bin/**",
15+
"test/**"
16+
],
17+
"rules": {
18+
"no-console": "off"
19+
}
20+
}]
21+
}

.github/workflows/ci-docs.yml

+18-23
Original file line numberDiff line numberDiff line change
@@ -1,50 +1,45 @@
1-
name: Node CI docs
1+
name: CI - docs
22

33
on:
4+
workflow_dispatch:
45
pull_request:
5-
paths:
6-
- docs/**
76
branches:
87
- '*'
9-
push:
108
paths:
119
- docs/**
10+
push:
1211
branches:
13-
- release-next
12+
- main
1413
- latest
15-
workflow_dispatch:
14+
paths:
15+
- docs/**
16+
schedule:
17+
# "At 02:00 on Monday" https://crontab.guru/#0_2_*_*_1
18+
- cron: "0 2 * * 1"
1619

1720
jobs:
1821
lint:
1922
runs-on: ubuntu-latest
2023
steps:
21-
# Checkout the npm/cli repo
22-
- uses: actions/checkout@v2
23-
- name: Use Node.js 14.x
24-
uses: actions/setup-node@v2
24+
- uses: actions/checkout@v3
25+
- uses: actions/setup-node@v3
2526
with:
26-
node-version: 14.x
27-
cache: npm
28-
- name: Install dependencies
29-
run: |
27+
node-version: 16.x
28+
- run: |
3029
node ./bin/npm-cli.js install --ignore-scripts --no-audit
3130
node ./bin/npm-cli.js rebuild
32-
- name: Run linting
33-
run: node ./bin/npm-cli.js run lint -w docs
31+
- run: node ./bin/npm-cli.js run lint -w docs
3432
env:
3533
DEPLOY_VERSION: testing
3634

3735
check_docs:
3836
runs-on: ubuntu-latest
3937
steps:
40-
- uses: actions/checkout@v2
41-
- name: Use Node.js 14.x
42-
uses: actions/setup-node@v2
38+
- uses: actions/checkout@v3
39+
- uses: actions/setup-node@v3
4340
with:
44-
node-version: 14.x
45-
cache: npm
46-
- name: Install dependencies
47-
run: |
41+
node-version: 16.x
42+
- run: |
4843
node ./bin/npm-cli.js install --ignore-scripts --no-audit
4944
- name: Rebuild the docs
5045
run: make freshdocs

.github/workflows/ci-libnpmaccess.yml

+47-20
Original file line numberDiff line numberDiff line change
@@ -1,35 +1,53 @@
1-
name: Node Workspace CI libnpmaccess
1+
# This file is automatically added by @npmcli/template-oss. Do not edit.
2+
3+
name: CI - libnpmaccess
24

35
on:
6+
workflow_dispatch:
47
pull_request:
8+
branches:
9+
- '*'
510
paths:
611
- workspaces/libnpmaccess/**
712
push:
8-
paths:
9-
- workspaces/libnpmaccess/**
1013
branches:
11-
- release-next
14+
- main
1215
- latest
13-
workflow_dispatch:
16+
paths:
17+
- workspaces/libnpmaccess/**
18+
schedule:
19+
# "At 02:00 on Monday" https://crontab.guru/#0_2_*_*_1
20+
- cron: "0 2 * * 1"
1421

1522
jobs:
1623
lint:
1724
runs-on: ubuntu-latest
1825
steps:
19-
# Checkout the npm/cli repo
20-
- uses: actions/checkout@v2
21-
- uses: actions/setup-node@v2
26+
- uses: actions/checkout@v3
27+
- name: Setup git user
28+
run: |
29+
git config --global user.email "ops+npm-cli@npmjs.com"
30+
git config --global user.name "npm cli ops bot"
31+
- uses: actions/setup-node@v3
2232
with:
23-
node-version: '16'
24-
- run: npm i --prefer-online -g npm@latest
25-
- run: npm i
26-
- run: npm run lint -w workspaces/libnpmaccess
33+
node-version: 16.x
34+
- name: Update npm to latest
35+
run: npm i --prefer-online --no-fund --no-audit -g npm@latest
36+
- run: npm -v
37+
- run: npm i --ignore-scripts
38+
- run: npm run lint -w libnpmaccess
2739

2840
test:
2941
strategy:
3042
fail-fast: false
3143
matrix:
32-
node-version: [12.13.0, 12.x, 14.15.0, 14.x, 16.13.0, 16.x]
44+
node-version:
45+
- 12.13.0
46+
- 12.x
47+
- 14.15.0
48+
- 14.x
49+
- 16.0.0
50+
- 16.x
3351
platform:
3452
- os: ubuntu-latest
3553
shell: bash
@@ -42,22 +60,31 @@ jobs:
4260
run:
4361
shell: ${{ matrix.platform.shell }}
4462
steps:
45-
- uses: actions/checkout@v2
46-
- uses: actions/setup-node@v2
63+
- uses: actions/checkout@v3
64+
- name: Setup git user
65+
run: |
66+
git config --global user.email "ops+npm-cli@npmjs.com"
67+
git config --global user.name "npm cli ops bot"
68+
- uses: actions/setup-node@v3
4769
with:
4870
node-version: ${{ matrix.node-version }}
49-
# node 12 and 14 ship with npm@6, which is known to fail when updating itself in windows
5071
- name: Update to workable npm (windows)
51-
if: matrix.platform.os == 'windows-latest' && (startsWith(matrix.node-version, '12') || startsWith(matrix.node-version, '14'))
72+
# node 12 and 14 ship with npm@6, which is known to fail when updating itself in windows
73+
if: matrix.platform.os == 'windows-latest' && (startsWith(matrix.node-version, '12.') || startsWith(matrix.node-version, '14.'))
5274
run: |
5375
curl -sO https://registry.npmjs.org/npm/-/npm-7.5.4.tgz
5476
tar xf npm-7.5.4.tgz
5577
cd package
5678
node lib/npm.js install --no-fund --no-audit -g ..\npm-7.5.4.tgz
5779
cd ..
5880
rmdir /s /q package
59-
- name: Update npm
81+
- name: Update npm to 7
82+
# If we do test on npm 10 it needs npm7
83+
if: startsWith(matrix.node-version, '10.')
84+
run: npm i --prefer-online --no-fund --no-audit -g npm@7
85+
- name: Update npm to latest
86+
if: ${{ !startsWith(matrix.node-version, '10.') }}
6087
run: npm i --prefer-online --no-fund --no-audit -g npm@latest
6188
- run: npm -v
62-
- run: npm i
63-
- run: npm test --ignore-scripts -w workspaces/libnpmaccess
89+
- run: npm i --ignore-scripts
90+
- run: npm test --ignore-scripts -w libnpmaccess

.github/workflows/ci-libnpmdiff.yml

+47-20
Original file line numberDiff line numberDiff line change
@@ -1,35 +1,53 @@
1-
name: Node Workspace CI libnpmdiff
1+
# This file is automatically added by @npmcli/template-oss. Do not edit.
2+
3+
name: CI - libnpmdiff
24

35
on:
6+
workflow_dispatch:
47
pull_request:
8+
branches:
9+
- '*'
510
paths:
611
- workspaces/libnpmdiff/**
712
push:
8-
paths:
9-
- workspaces/libnpmdiff/**
1013
branches:
11-
- release-next
14+
- main
1215
- latest
13-
workflow_dispatch:
16+
paths:
17+
- workspaces/libnpmdiff/**
18+
schedule:
19+
# "At 02:00 on Monday" https://crontab.guru/#0_2_*_*_1
20+
- cron: "0 2 * * 1"
1421

1522
jobs:
1623
lint:
1724
runs-on: ubuntu-latest
1825
steps:
19-
# Checkout the npm/cli repo
20-
- uses: actions/checkout@v2
21-
- uses: actions/setup-node@v2
26+
- uses: actions/checkout@v3
27+
- name: Setup git user
28+
run: |
29+
git config --global user.email "ops+npm-cli@npmjs.com"
30+
git config --global user.name "npm cli ops bot"
31+
- uses: actions/setup-node@v3
2232
with:
23-
node-version: '16'
24-
- run: npm i --prefer-online -g npm@latest
25-
- run: npm i
26-
- run: npm run lint -w workspaces/libnpmdiff
33+
node-version: 16.x
34+
- name: Update npm to latest
35+
run: npm i --prefer-online --no-fund --no-audit -g npm@latest
36+
- run: npm -v
37+
- run: npm i --ignore-scripts
38+
- run: npm run lint -w libnpmdiff
2739

2840
test:
2941
strategy:
3042
fail-fast: false
3143
matrix:
32-
node-version: [12.13.0, 12.x, 14.15.0, 14.x, 16.13.0, 16.x]
44+
node-version:
45+
- 12.13.0
46+
- 12.x
47+
- 14.15.0
48+
- 14.x
49+
- 16.0.0
50+
- 16.x
3351
platform:
3452
- os: ubuntu-latest
3553
shell: bash
@@ -42,22 +60,31 @@ jobs:
4260
run:
4361
shell: ${{ matrix.platform.shell }}
4462
steps:
45-
- uses: actions/checkout@v2
46-
- uses: actions/setup-node@v2
63+
- uses: actions/checkout@v3
64+
- name: Setup git user
65+
run: |
66+
git config --global user.email "ops+npm-cli@npmjs.com"
67+
git config --global user.name "npm cli ops bot"
68+
- uses: actions/setup-node@v3
4769
with:
4870
node-version: ${{ matrix.node-version }}
49-
# node 12 and 14 ship with npm@6, which is known to fail when updating itself in windows
5071
- name: Update to workable npm (windows)
51-
if: matrix.platform.os == 'windows-latest' && (startsWith(matrix.node-version, '12') || startsWith(matrix.node-version, '14'))
72+
# node 12 and 14 ship with npm@6, which is known to fail when updating itself in windows
73+
if: matrix.platform.os == 'windows-latest' && (startsWith(matrix.node-version, '12.') || startsWith(matrix.node-version, '14.'))
5274
run: |
5375
curl -sO https://registry.npmjs.org/npm/-/npm-7.5.4.tgz
5476
tar xf npm-7.5.4.tgz
5577
cd package
5678
node lib/npm.js install --no-fund --no-audit -g ..\npm-7.5.4.tgz
5779
cd ..
5880
rmdir /s /q package
59-
- name: Update npm
81+
- name: Update npm to 7
82+
# If we do test on npm 10 it needs npm7
83+
if: startsWith(matrix.node-version, '10.')
84+
run: npm i --prefer-online --no-fund --no-audit -g npm@7
85+
- name: Update npm to latest
86+
if: ${{ !startsWith(matrix.node-version, '10.') }}
6087
run: npm i --prefer-online --no-fund --no-audit -g npm@latest
6188
- run: npm -v
62-
- run: npm i
63-
- run: npm test --ignore-scripts -w workspaces/libnpmdiff
89+
- run: npm i --ignore-scripts
90+
- run: npm test --ignore-scripts -w libnpmdiff

0 commit comments

Comments
 (0)