GeezerVison is showing github.com — feat!: remove default license for npm init by owlstronaut · Pull Request #9234 · npm/cli
feat!: remove default license for npm init
#9234
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and
privacy statement . We’ll occasionally send you account related emails.
Already on GitHub?
Sign in
to your account
Uh oh!
There was an error while loading. Please reload this page.
Show file tree
Hide file tree
Changes from all commits
Commits
File filter
Filter by extension
.cjs
(3)
.js
(2)
All 2 file types selected
Viewed files
Conversations
Failed to load comments.
Loading
Uh oh!
There was an error while loading. Please reload this page.
Jump to
Jump to file
Failed to load files.
Loading
Uh oh!
There was an error while loading. Please reload this page.
Diff view
Hide whitespace
Diff view
Hide whitespace
There are no files selected for viewing
Original file line number
Diff line number
Diff line change
Expand Up
@@ -190,7 +190,6 @@ Wrote to {NPM}/{TESTDIR}/project/package.json:
"test": "echo /"Error: no test specified/" && exit 1"
},
"keywords": [],
"license": "ISC",
"type": "commonjs"
}
`
Expand All
@@ -207,7 +206,6 @@ Object {
"devDependencies": Object {
"promise-all-reject-late": "^5.0.0",
},
"license": "ISC",
"name": "project",
"version": "1.0.0",
},
Expand Down
Expand Up
@@ -239,7 +237,6 @@ Object {
"promise-all-reject-late": "^5.0.0",
},
"keywords": Array [],
"license": "ISC",
"main": "index.js",
"name": "project",
"scripts": Object {
Expand Down
Expand Up
@@ -270,7 +267,6 @@ Object {
"dependencies": Object {
"abbrev": "^1.0.4",
},
"license": "ISC",
"name": "project",
"version": "1.0.0",
},
Expand All
@@ -291,7 +287,6 @@ Object {
},
"description": "",
"keywords": Array [],
"license": "ISC",
"main": "index.js",
"name": "project",
"scripts": Object {
Expand Down
Expand Up
@@ -320,7 +315,6 @@ Object {
},
"description": "",
"keywords": Array [],
"license": "ISC",
"main": "index.js",
"name": "project",
"scripts": Object {
Expand All
@@ -339,7 +333,6 @@ Object {
},
"description": "",
"keywords": Array [],
"license": "ISC",
"main": "index.js",
"name": "project",
"scripts": Object {
Expand All
@@ -361,7 +354,7 @@ exports[`test/index.js TAP basic npm pkg > should have expected pkg delete outpu
`
exports[`test/index.js TAP basic npm pkg > should have expected pkg get output 1`] = `
ISC
`
exports[`test/index.js TAP basic npm pkg > should have expected pkg set output 1`] = `
Expand All
@@ -378,7 +371,6 @@ scripts = {
hello: 'echo Hello'
}
keywords = []
license = 'ISC'
type = 'commonjs'
dependencies = { abbrev: '^1.0.4' }
tap = { 'test-env': [ 'LC_ALL=sk' ] }
Expand All
@@ -394,7 +386,6 @@ Object {
"promise-all-reject-late": "^5.0.0",
},
"keywords": Array [],
"license": "ISC",
"main": "index.js",
"name": "project",
"scripts": Object {
Expand Down
Expand Up
@@ -427,7 +418,6 @@ Object {
"dependencies": Object {
"abbrev": "^1.0.4",
},
"license": "ISC",
"name": "project",
"version": "1.0.0",
},
Expand All
@@ -448,7 +438,6 @@ Object {
},
"description": "",
"keywords": Array [],
"license": "ISC",
"main": "index.js",
"name": "project",
"scripts": Object {
Expand Down
Expand Up
@@ -476,7 +465,6 @@ Object {
"devDependencies": Object {
"promise-all-reject-late": "^5.0.0",
},
"license": "ISC",
"name": "project",
"version": "1.0.0",
},
Expand Down
Expand Up
@@ -508,7 +496,6 @@ Object {
"promise-all-reject-late": "^5.0.0",
},
"keywords": Array [],
"license": "ISC",
"main": "index.js",
"name": "project",
"scripts": Object {
Expand Down
Original file line number
Diff line number
Diff line change
Expand Up
@@ -90,7 +90,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,
Expand Down
Expand Up
@@ -271,15 +271,15 @@ include-workspace-root = false
init-author-email = ""
; init-author-name = "" ; overridden by user
init-author-url = ""
; init-license = "ISC " ; overridden by global
; init-license = "" ; overridden by global
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
Original file line number
Diff line number
Diff line change
Expand Up
@@ -1044,10 +1044,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
@@ -2356,7 +2357,7 @@ Alias for \`--init-author-url\`
#### \`init.license\`
* Default: "ISC "
* Default: ""
* Type: String
* DEPRECATED: Use \`--init-license\` instead.
Expand Down
Original file line number
Diff line number
Diff line change
Expand Up
@@ -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 => {
Expand Down
Expand Up
@@ -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')
Expand Down
Expand Up
@@ -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 => {
Expand Down
Expand Up
@@ -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, {
Expand Down
Original file line number
Diff line number
Diff line change
Expand Up
@@ -1121,11 +1121,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
@@ -1196,7 +1197,7 @@ const definitions = {
`,
}),
'init.license': new Definition('init.license', {
default: 'ISC ',
default: '',
type: String,
deprecated: `
Use \`--init-license\` instead.
Expand Down
Loading
Oops, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.