@npmcli/template-oss 3.4.2 → 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.
@@ -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 = `# Changelog${EOL}${EOL}#`
14
- if (!content.startsWith(mustStart)) {
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
- `"${mustStart}"`,
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(EOL)
50
+ .split(/\r?\n/)
52
51
  .filter((l) => l && !l.trim().startsWith('#'))
53
52
 
54
53
  const relIgnore = relativeToRoot(ignoreFile)
@@ -0,0 +1,5 @@
1
+ All interactions in this repo are covered by the [npm Code of
2
+ Conduct](https://docs.npmjs.com/policies/conduct)
3
+
4
+ The npm cli team may, at its own discretion, moderate, remove, or edit
5
+ any interactions such as pull requests, issues, and comments.
@@ -3,8 +3,8 @@ name: Audit
3
3
  on:
4
4
  workflow_dispatch:
5
5
  schedule:
6
- # "At 01:00 on Monday" https://crontab.guru/#0_1_*_*_1
7
- - cron: "0 1 * * 1"
6
+ # "At 08:00 UTC (01:00 PT) on Monday" https://crontab.guru/#0_8_*_*_1
7
+ - cron: "0 8 * * 1"
8
8
 
9
9
  jobs:
10
10
  audit:
@@ -19,8 +19,8 @@ on:
19
19
  - {{pkgRelPath}}/**
20
20
  {{/if}}
21
21
  schedule:
22
- # "At 02:00 on Monday" https://crontab.guru/#0_2_*_*_1
23
- - cron: "0 2 * * 1"
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}}
@@ -13,8 +13,8 @@ on:
13
13
  - {{.}}
14
14
  {{/each}}
15
15
  schedule:
16
- # "At 03:00 on Monday" https://crontab.guru/#0_3_*_*_1
17
- - cron: "0 3 * * 1"
16
+ # "At 10:00 UTC (03:00 PT) on Monday" https://crontab.guru/#0_10_*_*_1
17
+ - cron: "0 10 * * 1"
18
18
 
19
19
  jobs:
20
20
  analyze:
@@ -1,3 +1,5 @@
1
+ 'use strict'
2
+
1
3
  const { readdirSync: readdir } = require('fs')
2
4
 
3
5
  const localConfigs = readdir(__dirname)
@@ -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',
@@ -31,6 +32,7 @@ const rootModule = {
31
32
  '.gitignore': 'gitignore',
32
33
  '.npmrc': 'npmrc',
33
34
  'SECURITY.md': 'SECURITY.md',
35
+ 'CODE_OF_CONDUCT.md': 'CODE_OF_CONDUCT.md',
34
36
  'package.json': 'pkg.json',
35
37
  },
36
38
  rm: [
@@ -7,5 +7,5 @@
7
7
  {{/if}}
8
8
  - name: Setup git user
9
9
  run: |
10
- git config --global user.email "ops+robot@npmjs.com"
11
- git config --global user.name "npm team"
10
+ git config --global user.email "npm-cli+bot@github.com"
11
+ git config --global user.name "npm CLI robot"
@@ -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
+ }
@@ -18,7 +18,9 @@ const getRepo = async (path) => {
18
18
  const url = new URL(`https://${domain}`)
19
19
  url.pathname = `/${user}/${project}.git`
20
20
  return url.toString()
21
- } catch {}
21
+ } catch {
22
+ // errors are ignored
23
+ }
22
24
  }
23
25
 
24
26
  module.exports = getRepo
@@ -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 + EOL + EOL + s : s
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.4.2",
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": "^2.0.0-11"
48
+ "yaml": "2.0.0-11"
49
49
  },
50
50
  "files": [
51
51
  "bin/",