create-node-lib 2.17.3 → 2.18.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/CHANGELOG.md CHANGED
@@ -1,3 +1,17 @@
1
+ # [2.18.0](https://github.com/lirantal/create-node-lib/compare/v2.17.4...v2.18.0) (2026-05-13)
2
+
3
+
4
+ ### Features
5
+
6
+ * update secure configs for npm and pnpm ([e4f533a](https://github.com/lirantal/create-node-lib/commit/e4f533a73b3ca1c7d4373b76831b49b9d331a1dc))
7
+
8
+ ## [2.17.4](https://github.com/lirantal/create-node-lib/compare/v2.17.3...v2.17.4) (2026-05-13)
9
+
10
+
11
+ ### Bug Fixes
12
+
13
+ * exclude pnpm-workspace.yaml when npm is selected as package manager ([#46](https://github.com/lirantal/create-node-lib/issues/46)) ([34891e1](https://github.com/lirantal/create-node-lib/commit/34891e1e9e1b5819ebea4dd36b6f42b3307d41e5))
14
+
1
15
  ## [2.17.3](https://github.com/lirantal/create-node-lib/compare/v2.17.2...v2.17.3) (2026-05-12)
2
16
 
3
17
 
@@ -79,6 +79,28 @@ describe('all the template files are accountable for', () => {
79
79
  expect(pkg.scripts['lint:lockfile']).toEqual(mockScripts['lint:lockfile'])
80
80
  })
81
81
 
82
+ test('Generator includes pnpm-workspace.yaml when pnpm is selected', async () => {
83
+ const stream = await sao.mock(
84
+ { generator: template },
85
+ {
86
+ npmClient: 'pnpm'
87
+ }
88
+ )
89
+
90
+ expect(stream.fileList).toContain('pnpm-workspace.yaml')
91
+ })
92
+
93
+ test('Generator excludes pnpm-workspace.yaml when npm is selected', async () => {
94
+ const stream = await sao.mock(
95
+ { generator: template },
96
+ {
97
+ npmClient: 'npm'
98
+ }
99
+ )
100
+
101
+ expect(stream.fileList).not.toContain('pnpm-workspace.yaml')
102
+ })
103
+
82
104
  test('Generator input creates correct package.json scripts with npm as client', async () => {
83
105
  const mockScripts = {
84
106
  'lint:lockfile': 'lockfile-lint --path package-lock.json --validate-https --allowed-hosts npm'
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "create-node-lib",
3
- "version": "2.17.3",
3
+ "version": "2.18.0",
4
4
  "description": "Scaffolding out a Node.js library module",
5
5
  "bin": "./bin/cli.js",
6
6
  "engines": {
package/saofile.js CHANGED
@@ -115,7 +115,15 @@ module.exports = {
115
115
  gitignore: '.gitignore',
116
116
  npmrc: '.npmrc'
117
117
  }
118
- }
118
+ },
119
+ ...(npmClient !== 'pnpm'
120
+ ? [
121
+ {
122
+ type: 'remove',
123
+ files: 'pnpm-workspace.yaml'
124
+ }
125
+ ]
126
+ : [])
119
127
  ]
120
128
  },
121
129
  async completed() {
package/template/npmrc CHANGED
@@ -1,3 +1,11 @@
1
+ # npm security best practices
2
+ # Source: https://github.com/lirantal/npm-security-best-practices
3
+
4
+ # Do not run any lifecycle hook scripts such as postinstall for packages
1
5
  ignore-scripts=true
6
+
7
+ # Do not allow Git / GitHub related sources for packages
2
8
  allow-git=none
3
- min-release-age=30 # 30 days
9
+
10
+ # Require at least 30 days since package release
11
+ min-release-age=30
@@ -1,19 +1,30 @@
1
- # Source for more information: https://github.com/lirantal/npm-security-best-practices
1
+ # npm security best practices
2
+ # Source: https://github.com/lirantal/npm-security-best-practices
3
+
4
+
5
+ # Require at least 30 days since package release (specified in minutes)
6
+ minimumReleaseAge: 43200
2
7
 
3
8
  # Fail if a package's trust level has decreased (pnpm 10.21+)
4
9
  trustPolicy: no-downgrade
5
10
 
6
11
  # Allow specific packages or versions to bypass the check when needed
7
12
  # example:
8
- #trustPolicyExclude:
9
- # - 'chokidar@4.0.3'
10
- # - 'webpack@4.47.0 || 5.102.1'
13
+ # trustPolicyExclude:
14
+ # - 'chokidar@4.0.3'
15
+ # - 'webpack@4.47.0 || 5.102.1'
11
16
 
12
17
  # Ignore the check for packages published more than 30 days ago (pnpm 10.27+)
13
18
  # Useful for older packages that pre-date provenance support
14
- trustPolicyIgnoreAfter: 43200 # minutes (30 days)
19
+ trustPolicyIgnoreAfter: 43200
20
+
21
+ allowBuilds:
22
+ esbuild: true
23
+ rolldown: true
24
+ unrs-resolver: true
25
+
26
+ # Strictly enforce build dependencies, otherwise pnpm will error
27
+ strictDepBuilds: true
15
28
 
16
- onlyBuiltDependencies:
17
- - esbuild
18
- - rolldown
19
- - unrs-resolver
29
+ # Block exotic subdependencies such as those pulled from Git sources
30
+ blockExoticSubdeps: true