diff --git a/tap-snapshots/test/lib/commands/config.js.test.cjs b/tap-snapshots/test/lib/commands/config.js.test.cjs index 6617b3a0827f7..26855af19bbd0 100644 --- a/tap-snapshots/test/lib/commands/config.js.test.cjs +++ b/tap-snapshots/test/lib/commands/config.js.test.cjs @@ -76,7 +76,7 @@ exports[`test/lib/commands/config.js TAP config list --json > output matches sna "init-author-email": "", "init-author-name": "", "init-author-url": "", - "init-license": "ISC", + "init-license": "", "init-module": "{CWD}/home/.npm-init.js", "init-type": "commonjs", "init-version": "1.0.0", @@ -84,7 +84,7 @@ exports[`test/lib/commands/config.js TAP config list --json > output matches sna "init.author.email": "", "init.author.name": "", "init.author.url": "", - "init.license": "ISC", + "init.license": "", "init.module": "{CWD}/home/.npm-init.js", "init.version": "1.0.0", "install-links": false, @@ -255,7 +255,7 @@ include-workspace-root = false init-author-email = "" init-author-name = "" init-author-url = "" -init-license = "ISC" +init-license = "" init-module = "{CWD}/home/.npm-init.js" init-private = false init-type = "commonjs" @@ -263,7 +263,7 @@ init-version = "1.0.0" init.author.email = "" init.author.name = "" init.author.url = "" -init.license = "ISC" +init.license = "" init.module = "{CWD}/home/.npm-init.js" init.version = "1.0.0" install-links = false diff --git a/tap-snapshots/test/lib/docs.js.test.cjs b/tap-snapshots/test/lib/docs.js.test.cjs index 2f8891f886263..70d760cad616f 100644 --- a/tap-snapshots/test/lib/docs.js.test.cjs +++ b/tap-snapshots/test/lib/docs.js.test.cjs @@ -888,10 +888,11 @@ homepage. #### \`init-license\` -* Default: "ISC" +* Default: "" * Type: String -The value \`npm init\` should use by default for the package license. +The value \`npm init\` should use by default for the package license. If not +set, the license field will be omitted from new packages. @@ -2145,7 +2146,7 @@ Alias for \`--init-author-url\` #### \`init.license\` -* Default: "ISC" +* Default: "" * Type: String * DEPRECATED: Use \`--init-license\` instead. diff --git a/test/lib/commands/init.js b/test/lib/commands/init.js index 1b59cc418c678..7e79098a55848 100644 --- a/test/lib/commands/init.js +++ b/test/lib/commands/init.js @@ -43,7 +43,7 @@ t.test('classic npm init -y', async t => { const pkg = require(resolve(prefix, 'package.json')) t.equal(pkg.version, '1.0.0') - t.equal(pkg.license, 'ISC') + t.equal(pkg.license, undefined, 'license is omitted by default') }) t.test('classic interactive npm init', async t => { @@ -273,7 +273,7 @@ t.test('workspaces', async t => { const pkg = require(resolve(prefix, 'a/package.json')) t.equal(pkg.name, 'a') t.equal(pkg.version, '1.0.0') - t.equal(pkg.license, 'ISC') + t.equal(pkg.license, undefined, 'license is omitted by default') t.matchSnapshot(joinedOutput(), 'should print helper info') @@ -306,7 +306,7 @@ t.test('workspaces', async t => { const pkg = require(resolve(prefix, 'packages/a/package.json')) t.equal(pkg.name, 'a') t.equal(pkg.version, '2.0.0') - t.equal(pkg.license, 'ISC') + t.equal(pkg.license, undefined, 'license is omitted by default') }) await t.test('fail parsing top-level package.json to set workspace', async t => { @@ -422,12 +422,12 @@ t.test('workspaces', async t => { const pkg = require(resolve(npm.localPrefix, 'package.json')) t.equal(pkg.version, '1.0.0') - t.equal(pkg.license, 'ISC') + t.equal(pkg.license, undefined, 'license is omitted by default') t.strictSame(pkg.workspaces, ['packages/a']) const ws = require(resolve(npm.localPrefix, 'packages/a/package.json')) t.equal(ws.version, '1.0.0') - t.equal(ws.license, 'ISC') + t.equal(ws.license, undefined, 'license is omitted by default') }) t.test('init pkg - installed workspace package', async t => { const { npm } = await mockNpm(t, { diff --git a/workspaces/config/lib/definitions/definitions.js b/workspaces/config/lib/definitions/definitions.js index 7c5b2ce170d89..a75b7a39d7a6e 100644 --- a/workspaces/config/lib/definitions/definitions.js +++ b/workspaces/config/lib/definitions/definitions.js @@ -983,11 +983,12 @@ const definitions = { `, }), 'init-license': new Definition('init-license', { - default: 'ISC', + default: '', hint: '', type: String, description: ` The value \`npm init\` should use by default for the package license. + If not set, the license field will be omitted from new packages. `, }), 'init-module': new Definition('init-module', { @@ -1058,7 +1059,7 @@ const definitions = { `, }), 'init.license': new Definition('init.license', { - default: 'ISC', + default: '', type: String, deprecated: ` Use \`--init-license\` instead.