create-node-lib 2.19.0 → 2.19.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.
- package/CHANGELOG.md +7 -0
- package/__tests__/generator.test.js +6 -0
- package/package.json +1 -1
- package/saofile.js +6 -4
- package/template/package.json +0 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,10 @@
|
|
|
1
|
+
## [2.19.1](https://github.com/lirantal/create-node-lib/compare/v2.19.0...v2.19.1) (2026-05-15)
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
### Bug Fixes
|
|
5
|
+
|
|
6
|
+
* move package manager constraints to engines ([#48](https://github.com/lirantal/create-node-lib/issues/48)) ([f39e97e](https://github.com/lirantal/create-node-lib/commit/f39e97efad3b5e76babaeb7febbdd54182c4988e))
|
|
7
|
+
|
|
1
8
|
# [2.19.0](https://github.com/lirantal/create-node-lib/compare/v2.18.0...v2.19.0) (2026-05-15)
|
|
2
9
|
|
|
3
10
|
|
|
@@ -75,6 +75,9 @@ describe('all the template files are accountable for', () => {
|
|
|
75
75
|
expect(pkg.author.email).toBe(mockUserEmail)
|
|
76
76
|
expect(pkg.homepage).toBe(mockProjectRepository)
|
|
77
77
|
expect(pkg.keywords).toEqual(mockProjectKeywords)
|
|
78
|
+
expect(pkg.engines.pnpm).toBe('>=10.26.0')
|
|
79
|
+
expect(pkg.engines.npm).toBeUndefined()
|
|
80
|
+
expect(pkg.packageManager).toBeUndefined()
|
|
78
81
|
// Testing only variable scripts
|
|
79
82
|
expect(pkg.scripts['lint:lockfile']).toEqual(mockScripts['lint:lockfile'])
|
|
80
83
|
})
|
|
@@ -116,6 +119,9 @@ describe('all the template files are accountable for', () => {
|
|
|
116
119
|
const pkg = JSON.parse(await stream.readFile('package.json'))
|
|
117
120
|
// Testing only variable scripts
|
|
118
121
|
expect(pkg.scripts['lint:lockfile']).toEqual(mockScripts['lint:lockfile'])
|
|
122
|
+
expect(pkg.engines.npm).toBe('>=11.10.0')
|
|
123
|
+
expect(pkg.engines.pnpm).toBeUndefined()
|
|
124
|
+
expect(pkg.packageManager).toBeUndefined()
|
|
119
125
|
})
|
|
120
126
|
|
|
121
127
|
test('Generator creates package.json with prepare script for husky', async () => {
|
package/package.json
CHANGED
package/saofile.js
CHANGED
|
@@ -1,7 +1,11 @@
|
|
|
1
1
|
'use strict'
|
|
2
2
|
const validateNpmPackageName = require('validate-npm-package-name')
|
|
3
3
|
|
|
4
|
-
const
|
|
4
|
+
const PACKAGE_MANAGER_ENGINES = {
|
|
5
|
+
pnpm: '>=10.26.0',
|
|
6
|
+
npm: '>=11.10.0'
|
|
7
|
+
}
|
|
8
|
+
const SUPPORTED_NPM_CLIENTS = Object.keys(PACKAGE_MANAGER_ENGINES)
|
|
5
9
|
|
|
6
10
|
module.exports = {
|
|
7
11
|
description: 'Scaffolding out a node library.',
|
|
@@ -100,12 +104,10 @@ module.exports = {
|
|
|
100
104
|
'lint:lockfile'
|
|
101
105
|
] = `lockfile-lint --path ${lockfile} --validate-https --allowed-hosts npm`
|
|
102
106
|
data.scripts['lint'] = `eslint . && ${npmClient} run lint:lockfile && ${npmClient} run lint:markdown`
|
|
107
|
+
data.engines[npmClient] = PACKAGE_MANAGER_ENGINES[npmClient]
|
|
103
108
|
data['lint-staged'] = {
|
|
104
109
|
'**/*.{js,json}': [`${npmClient} run lint:fix`]
|
|
105
110
|
}
|
|
106
|
-
if (npmClient !== 'pnpm') {
|
|
107
|
-
delete data.packageManager
|
|
108
|
-
}
|
|
109
111
|
return data
|
|
110
112
|
}
|
|
111
113
|
},
|