@npmcli/template-oss 4.4.0 → 4.4.1

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.
@@ -10,14 +10,21 @@ const partialName = (s) => basename(s, extname(s)) // remove extension
10
10
  .replace(/^_/, '') // remove leading underscore
11
11
  .replace(/-([a-z])/g, (_, g) => g.toUpperCase()) // camelcase
12
12
 
13
- const makePartials = (dir, setDefault) => {
13
+ const makePartials = (dir, isBase) => {
14
14
  const partials = fs.readdirSync(dir).reduce((acc, f) => {
15
15
  const partial = fs.readFileSync(join(dir, f)).toString()
16
16
  const name = partialName(f)
17
- acc[name] = partial
18
- if (setDefault && f.startsWith('_')) {
17
+
18
+ if (isBase) {
19
+ // in the default dir, everything is a partial
20
+ // and also gets set with a default prefix for extending
21
+ acc[name] = partial
19
22
  acc[partialName(`default-${name}`)] = partial
23
+ } else if (f.startsWith('_')) {
24
+ // otherwise only _ files get set as partials
25
+ acc[name] = partial
20
26
  }
27
+
21
28
  return acc
22
29
  }, {})
23
30
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@npmcli/template-oss",
3
- "version": "4.4.0",
3
+ "version": "4.4.1",
4
4
  "description": "templated files used in npm CLI team oss projects",
5
5
  "main": "lib/content/index.js",
6
6
  "bin": {