Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions tap-snapshots/test/lib/commands/config.js.test.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -76,15 +76,15 @@ 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",
"init-private": false,
"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,
Expand Down Expand Up @@ -255,15 +255,15 @@ 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"
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
Expand Down
7 changes: 4 additions & 3 deletions tap-snapshots/test/lib/docs.js.test.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -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.



Expand Down Expand Up @@ -2145,7 +2146,7 @@ Alias for \`--init-author-url\`

#### \`init.license\`

* Default: "ISC"
* Default: ""
* Type: String
* DEPRECATED: Use \`--init-license\` instead.

Expand Down
10 changes: 5 additions & 5 deletions test/lib/commands/init.js
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@

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')

Check failure on line 46 in test/lib/commands/init.js

View workflow job for this annotation

GitHub Actions / Test - macOS - 22.x

license is omitted by default

Check failure on line 46 in test/lib/commands/init.js

View workflow job for this annotation

GitHub Actions / Test - Linux - 20.17.0

license is omitted by default

Check failure on line 46 in test/lib/commands/init.js

View workflow job for this annotation

GitHub Actions / Test - Linux - 22.9.0

license is omitted by default

Check failure on line 46 in test/lib/commands/init.js

View workflow job for this annotation

GitHub Actions / Test - macOS - 20.x

license is omitted by default

Check failure on line 46 in test/lib/commands/init.js

View workflow job for this annotation

GitHub Actions / Test - Linux - 22.x

license is omitted by default

Check failure on line 46 in test/lib/commands/init.js

View workflow job for this annotation

GitHub Actions / Test - Linux - 20.x

license is omitted by default

Check failure on line 46 in test/lib/commands/init.js

View workflow job for this annotation

GitHub Actions / Test - macOS - 22.9.0

license is omitted by default

Check failure on line 46 in test/lib/commands/init.js

View workflow job for this annotation

GitHub Actions / Test - macOS - 20.17.0

license is omitted by default
})

t.test('classic interactive npm init', async t => {
Expand Down Expand Up @@ -273,7 +273,7 @@
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')

Check failure on line 276 in test/lib/commands/init.js

View workflow job for this annotation

GitHub Actions / Test - macOS - 22.x

license is omitted by default

Check failure on line 276 in test/lib/commands/init.js

View workflow job for this annotation

GitHub Actions / Test - Linux - 20.17.0

license is omitted by default

Check failure on line 276 in test/lib/commands/init.js

View workflow job for this annotation

GitHub Actions / Test - Linux - 22.9.0

license is omitted by default

Check failure on line 276 in test/lib/commands/init.js

View workflow job for this annotation

GitHub Actions / Test - macOS - 20.x

license is omitted by default

Check failure on line 276 in test/lib/commands/init.js

View workflow job for this annotation

GitHub Actions / Test - Linux - 22.x

license is omitted by default

Check failure on line 276 in test/lib/commands/init.js

View workflow job for this annotation

GitHub Actions / Test - Linux - 20.x

license is omitted by default

Check failure on line 276 in test/lib/commands/init.js

View workflow job for this annotation

GitHub Actions / Test - macOS - 22.9.0

license is omitted by default

Check failure on line 276 in test/lib/commands/init.js

View workflow job for this annotation

GitHub Actions / Test - macOS - 20.17.0

license is omitted by default

t.matchSnapshot(joinedOutput(), 'should print helper info')

Expand Down Expand Up @@ -306,7 +306,7 @@
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')

Check failure on line 309 in test/lib/commands/init.js

View workflow job for this annotation

GitHub Actions / Test - macOS - 22.x

license is omitted by default

Check failure on line 309 in test/lib/commands/init.js

View workflow job for this annotation

GitHub Actions / Test - Linux - 20.17.0

license is omitted by default

Check failure on line 309 in test/lib/commands/init.js

View workflow job for this annotation

GitHub Actions / Test - Linux - 22.9.0

license is omitted by default

Check failure on line 309 in test/lib/commands/init.js

View workflow job for this annotation

GitHub Actions / Test - macOS - 20.x

license is omitted by default

Check failure on line 309 in test/lib/commands/init.js

View workflow job for this annotation

GitHub Actions / Test - Linux - 22.x

license is omitted by default

Check failure on line 309 in test/lib/commands/init.js

View workflow job for this annotation

GitHub Actions / Test - Linux - 20.x

license is omitted by default

Check failure on line 309 in test/lib/commands/init.js

View workflow job for this annotation

GitHub Actions / Test - macOS - 22.9.0

license is omitted by default

Check failure on line 309 in test/lib/commands/init.js

View workflow job for this annotation

GitHub Actions / Test - macOS - 20.17.0

license is omitted by default
})

await t.test('fail parsing top-level package.json to set workspace', async t => {
Expand Down Expand Up @@ -422,12 +422,12 @@

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')

Check failure on line 425 in test/lib/commands/init.js

View workflow job for this annotation

GitHub Actions / Test - macOS - 22.x

license is omitted by default

Check failure on line 425 in test/lib/commands/init.js

View workflow job for this annotation

GitHub Actions / Test - Linux - 20.17.0

license is omitted by default

Check failure on line 425 in test/lib/commands/init.js

View workflow job for this annotation

GitHub Actions / Test - Linux - 22.9.0

license is omitted by default

Check failure on line 425 in test/lib/commands/init.js

View workflow job for this annotation

GitHub Actions / Test - macOS - 20.x

license is omitted by default

Check failure on line 425 in test/lib/commands/init.js

View workflow job for this annotation

GitHub Actions / Test - Linux - 22.x

license is omitted by default

Check failure on line 425 in test/lib/commands/init.js

View workflow job for this annotation

GitHub Actions / Test - Linux - 20.x

license is omitted by default

Check failure on line 425 in test/lib/commands/init.js

View workflow job for this annotation

GitHub Actions / Test - macOS - 22.9.0

license is omitted by default

Check failure on line 425 in test/lib/commands/init.js

View workflow job for this annotation

GitHub Actions / Test - macOS - 20.17.0

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')

Check failure on line 430 in test/lib/commands/init.js

View workflow job for this annotation

GitHub Actions / Test - macOS - 22.x

license is omitted by default

Check failure on line 430 in test/lib/commands/init.js

View workflow job for this annotation

GitHub Actions / Test - Linux - 20.17.0

license is omitted by default

Check failure on line 430 in test/lib/commands/init.js

View workflow job for this annotation

GitHub Actions / Test - Linux - 22.9.0

license is omitted by default

Check failure on line 430 in test/lib/commands/init.js

View workflow job for this annotation

GitHub Actions / Test - macOS - 20.x

license is omitted by default

Check failure on line 430 in test/lib/commands/init.js

View workflow job for this annotation

GitHub Actions / Test - Linux - 22.x

license is omitted by default

Check failure on line 430 in test/lib/commands/init.js

View workflow job for this annotation

GitHub Actions / Test - Linux - 20.x

license is omitted by default

Check failure on line 430 in test/lib/commands/init.js

View workflow job for this annotation

GitHub Actions / Test - macOS - 22.9.0

license is omitted by default

Check failure on line 430 in test/lib/commands/init.js

View workflow job for this annotation

GitHub Actions / Test - macOS - 20.17.0

license is omitted by default
})
t.test('init pkg - installed workspace package', async t => {
const { npm } = await mockNpm(t, {
Expand Down
5 changes: 3 additions & 2 deletions workspaces/config/lib/definitions/definitions.js
Original file line number Diff line number Diff line change
Expand Up @@ -983,11 +983,12 @@ const definitions = {
`,
}),
'init-license': new Definition('init-license', {
default: 'ISC',
default: '',
hint: '<license>',
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', {
Expand Down Expand Up @@ -1058,7 +1059,7 @@ const definitions = {
`,
}),
'init.license': new Definition('init.license', {
default: 'ISC',
default: '',
type: String,
deprecated: `
Use \`--init-license\` instead.
Expand Down
Loading