@npmcli/template-oss 4.12.1 → 4.14.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/bin/release-manager.js
CHANGED
|
@@ -17,14 +17,14 @@ const args = process.argv.slice(2).reduce((acc, a) => {
|
|
|
17
17
|
}, {})
|
|
18
18
|
|
|
19
19
|
/* eslint-disable max-len */
|
|
20
|
-
const
|
|
20
|
+
const MANUAL_PUBLISH_STEPS = `
|
|
21
21
|
1. Checkout the release branch and test
|
|
22
22
|
|
|
23
23
|
\`\`\`sh
|
|
24
24
|
gh pr checkout <PR-NUMBER> --force
|
|
25
25
|
npm ${args.lockfile ? 'ci' : 'update'}
|
|
26
26
|
npm test
|
|
27
|
-
gh pr checks --watch
|
|
27
|
+
gh pr checks <PR-NUMBER> -R {NWO} --watch
|
|
28
28
|
\`\`\`
|
|
29
29
|
|
|
30
30
|
1. Publish workspaces
|
|
@@ -42,12 +42,22 @@ const DEFAULT_RELEASE_PROCESS = `
|
|
|
42
42
|
1. Merge release PR
|
|
43
43
|
|
|
44
44
|
\`\`\`sh
|
|
45
|
-
gh pr merge --rebase
|
|
45
|
+
gh pr merge <PR-NUMBER> -R {NWO} --rebase
|
|
46
46
|
git checkout <BASE-BRANCH>
|
|
47
47
|
git fetch
|
|
48
48
|
git reset --hard origin/<BASE-BRANCH>
|
|
49
49
|
\`\`\`
|
|
50
|
+
`
|
|
50
51
|
|
|
52
|
+
const AUTO_PUBLISH_STEPS = `
|
|
53
|
+
1. Merge release PR :rotating_light: Merging this will auto publish :rotating_light:
|
|
54
|
+
|
|
55
|
+
\`\`\`sh
|
|
56
|
+
gh pr merge <PR-NUMBER> -R {NWO} --rebase
|
|
57
|
+
\`\`\`
|
|
58
|
+
`
|
|
59
|
+
|
|
60
|
+
const DEFAULT_RELEASE_PROCESS = (args.publish ? AUTO_PUBLISH_STEPS : MANUAL_PUBLISH_STEPS) + `
|
|
51
61
|
1. Check For Release Tags
|
|
52
62
|
|
|
53
63
|
Release Please will run on the just pushed release commit and create GitHub releases and tags for each package.
|
|
@@ -55,7 +65,8 @@ const DEFAULT_RELEASE_PROCESS = `
|
|
|
55
65
|
\`\`\`
|
|
56
66
|
gh run watch \`gh run list -R {NWO} -w release -b <BASE-BRANCH> -L 1 --json databaseId -q ".[0].databaseId"\`
|
|
57
67
|
\`\`\`
|
|
58
|
-
`
|
|
68
|
+
`
|
|
69
|
+
/* eslint-enable max-len */
|
|
59
70
|
|
|
60
71
|
const getReleaseProcess = async ({ owner, repo }) => {
|
|
61
72
|
const RELEASE_LIST_ITEM = /^\d+\.\s/gm
|
|
@@ -1,3 +1,28 @@
|
|
|
1
|
+
{{#if publish}}
|
|
2
|
+
runs-on: ubuntu-latest
|
|
3
|
+
defaults:
|
|
4
|
+
run:
|
|
5
|
+
shell: bash
|
|
6
|
+
permissions:
|
|
7
|
+
deployments: write
|
|
8
|
+
steps:
|
|
9
|
+
- name: Checkout
|
|
10
|
+
uses: actions/checkout@v3
|
|
11
|
+
with:
|
|
12
|
+
ref: $\{{ fromJSON(needs.release.outputs.release).tagName }}
|
|
13
|
+
- name: Setup Node
|
|
14
|
+
uses: actions/setup-node@v3
|
|
15
|
+
with:
|
|
16
|
+
node-version: 18.x
|
|
17
|
+
- name: Install npm@latest
|
|
18
|
+
run: |
|
|
19
|
+
npm i --prefer-online --no-fund --no-audit -g npm@latest
|
|
20
|
+
npm config set '//registry.npmjs.org/:_authToken'=\${PUBLISH_TOKEN}
|
|
21
|
+
- name: Publish
|
|
22
|
+
env:
|
|
23
|
+
PUBLISH_TOKEN: $\{{ secrets.PUBLISH_TOKEN }}
|
|
24
|
+
run: npm publish --provenance
|
|
25
|
+
{{else}}
|
|
1
26
|
runs-on: ubuntu-latest
|
|
2
27
|
defaults:
|
|
3
28
|
run:
|
|
@@ -30,3 +55,4 @@ steps:
|
|
|
30
55
|
done
|
|
31
56
|
|
|
32
57
|
exit $EXIT_CODE
|
|
58
|
+
{{/if}}
|
package/lib/content/index.js
CHANGED
package/lib/content/release.yml
CHANGED
|
@@ -85,7 +85,7 @@ jobs:
|
|
|
85
85
|
RELEASE_COMMENT_ID: $\{{ needs.release.outputs.comment-id }}
|
|
86
86
|
GITHUB_TOKEN: $\{{ secrets.GITHUB_TOKEN }}
|
|
87
87
|
run: |
|
|
88
|
-
{{ rootNpmPath }} exec --offline -- template-oss-release-manager --lockfile={{ lockfile }}
|
|
88
|
+
{{ rootNpmPath }} exec --offline -- template-oss-release-manager --lockfile={{ lockfile }} --publish={{ publish }}
|
|
89
89
|
{{ rootNpmPath }} run rp-pull-request --ignore-scripts {{~#if allFlags}} {{ allFlags }}{{else}} --if-present{{/if}}
|
|
90
90
|
- name: Commit
|
|
91
91
|
id: commit
|
package/lib/util/files.js
CHANGED
|
@@ -2,7 +2,7 @@ const { join } = require('path')
|
|
|
2
2
|
const { defaultsDeep } = require('lodash')
|
|
3
3
|
const merge = require('./merge.js')
|
|
4
4
|
const deepMapValues = require('just-deep-map-values')
|
|
5
|
-
const glob = require('glob')
|
|
5
|
+
const { glob } = require('glob')
|
|
6
6
|
const Parser = require('./parser.js')
|
|
7
7
|
const template = require('./template.js')
|
|
8
8
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@npmcli/template-oss",
|
|
3
|
-
"version": "4.
|
|
3
|
+
"version": "4.14.0",
|
|
4
4
|
"description": "templated files used in npm CLI team oss projects",
|
|
5
5
|
"main": "lib/content/index.js",
|
|
6
6
|
"bin": {
|
|
@@ -42,10 +42,10 @@
|
|
|
42
42
|
"@npmcli/package-json": "^3.0.0",
|
|
43
43
|
"@octokit/rest": "^19.0.4",
|
|
44
44
|
"diff": "^5.0.0",
|
|
45
|
-
"glob": "^
|
|
45
|
+
"glob": "^10.1.0",
|
|
46
46
|
"handlebars": "^4.7.7",
|
|
47
47
|
"hosted-git-info": "^6.0.0",
|
|
48
|
-
"ini": "^
|
|
48
|
+
"ini": "^4.0.0",
|
|
49
49
|
"json-parse-even-better-errors": "^3.0.0",
|
|
50
50
|
"just-deep-map-values": "^1.1.1",
|
|
51
51
|
"just-diff": "^6.0.0",
|
|
@@ -76,7 +76,8 @@
|
|
|
76
76
|
"test-ignore": "^(workspace/test-workspace)/"
|
|
77
77
|
},
|
|
78
78
|
"templateOSS": {
|
|
79
|
-
"//@npmcli/template-oss": "This file is partially managed by @npmcli/template-oss. Edits may be overwritten."
|
|
79
|
+
"//@npmcli/template-oss": "This file is partially managed by @npmcli/template-oss. Edits may be overwritten.",
|
|
80
|
+
"publish": true
|
|
80
81
|
},
|
|
81
82
|
"engines": {
|
|
82
83
|
"node": "^14.17.0 || ^16.13.0 || >=18.0.0"
|