@npmcli/template-oss 3.5.0 → 3.6.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/check/check-changelog.js +3 -4
- package/lib/check/check-gitignore.js +1 -2
- package/lib/content/audit.yml +2 -2
- package/lib/content/ci.yml +4 -2
- package/lib/content/codeql-analysis.yml +2 -2
- package/lib/content/index.js +1 -0
- package/lib/content/tap.json +28 -0
- package/lib/util/get-git-url.js +3 -1
- package/lib/util/parser.js +1 -2
- package/package.json +2 -2
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
const fs = require('@npmcli/fs')
|
|
2
|
-
const { EOL } = require('os')
|
|
3
2
|
const { join, relative } = require('path')
|
|
4
3
|
|
|
5
4
|
const run = async ({ root, path }) => {
|
|
@@ -10,13 +9,13 @@ const run = async ({ root, path }) => {
|
|
|
10
9
|
|
|
11
10
|
if (await fs.exists(changelog)) {
|
|
12
11
|
const content = await fs.readFile(changelog, { encoding: 'utf8' })
|
|
13
|
-
const mustStart =
|
|
14
|
-
if (!
|
|
12
|
+
const mustStart = /^#\s+Changelog\r?\n\r?\n#/
|
|
13
|
+
if (!mustStart.test(content)) {
|
|
15
14
|
return {
|
|
16
15
|
title: `The ${relative(root, changelog)} is incorrect:`,
|
|
17
16
|
body: [
|
|
18
17
|
'The changelog should start with',
|
|
19
|
-
`"
|
|
18
|
+
`"# Changelog\n\n#"`,
|
|
20
19
|
],
|
|
21
20
|
solution: 'reformat the changelog to have the correct heading',
|
|
22
21
|
}
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
const log = require('proc-log')
|
|
2
|
-
const { EOL } = require('os')
|
|
3
2
|
const { resolve, relative, basename } = require('path')
|
|
4
3
|
const fs = require('@npmcli/fs')
|
|
5
4
|
const git = require('@npmcli/git')
|
|
@@ -48,7 +47,7 @@ const run = async ({ root, path, config }) => {
|
|
|
48
47
|
|
|
49
48
|
const ignores = (await fs.readFile(ignoreFile))
|
|
50
49
|
.toString()
|
|
51
|
-
.split(
|
|
50
|
+
.split(/\r?\n/)
|
|
52
51
|
.filter((l) => l && !l.trim().startsWith('#'))
|
|
53
52
|
|
|
54
53
|
const relIgnore = relativeToRoot(ignoreFile)
|
package/lib/content/audit.yml
CHANGED
package/lib/content/ci.yml
CHANGED
|
@@ -19,8 +19,8 @@ on:
|
|
|
19
19
|
- {{pkgRelPath}}/**
|
|
20
20
|
{{/if}}
|
|
21
21
|
schedule:
|
|
22
|
-
# "At 02:00 on Monday" https://crontab.guru/#
|
|
23
|
-
- cron: "0
|
|
22
|
+
# "At 09:00 UTC (02:00 PT) on Monday" https://crontab.guru/#0_9_*_*_1
|
|
23
|
+
- cron: "0 9 * * 1"
|
|
24
24
|
|
|
25
25
|
jobs:
|
|
26
26
|
lint:
|
|
@@ -55,5 +55,7 @@ jobs:
|
|
|
55
55
|
steps:
|
|
56
56
|
{{> setupGit}}
|
|
57
57
|
{{> setupNode useMatrix=true}}
|
|
58
|
+
- name: add tap problem matcher
|
|
59
|
+
run: echo "::add-matcher::.github/matchers/tap.json"
|
|
58
60
|
- run: npm i --ignore-scripts --no-audit --no-fund
|
|
59
61
|
- run: npm test --ignore-scripts {{~#if isWorkspace}} -w {{pkgName}}{{/if}}
|
package/lib/content/index.js
CHANGED
|
@@ -9,6 +9,7 @@ const rootRepo = {
|
|
|
9
9
|
'.github/ISSUE_TEMPLATE/config.yml': 'config.yml',
|
|
10
10
|
'.github/CODEOWNERS': 'CODEOWNERS',
|
|
11
11
|
'.github/dependabot.yml': 'dependabot.yml',
|
|
12
|
+
'.github/matchers/tap.json': 'tap.json',
|
|
12
13
|
'.github/workflows/audit.yml': 'audit.yml',
|
|
13
14
|
'.github/workflows/codeql-analysis.yml': 'codeql-analysis.yml',
|
|
14
15
|
'.github/workflows/post-dependabot.yml': 'post-dependabot.yml',
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
{
|
|
2
|
+
"problemMatcher": [{
|
|
3
|
+
"owner": "tap",
|
|
4
|
+
"pattern" : [
|
|
5
|
+
{
|
|
6
|
+
"regexp": "^\\s*not ok \\d+ - (.*)",
|
|
7
|
+
"message": 1
|
|
8
|
+
},
|
|
9
|
+
{
|
|
10
|
+
"regexp": "^\\s*---"
|
|
11
|
+
},
|
|
12
|
+
{
|
|
13
|
+
"regexp": "^\\s*at:"
|
|
14
|
+
},
|
|
15
|
+
{
|
|
16
|
+
"regexp": "^\\s*line:\\s*(\\d+)",
|
|
17
|
+
"line": 1
|
|
18
|
+
},
|
|
19
|
+
{
|
|
20
|
+
"regexp": "^\\s*column:\\s*(\\d+)",
|
|
21
|
+
"column": 1
|
|
22
|
+
}, {
|
|
23
|
+
"regexp": "^\\s*file:\\s*(.*)",
|
|
24
|
+
"file": 1
|
|
25
|
+
}
|
|
26
|
+
]
|
|
27
|
+
}]
|
|
28
|
+
}
|
package/lib/util/get-git-url.js
CHANGED
package/lib/util/parser.js
CHANGED
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
const fs = require('@npmcli/fs')
|
|
2
|
-
const { EOL } = require('os')
|
|
3
2
|
const { basename, extname, dirname } = require('path')
|
|
4
3
|
const yaml = require('yaml')
|
|
5
4
|
const NpmPackageJson = require('@npmcli/package-json')
|
|
@@ -56,7 +55,7 @@ class Base {
|
|
|
56
55
|
|
|
57
56
|
prepare (s) {
|
|
58
57
|
const header = this.header()
|
|
59
|
-
return header ? header
|
|
58
|
+
return header ? `${header}\n\n${s}` : s
|
|
60
59
|
}
|
|
61
60
|
|
|
62
61
|
prepareTarget (s) {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@npmcli/template-oss",
|
|
3
|
-
"version": "3.
|
|
3
|
+
"version": "3.6.0",
|
|
4
4
|
"description": "templated files used in npm CLI team oss projects",
|
|
5
5
|
"main": "lib/content/index.js",
|
|
6
6
|
"bin": {
|
|
@@ -45,7 +45,7 @@
|
|
|
45
45
|
"npm-package-arg": "^9.0.1",
|
|
46
46
|
"proc-log": "^2.0.0",
|
|
47
47
|
"semver": "^7.3.5",
|
|
48
|
-
"yaml": "
|
|
48
|
+
"yaml": "2.0.0-11"
|
|
49
49
|
},
|
|
50
50
|
"files": [
|
|
51
51
|
"bin/",
|