Skip to content

Commit 73e6f4f

Browse files
committed
deps: @npmcli/template-oss@2.7.1
BREAKING CHANGE: This drops support for node 10 and non-LTS versions of node 12 and node 14
1 parent 2855aab commit 73e6f4f

17 files changed

+2292
-1019
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

+52-84
Original file line numberDiff line numberDiff line change
@@ -1,94 +1,62 @@
1-
---
2-
################################################################################
3-
# Template - Node CI
4-
#
5-
# Description:
6-
# This contains the basic information to: install dependencies, run tests,
7-
# get coverage, and run linting on a nodejs project. This template will run
8-
# over the MxN matrix of all operating systems, and all current LTS versions
9-
# of NodeJS.
10-
#
11-
# Dependencies:
12-
# This template assumes that your project is using the `tap` module for
13-
# testing. If you're not using this module, then the step that runs your
14-
# coverage will need to be adjusted.
15-
#
16-
################################################################################
17-
name: Node CI
1+
# This file is automatically added by @npmcli/template-oss. Do not edit.
182

19-
on: [push, pull_request]
3+
name: CI
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"
2014

2115
jobs:
22-
build:
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+
27+
test:
2328
strategy:
2429
fail-fast: false
2530
matrix:
26-
node-version: [10.x, 12.x, 13.x]
27-
os: [ubuntu-latest, windows-latest, macOS-latest]
28-
29-
runs-on: ${{ matrix.os }}
30-
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 }}
3143
steps:
32-
# Checkout the repository
3344
- uses: actions/checkout@v2
34-
# Installs the specific version of Node.js
35-
- name: Use Node.js ${{ matrix.node-version }}
36-
uses: actions/setup-node@v1
45+
- uses: actions/setup-node@v2
3746
with:
3847
node-version: ${{ matrix.node-version }}
39-
40-
################################################################################
41-
# Install Dependencies
42-
#
43-
# ASSUMPTIONS:
44-
# - The project has a package-lock.json file
45-
#
46-
# Simply run the tests for the project.
47-
################################################################################
48-
- name: Install dependencies
49-
run: npm ci
50-
51-
################################################################################
52-
# Run Testing
53-
#
54-
# ASSUMPTIONS:
55-
# - The project has `tap` as a devDependency
56-
# - There is a script called "test" in the package.json
57-
#
58-
# Simply run the tests for the project.
59-
################################################################################
60-
- name: Run tests
61-
run: npm test
62-
63-
################################################################################
64-
# Run coverage check
65-
#
66-
# ASSUMPTIONS:
67-
# - The project has `tap` as a devDependency
68-
# - There is a script called "coverage" in the package.json
69-
#
70-
# Coverage should only be posted once, we are choosing the latest LTS of
71-
# node, and ubuntu as the matrix point to post coverage from. We limit
72-
# to the 'push' event so that coverage ins't posted twice from the
73-
# pull-request event, and push event (line 3).
74-
################################################################################
75-
- name: Run coverage report
76-
if: github.event_name == 'push' && matrix.node-version == '12.x' && matrix.os == 'ubuntu-latest'
77-
run: npm run coverage
78-
env:
79-
# The environment variable name is leveraged by `tap`
80-
COVERALLS_REPO_TOKEN: ${{ secrets.COVERALLS_REPO_TOKEN }}
81-
82-
################################################################################
83-
# Run linting
84-
#
85-
# ASSUMPTIONS:
86-
# - There is a script called "lint" in the package.json
87-
#
88-
# We run linting AFTER we run testing and coverage checks, because if a step
89-
# fails in an GitHub Action, all other steps are not run. We don't want to
90-
# fail to run tests or coverage because of linting. It should be the lowest
91-
# priority of all the steps.
92-
################################################################################
93-
- name: Run linter
94-
run: npm run lint
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

+31
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
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+
jobs:
7+
Install:
8+
runs-on: ubuntu-latest
9+
if: ${{ github.actor == 'dependabot[bot]' }}
10+
steps:
11+
- uses: actions/checkout@v2
12+
- uses: actions/setup-node@v2
13+
with:
14+
node-version: '16'
15+
- name: Dependabot metadata
16+
id: metadata
17+
uses: dependabot/fetch-metadata@v1.1.1
18+
with:
19+
github-token: "${{ secrets.GITHUB_TOKEN }}"
20+
- name: npm install and commit
21+
if: ${{contains(steps.metadata.outputs.dependency-names, '@npmcli/template-oss')}}
22+
env:
23+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
24+
run: |
25+
git config --local user.email "ops+npm-cli@npmjs.com"
26+
git config --local user.name "npm cli ops bot"
27+
gh pr checkout ${{ github.event.pull_request.number }}
28+
npm install
29+
git add .
30+
git commit -am "chore: postinstall for dependabot template-oss PR"
31+
git push origin ${{github.ref_name}}

.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

0 commit comments

Comments
 (0)