@npmcli/template-oss 3.2.1 → 3.2.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/lib/config.js
CHANGED
package/lib/content/index.js
CHANGED
|
@@ -38,7 +38,10 @@ const rootModule = {
|
|
|
38
38
|
// Changes for each workspace but applied to the root of the repo
|
|
39
39
|
const workspaceRepo = {
|
|
40
40
|
add: {
|
|
41
|
-
'.github/workflows/release-please-{{pkgNameFs}}.yml':
|
|
41
|
+
'.github/workflows/release-please-{{pkgNameFs}}.yml': {
|
|
42
|
+
file: 'release-please.yml',
|
|
43
|
+
filter: (o) => !o.pkg.private,
|
|
44
|
+
},
|
|
42
45
|
'.github/workflows/ci-{{pkgNameFs}}.yml': 'ci.yml',
|
|
43
46
|
},
|
|
44
47
|
}
|
package/lib/content/pkg.json
CHANGED
|
@@ -7,8 +7,12 @@
|
|
|
7
7
|
"template-oss-apply": "template-oss-apply --force",
|
|
8
8
|
"lintfix": "npm run lint -- --fix",
|
|
9
9
|
"preversion": "npm test",
|
|
10
|
+
{{#if pkgPrivate}}
|
|
11
|
+
"postversion": "git push origin --follow-tags",
|
|
12
|
+
{{else}}
|
|
10
13
|
"postversion": "npm publish",
|
|
11
14
|
"prepublishOnly": "git push origin --follow-tags",
|
|
15
|
+
{{/if}}
|
|
12
16
|
"snap": "tap",
|
|
13
17
|
"test": "tap",
|
|
14
18
|
"posttest": "npm run lint",
|
package/lib/util/files.js
CHANGED
|
@@ -9,13 +9,24 @@ const fullTarget = (dir, file, options) => join(dir, template(file, options))
|
|
|
9
9
|
|
|
10
10
|
// given an obj of files, return the full target/source paths and associated parser
|
|
11
11
|
const getParsers = (dir, files, options) => Object.entries(files).map(([t, s]) => {
|
|
12
|
-
let {
|
|
13
|
-
|
|
12
|
+
let {
|
|
13
|
+
file,
|
|
14
|
+
parser: fileParser,
|
|
15
|
+
filter,
|
|
16
|
+
} = typeof s === 'string' ? { file: s } : s
|
|
17
|
+
|
|
14
18
|
file = join(options.config.sourceDir, file)
|
|
19
|
+
const target = fullTarget(dir, t, options)
|
|
20
|
+
|
|
21
|
+
if (typeof filter === 'function' && !filter(options)) {
|
|
22
|
+
return null
|
|
23
|
+
}
|
|
24
|
+
|
|
15
25
|
if (fileParser) {
|
|
16
26
|
// allow files to extend base parsers or create new ones
|
|
17
27
|
return new (fileParser(Parser.Parsers))(target, file, options)
|
|
18
28
|
}
|
|
29
|
+
|
|
19
30
|
return new (Parser(file))(target, file, options)
|
|
20
31
|
})
|
|
21
32
|
|
|
@@ -32,7 +43,9 @@ const rmEach = async (dir, files, options, fn) => {
|
|
|
32
43
|
const parseEach = async (dir, files, options, fn) => {
|
|
33
44
|
const res = []
|
|
34
45
|
for (const parser of getParsers(dir, files, options)) {
|
|
35
|
-
|
|
46
|
+
if (parser) {
|
|
47
|
+
res.push(await fn(parser))
|
|
48
|
+
}
|
|
36
49
|
}
|
|
37
50
|
return res.filter(Boolean)
|
|
38
51
|
}
|
package/lib/util/parser.js
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@npmcli/template-oss",
|
|
3
|
-
"version": "3.2.
|
|
3
|
+
"version": "3.2.2",
|
|
4
4
|
"description": "templated files used in npm CLI team oss projects",
|
|
5
5
|
"main": "lib/content/index.js",
|
|
6
6
|
"bin": {
|
|
@@ -44,7 +44,7 @@
|
|
|
44
44
|
"npm-package-arg": "^9.0.1",
|
|
45
45
|
"proc-log": "^2.0.0",
|
|
46
46
|
"semver": "^7.3.5",
|
|
47
|
-
"yaml": "^2.0.0-
|
|
47
|
+
"yaml": "^2.0.0-11"
|
|
48
48
|
},
|
|
49
49
|
"files": [
|
|
50
50
|
"bin/",
|