GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — feat!: remove default license for npm init · npm/cli@e9fb265

File tree

Expand file treeCollapse file tree
Open diff view settings
Filter options
  • tap-snapshots/test/lib
    • commands
      • config.js.test.cjs
    • docs.js.test.cjs
  • test/lib/commands
    • init.js
  • workspaces/config/lib/definitions
    • definitions.js
Expand file treeCollapse file tree
Open diff view settings
Collapse file

‎tap-snapshots/test/lib/commands/config.js.test.cjs‎

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 numberDiff line numberDiff line change
@@ -90,7 +90,7 @@ exports[`test/lib/commands/config.js TAP config list --json > output matches sna
9090
"init.author.email": "",
9191
"init.author.name": "",
9292
"init.author.url": "",
93-
"init.license": "ISC",
93+
"init.license": "",
9494
"init.module": "{CWD}/home/.npm-init.js",
9595
"init.version": "1.0.0",
9696
"install-links": false,
@@ -271,15 +271,15 @@ include-workspace-root = false
271271
init-author-email = ""
272272
; init-author-name = "" ; overridden by user
273273
init-author-url = ""
274-
; init-license = "ISC" ; overridden by global
274+
; init-license = "" ; overridden by global
275275
init-module = "{CWD}/home/.npm-init.js"
276276
init-private = false
277277
init-type = "commonjs"
278278
init-version = "1.0.0"
279279
init.author.email = ""
280280
init.author.name = ""
281281
init.author.url = ""
282-
init.license = "ISC"
282+
init.license = ""
283283
init.module = "{CWD}/home/.npm-init.js"
284284
init.version = "1.0.0"
285285
install-links = false
Collapse file

‎tap-snapshots/test/lib/docs.js.test.cjs‎

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 numberDiff line numberDiff line change
@@ -1044,10 +1044,11 @@ homepage.
10441044
10451045
#### \`init-license\`
10461046
1047-
* Default: "ISC"
1047+
* Default: ""
10481048
* Type: String
10491049
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.
10511052
10521053
10531054
@@ -2356,7 +2357,7 @@ Alias for \`--init-author-url\`
23562357
23572358
#### \`init.license\`
23582359
2359-
* Default: "ISC"
2360+
* Default: ""
23602361
* Type: String
23612362
* DEPRECATED: Use \`--init-license\` instead.
23622363
Collapse file

‎test/lib/commands/init.js‎

Copy file name to clipboardExpand all lines: test/lib/commands/init.js
+5-5Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ t.test('classic npm init -y', async t => {
4343

4444
const pkg = require(resolve(prefix, 'package.json'))
4545
t.equal(pkg.version, '1.0.0')
46-
t.equal(pkg.license, 'ISC')
46+
t.equal(pkg.license, undefined, 'license is omitted by default')
4747
})
4848

4949
t.test('classic interactive npm init', async t => {
@@ -273,7 +273,7 @@ t.test('workspaces', async t => {
273273
const pkg = require(resolve(prefix, 'a/package.json'))
274274
t.equal(pkg.name, 'a')
275275
t.equal(pkg.version, '1.0.0')
276-
t.equal(pkg.license, 'ISC')
276+
t.equal(pkg.license, undefined, 'license is omitted by default')
277277

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

@@ -306,7 +306,7 @@ t.test('workspaces', async t => {
306306
const pkg = require(resolve(prefix, 'packages/a/package.json'))
307307
t.equal(pkg.name, 'a')
308308
t.equal(pkg.version, '2.0.0')
309-
t.equal(pkg.license, 'ISC')
309+
t.equal(pkg.license, undefined, 'license is omitted by default')
310310
})
311311

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

423423
const pkg = require(resolve(npm.localPrefix, 'package.json'))
424424
t.equal(pkg.version, '1.0.0')
425-
t.equal(pkg.license, 'ISC')
425+
t.equal(pkg.license, undefined, 'license is omitted by default')
426426
t.strictSame(pkg.workspaces, ['packages/a'])
427427

428428
const ws = require(resolve(npm.localPrefix, 'packages/a/package.json'))
429429
t.equal(ws.version, '1.0.0')
430-
t.equal(ws.license, 'ISC')
430+
t.equal(ws.license, undefined, 'license is omitted by default')
431431
})
432432
t.test('init pkg - installed workspace package', async t => {
433433
const { npm } = await mockNpm(t, {
Collapse file

‎workspaces/config/lib/definitions/definitions.js‎

Copy file name to clipboardExpand all lines: workspaces/config/lib/definitions/definitions.js
+3-2Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1121,11 +1121,12 @@ const definitions = {
11211121
`,
11221122
}),
11231123
'init-license': new Definition('init-license', {
1124-
default: 'ISC',
1124+
default: '',
11251125
hint: '<license>',
11261126
type: String,
11271127
description: `
11281128
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.
11291130
`,
11301131
}),
11311132
'init-module': new Definition('init-module', {
@@ -1196,7 +1197,7 @@ const definitions = {
11961197
`,
11971198
}),
11981199
'init.license': new Definition('init.license', {
1199-
default: 'ISC',
1200+
default: '',
12001201
type: String,
12011202
deprecated: `
12021203
Use \`--init-license\` instead.

0 commit comments

Comments
0 (0)
You are visitor 01402792 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.