@npmcli/template-oss 4.24.4 → 4.25.1

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.
@@ -5,7 +5,7 @@ updates:
5
5
  - package-ecosystem: npm
6
6
  directory: /
7
7
  schedule:
8
- interval: daily
8
+ interval: {{ interval }}
9
9
  target-branch: "{{ branch }}"
10
10
  allow:
11
11
  - dependency-type: direct
@@ -187,6 +187,7 @@ module.exports = {
187
187
  esm: false,
188
188
  updateNpm: true,
189
189
  dependabot: 'increase-if-necessary',
190
+ dependabotInterval: 'daily',
190
191
  unwantedPackages: [
191
192
  'eslint',
192
193
  'eslint-plugin-node',
@@ -1,15 +1,14 @@
1
- const { Octokit } = require('@octokit/rest')
2
1
  const core = require('@actions/core')
3
2
  const { join } = require('path')
4
3
  const semver = require('semver')
5
4
  const assert = require('assert')
6
5
  const dedent = require('dedent')
7
6
  const mapWorkspaces = require('@npmcli/map-workspaces')
8
- const { request: fetch } = require('undici')
9
7
  const { getPublishTag, block, noop } = require('./util')
10
8
 
11
9
  class ReleaseManager {
12
10
  #octokit
11
+ #token
13
12
  #owner
14
13
  #repo
15
14
  #cwd
@@ -28,7 +27,7 @@ class ReleaseManager {
28
27
  assert(pr, 'pr is required')
29
28
  assert(defaultTag, 'defaultTag is required')
30
29
 
31
- this.#octokit = new Octokit({ auth: token })
30
+ this.#token = token
32
31
  this.#owner = repo.split('/')[0]
33
32
  this.#repo = repo.split('/')[1]
34
33
  this.#cwd = cwd
@@ -43,9 +42,15 @@ class ReleaseManager {
43
42
 
44
43
  static async run(options) {
45
44
  const manager = new ReleaseManager(options)
45
+ await manager.#init()
46
46
  return manager.run()
47
47
  }
48
48
 
49
+ async #init() {
50
+ const { Octokit } = await import('@octokit/rest')
51
+ this.#octokit = new Octokit({ auth: this.#token })
52
+ }
53
+
49
54
  async run() {
50
55
  const { data: pullRequest } = await this.#octokit.rest.pulls.get({
51
56
  owner: this.#owner,
@@ -168,15 +173,15 @@ class ReleaseManager {
168
173
  // up because that means something is very wrong. This is a rare edge
169
174
  // case that isn't worth testing.
170
175
 
171
- if (r.statusCode === 200) {
176
+ if (r.status === 200) {
172
177
  this.#info('Found release process from wiki')
173
- return r.body.text()
174
- } else if (r.statusCode === 404) {
178
+ return r.text()
179
+ } else if (r.status === 404) {
175
180
  this.#info('No release process found in wiki, falling back to default process')
176
181
  return this.#getReleaseSteps()
177
182
  /* c8 ignore next 3 */
178
183
  } else {
179
- throw new Error(`Release process fetch failed with status: ${r.statusCode}`)
184
+ throw new Error(`Release process fetch failed with status: ${r.status}`)
180
185
  }
181
186
  })
182
187
 
@@ -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.24.4",
3
+ "version": "4.25.1",
4
4
  "description": "templated files used in npm CLI team oss projects",
5
5
  "main": "lib/content/index.js",
6
6
  "bin": {
@@ -38,28 +38,27 @@
38
38
  "@commitlint/cli": "^19.0.3",
39
39
  "@commitlint/config-conventional": "^19.2.2",
40
40
  "@isaacs/string-locale-compare": "^1.1.0",
41
- "@npmcli/arborist": "^7.2.1",
42
- "@npmcli/git": "^6.0.0",
43
- "@npmcli/map-workspaces": "^4.0.0",
44
- "@npmcli/package-json": "^6.0.0",
45
- "@octokit/rest": "^19.0.4",
41
+ "@npmcli/arborist": "^9.1.2",
42
+ "@npmcli/git": "^7.0.0",
43
+ "@npmcli/map-workspaces": "^5.0.0",
44
+ "@npmcli/package-json": "^7.0.0",
45
+ "@octokit/rest": "^22.0.0",
46
46
  "dedent": "^1.5.1",
47
- "diff": "^7.0.0",
48
- "glob": "^10.1.0",
47
+ "diff": "^8.0.2",
48
+ "glob": "^11.0.3",
49
49
  "handlebars": "^4.7.7",
50
- "hosted-git-info": "^8.0.0",
50
+ "hosted-git-info": "^9.0.0",
51
51
  "ini": "^5.0.0",
52
52
  "json-parse-even-better-errors": "^4.0.0",
53
53
  "just-deep-map-values": "^1.1.1",
54
54
  "just-diff": "^6.0.0",
55
55
  "just-omit": "^2.2.0",
56
56
  "lodash": "^4.17.21",
57
- "minimatch": "^9.0.2",
58
- "npm-package-arg": "^12.0.0",
57
+ "minimatch": "^10.0.3",
58
+ "npm-package-arg": "^13.0.0",
59
59
  "proc-log": "^5.0.0",
60
- "release-please": "16.15.0",
60
+ "release-please": "^17.1.1",
61
61
  "semver": "^7.3.5",
62
- "undici": "^6.7.0",
63
62
  "yaml": "^2.1.1"
64
63
  },
65
64
  "files": [
@@ -71,15 +70,12 @@
71
70
  "@npmcli/eslint-config": "^5.0.0",
72
71
  "@npmcli/template-oss": "file:./",
73
72
  "eslint-config-prettier": "^9.1.0",
74
- "nock": "^13.3.8",
73
+ "nock": "^14.0.6",
75
74
  "prettier": "^3.2.5",
76
75
  "tap": "^21.0.1"
77
76
  },
78
77
  "tap": {
79
78
  "timeout": 600,
80
- "node-arg": [
81
- "--no-experimental-fetch"
82
- ],
83
79
  "exclude": [
84
80
  "workspace/test-workspace/**"
85
81
  ],