Skip to content

Commit c42e1f2

Browse files
committed
chore: @npmcli/[email protected]
BREAKING CHANGE: this drops support for node 10 and non-LTS versions of node 12 and node 14
1 parent 702b7df commit c42e1f2

17 files changed

+2031
-1382
lines changed

.commitlintrc.js

+11
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
// This file is automatically added by @npmcli/template-oss. Do not edit.
2+
3+
module.exports = {
4+
extends: ['@commitlint/config-conventional'],
5+
// If you change rules be sure to also update release-please.yml
6+
rules: {
7+
'type-enum': [2, 'always', ['feat', 'fix', 'docs', 'chore', 'deps']],
8+
'header-max-length': [2, 'always', 80],
9+
'subject-case': [0, 'always', ['lower-case', 'sentence-case', 'start-case']],
10+
},
11+
}

.eslintrc.js

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

.github/CODEOWNERS

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
* @npm/cli-team

.github/ISSUE_TEMPLATE/bug.yml

+54
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
# This file is automatically added by @npmcli/template-oss. Do not edit.
2+
3+
name: Bug
4+
description: File a bug/issue
5+
title: "[BUG] <title>"
6+
labels: [Bug, Needs Triage]
7+
body:
8+
- type: checkboxes
9+
attributes:
10+
label: Is there an existing issue for this?
11+
description: Please [search here](./issues) to see if an issue already exists for your problem.
12+
options:
13+
- label: I have searched the existing issues
14+
required: true
15+
- type: textarea
16+
attributes:
17+
label: Current Behavior
18+
description: A clear & concise description of what you're experiencing.
19+
validations:
20+
required: false
21+
- type: textarea
22+
attributes:
23+
label: Expected Behavior
24+
description: A clear & concise description of what you expected to happen.
25+
validations:
26+
required: false
27+
- type: textarea
28+
attributes:
29+
label: Steps To Reproduce
30+
description: Steps to reproduce the behavior.
31+
value: |
32+
1. In this environment...
33+
2. With this config...
34+
3. Run '...'
35+
4. See error...
36+
validations:
37+
required: false
38+
- type: textarea
39+
attributes:
40+
label: Environment
41+
description: |
42+
examples:
43+
- **npm**: 7.6.3
44+
- **Node**: 13.14.0
45+
- **OS**: Ubuntu 20.04
46+
- **platform**: Macbook Pro
47+
value: |
48+
- npm:
49+
- Node:
50+
- OS:
51+
- platform:
52+
validations:
53+
required: false
54+

.github/ISSUE_TEMPLATE/config.yml

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
# This file is automatically added by @npmcli/template-oss. Do not edit.
2+
3+
blank_issues_enabled: true

.github/dependabot.yml

+16
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
# This file is automatically added by @npmcli/template-oss. Do not edit.
2+
3+
version: 2
4+
updates:
5+
- package-ecosystem: npm
6+
directory: "/"
7+
schedule:
8+
interval: daily
9+
allow:
10+
- dependency-type: direct
11+
versioning-strategy: increase
12+
commit-message:
13+
prefix: deps
14+
prefix-development: chore
15+
labels:
16+
- "Dependencies"

.github/workflows/audit.yml

+23
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
# This file is automatically added by @npmcli/template-oss. Do not edit.
2+
3+
name: Audit
4+
5+
on:
6+
schedule:
7+
# "At 01:00 on Monday" https://crontab.guru/#0_1_*_*_1
8+
- cron: "0 1 * * 1"
9+
workflow_dispatch:
10+
11+
jobs:
12+
audit:
13+
name: npm audit
14+
runs-on: ubuntu-latest
15+
steps:
16+
- uses: actions/checkout@v2
17+
- uses: actions/setup-node@v2
18+
with:
19+
node-version: '16'
20+
- name: Install deps
21+
run: npm i --package-lock
22+
- name: Audit
23+
run: npm audit

.github/workflows/ci.yml

