pax_global_header 0000666 0000000 0000000 00000000064 15201665023 0014512 g ustar 00root root 0000000 0000000 52 comment=786d22e7a3583417ff10907f15da2c6c1ecf361b
unique-filename-6.0.0/ 0000775 0000000 0000000 00000000000 15201665023 0014601 5 ustar 00root root 0000000 0000000 unique-filename-6.0.0/.commitlintrc.js 0000664 0000000 0000000 00000000566 15201665023 0017730 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],
},
}
unique-filename-6.0.0/.eslintrc.js 0000664 0000000 0000000 00000000623 15201665023 0017041 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,
],
}
unique-filename-6.0.0/.github/ 0000775 0000000 0000000 00000000000 15201665023 0016141 5 ustar 00root root 0000000 0000000 unique-filename-6.0.0/.github/CODEOWNERS 0000664 0000000 0000000 00000000152 15201665023 0017532 0 ustar 00root root 0000000 0000000 # This file is automatically added by @npmcli/template-oss. Do not edit.
* @npm/cli-team @npm/cli-triage
unique-filename-6.0.0/.github/ISSUE_TEMPLATE/ 0000775 0000000 0000000 00000000000 15201665023 0020324 5 ustar 00root root 0000000 0000000 unique-filename-6.0.0/.github/ISSUE_TEMPLATE/bug.yml 0000664 0000000 0000000 00000002655 15201665023 0021634 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
unique-filename-6.0.0/.github/ISSUE_TEMPLATE/config.yml 0000664 0000000 0000000 00000000145 15201665023 0022314 0 ustar 00root root 0000000 0000000 # This file is automatically added by @npmcli/template-oss. Do not edit.
blank_issues_enabled: true
unique-filename-6.0.0/.github/actions/ 0000775 0000000 0000000 00000000000 15201665023 0017601 5 ustar 00root root 0000000 0000000 unique-filename-6.0.0/.github/actions/create-check/ 0000775 0000000 0000000 00000000000 15201665023 0022117 5 ustar 00root root 0000000 0000000 unique-filename-6.0.0/.github/actions/create-check/action.yml 0000664 0000000 0000000 00000002720 15201665023 0024120 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 }}"}
unique-filename-6.0.0/.github/actions/install-latest-npm/ 0000775 0000000 0000000 00000000000 15201665023 0023331 5 ustar 00root root 0000000 0000000 unique-filename-6.0.0/.github/actions/install-latest-npm/action.yml 0000664 0000000 0000000 00000003406 15201665023 0025334 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
unique-filename-6.0.0/.github/dependabot.yml 0000664 0000000 0000000 00000000656 15201665023 0021000 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
unique-filename-6.0.0/.github/matchers/ 0000775 0000000 0000000 00000000000 15201665023 0017747 5 ustar 00root root 0000000 0000000 unique-filename-6.0.0/.github/matchers/tap.json 0000664 0000000 0000000 00000001204 15201665023 0021423 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
}
]
}
]
}
unique-filename-6.0.0/.github/settings.yml 0000664 0000000 0000000 00000001377 15201665023 0020534 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" ]
unique-filename-6.0.0/.github/workflows/ 0000775 0000000 0000000 00000000000 15201665023 0020176 5 ustar 00root root 0000000 0000000 unique-filename-6.0.0/.github/workflows/audit.yml 0000664 0000000 0000000 00000002275 15201665023 0022035 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
unique-filename-6.0.0/.github/workflows/ci-release.yml 0000664 0000000 0000000 00000011652 15201665023 0022737 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 }}
unique-filename-6.0.0/.github/workflows/ci.yml 0000664 0000000 0000000 00000007104 15201665023 0021316 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
unique-filename-6.0.0/.github/workflows/codeql-analysis.yml 0000664 0000000 0000000 00000001606 15201665023 0024014 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
unique-filename-6.0.0/.github/workflows/post-dependabot.yml 0000664 0000000 0000000 00000012004 15201665023 0024006 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
unique-filename-6.0.0/.github/workflows/pull-request.yml 0000664 0000000 0000000 00000002737 15201665023 0023374 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
unique-filename-6.0.0/.github/workflows/release-integration.yml 0000664 0000000 0000000 00000004163 15201665023 0024666 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
unique-filename-6.0.0/.github/workflows/release.yml 0000664 0000000 0000000 00000026106 15201665023 0022346 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'
unique-filename-6.0.0/.gitignore 0000664 0000000 0000000 00000001050 15201665023 0016565 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*/
unique-filename-6.0.0/.npmrc 0000664 0000000 0000000 00000000135 15201665023 0015720 0 ustar 00root root 0000000 0000000 ; This file is automatically added by @npmcli/template-oss. Do not edit.
package-lock=false
unique-filename-6.0.0/.release-please-manifest.json 0000664 0000000 0000000 00000000023 15201665023 0022240 0 ustar 00root root 0000000 0000000 {
".": "6.0.0"
}
unique-filename-6.0.0/CHANGELOG.md 0000664 0000000 0000000 00000015420 15201665023 0016414 0 ustar 00root root 0000000 0000000 # Changelog
## [6.0.0](https://github.com/npm/unique-filename/compare/v5.0.0...v6.0.0) (2026-05-15)
### ⚠️ BREAKING CHANGES
* `unique-filename` now supports node `^22.22.2 || ^24.15.0 || >=26.0.0`
* template-oss-apply
### Features
* [`5b33ba7`](https://github.com/npm/unique-filename/commit/5b33ba7f3ba938872654b342f865788ea6cc52cb) [#109](https://github.com/npm/unique-filename/pull/109) bump to new node engine range (@owlstronaut)
* [`2928f44`](https://github.com/npm/unique-filename/commit/2928f4483dde265291875c43498b9ea681145a7f) [#109](https://github.com/npm/unique-filename/pull/109) template-oss-apply (@owlstronaut)
### Dependencies
* [`a143c1f`](https://github.com/npm/unique-filename/commit/a143c1fa526bb44a4666f5f87bebb03d1c2953d6) [#109](https://github.com/npm/unique-filename/pull/109) `unique-slug@7.0.0`
### Chores
* [`b157d8f`](https://github.com/npm/unique-filename/commit/b157d8fae510e2a5875797ecb08e8dc4efc35b1b) [#109](https://github.com/npm/unique-filename/pull/109) template-oss-apply (@owlstronaut)
* [`e01226d`](https://github.com/npm/unique-filename/commit/e01226deda8f3031eb87e0cbdaca256b72bfb871) [#109](https://github.com/npm/unique-filename/pull/109) bumping @npmcli/template-oss from 4.30.0 to 5.1.0 (@owlstronaut)
* [`f76307a`](https://github.com/npm/unique-filename/commit/f76307a2235c67f76ee4cdbdc3e9200612ce1d8f) [#102](https://github.com/npm/unique-filename/pull/102) remove tap (@owlstronaut)
* [`2d01838`](https://github.com/npm/unique-filename/commit/2d01838a0764eefc928a130ea127fb9ba29fff3f) [#102](https://github.com/npm/unique-filename/pull/102) swap from tap to built-in node:test (@owlstronaut)
* [`82dfda0`](https://github.com/npm/unique-filename/commit/82dfda0d178e6e4a77d445ff2384d901a30cb5f0) [#99](https://github.com/npm/unique-filename/pull/99) bump @npmcli/eslint-config from 5.1.0 to 6.0.0 (#99) (@dependabot[bot])
* [`17d1dfd`](https://github.com/npm/unique-filename/commit/17d1dfdaa35ba0eeadfa4ba58300f64c14f831b4) [#106](https://github.com/npm/unique-filename/pull/106) bump @npmcli/template-oss from 4.29.0 to 4.30.0 (#106) (@dependabot[bot], @npm-cli-bot)
## [5.0.0](https://github.com/npm/unique-filename/compare/v4.0.0...v5.0.0) (2025-10-22)
### ⚠️ BREAKING CHANGES
* `unique-filename` now supports node `^20.17.0 || >=22.9.0`
### Bug Fixes
* [`304a435`](https://github.com/npm/unique-filename/commit/304a4357894a1c646404ef8509fc431635a1a26a) [#97](https://github.com/npm/unique-filename/pull/97) align to npm 11 node engine range (@owlstronaut)
### Dependencies
* [`30d9f39`](https://github.com/npm/unique-filename/commit/30d9f391e4d6fe4c964d0437fa8740c12c41602c) [#97](https://github.com/npm/unique-filename/pull/97) `unique-slug@6.0.0`
### Chores
* [`9a60e04`](https://github.com/npm/unique-filename/commit/9a60e0472596ff96d872d5712a7ee4f0f74b57c8) [#97](https://github.com/npm/unique-filename/pull/97) template-oss-apply (@owlstronaut)
* [`9c86293`](https://github.com/npm/unique-filename/commit/9c86293ea3333179d96db330743d62020ec830a3) [#90](https://github.com/npm/unique-filename/pull/90) postinstall workflow updates (#90) (@owlstronaut)
* [`39c8890`](https://github.com/npm/unique-filename/commit/39c88905acd1d8769cebf2899f80f300f986463d) [#95](https://github.com/npm/unique-filename/pull/95) bump @npmcli/template-oss from 4.26.0 to 4.27.1 (#95) (@dependabot[bot], @npm-cli-bot)
## [4.0.0](https://github.com/npm/unique-filename/compare/v3.0.0...v4.0.0) (2024-09-25)
### ⚠️ BREAKING CHANGES
* `unique-filename` now supports node `^18.17.0 || >=20.5.0`
### Bug Fixes
* [`94b387c`](https://github.com/npm/unique-filename/commit/94b387c047141ae3490cace0273a6a69704a7f62) [#86](https://github.com/npm/unique-filename/pull/86) align to npm 10 node engine range (@reggi)
### Dependencies
* [`194c3ef`](https://github.com/npm/unique-filename/commit/194c3ef668a9f1b6bcc5d638f63a018719a29949) [#86](https://github.com/npm/unique-filename/pull/86) `unique-slug@5.0.0`
### Chores
* [`7f96619`](https://github.com/npm/unique-filename/commit/7f96619b509f7ee64785bd90aea50721da6eee85) [#86](https://github.com/npm/unique-filename/pull/86) run template-oss-apply (@reggi)
* [`3bda296`](https://github.com/npm/unique-filename/commit/3bda296241f166f9875ad4418a217b716459f44a) [#85](https://github.com/npm/unique-filename/pull/85) enable auto publish (#85) (@reggi)
* [`5b25a8b`](https://github.com/npm/unique-filename/commit/5b25a8b73aefdf8fe223779e13b335bb9a598222) [#83](https://github.com/npm/unique-filename/pull/83) bump @npmcli/eslint-config from 4.0.5 to 5.0.0 (@dependabot[bot])
* [`83cd1d9`](https://github.com/npm/unique-filename/commit/83cd1d97efb29fe67cd609a8af0ffaa84c703dff) [#74](https://github.com/npm/unique-filename/pull/74) bump @npmcli/template-oss to 4.22.0 (@lukekarrys)
* [`2372b8f`](https://github.com/npm/unique-filename/commit/2372b8fcd93d29275c86131f864cbe79d70c9df0) [#84](https://github.com/npm/unique-filename/pull/84) postinstall for dependabot template-oss PR (@hashtagchris)
* [`813e0db`](https://github.com/npm/unique-filename/commit/813e0db42757bfe2e14f09739a6a499416b20cd2) [#84](https://github.com/npm/unique-filename/pull/84) bump @npmcli/template-oss from 4.23.1 to 4.23.3 (@dependabot[bot])
## [3.0.0](https://github.com/npm/unique-filename/compare/v2.0.1...v3.0.0) (2022-10-14)
### ⚠️ BREAKING CHANGES
* `unique-filename` is now compatible with the following semver range for node: `^14.17.0 || ^16.13.0 || >=18.0.0`
### Features
* [`6412fef`](https://github.com/npm/unique-filename/commit/6412fef797b004c4029e963510cba63012abedbd) [#26](https://github.com/npm/unique-filename/pull/26) postinstall for dependabot template-oss PR (@lukekarrys)
### Dependencies
* [`50d9443`](https://github.com/npm/unique-filename/commit/50d9443f1df8e3a172114f7c08596c345a99f1ea) [#32](https://github.com/npm/unique-filename/pull/32) bump unique-slug from 3.0.0 to 4.0.0
## [2.0.1](https://github.com/npm/unique-filename/compare/v2.0.0...v2.0.1) (2022-08-25)
### Dependencies
* bump unique-slug from 2.0.2 to 3.0.0 ([#15](https://github.com/npm/unique-filename/issues/15)) ([e48b56f](https://github.com/npm/unique-filename/commit/e48b56f05701344e3a25fe1d28969b3d58b64d21))
## [2.0.0](https://github.com/npm/unique-filename/compare/v1.1.1...v2.0.0) (2022-08-22)
### ⚠ BREAKING CHANGES
* Sets node engines to `^12.13.0 || ^14.15.0 || >=16.0.0`
### Dependencies
* @npmcli/template-oss@3.5.0 ([#12](https://github.com/npm/unique-filename/issues/12)) ([96e4711](https://github.com/npm/unique-filename/commit/96e47114071454bf7580b9e9509173ec59f03dff))
### Documentation
* fix readme examples ([#14](https://github.com/npm/unique-filename/issues/14)) ([2718347](https://github.com/npm/unique-filename/commit/27183475b1f346516723065548c0989a8ac478c1))
* fix typo ([#8](https://github.com/npm/unique-filename/issues/8)) ([10f8420](https://github.com/npm/unique-filename/commit/10f8420abb1bb88d7bb8a508b9a0de622b302885))
unique-filename-6.0.0/CODE_OF_CONDUCT.md 0000664 0000000 0000000 00000000507 15201665023 0017402 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.
unique-filename-6.0.0/CONTRIBUTING.md 0000664 0000000 0000000 00000005133 15201665023 0017034 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.
unique-filename-6.0.0/LICENSE 0000664 0000000 0000000 00000001315 15201665023 0015606 0 ustar 00root root 0000000 0000000 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.
unique-filename-6.0.0/README.md 0000664 0000000 0000000 00000002325 15201665023 0016062 0 ustar 00root root 0000000 0000000 unique-filename
===============
Generate a unique filename for use in temporary directories or caches.
```js
const uniqueFilename = require('unique-filename')
// returns something like: '/tmp/c5b28f47'
const randomTmpfile = uniqueFilename(os.tmpdir())
// returns something like: '/tmp/my-test-51a7b48d'
const randomPrefixedTmpfile = uniqueFilename(os.tmpdir(), 'my-test')
// returns something like: '/my-tmp-dir/testing-7ddd44c0'
const uniqueTmpfile = uniqueFilename('/my-tmp-dir', 'testing', '/my/thing/to/uniq/on')
```
### uniqueFilename(*dir*, *fileprefix*, *uniqstr*) → String
Returns the full path of a unique filename that looks like:
`dir/prefix-7ddd44c0`
or `dir/7ddd44c0`
*dir* – The path you want the filename in. `os.tmpdir()` is a good choice for this.
*fileprefix* – A string to append prior to the unique part of the filename.
The parameter is required if *uniqstr* is also passed in but is otherwise
optional and can be `undefined`/`null`/`''`. If present and not empty
then this string plus a hyphen are prepended to the unique part.
*uniqstr* – Optional, if not passed the unique part of the resulting
filename will be random. If passed in it will be generated from this string
in a reproducible way.
unique-filename-6.0.0/SECURITY.md 0000664 0000000 0000000 00000002320 15201665023 0016367 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.
unique-filename-6.0.0/lib/ 0000775 0000000 0000000 00000000000 15201665023 0015347 5 ustar 00root root 0000000 0000000 unique-filename-6.0.0/lib/index.js 0000664 0000000 0000000 00000000312 15201665023 0017010 0 ustar 00root root 0000000 0000000 var path = require('path')
var uniqueSlug = require('unique-slug')
module.exports = function (filepath, prefix, uniq) {
return path.join(filepath, (prefix ? prefix + '-' : '') + uniqueSlug(uniq))
}
unique-filename-6.0.0/package.json 0000664 0000000 0000000 00000003064 15201665023 0017072 0 ustar 00root root 0000000 0000000 {
"name": "unique-filename",
"version": "6.0.0",
"description": "Generate a unique filename for use in temporary directories or caches.",
"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'"
},
"repository": {
"type": "git",
"url": "git+https://github.com/npm/unique-filename.git"
},
"keywords": [],
"author": "GitHub Inc.",
"license": "ISC",
"bugs": {
"url": "https://github.com/iarna/unique-filename/issues"
},
"homepage": "https://github.com/iarna/unique-filename",
"devDependencies": {
"@npmcli/eslint-config": "^6.0.0",
"@npmcli/template-oss": "5.1.0"
},
"dependencies": {
"unique-slug": "^7.0.0"
},
"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.1.0",
"publish": true,
"testRunner": "node:test",
"latestCiVersion": 24
}
}
unique-filename-6.0.0/release-please-config.json 0000664 0000000 0000000 00000001277 15201665023 0021635 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"
}
unique-filename-6.0.0/test/ 0000775 0000000 0000000 00000000000 15201665023 0015560 5 ustar 00root root 0000000 0000000 unique-filename-6.0.0/test/index.js 0000664 0000000 0000000 00000002450 15201665023 0017226 0 ustar 00root root 0000000 0000000 const { test } = require('node:test')
const assert = require('node:assert')
const uniqueFilename = require('..')
test('random tmp file', () => {
const randomTmpfile = uniqueFilename('tmp')
assert.match(randomTmpfile, /^tmp.[a-f0-9]{8}$/)
})
test('random tmp files are not the same', () => {
const randomTmpfile = uniqueFilename('tmp')
const randomAgain = uniqueFilename('tmp')
assert.notEqual(randomAgain, randomTmpfile)
})
test('random prefixed tmp file', () => {
const randomPrefixedTmpfile = uniqueFilename('tmp', 'my-test')
assert.match(randomPrefixedTmpfile, /^tmp.my-test-[a-f0-9]{8}$/)
})
test('random prefixed tmp files are not the same', () => {
const randomPrefixedTmpfile = uniqueFilename('tmp', 'my-test')
const randomPrefixedAgain = uniqueFilename('tmp', 'my-test')
assert.notEqual(randomPrefixedAgain, randomPrefixedTmpfile)
})
test('unique filename', () => {
const uniqueTmpfile = uniqueFilename('tmp', 'testing', '/my/thing/to/uniq/on')
assert.match(uniqueTmpfile, /^tmp.testing-7ddd44c0$/)
})
test('same unique string component produces same filename', () => {
const uniqueTmpfile = uniqueFilename('tmp', 'testing', '/my/thing/to/uniq/on')
const uniqueAgain = uniqueFilename('tmp', 'testing', '/my/thing/to/uniq/on')
assert.strictEqual(uniqueTmpfile, uniqueAgain)
})