Skip to content
This repository was archived by the owner on Nov 4, 2022. It is now read-only.

Commit 0be4b76

Browse files
authored
deps: @npmcli/[email protected] (#13)
BREAKING CHANGE: this drops support for node 10 and non-LTS versions of node 12 and node 14
1 parent 9862715 commit 0be4b76

20 files changed

+571
-8283
lines changed

.commitlintrc.js

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

.eslintrc.js

+15
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
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+
root: true,
11+
extends: [
12+
'@npmcli',
13+
...localConfigs,
14+
],
15+
}

.github/CODEOWNERS

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

.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

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

.github/workflows/audit.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: Audit
4+
5+
on:
6+
workflow_dispatch:
7+
schedule:
8+
# "At 01:00 on Monday" https://crontab.guru/#0_1_*_*_1
9+
- cron: "0 1 * * 1"
10+
11+
jobs:
12+
audit:
13+
runs-on: ubuntu-latest
14+
steps:
15+
- uses: actions/checkout@v3
16+
- name: Setup git user
17+
run: |
18+
git config --global user.email "[email protected]"
19+
git config --global user.name "npm cli ops bot"
20+
- uses: actions/setup-node@v3
21+
with:
22+
node-version: 16.x
23+
- name: Update npm to latest
24+
run: npm i --prefer-online --no-fund --no-audit -g npm@latest
25+
- run: npm -v
26+
- run: npm i --ignore-scripts --package-lock
27+
- run: npm audit

.github/workflows/ci.yml

+76-74
Original file line numberDiff line numberDiff line change
@@ -1,84 +1,86 @@
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+
workflow_dispatch:
7+
pull_request:
8+
branches:
9+
- '*'
10+
push:
11+
branches:
12+
- main
13+
- latest
14+
schedule:
15+
# "At 02:00 on Monday" https://crontab.guru/#0_2_*_*_1
16+
- cron: "0 2 * * 1"
2017

2118
jobs:
22-
build:
19+
lint:
20+
runs-on: ubuntu-latest
21+
steps:
22+
- uses: actions/checkout@v3
23+
- name: Setup git user
24+
run: |
25+
git config --global user.email "[email protected]"
26+
git config --global user.name "npm cli ops bot"
27+
- uses: actions/setup-node@v3
28+
with:
29+
node-version: 16.x
30+
- name: Update npm to latest
31+
run: npm i --prefer-online --no-fund --no-audit -g npm@latest
32+
- run: npm -v
33+
- run: npm i --ignore-scripts
34+
- run: npm run lint
35+
36+
test:
2337
strategy:
2438
fail-fast: false
2539
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-
40+
node-version:
41+
- 12.13.0
42+
- 12.x
43+
- 14.15.0
44+
- 14.x
45+
- 16.0.0
46+
- 16.x
47+
platform:
48+
- os: ubuntu-latest
49+
shell: bash
50+
- os: macos-latest
51+
shell: bash
52+
- os: windows-latest
53+
shell: cmd
54+
runs-on: ${{ matrix.platform.os }}
55+
defaults:
56+
run:
57+
shell: ${{ matrix.platform.shell }}
3158
steps:
32-
# Checkout the repository
33-
- 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
59+
- uses: actions/checkout@v3
60+
- name: Setup git user
61+
run: |
62+
git config --global user.email "[email protected]"
63+
git config --global user.name "npm cli ops bot"
64+
- uses: actions/setup-node@v3
3765
with:
3866
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-
61-
- name: Run tests
67+
- name: Update to workable npm (windows)
68+
# node 12 and 14 ship with npm@6, which is known to fail when updating itself in windows
69+
if: matrix.platform.os == 'windows-latest' && (startsWith(matrix.node-version, '12.') || startsWith(matrix.node-version, '14.'))
6270
run: |
63-
git config --global user.email "[email protected]"
64-
git config --global user.name "Your Name"
65-
npm test -- --no-coverage --timeout 60
66-
67-
################################################################################
68-
# Run coverage check
69-
#
70-
# ASSUMPTIONS:
71-
# - The project has `tap` as a devDependency
72-
# - There is a script called "coverage" in the package.json
73-
#
74-
# Coverage should only be posted once, we are choosing the latest LTS of
75-
# node, and ubuntu as the matrix point to post coverage from. We limit
76-
# to the 'push' event so that coverage ins't posted twice from the
77-
# pull-request event, and push event (line 3).
78-
################################################################################
79-
- name: Run coverage report
80-
if: github.event_name == 'push' && matrix.node-version == '12.x' && matrix.os == 'ubuntu-latest'
81-
run: npm test
82-
env:
83-
# The environment variable name is leveraged by `tap`
84-
COVERALLS_REPO_TOKEN: ${{ secrets.COVERALLS_REPO_TOKEN }}
71+
curl -sO https://registry.npmjs.org/npm/-/npm-7.5.4.tgz
72+
tar xf npm-7.5.4.tgz
73+
cd package
74+
node lib/npm.js install --no-fund --no-audit -g ..\npm-7.5.4.tgz
75+
cd ..
76+
rmdir /s /q package
77+
- name: Update npm to 7
78+
# If we do test on npm 10 it needs npm7
79+
if: startsWith(matrix.node-version, '10.')
80+
run: npm i --prefer-online --no-fund --no-audit -g npm@7
81+
- name: Update npm to latest
82+
if: ${{ !startsWith(matrix.node-version, '10.') }}
83+
run: npm i --prefer-online --no-fund --no-audit -g npm@latest
84+
- run: npm -v
85+
- run: npm i --ignore-scripts
86+
- run: npm test --ignore-scripts

.github/workflows/codeql-analysis.yml

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

.github/workflows/post-dependabot.yml

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

0 commit comments

Comments
 (0)