pax_global_header 0000666 0000000 0000000 00000000064 15177425606 0014527 g ustar 00root root 0000000 0000000 52 comment=460dc311b381c91d1c1abbf2c7ee11a1eaf18d33
npm-unique-slug-460dc31/ 0000775 0000000 0000000 00000000000 15177425606 0015123 5 ustar 00root root 0000000 0000000 npm-unique-slug-460dc31/.commitlintrc.js 0000664 0000000 0000000 00000000566 15177425606 0020252 0 ustar 00root root 0000000 0000000 /* This file is automatically added by @npmcli/template-oss. Do not edit. */
module.exports = {
extends: ['@commitlint/config-conventional'],
rules: {
'type-enum': [2, 'always', ['feat', 'fix', 'docs', 'deps', 'chore']],
'header-max-length': [2, 'always', 80],
'subject-case': [0],
'body-max-line-length': [0],
'footer-max-line-length': [0],
},
}
npm-unique-slug-460dc31/.eslintrc.js 0000664 0000000 0000000 00000000623 15177425606 0017363 0 ustar 00root root 0000000 0000000 /* This file is automatically added by @npmcli/template-oss. Do not edit. */
'use strict'
const { readdirSync: readdir } = require('fs')
const localConfigs = readdir(__dirname)
.filter((file) => file.startsWith('.eslintrc.local.'))
.map((file) => `./${file}`)
module.exports = {
root: true,
ignorePatterns: [
'tap-testdir*/',
],
extends: [
'@npmcli',
...localConfigs,
],
}
npm-unique-slug-460dc31/.github/ 0000775 0000000 0000000 00000000000 15177425606 0016463 5 ustar 00root root 0000000 0000000 npm-unique-slug-460dc31/.github/CODEOWNERS 0000664 0000000 0000000 00000000152 15177425606 0020054 0 ustar 00root root 0000000 0000000 # This file is automatically added by @npmcli/template-oss. Do not edit.
* @npm/cli-team @npm/cli-triage
npm-unique-slug-460dc31/.github/ISSUE_TEMPLATE/ 0000775 0000000 0000000 00000000000 15177425606 0020646 5 ustar 00root root 0000000 0000000 npm-unique-slug-460dc31/.github/ISSUE_TEMPLATE/bug.yml 0000664 0000000 0000000 00000002655 15177425606 0022156 0 ustar 00root root 0000000 0000000 # This file is automatically added by @npmcli/template-oss. Do not edit.
name: Bug
description: File a bug/issue
title: "[BUG]
"
labels: [ Bug, Needs Triage ]
body:
- type: checkboxes
attributes:
label: Is there an existing issue for this?
description: Please [search here](./issues) to see if an issue already exists for your problem.
options:
- label: I have searched the existing issues
required: true
- type: textarea
attributes:
label: Current Behavior
description: A clear & concise description of what you're experiencing.
validations:
required: false
- type: textarea
attributes:
label: Expected Behavior
description: A clear & concise description of what you expected to happen.
validations:
required: false
- type: textarea
attributes:
label: Steps To Reproduce
description: Steps to reproduce the behavior.
value: |
1. In this environment...
2. With this config...
3. Run '...'
4. See error...
validations:
required: false
- type: textarea
attributes:
label: Environment
description: |
examples:
- **npm**: 7.6.3
- **Node**: 13.14.0
- **OS**: Ubuntu 20.04
- **platform**: Macbook Pro
value: |
- npm:
- Node:
- OS:
- platform:
validations:
required: false
npm-unique-slug-460dc31/.github/ISSUE_TEMPLATE/config.yml 0000664 0000000 0000000 00000000145 15177425606 0022636 0 ustar 00root root 0000000 0000000 # This file is automatically added by @npmcli/template-oss. Do not edit.
blank_issues_enabled: true
npm-unique-slug-460dc31/.github/actions/ 0000775 0000000 0000000 00000000000 15177425606 0020123 5 ustar 00root root 0000000 0000000 npm-unique-slug-460dc31/.github/actions/create-check/ 0000775 0000000 0000000 00000000000 15177425606 0022441 5 ustar 00root root 0000000 0000000 npm-unique-slug-460dc31/.github/actions/create-check/action.yml 0000664 0000000 0000000 00000002720 15177425606 0024442 0 ustar 00root root 0000000 0000000 # 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/checks-action@v1.6.0
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 }}"}
npm-unique-slug-460dc31/.github/actions/install-latest-npm/ 0000775 0000000 0000000 00000000000 15177425606 0023653 5 ustar 00root root 0000000 0000000 npm-unique-slug-460dc31/.github/actions/install-latest-npm/action.yml 0000664 0000000 0000000 00000003406 15177425606 0025656 0 ustar 00root root 0000000 0000000 # 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
npm-unique-slug-460dc31/.github/dependabot.yml 0000664 0000000 0000000 00000000656 15177425606 0021322 0 ustar 00root root 0000000 0000000 # This file is automatically added by @npmcli/template-oss. Do not edit.
version: 2
updates:
- package-ecosystem: npm
directory: /
schedule:
interval: daily
target-branch: "main"
allow:
- dependency-type: direct
versioning-strategy: increase-if-necessary
commit-message:
prefix: deps
prefix-development: chore
labels:
- "Dependencies"
open-pull-requests-limit: 10
npm-unique-slug-460dc31/.github/matchers/ 0000775 0000000 0000000 00000000000 15177425606 0020271 5 ustar 00root root 0000000 0000000 npm-unique-slug-460dc31/.github/matchers/tap.json 0000664 0000000 0000000 00000001204 15177425606 0021745 0 ustar 00root root 0000000 0000000 {
"//@npmcli/template-oss": "This file is automatically added by @npmcli/template-oss. Do not edit.",
"problemMatcher": [
{
"owner": "tap",
"pattern": [
{
"regexp": "^\\s*not ok \\d+ - (.*)",
"message": 1
},
{
"regexp": "^\\s*---"
},
{
"regexp": "^\\s*at:"
},
{
"regexp": "^\\s*line:\\s*(\\d+)",
"line": 1
},
{
"regexp": "^\\s*column:\\s*(\\d+)",
"column": 1
},
{
"regexp": "^\\s*file:\\s*(.*)",
"file": 1
}
]
}
]
}
npm-unique-slug-460dc31/.github/settings.yml 0000664 0000000 0000000 00000001377 15177425606 0021056 0 ustar 00root root 0000000 0000000 # This file is automatically added by @npmcli/template-oss. Do not edit.
repository:
allow_merge_commit: false
allow_rebase_merge: true
allow_squash_merge: true
squash_merge_commit_title: PR_TITLE
squash_merge_commit_message: PR_BODY
delete_branch_on_merge: true
enable_automated_security_fixes: true
enable_vulnerability_alerts: true
branches:
- name: main
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" ]
npm-unique-slug-460dc31/.github/workflows/ 0000775 0000000 0000000 00000000000 15177425606 0020520 5 ustar 00root root 0000000 0000000 npm-unique-slug-460dc31/.github/workflows/audit.yml 0000664 0000000 0000000 00000002275 15177425606 0022357 0 ustar 00root root 0000000 0000000 # This file is automatically added by @npmcli/template-oss. Do not edit.
name: Audit
on:
workflow_dispatch:
schedule:
# "At 08:00 UTC (01:00 PT) on Monday" https://crontab.guru/#0_8_*_*_1
- cron: "0 8 * * 1"
permissions:
contents: read
jobs:
audit:
name: Audit Dependencies
if: github.repository_owner == 'npm'
runs-on: ubuntu-latest
defaults:
run:
shell: bash
steps:
- name: Checkout
uses: actions/checkout@v6
- name: Setup Git User
run: |
git config --global user.email "npm-cli+bot@github.com"
git config --global user.name "npm CLI robot"
- name: Setup Node
uses: actions/setup-node@v6
id: node
with:
node-version: 26.x
check-latest: contains('26.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
run: npm audit --omit=dev
- name: Run Full Audit
run: npm audit --audit-level=none
npm-unique-slug-460dc31/.github/workflows/ci-release.yml 0000664 0000000 0000000 00000011652 15177425606 0023261 0 ustar 00root root 0000000 0000000 # This file is automatically added by @npmcli/template-oss. Do not edit.
name: CI - Release
on:
workflow_dispatch:
inputs:
ref:
required: true
type: string
default: main
workflow_call:
inputs:
ref:
required: true
type: string
check-sha:
required: true
type: string
permissions:
contents: read
checks: write
jobs:
lint-all:
name: Lint All
if: github.repository_owner == 'npm'
runs-on: ubuntu-latest
defaults:
run:
shell: bash
steps:
- name: Checkout
uses: actions/checkout@v6
with:
ref: ${{ inputs.ref }}
- name: Setup Git User
run: |
git config --global user.email "npm-cli+bot@github.com"
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@v6
id: node
with:
node-version: 26.x
check-latest: contains('26.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
run: npm run lint --ignore-scripts
- name: Post Lint
run: npm run postlint --ignore-scripts
- name: Conclude Check
uses: LouisBrunner/checks-action@v1.6.0
if: steps.create-check.outputs.check-id && always()
with:
token: ${{ secrets.GITHUB_TOKEN }}
conclusion: ${{ job.status }}
check_id: ${{ steps.create-check.outputs.check-id }}
test-all:
name: Test All - ${{ matrix.platform.name }} - ${{ matrix.node-version }}
if: github.repository_owner == 'npm'
strategy:
fail-fast: false
matrix:
platform:
- name: Linux
os: ubuntu-latest
shell: bash
- name: macOS
os: macos-latest
shell: bash
- name: macOS
os: macos-15-intel
shell: bash
- name: Windows
os: windows-latest
shell: cmd
node-version:
- 22.22.2
- 22.x
- 24.15.0
- 24.x
- 26.0.0
- 26.x
exclude:
- platform: { name: macOS, os: macos-15-intel, shell: bash }
node-version: 22.22.2
- platform: { name: macOS, os: macos-15-intel, shell: bash }
node-version: 22.x
- platform: { name: macOS, os: macos-15-intel, shell: bash }
node-version: 24.15.0
- platform: { name: macOS, os: macos-15-intel, shell: bash }
node-version: 24.x
- platform: { name: macOS, os: macos-15-intel, shell: bash }
node-version: 26.0.0
- platform: { name: macOS, os: macos-15-intel, shell: bash }
node-version: 26.x
runs-on: ${{ matrix.platform.os }}
defaults:
run:
shell: ${{ matrix.platform.shell }}
steps:
- name: Checkout
uses: actions/checkout@v6
with:
ref: ${{ inputs.ref }}
- name: Setup Git User
run: |
git config --global user.email "npm-cli+bot@github.com"
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@v6
id: node
with:
node-version: ${{ matrix.node-version }}
check-latest: contains(matrix.node-version, '.x')
- name: Install Latest npm
if: ${{ !startsWith(matrix.node-version, '22.') }}
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: Test (with coverage on Node >= 24)
if: ${{ startsWith(matrix.node-version, '24') }}
run: npm run test:cover --ignore-scripts
- name: Test (without coverage on Node < 24)
if: ${{ !startsWith(matrix.node-version, '24') }}
run: npm test --ignore-scripts
- name: Conclude Check
uses: LouisBrunner/checks-action@v1.6.0
if: steps.create-check.outputs.check-id && always()
with:
token: ${{ secrets.GITHUB_TOKEN }}
conclusion: ${{ job.status }}
check_id: ${{ steps.create-check.outputs.check-id }}
npm-unique-slug-460dc31/.github/workflows/ci.yml 0000664 0000000 0000000 00000007104 15177425606 0021640 0 ustar 00root root 0000000 0000000 # This file is automatically added by @npmcli/template-oss. Do not edit.
name: CI
on:
workflow_dispatch:
pull_request:
push:
branches:
- main
schedule:
# "At 09:00 UTC (02:00 PT) on Monday" https://crontab.guru/#0_9_*_*_1
- cron: "0 9 * * 1"
permissions:
contents: read
jobs:
lint:
name: Lint
if: github.repository_owner == 'npm'
runs-on: ubuntu-latest
defaults:
run:
shell: bash
steps:
- name: Checkout
uses: actions/checkout@v6
- name: Setup Git User
run: |
git config --global user.email "npm-cli+bot@github.com"
git config --global user.name "npm CLI robot"
- name: Setup Node
uses: actions/setup-node@v6
id: node
with:
node-version: 26.x
check-latest: contains('26.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
run: npm run lint --ignore-scripts
- name: Post Lint
run: npm run postlint --ignore-scripts
test:
name: Test - ${{ matrix.platform.name }} - ${{ matrix.node-version }}
if: github.repository_owner == 'npm'
strategy:
fail-fast: false
matrix:
platform:
- name: Linux
os: ubuntu-latest
shell: bash
- name: macOS
os: macos-latest
shell: bash
- name: macOS
os: macos-15-intel
shell: bash
- name: Windows
os: windows-latest
shell: cmd
node-version:
- 22.22.2
- 22.x
- 24.15.0
- 24.x
- 26.0.0
- 26.x
exclude:
- platform: { name: macOS, os: macos-15-intel, shell: bash }
node-version: 22.22.2
- platform: { name: macOS, os: macos-15-intel, shell: bash }
node-version: 22.x
- platform: { name: macOS, os: macos-15-intel, shell: bash }
node-version: 24.15.0
- platform: { name: macOS, os: macos-15-intel, shell: bash }
node-version: 24.x
- platform: { name: macOS, os: macos-15-intel, shell: bash }
node-version: 26.0.0
- platform: { name: macOS, os: macos-15-intel, shell: bash }
node-version: 26.x
runs-on: ${{ matrix.platform.os }}
defaults:
run:
shell: ${{ matrix.platform.shell }}
steps:
- name: Checkout
uses: actions/checkout@v6
- name: Setup Git User
run: |
git config --global user.email "npm-cli+bot@github.com"
git config --global user.name "npm CLI robot"
- name: Setup Node
uses: actions/setup-node@v6
id: node
with:
node-version: ${{ matrix.node-version }}
check-latest: contains(matrix.node-version, '.x')
- name: Install Latest npm
if: ${{ !startsWith(matrix.node-version, '22.') }}
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: Test (with coverage on Node >= 24)
if: ${{ startsWith(matrix.node-version, '24') }}
run: npm run test:cover --ignore-scripts
- name: Test (without coverage on Node < 24)
if: ${{ !startsWith(matrix.node-version, '24') }}
run: npm test --ignore-scripts
npm-unique-slug-460dc31/.github/workflows/codeql-analysis.yml 0000664 0000000 0000000 00000001606 15177425606 0024336 0 ustar 00root root 0000000 0000000 # This file is automatically added by @npmcli/template-oss. Do not edit.
name: CodeQL
on:
push:
branches:
- main
pull_request:
branches:
- main
schedule:
# "At 10:00 UTC (03:00 PT) on Monday" https://crontab.guru/#0_10_*_*_1
- cron: "0 10 * * 1"
permissions:
contents: read
jobs:
analyze:
name: Analyze
runs-on: ubuntu-latest
permissions:
actions: read
contents: read
security-events: write
steps:
- name: Checkout
uses: actions/checkout@v6
- name: Setup Git User
run: |
git config --global user.email "npm-cli+bot@github.com"
git config --global user.name "npm CLI robot"
- name: Initialize CodeQL
uses: github/codeql-action/init@v3
with:
languages: javascript
- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v3
npm-unique-slug-460dc31/.github/workflows/post-dependabot.yml 0000664 0000000 0000000 00000012004 15177425606 0024330 0 ustar 00root root 0000000 0000000 # This file is automatically added by @npmcli/template-oss. Do not edit.
name: Post Dependabot
on: pull_request
permissions:
contents: write
jobs:
template-oss:
name: template-oss
if: github.repository_owner == 'npm' && github.actor == 'dependabot[bot]'
runs-on: ubuntu-latest
defaults:
run:
shell: bash
steps:
- name: Checkout
uses: actions/checkout@v6
with:
ref: ${{ github.event.pull_request.head.ref }}
- name: Setup Git User
run: |
git config --global user.email "npm-cli+bot@github.com"
git config --global user.name "npm CLI robot"
- name: Setup Node
uses: actions/setup-node@v6
id: node
with:
node-version: 26.x
check-latest: contains('26.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
id: metadata
uses: dependabot/fetch-metadata@v1
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
# Dependabot can update multiple directories so we output which directory
# it is acting on so we can run the command for the correct root or workspace
- name: Get Dependabot Directory
if: contains(steps.metadata.outputs.dependency-names, '@npmcli/template-oss')
id: flags
run: |
dependabot_dir="${{ steps.metadata.outputs.directory }}"
if [[ "$dependabot_dir" == "/" || "$dependabot_dir" == "/main" ]]; then
echo "workspace=-iwr" >> $GITHUB_OUTPUT
else
# strip leading slash from directory so it works as a
# a path to the workspace flag
echo "workspace=--workspace ${dependabot_dir#/}" >> $GITHUB_OUTPUT
fi
- name: Apply Changes
if: steps.flags.outputs.workspace
id: apply
run: |
npm run template-oss-apply ${{ steps.flags.outputs.workspace }}
if [[ `git status --porcelain` ]]; then
echo "changes=true" >> $GITHUB_OUTPUT
fi
# This only sets the conventional commit prefix. This workflow can't reliably determine
# what the breaking change is though. If a BREAKING CHANGE message is required then
# this PR check will fail and the commit will be amended with stafftools
if [[ "${{ steps.metadata.outputs.update-type }}" == "version-update:semver-major" ]]; then
prefix='feat!'
else
prefix='chore'
fi
echo "message=$prefix: postinstall for dependabot template-oss PR" >> $GITHUB_OUTPUT
# This step will fail if template-oss has made any workflow updates. It is impossible
# for a workflow to update other workflows. In the case it does fail, we continue
# and then try to apply only a portion of the changes in the next step
- name: Push All Changes
if: steps.apply.outputs.changes
id: push
continue-on-error: true
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
git commit -am "${{ steps.apply.outputs.message }}"
git push
# If the previous step failed, then reset the commit and remove any workflow changes
# and attempt to commit and push again. This is helpful because we will have a commit
# with the correct prefix that we can then --amend with @npmcli/stafftools later.
- name: Push All Changes Except Workflows
if: steps.apply.outputs.changes && steps.push.outcome == 'failure'
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
git reset HEAD~
git checkout HEAD -- .github/workflows/
git clean -fd .github/workflows/
git commit -am "${{ steps.apply.outputs.message }}"
git push
# Check if all the necessary template-oss changes were applied. Since we continued
# on errors in one of the previous steps, this check will fail if our follow up
# only applied a portion of the changes and we need to followup manually.
#
# Note that this used to run `lint` and `postlint` but that will fail this action
# if we've also shipped any linting changes separate from template-oss. We do
# linting in another action, so we want to fail this one only if there are
# template-oss changes that could not be applied.
- name: Check Changes
if: steps.apply.outputs.changes
run: |
npm exec --offline ${{ steps.flags.outputs.workspace }} -- template-oss-check
- name: Fail on Breaking Change
if: steps.apply.outputs.changes && startsWith(steps.apply.outputs.message, 'feat!')
run: |
echo "This PR has a breaking change. Run 'npx -p @npmcli/stafftools gh template-oss-fix'"
echo "for more information on how to fix this with a BREAKING CHANGE footer."
exit 1
npm-unique-slug-460dc31/.github/workflows/pull-request.yml 0000664 0000000 0000000 00000002737 15177425606 0023716 0 ustar 00root root 0000000 0000000 # This file is automatically added by @npmcli/template-oss. Do not edit.
name: Pull Request
on:
pull_request:
types:
- opened
- reopened
- edited
- synchronize
permissions:
contents: read
jobs:
commitlint:
name: Lint Commits
if: github.repository_owner == 'npm'
runs-on: ubuntu-latest
defaults:
run:
shell: bash
steps:
- name: Checkout
uses: actions/checkout@v6
with:
fetch-depth: 0
- name: Setup Git User
run: |
git config --global user.email "npm-cli+bot@github.com"
git config --global user.name "npm CLI robot"
- name: Setup Node
uses: actions/setup-node@v6
id: node
with:
node-version: 26.x
check-latest: contains('26.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 }}
- 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
npm-unique-slug-460dc31/.github/workflows/release-integration.yml 0000664 0000000 0000000 00000004163 15177425606 0025210 0 ustar 00root root 0000000 0000000 # 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
permissions:
contents: read
id-token: write
jobs:
publish:
name: Publish
runs-on: ubuntu-latest
defaults:
run:
shell: bash
permissions:
id-token: write
steps:
- name: Checkout
uses: actions/checkout@v6
with:
ref: ${{ fromJSON(inputs.releases)[0].tagName }}
- name: Setup Git User
run: |
git config --global user.email "npm-cli+bot@github.com"
git config --global user.name "npm CLI robot"
- name: Setup Node
uses: actions/setup-node@v6
id: node
with:
node-version: 26.x
check-latest: contains('26.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
npm-unique-slug-460dc31/.github/workflows/release.yml 0000664 0000000 0000000 00000026106 15177425606 0022670 0 ustar 00root root 0000000 0000000 # This file is automatically added by @npmcli/template-oss. Do not edit.
name: Release
on:
push:
branches:
- main
permissions:
contents: write
pull-requests: write
checks: write
jobs:
release:
outputs:
pr: ${{ steps.release.outputs.pr }}
pr-branch: ${{ steps.release.outputs.pr-branch }}
pr-number: ${{ steps.release.outputs.pr-number }}
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
defaults:
run:
shell: bash
steps:
- name: Checkout
uses: actions/checkout@v6
- name: Setup Git User
run: |
git config --global user.email "npm-cli+bot@github.com"
git config --global user.name "npm CLI robot"
- name: Setup Node
uses: actions/setup-node@v6
id: node
with:
node-version: 26.x
check-latest: contains('26.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: Release Please
id: release
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
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@v7
id: comment-text
with:
result-encoding: string
script: |
const { runId, repo: { owner, repo } } = context
const { data: workflow } = await github.rest.actions.getWorkflowRun({ owner, repo, run_id: runId })
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:
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
id: create-check
uses: ./.github/actions/create-check
if: steps.release.outputs.pr-sha
with:
name: "Release"
token: ${{ secrets.GITHUB_TOKEN }}
sha: ${{ steps.release.outputs.pr-sha }}
update:
needs: release
outputs:
sha: ${{ steps.commit.outputs.sha }}
check-id: ${{ steps.create-check.outputs.check-id }}
name: Update - Release
if: github.repository_owner == 'npm' && needs.release.outputs.pr
runs-on: ubuntu-latest
defaults:
run:
shell: bash
steps:
- name: Checkout
uses: actions/checkout@v6
with:
fetch-depth: 0
ref: ${{ needs.release.outputs.pr-branch }}
- name: Setup Git User
run: |
git config --global user.email "npm-cli+bot@github.com"
git config --global user.name "npm CLI robot"
- name: Setup Node
uses: actions/setup-node@v6
id: node
with:
node-version: 26.x
check-latest: contains('26.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: 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:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
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:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
git commit --all --amend --no-edit || true
git push --force-with-lease
echo "sha=$(git rev-parse HEAD)" >> $GITHUB_OUTPUT
- name: Create Check
id: create-check
uses: ./.github/actions/create-check
with:
name: "Update - Release"
check-name: "Release"
token: ${{ secrets.GITHUB_TOKEN }}
sha: ${{ steps.commit.outputs.sha }}
- name: Conclude Check
uses: LouisBrunner/checks-action@v1.6.0
with:
token: ${{ secrets.GITHUB_TOKEN }}
conclusion: ${{ job.status }}
check_id: ${{ needs.release.outputs.check-id }}
ci:
name: CI - Release
needs: [ release, update ]
if: needs.release.outputs.pr
uses: ./.github/workflows/ci-release.yml
with:
ref: ${{ needs.release.outputs.pr-branch }}
check-sha: ${{ needs.update.outputs.sha }}
post-ci:
needs: [ release, update, ci ]
name: Post CI - Release
if: github.repository_owner == 'npm' && needs.release.outputs.pr && always()
runs-on: ubuntu-latest
defaults:
run:
shell: bash
steps:
- name: Get CI Conclusion
id: conclusion
run: |
result=""
if [[ "${{ contains(needs.*.result, 'failure') }}" == "true" ]]; then
result="failure"
elif [[ "${{ contains(needs.*.result, 'cancelled') }}" == "true" ]]; then
result="cancelled"
else
result="success"
fi
echo "result=$result" >> $GITHUB_OUTPUT
- name: Conclude Check
uses: LouisBrunner/checks-action@v1.6.0
with:
token: ${{ secrets.GITHUB_TOKEN }}
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
defaults:
run:
shell: bash
steps:
- 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
const runUrl = `https://github.com/${owner}/${repo}/actions/runs/${runId}`
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.releases
uses: ./.github/workflows/release-integration.yml
permissions:
contents: read
id-token: write
secrets:
PUBLISH_TOKEN: ${{ secrets.PUBLISH_TOKEN }}
with:
releases: ${{ needs.release.outputs.releases }}
post-release-integration:
needs: [ release, release-integration, post-release ]
name: Post Release Integration - Release
if: github.repository_owner == 'npm' && needs.release.outputs.releases && always()
runs-on: ubuntu-latest
defaults:
run:
shell: bash
steps:
- name: Get Post Release Conclusion
id: conclusion
run: |
if [[ "${{ contains(needs.*.result, 'failure') }}" == "true" ]]; then
result="x"
elif [[ "${{ contains(needs.*.result, 'cancelled') }}" == "true" ]]; then
result="heavy_multiplication_x"
else
result="white_check_mark"
fi
echo "result=$result" >> $GITHUB_OUTPUT
- 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:
RESULT: ${{ steps.conclusion.outputs.result }}
BODY: ${{ steps.found-comment.outputs.comment-body }}
with:
result-encoding: string
script: |
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'
npm-unique-slug-460dc31/.gitignore 0000664 0000000 0000000 00000001050 15177425606 0017107 0 ustar 00root root 0000000 0000000 # This file is automatically added by @npmcli/template-oss. Do not edit.
# ignore everything in the root
/*
!**/.gitignore
!/.commitlintrc.js
!/.eslint.config.js
!/.eslintrc.js
!/.eslintrc.local.*
!/.git-blame-ignore-revs
!/.github/
!/.gitignore
!/.npmrc
!/.prettierignore
!/.prettierrc.js
!/.release-please-manifest.json
!/bin/
!/CHANGELOG*
!/CODE_OF_CONDUCT.md
!/CONTRIBUTING.md
!/docs/
!/lib/
!/LICENSE*
!/map.js
!/package.json
!/README*
!/release-please-config.json
!/scripts/
!/SECURITY.md
!/tap-snapshots/
!/test/
!/tsconfig.json
tap-testdir*/
npm-unique-slug-460dc31/.npmrc 0000664 0000000 0000000 00000000135 15177425606 0016242 0 ustar 00root root 0000000 0000000 ; This file is automatically added by @npmcli/template-oss. Do not edit.
package-lock=false
npm-unique-slug-460dc31/.release-please-manifest.json 0000664 0000000 0000000 00000000023 15177425606 0022562 0 ustar 00root root 0000000 0000000 {
".": "7.0.0"
}
npm-unique-slug-460dc31/CHANGELOG.md 0000664 0000000 0000000 00000012134 15177425606 0016735 0 ustar 00root root 0000000 0000000 # Changelog
## [7.0.0](https://github.com/npm/unique-slug/compare/v6.0.0...v7.0.0) (2026-05-08)
### ⚠️ BREAKING CHANGES
* `unique-slug` now supports node `^22.22.2 || ^24.15.0 || >=26.0.0`
* template-oss-apply
### Features
* [`147f28c`](https://github.com/npm/unique-slug/commit/147f28c3bc84b5f681117130f645c03a002b1706) [#118](https://github.com/npm/unique-slug/pull/118) bump to new node engine range (@owlstronaut)
* [`885eff3`](https://github.com/npm/unique-slug/commit/885eff3052e39861b9fba3b49a8ecef2d7996854) [#118](https://github.com/npm/unique-slug/pull/118) template-oss-apply (@owlstronaut)
### Chores
* [`3b31500`](https://github.com/npm/unique-slug/commit/3b31500e4e59525bcf82ef7a79afcf3fa5d6d694) [#118](https://github.com/npm/unique-slug/pull/118) template-oss-apply (@owlstronaut)
* [`aa3a4b9`](https://github.com/npm/unique-slug/commit/aa3a4b9f1b29edee991e5ce6203327baad974e5f) [#113](https://github.com/npm/unique-slug/pull/113) remove tap (@owlstronaut)
* [`802c1a1`](https://github.com/npm/unique-slug/commit/802c1a19fc71f9fc524c8a3921e1663fd2d07c0e) [#113](https://github.com/npm/unique-slug/pull/113) swap from tap to built-in node:test (@owlstronaut)
* [`592577c`](https://github.com/npm/unique-slug/commit/592577ca28cc3cca9f0ead467a71674c6e6a3c06) [#110](https://github.com/npm/unique-slug/pull/110) bump @npmcli/eslint-config from 5.1.0 to 6.0.0 (#110) (@dependabot[bot])
* [`1f55579`](https://github.com/npm/unique-slug/commit/1f5557900893c31554792a69539a77b7a40cc3b2) [#115](https://github.com/npm/unique-slug/pull/115) bump @npmcli/template-oss from 4.28.1 to 4.29.0 (#115) (@dependabot[bot], @npm-cli-bot)
## [6.0.0](https://github.com/npm/unique-slug/compare/v5.0.0...v6.0.0) (2025-10-22)
### ⚠️ BREAKING CHANGES
* `unique-slug` now supports node `^20.17.0 || >=22.9.0`
### Bug Fixes
* [`f5e61b3`](https://github.com/npm/unique-slug/commit/f5e61b361dbe5c8ad38cd46bf21583cf93b794ed) [#108](https://github.com/npm/unique-slug/pull/108) align to npm 11 node engine range (#108) (@owlstronaut)
### Chores
* [`4a4f0d8`](https://github.com/npm/unique-slug/commit/4a4f0d86ffd3e555275c07642df91597a158caa9) [#101](https://github.com/npm/unique-slug/pull/101) postinstall workflow updates (#101) (@owlstronaut)
* [`236644c`](https://github.com/npm/unique-slug/commit/236644c77e33929ee95811dee134e593fbb201bb) [#107](https://github.com/npm/unique-slug/pull/107) bump @npmcli/template-oss from 4.26.0 to 4.27.1 (#107) (@dependabot[bot], @npm-cli-bot)
## [5.0.0](https://github.com/npm/unique-slug/compare/v4.0.0...v5.0.0) (2024-09-24)
### ⚠️ BREAKING CHANGES
* `unique-slug` now supports node `^18.17.0 || >=20.5.0`
### Bug Fixes
* [`cade20a`](https://github.com/npm/unique-slug/commit/cade20aba51d079cf2bcde67e74c18939e045337) [#97](https://github.com/npm/unique-slug/pull/97) align to npm 10 node engine range (@hashtagchris)
### Chores
* [`1881f90`](https://github.com/npm/unique-slug/commit/1881f9040a58017e90eff9ea18322a2bb335efff) [#97](https://github.com/npm/unique-slug/pull/97) run template-oss-apply (@hashtagchris)
* [`0a6131f`](https://github.com/npm/unique-slug/commit/0a6131fa03663c1a31bdfad99929aa942d3fca80) [#96](https://github.com/npm/unique-slug/pull/96) enable auto publish (#96) (@reggi)
* [`06d88e6`](https://github.com/npm/unique-slug/commit/06d88e629809b7e09bf57ce50bbed87aa465f2b7) [#94](https://github.com/npm/unique-slug/pull/94) bump @npmcli/eslint-config from 4.0.5 to 5.0.0 (@dependabot[bot])
* [`14f6a93`](https://github.com/npm/unique-slug/commit/14f6a93c484aac6ff5a1f6711bd0196223fd0450) [#84](https://github.com/npm/unique-slug/pull/84) bump @npmcli/template-oss to 4.22.0 (@lukekarrys)
* [`a3a1fa5`](https://github.com/npm/unique-slug/commit/a3a1fa5744220d6427de730b3a853ca648e64755) [#36](https://github.com/npm/unique-slug/pull/36) bump @npmcli/eslint-config from 3.1.0 to 4.0.0 (@dependabot[bot])
* [`dd40a9a`](https://github.com/npm/unique-slug/commit/dd40a9aad760d3d1a4306586d7b227ca55a371f1) [#95](https://github.com/npm/unique-slug/pull/95) postinstall for dependabot template-oss PR (@hashtagchris)
* [`3082ca1`](https://github.com/npm/unique-slug/commit/3082ca1b697af8bb60e5cdf58e1b75d82e6739d7) [#95](https://github.com/npm/unique-slug/pull/95) bump @npmcli/template-oss from 4.23.1 to 4.23.3 (@dependabot[bot])
## [4.0.0](https://github.com/npm/unique-slug/compare/v3.0.0...v4.0.0) (2022-10-10)
### ⚠️ BREAKING CHANGES
* `unique-slug` is now compatible with the following semver range for node: `^14.17.0 || ^16.13.0 || >=18.0.0`
### Features
* [`81375b9`](https://github.com/npm/unique-slug/commit/81375b9e1d831575a9fcb0154e639a8025b1352b) [#29](https://github.com/npm/unique-slug/pull/29) postinstall for dependabot template-oss PR (@lukekarrys)
## [3.0.0](https://github.com/npm/unique-slug/compare/v2.0.2...v3.0.0) (2022-08-22)
### ⚠ BREAKING CHANGES
* sets node engines to `^12.13.0 || ^14.15.0 || >=16.0.0`
### Bug Fixes
* replace deprecated String.prototype.substr() ([bf77b3d](https://github.com/npm/unique-slug/commit/bf77b3dda91bcb15998071a917420ef6965089ad))
### Dependencies
* @npmcli/template-oss@3.5.0 ([9b51795](https://github.com/npm/unique-slug/commit/9b51795b546d31a50af30d6d5c78b2eed73dba11))
npm-unique-slug-460dc31/CODE_OF_CONDUCT.md 0000664 0000000 0000000 00000000507 15177425606 0017724 0 ustar 00root root 0000000 0000000
All interactions in this repo are covered by the [npm Code of
Conduct](https://docs.npmjs.com/policies/conduct)
The npm cli team may, at its own discretion, moderate, remove, or edit
any interactions such as pull requests, issues, and comments.
npm-unique-slug-460dc31/CONTRIBUTING.md 0000664 0000000 0000000 00000005133 15177425606 0017356 0 ustar 00root root 0000000 0000000
# Contributing
## Code of Conduct
All interactions in the **npm** organization on GitHub are considered to be covered by our standard [Code of Conduct](https://docs.npmjs.com/policies/conduct).
## Reporting Bugs
Before submitting a new bug report please search for an existing or similar report.
Use one of our existing issue templates if you believe you've come across a unique problem.
Duplicate issues, or issues that don't use one of our templates may get closed without a response.
## Pull Request Conventions
### Commits
We use [Conventional Commits](https://www.conventionalcommits.org/en/v1.0.0/).
When opening a pull request please be sure that either the pull request title, or each commit in the pull request, has one of the following prefixes:
- `feat`: For when introducing a new feature. The result will be a new semver minor version of the package when it is next published.
- `fix`: For bug fixes. The result will be a new semver patch version of the package when it is next published.
- `docs`: For documentation updates. The result will be a new semver patch version of the package when it is next published.
- `chore`: For changes that do not affect the published module. Often these are changes to tests. The result will be *no* change to the version of the package when it is next published (as the commit does not affect the published version).
### Test Coverage
Pull requests made against this repo will run `npm test` automatically. Please make sure tests pass locally before submitting a PR.
Every new feature or bug fix should come with a corresponding test or tests that validate the solutions. Testing also reports on code coverage and will fail if code coverage drops.
### Linting
Linting is also done automatically once tests pass. `npm run lintfix` will fix most linting errors automatically.
Please make sure linting passes before submitting a PR.
## What _not_ to contribute?
### Dependencies
It should be noted that our team does not accept third-party dependency updates/PRs. If you submit a PR trying to update our dependencies we will close it with or without a reference to these contribution guidelines.
### Tools/Automation
Our core team is responsible for the maintenance of the tooling/automation in this project and we ask contributors to not make changes to these when contributing (e.g. `.github/*`, `.eslintrc.json`, `.licensee.json`). Most of those files also have a header at the top to remind folks they are automatically generated. Pull requests that alter these will not be accepted.
npm-unique-slug-460dc31/LICENSE 0000664 0000000 0000000 00000001336 15177425606 0016133 0 ustar 00root root 0000000 0000000 The ISC License
Copyright npm, Inc
Permission to use, copy, modify, and/or distribute this software for any
purpose with or without fee is hereby granted, provided that the above
copyright notice and this permission notice appear in all copies.
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR
IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
npm-unique-slug-460dc31/README.md 0000664 0000000 0000000 00000000675 15177425606 0016412 0 ustar 00root root 0000000 0000000 unique-slug
===========
Generate a unique character string suitible for use in files and URLs.
```
var uniqueSlug = require('unique-slug')
var randomSlug = uniqueSlug()
var fileSlug = uniqueSlug('/etc/passwd')
```
### uniqueSlug(*str*) → String (8 chars)
If *str* is passed in then the return value will be its murmur hash in
hex.
If *str* is not passed in, it will be 4 randomly generated bytes
converted into 8 hexadecimal characters.
npm-unique-slug-460dc31/SECURITY.md 0000664 0000000 0000000 00000002320 15177425606 0016711 0 ustar 00root root 0000000 0000000
GitHub takes the security of our software products and services seriously, including the open source code repositories managed through our GitHub organizations, such as [GitHub](https://github.com/GitHub).
If you believe you have found a security vulnerability in this GitHub-owned open source repository, you can report it to us in one of two ways.
If the vulnerability you have found is *not* [in scope for the GitHub Bug Bounty Program](https://bounty.github.com/#scope) or if you do not wish to be considered for a bounty reward, please report the issue to us directly through [opensource-security@github.com](mailto:opensource-security@github.com).
If the vulnerability you have found is [in scope for the GitHub Bug Bounty Program](https://bounty.github.com/#scope) and you would like for your finding to be considered for a bounty reward, please submit the vulnerability to us through [HackerOne](https://hackerone.com/github) in order to be eligible to receive a bounty award.
**Please do not report security vulnerabilities through public GitHub issues, discussions, or pull requests.**
Thanks for helping make GitHub safe for everyone.
npm-unique-slug-460dc31/lib/ 0000775 0000000 0000000 00000000000 15177425606 0015671 5 ustar 00root root 0000000 0000000 npm-unique-slug-460dc31/lib/index.js 0000664 0000000 0000000 00000000436 15177425606 0017341 0 ustar 00root root 0000000 0000000 'use strict'
var MurmurHash3 = require('imurmurhash')
module.exports = function (uniq) {
if (uniq) {
var hash = new MurmurHash3(uniq)
return ('00000000' + hash.result().toString(16)).slice(-8)
} else {
return (Math.random().toString(16) + '0000000').slice(2, 10)
}
}
npm-unique-slug-460dc31/package.json 0000664 0000000 0000000 00000002644 15177425606 0017417 0 ustar 00root root 0000000 0000000 {
"name": "unique-slug",
"version": "7.0.0",
"description": "Generate a unique character string suitible for use in files and URLs.",
"main": "lib/index.js",
"scripts": {
"test": "node --test './test/**/*.js'",
"lint": "npm run eslint",
"postlint": "template-oss-check",
"template-oss-apply": "template-oss-apply --force",
"lintfix": "npm run eslint -- --fix",
"snap": "node --test --test-update-snapshots './test/**/*.js'",
"posttest": "npm run lint",
"eslint": "eslint \"**/*.{js,cjs,ts,mjs,jsx,tsx}\"",
"test:node20": "node --test test",
"test:cover": "node --test --experimental-test-coverage --test-timeout=3000 --test-coverage-lines=100 --test-coverage-functions=100 --test-coverage-branches=100 './test/**/*.js'"
},
"keywords": [],
"author": "GitHub Inc.",
"license": "ISC",
"devDependencies": {
"@npmcli/eslint-config": "^6.0.0",
"@npmcli/template-oss": "5.0.0"
},
"repository": {
"type": "git",
"url": "git+https://github.com/npm/unique-slug.git"
},
"dependencies": {
"imurmurhash": "^0.1.4"
},
"files": [
"bin/",
"lib/"
],
"engines": {
"node": "^22.22.2 || ^24.15.0 || >=26.0.0"
},
"templateOSS": {
"//@npmcli/template-oss": "This file is partially managed by @npmcli/template-oss. Edits may be overwritten.",
"version": "5.0.0",
"publish": true,
"testRunner": "node:test",
"latestCiVersion": 24
}
}
npm-unique-slug-460dc31/release-please-config.json 0000664 0000000 0000000 00000001277 15177425606 0022157 0 ustar 00root root 0000000 0000000 {
"group-pull-request-title-pattern": "chore: release ${version}",
"pull-request-title-pattern": "chore: release${component} ${version}",
"changelog-sections": [
{
"type": "feat",
"section": "Features",
"hidden": false
},
{
"type": "fix",
"section": "Bug Fixes",
"hidden": false
},
{
"type": "docs",
"section": "Documentation",
"hidden": false
},
{
"type": "deps",
"section": "Dependencies",
"hidden": false
},
{
"type": "chore",
"section": "Chores",
"hidden": true
}
],
"packages": {
".": {
"package-name": ""
}
},
"prerelease-type": "pre.0"
}
npm-unique-slug-460dc31/test/ 0000775 0000000 0000000 00000000000 15177425606 0016102 5 ustar 00root root 0000000 0000000 npm-unique-slug-460dc31/test/index.js 0000664 0000000 0000000 00000001646 15177425606 0017556 0 ustar 00root root 0000000 0000000 'use strict'
const { test } = require('node:test')
const assert = require('node:assert')
const uniqueSlug = require('../lib/index.js')
test('random slugs are 8 chars', () => {
const slugA = uniqueSlug()
assert.strictEqual(slugA.length, 8)
})
test("two slugs aren't the same", () => {
const slugA = uniqueSlug()
assert.notStrictEqual(slugA, uniqueSlug())
})
test('string based slugs are 8 chars', () => {
const base = '/path/to/thingy'
const slugB = uniqueSlug(base)
assert.strictEqual(slugB.length, 8)
})
test('two string based slugs, from the same string are the same', () => {
const base = '/path/to/thingy'
const slugB = uniqueSlug(base)
assert.strictEqual(slugB, uniqueSlug(base))
})
test('two string based slongs, from diff strings are different', () => {
const base = '/path/to/thingy'
const slugA = uniqueSlug()
const slugB = uniqueSlug(base)
assert.notStrictEqual(slugB, uniqueSlug(slugA))
})