@npmcli/template-oss 4.1.1 → 4.2.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.
@@ -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))
@@ -3,7 +3,7 @@ const log = require('proc-log')
3
3
  const { rmEach, parseEach } = require('../util/files.js')
4
4
 
5
5
  const run = async (dir, files, options) => {
6
- const { rm = [], add = {} } = files
6
+ const { rm, add } = files
7
7
 
8
8
  log.verbose('apply-files', 'rm', rm)
9
9
  await rmEach(dir, rm, options, (f) => fs.rm(f))
@@ -1,6 +1,6 @@
1
1
  const run = require('../index.js')
2
2
 
3
- module.exports = (root, content) => run(root, content, [
3
+ module.exports = (root) => run(root, [
4
4
  require('./apply-files.js'),
5
5
  require('./apply-version.js'),
6
6
  ])
@@ -2,13 +2,14 @@ const log = require('proc-log')
2
2
  const { relative, basename } = require('path')
3
3
  const { rmEach, parseEach } = require('../util/files.js')
4
4
  const { partition } = require('lodash')
5
+ const localeCompare = require('@isaacs/string-locale-compare')('en')
5
6
 
6
7
  const solution = 'npx template-oss-apply --force'
7
8
 
8
9
  const run = async (type, dir, files, options) => {
9
10
  const res = []
10
11
  const rel = (f) => relative(options.root, f)
11
- const { add: addFiles = {}, rm: rmFiles = [] } = files
12
+ const { add: addFiles, rm: rmFiles } = files
12
13
 
13
14
  const rm = await rmEach(dir, rmFiles, options, (f) => rel(f))
14
15
  const [add, update] = partition(await parseEach(dir, addFiles, options, async (p) => {
@@ -28,7 +29,7 @@ const run = async (type, dir, files, options) => {
28
29
  if (rm.length) {
29
30
  res.push({
30
31
  title: `The following ${type} files need to be deleted:`,
31
- body: rm,
32
+ body: rm.sort(localeCompare),
32
33
  solution,
33
34
  })
34
35
  }
@@ -37,13 +38,13 @@ const run = async (type, dir, files, options) => {
37
38
  if (add.length) {
38
39
  res.push({
39
40
  title: `The following ${type} files need to be added:`,
40
- body: add,
41
+ body: add.sort(localeCompare),
41
42
  solution,
42
43
  })
43
44
  }
44
45
 
45
46
  log.verbose('check-apply', 'update', update)
46
- res.push(...update.map(({ file, diff }) => ({
47
+ res.push(...update.sort((a, b) => localeCompare(a.file, b.file)).map(({ file, diff }) => ({
47
48
  title: `The ${type} file ${basename(file)} needs to be updated:`,
48
49
  body: [`${file}\n${'='.repeat(40)}\n${diff}`],
49
50
  solution,
@@ -1,6 +1,6 @@
1
1
  const run = require('../index.js')
2
2
 
3
- module.exports = (root, content) => run(root, content, [
3
+ module.exports = (root) => run(root, [
4
4
  require('./check-apply.js'),
5
5
  require('./check-required.js'),
6
6
  require('./check-unwanted.js'),
package/lib/config.js CHANGED
@@ -1,101 +1,142 @@
1
- const { relative, dirname, join, posix, win32 } = require('path')
2
- const log = require('proc-log')
3
- const { uniq, defaults } = require('lodash')
1
+ const { relative, dirname, join, extname, posix, win32 } = require('path')
2
+ const { defaults, pick, omit, uniq } = require('lodash')
4
3
  const parseCIVersions = require('./util/parse-ci-versions.js')
5
4
  const getGitUrl = require('./util/get-git-url.js')
6
- const { name: NAME, version: LATEST_VERSION } = require('../package.json')
5
+ const gitignore = require('./util/gitignore.js')
6
+ const { withArrays } = require('./util/merge.js')
7
+ const { FILE_KEYS, parseConfig: parseFiles, getAddedFiles } = require('./util/files.js')
7
8
 
8
9
  const CONFIG_KEY = 'templateOSS'
9
10
  const getPkgConfig = (pkg) => pkg[CONFIG_KEY] || {}
10
11
 
11
- const getContent = (contentPath) => {
12
- if (typeof contentPath === 'string') {
13
- return defaults(require(contentPath), {
14
- sourceDir: dirname(require.resolve(contentPath)),
15
- })
16
- } else {
17
- // allow passing in content directly for tests
18
- return contentPath
12
+ const { name: NAME, version: LATEST_VERSION } = require('../package.json')
13
+ const MERGE_KEYS = [...FILE_KEYS, 'defaultContent', 'content']
14
+ const DEFAULT_CONTENT = require.resolve(NAME)
15
+
16
+ const merge = withArrays('branches', 'distPaths', 'allowPaths', 'ignorePaths')
17
+
18
+ const makePosix = (str) => str.split(win32.sep).join(posix.sep)
19
+
20
+ const getCmdPath = (key, { rootConfig, defaultConfig, isRoot, path, root }) => {
21
+ // Make a path relative from a workspace to the root if we are in a workspace
22
+ const wsToRoot = (p) => isRoot ? p : makePosix(join(relative(path, root), p))
23
+
24
+ const rootPath = rootConfig[key]
25
+ const defaultPath = defaultConfig[key]
26
+ const isLocal = rootPath && rootPath !== defaultPath
27
+
28
+ return {
29
+ isLocal,
30
+ root: !isLocal ? defaultPath : `node ${rootPath}`,
31
+ local: !isLocal ? defaultPath : `node ${wsToRoot(rootPath)}`,
19
32
  }
20
33
  }
21
34
 
22
- // falsy means no content of this type
23
- const getFiles = (config, content) => config ? content : null
24
- const getFileKeys = (files) => files ? Object.keys(files.add || {}) : []
25
- const negatePath = (p) => {
26
- // XXX: this negates the first part of each path for the gitignore
27
- // files. it might make sense to negate more specific portions of the
28
- // path for some paths like workspaces. so instead of ignoring !/workspaces
29
- // it would only ignore !/workspaces/a, !/workspaces/b, etc
30
- const [first, ...parts] = p.split(posix.sep)
31
- const isDir = parts.length > 0
32
- return `!${posix.sep}${first}${isDir ? posix.sep : ''}`
35
+ const mergeConfigs = (...configs) => {
36
+ const mergedConfig = merge(...configs.map(c => pick(c, MERGE_KEYS)))
37
+ return defaults(mergedConfig, {
38
+ defaultContent: DEFAULT_CONTENT,
39
+ // allow all file types by default
40
+ ...FILE_KEYS.reduce((acc, key) => {
41
+ acc[key] = true
42
+ return acc
43
+ }, {}),
44
+ })
33
45
  }
34
46
 
35
- const makePosix = (str) => str.split(win32.sep).join(posix.sep)
47
+ const readContentPath = (path) => {
48
+ if (!path) {
49
+ return {}
50
+ }
36
51
 
37
- const getConfig = async ({
38
- pkgs,
39
- workspaces,
52
+ let content = {}
53
+ const index = extname(path) === '.js' ? path : join(path, 'index.js')
54
+ const dir = dirname(index)
55
+
56
+ try {
57
+ content = require(index)
58
+ } catch {
59
+ // its ok if this fails since the content dir
60
+ // might only be to provide other files. the
61
+ // index.js is optional
62
+ }
63
+
64
+ return { content, dir }
65
+ }
66
+
67
+ const getConfig = (path, rawConfig) => {
68
+ const config = omit(readContentPath(path).content, FILE_KEYS)
69
+ return merge(config, rawConfig ? omit(rawConfig, FILE_KEYS) : {})
70
+ }
71
+
72
+ const getFiles = (path, rawConfig) => {
73
+ const { content, dir } = readContentPath(path)
74
+ if (!dir) {
75
+ return []
76
+ }
77
+ return [parseFiles(pick(content, FILE_KEYS), dir, pick(rawConfig, FILE_KEYS)), dir]
78
+ }
79
+
80
+ const getFullConfig = async ({
40
81
  root,
41
82
  path,
42
83
  pkg,
43
- // default content path is looked up via require.resolve
44
- // so use the name of this module since package.json#main
45
- // points to the content dir
46
- content: contentPath = NAME,
47
- config: {
48
- rootRepo,
49
- rootModule,
50
- workspaceRepo,
51
- workspaceModule,
52
- version,
53
- ...pkgConfig // this includes config merged in from root
54
- },
84
+ pkgs,
85
+ workspaces,
86
+ rootConfig: _rootConfig,
87
+ pkgConfig: _pkgConfig,
55
88
  }) => {
56
89
  const isRoot = root === path
57
- const isLatest = version === LATEST_VERSION
90
+ const isRootMono = isRoot && workspaces.length > 0
91
+ const isLatest = _pkgConfig.version === LATEST_VERSION
58
92
  const isDogFood = pkg.name === NAME
59
93
  const isForce = process.argv.includes('--force')
60
- const rawPkgConfig = getPkgConfig(pkg)
61
94
 
62
95
  // this is written to ci yml files so it needs to always use posix
63
96
  const pkgRelPath = makePosix(relative(root, path))
64
- const gitUrl = await getGitUrl(root)
65
97
 
66
- const {
67
- rootRepo: rootRepoContent,
68
- rootModule: rootModuleContent,
69
- workspaceRepo: workspaceRepoContent,
70
- workspaceModule: workspaceModuleContent,
71
- ...baseContent
72
- } = getContent(contentPath)
73
-
74
- let repoFiles, moduleFiles
75
- const ignorePaths = []
76
-
77
- if (isRoot) {
78
- repoFiles = getFiles(rootRepo, rootRepoContent)
79
- moduleFiles = getFiles(rootModule, rootModuleContent)
80
- ignorePaths.push(
81
- // allow workspace paths if they are set, this is directly from
82
- // map-workspaces so normalize to posix paths for gitignore
83
- ...workspaces.map((p) => makePosix(relative(root, p))),
84
- // allow both the repo and module files since this is the root
85
- ...getFileKeys(repoFiles),
86
- ...getFileKeys(moduleFiles),
87
- // allow all workspace repo level files
88
- ...pkgs.filter((p) => p.path !== path).flatMap((p) =>
89
- getFileKeys(getFiles(p.config.workspaceRepo, workspaceRepoContent))
90
- )
91
- )
92
- } else {
93
- repoFiles = getFiles(workspaceRepo, workspaceRepoContent)
94
- moduleFiles = getFiles(workspaceModule, workspaceModuleContent)
95
- // In a workspace gitignores are relative to the workspace dir
96
- // so we should only allow added module files
97
- ignorePaths.push(...getFileKeys(moduleFiles))
98
- }
98
+ const workspacePkgs = pkgs.filter((p) => p.path !== path)
99
+ const workspaceDirs = isRootMono && workspaces.map((p) => makePosix(relative(root, p)))
100
+ const workspaceGlobs = isRootMono && pkg.workspaces.map(p => p.replace(/[/*]+$/, ''))
101
+
102
+ // These config items are merged betweent the root and child workspaces and only come from
103
+ // the package.json because they can be used to read configs from other the content directories
104
+ const mergedConfig = mergeConfigs(_rootConfig, _pkgConfig)
105
+
106
+ const defaultConfig = getConfig(DEFAULT_CONTENT)
107
+ const [defaultFiles, defaultDir] = getFiles(DEFAULT_CONTENT, mergedConfig)
108
+ const useDefault = mergedConfig.defaultContent && defaultConfig
109
+
110
+ const rootConfig = getConfig(_rootConfig.content, _rootConfig)
111
+ const [rootFiles, rootDir] = getFiles(_rootConfig.content, mergedConfig)
112
+
113
+ // The content config only gets set from the package we are in, it doesn't inherit
114
+ // anything from the root
115
+ const pkgConfig = merge(useDefault, getConfig(_pkgConfig.content, _pkgConfig))
116
+ const [pkgFiles, pkgDir] = getFiles(mergedConfig.content, mergedConfig)
117
+
118
+ // Files get merged in from the default content (that template-oss provides) as well
119
+ // as any content paths provided from the root or the workspace
120
+ const fileDirs = uniq([useDefault && defaultDir, rootDir, pkgDir].filter(Boolean))
121
+ const files = merge(useDefault && defaultFiles, rootFiles, pkgFiles)
122
+ const repoFiles = isRoot ? files.rootRepo : files.workspaceRepo
123
+ const moduleFiles = isRoot ? files.rootModule : files.workspaceModule
124
+
125
+ const allowRootDirs = [
126
+ // Allways allow module files in root or workspaces
127
+ ...getAddedFiles(moduleFiles),
128
+ ...isRoot ? [
129
+ // in the root allow all repo files
130
+ ...getAddedFiles(repoFiles),
131
+ // and allow all workspace repo level files
132
+ ...workspacePkgs.filter(p => p.config.workspaceRepo !== false).flatMap((p) =>
133
+ getAddedFiles(files.workspaceRepo)
134
+ ),
135
+ ] : [],
136
+ ]
137
+
138
+ const npmPath = getCmdPath('npm', { rootConfig, defaultConfig, isRoot, path, root })
139
+ const npxPath = getCmdPath('npx', { rootConfig, defaultConfig, isRoot, path, root })
99
140
 
100
141
  // all derived keys
101
142
  const derived = {
@@ -106,7 +147,8 @@ const getConfig = async ({
106
147
  // For these cases it is helpful to know if we are in a
107
148
  // monorepo since template-oss might be used only for
108
149
  // workspaces and not the root or vice versa.
109
- isMono: (isRoot && workspaces.length > 0) || !isRoot,
150
+ isRootMono,
151
+ isMono: isRootMono || !isRoot,
110
152
  // repo
111
153
  repoDir: root,
112
154
  repoFiles,
@@ -120,10 +162,31 @@ const getConfig = async ({
120
162
  pkgNameFs: pkg.name.replace(/\//g, '-').replace(/@/g, ''),
121
163
  pkgRelPath: pkgRelPath,
122
164
  pkgPrivate: !!pkg.private,
165
+ pkgPublic: !pkg.private,
166
+ workspaces: workspaceDirs,
167
+ workspaceGlobs,
123
168
  // booleans to control application of updates
124
169
  isForce,
125
170
  isDogFood,
126
171
  isLatest,
172
+ // whether to install and update npm in ci
173
+ // only do this if we aren't using a custom path to bin
174
+ updateNpm: !npmPath.isLocal,
175
+ rootNpmPath: npmPath.root,
176
+ localNpmPath: npmPath.local,
177
+ rootNpxPath: npxPath.root,
178
+ // gitignore
179
+ ignorePaths: [
180
+ ...gitignore.sort([
181
+ ...gitignore.allowRootDir(allowRootDirs),
182
+ ...isRoot && pkgConfig.lockfile ? ['!/package-lock.json'] : [],
183
+ ...(pkgConfig.allowPaths || []).map((p) => `!${p}`),
184
+ ...(pkgConfig.ignorePaths || []),
185
+ ]),
186
+ // these cant be sorted since they rely on order
187
+ // to allow a previously ignored directoy
188
+ ...gitignore.allowDir(workspaceDirs || []),
189
+ ],
127
190
  // needs update if we are dogfooding this repo, with force argv, or its
128
191
  // behind the current version
129
192
  needsUpdate: isForce || isDogFood || !isLatest,
@@ -131,55 +194,31 @@ const getConfig = async ({
131
194
  __NAME__: NAME,
132
195
  __CONFIG_KEY__: CONFIG_KEY,
133
196
  __VERSION__: LATEST_VERSION,
197
+ __PARTIAL_DIRS__: fileDirs,
134
198
  }
135
199
 
136
- // merge the rest of base and pkg content to make the
137
- // full content object
138
- const content = { ...baseContent, ...pkgConfig }
139
-
140
- // set some defaults on content that can be overwritten unlike
141
- // derived values which are calculated from other config
142
- const contentDefaults = {}
143
-
144
- if (content.npmBin && content.npmBin !== baseContent.npmBin) {
145
- // make it relative to each workspace if they did not set the config themselves
146
- if (!rawPkgConfig.npmBin) {
147
- content.npmBin = makePosix(join(relative(path, root), content.npmBin))
148
- }
149
- // a bit of a hack but allow custom node paths or no node path at all
150
- // checks if the first thing has node somewhere in it and if it doesnt
151
- // puts a system node in front of the script
152
- const execPaths = content.npmBin.split(' ')[0].split(posix.sep)
153
- if (execPaths.every(p => p !== 'node')) {
154
- content.npmBin = `node ${content.npmBin}`
155
- }
156
- }
157
- if (Array.isArray(content.ciVersions)) {
158
- const parsed = parseCIVersions(content.ciVersions)
159
- contentDefaults.engines = parsed.engines
160
- content.ciVersions = parsed.targets
161
- log.verbose('config ci', parsed)
200
+ if (pkgConfig.ciVersions) {
201
+ const versions = pkgConfig.ciVersions
202
+ const defaultVersions = defaultConfig.ciVersions
203
+ const parsed = parseCIVersions(versions === 'latest' ? defaultVersions.slice(-1) : versions)
204
+ derived.ciVersions = parsed.targets
205
+ derived.engines = pkgConfig.engines || parsed.engines
162
206
  }
163
207
 
208
+ const gitUrl = await getGitUrl(root)
164
209
  if (gitUrl) {
165
- contentDefaults.repository = {
210
+ derived.repository = {
166
211
  type: 'git',
167
212
  url: gitUrl,
168
213
  ...(pkgRelPath ? { directory: pkgRelPath } : {}),
169
214
  }
170
215
  }
171
216
 
172
- contentDefaults.ignorePaths = uniq(
173
- [...ignorePaths, ...(content.distPaths || [])].map(negatePath)
174
- ).sort()
175
-
176
- log.verbose('config', 'defaults', contentDefaults)
177
-
178
217
  return {
179
- ...defaults(content, contentDefaults),
218
+ ...pkgConfig,
180
219
  ...derived,
181
220
  }
182
221
  }
183
222
 
184
- module.exports = getConfig
223
+ module.exports = getFullConfig
185
224
  module.exports.getPkgConfig = getPkgConfig
@@ -0,0 +1,32 @@
1
+ workflow_dispatch:
2
+ pull_request:
3
+ branches:
4
+ - '*'
5
+ {{#if pkgRelPath}}
6
+ paths:
7
+ - {{pkgRelPath}}/**
8
+ {{/if}}
9
+ {{#if workspaceGlobs}}
10
+ paths-ignore:
11
+ {{#each workspaceGlobs}}
12
+ - {{.}}/**
13
+ {{/each}}
14
+ {{/if}}
15
+ push:
16
+ branches:
17
+ {{#each branches}}
18
+ - {{.}}
19
+ {{/each}}
20
+ {{#if pkgRelPath}}
21
+ paths:
22
+ - {{pkgRelPath}}/**
23
+ {{/if}}
24
+ {{#if workspaceGlobs}}
25
+ paths-ignore:
26
+ {{#each workspaceGlobs}}
27
+ - {{.}}/**
28
+ {{/each}}
29
+ {{/if}}
30
+ schedule:
31
+ # "At 09:00 UTC (02:00 PT) on Monday" https://crontab.guru/#0_9_*_*_1
32
+ - cron: "0 9 * * 1"
@@ -0,0 +1 @@
1
+ - run: {{rootNpmPath}} i --ignore-scripts --no-audit --no-fund {{~#if flags}} {{flags}}{{/if}}
@@ -1,7 +1,7 @@
1
1
  - uses: actions/checkout@v3
2
- {{#if with}}
2
+ {{#if checkout}}
3
3
  with:
4
- {{#each with}}
4
+ {{#each checkout}}
5
5
  {{@key}}: {{this}}
6
6
  {{/each}}
7
7
  {{/if}}
@@ -0,0 +1,27 @@
1
+ if: github.repository_owner == 'npm'
2
+ strategy:
3
+ fail-fast: false
4
+ matrix:
5
+ node-version:
6
+ {{#each ciVersions}}
7
+ - {{.}}
8
+ {{/each}}
9
+ platform:
10
+ - os: ubuntu-latest
11
+ shell: bash
12
+ {{#if macCI}}
13
+ - os: macos-latest
14
+ shell: bash
15
+ {{/if}}
16
+ {{#if windowsCI}}
17
+ - os: windows-latest
18
+ shell: cmd
19
+ {{/if}}
20
+ runs-on: $\{{ matrix.platform.os }}
21
+ defaults:
22
+ run:
23
+ shell: $\{{ matrix.platform.shell }}
24
+ steps:
25
+ {{> setupGit}}
26
+ {{> setupNode useMatrix=true}}
27
+ {{> setupDeps}}
@@ -0,0 +1,6 @@
1
+ if: github.repository_owner == 'npm' {{~#if jobIf}} && {{{jobIf}}}{{/if}}
2
+ runs-on: ubuntu-latest
3
+ steps:
4
+ {{> setupGit}}
5
+ {{> setupNode}}
6
+ {{> setupDeps}}
@@ -4,6 +4,7 @@
4
4
  {{#if lockfile}}
5
5
  cache: npm
6
6
  {{/if}}
7
+ {{#if updateNpm}}
7
8
  {{#if useMatrix}}
8
9
  - name: Update to workable npm (windows)
9
10
  # node 12 and 14 ship with npm@6, which is known to fail when updating itself in windows
@@ -26,3 +27,4 @@
26
27
  {{/if}}
27
28
  run: npm i --prefer-online --no-fund --no-audit -g npm@latest
28
29
  - run: npm -v
30
+ {{/if}}
@@ -8,9 +8,5 @@ on:
8
8
 
9
9
  jobs:
10
10
  audit:
11
- runs-on: ubuntu-latest
12
- steps:
13
- {{> setupGit}}
14
- {{> setupNode}}
15
- {{> setupDeps flags="--package-lock"}}
16
- - run: npm audit
11
+ {{> setupJob flags="--package-lock"}}
12
+ - run: {{rootNpmPath}} audit
@@ -1,61 +1,15 @@
1
1
  name: CI {{~#if isWorkspace}} - {{pkgName}}{{/if}}
2
2
 
3
3
  on:
4
- workflow_dispatch:
5
- pull_request:
6
- branches:
7
- - '*'
8
- {{#if pkgRelPath}}
9
- paths:
10
- - {{pkgRelPath}}/**
11
- {{/if}}
12
- push:
13
- branches:
14
- {{#each branches}}
15
- - {{.}}
16
- {{/each}}
17
- {{#if pkgRelPath}}
18
- paths:
19
- - {{pkgRelPath}}/**
20
- {{/if}}
21
- schedule:
22
- # "At 09:00 UTC (02:00 PT) on Monday" https://crontab.guru/#0_9_*_*_1
23
- - cron: "0 9 * * 1"
4
+ {{> setupCiOn}}
24
5
 
25
6
  jobs:
26
7
  lint:
27
- runs-on: ubuntu-latest
28
- steps:
29
- {{> setupGit}}
30
- {{> setupNode}}
31
- {{> setupDeps}}
32
- - run: npm run lint {{~#if isWorkspace}} -w {{pkgName}}{{/if}}
8
+ {{> setupJob }}
9
+ - run: {{rootNpmPath}} run lint {{~#if isWorkspace}} -w {{pkgName}}{{/if}}
33
10
 
34
11
  test:
35
- strategy:
36
- fail-fast: false
37
- matrix:
38
- node-version:
39
- {{#each ciVersions}}
40
- - {{.}}
41
- {{/each}}
42
- platform:
43
- - os: ubuntu-latest
44
- shell: bash
45
- - os: macos-latest
46
- shell: bash
47
- {{#if windowsCI}}
48
- - os: windows-latest
49
- shell: cmd
50
- {{/if}}
51
- runs-on: $\{{ matrix.platform.os }}
52
- defaults:
53
- run:
54
- shell: $\{{ matrix.platform.shell }}
55
- steps:
56
- {{> setupGit}}
57
- {{> setupNode useMatrix=true}}
58
- {{> setupDeps}}
12
+ {{> setupJobMatrix }}
59
13
  - name: add tap problem matcher
60
14
  run: echo "::add-matcher::.github/matchers/tap.json"
61
- - run: npm test --ignore-scripts {{~#if isWorkspace}} -w {{pkgName}}{{/if}}
15
+ - run: {{rootNpmPath}} test --ignore-scripts {{~#if isWorkspace}} -w {{pkgName}}{{/if}}
@@ -13,3 +13,21 @@ updates:
13
13
  prefix-development: chore
14
14
  labels:
15
15
  - "Dependencies"
16
+
17
+ {{#if workspaces}}
18
+ {{#each workspaces}}
19
+ - package-ecosystem: npm
20
+ directory: "{{.}}/"
21
+ schedule:
22
+ interval: daily
23
+ allow:
24
+ - dependency-type: direct
25
+ versioning-strategy: increase-if-necessary
26
+ commit-message:
27
+ prefix: deps
28
+ prefix-development: chore
29
+ labels:
30
+ - "Dependencies"
31
+
32
+ {{/each}}
33
+ {{/if}}
@@ -8,6 +8,13 @@ const localConfigs = readdir(__dirname)
8
8
 
9
9
  module.exports = {
10
10
  root: true,
11
+ {{#if isRootMono}}
12
+ ignorePatterns: [
13
+ {{#each workspaces}}
14
+ '{{.}}',
15
+ {{/each}}
16
+ ],
17
+ {{/if}}
11
18
  extends: [
12
19
  '@npmcli',
13
20
  ...localConfigs,
@@ -2,19 +2,6 @@
2
2
  /*
3
3
 
4
4
  # keep these
5
- !/.eslintrc.local.*
6
- !**/.gitignore
7
- !/docs/
8
- !/tap-snapshots/
9
- !/test/
10
- !/map.js
11
- !/scripts/
12
- !/README*
13
- !/LICENSE*
14
- !/CHANGELOG*
15
5
  {{#each ignorePaths}}
16
6
  {{.}}
17
7
  {{/each}}
18
- {{#if lockfile}}
19
- !/package-lock.json
20
- {{/if}}