@npmcli/template-oss 4.1.1 → 4.1.2
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-please.js
CHANGED
|
@@ -20,6 +20,13 @@ const setOutput = (key, val) => {
|
|
|
20
20
|
console.log(update.updater.changelogEntry)
|
|
21
21
|
console.log('-'.repeat(40))
|
|
22
22
|
}
|
|
23
|
+
for (const update of val.updates.filter(u => u.updater.rawContent)) {
|
|
24
|
+
console.log('package:', update.path)
|
|
25
|
+
console.log('-'.repeat(40))
|
|
26
|
+
console.log(JSON.parse(update.updater.rawContent).name)
|
|
27
|
+
console.log(JSON.parse(update.updater.rawContent).version)
|
|
28
|
+
console.log('-'.repeat(40))
|
|
29
|
+
}
|
|
23
30
|
}
|
|
24
31
|
} else {
|
|
25
32
|
core.setOutput(key, JSON.stringify(val))
|
|
@@ -10,35 +10,39 @@ module.exports = (gh) => {
|
|
|
10
10
|
return response
|
|
11
11
|
}
|
|
12
12
|
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
13
|
+
try {
|
|
14
|
+
const { repository } = await gh.graphql(
|
|
15
|
+
`fragment CommitAuthors on GitObject {
|
|
16
|
+
... on Commit {
|
|
17
|
+
authors (first:10) {
|
|
18
|
+
nodes {
|
|
19
|
+
user { login }
|
|
20
|
+
name
|
|
21
|
+
}
|
|
20
22
|
}
|
|
21
23
|
}
|
|
22
24
|
}
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
}
|
|
25
|
+
query {
|
|
26
|
+
repository (owner:"${owner}", name:"${repo}") {
|
|
27
|
+
${shas.map((s) => {
|
|
28
|
+
return `_${s}: object (expression: "${s}") { ...CommitAuthors }`
|
|
29
|
+
})}
|
|
30
|
+
}
|
|
31
|
+
}`
|
|
32
|
+
)
|
|
33
|
+
|
|
34
|
+
for (const [key, commit] of Object.entries(repository)) {
|
|
35
|
+
if (commit) {
|
|
36
|
+
response[key.slice(1)] = commit.authors.nodes
|
|
37
|
+
.map((a) => a.user && a.user.login ? `@${a.user.login}` : a.name)
|
|
38
|
+
.filter(Boolean)
|
|
29
39
|
}
|
|
30
|
-
}`
|
|
31
|
-
)
|
|
32
|
-
|
|
33
|
-
for (const [key, commit] of Object.entries(repository)) {
|
|
34
|
-
if (commit) {
|
|
35
|
-
response[key.slice(1)] = commit.authors.nodes
|
|
36
|
-
.map((a) => a.user && a.user.login ? `@${a.user.login}` : a.name)
|
|
37
|
-
.filter(Boolean)
|
|
38
40
|
}
|
|
39
|
-
}
|
|
40
41
|
|
|
41
|
-
|
|
42
|
+
return response
|
|
43
|
+
} catch {
|
|
44
|
+
return response
|
|
45
|
+
}
|
|
42
46
|
}
|
|
43
47
|
|
|
44
48
|
const url = (...p) => `https://github.com/${owner}/${repo}/${p.join('/')}`
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
const localeCompare = require('@isaacs/string-locale-compare')('en')
|
|
1
2
|
const { NodeWorkspace } = require('release-please/build/src/plugins/node-workspace.js')
|
|
2
3
|
const { RawContent } = require('release-please/build/src/updaters/raw-content.js')
|
|
3
4
|
const { jsonStringify } = require('release-please/build/src/util/json-stringify.js')
|
|
@@ -105,9 +106,11 @@ module.exports = class extends NodeWorkspace {
|
|
|
105
106
|
// except it only updates the package.json instead of appending
|
|
106
107
|
// anything to changelogs since we've already done that in preconfigure.
|
|
107
108
|
updateCandidate (candidate, pkg, updatedVersions) {
|
|
109
|
+
const newVersion = updatedVersions.get(pkg.name)
|
|
108
110
|
const graphPackage = this.packageGraph.get(pkg.name)
|
|
109
|
-
const updatedPackage = pkg.clone()
|
|
110
111
|
|
|
112
|
+
const updatedPackage = pkg.clone()
|
|
113
|
+
updatedPackage.version = newVersion.toString()
|
|
111
114
|
for (const [depName, resolved] of graphPackage.localDependencies) {
|
|
112
115
|
const depVersion = updatedVersions.get(depName)
|
|
113
116
|
if (depVersion && resolved.type !== 'directory') {
|
|
@@ -160,10 +163,13 @@ module.exports = class extends NodeWorkspace {
|
|
|
160
163
|
if (aPath === ROOT_PROJECT_PATH) {
|
|
161
164
|
return -1
|
|
162
165
|
}
|
|
166
|
+
// release please pre sorts based on graph order so
|
|
167
|
+
// this is never called in normal circumstances
|
|
168
|
+
/* istanbul ignore next */
|
|
163
169
|
if (bPath === ROOT_PROJECT_PATH) {
|
|
164
170
|
return 1
|
|
165
171
|
}
|
|
166
|
-
return
|
|
172
|
+
return localeCompare(aPath, bPath)
|
|
167
173
|
})
|
|
168
174
|
}
|
|
169
175
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@npmcli/template-oss",
|
|
3
|
-
"version": "4.1.
|
|
3
|
+
"version": "4.1.2",
|
|
4
4
|
"description": "templated files used in npm CLI team oss projects",
|
|
5
5
|
"main": "lib/content/index.js",
|
|
6
6
|
"bin": {
|
|
@@ -32,6 +32,7 @@
|
|
|
32
32
|
"@actions/core": "^1.9.1",
|
|
33
33
|
"@commitlint/cli": "^17.1.1",
|
|
34
34
|
"@commitlint/config-conventional": "^17.1.0",
|
|
35
|
+
"@isaacs/string-locale-compare": "^1.1.0",
|
|
35
36
|
"@npmcli/fs": "^2.0.1",
|
|
36
37
|
"@npmcli/git": "^3.0.0",
|
|
37
38
|
"@npmcli/map-workspaces": "^2.0.2",
|