Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: npm/template-oss
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: 102e1ae9d62646e888c71efe6d86dc491e5ca7ca
Choose a base ref
...
head repository: npm/template-oss
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: 7f86c5fbe81c50ab35d954f891332bab00568c18
Choose a head ref
Loading
Showing with 2,878 additions and 1,111 deletions.
  1. +1 −0 .eslintrc.js
  2. +0 −6 .eslintrc.local.json
  3. +1 −12 .github/dependabot.yml
  4. +1 −26 .github/settings.yml
  5. +32 −3 .github/workflows/audit.yml
  6. +74 −16 .github/workflows/ci-release.yml
  7. +74 −18 .github/workflows/ci-test-workspace.yml
  8. +74 −18 .github/workflows/ci.yml
  9. +0 −4 .github/workflows/codeql-analysis.yml
  10. +32 −3 .github/workflows/post-dependabot.yml
  11. +33 −4 .github/workflows/pull-request.yml
  12. +65 −9 .github/workflows/release.yml
  13. +3 −0 .gitignore
  14. +1 −1 .release-please-manifest.json
  15. +59 −0 CHANGELOG.md
  16. +15 −11 README.md
  17. +6 −0 bin/release-manager.js
  18. +124 −132 lib/config.js
  19. 0 lib/content/{CODEOWNERS → CODEOWNERS.hbs}
  20. 0 lib/content/{CODE_OF_CONDUCT.md → CODE_OF_CONDUCT-md.hbs}
  21. 0 lib/content/{CONTRIBUTING.md → CONTRIBUTING-md.hbs}
  22. 0 lib/content/{LICENSE.md → LICENSE-md.hbs}
  23. 0 lib/content/{SECURITY.md → SECURITY-md.hbs}
  24. +1 −1 lib/content/{_job-matrix.yml → _job-matrix-yml.hbs}
  25. +2 −2 lib/content/{_job-release-integration.yml → _job-release-integration-yml.hbs}
  26. +1 −1 lib/content/{_job.yml → _job-yml.hbs}
  27. +1 −1 lib/content/{_on-ci.yml → _on-ci-yml.hbs}
  28. 0 lib/content/{_step-audit.yml → _step-audit-yml.hbs}
  29. 0 lib/content/{_step-checks.yml → _step-checks-yml.hbs}
  30. 0 lib/content/{_step-deps.yml → _step-deps-yml.hbs}
  31. 0 lib/content/{_step-git.yml → _step-git-yml.hbs}
  32. 0 lib/content/{_step-lint.yml → _step-lint-yml.hbs}
  33. +60 −0 lib/content/_step-node-yml.hbs
  34. +0 −31 lib/content/_step-node.yml
  35. 0 lib/content/{_step-test.yml → _step-test-yml.hbs}
  36. +6 −0 lib/content/_steps-setup-yml.hbs
  37. +0 −6 lib/content/_steps-setup.yml
  38. +2 −2 lib/content/{audit.yml → audit-yml.hbs}
  39. 0 lib/content/{bug.yml → bug-yml.hbs}
  40. +7 −7 lib/content/{ci-release.yml → ci-release-yml.hbs}
  41. +13 −0 lib/content/ci-yml.hbs
  42. +0 −13 lib/content/ci.yml
  43. +3 −3 lib/content/{codeql-analysis.yml → codeql-analysis-yml.hbs}
  44. 0 lib/content/{commitlintrc.js → commitlintrc-js.hbs}
  45. 0 lib/content/{config.yml → config-yml.hbs}
  46. +24 −0 lib/content/dependabot-yml.hbs
  47. +0 −15 lib/content/dependabot.yml
  48. +11 −1 lib/content/{eslintrc.js → eslintrc-js.hbs}
  49. +2 −0 lib/content/{gitignore → gitignore.hbs}
  50. +53 −53 lib/content/index.js
  51. 0 lib/content/{npmrc → npmrc.hbs}
  52. +8 −9 lib/content/{pkg.json → package-json.hbs}
  53. +1 −1 lib/content/{post-dependabot.yml → post-dependabot-yml.hbs}
  54. +2 −2 lib/content/{pull-request.yml → pull-request-yml.hbs}
  55. 0 lib/content/{release-please-config.json → release-please-config-json.hbs}
  56. 0 lib/content/{release-please-manifest.json → release-please-manifest-json.hbs}
  57. +11 −11 lib/content/{release.yml → release-yml.hbs}
  58. +1 −0 lib/content/{settings.yml → settings-yml.hbs}
  59. 0 lib/content/{tap.json → tap-json.hbs}
  60. +17 −0 lib/content/tsconfig-json.hbs
  61. +80 −0 lib/util/ci-versions.js
  62. +27 −0 lib/util/dependabot.js
  63. +29 −20 lib/util/files.js
  64. +36 −0 lib/util/get-cmd-path.js
  65. +0 −26 lib/util/get-git-url.js
  66. +77 −0 lib/util/git.js
  67. +29 −0 lib/util/import-or-require.js
  68. +0 −1 lib/util/merge.js
  69. +0 −78 lib/util/parse-ci-versions.js
  70. +6 −1 lib/util/parser.js
  71. +13 −0 lib/util/path.js
  72. +9 −6 lib/util/template.js
  73. +10 −10 package.json
  74. +1,258 −285 tap-snapshots/test/apply/source-snapshots.js.test.cjs
  75. +53 −26 tap-snapshots/test/check/diff-snapshots.js.test.cjs
  76. +10 −16 tap-snapshots/test/check/snapshots.js.test.cjs
  77. +2 −2 test/apply/allow-paths.js
  78. +88 −16 test/apply/dependabot.js
  79. +67 −39 test/apply/engines.js
  80. +23 −0 test/apply/esm.js
  81. +35 −37 test/apply/index.js
  82. +15 −67 test/apply/merge-yml.js
  83. +25 −8 test/apply/npm-bin.js
  84. +1 −2 test/apply/release-config.js
  85. +35 −7 test/apply/release.js
  86. +37 −0 test/apply/tap.js
  87. +57 −0 test/apply/typescript.js
  88. +3 −1 test/bin/apply.js
  89. +3 −1 test/bin/check.js
  90. +1 −1 test/check/engines.js
  91. +8 −0 test/fixtures/yml-merge.js
  92. +13 −7 test/setup.js
  93. +0 −30 test/util/parse-ci-versions.js
  94. +3 −0 workspace/test-workspace/.eslintrc.js
  95. +2 −0 workspace/test-workspace/.gitignore
  96. +2 −2 workspace/test-workspace/package.json
