-
Notifications
You must be signed in to change notification settings - Fork 9
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
chore(deps): update dependency semver to v7.7.1 #66
base: master
Are you sure you want to change the base?
Conversation
[puLL-Merge] - npm/[email protected] DescriptionThis PR introduces a series of changes aiming at improving the code quality, security, and maintainability of the ChangesChanges.eslintrc.js
.github/actions/create-check/action.yml (New File)
.github/actions/install-latest-npm/action.yml (New File)
.github/dependabot.yml
.github/settings.yml
GitHub Workflows (.github/workflows/*.yml)
.gitignore
.release-please-manifest.json
CHANGELOG.md
README.md
JavaScript Files (
|
5ec1e3f
to
134fddd
Compare
[puLL-Merge] - npm/[email protected] DescriptionThis PR updates the semver package to version 7.6.1. It includes bug fixes, dependency updates, and chore updates. ChangesChanges
Security HotspotsNone found. The changes look safe and do not introduce any obvious security vulnerabilities. Overall this is a solid maintenance release with useful improvements and fixes. The new features like supporting prerelease/build parts in Let me know if you have any other questions! The PR looks good to merge from my review. |
134fddd
to
7eb30fe
Compare
[puLL-Merge] - npm/[email protected] DescriptionThis PR updates the semver library to version 7.6.2. The main changes include:
The motivation appears to be fixing bugs, improving performance, and adding some new functionality while keeping the library up-to-date. ChangesChanges
Security HotspotsNone found. The changes appear to be safe bug fixes, refactorings and enhancements. Switching to a custom Let me know if you have any other questions! |
7eb30fe
to
dd958a7
Compare
[puLL-Merge] - npm/[email protected] DescriptionThis PR updates the ChangesChanges
Possible Issues
Security HotspotsNo significant security issues were identified in this PR. |
dd958a7
to
165e93d
Compare
[puLL-Merge] - npm/[email protected] Diffdiff --git .commitlintrc.js .commitlintrc.js
index 5b0b1a52..b706e527 100644
--- .commitlintrc.js
+++ .commitlintrc.js
@@ -5,6 +5,8 @@ module.exports = {
rules: {
'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']],
+ 'subject-case': [0],
+ 'body-max-line-length': [0],
+ 'footer-max-line-length': [0],
},
}
diff --git .eslintrc.js .eslintrc.js
index 5db9f815..f21d26ec 100644
--- .eslintrc.js
+++ .eslintrc.js
@@ -10,6 +10,9 @@ const localConfigs = readdir(__dirname)
module.exports = {
root: true,
+ ignorePatterns: [
+ 'tap-testdir*/',
+ ],
extends: [
'@npmcli',
...localConfigs,
diff --git a/.github/actions/create-check/action.yml b/.github/actions/create-check/action.yml
new file mode 100644
index 00000000..d1220c90
--- /dev/null
+++ .github/actions/create-check/action.yml
@@ -0,0 +1,52 @@
+# This file is automatically added by @npmcli/template-oss. Do not edit.
+
+name: 'Create Check'
+inputs:
+ name:
+ required: true
+ token:
+ required: true
+ sha:
+ required: true
+ check-name:
+ default: ''
+outputs:
+ check-id:
+ value: ${{ steps.create-check.outputs.check_id }}
+runs:
+ using: "composite"
+ steps:
+ - name: Get Workflow Job
+ uses: actions/github-script@v7
+ id: workflow
+ env:
+ JOB_NAME: "${{ inputs.name }}"
+ SHA: "${{ inputs.sha }}"
+ with:
+ result-encoding: string
+ script: |
+ const { repo: { owner, repo}, runId, serverUrl } = context
+ const { JOB_NAME, SHA } = process.env
+
+ const job = await github.rest.actions.listJobsForWorkflowRun({
+ owner,
+ repo,
+ run_id: runId,
+ per_page: 100
+ }).then(r => r.data.jobs.find(j => j.name.endsWith(JOB_NAME)))
+
+ return [
+ `This check is assosciated with ${serverUrl}/${owner}/${repo}/commit/${SHA}.`,
+ 'Run logs:',
+ job?.html_url || `could not be found for a job ending with: "${JOB_NAME}"`,
+ ].join(' ')
+ - name: Create Check
+ uses: LouisBrunner/[email protected]
+ id: create-check
+ with:
+ token: ${{ inputs.token }}
+ sha: ${{ inputs.sha }}
+ status: in_progress
+ name: ${{ inputs.check-name || inputs.name }}
+ output: |
+ {"summary":"${{ steps.workflow.outputs.result }}"}
diff --git a/.github/actions/install-latest-npm/action.yml b/.github/actions/install-latest-npm/action.yml
new file mode 100644
index 00000000..580603dd
--- /dev/null
+++ .github/actions/install-latest-npm/action.yml
@@ -0,0 +1,58 @@
+# This file is automatically added by @npmcli/template-oss. Do not edit.
+
+name: 'Install Latest npm'
+description: 'Install the latest version of npm compatible with the Node version'
+inputs:
+ node:
+ description: 'Current Node version'
+ required: true
+runs:
+ using: "composite"
+ steps:
+ # node 10/12/14 ship with npm@6, which is known to fail when updating itself in windows
+ - name: Update Windows npm
+ if: |
+ runner.os == 'Windows' && (
+ startsWith(inputs.node, 'v10.') ||
+ startsWith(inputs.node, 'v12.') ||
+ startsWith(inputs.node, 'v14.')
+ )
+ shell: cmd
+ run: |
+ curl -sO https://registry.npmjs.org/npm/-/npm-7.5.4.tgz
+ tar xf npm-7.5.4.tgz
+ cd package
+ node lib/npm.js install --no-fund --no-audit -g ..\npm-7.5.4.tgz
+ cd ..
+ rmdir /s /q package
+ - name: Install Latest npm
+ shell: bash
+ env:
+ NODE_VERSION: ${{ inputs.node }}
+ working-directory: ${{ runner.temp }}
+ run: |
+ MATCH=""
+ SPECS=("latest" "next-10" "next-9" "next-8" "next-7" "next-6")
+
+ echo "node@$NODE_VERSION"
+
+ for SPEC in ${SPECS[@]}; do
+ ENGINES=$(npm view npm@$SPEC --json | jq -r '.engines.node')
+ echo "Checking if node@$NODE_VERSION satisfies npm@$SPEC ($ENGINES)"
+
+ if npx semver -r "$ENGINES" "$NODE_VERSION" > /dev/null; then
+ MATCH=$SPEC
+ echo "Found compatible version: npm@$MATCH"
+ break
+ fi
+ done
+
+ if [ -z $MATCH ]; then
+ echo "Could not find a compatible version of npm for node@$NODE_VERSION"
+ exit 1
+ fi
+
+ npm i --prefer-online --no-fund --no-audit -g npm@$MATCH
+ - name: npm Version
+ shell: bash
+ run: npm -v
diff --git .github/dependabot.yml .github/dependabot.yml
index 8da2a452..d735ccf2 100644
--- .github/dependabot.yml
+++ .github/dependabot.yml
@@ -7,6 +7,7 @@ updates:
directory: /
schedule:
interval: daily
+ target-branch: "main"
allow:
- dependency-type: direct
versioning-strategy: increase-if-necessary
@@ -15,3 +16,38 @@ updates:
prefix-development: chore
labels:
- "Dependencies"
+ open-pull-requests-limit: 10
+ - package-ecosystem: npm
+ directory: /
+ schedule:
+ interval: daily
+ target-branch: "release/v5"
+ allow:
+ - dependency-type: direct
+ dependency-name: "@npmcli/template-oss"
+ versioning-strategy: increase-if-necessary
+ commit-message:
+ prefix: deps
+ prefix-development: chore
+ labels:
+ - "Dependencies"
+ - "Backport"
+ - "release/v5"
+ open-pull-requests-limit: 10
+ - package-ecosystem: npm
+ directory: /
+ schedule:
+ interval: daily
+ target-branch: "release/v6"
+ allow:
+ - dependency-type: direct
+ dependency-name: "@npmcli/template-oss"
+ versioning-strategy: increase-if-necessary
+ commit-message:
+ prefix: deps
+ prefix-development: chore
+ labels:
+ - "Dependencies"
+ - "Backport"
+ - "release/v6"
+ open-pull-requests-limit: 10
diff --git .github/settings.yml .github/settings.yml
index 107aa0ad..206b6eeb 100644
--- .github/settings.yml
+++ .github/settings.yml
@@ -15,6 +15,35 @@ branches:
protection:
required_status_checks: null
enforce_admins: true
+ block_creations: true
+ required_pull_request_reviews:
+ required_approving_review_count: 1
+ require_code_owner_reviews: true
+ require_last_push_approval: true
+ dismiss_stale_reviews: true
+ restrictions:
+ apps: []
+ users: []
+ teams: [ "cli-team" ]
+ - name: release/v5
+ protection:
+ required_status_checks: null
+ enforce_admins: true
+ block_creations: true
+ required_pull_request_reviews:
+ required_approving_review_count: 1
+ require_code_owner_reviews: true
+ require_last_push_approval: true
+ dismiss_stale_reviews: true
+ restrictions:
+ apps: []
+ users: []
+ teams: [ "cli-team" ]
+ - name: release/v6
+ protection:
+ required_status_checks: null
+ enforce_admins: true
+ block_creations: true
required_pull_request_reviews:
required_approving_review_count: 1
require_code_owner_reviews: true
diff --git .github/workflows/audit.yml .github/workflows/audit.yml
index 8b8f3748..a3ae7257 100644
--- .github/workflows/audit.yml
+++ .github/workflows/audit.yml
@@ -18,19 +18,21 @@ jobs:
shell: bash
steps:
- name: Checkout
- uses: actions/checkout@v3
+ uses: actions/checkout@v4
- name: Setup Git User
run: |
git config --global user.email "[email protected]"
git config --global user.name "npm CLI robot"
- name: Setup Node
- uses: actions/setup-node@v3
+ uses: actions/setup-node@v4
+ id: node
with:
- node-version: 18.x
- - name: Install npm@8
- run: npm i --prefer-online --no-fund --no-audit -g npm@8
- - name: npm Version
- run: npm -v
+ node-version: 22.x
+ check-latest: contains('22.x', '.x')
+ - name: Install Latest npm
+ uses: ./.github/actions/install-latest-npm
+ with:
+ node: ${{ steps.node.outputs.node-version }}
- name: Install Dependencies
run: npm i --ignore-scripts --no-audit --no-fund --package-lock
- name: Run Production Audit
diff --git .github/workflows/ci-release.yml .github/workflows/ci-release.yml
index 98b70866..f6ab948b 100644
--- .github/workflows/ci-release.yml
+++ .github/workflows/ci-release.yml
@@ -27,65 +27,32 @@ jobs:
run:
shell: bash
steps:
- - name: Get Workflow Job
- uses: actions/github-script@v6
- if: inputs.check-sha
- id: check-output
- env:
- JOB_NAME: "Lint All"
- MATRIX_NAME: ""
- with:
- script: |
- const { owner, repo } = context.repo
-
- const { data } = await github.rest.actions.listJobsForWorkflowRun({
- owner,
- repo,
- run_id: context.runId,
- per_page: 100
- })
-
- const jobName = process.env.JOB_NAME + process.env.MATRIX_NAME
- const job = data.jobs.find(j => j.name.endsWith(jobName))
- const jobUrl = job?.html_url
-
- const shaUrl = `${context.serverUrl}/${owner}/${repo}/commit/${{ inputs.check-sha }}`
-
- let summary = `This check is assosciated with ${shaUrl}\n\n`
-
- if (jobUrl) {
- summary += `For run logs, click here: ${jobUrl}`
- } else {
- summary += `Run logs could not be found for a job with name: "${jobName}"`
- }
-
- return { summary }
- - name: Create Check
- uses: LouisBrunner/[email protected]
- id: check
- if: inputs.check-sha
- with:
- token: ${{ secrets.GITHUB_TOKEN }}
- status: in_progress
- name: Lint All
- sha: ${{ inputs.check-sha }}
- output: ${{ steps.check-output.outputs.result }}
- name: Checkout
- uses: actions/checkout@v3
+ uses: actions/checkout@v4
with:
ref: ${{ inputs.ref }}
- name: Setup Git User
run: |
git config --global user.email "[email protected]"
git config --global user.name "npm CLI robot"
+ - name: Create Check
+ id: create-check
+ if: ${{ inputs.check-sha }}
+ uses: ./.github/actions/create-check
+ with:
+ name: "Lint All"
+ token: ${{ secrets.GITHUB_TOKEN }}
+ sha: ${{ inputs.check-sha }}
- name: Setup Node
- uses: actions/setup-node@v3
+ uses: actions/setup-node@v4
+ id: node
+ with:
+ node-version: 22.x
+ check-latest: contains('22.x', '.x')
+ - name: Install Latest npm
+ uses: ./.github/actions/install-latest-npm
with:
- node-version: 18.x
- - name: Install npm@8
- run: npm i --prefer-online --no-fund --no-audit -g npm@8
- - name: npm Version
- run: npm -v
+ node: ${{ steps.node.outputs.node-version }}
- name: Install Dependencies
run: npm i --ignore-scripts --no-audit --no-fund
- name: Lint
@@ -94,11 +61,11 @@ jobs:
run: npm run postlint --ignore-scripts
- name: Conclude Check
uses: LouisBrunner/[email protected]
- if: steps.check.outputs.check_id && always()
+ if: steps.create-check.outputs.check-id && always()
with:
token: ${{ secrets.GITHUB_TOKEN }}
conclusion: ${{ job.status }}
- check_id: ${{ steps.check.outputs.check_id }}
+ check_id: ${{ steps.create-check.outputs.check-id }}
test-all:
name: Test All - ${{ matrix.platform.name }} - ${{ matrix.node-version }}
@@ -113,6 +80,9 @@ jobs:
- name: macOS
os: macos-latest
shell: bash
+ - name: macOS
+ os: macos-13
+ shell: bash
- name: Windows
os: windows-latest
shell: cmd
@@ -123,84 +93,56 @@ jobs:
- 14.x
- 16.x
- 18.x
+ - 20.x
+ - 22.x
+ exclude:
+ - platform: { name: macOS, os: macos-latest, shell: bash }
+ node-version: 10.0.0
+ - platform: { name: macOS, os: macos-latest, shell: bash }
+ node-version: 10.x
+ - platform: { name: macOS, os: macos-latest, shell: bash }
+ node-version: 12.x
+ - platform: { name: macOS, os: macos-latest, shell: bash }
+ node-version: 14.x
+ - platform: { name: macOS, os: macos-13, shell: bash }
+ node-version: 16.x
+ - platform: { name: macOS, os: macos-13, shell: bash }
+ node-version: 18.x
+ - platform: { name: macOS, os: macos-13, shell: bash }
+ node-version: 20.x
+ - platform: { name: macOS, os: macos-13, shell: bash }
+ node-version: 22.x
runs-on: ${{ matrix.platform.os }}
defaults:
run:
shell: ${{ matrix.platform.shell }}
steps:
- - name: Get Workflow Job
- uses: actions/github-script@v6
- if: inputs.check-sha
- id: check-output
- env:
- JOB_NAME: "Test All"
- MATRIX_NAME: " - ${{ matrix.platform.name }} - ${{ matrix.node-version }}"
- with:
- script: |
- const { owner, repo } = context.repo
-
- const { data } = await github.rest.actions.listJobsForWorkflowRun({
- owner,
- repo,
- run_id: context.runId,
- per_page: 100
- })
-
- const jobName = process.env.JOB_NAME + process.env.MATRIX_NAME
- const job = data.jobs.find(j => j.name.endsWith(jobName))
- const jobUrl = job?.html_url
-
- const shaUrl = `${context.serverUrl}/${owner}/${repo}/commit/${{ inputs.check-sha }}`
-
- let summary = `This check is assosciated with ${shaUrl}\n\n`
-
- if (jobUrl) {
- summary += `For run logs, click here: ${jobUrl}`
- } else {
- summary += `Run logs could not be found for a job with name: "${jobName}"`
- }
-
- return { summary }
- - name: Create Check
- uses: LouisBrunner/[email protected]
- id: check
- if: inputs.check-sha
- with:
- token: ${{ secrets.GITHUB_TOKEN }}
- status: in_progress
- name: Test All - ${{ matrix.platform.name }} - ${{ matrix.node-version }}
- sha: ${{ inputs.check-sha }}
- output: ${{ steps.check-output.outputs.result }}
- name: Checkout
- uses: actions/checkout@v3
+ uses: actions/checkout@v4
with:
ref: ${{ inputs.ref }}
- name: Setup Git User
run: |
git config --global user.email "[email protected]"
git config --global user.name "npm CLI robot"
+ - name: Create Check
+ id: create-check
+ if: ${{ inputs.check-sha }}
+ uses: ./.github/actions/create-check
+ with:
+ name: "Test All - ${{ matrix.platform.name }} - ${{ matrix.node-version }}"
+ token: ${{ secrets.GITHUB_TOKEN }}
+ sha: ${{ inputs.check-sha }}
- name: Setup Node
- uses: actions/setup-node@v3
+ uses: actions/setup-node@v4
+ id: node
with:
node-version: ${{ matrix.node-version }}
- - name: Update Windows npm
- # 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
- cd package
- node lib/npm.js install --no-fund --no-audit -g ..\npm-7.5.4.tgz
- cd ..
- rmdir /s /q package
- - name: Install npm@7
- if: startsWith(matrix.node-version, '10.')
- run: npm i --prefer-online --no-fund --no-audit -g npm@7
- - name: Install npm@8
- if: ${{ !startsWith(matrix.node-version, '10.') }}
- run: npm i --prefer-online --no-fund --no-audit -g npm@8
- - name: npm Version
- run: npm -v
+ check-latest: contains(matrix.node-version, '.x')
+ - name: Install Latest npm
+ uses: ./.github/actions/install-latest-npm
+ with:
+ node: ${{ steps.node.outputs.node-version }}
- name: Install Dependencies
run: npm i --ignore-scripts --no-audit --no-fund
- name: Add Problem Matcher
@@ -209,8 +151,8 @@ jobs:
run: npm test --ignore-scripts
- name: Conclude Check
uses: LouisBrunner/[email protected]
- if: steps.check.outputs.check_id && always()
+ if: steps.create-check.outputs.check-id && always()
with:
token: ${{ secrets.GITHUB_TOKEN }}
conclusion: ${{ job.status }}
- check_id: ${{ steps.check.outputs.check_id }}
+ check_id: ${{ steps.create-check.outputs.check-id }}
diff --git .github/workflows/ci.yml .github/workflows/ci.yml
index 90c632b9..4a2724b6 100644
--- .github/workflows/ci.yml
+++ .github/workflows/ci.yml
@@ -8,7 +8,7 @@ on:
push:
branches:
- main
- - latest
+ - release/v*
schedule:
# "At 09:00 UTC (02:00 PT) on Monday" https://crontab.guru/#0_9_*_*_1
- cron: "0 9 * * 1"
@@ -23,19 +23,21 @@ jobs:
shell: bash
steps:
- name: Checkout
- uses: actions/checkout@v3
+ uses: actions/checkout@v4
- name: Setup Git User
run: |
git config --global user.email "[email protected]"
git config --global user.name "npm CLI robot"
- name: Setup Node
- uses: actions/setup-node@v3
+ uses: actions/setup-node@v4
+ id: node
with:
- node-version: 18.x
- - name: Install npm@8
- run: npm i --prefer-online --no-fund --no-audit -g npm@8
- - name: npm Version
- run: npm -v
+ node-version: 22.x
+ check-latest: contains('22.x', '.x')
+ - name: Install Latest npm
+ uses: ./.github/actions/install-latest-npm
+ with:
+ node: ${{ steps.node.outputs.node-version }}
- name: Install Dependencies
run: npm i --ignore-scripts --no-audit --no-fund
- name: Lint
@@ -56,6 +58,9 @@ jobs:
- name: macOS
os: macos-latest
shell: bash
+ - name: macOS
+ os: macos-13
+ shell: bash
- name: Windows
os: windows-latest
shell: cmd
@@ -66,39 +71,46 @@ jobs:
- 14.x
- 16.x
- 18.x
+ - 20.x
+ - 22.x
+ exclude:
+ - platform: { name: macOS, os: macos-latest, shell: bash }
+ node-version: 10.0.0
+ - platform: { name: macOS, os: macos-latest, shell: bash }
+ node-version: 10.x
+ - platform: { name: macOS, os: macos-latest, shell: bash }
+ node-version: 12.x
+ - platform: { name: macOS, os: macos-latest, shell: bash }
+ node-version: 14.x
+ - platform: { name: macOS, os: macos-13, shell: bash }
+ node-version: 16.x
+ - platform: { name: macOS, os: macos-13, shell: bash }
+ node-version: 18.x
+ - platform: { name: macOS, os: macos-13, shell: bash }
+ node-version: 20.x
+ - platform: { name: macOS, os: macos-13, shell: bash }
+ node-version: 22.x
runs-on: ${{ matrix.platform.os }}
defaults:
run:
shell: ${{ matrix.platform.shell }}
steps:
- name: Checkout
- uses: actions/checkout@v3
+ uses: actions/checkout@v4
- name: Setup Git User
run: |
git config --global user.email "[email protected]"
git config --global user.name "npm CLI robot"
- name: Setup Node
- uses: actions/setup-node@v3
+ uses: actions/setup-node@v4
+ id: node
with:
node-version: ${{ matrix.node-version }}
- - name: Update Windows npm
- # 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
- cd package
- node lib/npm.js install --no-fund --no-audit -g ..\npm-7.5.4.tgz
- cd ..
- rmdir /s /q package
- - name: Install npm@7
- if: startsWith(matrix.node-version, '10.')
- run: npm i --prefer-online --no-fund --no-audit -g npm@7
- - name: Install npm@8
- if: ${{ !startsWith(matrix.node-version, '10.') }}
- run: npm i --prefer-online --no-fund --no-audit -g npm@8
- - name: npm Version
- run: npm -v
+ check-latest: contains(matrix.node-version, '.x')
+ - name: Install Latest npm
+ uses: ./.github/actions/install-latest-npm
+ with:
+ node: ${{ steps.node.outputs.node-version }}
- name: Install Dependencies
run: npm i --ignore-scripts --no-audit --no-fund
- name: Add Problem Matcher
diff --git .github/workflows/codeql-analysis.yml .github/workflows/codeql-analysis.yml
index 66b9498a..f8b17025 100644
--- .github/workflows/codeql-analysis.yml
+++ .github/workflows/codeql-analysis.yml
@@ -6,11 +6,11 @@ on:
push:
branches:
- main
- - latest
+ - release/v*
pull_request:
branches:
- main
- - latest
+ - release/v*
schedule:
# "At 10:00 UTC (03:00 PT) on Monday" https://crontab.guru/#0_10_*_*_1
- cron: "0 10 * * 1"
@@ -25,14 +25,14 @@ jobs:
security-events: write
steps:
- name: Checkout
- uses: actions/checkout@v3
+ uses: actions/checkout@v4
- name: Setup Git User
run: |
git config --global user.email "[email protected]"
git config --global user.name "npm CLI robot"
- name: Initialize CodeQL
- uses: github/codeql-action/init@v2
+ uses: github/codeql-action/init@v3
with:
languages: javascript
- name: Perform CodeQL Analysis
- uses: github/codeql-action/analyze@v2
+ uses: github/codeql-action/analyze@v3
diff --git .github/workflows/post-dependabot.yml .github/workflows/post-dependabot.yml
index 03c85681..1ea8693c 100644
--- .github/workflows/post-dependabot.yml
+++ .github/workflows/post-dependabot.yml
@@ -17,7 +17,7 @@ jobs:
shell: bash
steps:
- name: Checkout
- uses: actions/checkout@v3
+ uses: actions/checkout@v4
with:
ref: ${{ github.event.pull_request.head.ref }}
- name: Setup Git User
@@ -25,13 +25,15 @@ jobs:
git config --global user.email "[email protected]"
git config --global user.name "npm CLI robot"
- name: Setup Node
- uses: actions/setup-node@v3
+ uses: actions/setup-node@v4
+ id: node
with:
- node-version: 18.x
- - name: Install npm@8
- run: npm i --prefer-online --no-fund --no-audit -g npm@8
- - name: npm Version
- run: npm -v
+ node-version: 22.x
+ check-latest: contains('22.x', '.x')
+ - name: Install Latest npm
+ uses: ./.github/actions/install-latest-npm
+ with:
+ node: ${{ steps.node.outputs.node-version }}
- name: Install Dependencies
run: npm i --ignore-scripts --no-audit --no-fund
- name: Fetch Dependabot Metadata
@@ -47,7 +49,7 @@ jobs:
id: flags
run: |
dependabot_dir="${{ steps.metadata.outputs.directory }}"
- if [[ "$dependabot_dir" == "/" ]]; then
+ if [[ "$dependabot_dir" == "/" || "$dependabot_dir" == "/main" ]]; then
echo "workspace=-iwr" >> $GITHUB_OUTPUT
else
# strip leading slash from directory so it works as a
diff --git .github/workflows/pull-request.yml .github/workflows/pull-request.yml
index da5779df..7dbdfd41 100644
--- .github/workflows/pull-request.yml
+++ .github/workflows/pull-request.yml
@@ -20,7 +20,7 @@ jobs:
shell: bash
steps:
- name: Checkout
- uses: actions/checkout@v3
+ uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Setup Git User
@@ -28,23 +28,23 @@ jobs:
git config --global user.email "[email protected]"
git config --global user.name "npm CLI robot"
- name: Setup Node
- uses: actions/setup-node@v3
+ uses: actions/setup-node@v4
+ id: node
with:
- node-version: 18.x
- - name: Install npm@8
- run: npm i --prefer-online --no-fund --no-audit -g npm@8
- - name: npm Version
- run: npm -v
+ node-version: 22.x
+ check-latest: contains('22.x', '.x')
+ - name: Install Latest npm
+ uses: ./.github/actions/install-latest-npm
+ with:
+ node: ${{ steps.node.outputs.node-version }}
- name: Install Dependencies
run: npm i --ignore-scripts --no-audit --no-fund
- name: Run Commitlint on Commits
id: commit
continue-on-error: true
- run: |
- npx --offline commitlint -V --from 'origin/${{ github.base_ref }}' --to ${{ github.event.pull_request.head.sha }}
+ run: npx --offline commitlint -V --from 'origin/${{ github.base_ref }}' --to ${{ github.event.pull_request.head.sha }}
- name: Run Commitlint on PR Title
if: steps.commit.outcome == 'failure'
env:
PR_TITLE: ${{ github.event.pull_request.title }}
- run: |
- echo '$PR_TITLE' | npx --offline commitlint -V
+ run: echo "$PR_TITLE" | npx --offline commitlint -V
diff --git a/.github/workflows/release-integration.yml b/.github/workflows/release-integration.yml
new file mode 100644
index 00000000..130578e6
--- /dev/null
+++ .github/workflows/release-integration.yml
@@ -0,0 +1,70 @@
+# This file is automatically added by @npmcli/template-oss. Do not edit.
+
+name: Release Integration
+
+on:
+ workflow_dispatch:
+ inputs:
+ releases:
+ required: true
+ type: string
+ description: 'A json array of releases. Required fields: publish: tagName, publishTag. publish check: pkgName, version'
+ workflow_call:
+ inputs:
+ releases:
+ required: true
+ type: string
+ description: 'A json array of releases. Required fields: publish: tagName, publishTag. publish check: pkgName, version'
+ secrets:
+ PUBLISH_TOKEN:
+ required: true
+
+jobs:
+ publish:
+ name: Publish
+ runs-on: ubuntu-latest
+ defaults:
+ run:
+ shell: bash
+ permissions:
+ id-token: write
+ steps:
+ - name: Checkout
+ uses: actions/checkout@v4
+ with:
+ ref: ${{ fromJSON(inputs.releases)[0].tagName }}
+ - name: Setup Git User
+ run: |
+ git config --global user.email "[email protected]"
+ git config --global user.name "npm CLI robot"
+ - name: Setup Node
+ uses: actions/setup-node@v4
+ id: node
+ with:
+ node-version: 22.x
+ check-latest: contains('22.x', '.x')
+ - name: Install Latest npm
+ uses: ./.github/actions/install-latest-npm
+ with:
+ node: ${{ steps.node.outputs.node-version }}
+ - name: Install Dependencies
+ run: npm i --ignore-scripts --no-audit --no-fund
+ - name: Set npm authToken
+ run: npm config set '//registry.npmjs.org/:_authToken'=\${PUBLISH_TOKEN}
+ - name: Publish
+ env:
+ PUBLISH_TOKEN: ${{ secrets.PUBLISH_TOKEN }}
+ RELEASES: ${{ inputs.releases }}
+ run: |
+ EXIT_CODE=0
+
+ for release in $(echo $RELEASES | jq -r '.[] | @base64'); do
+ PUBLISH_TAG=$(echo "$release" | base64 --decode | jq -r .publishTag)
+ npm publish --provenance --tag="$PUBLISH_TAG"
+ STATUS=$?
+ if [[ "$STATUS" -eq 1 ]]; then
+ EXIT_CODE=$STATUS
+ fi
+ done
+
+ exit $EXIT_CODE
diff --git .github/workflows/release.yml .github/workflows/release.yml
index 3b69ae10..e77e76f2 100644
--- .github/workflows/release.yml
+++ .github/workflows/release.yml
@@ -3,15 +3,9 @@
name: Release
on:
- workflow_dispatch:
- inputs:
- release-pr:
- description: a release PR number to rerun release jobs on
- type: string
push:
branches:
- main
- - latest
- release/v*
permissions:
@@ -23,12 +17,12 @@ jobs:
release:
outputs:
pr: ${{ steps.release.outputs.pr }}
- release: ${{ steps.release.outputs.release }}
- releases: ${{ steps.release.outputs.releases }}
- branch: ${{ steps.release.outputs.pr-branch }}
+ pr-branch: ${{ steps.release.outputs.pr-branch }}
pr-number: ${{ steps.release.outputs.pr-number }}
- comment-id: ${{ steps.pr-comment.outputs.result }}
- check-id: ${{ steps.check.outputs.check_id }}
+ pr-sha: ${{ steps.release.outputs.pr-sha }}
+ releases: ${{ steps.release.outputs.releases }}
+ comment-id: ${{ steps.create-comment.outputs.comment-id || steps.update-comment.outputs.comment-id }}
+ check-id: ${{ steps.create-check.outputs.check-id }}
name: Release
if: github.repository_owner == 'npm'
runs-on: ubuntu-latest
@@ -37,108 +31,75 @@ jobs:
shell: bash
steps:
- name: Checkout
- uses: actions/checkout@v3
+ uses: actions/checkout@v4
- name: Setup Git User
run: |
git config --global user.email "[email protected]"
git config --global user.name "npm CLI robot"
- name: Setup Node
- uses: actions/setup-node@v3
+ uses: actions/setup-node@v4
+ id: node
+ with:
+ node-version: 22.x
+ check-latest: contains('22.x', '.x')
+ - name: Install Latest npm
+ uses: ./.github/actions/install-latest-npm
with:
- node-version: 18.x
- - name: Install npm@8
- run: npm i --prefer-online --no-fund --no-audit -g npm@8
- - name: npm Version
- run: npm -v
+ node: ${{ steps.node.outputs.node-version }}
- name: Install Dependencies
run: npm i --ignore-scripts --no-audit --no-fund
- name: Release Please
id: release
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- run: |
- npx --offline template-oss-release-please "${{ github.ref_name }}" "${{ inputs.release-pr }}"
- - name: Post Pull Request Comment
+ run: npx --offline template-oss-release-please --branch="${{ github.ref_name }}" --backport="" --defaultTag="latest"
+ - name: Create Release Manager Comment Text
if: steps.release.outputs.pr-number
- uses: actions/github-script@v6
- id: pr-comment
- env:
- PR_NUMBER: ${{ steps.release.outputs.pr-number }}
- REF_NAME: ${{ github.ref_name }}
+ uses: actions/github-script@v7
+ id: comment-text
with:
+ result-encoding: string
script: |
- const { REF_NAME, PR_NUMBER: issue_number } = process.env
const { runId, repo: { owner, repo } } = context
-
const { data: workflow } = await github.rest.actions.getWorkflowRun({ owner, repo, run_id: runId })
-
- let body = '## Release Manager\n\n'
-
- const comments = await github.paginate(github.rest.issues.listComments, { owner, repo, issue_number })
- let commentId = comments.find(c => c.user.login === 'github-actions[bot]' && c.body.startsWith(body))?.id
-
- body += `Release workflow run: ${workflow.html_url}\n\n#### Force CI to Update This Release\n\n`
- body += `This PR will be updated and CI will run for every non-\`chore:\` commit that is pushed to \`main\`. `
- body += `To force CI to update this PR, run this command:\n\n`
- body += `\`\`\`\ngh workflow run release.yml -r ${REF_NAME} -R ${owner}/${repo} -f release-pr=${issue_number}\n\`\`\``
-
- if (commentId) {
- await github.rest.issues.updateComment({ owner, repo, comment_id: commentId, body })
- } else {
- const { data: comment } = await github.rest.issues.createComment({ owner, repo, issue_number, body })
- commentId = comment?.id
- }
-
- return commentId
- - name: Get Workflow Job
- uses: actions/github-script@v6
- if: steps.release.outputs.pr-sha
- id: check-output
- env:
- JOB_NAME: "Release"
- MATRIX_NAME: ""
+ return['## Release Manager', `Release workflow run: ${workflow.html_url}`].join('\n\n')
+ - name: Find Release Manager Comment
+ uses: peter-evans/find-comment@v2
+ if: steps.release.outputs.pr-number
+ id: found-comment
with:
- script: |
- const { owner, repo } = context.repo
-
- const { data } = await github.rest.actions.listJobsForWorkflowRun({
- owner,
- repo,
- run_id: context.runId,
- per_page: 100
- })
-
- const jobName = process.env.JOB_NAME + process.env.MATRIX_NAME
- const job = data.jobs.find(j => j.name.endsWith(jobName))
- const jobUrl = job?.html_url
-
- const shaUrl = `${context.serverUrl}/${owner}/${repo}/commit/${{ steps.release.outputs.pr-sha }}`
-
- let summary = `This check is assosciated with ${shaUrl}\n\n`
-
- if (jobUrl) {
- summary += `For run logs, click here: ${jobUrl}`
- } else {
- summary += `Run logs could not be found for a job with name: "${jobName}"`
- }
-
- return { summary }
+ issue-number: ${{ steps.release.outputs.pr-number }}
+ comment-author: 'github-actions[bot]'
+ body-includes: '## Release Manager'
+ - name: Create Release Manager Comment
+ id: create-comment
+ if: steps.release.outputs.pr-number && !steps.found-comment.outputs.comment-id
+ uses: peter-evans/create-or-update-comment@v3
+ with:
+ issue-number: ${{ steps.release.outputs.pr-number }}
+ body: ${{ steps.comment-text.outputs.result }}
+ - name: Update Release Manager Comment
+ id: update-comment
+ if: steps.release.outputs.pr-number && steps.found-comment.outputs.comment-id
+ uses: peter-evans/create-or-update-comment@v3
+ with:
+ comment-id: ${{ steps.found-comment.outputs.comment-id }}
+ body: ${{ steps.comment-text.outputs.result }}
+ edit-mode: 'replace'
- name: Create Check
- uses: LouisBrunner/[email protected]
- id: check
+ id: create-check
+ uses: ./.github/actions/create-check
if: steps.release.outputs.pr-sha
with:
+ name: "Release"
token: ${{ secrets.GITHUB_TOKEN }}
- status: in_progress
- name: Release
sha: ${{ steps.release.outputs.pr-sha }}
- output: ${{ steps.check-output.outputs.result }}
update:
needs: release
outputs:
sha: ${{ steps.commit.outputs.sha }}
- check-id: ${{ steps.check.outputs.check_id }}
+ check-id: ${{ steps.create-check.outputs.check-id }}
name: Update - Release
if: github.repository_owner == 'npm' && needs.release.outputs.pr
runs-on: ubuntu-latest
@@ -147,32 +108,41 @@ jobs:
shell: bash
steps:
- name: Checkout
- uses: actions/checkout@v3
+ uses: actions/checkout@v4
with:
fetch-depth: 0
- ref: ${{ needs.release.outputs.branch }}
+ ref: ${{ needs.release.outputs.pr-branch }}
- name: Setup Git User
run: |
git config --global user.email "[email protected]"
git config --global user.name "npm CLI robot"
- name: Setup Node
- uses: actions/setup-node@v3
+ uses: actions/setup-node@v4
+ id: node
+ with:
+ node-version: 22.x
+ check-latest: contains('22.x', '.x')
+ - name: Install Latest npm
+ uses: ./.github/actions/install-latest-npm
with:
- node-version: 18.x
- - name: Install npm@8
- run: npm i --prefer-online --no-fund --no-audit -g npm@8
- - name: npm Version
- run: npm -v
+ node: ${{ steps.node.outputs.node-version }}
- name: Install Dependencies
run: npm i --ignore-scripts --no-audit --no-fund
+ - name: Create Release Manager Checklist Text
+ id: comment-text
+ env:
+ GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
+ run: npm exec --offline -- template-oss-release-manager --pr="${{ needs.release.outputs.pr-number }}" --backport="" --defaultTag="latest" --publish
+ - name: Append Release Manager Comment
+ uses: peter-evans/create-or-update-comment@v3
+ with:
+ comment-id: ${{ needs.release.outputs.comment-id }}
+ body: ${{ steps.comment-text.outputs.result }}
+ edit-mode: 'append'
- name: Run Post Pull Request Actions
env:
- RELEASE_PR_NUMBER: ${{ needs.release.outputs.pr-number }}
- RELEASE_COMMENT_ID: ${{ needs.release.outputs.comment-id }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- run: |
- npm exec --offline -- template-oss-release-manager --lockfile=false --publish=true
- npm run rp-pull-request --ignore-scripts --if-present
+ run: npm run rp-pull-request --ignore-scripts --if-present -- --pr="${{ needs.release.outputs.pr-number }}" --commentId="${{ needs.release.outputs.comment-id }}"
- name: Commit
id: commit
env:
@@ -181,52 +151,16 @@ jobs:
git commit --all --amend --no-edit || true
git push --force-with-lease
echo "sha=$(git rev-parse HEAD)" >> $GITHUB_OUTPUT
- - name: Get Workflow Job
- uses: actions/github-script@v6
- if: steps.commit.outputs.sha
- id: check-output
- env:
- JOB_NAME: "Update - Release"
- MATRIX_NAME: ""
- with:
- script: |
- const { owner, repo } = context.repo
-
- const { data } = await github.rest.actions.listJobsForWorkflowRun({
- owner,
- repo,
- run_id: context.runId,
- per_page: 100
- })
-
- const jobName = process.env.JOB_NAME + process.env.MATRIX_NAME
- const job = data.jobs.find(j => j.name.endsWith(jobName))
- const jobUrl = job?.html_url
-
- const shaUrl = `${context.serverUrl}/${owner}/${repo}/commit/${{ steps.commit.outputs.sha }}`
-
- let summary = `This check is assosciated with ${shaUrl}\n\n`
-
- if (jobUrl) {
- summary += `For run logs, click here: ${jobUrl}`
- } else {
- summary += `Run logs could not be found for a job with name: "${jobName}"`
- }
-
- return { summary }
- name: Create Check
- uses: LouisBrunner/[email protected]
- id: check
- if: steps.commit.outputs.sha
+ id: create-check
+ uses: ./.github/actions/create-check
with:
+ name: "Update - Release"
+ check-name: "Release"
token: ${{ secrets.GITHUB_TOKEN }}
- status: in_progress
- name: Release
sha: ${{ steps.commit.outputs.sha }}
- output: ${{ steps.check-output.outputs.result }}
- name: Conclude Check
uses: LouisBrunner/[email protected]
- if: needs.release.outputs.check-id && always()
with:
token: ${{ secrets.GITHUB_TOKEN }}
conclusion: ${{ job.status }}
@@ -238,7 +172,7 @@ jobs:
if: needs.release.outputs.pr
uses: ./.github/workflows/ci-release.yml
with:
- ref: ${{ needs.release.outputs.branch }}
+ ref: ${{ needs.release.outputs.pr-branch }}
check-sha: ${{ needs.update.outputs.sha }}
post-ci:
@@ -250,8 +184,8 @@ jobs:
run:
shell: bash
steps:
- - name: Get Needs Result
- id: needs-result
+ - name: Get CI Conclusion
+ id: conclusion
run: |
result=""
if [[ "${{ contains(needs.*.result, 'failure') }}" == "true" ]]; then
@@ -264,14 +198,15 @@ jobs:
echo "result=$result" >> $GITHUB_OUTPUT
- name: Conclude Check
uses: LouisBrunner/[email protected]
- if: needs.update.outputs.check-id && always()
with:
token: ${{ secrets.GITHUB_TOKEN }}
- conclusion: ${{ steps.needs-result.outputs.result }}
+ conclusion: ${{ steps.conclusion.outputs.result }}
check_id: ${{ needs.update.outputs.check-id }}
post-release:
needs: release
+ outputs:
+ comment-id: ${{ steps.create-comment.outputs.comment-id }}
name: Post Release - Release
if: github.repository_owner == 'npm' && needs.release.outputs.releases
runs-on: ubuntu-latest
@@ -279,79 +214,54 @@ jobs:
run:
shell: bash
steps:
- - name: Create Release PR Comment
- uses: actions/github-script@v6
+ - name: Create Release PR Comment Text
+ id: comment-text
+ uses: actions/github-script@v7
env:
RELEASES: ${{ needs.release.outputs.releases }}
with:
+ result-encoding: string
script: |
const releases = JSON.parse(process.env.RELEASES)
const { runId, repo: { owner, repo } } = context
const issue_number = releases[0].prNumber
-
- let body = '## Release Workflow\n\n'
- for (const { pkgName, version, url } of releases) {
- body += `- \`${pkgName}@${version}\` ${url}\n`
- }
-
- const comments = await github.paginate(github.rest.issues.listComments, { owner, repo, issue_number })
- .then(cs => cs.map(c => ({ id: c.id, login: c.user.login, body: c.body })))
- console.log(`Found comments: ${JSON.stringify(comments, null, 2)}`)
- const releaseComments = comments.filter(c => c.login === 'github-actions[bot]' && c.body.includes('Release is at'))
-
- for (const comment of releaseComments) {
- console.log(`Release comment: ${JSON.stringify(comment, null, 2)}`)
- await github.rest.issues.deleteComment({ owner, repo, comment_id: comment.id })
- }
-
const runUrl = `https://github.com/${owner}/${repo}/actions/runs/${runId}`
- await github.rest.issues.createComment({
- owner,
- repo,
- issue_number,
- body: `${body}- Workflow run: :arrows_counterclockwise: ${runUrl}`,
- })
+
+ return [
+ '## Release Workflow\n',
+ ...releases.map(r => `- \`${r.pkgName}@${r.version}\` ${r.url}`),
+ `- Workflow run: :arrows_counterclockwise: ${runUrl}`,
+ ].join('\n')
+ - name: Create Release PR Comment
+ id: create-comment
+ uses: peter-evans/create-or-update-comment@v3
+ with:
+ issue-number: ${{ fromJSON(needs.release.outputs.releases)[0].prNumber }}
+ body: ${{ steps.comment-text.outputs.result }}
release-integration:
needs: release
name: Release Integration
- if: needs.release.outputs.release
- runs-on: ubuntu-latest
- defaults:
- run:
- shell: bash
+ if: needs.release.outputs.releases
+ uses: ./.github/workflows/release-integration.yml
permissions:
- deployments: write
id-token: write
- steps:
- - name: Checkout
- uses: actions/checkout@v3
- with:
- ref: ${{ fromJSON(needs.release.outputs.release).tagName }}
- - name: Setup Node
- uses: actions/setup-node@v3
- with:
- node-version: 18.x
- - name: Install npm@latest
- run: |
- npm i --prefer-online --no-fund --no-audit -g npm@latest
- npm config set '//registry.npmjs.org/:_authToken'=\${PUBLISH_TOKEN}
- - name: Publish
- env:
- PUBLISH_TOKEN: ${{ secrets.PUBLISH_TOKEN }}
- run: npm publish --provenance
+ secrets:
+ PUBLISH_TOKEN: ${{ secrets.PUBLISH_TOKEN }}
+ with:
+ releases: ${{ needs.release.outputs.releases }}
post-release-integration:
- needs: [ release, release-integration ]
+ needs: [ release, release-integration, post-release ]
name: Post Release Integration - Release
- if: github.repository_owner == 'npm' && needs.release.outputs.release && always()
+ if: github.repository_owner == 'npm' && needs.release.outputs.releases && always()
runs-on: ubuntu-latest
defaults:
run:
shell: bash
steps:
- - name: Get Needs Result
- id: needs-result
+ - name: Get Post Release Conclusion
+ id: conclusion
run: |
if [[ "${{ contains(needs.*.result, 'failure') }}" == "true" ]]; then
result="x"
@@ -361,39 +271,38 @@ jobs:
result="white_check_mark"
fi
echo "result=$result" >> $GITHUB_OUTPUT
- - name: Update Release PR Comment
- uses: actions/github-script@v6
+ - name: Find Release PR Comment
+ uses: peter-evans/find-comment@v2
+ id: found-comment
+ with:
+ issue-number: ${{ fromJSON(needs.release.outputs.releases)[0].prNumber }}
+ comment-author: 'github-actions[bot]'
+ body-includes: '## Release Workflow'
+ - name: Create Release PR Comment Text
+ id: comment-text
+ if: steps.found-comment.outputs.comment-id
+ uses: actions/github-script@v7
env:
- PR_NUMBER: ${{ fromJSON(needs.release.outputs.release).prNumber }}
- RESULT: ${{ steps.needs-result.outputs.result }}
+ RESULT: ${{ steps.conclusion.outputs.result }}
+ BODY: ${{ steps.found-comment.outputs.comment-body }}
with:
+ result-encoding: string
script: |
- const { PR_NUMBER: issue_number, RESULT } = process.env
- const { runId, repo: { owner, repo } } = context
-
- const comments = await github.paginate(github.rest.issues.listComments, { owner, repo, issue_number })
- const updateComment = comments.find(c =>
- c.user.login === 'github-actions[bot]' &&
- c.body.startsWith('## Release Workflow\n\n') &&
- c.body.includes(runId)
- )
-
- if (updateComment) {
- console.log('Found comment to update:', JSON.stringify(updateComment, null, 2))
- let body = updateComment.body.replace(/Workflow run: :[a-z_]+:/, `Workflow run: :${RESULT}:`)
- const tagCodeowner = RESULT !== 'white_check_mark'
- if (tagCodeowner) {
- body += `\n\n:rotating_light:`
- body += ` @npm/cli-team: The post-release workflow failed for this release.`
- body += ` Manual steps may need to be taken after examining the workflow output`
- body += ` from the above workflow run. :rotating_light:`
- }
- await github.rest.issues.updateComment({
- owner,
- repo,
- body,
- comment_id: updateComment.id,
- })
- } else {
- console.log('No matching comments found:', JSON.stringify(comments, null, 2))
+ const { RESULT, BODY } = process.env
+ const body = [BODY.replace(/(Workflow run: :)[a-z_]+(:)/, `$1${RESULT}$2`)]
+ if (RESULT !== 'white_check_mark') {
+ body.push(':rotating_light::rotating_light::rotating_light:')
+ body.push([
+ '@npm/cli-team: The post-release workflow failed for this release.',
+ 'Manual steps may need to be taken after examining the workflow output.'
+ ].join(' '))
+ body.push(':rotating_light::rotating_light::rotating_light:')
}
+ return body.join('\n\n').trim()
+ - name: Update Release PR Comment
+ if: steps.comment-text.outputs.result
+ uses: peter-evans/create-or-update-comment@v3
+ with:
+ comment-id: ${{ steps.found-comment.outputs.comment-id }}
+ body: ${{ steps.comment-text.outputs.result }}
+ edit-mode: 'replace'
diff --git .gitignore .gitignore
index 00bdaf2b..ac3c1dad 100644
--- .gitignore
+++ .gitignore
@@ -3,15 +3,18 @@
# ignore everything in the root
/*
-# keep these
!**/.gitignore
!/.commitlintrc.js
!/.eslintrc.js
!/.eslintrc.local.*
+!/.git-blame-ignore-revs
!/.github/
!/.gitignore
!/.npmrc
+!/.prettierignore
+!/.prettierrc.js
!/.release-please-manifest.json
+!/benchmarks
!/bin/
!/CHANGELOG*
!/classes/
@@ -34,3 +37,5 @@
!/SECURITY.md
!/tap-snapshots/
!/test/
+!/tsconfig.json
+tap-testdir*/
diff --git .release-please-manifest.json .release-please-manifest.json
index cc729eee..6a15549e 100644
--- .release-please-manifest.json
+++ .release-please-manifest.json
@@ -1,3 +1,3 @@
{
- ".": "7.5.3"
+ ".": "7.7.0"
}
diff --git CHANGELOG.md CHANGELOG.md
index 292ed24a..b4ddfe57 100644
--- CHANGELOG.md
+++ CHANGELOG.md
@@ -1,5 +1,86 @@
# Changelog
+## [7.7.0](https://github.com/npm/node-semver/compare/v7.6.3...v7.7.0) (2025-01-29)
+### Features
+* [`0864b3c`](https://github.com/npm/node-semver/commit/0864b3ce7932667013e0c7c5ec764777d4682883) [#753](https://github.com/npm/node-semver/pull/753) add "release" inc type (#753) (@mbtools)
+### Bug Fixes
+* [`d588e37`](https://github.com/npm/node-semver/commit/d588e3782864b1cab2fe9f2452b848e8c7f609d1) [#755](https://github.com/npm/node-semver/pull/755) diff: fix prerelease to stable version diff logic (#755) (@eminberkayd, berkay.daglar)
+* [`8a34bde`](https://github.com/npm/node-semver/commit/8a34bdecc783407f4e1a8a1ee1f67906b84a4b78) [#754](https://github.com/npm/node-semver/pull/754) add identifier validation to `inc()` (#754) (@mbtools)
+### Documentation
+* [`67e5478`](https://github.com/npm/node-semver/commit/67e54785a0f871361230f84323cbb631b9b6d834) [#756](https://github.com/npm/node-semver/pull/756) readme: added missing period for consistency (#756) (@shaymolcho)
+* [`868d4bb`](https://github.com/npm/node-semver/commit/868d4bbe3d318c52544f38d5f9977a1103e924c2) [#749](https://github.com/npm/node-semver/pull/749) clarify comment about obsolete prefixes (#749) (@mbtools, @ljharb)
+### Chores
+* [`145c554`](https://github.com/npm/node-semver/commit/145c554b8c7b7ecfcb451153ad18bdb2f24ad10d) [#741](https://github.com/npm/node-semver/pull/741) bump @npmcli/eslint-config from 4.0.5 to 5.0.0 (@dependabot[bot])
+* [`753e02b`](https://github.com/npm/node-semver/commit/753e02b9d0cb3ac23e085dc33efcab3e08d61f2b) [#747](https://github.com/npm/node-semver/pull/747) bump @npmcli/template-oss from 4.23.3 to 4.23.4 (#747) (@dependabot[bot], @npm-cli-bot)
+* [`0b812d5`](https://github.com/npm/node-semver/commit/0b812d5fb5fbb208e89dc1250e2efafeaa549437) [#744](https://github.com/npm/node-semver/pull/744) postinstall for dependabot template-oss PR (@hashtagchris)
+
+## [7.6.3](https://github.com/npm/node-semver/compare/v7.6.2...v7.6.3) (2024-07-16)
+
+### Bug Fixes
+
+* [`73a3d79`](https://github.com/npm/node-semver/commit/73a3d79c4ec32d5dd62c9d5f64e5af7fbdad9ec0) [#726](https://github.com/npm/node-semver/pull/726) optimize Range parsing and formatting (#726) (@jviide)
+
+### Documentation
+
+* [`2975ece`](https://github.com/npm/node-semver/commit/2975ece120e17660c9f1ef517de45c09ff821064) [#719](https://github.com/npm/node-semver/pull/719) fix extra backtick typo (#719) (@stdavis)
+
+## [7.6.2](https://github.com/npm/node-semver/compare/v7.6.1...v7.6.2) (2024-05-09)
+
+### Bug Fixes
+
+* [`6466ba9`](https://github.com/npm/node-semver/commit/6466ba9b540252db405fdd2a289dd4651495beea) [#713](https://github.com/npm/node-semver/pull/713) lru: use map.delete() directly (#713) (@negezor, @lukekarrys)
+
+## [7.6.1](https://github.com/npm/node-semver/compare/v7.6.0...v7.6.1) (2024-05-04)
+
+### Bug Fixes
+
+* [`c570a34`](https://github.com/npm/node-semver/commit/c570a348ffc6612af07fe94fa46b9affa5e4eff0) [#704](https://github.com/npm/node-semver/pull/704) linting: no-unused-vars (@wraithgar)
+* [`ad8ff11`](https://github.com/npm/node-semver/commit/ad8ff11dd200dac3a05097d9a82d1977ccfa1535) [#704](https://github.com/npm/node-semver/pull/704) use internal cache implementation (@mbtools)
+* [`ac9b357`](https://github.com/npm/node-semver/commit/ac9b35769ab0ddfefd5a3af4a3ecaf3da2012352) [#682](https://github.com/npm/node-semver/pull/682) typo in compareBuild debug message (#682) (@mbtools)
+
+### Dependencies
+
+* [`988a8de`](https://github.com/npm/node-semver/commit/988a8deb3ea76b9a314a740e66b5fc2f726822f8) [#709](https://github.com/npm/node-semver/pull/709) uninstall `lru-cache` (#709)
+* [`3fabe4d`](https://github.com/npm/node-semver/commit/3fabe4dbfbd199fdb589c076a7f30bc1f18c6614) [#704](https://github.com/npm/node-semver/pull/704) remove lru-cache
+
+### Chores
+
+* [`dd09b60`](https://github.com/npm/node-semver/commit/dd09b60da1e618335d7c269426345b336fd5f63d) [#705](https://github.com/npm/node-semver/pull/705) bump @npmcli/template-oss to 4.22.0 (@lukekarrys)
+* [`ec49cdc`](https://github.com/npm/node-semver/commit/ec49cdcece9db0020d6829b246681ff65a393644) [#701](https://github.com/npm/node-semver/pull/701) chore: chore: postinstall for dependabot template-oss PR (@lukekarrys)
+* [`b236c3d`](https://github.com/npm/node-semver/commit/b236c3d2f357a16a733c96ec2ca8c57848b70091) [#696](https://github.com/npm/node-semver/pull/696) add benchmarks (#696) (@H4ad)
+* [`692451b`](https://github.com/npm/node-semver/commit/692451bd6f75b38a71a99f39da405c94a5954a22) [#688](https://github.com/npm/node-semver/pull/688) various improvements to README (#688) (@mbtools)
+* [`5feeb7f`](https://github.com/npm/node-semver/commit/5feeb7f4f63061e19a29087115b50cb04135b63e) [#705](https://github.com/npm/node-semver/pull/705) postinstall for dependabot template-oss PR (@lukekarrys)
+* [`074156f`](https://github.com/npm/node-semver/commit/074156f64fa91723fe1ae6af8cc497014b9b7aff) [#701](https://github.com/npm/node-semver/pull/701) bump @npmcli/template-oss from 4.21.3 to 4.21.4 (@dependabot[bot])
+
+## [7.6.0](https://github.com/npm/node-semver/compare/v7.5.4...v7.6.0) (2024-01-31)
+
+### Features
+
+* [`a7ab13a`](https://github.com/npm/node-semver/commit/a7ab13a46201e342d34e84a989632b380f755baf) [#671](https://github.com/npm/node-semver/pull/671) preserve pre-release and build parts of a version on coerce (#671) (@madtisa, madtisa, @wraithgar)
+
+### Chores
+
+* [`816c7b2`](https://github.com/npm/node-semver/commit/816c7b2cbfcb1986958a290f941eddfd0441139e) [#667](https://github.com/npm/node-semver/pull/667) postinstall for dependabot template-oss PR (@lukekarrys)
+* [`0bd24d9`](https://github.com/npm/node-semver/commit/0bd24d943cbd1a7f6a2b8d384590bfa98559e1de) [#667](https://github.com/npm/node-semver/pull/667) bump @npmcli/template-oss from 4.21.1 to 4.21.3 (@dependabot[bot])
+* [`e521932`](https://github.com/npm/node-semver/commit/e521932f115a81030f4e7c34e8631cdd3c6a108b) [#652](https://github.com/npm/node-semver/pull/652) postinstall for dependabot template-oss PR (@lukekarrys)
+* [`8873991`](https://github.com/npm/node-semver/commit/88739918080debeb239aae840b35c07436148e50) [#652](https://github.com/npm/node-semver/pull/652) chore: chore: postinstall for dependabot template-oss PR (@lukekarrys)
+* [`f317dc8`](https://github.com/npm/node-semver/commit/f317dc8689781bcfd98e2c32b46157276acdd47c) [#652](https://github.com/npm/node-semver/pull/652) bump @npmcli/template-oss from 4.19.0 to 4.21.0 (@dependabot[bot])
+* [`7303db1`](https://github.com/npm/node-semver/commit/7303db1fe54d6905b23ccb0162878e37d73535ef) [#658](https://github.com/npm/node-semver/pull/658) add clean() test for build metadata (#658) (@jethrodaniel)
+* [`6240d75`](https://github.com/npm/node-semver/commit/6240d75a7c620b0a222f05969a91fdc3dc2be0fb) [#656](https://github.com/npm/node-semver/pull/656) add missing quotes in README.md (#656) (@zyxkad)
+* [`14d263f`](https://github.com/npm/node-semver/commit/14d263faa156e408a033b9b12a2f87735c2df42c) [#625](https://github.com/npm/node-semver/pull/625) postinstall for dependabot template-oss PR (@lukekarrys)
+* [`7c34e1a`](https://github.com/npm/node-semver/commit/7c34e1ac1bcc0bc6579b30745c96075c69bd0332) [#625](https://github.com/npm/node-semver/pull/625) bump @npmcli/template-oss from 4.18.1 to 4.19.0 (@dependabot[bot])
+* [`123e0b0`](https://github.com/npm/node-semver/commit/123e0b03287e1af295ef82d55f55c16805596f35) [#622](https://github.com/npm/node-semver/pull/622) postinstall for dependabot template-oss PR (@lukekarrys)
+* [`737d5e1`](https://github.com/npm/node-semver/commit/737d5e1cf10e631bab8a28594aa2d5c9d4090814) [#622](https://github.com/npm/node-semver/pull/622) bump @npmcli/template-oss from 4.18.0 to 4.18.1 (@dependabot[bot])
+* [`cce6180`](https://github.com/npm/node-semver/commit/cce61804ba6f997225a1267135c06676fe0524d2) [#598](https://github.com/npm/node-semver/pull/598) postinstall for dependabot template-oss PR (@lukekarrys)
+* [`b914a3d`](https://github.com/npm/node-semver/commit/b914a3d0d26ca27d2685053d7d390af4e02eedd9) [#598](https://github.com/npm/node-semver/pull/598) bump @npmcli/template-oss from 4.17.0 to 4.18.0 (@dependabot[bot])
+
+## [7.5.4](https://github.com/npm/node-semver/compare/v7.5.3...v7.5.4) (2023-07-07)
+
+### Bug Fixes
+
+* [`cc6fde2`](https://github.com/npm/node-semver/commit/cc6fde2d34b95cb600d126649d926901bd2a9703) [#588](https://github.com/npm/node-semver/pull/588) trim each range set before parsing (@lukekarrys)
+* [`99d8287`](https://github.com/npm/node-semver/commit/99d8287516a1d2abf0286033e2e26eca6b69c09f) [#583](https://github.com/npm/node-semver/pull/583) correctly parse long build ids as valid (#583) (@lukekarrys)
+
## [7.5.3](https://github.com/npm/node-semver/compare/v7.5.2...v7.5.3) (2023-06-22)
### Bug Fixes
diff --git README.md README.md
index 53ea9b52..e9522153 100644
--- README.md
+++ README.md
@@ -25,7 +25,7 @@ semver.valid(semver.coerce('v2')) // '2.0.0'
semver.valid(semver.coerce('42.6.7.9.3-alpha')) // '42.6.7'
\`\`\`
-You can also just load the module for the function that you care about, if
+You can also just load the module for the function that you care about if
you'd like to minimize your footprint.
```js
@@ -78,8 +78,8 @@ const semverOutside = require('semver/ranges/outside')
const semverGtr = require('semver/ranges/gtr')
const semverLtr = require('semver/ranges/ltr')
const semverIntersects = require('semver/ranges/intersects')
-const simplifyRange = require('semver/ranges/simplify')
-const rangeSubset = require('semver/ranges/subset')
+const semverSimplifyRange = require('semver/ranges/simplify')
+const semverRangeSubset = require('semver/ranges/subset') As a command-line utility:
--preid A leading Ranges-A A
For example, the comparator -The purpose for this behavior is twofold. First, prerelease versions Second, a user who has opted into using a prerelease version has Note that this behavior can be suppressed (treating all prerelease
DescriptionThis PR introduces several significant updates to the node-semver library, including new features, performance improvements, and dependency changes. The main changes include adding a "release" increment type, optimizing the Range parsing logic, and replacing the third-party LRU cache with an internal implementation. ChangesChangesBy file category: Core functionality:
Performance:
Infrastructure:
Documentation:
sequenceDiagram
participant App as Application
participant Semver as SemVer Class
participant Range as Range Class
participant Cache as Internal LRU Cache
App->>Semver: Parse Version
Semver->>Cache: Check Cache
alt Cache Hit
Cache-->>Semver: Return Cached Result
else Cache Miss
Semver->>Semver: Parse Version
Semver->>Cache: Store Result
end
Semver-->>App: Return Version Object
App->>Range: Parse Range
Range->>Cache: Check Cache
alt Cache Hit
Cache-->>Range: Return Cached Result
else Cache Miss
Range->>Range: Parse Range
Range->>Cache: Store Result
end
Range-->>App: Return Range Object
Possible Issues
Security HotspotsNone identified - the changes are primarily focused on internal logic improvements and don't introduce new attack vectors. |
165e93d
to
07a80d1
Compare
[puLL-Merge] - npm/[email protected] Diffdiff --git .commitlintrc.js .commitlintrc.js
index 5b0b1a52..b706e527 100644
--- .commitlintrc.js
+++ .commitlintrc.js
@@ -5,6 +5,8 @@ module.exports = {
rules: {
'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']],
+ 'subject-case': [0],
+ 'body-max-line-length': [0],
+ 'footer-max-line-length': [0],
},
}
diff --git .eslintrc.js .eslintrc.js
index 5db9f815..f21d26ec 100644
--- .eslintrc.js
+++ .eslintrc.js
@@ -10,6 +10,9 @@ const localConfigs = readdir(__dirname)
module.exports = {
root: true,
+ ignorePatterns: [
+ 'tap-testdir*/',
+ ],
extends: [
'@npmcli',
...localConfigs,
diff --git a/.github/actions/create-check/action.yml b/.github/actions/create-check/action.yml
new file mode 100644
index 00000000..d1220c90
--- /dev/null
+++ .github/actions/create-check/action.yml
@@ -0,0 +1,52 @@
+# This file is automatically added by @npmcli/template-oss. Do not edit.
+
+name: 'Create Check'
+inputs:
+ name:
+ required: true
+ token:
+ required: true
+ sha:
+ required: true
+ check-name:
+ default: ''
+outputs:
+ check-id:
+ value: ${{ steps.create-check.outputs.check_id }}
+runs:
+ using: "composite"
+ steps:
+ - name: Get Workflow Job
+ uses: actions/github-script@v7
+ id: workflow
+ env:
+ JOB_NAME: "${{ inputs.name }}"
+ SHA: "${{ inputs.sha }}"
+ with:
+ result-encoding: string
+ script: |
+ const { repo: { owner, repo}, runId, serverUrl } = context
+ const { JOB_NAME, SHA } = process.env
+
+ const job = await github.rest.actions.listJobsForWorkflowRun({
+ owner,
+ repo,
+ run_id: runId,
+ per_page: 100
+ }).then(r => r.data.jobs.find(j => j.name.endsWith(JOB_NAME)))
+
+ return [
+ `This check is assosciated with ${serverUrl}/${owner}/${repo}/commit/${SHA}.`,
+ 'Run logs:',
+ job?.html_url || `could not be found for a job ending with: "${JOB_NAME}"`,
+ ].join(' ')
+ - name: Create Check
+ uses: LouisBrunner/[email protected]
+ id: create-check
+ with:
+ token: ${{ inputs.token }}
+ sha: ${{ inputs.sha }}
+ status: in_progress
+ name: ${{ inputs.check-name || inputs.name }}
+ output: |
+ {"summary":"${{ steps.workflow.outputs.result }}"}
diff --git a/.github/actions/install-latest-npm/action.yml b/.github/actions/install-latest-npm/action.yml
new file mode 100644
index 00000000..580603dd
--- /dev/null
+++ .github/actions/install-latest-npm/action.yml
@@ -0,0 +1,58 @@
+# This file is automatically added by @npmcli/template-oss. Do not edit.
+
+name: 'Install Latest npm'
+description: 'Install the latest version of npm compatible with the Node version'
+inputs:
+ node:
+ description: 'Current Node version'
+ required: true
+runs:
+ using: "composite"
+ steps:
+ # node 10/12/14 ship with npm@6, which is known to fail when updating itself in windows
+ - name: Update Windows npm
+ if: |
+ runner.os == 'Windows' && (
+ startsWith(inputs.node, 'v10.') ||
+ startsWith(inputs.node, 'v12.') ||
+ startsWith(inputs.node, 'v14.')
+ )
+ shell: cmd
+ run: |
+ curl -sO https://registry.npmjs.org/npm/-/npm-7.5.4.tgz
+ tar xf npm-7.5.4.tgz
+ cd package
+ node lib/npm.js install --no-fund --no-audit -g ..\npm-7.5.4.tgz
+ cd ..
+ rmdir /s /q package
+ - name: Install Latest npm
+ shell: bash
+ env:
+ NODE_VERSION: ${{ inputs.node }}
+ working-directory: ${{ runner.temp }}
+ run: |
+ MATCH=""
+ SPECS=("latest" "next-10" "next-9" "next-8" "next-7" "next-6")
+
+ echo "node@$NODE_VERSION"
+
+ for SPEC in ${SPECS[@]}; do
+ ENGINES=$(npm view npm@$SPEC --json | jq -r '.engines.node')
+ echo "Checking if node@$NODE_VERSION satisfies npm@$SPEC ($ENGINES)"
+
+ if npx semver -r "$ENGINES" "$NODE_VERSION" > /dev/null; then
+ MATCH=$SPEC
+ echo "Found compatible version: npm@$MATCH"
+ break
+ fi
+ done
+
+ if [ -z $MATCH ]; then
+ echo "Could not find a compatible version of npm for node@$NODE_VERSION"
+ exit 1
+ fi
+
+ npm i --prefer-online --no-fund --no-audit -g npm@$MATCH
+ - name: npm Version
+ shell: bash
+ run: npm -v
diff --git .github/dependabot.yml .github/dependabot.yml
index 8da2a452..d735ccf2 100644
--- .github/dependabot.yml
+++ .github/dependabot.yml
@@ -7,6 +7,7 @@ updates:
directory: /
schedule:
interval: daily
+ target-branch: "main"
allow:
- dependency-type: direct
versioning-strategy: increase-if-necessary
@@ -15,3 +16,38 @@ updates:
prefix-development: chore
labels:
- "Dependencies"
+ open-pull-requests-limit: 10
+ - package-ecosystem: npm
+ directory: /
+ schedule:
+ interval: daily
+ target-branch: "release/v5"
+ allow:
+ - dependency-type: direct
+ dependency-name: "@npmcli/template-oss"
+ versioning-strategy: increase-if-necessary
+ commit-message:
+ prefix: deps
+ prefix-development: chore
+ labels:
+ - "Dependencies"
+ - "Backport"
+ - "release/v5"
+ open-pull-requests-limit: 10
+ - package-ecosystem: npm
+ directory: /
+ schedule:
+ interval: daily
+ target-branch: "release/v6"
+ allow:
+ - dependency-type: direct
+ dependency-name: "@npmcli/template-oss"
+ versioning-strategy: increase-if-necessary
+ commit-message:
+ prefix: deps
+ prefix-development: chore
+ labels:
+ - "Dependencies"
+ - "Backport"
+ - "release/v6"
+ open-pull-requests-limit: 10
diff --git .github/settings.yml .github/settings.yml
index 107aa0ad..206b6eeb 100644
--- .github/settings.yml
+++ .github/settings.yml
@@ -15,6 +15,35 @@ branches:
protection:
required_status_checks: null
enforce_admins: true
+ block_creations: true
+ required_pull_request_reviews:
+ required_approving_review_count: 1
+ require_code_owner_reviews: true
+ require_last_push_approval: true
+ dismiss_stale_reviews: true
+ restrictions:
+ apps: []
+ users: []
+ teams: [ "cli-team" ]
+ - name: release/v5
+ protection:
+ required_status_checks: null
+ enforce_admins: true
+ block_creations: true
+ required_pull_request_reviews:
+ required_approving_review_count: 1
+ require_code_owner_reviews: true
+ require_last_push_approval: true
+ dismiss_stale_reviews: true
+ restrictions:
+ apps: []
+ users: []
+ teams: [ "cli-team" ]
+ - name: release/v6
+ protection:
+ required_status_checks: null
+ enforce_admins: true
+ block_creations: true
required_pull_request_reviews:
required_approving_review_count: 1
require_code_owner_reviews: true
diff --git .github/workflows/audit.yml .github/workflows/audit.yml
index 8b8f3748..a3ae7257 100644
--- .github/workflows/audit.yml
+++ .github/workflows/audit.yml
@@ -18,19 +18,21 @@ jobs:
shell: bash
steps:
- name: Checkout
- uses: actions/checkout@v3
+ uses: actions/checkout@v4
- name: Setup Git User
run: |
git config --global user.email "[email protected]"
git config --global user.name "npm CLI robot"
- name: Setup Node
- uses: actions/setup-node@v3
+ uses: actions/setup-node@v4
+ id: node
with:
- node-version: 18.x
- - name: Install npm@8
- run: npm i --prefer-online --no-fund --no-audit -g npm@8
- - name: npm Version
- run: npm -v
+ node-version: 22.x
+ check-latest: contains('22.x', '.x')
+ - name: Install Latest npm
+ uses: ./.github/actions/install-latest-npm
+ with:
+ node: ${{ steps.node.outputs.node-version }}
- name: Install Dependencies
run: npm i --ignore-scripts --no-audit --no-fund --package-lock
- name: Run Production Audit
diff --git .github/workflows/ci-release.yml .github/workflows/ci-release.yml
index 98b70866..f6ab948b 100644
--- .github/workflows/ci-release.yml
+++ .github/workflows/ci-release.yml
@@ -27,65 +27,32 @@ jobs:
run:
shell: bash
steps:
- - name: Get Workflow Job
- uses: actions/github-script@v6
- if: inputs.check-sha
- id: check-output
- env:
- JOB_NAME: "Lint All"
- MATRIX_NAME: ""
- with:
- script: |
- const { owner, repo } = context.repo
-
- const { data } = await github.rest.actions.listJobsForWorkflowRun({
- owner,
- repo,
- run_id: context.runId,
- per_page: 100
- })
-
- const jobName = process.env.JOB_NAME + process.env.MATRIX_NAME
- const job = data.jobs.find(j => j.name.endsWith(jobName))
- const jobUrl = job?.html_url
-
- const shaUrl = `${context.serverUrl}/${owner}/${repo}/commit/${{ inputs.check-sha }}`
-
- let summary = `This check is assosciated with ${shaUrl}\n\n`
-
- if (jobUrl) {
- summary += `For run logs, click here: ${jobUrl}`
- } else {
- summary += `Run logs could not be found for a job with name: "${jobName}"`
- }
-
- return { summary }
- - name: Create Check
- uses: LouisBrunner/[email protected]
- id: check
- if: inputs.check-sha
- with:
- token: ${{ secrets.GITHUB_TOKEN }}
- status: in_progress
- name: Lint All
- sha: ${{ inputs.check-sha }}
- output: ${{ steps.check-output.outputs.result }}
- name: Checkout
- uses: actions/checkout@v3
+ uses: actions/checkout@v4
with:
ref: ${{ inputs.ref }}
- name: Setup Git User
run: |
git config --global user.email "[email protected]"
git config --global user.name "npm CLI robot"
+ - name: Create Check
+ id: create-check
+ if: ${{ inputs.check-sha }}
+ uses: ./.github/actions/create-check
+ with:
+ name: "Lint All"
+ token: ${{ secrets.GITHUB_TOKEN }}
+ sha: ${{ inputs.check-sha }}
- name: Setup Node
- uses: actions/setup-node@v3
+ uses: actions/setup-node@v4
+ id: node
+ with:
+ node-version: 22.x
+ check-latest: contains('22.x', '.x')
+ - name: Install Latest npm
+ uses: ./.github/actions/install-latest-npm
with:
- node-version: 18.x
- - name: Install npm@8
- run: npm i --prefer-online --no-fund --no-audit -g npm@8
- - name: npm Version
- run: npm -v
+ node: ${{ steps.node.outputs.node-version }}
- name: Install Dependencies
run: npm i --ignore-scripts --no-audit --no-fund
- name: Lint
@@ -94,11 +61,11 @@ jobs:
run: npm run postlint --ignore-scripts
- name: Conclude Check
uses: LouisBrunner/[email protected]
- if: steps.check.outputs.check_id && always()
+ if: steps.create-check.outputs.check-id && always()
with:
token: ${{ secrets.GITHUB_TOKEN }}
conclusion: ${{ job.status }}
- check_id: ${{ steps.check.outputs.check_id }}
+ check_id: ${{ steps.create-check.outputs.check-id }}
test-all:
name: Test All - ${{ matrix.platform.name }} - ${{ matrix.node-version }}
@@ -113,6 +80,9 @@ jobs:
- name: macOS
os: macos-latest
shell: bash
+ - name: macOS
+ os: macos-13
+ shell: bash
- name: Windows
os: windows-latest
shell: cmd
@@ -123,84 +93,56 @@ jobs:
- 14.x
- 16.x
- 18.x
+ - 20.x
+ - 22.x
+ exclude:
+ - platform: { name: macOS, os: macos-latest, shell: bash }
+ node-version: 10.0.0
+ - platform: { name: macOS, os: macos-latest, shell: bash }
+ node-version: 10.x
+ - platform: { name: macOS, os: macos-latest, shell: bash }
+ node-version: 12.x
+ - platform: { name: macOS, os: macos-latest, shell: bash }
+ node-version: 14.x
+ - platform: { name: macOS, os: macos-13, shell: bash }
+ node-version: 16.x
+ - platform: { name: macOS, os: macos-13, shell: bash }
+ node-version: 18.x
+ - platform: { name: macOS, os: macos-13, shell: bash }
+ node-version: 20.x
+ - platform: { name: macOS, os: macos-13, shell: bash }
+ node-version: 22.x
runs-on: ${{ matrix.platform.os }}
defaults:
run:
shell: ${{ matrix.platform.shell }}
steps:
- - name: Get Workflow Job
- uses: actions/github-script@v6
- if: inputs.check-sha
- id: check-output
- env:
- JOB_NAME: "Test All"
- MATRIX_NAME: " - ${{ matrix.platform.name }} - ${{ matrix.node-version }}"
- with:
- script: |
- const { owner, repo } = context.repo
-
- const { data } = await github.rest.actions.listJobsForWorkflowRun({
- owner,
- repo,
- run_id: context.runId,
- per_page: 100
- })
-
- const jobName = process.env.JOB_NAME + process.env.MATRIX_NAME
- const job = data.jobs.find(j => j.name.endsWith(jobName))
- const jobUrl = job?.html_url
-
- const shaUrl = `${context.serverUrl}/${owner}/${repo}/commit/${{ inputs.check-sha }}`
-
- let summary = `This check is assosciated with ${shaUrl}\n\n`
-
- if (jobUrl) {
- summary += `For run logs, click here: ${jobUrl}`
- } else {
- summary += `Run logs could not be found for a job with name: "${jobName}"`
- }
-
- return { summary }
- - name: Create Check
- uses: LouisBrunner/[email protected]
- id: check
- if: inputs.check-sha
- with:
- token: ${{ secrets.GITHUB_TOKEN }}
- status: in_progress
- name: Test All - ${{ matrix.platform.name }} - ${{ matrix.node-version }}
- sha: ${{ inputs.check-sha }}
- output: ${{ steps.check-output.outputs.result }}
- name: Checkout
- uses: actions/checkout@v3
+ uses: actions/checkout@v4
with:
ref: ${{ inputs.ref }}
- name: Setup Git User
run: |
git config --global user.email "[email protected]"
git config --global user.name "npm CLI robot"
+ - name: Create Check
+ id: create-check
+ if: ${{ inputs.check-sha }}
+ uses: ./.github/actions/create-check
+ with:
+ name: "Test All - ${{ matrix.platform.name }} - ${{ matrix.node-version }}"
+ token: ${{ secrets.GITHUB_TOKEN }}
+ sha: ${{ inputs.check-sha }}
- name: Setup Node
- uses: actions/setup-node@v3
+ uses: actions/setup-node@v4
+ id: node
with:
node-version: ${{ matrix.node-version }}
- - name: Update Windows npm
- # 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
- cd package
- node lib/npm.js install --no-fund --no-audit -g ..\npm-7.5.4.tgz
- cd ..
- rmdir /s /q package
- - name: Install npm@7
- if: startsWith(matrix.node-version, '10.')
- run: npm i --prefer-online --no-fund --no-audit -g npm@7
- - name: Install npm@8
- if: ${{ !startsWith(matrix.node-version, '10.') }}
- run: npm i --prefer-online --no-fund --no-audit -g npm@8
- - name: npm Version
- run: npm -v
+ check-latest: contains(matrix.node-version, '.x')
+ - name: Install Latest npm
+ uses: ./.github/actions/install-latest-npm
+ with:
+ node: ${{ steps.node.outputs.node-version }}
- name: Install Dependencies
run: npm i --ignore-scripts --no-audit --no-fund
- name: Add Problem Matcher
@@ -209,8 +151,8 @@ jobs:
run: npm test --ignore-scripts
- name: Conclude Check
uses: LouisBrunner/[email protected]
- if: steps.check.outputs.check_id && always()
+ if: steps.create-check.outputs.check-id && always()
with:
token: ${{ secrets.GITHUB_TOKEN }}
conclusion: ${{ job.status }}
- check_id: ${{ steps.check.outputs.check_id }}
+ check_id: ${{ steps.create-check.outputs.check-id }}
diff --git .github/workflows/ci.yml .github/workflows/ci.yml
index 90c632b9..4a2724b6 100644
--- .github/workflows/ci.yml
+++ .github/workflows/ci.yml
@@ -8,7 +8,7 @@ on:
push:
branches:
- main
- - latest
+ - release/v*
schedule:
# "At 09:00 UTC (02:00 PT) on Monday" https://crontab.guru/#0_9_*_*_1
- cron: "0 9 * * 1"
@@ -23,19 +23,21 @@ jobs:
shell: bash
steps:
- name: Checkout
- uses: actions/checkout@v3
+ uses: actions/checkout@v4
- name: Setup Git User
run: |
git config --global user.email "[email protected]"
git config --global user.name "npm CLI robot"
- name: Setup Node
- uses: actions/setup-node@v3
+ uses: actions/setup-node@v4
+ id: node
with:
- node-version: 18.x
- - name: Install npm@8
- run: npm i --prefer-online --no-fund --no-audit -g npm@8
- - name: npm Version
- run: npm -v
+ node-version: 22.x
+ check-latest: contains('22.x', '.x')
+ - name: Install Latest npm
+ uses: ./.github/actions/install-latest-npm
+ with:
+ node: ${{ steps.node.outputs.node-version }}
- name: Install Dependencies
run: npm i --ignore-scripts --no-audit --no-fund
- name: Lint
@@ -56,6 +58,9 @@ jobs:
- name: macOS
os: macos-latest
shell: bash
+ - name: macOS
+ os: macos-13
+ shell: bash
- name: Windows
os: windows-latest
shell: cmd
@@ -66,39 +71,46 @@ jobs:
- 14.x
- 16.x
- 18.x
+ - 20.x
+ - 22.x
+ exclude:
+ - platform: { name: macOS, os: macos-latest, shell: bash }
+ node-version: 10.0.0
+ - platform: { name: macOS, os: macos-latest, shell: bash }
+ node-version: 10.x
+ - platform: { name: macOS, os: macos-latest, shell: bash }
+ node-version: 12.x
+ - platform: { name: macOS, os: macos-latest, shell: bash }
+ node-version: 14.x
+ - platform: { name: macOS, os: macos-13, shell: bash }
+ node-version: 16.x
+ - platform: { name: macOS, os: macos-13, shell: bash }
+ node-version: 18.x
+ - platform: { name: macOS, os: macos-13, shell: bash }
+ node-version: 20.x
+ - platform: { name: macOS, os: macos-13, shell: bash }
+ node-version: 22.x
runs-on: ${{ matrix.platform.os }}
defaults:
run:
shell: ${{ matrix.platform.shell }}
steps:
- name: Checkout
- uses: actions/checkout@v3
+ uses: actions/checkout@v4
- name: Setup Git User
run: |
git config --global user.email "[email protected]"
git config --global user.name "npm CLI robot"
- name: Setup Node
- uses: actions/setup-node@v3
+ uses: actions/setup-node@v4
+ id: node
with:
node-version: ${{ matrix.node-version }}
- - name: Update Windows npm
- # 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
- cd package
- node lib/npm.js install --no-fund --no-audit -g ..\npm-7.5.4.tgz
- cd ..
- rmdir /s /q package
- - name: Install npm@7
- if: startsWith(matrix.node-version, '10.')
- run: npm i --prefer-online --no-fund --no-audit -g npm@7
- - name: Install npm@8
- if: ${{ !startsWith(matrix.node-version, '10.') }}
- run: npm i --prefer-online --no-fund --no-audit -g npm@8
- - name: npm Version
- run: npm -v
+ check-latest: contains(matrix.node-version, '.x')
+ - name: Install Latest npm
+ uses: ./.github/actions/install-latest-npm
+ with:
+ node: ${{ steps.node.outputs.node-version }}
- name: Install Dependencies
run: npm i --ignore-scripts --no-audit --no-fund
- name: Add Problem Matcher
diff --git .github/workflows/codeql-analysis.yml .github/workflows/codeql-analysis.yml
index 66b9498a..f8b17025 100644
--- .github/workflows/codeql-analysis.yml
+++ .github/workflows/codeql-analysis.yml
@@ -6,11 +6,11 @@ on:
push:
branches:
- main
- - latest
+ - release/v*
pull_request:
branches:
- main
- - latest
+ - release/v*
schedule:
# "At 10:00 UTC (03:00 PT) on Monday" https://crontab.guru/#0_10_*_*_1
- cron: "0 10 * * 1"
@@ -25,14 +25,14 @@ jobs:
security-events: write
steps:
- name: Checkout
- uses: actions/checkout@v3
+ uses: actions/checkout@v4
- name: Setup Git User
run: |
git config --global user.email "[email protected]"
git config --global user.name "npm CLI robot"
- name: Initialize CodeQL
- uses: github/codeql-action/init@v2
+ uses: github/codeql-action/init@v3
with:
languages: javascript
- name: Perform CodeQL Analysis
- uses: github/codeql-action/analyze@v2
+ uses: github/codeql-action/analyze@v3
diff --git .github/workflows/post-dependabot.yml .github/workflows/post-dependabot.yml
index 03c85681..1ea8693c 100644
--- .github/workflows/post-dependabot.yml
+++ .github/workflows/post-dependabot.yml
@@ -17,7 +17,7 @@ jobs:
shell: bash
steps:
- name: Checkout
- uses: actions/checkout@v3
+ uses: actions/checkout@v4
with:
ref: ${{ github.event.pull_request.head.ref }}
- name: Setup Git User
@@ -25,13 +25,15 @@ jobs:
git config --global user.email "[email protected]"
git config --global user.name "npm CLI robot"
- name: Setup Node
- uses: actions/setup-node@v3
+ uses: actions/setup-node@v4
+ id: node
with:
- node-version: 18.x
- - name: Install npm@8
- run: npm i --prefer-online --no-fund --no-audit -g npm@8
- - name: npm Version
- run: npm -v
+ node-version: 22.x
+ check-latest: contains('22.x', '.x')
+ - name: Install Latest npm
+ uses: ./.github/actions/install-latest-npm
+ with:
+ node: ${{ steps.node.outputs.node-version }}
- name: Install Dependencies
run: npm i --ignore-scripts --no-audit --no-fund
- name: Fetch Dependabot Metadata
@@ -47,7 +49,7 @@ jobs:
id: flags
run: |
dependabot_dir="${{ steps.metadata.outputs.directory }}"
- if [[ "$dependabot_dir" == "/" ]]; then
+ if [[ "$dependabot_dir" == "/" || "$dependabot_dir" == "/main" ]]; then
echo "workspace=-iwr" >> $GITHUB_OUTPUT
else
# strip leading slash from directory so it works as a
diff --git .github/workflows/pull-request.yml .github/workflows/pull-request.yml
index da5779df..7dbdfd41 100644
--- .github/workflows/pull-request.yml
+++ .github/workflows/pull-request.yml
@@ -20,7 +20,7 @@ jobs:
shell: bash
steps:
- name: Checkout
- uses: actions/checkout@v3
+ uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Setup Git User
@@ -28,23 +28,23 @@ jobs:
git config --global user.email "[email protected]"
git config --global user.name "npm CLI robot"
- name: Setup Node
- uses: actions/setup-node@v3
+ uses: actions/setup-node@v4
+ id: node
with:
- node-version: 18.x
- - name: Install npm@8
- run: npm i --prefer-online --no-fund --no-audit -g npm@8
- - name: npm Version
- run: npm -v
+ node-version: 22.x
+ check-latest: contains('22.x', '.x')
+ - name: Install Latest npm
+ uses: ./.github/actions/install-latest-npm
+ with:
+ node: ${{ steps.node.outputs.node-version }}
- name: Install Dependencies
run: npm i --ignore-scripts --no-audit --no-fund
- name: Run Commitlint on Commits
id: commit
continue-on-error: true
- run: |
- npx --offline commitlint -V --from 'origin/${{ github.base_ref }}' --to ${{ github.event.pull_request.head.sha }}
+ run: npx --offline commitlint -V --from 'origin/${{ github.base_ref }}' --to ${{ github.event.pull_request.head.sha }}
- name: Run Commitlint on PR Title
if: steps.commit.outcome == 'failure'
env:
PR_TITLE: ${{ github.event.pull_request.title }}
- run: |
- echo '$PR_TITLE' | npx --offline commitlint -V
+ run: echo "$PR_TITLE" | npx --offline commitlint -V
diff --git a/.github/workflows/release-integration.yml b/.github/workflows/release-integration.yml
new file mode 100644
index 00000000..130578e6
--- /dev/null
+++ .github/workflows/release-integration.yml
@@ -0,0 +1,70 @@
+# This file is automatically added by @npmcli/template-oss. Do not edit.
+
+name: Release Integration
+
+on:
+ workflow_dispatch:
+ inputs:
+ releases:
+ required: true
+ type: string
+ description: 'A json array of releases. Required fields: publish: tagName, publishTag. publish check: pkgName, version'
+ workflow_call:
+ inputs:
+ releases:
+ required: true
+ type: string
+ description: 'A json array of releases. Required fields: publish: tagName, publishTag. publish check: pkgName, version'
+ secrets:
+ PUBLISH_TOKEN:
+ required: true
+
+jobs:
+ publish:
+ name: Publish
+ runs-on: ubuntu-latest
+ defaults:
+ run:
+ shell: bash
+ permissions:
+ id-token: write
+ steps:
+ - name: Checkout
+ uses: actions/checkout@v4
+ with:
+ ref: ${{ fromJSON(inputs.releases)[0].tagName }}
+ - name: Setup Git User
+ run: |
+ git config --global user.email "[email protected]"
+ git config --global user.name "npm CLI robot"
+ - name: Setup Node
+ uses: actions/setup-node@v4
+ id: node
+ with:
+ node-version: 22.x
+ check-latest: contains('22.x', '.x')
+ - name: Install Latest npm
+ uses: ./.github/actions/install-latest-npm
+ with:
+ node: ${{ steps.node.outputs.node-version }}
+ - name: Install Dependencies
+ run: npm i --ignore-scripts --no-audit --no-fund
+ - name: Set npm authToken
+ run: npm config set '//registry.npmjs.org/:_authToken'=\${PUBLISH_TOKEN}
+ - name: Publish
+ env:
+ PUBLISH_TOKEN: ${{ secrets.PUBLISH_TOKEN }}
+ RELEASES: ${{ inputs.releases }}
+ run: |
+ EXIT_CODE=0
+
+ for release in $(echo $RELEASES | jq -r '.[] | @base64'); do
+ PUBLISH_TAG=$(echo "$release" | base64 --decode | jq -r .publishTag)
+ npm publish --provenance --tag="$PUBLISH_TAG"
+ STATUS=$?
+ if [[ "$STATUS" -eq 1 ]]; then
+ EXIT_CODE=$STATUS
+ fi
+ done
+
+ exit $EXIT_CODE
diff --git .github/workflows/release.yml .github/workflows/release.yml
index 3b69ae10..e77e76f2 100644
--- .github/workflows/release.yml
+++ .github/workflows/release.yml
@@ -3,15 +3,9 @@
name: Release
on:
- workflow_dispatch:
- inputs:
- release-pr:
- description: a release PR number to rerun release jobs on
- type: string
push:
branches:
- main
- - latest
- release/v*
permissions:
@@ -23,12 +17,12 @@ jobs:
release:
outputs:
pr: ${{ steps.release.outputs.pr }}
- release: ${{ steps.release.outputs.release }}
- releases: ${{ steps.release.outputs.releases }}
- branch: ${{ steps.release.outputs.pr-branch }}
+ pr-branch: ${{ steps.release.outputs.pr-branch }}
pr-number: ${{ steps.release.outputs.pr-number }}
- comment-id: ${{ steps.pr-comment.outputs.result }}
- check-id: ${{ steps.check.outputs.check_id }}
+ pr-sha: ${{ steps.release.outputs.pr-sha }}
+ releases: ${{ steps.release.outputs.releases }}
+ comment-id: ${{ steps.create-comment.outputs.comment-id || steps.update-comment.outputs.comment-id }}
+ check-id: ${{ steps.create-check.outputs.check-id }}
name: Release
if: github.repository_owner == 'npm'
runs-on: ubuntu-latest
@@ -37,108 +31,75 @@ jobs:
shell: bash
steps:
- name: Checkout
- uses: actions/checkout@v3
+ uses: actions/checkout@v4
- name: Setup Git User
run: |
git config --global user.email "[email protected]"
git config --global user.name "npm CLI robot"
- name: Setup Node
- uses: actions/setup-node@v3
+ uses: actions/setup-node@v4
+ id: node
+ with:
+ node-version: 22.x
+ check-latest: contains('22.x', '.x')
+ - name: Install Latest npm
+ uses: ./.github/actions/install-latest-npm
with:
- node-version: 18.x
- - name: Install npm@8
- run: npm i --prefer-online --no-fund --no-audit -g npm@8
- - name: npm Version
- run: npm -v
+ node: ${{ steps.node.outputs.node-version }}
- name: Install Dependencies
run: npm i --ignore-scripts --no-audit --no-fund
- name: Release Please
id: release
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- run: |
- npx --offline template-oss-release-please "${{ github.ref_name }}" "${{ inputs.release-pr }}"
- - name: Post Pull Request Comment
+ run: npx --offline template-oss-release-please --branch="${{ github.ref_name }}" --backport="" --defaultTag="latest"
+ - name: Create Release Manager Comment Text
if: steps.release.outputs.pr-number
- uses: actions/github-script@v6
- id: pr-comment
- env:
- PR_NUMBER: ${{ steps.release.outputs.pr-number }}
- REF_NAME: ${{ github.ref_name }}
+ uses: actions/github-script@v7
+ id: comment-text
with:
+ result-encoding: string
script: |
- const { REF_NAME, PR_NUMBER: issue_number } = process.env
const { runId, repo: { owner, repo } } = context
-
const { data: workflow } = await github.rest.actions.getWorkflowRun({ owner, repo, run_id: runId })
-
- let body = '## Release Manager\n\n'
-
- const comments = await github.paginate(github.rest.issues.listComments, { owner, repo, issue_number })
- let commentId = comments.find(c => c.user.login === 'github-actions[bot]' && c.body.startsWith(body))?.id
-
- body += `Release workflow run: ${workflow.html_url}\n\n#### Force CI to Update This Release\n\n`
- body += `This PR will be updated and CI will run for every non-\`chore:\` commit that is pushed to \`main\`. `
- body += `To force CI to update this PR, run this command:\n\n`
- body += `\`\`\`\ngh workflow run release.yml -r ${REF_NAME} -R ${owner}/${repo} -f release-pr=${issue_number}\n\`\`\``
-
- if (commentId) {
- await github.rest.issues.updateComment({ owner, repo, comment_id: commentId, body })
- } else {
- const { data: comment } = await github.rest.issues.createComment({ owner, repo, issue_number, body })
- commentId = comment?.id
- }
-
- return commentId
- - name: Get Workflow Job
- uses: actions/github-script@v6
- if: steps.release.outputs.pr-sha
- id: check-output
- env:
- JOB_NAME: "Release"
- MATRIX_NAME: ""
+ return['## Release Manager', `Release workflow run: ${workflow.html_url}`].join('\n\n')
+ - name: Find Release Manager Comment
+ uses: peter-evans/find-comment@v2
+ if: steps.release.outputs.pr-number
+ id: found-comment
with:
- script: |
- const { owner, repo } = context.repo
-
- const { data } = await github.rest.actions.listJobsForWorkflowRun({
- owner,
- repo,
- run_id: context.runId,
- per_page: 100
- })
-
- const jobName = process.env.JOB_NAME + process.env.MATRIX_NAME
- const job = data.jobs.find(j => j.name.endsWith(jobName))
- const jobUrl = job?.html_url
-
- const shaUrl = `${context.serverUrl}/${owner}/${repo}/commit/${{ steps.release.outputs.pr-sha }}`
-
- let summary = `This check is assosciated with ${shaUrl}\n\n`
-
- if (jobUrl) {
- summary += `For run logs, click here: ${jobUrl}`
- } else {
- summary += `Run logs could not be found for a job with name: "${jobName}"`
- }
-
- return { summary }
+ issue-number: ${{ steps.release.outputs.pr-number }}
+ comment-author: 'github-actions[bot]'
+ body-includes: '## Release Manager'
+ - name: Create Release Manager Comment
+ id: create-comment
+ if: steps.release.outputs.pr-number && !steps.found-comment.outputs.comment-id
+ uses: peter-evans/create-or-update-comment@v3
+ with:
+ issue-number: ${{ steps.release.outputs.pr-number }}
+ body: ${{ steps.comment-text.outputs.result }}
+ - name: Update Release Manager Comment
+ id: update-comment
+ if: steps.release.outputs.pr-number && steps.found-comment.outputs.comment-id
+ uses: peter-evans/create-or-update-comment@v3
+ with:
+ comment-id: ${{ steps.found-comment.outputs.comment-id }}
+ body: ${{ steps.comment-text.outputs.result }}
+ edit-mode: 'replace'
- name: Create Check
- uses: LouisBrunner/[email protected]
- id: check
+ id: create-check
+ uses: ./.github/actions/create-check
if: steps.release.outputs.pr-sha
with:
+ name: "Release"
token: ${{ secrets.GITHUB_TOKEN }}
- status: in_progress
- name: Release
sha: ${{ steps.release.outputs.pr-sha }}
- output: ${{ steps.check-output.outputs.result }}
update:
needs: release
outputs:
sha: ${{ steps.commit.outputs.sha }}
- check-id: ${{ steps.check.outputs.check_id }}
+ check-id: ${{ steps.create-check.outputs.check-id }}
name: Update - Release
if: github.repository_owner == 'npm' && needs.release.outputs.pr
runs-on: ubuntu-latest
@@ -147,32 +108,41 @@ jobs:
shell: bash
steps:
- name: Checkout
- uses: actions/checkout@v3
+ uses: actions/checkout@v4
with:
fetch-depth: 0
- ref: ${{ needs.release.outputs.branch }}
+ ref: ${{ needs.release.outputs.pr-branch }}
- name: Setup Git User
run: |
git config --global user.email "[email protected]"
git config --global user.name "npm CLI robot"
- name: Setup Node
- uses: actions/setup-node@v3
+ uses: actions/setup-node@v4
+ id: node
+ with:
+ node-version: 22.x
+ check-latest: contains('22.x', '.x')
+ - name: Install Latest npm
+ uses: ./.github/actions/install-latest-npm
with:
- node-version: 18.x
- - name: Install npm@8
- run: npm i --prefer-online --no-fund --no-audit -g npm@8
- - name: npm Version
- run: npm -v
+ node: ${{ steps.node.outputs.node-version }}
- name: Install Dependencies
run: npm i --ignore-scripts --no-audit --no-fund
+ - name: Create Release Manager Checklist Text
+ id: comment-text
+ env:
+ GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
+ run: npm exec --offline -- template-oss-release-manager --pr="${{ needs.release.outputs.pr-number }}" --backport="" --defaultTag="latest" --publish
+ - name: Append Release Manager Comment
+ uses: peter-evans/create-or-update-comment@v3
+ with:
+ comment-id: ${{ needs.release.outputs.comment-id }}
+ body: ${{ steps.comment-text.outputs.result }}
+ edit-mode: 'append'
- name: Run Post Pull Request Actions
env:
- RELEASE_PR_NUMBER: ${{ needs.release.outputs.pr-number }}
- RELEASE_COMMENT_ID: ${{ needs.release.outputs.comment-id }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- run: |
- npm exec --offline -- template-oss-release-manager --lockfile=false --publish=true
- npm run rp-pull-request --ignore-scripts --if-present
+ run: npm run rp-pull-request --ignore-scripts --if-present -- --pr="${{ needs.release.outputs.pr-number }}" --commentId="${{ needs.release.outputs.comment-id }}"
- name: Commit
id: commit
env:
@@ -181,52 +151,16 @@ jobs:
git commit --all --amend --no-edit || true
git push --force-with-lease
echo "sha=$(git rev-parse HEAD)" >> $GITHUB_OUTPUT
- - name: Get Workflow Job
- uses: actions/github-script@v6
- if: steps.commit.outputs.sha
- id: check-output
- env:
- JOB_NAME: "Update - Release"
- MATRIX_NAME: ""
- with:
- script: |
- const { owner, repo } = context.repo
-
- const { data } = await github.rest.actions.listJobsForWorkflowRun({
- owner,
- repo,
- run_id: context.runId,
- per_page: 100
- })
-
- const jobName = process.env.JOB_NAME + process.env.MATRIX_NAME
- const job = data.jobs.find(j => j.name.endsWith(jobName))
- const jobUrl = job?.html_url
-
- const shaUrl = `${context.serverUrl}/${owner}/${repo}/commit/${{ steps.commit.outputs.sha }}`
-
- let summary = `This check is assosciated with ${shaUrl}\n\n`
-
- if (jobUrl) {
- summary += `For run logs, click here: ${jobUrl}`
- } else {
- summary += `Run logs could not be found for a job with name: "${jobName}"`
- }
-
- return { summary }
- name: Create Check
- uses: LouisBrunner/[email protected]
- id: check
- if: steps.commit.outputs.sha
+ id: create-check
+ uses: ./.github/actions/create-check
with:
+ name: "Update - Release"
+ check-name: "Release"
token: ${{ secrets.GITHUB_TOKEN }}
- status: in_progress
- name: Release
sha: ${{ steps.commit.outputs.sha }}
- output: ${{ steps.check-output.outputs.result }}
- name: Conclude Check
uses: LouisBrunner/[email protected]
- if: needs.release.outputs.check-id && always()
with:
token: ${{ secrets.GITHUB_TOKEN }}
conclusion: ${{ job.status }}
@@ -238,7 +172,7 @@ jobs:
if: needs.release.outputs.pr
uses: ./.github/workflows/ci-release.yml
with:
- ref: ${{ needs.release.outputs.branch }}
+ ref: ${{ needs.release.outputs.pr-branch }}
check-sha: ${{ needs.update.outputs.sha }}
post-ci:
@@ -250,8 +184,8 @@ jobs:
run:
shell: bash
steps:
- - name: Get Needs Result
- id: needs-result
+ - name: Get CI Conclusion
+ id: conclusion
run: |
result=""
if [[ "${{ contains(needs.*.result, 'failure') }}" == "true" ]]; then
@@ -264,14 +198,15 @@ jobs:
echo "result=$result" >> $GITHUB_OUTPUT
- name: Conclude Check
uses: LouisBrunner/[email protected]
- if: needs.update.outputs.check-id && always()
with:
token: ${{ secrets.GITHUB_TOKEN }}
- conclusion: ${{ steps.needs-result.outputs.result }}
+ conclusion: ${{ steps.conclusion.outputs.result }}
check_id: ${{ needs.update.outputs.check-id }}
post-release:
needs: release
+ outputs:
+ comment-id: ${{ steps.create-comment.outputs.comment-id }}
name: Post Release - Release
if: github.repository_owner == 'npm' && needs.release.outputs.releases
runs-on: ubuntu-latest
@@ -279,79 +214,54 @@ jobs:
run:
shell: bash
steps:
- - name: Create Release PR Comment
- uses: actions/github-script@v6
+ - name: Create Release PR Comment Text
+ id: comment-text
+ uses: actions/github-script@v7
env:
RELEASES: ${{ needs.release.outputs.releases }}
with:
+ result-encoding: string
script: |
const releases = JSON.parse(process.env.RELEASES)
const { runId, repo: { owner, repo } } = context
const issue_number = releases[0].prNumber
-
- let body = '## Release Workflow\n\n'
- for (const { pkgName, version, url } of releases) {
- body += `- \`${pkgName}@${version}\` ${url}\n`
- }
-
- const comments = await github.paginate(github.rest.issues.listComments, { owner, repo, issue_number })
- .then(cs => cs.map(c => ({ id: c.id, login: c.user.login, body: c.body })))
- console.log(`Found comments: ${JSON.stringify(comments, null, 2)}`)
- const releaseComments = comments.filter(c => c.login === 'github-actions[bot]' && c.body.includes('Release is at'))
-
- for (const comment of releaseComments) {
- console.log(`Release comment: ${JSON.stringify(comment, null, 2)}`)
- await github.rest.issues.deleteComment({ owner, repo, comment_id: comment.id })
- }
-
const runUrl = `https://github.com/${owner}/${repo}/actions/runs/${runId}`
- await github.rest.issues.createComment({
- owner,
- repo,
- issue_number,
- body: `${body}- Workflow run: :arrows_counterclockwise: ${runUrl}`,
- })
+
+ return [
+ '## Release Workflow\n',
+ ...releases.map(r => `- \`${r.pkgName}@${r.version}\` ${r.url}`),
+ `- Workflow run: :arrows_counterclockwise: ${runUrl}`,
+ ].join('\n')
+ - name: Create Release PR Comment
+ id: create-comment
+ uses: peter-evans/create-or-update-comment@v3
+ with:
+ issue-number: ${{ fromJSON(needs.release.outputs.releases)[0].prNumber }}
+ body: ${{ steps.comment-text.outputs.result }}
release-integration:
needs: release
name: Release Integration
- if: needs.release.outputs.release
- runs-on: ubuntu-latest
- defaults:
- run:
- shell: bash
+ if: needs.release.outputs.releases
+ uses: ./.github/workflows/release-integration.yml
permissions:
- deployments: write
id-token: write
- steps:
- - name: Checkout
- uses: actions/checkout@v3
- with:
- ref: ${{ fromJSON(needs.release.outputs.release).tagName }}
- - name: Setup Node
- uses: actions/setup-node@v3
- with:
- node-version: 18.x
- - name: Install npm@latest
- run: |
- npm i --prefer-online --no-fund --no-audit -g npm@latest
- npm config set '//registry.npmjs.org/:_authToken'=\${PUBLISH_TOKEN}
- - name: Publish
- env:
- PUBLISH_TOKEN: ${{ secrets.PUBLISH_TOKEN }}
- run: npm publish --provenance
+ secrets:
+ PUBLISH_TOKEN: ${{ secrets.PUBLISH_TOKEN }}
+ with:
+ releases: ${{ needs.release.outputs.releases }}
post-release-integration:
- needs: [ release, release-integration ]
+ needs: [ release, release-integration, post-release ]
name: Post Release Integration - Release
- if: github.repository_owner == 'npm' && needs.release.outputs.release && always()
+ if: github.repository_owner == 'npm' && needs.release.outputs.releases && always()
runs-on: ubuntu-latest
defaults:
run:
shell: bash
steps:
- - name: Get Needs Result
- id: needs-result
+ - name: Get Post Release Conclusion
+ id: conclusion
run: |
if [[ "${{ contains(needs.*.result, 'failure') }}" == "true" ]]; then
result="x"
@@ -361,39 +271,38 @@ jobs:
result="white_check_mark"
fi
echo "result=$result" >> $GITHUB_OUTPUT
- - name: Update Release PR Comment
- uses: actions/github-script@v6
+ - name: Find Release PR Comment
+ uses: peter-evans/find-comment@v2
+ id: found-comment
+ with:
+ issue-number: ${{ fromJSON(needs.release.outputs.releases)[0].prNumber }}
+ comment-author: 'github-actions[bot]'
+ body-includes: '## Release Workflow'
+ - name: Create Release PR Comment Text
+ id: comment-text
+ if: steps.found-comment.outputs.comment-id
+ uses: actions/github-script@v7
env:
- PR_NUMBER: ${{ fromJSON(needs.release.outputs.release).prNumber }}
- RESULT: ${{ steps.needs-result.outputs.result }}
+ RESULT: ${{ steps.conclusion.outputs.result }}
+ BODY: ${{ steps.found-comment.outputs.comment-body }}
with:
+ result-encoding: string
script: |
- const { PR_NUMBER: issue_number, RESULT } = process.env
- const { runId, repo: { owner, repo } } = context
-
- const comments = await github.paginate(github.rest.issues.listComments, { owner, repo, issue_number })
- const updateComment = comments.find(c =>
- c.user.login === 'github-actions[bot]' &&
- c.body.startsWith('## Release Workflow\n\n') &&
- c.body.includes(runId)
- )
-
- if (updateComment) {
- console.log('Found comment to update:', JSON.stringify(updateComment, null, 2))
- let body = updateComment.body.replace(/Workflow run: :[a-z_]+:/, `Workflow run: :${RESULT}:`)
- const tagCodeowner = RESULT !== 'white_check_mark'
- if (tagCodeowner) {
- body += `\n\n:rotating_light:`
- body += ` @npm/cli-team: The post-release workflow failed for this release.`
- body += ` Manual steps may need to be taken after examining the workflow output`
- body += ` from the above workflow run. :rotating_light:`
- }
- await github.rest.issues.updateComment({
- owner,
- repo,
- body,
- comment_id: updateComment.id,
- })
- } else {
- console.log('No matching comments found:', JSON.stringify(comments, null, 2))
+ const { RESULT, BODY } = process.env
+ const body = [BODY.replace(/(Workflow run: :)[a-z_]+(:)/, `$1${RESULT}$2`)]
+ if (RESULT !== 'white_check_mark') {
+ body.push(':rotating_light::rotating_light::rotating_light:')
+ body.push([
+ '@npm/cli-team: The post-release workflow failed for this release.',
+ 'Manual steps may need to be taken after examining the workflow output.'
+ ].join(' '))
+ body.push(':rotating_light::rotating_light::rotating_light:')
}
+ return body.join('\n\n').trim()
+ - name: Update Release PR Comment
+ if: steps.comment-text.outputs.result
+ uses: peter-evans/create-or-update-comment@v3
+ with:
+ comment-id: ${{ steps.found-comment.outputs.comment-id }}
+ body: ${{ steps.comment-text.outputs.result }}
+ edit-mode: 'replace'
diff --git .gitignore .gitignore
index 00bdaf2b..ac3c1dad 100644
--- .gitignore
+++ .gitignore
@@ -3,15 +3,18 @@
# ignore everything in the root
/*
-# keep these
!**/.gitignore
!/.commitlintrc.js
!/.eslintrc.js
!/.eslintrc.local.*
+!/.git-blame-ignore-revs
!/.github/
!/.gitignore
!/.npmrc
+!/.prettierignore
+!/.prettierrc.js
!/.release-please-manifest.json
+!/benchmarks
!/bin/
!/CHANGELOG*
!/classes/
@@ -34,3 +37,5 @@
!/SECURITY.md
!/tap-snapshots/
!/test/
+!/tsconfig.json
+tap-testdir*/
diff --git .release-please-manifest.json .release-please-manifest.json
index cc729eee..df0299e9 100644
--- .release-please-manifest.json
+++ .release-please-manifest.json
@@ -1,3 +1,3 @@
{
- ".": "7.5.3"
+ ".": "7.7.1"
}
diff --git CHANGELOG.md CHANGELOG.md
index 292ed24a..f80a7622 100644
--- CHANGELOG.md
+++ CHANGELOG.md
@@ -1,5 +1,90 @@
# Changelog
+## [7.7.1](https://github.com/npm/node-semver/compare/v7.7.0...v7.7.1) (2025-02-03)
+### Bug Fixes
+* [`af761c0`](https://github.com/npm/node-semver/commit/af761c05bd53eef83b5e20f8b09360b0e70557dc) [#764](https://github.com/npm/node-semver/pull/764) inc: fully capture prerelease identifier (#764) (@wraithgar)
+
+## [7.7.0](https://github.com/npm/node-semver/compare/v7.6.3...v7.7.0) (2025-01-29)
+### Features
+* [`0864b3c`](https://github.com/npm/node-semver/commit/0864b3ce7932667013e0c7c5ec764777d4682883) [#753](https://github.com/npm/node-semver/pull/753) add "release" inc type (#753) (@mbtools)
+### Bug Fixes
+* [`d588e37`](https://github.com/npm/node-semver/commit/d588e3782864b1cab2fe9f2452b848e8c7f609d1) [#755](https://github.com/npm/node-semver/pull/755) diff: fix prerelease to stable version diff logic (#755) (@eminberkayd, berkay.daglar)
+* [`8a34bde`](https://github.com/npm/node-semver/commit/8a34bdecc783407f4e1a8a1ee1f67906b84a4b78) [#754](https://github.com/npm/node-semver/pull/754) add identifier validation to `inc()` (#754) (@mbtools)
+### Documentation
+* [`67e5478`](https://github.com/npm/node-semver/commit/67e54785a0f871361230f84323cbb631b9b6d834) [#756](https://github.com/npm/node-semver/pull/756) readme: added missing period for consistency (#756) (@shaymolcho)
+* [`868d4bb`](https://github.com/npm/node-semver/commit/868d4bbe3d318c52544f38d5f9977a1103e924c2) [#749](https://github.com/npm/node-semver/pull/749) clarify comment about obsolete prefixes (#749) (@mbtools, @ljharb)
+### Chores
+* [`145c554`](https://github.com/npm/node-semver/commit/145c554b8c7b7ecfcb451153ad18bdb2f24ad10d) [#741](https://github.com/npm/node-semver/pull/741) bump @npmcli/eslint-config from 4.0.5 to 5.0.0 (@dependabot[bot])
+* [`753e02b`](https://github.com/npm/node-semver/commit/753e02b9d0cb3ac23e085dc33efcab3e08d61f2b) [#747](https://github.com/npm/node-semver/pull/747) bump @npmcli/template-oss from 4.23.3 to 4.23.4 (#747) (@dependabot[bot], @npm-cli-bot)
+* [`0b812d5`](https://github.com/npm/node-semver/commit/0b812d5fb5fbb208e89dc1250e2efafeaa549437) [#744](https://github.com/npm/node-semver/pull/744) postinstall for dependabot template-oss PR (@hashtagchris)
+
+## [7.6.3](https://github.com/npm/node-semver/compare/v7.6.2...v7.6.3) (2024-07-16)
+
+### Bug Fixes
+
+* [`73a3d79`](https://github.com/npm/node-semver/commit/73a3d79c4ec32d5dd62c9d5f64e5af7fbdad9ec0) [#726](https://github.com/npm/node-semver/pull/726) optimize Range parsing and formatting (#726) (@jviide)
+
+### Documentation
+
+* [`2975ece`](https://github.com/npm/node-semver/commit/2975ece120e17660c9f1ef517de45c09ff821064) [#719](https://github.com/npm/node-semver/pull/719) fix extra backtick typo (#719) (@stdavis)
+
+## [7.6.2](https://github.com/npm/node-semver/compare/v7.6.1...v7.6.2) (2024-05-09)
+
+### Bug Fixes
+
+* [`6466ba9`](https://github.com/npm/node-semver/commit/6466ba9b540252db405fdd2a289dd4651495beea) [#713](https://github.com/npm/node-semver/pull/713) lru: use map.delete() directly (#713) (@negezor, @lukekarrys)
+
+## [7.6.1](https://github.com/npm/node-semver/compare/v7.6.0...v7.6.1) (2024-05-04)
+
+### Bug Fixes
+
+* [`c570a34`](https://github.com/npm/node-semver/commit/c570a348ffc6612af07fe94fa46b9affa5e4eff0) [#704](https://github.com/npm/node-semver/pull/704) linting: no-unused-vars (@wraithgar)
+* [`ad8ff11`](https://github.com/npm/node-semver/commit/ad8ff11dd200dac3a05097d9a82d1977ccfa1535) [#704](https://github.com/npm/node-semver/pull/704) use internal cache implementation (@mbtools)
+* [`ac9b357`](https://github.com/npm/node-semver/commit/ac9b35769ab0ddfefd5a3af4a3ecaf3da2012352) [#682](https://github.com/npm/node-semver/pull/682) typo in compareBuild debug message (#682) (@mbtools)
+
+### Dependencies
+
+* [`988a8de`](https://github.com/npm/node-semver/commit/988a8deb3ea76b9a314a740e66b5fc2f726822f8) [#709](https://github.com/npm/node-semver/pull/709) uninstall `lru-cache` (#709)
+* [`3fabe4d`](https://github.com/npm/node-semver/commit/3fabe4dbfbd199fdb589c076a7f30bc1f18c6614) [#704](https://github.com/npm/node-semver/pull/704) remove lru-cache
+
+### Chores
+
+* [`dd09b60`](https://github.com/npm/node-semver/commit/dd09b60da1e618335d7c269426345b336fd5f63d) [#705](https://github.com/npm/node-semver/pull/705) bump @npmcli/template-oss to 4.22.0 (@lukekarrys)
+* [`ec49cdc`](https://github.com/npm/node-semver/commit/ec49cdcece9db0020d6829b246681ff65a393644) [#701](https://github.com/npm/node-semver/pull/701) chore: chore: postinstall for dependabot template-oss PR (@lukekarrys)
+* [`b236c3d`](https://github.com/npm/node-semver/commit/b236c3d2f357a16a733c96ec2ca8c57848b70091) [#696](https://github.com/npm/node-semver/pull/696) add benchmarks (#696) (@H4ad)
+* [`692451b`](https://github.com/npm/node-semver/commit/692451bd6f75b38a71a99f39da405c94a5954a22) [#688](https://github.com/npm/node-semver/pull/688) various improvements to README (#688) (@mbtools)
+* [`5feeb7f`](https://github.com/npm/node-semver/commit/5feeb7f4f63061e19a29087115b50cb04135b63e) [#705](https://github.com/npm/node-semver/pull/705) postinstall for dependabot template-oss PR (@lukekarrys)
+* [`074156f`](https://github.com/npm/node-semver/commit/074156f64fa91723fe1ae6af8cc497014b9b7aff) [#701](https://github.com/npm/node-semver/pull/701) bump @npmcli/template-oss from 4.21.3 to 4.21.4 (@dependabot[bot])
+
+## [7.6.0](https://github.com/npm/node-semver/compare/v7.5.4...v7.6.0) (2024-01-31)
+
+### Features
+
+* [`a7ab13a`](https://github.com/npm/node-semver/commit/a7ab13a46201e342d34e84a989632b380f755baf) [#671](https://github.com/npm/node-semver/pull/671) preserve pre-release and build parts of a version on coerce (#671) (@madtisa, madtisa, @wraithgar)
+
+### Chores
+
+* [`816c7b2`](https://github.com/npm/node-semver/commit/816c7b2cbfcb1986958a290f941eddfd0441139e) [#667](https://github.com/npm/node-semver/pull/667) postinstall for dependabot template-oss PR (@lukekarrys)
+* [`0bd24d9`](https://github.com/npm/node-semver/commit/0bd24d943cbd1a7f6a2b8d384590bfa98559e1de) [#667](https://github.com/npm/node-semver/pull/667) bump @npmcli/template-oss from 4.21.1 to 4.21.3 (@dependabot[bot])
+* [`e521932`](https://github.com/npm/node-semver/commit/e521932f115a81030f4e7c34e8631cdd3c6a108b) [#652](https://github.com/npm/node-semver/pull/652) postinstall for dependabot template-oss PR (@lukekarrys)
+* [`8873991`](https://github.com/npm/node-semver/commit/88739918080debeb239aae840b35c07436148e50) [#652](https://github.com/npm/node-semver/pull/652) chore: chore: postinstall for dependabot template-oss PR (@lukekarrys)
+* [`f317dc8`](https://github.com/npm/node-semver/commit/f317dc8689781bcfd98e2c32b46157276acdd47c) [#652](https://github.com/npm/node-semver/pull/652) bump @npmcli/template-oss from 4.19.0 to 4.21.0 (@dependabot[bot])
+* [`7303db1`](https://github.com/npm/node-semver/commit/7303db1fe54d6905b23ccb0162878e37d73535ef) [#658](https://github.com/npm/node-semver/pull/658) add clean() test for build metadata (#658) (@jethrodaniel)
+* [`6240d75`](https://github.com/npm/node-semver/commit/6240d75a7c620b0a222f05969a91fdc3dc2be0fb) [#656](https://github.com/npm/node-semver/pull/656) add missing quotes in README.md (#656) (@zyxkad)
+* [`14d263f`](https://github.com/npm/node-semver/commit/14d263faa156e408a033b9b12a2f87735c2df42c) [#625](https://github.com/npm/node-semver/pull/625) postinstall for dependabot template-oss PR (@lukekarrys)
+* [`7c34e1a`](https://github.com/npm/node-semver/commit/7c34e1ac1bcc0bc6579b30745c96075c69bd0332) [#625](https://github.com/npm/node-semver/pull/625) bump @npmcli/template-oss from 4.18.1 to 4.19.0 (@dependabot[bot])
+* [`123e0b0`](https://github.com/npm/node-semver/commit/123e0b03287e1af295ef82d55f55c16805596f35) [#622](https://github.com/npm/node-semver/pull/622) postinstall for dependabot template-oss PR (@lukekarrys)
+* [`737d5e1`](https://github.com/npm/node-semver/commit/737d5e1cf10e631bab8a28594aa2d5c9d4090814) [#622](https://github.com/npm/node-semver/pull/622) bump @npmcli/template-oss from 4.18.0 to 4.18.1 (@dependabot[bot])
+* [`cce6180`](https://github.com/npm/node-semver/commit/cce61804ba6f997225a1267135c06676fe0524d2) [#598](https://github.com/npm/node-semver/pull/598) postinstall for dependabot template-oss PR (@lukekarrys)
+* [`b914a3d`](https://github.com/npm/node-semver/commit/b914a3d0d26ca27d2685053d7d390af4e02eedd9) [#598](https://github.com/npm/node-semver/pull/598) bump @npmcli/template-oss from 4.17.0 to 4.18.0 (@dependabot[bot])
+
+## [7.5.4](https://github.com/npm/node-semver/compare/v7.5.3...v7.5.4) (2023-07-07)
+
+### Bug Fixes
+
+* [`cc6fde2`](https://github.com/npm/node-semver/commit/cc6fde2d34b95cb600d126649d926901bd2a9703) [#588](https://github.com/npm/node-semver/pull/588) trim each range set before parsing (@lukekarrys)
+* [`99d8287`](https://github.com/npm/node-semver/commit/99d8287516a1d2abf0286033e2e26eca6b69c09f) [#583](https://github.com/npm/node-semver/pull/583) correctly parse long build ids as valid (#583) (@lukekarrys)
+
## [7.5.3](https://github.com/npm/node-semver/compare/v7.5.2...v7.5.3) (2023-06-22)
### Bug Fixes
diff --git README.md README.md
index 53ea9b52..e9522153 100644
--- README.md
+++ README.md
@@ -25,7 +25,7 @@ semver.valid(semver.coerce('v2')) // '2.0.0'
semver.valid(semver.coerce('42.6.7.9.3-alpha')) // '42.6.7'
\`\`\`
-You can also just load the module for the function that you care about, if
+You can also just load the module for the function that you care about if
you'd like to minimize your footprint.
```js
@@ -78,8 +78,8 @@ const semverOutside = require('semver/ranges/outside')
const semverGtr = require('semver/ranges/gtr')
const semverLtr = require('semver/ranges/ltr')
const semverIntersects = require('semver/ranges/intersects')
-const simplifyRange = require('semver/ranges/simplify')
-const rangeSubset = require('semver/ranges/subset')
+const semverSimplifyRange = require('semver/ranges/simplify')
+const semverRangeSubset = require('semver/ranges/subset') As a command-line utility:
--preid A leading Ranges-A A
For example, the comparator -The purpose for this behavior is twofold. First, prerelease versions Second, a user who has opted into using a prerelease version has Note that this behavior can be suppressed (treating all prerelease
Here's my review of the PR: DescriptionThis PR updates the node-semver package with numerous changes and improvements. Key updates include:
Possible Issues
Security HotspotsThe removal of external dependency lru-cache reduces the attack surface and potential security vulnerabilities from third-party code. ChangesChangesBy filename:
sequenceDiagram
participant Client
participant SemVer
participant Range
participant Cache
Client->>SemVer: version operation
SemVer->>Cache: check cache
alt cache hit
Cache-->>SemVer: return cached result
else cache miss
SemVer->>Range: parse version/range
Range->>Range: lazy format value
Range-->>SemVer: return parsed result
SemVer->>Cache: store in cache
end
SemVer-->>Client: return result
|
This PR contains the following updates:
7.5.3
->7.7.1
Release Notes
npm/node-semver (semver)
v7.7.1
Compare Source
Bug Fixes
af761c0
#764 inc: fully capture prerelease identifier (#764) (@wraithgar)v7.7.0
Compare Source
Features
0864b3c
#753 add "release" inc type (#753) (@mbtools)Bug Fixes
d588e37
#755 diff: fix prerelease to stable version diff logic (#755) (@eminberkayd, berkay.daglar)8a34bde
#754 add identifier validation toinc()
(#754) (@mbtools)Documentation
67e5478
#756 readme: added missing period for consistency (#756) (@shaymolcho)868d4bb
#749 clarify comment about obsolete prefixes (#749) (@mbtools, @ljharb)Chores
145c554
#741 bump @npmcli/eslint-config from 4.0.5 to 5.0.0 (@dependabot[bot])753e02b
#747 bump @npmcli/template-oss from 4.23.3 to 4.23.4 (#747) (@dependabot[bot], @npm-cli-bot)0b812d5
#744 postinstall for dependabot template-oss PR (@hashtagchris)v7.6.3
Compare Source
Bug Fixes
73a3d79
#726 optimize Range parsing and formatting (#726) (@jviide)Documentation
2975ece
#719 fix extra backtick typo (#719) (@stdavis)v7.6.2
Compare Source
Bug Fixes
6466ba9
#713 lru: use map.delete() directly (#713) (@negezor, @lukekarrys)v7.6.1
Compare Source
Bug Fixes
c570a34
#704 linting: no-unused-vars (@wraithgar)ad8ff11
#704 use internal cache implementation (@mbtools)ac9b357
#682 typo in compareBuild debug message (#682) (@mbtools)Dependencies
988a8de
#709 uninstalllru-cache
(#709)3fabe4d
#704 remove lru-cacheChores
dd09b60
#705 bump @npmcli/template-oss to 4.22.0 (@lukekarrys)ec49cdc
#701 chore: chore: postinstall for dependabot template-oss PR (@lukekarrys)b236c3d
#696 add benchmarks (#696) (@H4ad)692451b
#688 various improvements to README (#688) (@mbtools)5feeb7f
#705 postinstall for dependabot template-oss PR (@lukekarrys)074156f
#701 bump @npmcli/template-oss from 4.21.3 to 4.21.4 (@dependabot[bot])v7.6.0
Compare Source
Features
a7ab13a
#671 preserve pre-release and build parts of a version on coerce (#671) (@madtisa, madtisa, @wraithgar)Chores
816c7b2
#667 postinstall for dependabot template-oss PR (@lukekarrys)0bd24d9
#667 bump @npmcli/template-oss from 4.21.1 to 4.21.3 (@dependabot[bot])e521932
#652 postinstall for dependabot template-oss PR (@lukekarrys)8873991
#652 chore: chore: postinstall for dependabot template-oss PR (@lukekarrys)f317dc8
#652 bump @npmcli/template-oss from 4.19.0 to 4.21.0 (@dependabot[bot])7303db1
#658 add clean() test for build metadata (#658) (@jethrodaniel)6240d75
#656 add missing quotes in README.md (#656) (@zyxkad)14d263f
#625 postinstall for dependabot template-oss PR (@lukekarrys)7c34e1a
#625 bump @npmcli/template-oss from 4.18.1 to 4.19.0 (@dependabot[bot])123e0b0
#622 postinstall for dependabot template-oss PR (@lukekarrys)737d5e1
#622 bump @npmcli/template-oss from 4.18.0 to 4.18.1 (@dependabot[bot])cce6180
#598 postinstall for dependabot template-oss PR (@lukekarrys)b914a3d
#598 bump @npmcli/template-oss from 4.17.0 to 4.18.0 (@dependabot[bot])v7.5.4
Compare Source
Bug Fixes
cc6fde2
#588 trim each range set before parsing (@lukekarrys)99d8287
#583 correctly parse long build ids as valid (#583) (@lukekarrys)Configuration
📅 Schedule: Branch creation - "* 0-12 * * 3" (UTC), Automerge - At any time (no schedule defined).
🚦 Automerge: Disabled by config. Please merge this manually once you are satisfied.
♻ Rebasing: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox.
🔕 Ignore: Close this PR and you won't be reminded about this update again.
This PR was generated by Mend Renovate. View the repository job log.