@npmcli/template-oss 4.25.0 → 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.
- package/lib/release/release-manager.js +12 -7
- package/package.json +13 -17
|
@@ -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.#
|
|
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.
|
|
176
|
+
if (r.status === 200) {
|
|
172
177
|
this.#info('Found release process from wiki')
|
|
173
|
-
return r.
|
|
174
|
-
} else if (r.
|
|
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.
|
|
184
|
+
throw new Error(`Release process fetch failed with status: ${r.status}`)
|
|
180
185
|
}
|
|
181
186
|
})
|
|
182
187
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@npmcli/template-oss",
|
|
3
|
-
"version": "4.25.
|
|
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": "^
|
|
42
|
-
"@npmcli/git": "^
|
|
43
|
-
"@npmcli/map-workspaces": "^
|
|
44
|
-
"@npmcli/package-json": "^
|
|
45
|
-
"@octokit/rest": "^
|
|
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": "^
|
|
48
|
-
"glob": "^
|
|
47
|
+
"diff": "^8.0.2",
|
|
48
|
+
"glob": "^11.0.3",
|
|
49
49
|
"handlebars": "^4.7.7",
|
|
50
|
-
"hosted-git-info": "^
|
|
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": "^
|
|
58
|
-
"npm-package-arg": "^
|
|
57
|
+
"minimatch": "^10.0.3",
|
|
58
|
+
"npm-package-arg": "^13.0.0",
|
|
59
59
|
"proc-log": "^5.0.0",
|
|
60
|
-
"release-please": "
|
|
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": "^
|
|
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
|
],
|