1 change: 1 addition & 0 deletions .eslintrc.js
Original file line number Diff line number Diff line change
@@ -11,6 +11,7 @@ const localConfigs = readdir(__dirname)
module.exports = {
root: true,
ignorePatterns: [
'tap-testdir*/',
'workspace/test-workspace/**',
],
extends: [
6 changes: 0 additions & 6 deletions .eslintrc.local.json

This file was deleted.

13 changes: 1 addition & 12 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -7,18 +7,7 @@ updates:
directory: /
schedule:
interval: daily
allow:
- dependency-type: direct
versioning-strategy: increase-if-necessary
commit-message:
prefix: deps
prefix-development: chore
labels:
- "Dependencies"
- package-ecosystem: npm
directory: workspace/test-workspace/
schedule:
interval: daily
target-branch: "main"
allow:
- dependency-type: direct
versioning-strategy: increase-if-necessary
27 changes: 1 addition & 26 deletions .github/settings.yml
Original file line number Diff line number Diff line change
@@ -15,32 +15,7 @@ branches:
protection:
required_status_checks: null
enforce_admins: true
required_pull_request_reviews:
required_approving_review_count: 1
require_code_owner_reviews: true
require_last_push_approval: true
dismiss_stale_reviews: true
restrictions:
apps: []
users: []
teams: [ "cli-team" ]
- name: latest
protection:
required_status_checks: null
enforce_admins: true
required_pull_request_reviews:
required_approving_review_count: 1
require_code_owner_reviews: true
require_last_push_approval: true
dismiss_stale_reviews: true
restrictions:
apps: []
users: []
teams: [ "cli-team" ]
- name: release/v*
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
35 changes: 32 additions & 3 deletions .github/workflows/audit.yml
Original file line number Diff line number Diff line change
@@ -25,10 +25,39 @@ jobs:
git config --global user.name "npm CLI robot"
- name: Setup Node
uses: actions/setup-node@v3
id: node
with:
node-version: 18.x
- name: Install npm@latest
run: npm i --prefer-online --no-fund --no-audit -g npm@latest
node-version: 20.x
check-latest: contains('20.x', '.x')

- name: Install Latest npm
shell: bash
env:
NODE_VERSION: ${{ steps.node.outputs.node-version }}
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
run: npm -v
- name: Install Dependencies
90 changes: 74 additions & 16 deletions .github/workflows/ci-release.yml
Original file line number Diff line number Diff line change
@@ -80,10 +80,39 @@ jobs:
git config --global user.name "npm CLI robot"
- name: Setup Node
uses: actions/setup-node@v3
id: node
with:
node-version: 18.x
- name: Install npm@latest
run: npm i --prefer-online --no-fund --no-audit -g npm@latest
node-version: 20.x
check-latest: contains('20.x', '.x')

- name: Install Latest npm
shell: bash
env:
NODE_VERSION: ${{ steps.node.outputs.node-version }}
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
run: npm -v
- name: Install Dependencies
@@ -117,12 +146,10 @@ jobs:
os: windows-latest
shell: cmd
node-version:
- 14.17.0
- 14.x
- 16.13.0
- 16.x
- 18.0.0
- 18.17.0
- 18.x
- 20.5.0
- 20.x
runs-on: ${{ matrix.platform.os }}
defaults:
run:
@@ -181,24 +208,55 @@ jobs:
git config --global user.name "npm CLI robot"
- name: Setup Node
uses: actions/setup-node@v3
id: node
with:
node-version: ${{ matrix.node-version }}
check-latest: contains(matrix.node-version, '.x')

# node 10/12/14 ship with npm@6, which is known to fail when updating itself in windows
- name: Update Windows npm
# node 12 and 14 ship with npm@6, which is known to fail when updating itself in windows
if: matrix.platform.os == 'windows-latest' && (startsWith(matrix.node-version, '12.') || startsWith(matrix.node-version, '14.'))
if: |
matrix.platform.os == 'windows-latest' && (
startsWith(steps.node.outputs.node-version, 'v10.') ||
startsWith(steps.node.outputs.node-version, 'v12.') ||
startsWith(steps.node.outputs.node-version, 'v14.')
)
run: |
curl -sO https://registry.npmjs.org/npm/-/npm-7.5.4.tgz
tar xf npm-7.5.4.tgz
cd package
node lib/npm.js install --no-fund --no-audit -g ..\npm-7.5.4.tgz
cd ..
rmdir /s /q package
- name: Install npm@7
if: startsWith(matrix.node-version, '10.')
run: npm i --prefer-online --no-fund --no-audit -g npm@7
- name: Install npm@latest
if: ${{ !startsWith(matrix.node-version, '10.') }}
run: npm i --prefer-online --no-fund --no-audit -g npm@latest
- name: Install Latest npm
shell: bash
env:
NODE_VERSION: ${{ steps.node.outputs.node-version }}
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
run: npm -v
- name: Install Dependencies
92 changes: 74 additions & 18 deletions .github/workflows/ci-test-workspace.yml
Original file line number Diff line number Diff line change
@@ -10,8 +10,6 @@ on:
push:
branches:
- main
- latest
- release/v*
paths:
- workspace/test-workspace/**
schedule:
@@ -35,10 +33,39 @@ jobs:
git config --global user.name "npm CLI robot"
- name: Setup Node
uses: actions/setup-node@v3
id: node
with:
node-version: 18.x
- name: Install npm@latest
run: npm i --prefer-online --no-fund --no-audit -g npm@latest
node-version: 20.x
check-latest: contains('20.x', '.x')

- name: Install Latest npm
shell: bash
env:
NODE_VERSION: ${{ steps.node.outputs.node-version }}
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
run: npm -v
- name: Install Dependencies
@@ -65,12 +92,10 @@ jobs:
os: windows-latest
shell: cmd
node-version:
- 14.17.0
- 14.x
- 16.13.0
- 16.x
- 18.0.0
- 18.17.0
- 18.x
- 20.5.0
- 20.x
runs-on: ${{ matrix.platform.os }}
defaults:
run:
@@ -84,24 +109,55 @@ jobs:
git config --global user.name "npm CLI robot"
- name: Setup Node
uses: actions/setup-node@v3
id: node
with:
node-version: ${{ matrix.node-version }}
check-latest: contains(matrix.node-version, '.x')

# node 10/12/14 ship with npm@6, which is known to fail when updating itself in windows
- name: Update Windows npm
# node 12 and 14 ship with npm@6, which is known to fail when updating itself in windows
if: matrix.platform.os == 'windows-latest' && (startsWith(matrix.node-version, '12.') || startsWith(matrix.node-version, '14.'))
if: |
matrix.platform.os == 'windows-latest' && (
startsWith(steps.node.outputs.node-version, 'v10.') ||
startsWith(steps.node.outputs.node-version, 'v12.') ||
startsWith(steps.node.outputs.node-version, 'v14.')
)
run: |
curl -sO https://registry.npmjs.org/npm/-/npm-7.5.4.tgz
tar xf npm-7.5.4.tgz
cd package
node lib/npm.js install --no-fund --no-audit -g ..\npm-7.5.4.tgz
cd ..
rmdir /s /q package
- name: Install npm@7
if: startsWith(matrix.node-version, '10.')
run: npm i --prefer-online --no-fund --no-audit -g npm@7
- name: Install npm@latest
if: ${{ !startsWith(matrix.node-version, '10.') }}
run: npm i --prefer-online --no-fund --no-audit -g npm@latest
- name: Install Latest npm
shell: bash
env:
NODE_VERSION: ${{ steps.node.outputs.node-version }}
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
run: npm -v
- name: Install Dependencies
Loading