GeezerVison is showing github.com — feat!: remove default license for npm init · npm/cli@e9fb265
File treeExpand file treeCollapse file tree Open diff view settings workspaces/config/lib/definitions
Expand file treeCollapse file tree Open diff view settings Collapse file Copy file name to clipboardExpand all lines: tap-snapshots/test/lib/commands/config.js.test.cjs +3-3Lines changed: 3 additions & 3 deletions | Original file line number | Diff line number | Diff line change |
|---|
@@ -90,7 +90,7 @@ exports[`test/lib/commands/config.js TAP config list --json > output matches sna | 90 | 90 | "init.author.email": "", | 91 | 91 | "init.author.name": "", | 92 | 92 | "init.author.url": "", | 93 | | - "init.license": "ISC", | | 93 | + "init.license": "", | 94 | 94 | "init.module": "{CWD}/home/.npm-init.js", | 95 | 95 | "init.version": "1.0.0", | 96 | 96 | "install-links": false, | @@ -271,15 +271,15 @@ include-workspace-root = false | 271 | 271 | init-author-email = "" | 272 | 272 | ; init-author-name = "" ; overridden by user | 273 | 273 | init-author-url = "" | 274 | | -; init-license = "ISC" ; overridden by global | | 274 | +; init-license = "" ; overridden by global | 275 | 275 | init-module = "{CWD}/home/.npm-init.js" | 276 | 276 | init-private = false | 277 | 277 | init-type = "commonjs" | 278 | 278 | init-version = "1.0.0" | 279 | 279 | init.author.email = "" | 280 | 280 | init.author.name = "" | 281 | 281 | init.author.url = "" | 282 | | -init.license = "ISC" | | 282 | +init.license = "" | 283 | 283 | init.module = "{CWD}/home/.npm-init.js" | 284 | 284 | init.version = "1.0.0" | 285 | 285 | install-links = false | |
Collapse file Copy file name to clipboardExpand all lines: tap-snapshots/test/lib/docs.js.test.cjs +4-3Lines changed: 4 additions & 3 deletions | Original file line number | Diff line number | Diff line change |
|---|
@@ -1044,10 +1044,11 @@ homepage. | 1044 | 1044 |
| 1045 | 1045 | #### \`init-license\` | 1046 | 1046 |
| 1047 | | -* Default: "ISC" | | 1047 | +* Default: "" | 1048 | 1048 | * Type: String | 1049 | 1049 |
| 1050 | | -The value \`npm init\` should use by default for the package license. | | 1050 | +The value \`npm init\` should use by default for the package license. If not | | 1051 | +set, the license field will be omitted from new packages. | 1051 | 1052 |
| 1052 | 1053 |
| 1053 | 1054 |
| @@ -2356,7 +2357,7 @@ Alias for \`--init-author-url\` | 2356 | 2357 |
| 2357 | 2358 | #### \`init.license\` | 2358 | 2359 |
| 2359 | | -* Default: "ISC" | | 2360 | +* Default: "" | 2360 | 2361 | * Type: String | 2361 | 2362 | * DEPRECATED: Use \`--init-license\` instead. | 2362 | 2363 |
| |
Collapse file Copy file name to clipboardExpand all lines: test/lib/commands/init.js +5-5Lines changed: 5 additions & 5 deletions | Original file line number | Diff line number | Diff line change |
|---|
@@ -43,7 +43,7 @@ t.test('classic npm init -y', async t => { | 43 | 43 |
| 44 | 44 | const pkg = require(resolve(prefix, 'package.json')) | 45 | 45 | t.equal(pkg.version, '1.0.0') | 46 | | - t.equal(pkg.license, 'ISC') | | 46 | + t.equal(pkg.license, undefined, 'license is omitted by default') | 47 | 47 | }) | 48 | 48 |
| 49 | 49 | t.test('classic interactive npm init', async t => { | @@ -273,7 +273,7 @@ t.test('workspaces', async t => { | 273 | 273 | const pkg = require(resolve(prefix, 'a/package.json')) | 274 | 274 | t.equal(pkg.name, 'a') | 275 | 275 | t.equal(pkg.version, '1.0.0') | 276 | | - t.equal(pkg.license, 'ISC') | | 276 | + t.equal(pkg.license, undefined, 'license is omitted by default') | 277 | 277 |
| 278 | 278 | t.matchSnapshot(joinedOutput(), 'should print helper info') | 279 | 279 |
| @@ -306,7 +306,7 @@ t.test('workspaces', async t => { | 306 | 306 | const pkg = require(resolve(prefix, 'packages/a/package.json')) | 307 | 307 | t.equal(pkg.name, 'a') | 308 | 308 | t.equal(pkg.version, '2.0.0') | 309 | | - t.equal(pkg.license, 'ISC') | | 309 | + t.equal(pkg.license, undefined, 'license is omitted by default') | 310 | 310 | }) | 311 | 311 |
| 312 | 312 | await t.test('fail parsing top-level package.json to set workspace', async t => { | @@ -422,12 +422,12 @@ t.test('workspaces', async t => { | 422 | 422 |
| 423 | 423 | const pkg = require(resolve(npm.localPrefix, 'package.json')) | 424 | 424 | t.equal(pkg.version, '1.0.0') | 425 | | - t.equal(pkg.license, 'ISC') | | 425 | + t.equal(pkg.license, undefined, 'license is omitted by default') | 426 | 426 | t.strictSame(pkg.workspaces, ['packages/a']) | 427 | 427 |
| 428 | 428 | const ws = require(resolve(npm.localPrefix, 'packages/a/package.json')) | 429 | 429 | t.equal(ws.version, '1.0.0') | 430 | | - t.equal(ws.license, 'ISC') | | 430 | + t.equal(ws.license, undefined, 'license is omitted by default') | 431 | 431 | }) | 432 | 432 | t.test('init pkg - installed workspace package', async t => { | 433 | 433 | const { npm } = await mockNpm(t, { | |
Collapse file Copy file name to clipboardExpand all lines: workspaces/config/lib/definitions/definitions.js +3-2Lines changed: 3 additions & 2 deletions | Original file line number | Diff line number | Diff line change |
|---|
@@ -1121,11 +1121,12 @@ const definitions = { | 1121 | 1121 | `, | 1122 | 1122 | }), | 1123 | 1123 | 'init-license': new Definition('init-license', { | 1124 | | - default: 'ISC', | | 1124 | + default: '', | 1125 | 1125 | hint: '<license>', | 1126 | 1126 | type: String, | 1127 | 1127 | description: ` | 1128 | 1128 | The value \`npm init\` should use by default for the package license. | | 1129 | + If not set, the license field will be omitted from new packages. | 1129 | 1130 | `, | 1130 | 1131 | }), | 1131 | 1132 | 'init-module': new Definition('init-module', { | @@ -1196,7 +1197,7 @@ const definitions = { | 1196 | 1197 | `, | 1197 | 1198 | }), | 1198 | 1199 | 'init.license': new Definition('init.license', { | 1199 | | - default: 'ISC', | | 1200 | + default: '', | 1200 | 1201 | type: String, | 1201 | 1202 | deprecated: ` | 1202 | 1203 | Use \`--init-license\` instead. | |
|