+55-15
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,62 @@
1+
# This file is automatically added by @npmcli/template-oss. Do not edit.
2+
13
name: CI
2-
on: [push, pull_request]
4+
5+
on:
6+
pull_request:
7+
push:
8+
branches:
9+
- main
10+
- latest
11+
schedule:
12+
# "At 02:00 on Monday" https://crontab.guru/#0_2_*_*_1
13+
- cron: "0 2 * * 1"
14+
315
jobs:
16+
lint:
17+
runs-on: ubuntu-latest
18+
steps:
19+
- uses: actions/checkout@v2
20+
- uses: actions/setup-node@v2
21+
with:
22+
node-version: '16'
23+
- run: npm i --prefer-online -g npm@latest
24+
- run: npm i
25+
- run: npm run lint
26+
427
test:
528
strategy:
629
fail-fast: false
730
matrix:
8-
node-version: ['10.1', 10.x, '12.1', 12.x, '14.1', 14.x]
9-
10-
runs-on: ubuntu-latest
31+
node-version: [12.13.0, 12.x, 14.15.0, 14.x, 16.13.0, 16.x]
32+
platform:
33+
- os: ubuntu-latest
34+
shell: bash
35+
- os: macos-latest
36+
shell: bash
37+
- os: windows-latest
38+
shell: cmd
39+
runs-on: ${{ matrix.platform.os }}
40+
defaults:
41+
run:
42+
shell: ${{ matrix.platform.shell }}
1143
steps:
12-
- uses: actions/checkout@v2
13-
- name: Use Node.js ${{ matrix.node-version }}
14-
uses: actions/setup-node@v2
15-
with:
16-
node-version: ${{ matrix.node-version }}
17-
- name: Update npm
18-
run: npm i -g npm@7
19-
- name: Install dependencies
20-
run: npm ci
21-
- name: Run Tap tests
22-
run: npm test
44+
- uses: actions/checkout@v2
45+
- uses: actions/setup-node@v2
46+
with:
47+
node-version: ${{ matrix.node-version }}
48+
# node 12 and 14 ship with npm@6, which is known to fail when updating itself in windows
49+
- name: Update to workable npm (windows)
50+
if: matrix.platform.os == 'windows-latest' && (startsWith(matrix.node-version, '12') || startsWith(matrix.node-version, '14'))
51+
run: |
52+
curl -sO https://registry.npmjs.org/npm/-/npm-7.5.4.tgz
53+
tar xf npm-7.5.4.tgz
54+
cd package
55+
node lib/npm.js install --no-fund --no-audit -g ..\npm-7.5.4.tgz
56+
cd ..
57+
rmdir /s /q package
58+
- name: Update npm
59+
run: npm i --prefer-online --no-fund --no-audit -g npm@latest
60+
- run: npm -v
61+
- run: npm i
62+
- run: npm test --ignore-scripts

.github/workflows/codeql-analysis.yml

+38
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
# This file is automatically added by @npmcli/template-oss. Do not edit.
2+
3+
name: "CodeQL"
4+
5+
on:
6+
push:
7+
branches: [ main ]
8+
pull_request:
9+
# The branches below must be a subset of the branches above
10+
branches: [ main ]
11+
schedule:
12+
# "At 03:00 on Monday" https://crontab.guru/#0_3_*_*_1
13+
- cron: "0 3 * * 1"
14+
15+
jobs:
16+
analyze:
17+
name: Analyze
18+
runs-on: ubuntu-latest
19+
permissions:
20+
actions: read
21+
contents: read
22+
security-events: write
23+
24+
strategy:
25+
fail-fast: false
26+
matrix:
27+
language: [ 'javascript' ]
28+
29+
steps:
30+
- name: Checkout repository
31+
uses: actions/checkout@v2
32+
33+
- name: Initialize CodeQL
34+
uses: github/codeql-action/init@v1
35+
with:
36+
languages: ${{ matrix.language }}
37+
- name: Perform CodeQL Analysis
38+
uses: github/codeql-action/analyze@v1

.github/workflows/post-dependabot.yml

