@npmcli/template-oss 4.24.3 → 4.25.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/lib/config.js +2 -2
- package/lib/content/dependabot-yml.hbs +1 -1
- package/lib/content/index.js +1 -0
- package/lib/content/post-dependabot-yml.hbs +1 -1
- package/lib/content/release-integration-yml.hbs +3 -1
- package/lib/release/release-manager.js +6 -4
- package/lib/util/dependabot.js +7 -2
- package/package.json +3 -3
package/lib/config.js
CHANGED
|
@@ -160,8 +160,8 @@ const getFullConfig = async ({
|
|
|
160
160
|
pkgPath,
|
|
161
161
|
pkgDir: posixDir(pkgPath),
|
|
162
162
|
pkgGlob: posixGlob(pkgPath),
|
|
163
|
-
pkgFlags: isWorkspace ?
|
|
164
|
-
allFlags: isMono ? '
|
|
163
|
+
pkgFlags: isWorkspace ? `--workspace ${pkg.pkgJson.name}` : '',
|
|
164
|
+
allFlags: isMono ? '--workspaces --include-workspace-root --if-present' : '',
|
|
165
165
|
workspacePaths,
|
|
166
166
|
workspaceGlobs: workspacePaths.map(posixGlob),
|
|
167
167
|
// type
|
package/lib/content/index.js
CHANGED
|
@@ -31,7 +31,7 @@ jobs:
|
|
|
31
31
|
else
|
|
32
32
|
# strip leading slash from directory so it works as a
|
|
33
33
|
# a path to the workspace flag
|
|
34
|
-
echo "workspace
|
|
34
|
+
echo "workspace=--workspace ${dependabot_dir#/}" >> $GITHUB_OUTPUT
|
|
35
35
|
fi
|
|
36
36
|
|
|
37
37
|
- name: Apply Changes
|
|
@@ -68,7 +68,7 @@ class ReleaseManager {
|
|
|
68
68
|
.replace(/<X\.Y\.Z>/g, release.version)
|
|
69
69
|
.replace(/<GITHUB-RELEASE-LINK>/g, release.url)
|
|
70
70
|
.replace(/<PUBLISH-FLAGS>/g, release.flags)
|
|
71
|
-
.replace(/^(\s*\S.*)(
|
|
71
|
+
.replace(/^(\s*\S.*)(--workspace <WS-PKG-N>)$/gm, workspaces.map(w => `$1${w.flags}`).join('\n'))
|
|
72
72
|
.trim()
|
|
73
73
|
|
|
74
74
|
return `### Release Checklist for ${release.tag}\n\n${checklist}`
|
|
@@ -150,7 +150,9 @@ class ReleaseManager {
|
|
|
150
150
|
version: rawVersion,
|
|
151
151
|
major: version.major,
|
|
152
152
|
url: `https://github.com/${pullRequest.base.repo.full_name}/releases/tag/${tag}`,
|
|
153
|
-
flags: [workspaces[name] ?
|
|
153
|
+
flags: [workspaces[name] ? `--workspace ${workspaces[name]}` : null, `--tag=${publishTag}`]
|
|
154
|
+
.filter(Boolean)
|
|
155
|
+
.join(' '),
|
|
154
156
|
}
|
|
155
157
|
}
|
|
156
158
|
|
|
@@ -221,7 +223,7 @@ class ReleaseManager {
|
|
|
221
223
|
1. Publish workspaces
|
|
222
224
|
|
|
223
225
|
${block('sh')}
|
|
224
|
-
npm publish
|
|
226
|
+
npm publish --workspace <WS-PKG-N>
|
|
225
227
|
${block()}
|
|
226
228
|
|
|
227
229
|
1. Publish
|
|
@@ -261,7 +263,7 @@ class ReleaseManager {
|
|
|
261
263
|
Release Please will run on the just pushed release commit and create GitHub releases and tags for each package.
|
|
262
264
|
|
|
263
265
|
${block('sh')}
|
|
264
|
-
gh run watch ${R} $(gh run list ${R}
|
|
266
|
+
gh run watch ${R} $(gh run list ${R} --workspace release -b <BASE-BRANCH> -L 1 --json databaseId -q ".[0].databaseId")
|
|
265
267
|
${block()}
|
|
266
268
|
`
|
|
267
269
|
/* eslint-enable max-len */
|
package/lib/util/dependabot.js
CHANGED
|
@@ -4,8 +4,8 @@ const { minimatch } = require('minimatch')
|
|
|
4
4
|
const parseDependabotConfig = v => (typeof v === 'string' ? { strategy: v } : (v ?? {}))
|
|
5
5
|
|
|
6
6
|
module.exports = (config, defaultConfig, branches) => {
|
|
7
|
-
const { dependabot } = config
|
|
8
|
-
const { dependabot: defaultDependabot } = defaultConfig
|
|
7
|
+
const { dependabot, dependabotInterval } = config
|
|
8
|
+
const { dependabot: defaultDependabot, dependabotInterval: defaultInterval } = defaultConfig
|
|
9
9
|
|
|
10
10
|
if (!dependabot) {
|
|
11
11
|
return false
|
|
@@ -15,8 +15,13 @@ module.exports = (config, defaultConfig, branches) => {
|
|
|
15
15
|
.filter(b => dependabot[b] !== false)
|
|
16
16
|
.map(branch => {
|
|
17
17
|
const isReleaseBranch = minimatch(branch, config.releaseBranch)
|
|
18
|
+
|
|
19
|
+
// Determine the interval to use: branch-specific > package-specific > default
|
|
20
|
+
const interval = parseDependabotConfig(dependabot[branch]).interval || dependabotInterval || defaultInterval
|
|
21
|
+
|
|
18
22
|
return {
|
|
19
23
|
branch,
|
|
24
|
+
interval,
|
|
20
25
|
allowNames: isReleaseBranch ? [NAME] : [],
|
|
21
26
|
labels: isReleaseBranch ? ['Backport', branch] : [],
|
|
22
27
|
...parseDependabotConfig(defaultDependabot),
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@npmcli/template-oss",
|
|
3
|
-
"version": "4.
|
|
3
|
+
"version": "4.25.0",
|
|
4
4
|
"description": "templated files used in npm CLI team oss projects",
|
|
5
5
|
"main": "lib/content/index.js",
|
|
6
6
|
"bin": {
|
|
@@ -20,8 +20,8 @@
|
|
|
20
20
|
"postinstall": "template-oss-apply",
|
|
21
21
|
"eslint": "eslint \"**/*.{js,cjs,ts,mjs,jsx,tsx}\"",
|
|
22
22
|
"prettier": "prettier \"**/*.{js,cjs,ts,mjs,jsx,tsx,json}\"",
|
|
23
|
-
"test-all": "npm run test
|
|
24
|
-
"lint-all": "npm run lint
|
|
23
|
+
"test-all": "npm run test --workspaces --include-workspace-root --if-present",
|
|
24
|
+
"lint-all": "npm run lint --workspaces --include-workspace-root --if-present"
|
|
25
25
|
},
|
|
26
26
|
"repository": {
|
|
27
27
|
"type": "git",
|