Skip to content

Commit

Permalink
feat: add lockfile resolved options
Browse files Browse the repository at this point in the history
  • Loading branch information
Caleb ツ Everett committed Jan 19, 2022
1 parent 8027323 commit 6feb42a
Show file tree
Hide file tree
Showing 4 changed files with 98 additions and 0 deletions.
30 changes: 30 additions & 0 deletions lib/utils/config/definitions.js
Original file line number Diff line number Diff line change
Expand Up @@ -2267,3 +2267,33 @@ define('yes', {
the command line.
`,
})

define('omit-lockfile-registry-resolved', {
default: false,
type: Boolean,
description: `
Set to true to omit 'resolved' key from registry dependencies in lock files.
This setting is useful in projects that may install dependencies from
different registries but would use a lockfile to lock package versions.
This option makes installing slower because npm must fetch package manifest
to resolve the package version's tarball.
See 'record-default-registry' for an alternative.
`,
flatten,
})

define('record-default-registry', {
default: false,
type: Boolean,
description: `
Set to true to replace the actual registry in urls resolved from registires
with the default registry when recording lock files.
This setting is useful in projects that may install dependencies from
different registries but would use a lockfile to lock package versions.
This option supports registries that host tarballs at the same path. If
even the path may change see 'omit-lockfile-registry-resolved'.
`,
flatten,
})
4 changes: 4 additions & 0 deletions tap-snapshots/test/lib/commands/config.js.test.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -156,6 +156,8 @@ exports[`test/lib/commands/config.js TAP config list --json > output matches sna
"workspace": [],
"workspaces": null,
"yes": null,
"omit-lockfile-registry-resolved": false,
"record-default-registry": false,
"metrics-registry": "https://registry.npmjs.org/"
}
`
Expand Down Expand Up @@ -252,6 +254,7 @@ noproxy = [""]
npm-version = "{NPM-VERSION}"
offline = false
omit = []
omit-lockfile-registry-resolved = false
only = null
optional = null
otp = null
Expand All @@ -269,6 +272,7 @@ progress = true
proxy = null
read-only = false
rebuild-bundle = true
record-default-registry = false
registry = "https://registry.npmjs.org/"
save = true
save-bundle = false
Expand Down
32 changes: 32 additions & 0 deletions tap-snapshots/test/lib/utils/config/definitions.js.test.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -152,6 +152,8 @@ Array [
"workspace",
"workspaces",
"yes",
"omit-lockfile-registry-resolved",
"record-default-registry",
]
`

Expand Down Expand Up @@ -1205,6 +1207,21 @@ If the resulting omit list includes \`'dev'\`, then the \`NODE_ENV\` environment
variable will be set to \`'production'\` for all lifecycle scripts.
`

exports[`test/lib/utils/config/definitions.js TAP > config description for omit-lockfile-registry-resolved 1`] = `
#### \`omit-lockfile-registry-resolved\`
* Default: false
* Type: Boolean
Set to true to omit 'resolved' key from registry dependencies in lock files.
This setting is useful in projects that may install dependencies from
different registries but would use a lockfile to lock package versions. This
option makes installing slower because npm must fetch package manifest to
resolve the package version's tarball. See 'record-default-registry' for an
alternative.
`

exports[`test/lib/utils/config/definitions.js TAP > config description for only 1`] = `
#### \`only\`
Expand Down Expand Up @@ -1394,6 +1411,21 @@ exports[`test/lib/utils/config/definitions.js TAP > config description for rebui
Rebuild bundled dependencies after installation.
`

exports[`test/lib/utils/config/definitions.js TAP > config description for record-default-registry 1`] = `
#### \`record-default-registry\`
* Default: false
* Type: Boolean
Set to true to replace the actual registry in urls resolved from registires
with the default registry when recording lock files.
This setting is useful in projects that may install dependencies from
different registries but would use a lockfile to lock package versions. This
option supports registries that host tarballs at the same path. If even the
path may change see 'omit-lockfile-registry-resolved'.
`

exports[`test/lib/utils/config/definitions.js TAP > config description for registry 1`] = `
#### \`registry\`
Expand Down
32 changes: 32 additions & 0 deletions tap-snapshots/test/lib/utils/config/describe-all.js.test.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -1018,6 +1018,22 @@ variable will be set to \`'production'\` for all lifecycle scripts.
<!-- automatically generated, do not edit manually -->
<!-- see lib/utils/config/definitions.js -->
#### \`omit-lockfile-registry-resolved\`
* Default: false
* Type: Boolean
Set to true to omit 'resolved' key from registry dependencies in lock files.
This setting is useful in projects that may install dependencies from
different registries but would use a lockfile to lock package versions. This
option makes installing slower because npm must fetch package manifest to
resolve the package version's tarball. See 'record-default-registry' for an
alternative.
<!-- automatically generated, do not edit manually -->
<!-- see lib/utils/config/definitions.js -->
#### \`otp\`
* Default: null
Expand Down Expand Up @@ -1188,6 +1204,22 @@ Rebuild bundled dependencies after installation.
<!-- automatically generated, do not edit manually -->
<!-- see lib/utils/config/definitions.js -->
#### \`record-default-registry\`
* Default: false
* Type: Boolean
Set to true to replace the actual registry in urls resolved from registires
with the default registry when recording lock files.
This setting is useful in projects that may install dependencies from
different registries but would use a lockfile to lock package versions. This
option supports registries that host tarballs at the same path. If even the
path may change see 'omit-lockfile-registry-resolved'.
<!-- automatically generated, do not edit manually -->
<!-- see lib/utils/config/definitions.js -->
#### \`registry\`
* Default: "https://registry.npmjs.org/"
Expand Down

0 comments on commit 6feb42a

Please sign in to comment.