+35
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
# This file is automatically added by @npmcli/template-oss. Do not edit.
2+
3+
name: "Post Dependabot Actions"
4+
on: pull_request
5+
6+
# https://docs.github.com/en/rest/overview/permissions-required-for-github-apps
7+
permissions:
8+
contents: write
9+
10+
jobs:
11+
Install:
12+
runs-on: ubuntu-latest
13+
if: ${{ github.actor == 'dependabot[bot]' }}
14+
steps:
15+
- uses: actions/checkout@v2
16+
- uses: actions/setup-node@v2
17+
with:
18+
node-version: '16'
19+
- name: Dependabot metadata
20+
id: metadata
21+
uses: dependabot/[email protected]
22+
with:
23+
github-token: "${{ secrets.GITHUB_TOKEN }}"
24+
- name: npm install and commit
25+
if: ${{contains(steps.metadata.outputs.dependency-names, '@npmcli/template-oss')}}
26+
env:
27+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
28+
run: |
29+
git config --local user.email "[email protected]"
30+
git config --local user.name "npm cli ops bot"
31+
gh pr checkout ${{ github.event.pull_request.number }}
32+
npm install
33+
git add .
34+
git commit -am "chore: postinstall for dependabot template-oss PR"
35+
git push

.github/workflows/pull-request.yml

+27
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
# This file is automatically added by @npmcli/template-oss. Do not edit.
2+
3+
name: Pull Request Linting
4+
5+
on:
6+
pull_request:
7+
types: [opened, reopened, edited, synchronize]
8+
9+
jobs:
10+
check:
11+
name: Check PR Title or Commits
12+
runs-on: ubuntu-latest
13+
steps:
14+
- uses: actions/checkout@v2
15+
with:
16+
fetch-depth: 0
17+
- uses: actions/setup-node@v2
18+
with:
19+
node-version: '16'
20+
- name: Install deps
21+
run: |
22+
npm i -D @commitlint/cli @commitlint/config-conventional
23+
- name: Check commits OR PR title
24+
env:
25+
PR_TITLE: ${{ github.event.pull_request.title }}
26+
run: |
27+
npx commitlint -x @commitlint/config-conventional -V --from origin/main --to ${{ github.event.pull_request.head.sha }} || echo $PR_TITLE | npx commitlint -x @commitlint/config-conventional -V

.github/workflows/release-please.yml

+24
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
# This file is automatically added by @npmcli/template-oss. Do not edit.
2+
3+
name: Release Please
4+
5+
on:
6+
push:
7+
branches:
8+
- main
9+
10+
jobs:
11+
release-please:
12+
runs-on: ubuntu-latest
13+
steps:
14+
- uses: google-github-actions/release-please-action@v2
15+
id: release
16+
with:
17+
release-type: node
18+
# If you change changelog-types be sure to also update commitlintrc.js
19+
changelog-types: >
20+
[{"type":"feat","section":"Features","hidden":false},
21+
{"type":"fix","section":"Bug Fixes","hidden":false},
22+
{"type":"docs","section":"Documentation","hidden":false},
23+
{"type":"deps","section":"Dependencies","hidden":false},
24+
{"type":"chore","hidden":true}]

.gitignore

+23-5
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,23 @@
1-
*~
2-
.#
3-
node_modules
4-
.nyc_output
5-
coverage
1+
# This file is automatically added by @npmcli/template-oss. Do not edit.
2+
3+
# ignore everything in the root
4+
/*
5+
6+
# keep these
7+
!/.commitlintrc.js
8+
!/.npmrc
9+
!/.eslintrc*
10+
!/.github
11+
!**/.gitignore
12+
!/package.json
13+
!/docs
14+
!/bin
15+
!/lib
16+
!/map.js
17+
!/tap-snapshots
18+
!/test
19+
!/scripts
20+
!/README*
21+
!/LICENSE*
22+
!/SECURITY*
23+
!/CHANGELOG*

.npmrc

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
;This file is automatically added by @npmcli/template-oss. Do not edit.
2+
3+
package-lock=false

SECURITY.md

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
<!-- This file is automatically added by @npmcli/template-oss. Do not edit. -->
2+
3+
Please send vulnerability reports through [hackerone](https://hackerone.com/github).

0 commit comments

Comments
 (0)