diff --git a/.commitlintrc.js b/.commitlintrc.js
index cf8f3d7..5b0b1a5 100644
--- a/.commitlintrc.js
+++ b/.commitlintrc.js
@@ -1,10 +1,9 @@
-// This file is automatically added by @npmcli/template-oss. Do not edit.
+/* This file is automatically added by @npmcli/template-oss. Do not edit. */
module.exports = {
extends: ['@commitlint/config-conventional'],
- // If you change rules be sure to also update release-please.yml
rules: {
- 'type-enum': [2, 'always', ['feat', 'fix', 'docs', 'chore', 'deps']],
+ 'type-enum': [2, 'always', ['feat', 'fix', 'docs', 'deps', 'chore']],
'header-max-length': [2, 'always', 80],
'subject-case': [0, 'always', ['lower-case', 'sentence-case', 'start-case']],
},
diff --git a/.eslintrc.js b/.eslintrc.js
index 022767b..8204f23 100644
--- a/.eslintrc.js
+++ b/.eslintrc.js
@@ -1,4 +1,4 @@
-// This file is automatically added by @npmcli/template-oss. Do not edit.
+/* This file is automatically added by @npmcli/template-oss. Do not edit. */
const { readdirSync: readdir } = require('fs')
diff --git a/.github/CODEOWNERS b/.github/CODEOWNERS
index ef87431..2c54b0d 100644
--- a/.github/CODEOWNERS
+++ b/.github/CODEOWNERS
@@ -1 +1,3 @@
-* @npm/cli-team
+# This file is automatically added by @npmcli/template-oss. Do not edit.
+
+* @npm/cli-team
diff --git a/.github/ISSUE_TEMPLATE/bug.yml b/.github/ISSUE_TEMPLATE/bug.yml
index fa80b2d..d043192 100644
--- a/.github/ISSUE_TEMPLATE/bug.yml
+++ b/.github/ISSUE_TEMPLATE/bug.yml
@@ -3,52 +3,52 @@
name: Bug
description: File a bug/issue
title: "[BUG]
"
-labels: [Bug, Needs Triage]
+labels: [ Bug, Needs Triage ]
+
body:
-- type: checkboxes
- attributes:
- label: Is there an existing issue for this?
- description: Please [search here](./issues) to see if an issue already exists for your problem.
- options:
- - label: I have searched the existing issues
- required: true
-- type: textarea
- attributes:
- label: Current Behavior
- description: A clear & concise description of what you're experiencing.
- validations:
- required: false
-- type: textarea
- attributes:
- label: Expected Behavior
- description: A clear & concise description of what you expected to happen.
- validations:
- required: false
-- type: textarea
- attributes:
- label: Steps To Reproduce
- description: Steps to reproduce the behavior.
- value: |
- 1. In this environment...
- 2. With this config...
- 3. Run '...'
- 4. See error...
- validations:
- required: false
-- type: textarea
- attributes:
- label: Environment
- description: |
- examples:
- - **npm**: 7.6.3
- - **Node**: 13.14.0
- - **OS**: Ubuntu 20.04
- - **platform**: Macbook Pro
- value: |
+ - type: checkboxes
+ attributes:
+ label: Is there an existing issue for this?
+ description: Please [search here](./issues) to see if an issue already exists for your problem.
+ options:
+ - label: I have searched the existing issues
+ required: true
+ - type: textarea
+ attributes:
+ label: Current Behavior
+ description: A clear & concise description of what you're experiencing.
+ validations:
+ required: false
+ - type: textarea
+ attributes:
+ label: Expected Behavior
+ description: A clear & concise description of what you expected to happen.
+ validations:
+ required: false
+ - type: textarea
+ attributes:
+ label: Steps To Reproduce
+ description: Steps to reproduce the behavior.
+ value: |
+ 1. In this environment...
+ 2. With this config...
+ 3. Run '...'
+ 4. See error...
+ validations:
+ required: false
+ - type: textarea
+ attributes:
+ label: Environment
+ description: |
+ examples:
+ - **npm**: 7.6.3
+ - **Node**: 13.14.0
+ - **OS**: Ubuntu 20.04
+ - **platform**: Macbook Pro
+ value: |
- npm:
- Node:
- OS:
- platform:
- validations:
- required: false
-
+ validations:
+ required: false
diff --git a/.github/dependabot.yml b/.github/dependabot.yml
index 4c8e23f..96d8eaf 100644
--- a/.github/dependabot.yml
+++ b/.github/dependabot.yml
@@ -1,16 +1,17 @@
# This file is automatically added by @npmcli/template-oss. Do not edit.
version: 2
+
updates:
-- package-ecosystem: npm
- directory: "/"
- schedule:
- interval: daily
- allow:
- - dependency-type: direct
- versioning-strategy: increase
- commit-message:
- prefix: deps
- prefix-development: chore
- labels:
- - "Dependencies"
+ - package-ecosystem: npm
+ directory: "/"
+ schedule:
+ interval: daily
+ allow:
+ - dependency-type: direct
+ versioning-strategy: increase-if-necessary
+ commit-message:
+ prefix: deps
+ prefix-development: chore
+ labels:
+ - "Dependencies"
diff --git a/.github/workflows/audit.yml b/.github/workflows/audit.yml
index 5f07e04..549243a 100644
--- a/.github/workflows/audit.yml
+++ b/.github/workflows/audit.yml
@@ -3,21 +3,25 @@
name: Audit
on:
+ workflow_dispatch:
schedule:
# "At 01:00 on Monday" https://crontab.guru/#0_1_*_*_1
- cron: "0 1 * * 1"
- workflow_dispatch:
jobs:
audit:
- name: npm audit
runs-on: ubuntu-latest
steps:
- - uses: actions/checkout@v2
- - uses: actions/setup-node@v2
+ - uses: actions/checkout@v3
+ - name: Setup git user
+ run: |
+ git config --global user.email "ops+npm-cli@npmjs.com"
+ git config --global user.name "npm cli ops bot"
+ - uses: actions/setup-node@v3
with:
- node-version: '16'
- - name: Install deps
- run: npm i --package-lock
- - name: Audit
- run: npm audit
+ node-version: 16.x
+ - name: Update npm to latest
+ run: npm i --prefer-online --no-fund --no-audit -g npm@latest
+ - run: npm -v
+ - run: npm i --ignore-scripts --package-lock
+ - run: npm audit
diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml
index 175457e..8067c86 100644
--- a/.github/workflows/ci.yml
+++ b/.github/workflows/ci.yml
@@ -3,7 +3,10 @@
name: CI
on:
+ workflow_dispatch:
pull_request:
+ branches:
+ - '*'
push:
branches:
- main
@@ -16,38 +19,54 @@ jobs:
lint:
runs-on: ubuntu-latest
steps:
- - uses: actions/checkout@v2
- - uses: actions/setup-node@v2
+ - uses: actions/checkout@v3
+ - name: Setup git user
+ run: |
+ git config --global user.email "ops+npm-cli@npmjs.com"
+ git config --global user.name "npm cli ops bot"
+ - uses: actions/setup-node@v3
with:
- node-version: '16'
- - run: npm i --prefer-online -g npm@latest
- - run: npm i
+ node-version: 16.x
+ - name: Update npm to latest
+ run: npm i --prefer-online --no-fund --no-audit -g npm@latest
+ - run: npm -v
+ - run: npm i --ignore-scripts
- run: npm run lint
test:
strategy:
fail-fast: false
matrix:
- node-version: [12.13.0, 12.x, 14.15.0, 14.x, 16.13.0, 16.x]
+ node-version:
+ - 12.13.0
+ - 12.x
+ - 14.15.0
+ - 14.x
+ - 16.0.0
+ - 16.x
platform:
- - os: ubuntu-latest
- shell: bash
- - os: macos-latest
- shell: bash
- - os: windows-latest
- shell: cmd
+ - os: ubuntu-latest
+ shell: bash
+ - os: macos-latest
+ shell: bash
+ - os: windows-latest
+ shell: cmd
runs-on: ${{ matrix.platform.os }}
defaults:
run:
shell: ${{ matrix.platform.shell }}
steps:
- - uses: actions/checkout@v2
- - uses: actions/setup-node@v2
+ - uses: actions/checkout@v3
+ - name: Setup git user
+ run: |
+ git config --global user.email "ops+npm-cli@npmjs.com"
+ git config --global user.name "npm cli ops bot"
+ - uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node-version }}
- # node 12 and 14 ship with npm@6, which is known to fail when updating itself in windows
- name: Update to workable npm (windows)
- if: matrix.platform.os == 'windows-latest' && (startsWith(matrix.node-version, '12') || startsWith(matrix.node-version, '14'))
+ # node 12 and 14 ship with npm@6, which is known to fail when updating itself in windows
+ if: matrix.platform.os == 'windows-latest' && (startsWith(matrix.node-version, '12.') || startsWith(matrix.node-version, '14.'))
run: |
curl -sO https://registry.npmjs.org/npm/-/npm-7.5.4.tgz
tar xf npm-7.5.4.tgz
@@ -55,8 +74,13 @@ jobs:
node lib/npm.js install --no-fund --no-audit -g ..\npm-7.5.4.tgz
cd ..
rmdir /s /q package
- - name: Update npm
+ - name: Update npm to 7
+ # If we do test on npm 10 it needs npm7
+ if: startsWith(matrix.node-version, '10.')
+ run: npm i --prefer-online --no-fund --no-audit -g npm@7
+ - name: Update npm to latest
+ if: ${{ !startsWith(matrix.node-version, '10.') }}
run: npm i --prefer-online --no-fund --no-audit -g npm@latest
- run: npm -v
- - run: npm i
+ - run: npm i --ignore-scripts
- run: npm test --ignore-scripts
diff --git a/.github/workflows/codeql-analysis.yml b/.github/workflows/codeql-analysis.yml
index c7694c4..56cd7b9 100644
--- a/.github/workflows/codeql-analysis.yml
+++ b/.github/workflows/codeql-analysis.yml
@@ -4,10 +4,14 @@ name: "CodeQL"
on:
push:
- branches: [ main ]
+ branches:
+ - main
+ - latest
pull_request:
# The branches below must be a subset of the branches above
- branches: [ main ]
+ branches:
+ - main
+ - latest
schedule:
# "At 03:00 on Monday" https://crontab.guru/#0_3_*_*_1
- cron: "0 3 * * 1"
@@ -24,15 +28,17 @@ jobs:
strategy:
fail-fast: false
matrix:
- language: [ 'javascript' ]
+ language: [ javascript ]
steps:
- - name: Checkout repository
- uses: actions/checkout@v2
-
- - name: Initialize CodeQL
- uses: github/codeql-action/init@v1
- with:
- languages: ${{ matrix.language }}
- - name: Perform CodeQL Analysis
- uses: github/codeql-action/analyze@v1
+ - uses: actions/checkout@v3
+ - name: Setup git user
+ run: |
+ git config --global user.email "ops+npm-cli@npmjs.com"
+ git config --global user.name "npm cli ops bot"
+ - name: Initialize CodeQL
+ uses: github/codeql-action/init@v1
+ with:
+ languages: ${{ matrix.language }}
+ - name: Perform CodeQL Analysis
+ uses: github/codeql-action/analyze@v1
diff --git a/.github/workflows/post-dependabot.yml b/.github/workflows/post-dependabot.yml
index 3093c30..bae1d8d 100644
--- a/.github/workflows/post-dependabot.yml
+++ b/.github/workflows/post-dependabot.yml
@@ -1,35 +1,43 @@
# This file is automatically added by @npmcli/template-oss. Do not edit.
-name: "Post Dependabot Actions"
+name: Post Dependabot Actions
+
on: pull_request
# https://docs.github.com/en/rest/overview/permissions-required-for-github-apps
permissions:
+ actions: write
contents: write
jobs:
Install:
runs-on: ubuntu-latest
- if: ${{ github.actor == 'dependabot[bot]' }}
+ if: github.actor == 'dependabot[bot]'
steps:
- - uses: actions/checkout@v2
- - uses: actions/setup-node@v2
+ - uses: actions/checkout@v3
+ - name: Setup git user
+ run: |
+ git config --global user.email "ops+npm-cli@npmjs.com"
+ git config --global user.name "npm cli ops bot"
+ - uses: actions/setup-node@v3
with:
- node-version: '16'
+ node-version: 16.x
+ - name: Update npm to latest
+ run: npm i --prefer-online --no-fund --no-audit -g npm@latest
+ - run: npm -v
- name: Dependabot metadata
id: metadata
uses: dependabot/fetch-metadata@v1.1.1
with:
github-token: "${{ secrets.GITHUB_TOKEN }}"
- name: npm install and commit
- if: ${{contains(steps.metadata.outputs.dependency-names, '@npmcli/template-oss')}}
+ if: contains(steps.metadata.outputs.dependency-names, '@npmcli/template-oss')
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
- git config --local user.email "ops+npm-cli@npmjs.com"
- git config --local user.name "npm cli ops bot"
gh pr checkout ${{ github.event.pull_request.number }}
- npm install
+ npm install --ignore-scripts
+ npm run template-oss-apply
git add .
git commit -am "chore: postinstall for dependabot template-oss PR"
git push
diff --git a/.github/workflows/pull-request.yml b/.github/workflows/pull-request.yml
index 948960e..93a5c3c 100644
--- a/.github/workflows/pull-request.yml
+++ b/.github/workflows/pull-request.yml
@@ -4,24 +4,35 @@ name: Pull Request Linting
on:
pull_request:
- types: [opened, reopened, edited, synchronize]
+ types:
+ - opened
+ - reopened
+ - edited
+ - synchronize
jobs:
check:
name: Check PR Title or Commits
runs-on: ubuntu-latest
steps:
- - uses: actions/checkout@v2
+ - uses: actions/checkout@v3
with:
fetch-depth: 0
- - uses: actions/setup-node@v2
+ - name: Setup git user
+ run: |
+ git config --global user.email "ops+npm-cli@npmjs.com"
+ git config --global user.name "npm cli ops bot"
+ - uses: actions/setup-node@v3
with:
- node-version: '16'
+ node-version: 16.x
+ - name: Update npm to latest
+ run: npm i --prefer-online --no-fund --no-audit -g npm@latest
+ - run: npm -v
- name: Install deps
- run: |
- npm i -D @commitlint/cli @commitlint/config-conventional
+ run: npm i -D @commitlint/cli @commitlint/config-conventional
- name: Check commits OR PR title
env:
PR_TITLE: ${{ github.event.pull_request.title }}
run: |
- 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
+ npx --offline commitlint -V --from origin/main --to ${{ github.event.pull_request.head.sha }} \
+ || echo $PR_TITLE | npx --offline commitlint -V
diff --git a/.github/workflows/release-please.yml b/.github/workflows/release-please.yml
index c5a165f..ab3a910 100644
--- a/.github/workflows/release-please.yml
+++ b/.github/workflows/release-please.yml
@@ -6,19 +6,21 @@ on:
push:
branches:
- main
+ - latest
jobs:
release-please:
runs-on: ubuntu-latest
steps:
- - uses: google-github-actions/release-please-action@v2
+ - uses: google-github-actions/release-please-action@v3
id: release
with:
release-type: node
- # If you change changelog-types be sure to also update commitlintrc.js
changelog-types: >
- [{"type":"feat","section":"Features","hidden":false},
- {"type":"fix","section":"Bug Fixes","hidden":false},
- {"type":"docs","section":"Documentation","hidden":false},
- {"type":"deps","section":"Dependencies","hidden":false},
- {"type":"chore","hidden":true}]
+ [
+ {"type":"feat","section":"Features","hidden":false},
+ {"type":"fix","section":"Bug Fixes","hidden":false},
+ {"type":"docs","section":"Documentation","hidden":false},
+ {"type":"deps","section":"Dependencies","hidden":false},
+ {"type":"chore","hidden":true}
+ ]
diff --git a/.gitignore b/.gitignore
index 6ed44c7..bf011b1 100644
--- a/.gitignore
+++ b/.gitignore
@@ -4,20 +4,22 @@
/*
# keep these
-!/.commitlintrc.js
-!/.npmrc
-!/.eslintrc*
-!/.github
+!/.eslintrc.local.*
!**/.gitignore
-!/package.json
-!/docs
-!/bin
-!/lib
+!/docs/
+!/tap-snapshots/
+!/test/
!/map.js
-!/tap-snapshots
-!/test
-!/scripts
+!/scripts/
!/README*
!/LICENSE*
-!/SECURITY*
!/CHANGELOG*
+!/.commitlintrc.js
+!/.eslintrc.js
+!/.github/
+!/.gitignore
+!/.npmrc
+!/SECURITY.md
+!/bin/
+!/lib/
+!/package.json
diff --git a/.npmrc b/.npmrc
index 878b7dd..529f93e 100644
--- a/.npmrc
+++ b/.npmrc
@@ -1,3 +1,3 @@
-;This file is automatically added by @npmcli/template-oss. Do not edit.
+; This file is automatically added by @npmcli/template-oss. Do not edit.
package-lock=false
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 5b50746..caafbec 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -1,3 +1,5 @@
+# Changelog
+
### v6.0.0
* Drop support for node 10 and non-lts versions of 12 and 14
diff --git a/package.json b/package.json
index 7f0ada7..9d57dc2 100644
--- a/package.json
+++ b/package.json
@@ -9,22 +9,22 @@
},
"main": "lib/log.js",
"files": [
- "bin",
- "lib"
+ "bin/",
+ "lib/"
],
"scripts": {
"test": "tap",
"npmclilint": "npmcli-lint",
- "lint": "eslint '**/*.js'",
+ "lint": "eslint \"**/*.js\"",
"lintfix": "npm run lint -- --fix",
"posttest": "npm run lint",
"postsnap": "npm run lintfix --",
- "postlint": "npm-template-check",
+ "postlint": "template-oss-check",
"preversion": "npm test",
"postversion": "npm publish",
"prepublishOnly": "git push origin --follow-tags",
"snap": "tap",
- "template-copy": "npm-template-copy --force"
+ "template-oss-apply": "template-oss-apply --force"
},
"dependencies": {
"are-we-there-yet": "^3.0.0",
@@ -33,17 +33,19 @@
"set-blocking": "^2.0.0"
},
"devDependencies": {
- "@npmcli/template-oss": "^2.9.2",
+ "@npmcli/eslint-config": "^3.0.1",
+ "@npmcli/template-oss": "3.2.0",
"tap": "^15.1.6"
},
"license": "ISC",
"engines": {
- "node": "^12.13.0 || ^14.15.0 || >=16"
+ "node": "^12.13.0 || ^14.15.0 || >=16.0.0"
},
"tap": {
"branches": 95
},
"templateOSS": {
- "version": "2.9.2"
+ "//@npmcli/template-oss": "This file is partially managed by @npmcli/template-oss. Edits may be overwritten.",
+ "version": "3.2.0"
}
}