Skip to content

Commit

Permalink
docs: add init-specific params to init docs/help (#6819)
Browse files Browse the repository at this point in the history
  • Loading branch information
wraithgar authored Sep 20, 2023
1 parent 8088325 commit 03912db
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 1 deletion.
5 changes: 5 additions & 0 deletions lib/commands/init.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,11 @@ const BaseCommand = require('../base-command.js')
class Init extends BaseCommand {
static description = 'Create a package.json file'
static params = [
'init-author-name',

This comment has been minimized.

Copy link
@ammarorokushorking

ammarorokushorking Oct 7, 2023

Bexchange

'init-author-url',

This comment has been minimized.

Copy link
@ammarorokushorking

ammarorokushorking Oct 7, 2023

Exchange

'init-license',

This comment has been minimized.

Copy link
@ammarorokushorking

ammarorokushorking Oct 7, 2023

0x00000010

'init-module',

This comment has been minimized.

Copy link
@ammarorokushorking

ammarorokushorking Oct 7, 2023

Android

'init-version',

This comment has been minimized.

Copy link
@ammarorokushorking
'yes',
'force',
'scope',
Expand Down
1 change: 1 addition & 0 deletions tap-snapshots/test/lib/commands/publish.js.test.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -315,6 +315,7 @@ exports[`test/lib/commands/publish.js TAP re-loads publishConfig.registry if add
`

exports[`test/lib/commands/publish.js TAP respects publishConfig.registry, runs appropriate scripts > new package version 1`] = `
`

exports[`test/lib/commands/publish.js TAP restricted access > must match snapshot 1`] = `
Expand Down
9 changes: 8 additions & 1 deletion tap-snapshots/test/lib/docs.js.test.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -3160,7 +3160,9 @@ npm init <package-spec> (same as \`npx <package-spec>\`)
npm init <@scope> (same as \`npx <@scope>/create\`)
Options:
[-y|--yes] [-f|--force] [--scope <@scope>]
[--init-author-name <name>] [--init-author-url <url>] [--init-license <license>]
[--init-module <module>] [--init-version <version>] [-y|--yes] [-f|--force]
[--scope <@scope>]
[-w|--workspace <workspace-name> [-w|--workspace <workspace-name> ...]]
[-ws|--workspaces] [--no-workspaces-update] [--include-workspace-root]
Expand All @@ -3175,6 +3177,11 @@ npm init <@scope> (same as \`npx <@scope>/create\`)
aliases: create, innit
\`\`\`
#### \`init-author-name\`
#### \`init-author-url\`
#### \`init-license\`
#### \`init-module\`
#### \`init-version\`
#### \`yes\`
#### \`force\`
#### \`scope\`
Expand Down
6 changes: 6 additions & 0 deletions workspaces/config/lib/definitions/definitions.js
Original file line number Diff line number Diff line change
Expand Up @@ -963,6 +963,7 @@ define('include-workspace-root', {

define('init-author-email', {
default: '',
hint: '<email>',
type: String,
description: `
The value \`npm init\` should use by default for the package author's
Expand All @@ -972,6 +973,7 @@ define('init-author-email', {

define('init-author-name', {
default: '',
hint: '<name>',
type: String,
description: `
The value \`npm init\` should use by default for the package author's name.
Expand All @@ -981,13 +983,15 @@ define('init-author-name', {
define('init-author-url', {
default: '',
type: ['', url],
hint: '<url>',
description: `
The value \`npm init\` should use by default for the package author's homepage.
`,
})

define('init-license', {
default: 'ISC',
hint: '<license>',
type: String,
description: `
The value \`npm init\` should use by default for the package license.
Expand All @@ -997,6 +1001,7 @@ define('init-license', {
define('init-module', {
default: '~/.npm-init.js',
type: path,
hint: '<module>',
description: `
A module that will be loaded by the \`npm init\` command. See the
documentation for the
Expand All @@ -1008,6 +1013,7 @@ define('init-module', {
define('init-version', {
default: '1.0.0',
type: semver,
hint: '<version>',
description: `
The value that \`npm init\` should use by default for the package
version number, if not already set in package.json.
Expand Down

0 comments on commit 03912db

Please sign in to comment.