Skip to content
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

docs: add init-specific params to init docs/help #6819

Merged
merged 1 commit into from
Sep 20, 2023
Merged
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
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',
'init-author-url',
'init-license',
'init-module',
'init-version',
'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