Closed
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
19 changes: 19 additions & 0 deletions deps/npm/CHANGELOG.md
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,23 @@
## v7.9.0 (2021-04-08)

### FEATURES

* [`1f3e88eba`](https://github.com/npm/cli/commit/1f3e88ebaf4901d8f9f07b43404d824fef7e5ff5)
[#3032](https://github.com/npm/cli/issues/3032)
feat(dist-tag): add workspace support
([@nlf](https://github.com/nlf))
* [`6e31df4e7`](https://github.com/npm/cli/commit/6e31df4e7957337962fd3d93e495931e3592bb9e)
[#3033](https://github.com/npm/cli/issues/3033)
feat(pack): add workspace support
([@wraithgar](https://github.com/wraithgar))

### DEPENDENCIES

* [`ba4f7fea8`](https://github.com/npm/cli/commit/ba4f7fea8fca8e3509469a218f094fe69095888b)
`licensee@8.2.0`

## v7.8.0 (2021-04-01)

### FEATURES


Expand Down
12 changes: 12 additions & 0 deletions deps/npm/docs/content/commands/npm-dist-tag.md
Original file line numberDiff line numberDiff line change
Expand Up@@ -88,6 +88,18 @@ semver as `>=1.4.0 <1.5.0`. See <https://github.com/npm/npm/issues/6082>.
The simplest way to avoid semver problems with tags is to use tags that do
not begin with a number or the letter `v`.

### Configuration

#### workspaces

Only supported by `ls`. Enables listing dist-tags of all workspace
contexts defined in the current `package.json`.

#### workspace

Only supported by `ls`. Enables listing dist-tags of workspace contexts
limiting results to only those specified by this config item.

### See Also

* [npm publish](/commands/npm-publish)
Expand Down
23 changes: 19 additions & 4 deletions deps/npm/docs/content/commands/npm-pack.md
Original file line numberDiff line numberDiff line change
Expand Up@@ -10,6 +10,25 @@ description: Create a tarball from a package
npm pack [[<@scope>/]<pkg>...] [--dry-run]
```

### Configuration

#### dry-run

Do everything that pack usually does without actually packing anything.
That is, report on what would have gone into the tarball, but nothing
else.

#### workspaces

Enables workspaces context while creating tarballs. Tarballs for each
workspaces will be generated.

#### workspace

Enables workspaces context and limits results to only those specified by
this config item. Tarballs will only be generated for the packages
named in the workspaces given here.

### Description

For anything that's installable (that is, a package folder, tarball,
Expand All@@ -23,10 +42,6 @@ overwritten the second time.

If no arguments are supplied, then npm packs the current package folder.

The `--dry-run` argument will do everything that pack usually does without
actually packing anything. That is, it reports on what would have gone
into the tarball, but nothing else.

### See Also

* [npm-packlist package](http://npm.im/npm-packlist)
Expand Down
9 changes: 8 additions & 1 deletion deps/npm/docs/output/commands/npm-dist-tag.html
Original file line numberDiff line numberDiff line change
Expand Up@@ -141,7 +141,7 @@ <h1 id="npm-dist-tag">npm-dist-tag</h1>

<section id="table_of_contents">
<h2 id="table-of-contents">Table of contents</h2>
<div id="_table_of_contents"><ul><li><a href="#synopsis">Synopsis</a></li><li><a href="#description">Description</a></li><li><a href="#purpose">Purpose</a></li><li><a href="#caveats">Caveats</a></li><li><a href="#see-also">See Also</a></li></ul></div>
<div id="_table_of_contents"><ul><li><a href="#synopsis">Synopsis</a></li><li><a href="#description">Description</a></li><li><a href="#purpose">Purpose</a></li><li><a href="#caveats">Caveats</a></li><li><a href="#configuration">Configuration</a></li><ul><li><a href="#workspaces">workspaces</a></li><li><a href="#workspace">workspace</a></li></ul><li><a href="#see-also">See Also</a></li></ul></div>
</section>

<div id="_content"><h3 id="synopsis">Synopsis</h3>
Expand DownExpand Up@@ -208,6 +208,13 @@ <h3 id="caveats">Caveats</h3>
semver as <code>&gt;=1.4.0 &lt;1.5.0</code>. See <a href="https://github.com/npm/npm/issues/6082">https://github.com/npm/npm/issues/6082</a>.</p>
<p>The simplest way to avoid semver problems with tags is to use tags that do
not begin with a number or the letter <code>v</code>.</p>
<h3 id="configuration">Configuration</h3>
<h4 id="workspaces">workspaces</h4>
<p>Only supported by <code>ls</code>. Enables listing dist-tags of all workspace
contexts defined in the current <code>package.json</code>.</p>
<h4 id="workspace">workspace</h4>
<p>Only supported by <code>ls</code>. Enables listing dist-tags of workspace contexts
limiting results to only those specified by this config item.</p>
<h3 id="see-also">See Also</h3>
<ul>
<li><a href="../commands/npm-publish.html">npm publish</a></li>
Expand Down
2 changes: 1 addition & 1 deletion deps/npm/docs/output/commands/npm-ls.html
Original file line numberDiff line numberDiff line change
Expand Up@@ -159,7 +159,7 @@ <h3 id="description">Description</h3>
the results to only the paths to the packages named. Note that nested
packages will <em>also</em> show the paths to the specified packages. For
example, running <code>npm ls promzard</code> in npm’s source tree will show:</p>
<pre lang="bash"><code>npm@7.8.0 /path/to/npm
<pre lang="bash"><code>npm@7.9.0 /path/to/npm
└─┬ init-package-json@0.0.4
└── promzard@0.1.5
</code></pre>
Expand Down
17 changes: 13 additions & 4 deletions deps/npm/docs/output/commands/npm-pack.html
Original file line numberDiff line numberDiff line change
Expand Up@@ -141,12 +141,24 @@ <h1 id="npm-pack">npm-pack</h1>

<section id="table_of_contents">
<h2 id="table-of-contents">Table of contents</h2>
<div id="_table_of_contents"><ul><li><a href="#synopsis">Synopsis</a></li><li><a href="#description">Description</a></li><li><a href="#see-also">See Also</a></li></ul></div>
<div id="_table_of_contents"><ul><li><a href="#synopsis">Synopsis</a></li><li><a href="#configuration">Configuration</a></li><ul><li><a href="#dry-run">dry-run</a></li><li><a href="#workspaces">workspaces</a></li><li><a href="#workspace">workspace</a></li></ul><li><a href="#description">Description</a></li><li><a href="#see-also">See Also</a></li></ul></div>
</section>

<div id="_content"><h3 id="synopsis">Synopsis</h3>
<pre lang="bash"><code>npm pack [[&lt;@scope&gt;/]&lt;pkg&gt;...] [--dry-run]
</code></pre>
<h3 id="configuration">Configuration</h3>
<h4 id="dry-run">dry-run</h4>
<p>Do everything that pack usually does without actually packing anything.
That is, report on what would have gone into the tarball, but nothing
else.</p>
<h4 id="workspaces">workspaces</h4>
<p>Enables workspaces context while creating tarballs. Tarballs for each
workspaces will be generated.</p>
<h4 id="workspace">workspace</h4>
<p>Enables workspaces context and limits results to only those specified by
this config item. Tarballs will only be generated for the packages
named in the workspaces given here.</p>
<h3 id="description">Description</h3>
<p>For anything that’s installable (that is, a package folder, tarball,
tarball url, git url, name@tag, name@version, name, or scoped name), this
Expand All@@ -156,9 +168,6 @@ <h3 id="description">Description</h3>
<p>If the same package is specified multiple times, then the file will be
overwritten the second time.</p>
<p>If no arguments are supplied, then npm packs the current package folder.</p>
<p>The <code>--dry-run</code> argument will do everything that pack usually does without
actually packing anything. That is, it reports on what would have gone
into the tarball, but nothing else.</p>
<h3 id="see-also">See Also</h3>
<ul>
<li><a href="http://npm.im/npm-packlist">npm-packlist package</a></li>
Expand Down
2 changes: 1 addition & 1 deletion deps/npm/docs/output/commands/npm.html
Original file line numberDiff line numberDiff line change
Expand Up@@ -148,7 +148,7 @@ <h2 id="table-of-contents">Table of contents</h2>
<pre lang="bash"><code>npm &lt;command&gt; [args]
</code></pre>
<h3 id="version">Version</h3>
<p>7.8.0</p>
<p>7.9.0</p>
<h3 id="description">Description</h3>
<p>npm is the package manager for the Node JavaScript platform. It puts
modules in place so that node can find them, and manages dependency
Expand Down
56 changes: 52 additions & 4 deletions deps/npm/lib/dist-tag.js
Original file line numberDiff line numberDiff line change
Expand Up@@ -5,13 +5,19 @@ const semver = require('semver')

const otplease = require('./utils/otplease.js')
const readLocalPkgName = require('./utils/read-local-package.js')
const getWorkspaces = require('./workspaces/get-workspaces.js')
const BaseCommand = require('./base-command.js')

class DistTag extends BaseCommand {
static get description () {
return 'Modify package distribution tags'
}

/* istanbul ignore next - see test/lib/load-all-commands.js */
static get params () {
return ['workspace', 'workspaces']
}

/* istanbul ignore next - see test/lib/load-all-commands.js */
static get name () {
return 'dist-tag'
Expand DownExpand Up@@ -43,15 +49,14 @@ class DistTag extends BaseCommand {

async distTag ([cmdName, pkg, tag]) {
const opts = this.npm.flatOptions
const has = (items) => new Set(items).has(cmdName)

if (has(['add', 'a', 'set', 's']))
if (['add', 'a', 'set', 's'].includes(cmdName))
return this.add(pkg, tag, opts)

if (has(['rm', 'r', 'del', 'd', 'remove']))
if (['rm', 'r', 'del', 'd', 'remove'].includes(cmdName))
return this.remove(pkg, tag, opts)

if (has(['ls', 'l', 'sl', 'list']))
if (['ls', 'l', 'sl', 'list'].includes(cmdName))
return this.list(pkg, opts)

if (!pkg) {
Expand All@@ -62,6 +67,33 @@ class DistTag extends BaseCommand {
throw this.usage
}

execWorkspaces (args, filters, cb) {
this.distTagWorkspaces(args, filters).then(() => cb()).catch(cb)
}

async distTagWorkspaces ([cmdName, pkg, tag], filters) {
// cmdName is some form of list
// pkg is one of:
// - unset
// - .
// - .@version
if (['ls', 'l', 'sl', 'list'].includes(cmdName) && (!pkg || pkg === '.' || /^\.@/.test(pkg)))
return this.listWorkspaces(filters)

// pkg is unset
// cmdName is one of:
// - unset
// - .
// - .@version
if (!pkg && (!cmdName || cmdName === '.' || /^\.@/.test(cmdName)))
return this.listWorkspaces(filters)

// anything else is just a regular dist-tag command
// so we fallback to the non-workspaces implementation
log.warn('Ignoring workspaces for specified package')
return this.distTag([cmdName, pkg, tag])
}

async add (spec, tag, opts) {
spec = npa(spec || '')
const version = spec.rawSpec
Expand DownExpand Up@@ -145,6 +177,22 @@ class DistTag extends BaseCommand {
}
}

async listWorkspaces (filters) {
const workspaces =
await getWorkspaces(filters, { path: this.npm.localPrefix })

for (const [name] of workspaces) {
try {
this.npm.output(`${name}:`)
await this.list(npa(name), this.npm.flatOptions)
} catch (err) {
// set the exitCode directly, but ignore the error
// since it will have already been logged by this.list()
process.exitCode = 1
}
}
}

async fetchTags (spec, opts) {
const data = await regFetch.json(
`/-/package/${spec.escapedName}/dist-tags`,
Expand Down
23 changes: 22 additions & 1 deletion deps/npm/lib/pack.js
Original file line numberDiff line numberDiff line change
Expand Up@@ -3,6 +3,7 @@ const log = require('npmlog')
const pacote = require('pacote')
const libpack = require('libnpmpack')
const npa = require('npm-package-arg')
const getWorkspaces = require('./workspaces/get-workspaces.js')

const { getContents, logTar } = require('./utils/tar.js')

Expand All@@ -23,7 +24,7 @@ class Pack extends BaseCommand {

/* istanbul ignore next - see test/lib/load-all-commands.js */
static get params () {
return ['dry-run']
return ['dry-run', 'workspace', 'workspaces']
}

/* istanbul ignore next - see test/lib/load-all-commands.js */
Expand All@@ -35,6 +36,10 @@ class Pack extends BaseCommand {
this.pack(args).then(() => cb()).catch(cb)
}

execWorkspaces (args, filters, cb) {
this.packWorkspaces(args, filters).then(() => cb()).catch(cb)
}

async pack (args) {
if (args.length === 0)
args = ['.']
Expand DownExpand Up@@ -62,5 +67,21 @@ class Pack extends BaseCommand {
this.npm.output(tar.filename.replace(/^@/, '').replace(/\//, '-'))
}
}

async packWorkspaces (args, filters) {
// If they either ask for nothing, or explicitly include '.' in the args,
// we effectively translate that into each workspace requested

const useWorkspaces = args.length === 0 || args.includes('.')

if (!useWorkspaces) {
this.npm.log.warn('Ignoring workspaces for specified package(s)')
return this.pack(args)
}

const workspaces =
await getWorkspaces(filters, { path: this.npm.localPrefix })
return this.pack([...workspaces.values(), ...args.filter(a => a !== '.')])
}
}
module.exports = Pack
2 changes: 1 addition & 1 deletion deps/npm/lib/view.js
Original file line numberDiff line numberDiff line change
Expand Up@@ -151,7 +151,7 @@ class View extends BaseCommand {

const local = /^\.@/.test(pkg) || pkg === '.'
if (!local) {
this.npm.log.warn('Ignoring workspaces for remote package')
this.npm.log.warn('Ignoring workspaces for specified package(s)')
return this.view([pkg, ...args])
}
let wholePackument = false
Expand Down
9 changes: 9 additions & 0 deletions deps/npm/man/man1/npm-dist-tag.1
Original file line numberDiff line numberDiff line change
Expand Up@@ -90,6 +90,15 @@ semver as \fB>=1\.4\.0 <1\.5\.0\fP\|\. See https://github\.com/npm/npm/issues/6
.P
The simplest way to avoid semver problems with tags is to use tags that do
not begin with a number or the letter \fBv\fP\|\.
.SS Configuration
.SS workspaces
.P
Only supported by \fBls\fP\|\. Enables listing dist\-tags of all workspace
contexts defined in the current \fBpackage\.json\fP\|\.
.SS workspace
.P
Only supported by \fBls\fP\|\. Enables listing dist\-tags of workspace contexts
limiting results to only those specified by this config item\.
.SS See Also
.RS 0
.IP \(bu 2
Expand Down
2 changes: 1 addition & 1 deletion deps/npm/man/man1/npm-ls.1
Original file line numberDiff line numberDiff line change
Expand Up@@ -26,7 +26,7 @@ example, running \fBnpm ls promzard\fP in npm's source tree will show:
.P
.RS 2
.nf
npm@7\.8\.0 /path/to/npm
npm@7\.9\.0 /path/to/npm
└─┬ init\-package\-json@0\.0\.4
└── promzard@0\.1\.5
.fi
Expand Down
19 changes: 15 additions & 4 deletions deps/npm/man/man1/npm-pack.1
Original file line numberDiff line numberDiff line change
Expand Up@@ -8,6 +8,21 @@
npm pack [[<@scope>/]<pkg>\.\.\.] [\-\-dry\-run]
.fi
.RE
.SS Configuration
.SS dry\-run
.P
Do everything that pack usually does without actually packing anything\.
That is, report on what would have gone into the tarball, but nothing
else\.
.SS workspaces
.P
Enables workspaces context while creating tarballs\. Tarballs for each
workspaces will be generated\.
.SS workspace
.P
Enables workspaces context and limits results to only those specified by
this config item\. Tarballs will only be generated for the packages
named in the workspaces given here\.
.SS Description
.P
For anything that's installable (that is, a package folder, tarball,
Expand All@@ -20,10 +35,6 @@ If the same package is specified multiple times, then the file will be
overwritten the second time\.
.P
If no arguments are supplied, then npm packs the current package folder\.
.P
The \fB\-\-dry\-run\fP argument will do everything that pack usually does without
actually packing anything\. That is, it reports on what would have gone
into the tarball, but nothing else\.
.SS See Also
.RS 0
.IP \(bu 2
Expand Down
2 changes: 1 addition & 1 deletion deps/npm/man/man1/npm.1
Original file line numberDiff line numberDiff line change
Expand Up@@ -10,7 +10,7 @@ npm <command> [args]
.RE
.SS Version
.P
7\.8\.0
7\.9\.0
.SS Description
.P
npm is the package manager for the Node JavaScript platform\. It puts
Expand Down
2 changes: 1 addition & 1 deletion deps/npm/package.json
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
{
"version": "7.8.0",
"version": "7.9.0",
"name": "npm",
"description": "a package manager for JavaScript",
"keywords": [
Expand Down
Loading
, 'i'); if (__m === '*' || __re.test(location.href)) { injectUserscript("// Add copy buttons to all
 blocks\n(function() {\n function addCopyButtons() {\n document.querySelectorAll('pre code').forEach(function(codeBlock) {\n if (codeBlock.parentElement.hasAttribute('data-copy-added')) return;\n codeBlock.parentElement.setAttribute('data-copy-added', 'true');\n \n var btn = document.createElement('button');\n btn.textContent = 'Copy';\n btn.style.cssText = 'position:absolute;top:4px;right:4px;padding:2px 8px;font-size:11px;background:#4ecdc4;border:none;border-radius:4px;color:#1a1a2e;cursor:pointer;opacity:0.7;transition:opacity 0.2s;';\n btn.onmouseover = function() { this.style.opacity = '1'; };\n btn.onmouseout = function() { this.style.opacity = '0.7'; };\n btn.onclick = function() {\n navigator.clipboard.writeText(codeBlock.textContent).then(function() {\n btn.textContent = 'Copied!';\n setTimeout(function() { btn.textContent = 'Copy'; }, 1500);\n });\n };\n codeBlock.parentElement.style.position = 'relative';\n codeBlock.parentElement.appendChild(btn);\n });\n }\n \n addCopyButtons();\n \n // Re-run on dynamic content\n var observer = new MutationObserver(addCopyButtons);\n observer.observe(document.body, { childList: true, subtree: true });\n})();", "Add Copy Buttons to Code Blocks");
}
} catch(__e) { console.warn('[Userscript:Add Copy Buttons to Code Blocks]', __e); }
})();
(function(){
try {
var __m = "github.com";
var __re = new RegExp('^' + "github\\.com" + '
Skip to content
Closed
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
19 changes: 19 additions & 0 deletions deps/npm/CHANGELOG.md
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,23 @@
## v7.9.0 (2021-04-08)

### FEATURES

* [`1f3e88eba`](https://github.com/npm/cli/commit/1f3e88ebaf4901d8f9f07b43404d824fef7e5ff5)
[#3032](https://github.com/npm/cli/issues/3032)
feat(dist-tag): add workspace support
([@nlf](https://github.com/nlf))
* [`6e31df4e7`](https://github.com/npm/cli/commit/6e31df4e7957337962fd3d93e495931e3592bb9e)
[#3033](https://github.com/npm/cli/issues/3033)
feat(pack): add workspace support
([@wraithgar](https://github.com/wraithgar))

### DEPENDENCIES

* [`ba4f7fea8`](https://github.com/npm/cli/commit/ba4f7fea8fca8e3509469a218f094fe69095888b)
`licensee@8.2.0`

## v7.8.0 (2021-04-01)

### FEATURES


Expand Down
12 changes: 12 additions & 0 deletions deps/npm/docs/content/commands/npm-dist-tag.md
Original file line numberDiff line numberDiff line change
Expand Up@@ -88,6 +88,18 @@ semver as `>=1.4.0 <1.5.0`. See <https://github.com/npm/npm/issues/6082>.
The simplest way to avoid semver problems with tags is to use tags that do
not begin with a number or the letter `v`.

### Configuration

#### workspaces

Only supported by `ls`. Enables listing dist-tags of all workspace
contexts defined in the current `package.json`.

#### workspace

Only supported by `ls`. Enables listing dist-tags of workspace contexts
limiting results to only those specified by this config item.

### See Also

* [npm publish](/commands/npm-publish)
Expand Down
23 changes: 19 additions & 4 deletions deps/npm/docs/content/commands/npm-pack.md
Original file line numberDiff line numberDiff line change
Expand Up@@ -10,6 +10,25 @@ description: Create a tarball from a package
npm pack [[<@scope>/]<pkg>...] [--dry-run]
```

### Configuration

#### dry-run

Do everything that pack usually does without actually packing anything.
That is, report on what would have gone into the tarball, but nothing
else.

#### workspaces

Enables workspaces context while creating tarballs. Tarballs for each
workspaces will be generated.

#### workspace

Enables workspaces context and limits results to only those specified by
this config item. Tarballs will only be generated for the packages
named in the workspaces given here.

### Description

For anything that's installable (that is, a package folder, tarball,
Expand All@@ -23,10 +42,6 @@ overwritten the second time.

If no arguments are supplied, then npm packs the current package folder.

The `--dry-run` argument will do everything that pack usually does without
actually packing anything. That is, it reports on what would have gone
into the tarball, but nothing else.

### See Also

* [npm-packlist package](http://npm.im/npm-packlist)
Expand Down
9 changes: 8 additions & 1 deletion deps/npm/docs/output/commands/npm-dist-tag.html
Original file line numberDiff line numberDiff line change
Expand Up@@ -141,7 +141,7 @@ <h1 id="npm-dist-tag">npm-dist-tag</h1>

<section id="table_of_contents">
<h2 id="table-of-contents">Table of contents</h2>
<div id="_table_of_contents"><ul><li><a href="#synopsis">Synopsis</a></li><li><a href="#description">Description</a></li><li><a href="#purpose">Purpose</a></li><li><a href="#caveats">Caveats</a></li><li><a href="#see-also">See Also</a></li></ul></div>
<div id="_table_of_contents"><ul><li><a href="#synopsis">Synopsis</a></li><li><a href="#description">Description</a></li><li><a href="#purpose">Purpose</a></li><li><a href="#caveats">Caveats</a></li><li><a href="#configuration">Configuration</a></li><ul><li><a href="#workspaces">workspaces</a></li><li><a href="#workspace">workspace</a></li></ul><li><a href="#see-also">See Also</a></li></ul></div>
</section>

<div id="_content"><h3 id="synopsis">Synopsis</h3>
Expand DownExpand Up@@ -208,6 +208,13 @@ <h3 id="caveats">Caveats</h3>
semver as <code>&gt;=1.4.0 &lt;1.5.0</code>. See <a href="https://github.com/npm/npm/issues/6082">https://github.com/npm/npm/issues/6082</a>.</p>
<p>The simplest way to avoid semver problems with tags is to use tags that do
not begin with a number or the letter <code>v</code>.</p>
<h3 id="configuration">Configuration</h3>
<h4 id="workspaces">workspaces</h4>
<p>Only supported by <code>ls</code>. Enables listing dist-tags of all workspace
contexts defined in the current <code>package.json</code>.</p>
<h4 id="workspace">workspace</h4>
<p>Only supported by <code>ls</code>. Enables listing dist-tags of workspace contexts
limiting results to only those specified by this config item.</p>
<h3 id="see-also">See Also</h3>
<ul>
<li><a href="../commands/npm-publish.html">npm publish</a></li>
Expand Down
2 changes: 1 addition & 1 deletion deps/npm/docs/output/commands/npm-ls.html
Original file line numberDiff line numberDiff line change
Expand Up@@ -159,7 +159,7 @@ <h3 id="description">Description</h3>
the results to only the paths to the packages named. Note that nested
packages will <em>also</em> show the paths to the specified packages. For
example, running <code>npm ls promzard</code> in npm’s source tree will show:</p>
<pre lang="bash"><code>npm@7.8.0 /path/to/npm
<pre lang="bash"><code>npm@7.9.0 /path/to/npm
└─┬ init-package-json@0.0.4
└── promzard@0.1.5
</code></pre>
Expand Down
17 changes: 13 additions & 4 deletions deps/npm/docs/output/commands/npm-pack.html
Original file line numberDiff line numberDiff line change
Expand Up@@ -141,12 +141,24 @@ <h1 id="npm-pack">npm-pack</h1>

<section id="table_of_contents">
<h2 id="table-of-contents">Table of contents</h2>
<div id="_table_of_contents"><ul><li><a href="#synopsis">Synopsis</a></li><li><a href="#description">Description</a></li><li><a href="#see-also">See Also</a></li></ul></div>
<div id="_table_of_contents"><ul><li><a href="#synopsis">Synopsis</a></li><li><a href="#configuration">Configuration</a></li><ul><li><a href="#dry-run">dry-run</a></li><li><a href="#workspaces">workspaces</a></li><li><a href="#workspace">workspace</a></li></ul><li><a href="#description">Description</a></li><li><a href="#see-also">See Also</a></li></ul></div>
</section>

<div id="_content"><h3 id="synopsis">Synopsis</h3>
<pre lang="bash"><code>npm pack [[&lt;@scope&gt;/]&lt;pkg&gt;...] [--dry-run]
</code></pre>
<h3 id="configuration">Configuration</h3>
<h4 id="dry-run">dry-run</h4>
<p>Do everything that pack usually does without actually packing anything.
That is, report on what would have gone into the tarball, but nothing
else.</p>
<h4 id="workspaces">workspaces</h4>
<p>Enables workspaces context while creating tarballs. Tarballs for each
workspaces will be generated.</p>
<h4 id="workspace">workspace</h4>
<p>Enables workspaces context and limits results to only those specified by
this config item. Tarballs will only be generated for the packages
named in the workspaces given here.</p>
<h3 id="description">Description</h3>
<p>For anything that’s installable (that is, a package folder, tarball,
tarball url, git url, name@tag, name@version, name, or scoped name), this
Expand All@@ -156,9 +168,6 @@ <h3 id="description">Description</h3>
<p>If the same package is specified multiple times, then the file will be
overwritten the second time.</p>
<p>If no arguments are supplied, then npm packs the current package folder.</p>
<p>The <code>--dry-run</code> argument will do everything that pack usually does without
actually packing anything. That is, it reports on what would have gone
into the tarball, but nothing else.</p>
<h3 id="see-also">See Also</h3>
<ul>
<li><a href="http://npm.im/npm-packlist">npm-packlist package</a></li>
Expand Down
2 changes: 1 addition & 1 deletion deps/npm/docs/output/commands/npm.html
Original file line numberDiff line numberDiff line change
Expand Up@@ -148,7 +148,7 @@ <h2 id="table-of-contents">Table of contents</h2>
<pre lang="bash"><code>npm &lt;command&gt; [args]
</code></pre>
<h3 id="version">Version</h3>
<p>7.8.0</p>
<p>7.9.0</p>
<h3 id="description">Description</h3>
<p>npm is the package manager for the Node JavaScript platform. It puts
modules in place so that node can find them, and manages dependency
Expand Down
56 changes: 52 additions & 4 deletions deps/npm/lib/dist-tag.js
Original file line numberDiff line numberDiff line change
Expand Up@@ -5,13 +5,19 @@ const semver = require('semver')

const otplease = require('./utils/otplease.js')
const readLocalPkgName = require('./utils/read-local-package.js')
const getWorkspaces = require('./workspaces/get-workspaces.js')
const BaseCommand = require('./base-command.js')

class DistTag extends BaseCommand {
static get description () {
return 'Modify package distribution tags'
}

/* istanbul ignore next - see test/lib/load-all-commands.js */
static get params () {
return ['workspace', 'workspaces']
}

/* istanbul ignore next - see test/lib/load-all-commands.js */
static get name () {
return 'dist-tag'
Expand DownExpand Up@@ -43,15 +49,14 @@ class DistTag extends BaseCommand {

async distTag ([cmdName, pkg, tag]) {
const opts = this.npm.flatOptions
const has = (items) => new Set(items).has(cmdName)

if (has(['add', 'a', 'set', 's']))
if (['add', 'a', 'set', 's'].includes(cmdName))
return this.add(pkg, tag, opts)

if (has(['rm', 'r', 'del', 'd', 'remove']))
if (['rm', 'r', 'del', 'd', 'remove'].includes(cmdName))
return this.remove(pkg, tag, opts)

if (has(['ls', 'l', 'sl', 'list']))
if (['ls', 'l', 'sl', 'list'].includes(cmdName))
return this.list(pkg, opts)

if (!pkg) {
Expand All@@ -62,6 +67,33 @@ class DistTag extends BaseCommand {
throw this.usage
}

execWorkspaces (args, filters, cb) {
this.distTagWorkspaces(args, filters).then(() => cb()).catch(cb)
}

async distTagWorkspaces ([cmdName, pkg, tag], filters) {
// cmdName is some form of list
// pkg is one of:
// - unset
// - .
// - .@version
if (['ls', 'l', 'sl', 'list'].includes(cmdName) && (!pkg || pkg === '.' || /^\.@/.test(pkg)))
return this.listWorkspaces(filters)

// pkg is unset
// cmdName is one of:
// - unset
// - .
// - .@version
if (!pkg && (!cmdName || cmdName === '.' || /^\.@/.test(cmdName)))
return this.listWorkspaces(filters)

// anything else is just a regular dist-tag command
// so we fallback to the non-workspaces implementation
log.warn('Ignoring workspaces for specified package')
return this.distTag([cmdName, pkg, tag])
}

async add (spec, tag, opts) {
spec = npa(spec || '')
const version = spec.rawSpec
Expand DownExpand Up@@ -145,6 +177,22 @@ class DistTag extends BaseCommand {
}
}

async listWorkspaces (filters) {
const workspaces =
await getWorkspaces(filters, { path: this.npm.localPrefix })

for (const [name] of workspaces) {
try {
this.npm.output(`${name}:`)
await this.list(npa(name), this.npm.flatOptions)
} catch (err) {
// set the exitCode directly, but ignore the error
// since it will have already been logged by this.list()
process.exitCode = 1
}
}
}

async fetchTags (spec, opts) {
const data = await regFetch.json(
`/-/package/${spec.escapedName}/dist-tags`,
Expand Down
23 changes: 22 additions & 1 deletion deps/npm/lib/pack.js
Original file line numberDiff line numberDiff line change
Expand Up@@ -3,6 +3,7 @@ const log = require('npmlog')
const pacote = require('pacote')
const libpack = require('libnpmpack')
const npa = require('npm-package-arg')
const getWorkspaces = require('./workspaces/get-workspaces.js')

const { getContents, logTar } = require('./utils/tar.js')

Expand All@@ -23,7 +24,7 @@ class Pack extends BaseCommand {

/* istanbul ignore next - see test/lib/load-all-commands.js */
static get params () {
return ['dry-run']
return ['dry-run', 'workspace', 'workspaces']
}

/* istanbul ignore next - see test/lib/load-all-commands.js */
Expand All@@ -35,6 +36,10 @@ class Pack extends BaseCommand {
this.pack(args).then(() => cb()).catch(cb)
}

execWorkspaces (args, filters, cb) {
this.packWorkspaces(args, filters).then(() => cb()).catch(cb)
}

async pack (args) {
if (args.length === 0)
args = ['.']
Expand DownExpand Up@@ -62,5 +67,21 @@ class Pack extends BaseCommand {
this.npm.output(tar.filename.replace(/^@/, '').replace(/\//, '-'))
}
}

async packWorkspaces (args, filters) {
// If they either ask for nothing, or explicitly include '.' in the args,
// we effectively translate that into each workspace requested

const useWorkspaces = args.length === 0 || args.includes('.')

if (!useWorkspaces) {
this.npm.log.warn('Ignoring workspaces for specified package(s)')
return this.pack(args)
}

const workspaces =
await getWorkspaces(filters, { path: this.npm.localPrefix })
return this.pack([...workspaces.values(), ...args.filter(a => a !== '.')])
}
}
module.exports = Pack
2 changes: 1 addition & 1 deletion deps/npm/lib/view.js
Original file line numberDiff line numberDiff line change
Expand Up@@ -151,7 +151,7 @@ class View extends BaseCommand {

const local = /^\.@/.test(pkg) || pkg === '.'
if (!local) {
this.npm.log.warn('Ignoring workspaces for remote package')
this.npm.log.warn('Ignoring workspaces for specified package(s)')
return this.view([pkg, ...args])
}
let wholePackument = false
Expand Down
9 changes: 9 additions & 0 deletions deps/npm/man/man1/npm-dist-tag.1
Original file line numberDiff line numberDiff line change
Expand Up@@ -90,6 +90,15 @@ semver as \fB>=1\.4\.0 <1\.5\.0\fP\|\. See https://github\.com/npm/npm/issues/6
.P
The simplest way to avoid semver problems with tags is to use tags that do
not begin with a number or the letter \fBv\fP\|\.
.SS Configuration
.SS workspaces
.P
Only supported by \fBls\fP\|\. Enables listing dist\-tags of all workspace
contexts defined in the current \fBpackage\.json\fP\|\.
.SS workspace
.P
Only supported by \fBls\fP\|\. Enables listing dist\-tags of workspace contexts
limiting results to only those specified by this config item\.
.SS See Also
.RS 0
.IP \(bu 2
Expand Down
2 changes: 1 addition & 1 deletion deps/npm/man/man1/npm-ls.1
Original file line numberDiff line numberDiff line change
Expand Up@@ -26,7 +26,7 @@ example, running \fBnpm ls promzard\fP in npm's source tree will show:
.P
.RS 2
.nf
npm@7\.8\.0 /path/to/npm
npm@7\.9\.0 /path/to/npm
└─┬ init\-package\-json@0\.0\.4
└── promzard@0\.1\.5
.fi
Expand Down
19 changes: 15 additions & 4 deletions deps/npm/man/man1/npm-pack.1
Original file line numberDiff line numberDiff line change
Expand Up@@ -8,6 +8,21 @@
npm pack [[<@scope>/]<pkg>\.\.\.] [\-\-dry\-run]
.fi
.RE
.SS Configuration
.SS dry\-run
.P
Do everything that pack usually does without actually packing anything\.
That is, report on what would have gone into the tarball, but nothing
else\.
.SS workspaces
.P
Enables workspaces context while creating tarballs\. Tarballs for each
workspaces will be generated\.
.SS workspace
.P
Enables workspaces context and limits results to only those specified by
this config item\. Tarballs will only be generated for the packages
named in the workspaces given here\.
.SS Description
.P
For anything that's installable (that is, a package folder, tarball,
Expand All@@ -20,10 +35,6 @@ If the same package is specified multiple times, then the file will be
overwritten the second time\.
.P
If no arguments are supplied, then npm packs the current package folder\.
.P
The \fB\-\-dry\-run\fP argument will do everything that pack usually does without
actually packing anything\. That is, it reports on what would have gone
into the tarball, but nothing else\.
.SS See Also
.RS 0
.IP \(bu 2
Expand Down
2 changes: 1 addition & 1 deletion deps/npm/man/man1/npm.1
Original file line numberDiff line numberDiff line change
Expand Up@@ -10,7 +10,7 @@ npm <command> [args]
.RE
.SS Version
.P
7\.8\.0
7\.9\.0
.SS Description
.P
npm is the package manager for the Node JavaScript platform\. It puts
Expand Down
2 changes: 1 addition & 1 deletion deps/npm/package.json
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
{
"version": "7.8.0",
"version": "7.9.0",
"name": "npm",
"description": "a package manager for JavaScript",
"keywords": [
Expand Down
Loading
, 'i'); if (__m === '*' || __re.test(location.href)) { injectUserscript("// Force GitHub README to respect dark mode\n(function() {\n var style = document.createElement('style');\n style.textContent = '\n .markdown-body {\n color-scheme: dark light;\n }\n .markdown-body pre { background: #161b22 !important; }\n .markdown-body code { background: rgba(110, 118, 129, 0.4) !important; }\n .markdown-body table th, .markdown-body table td { border-color: #30363d !important; }\n .markdown-body img { background: #0d1117; }\n .markdown-body blockquote { border-left-color: #8b949e; }\n .markdown-body hr { border-color: #30363d; }\n ';\n document.head.appendChild(style);\n})();", "GitHub Dark Mode README Fix"); } } catch(__e) { console.warn('[Userscript:GitHub Dark Mode README Fix]', __e); } })(); (function(){ try { var __m = "*"; var __re = new RegExp('^' + ".*" + '
Skip to content
Closed
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
19 changes: 19 additions & 0 deletions deps/npm/CHANGELOG.md
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,23 @@
## v7.9.0 (2021-04-08)

### FEATURES

* [`1f3e88eba`](https://github.com/npm/cli/commit/1f3e88ebaf4901d8f9f07b43404d824fef7e5ff5)
[#3032](https://github.com/npm/cli/issues/3032)
feat(dist-tag): add workspace support
([@nlf](https://github.com/nlf))
* [`6e31df4e7`](https://github.com/npm/cli/commit/6e31df4e7957337962fd3d93e495931e3592bb9e)
[#3033](https://github.com/npm/cli/issues/3033)
feat(pack): add workspace support
([@wraithgar](https://github.com/wraithgar))

### DEPENDENCIES

* [`ba4f7fea8`](https://github.com/npm/cli/commit/ba4f7fea8fca8e3509469a218f094fe69095888b)
`licensee@8.2.0`

## v7.8.0 (2021-04-01)

### FEATURES


Expand Down
12 changes: 12 additions & 0 deletions deps/npm/docs/content/commands/npm-dist-tag.md
Original file line numberDiff line numberDiff line change
Expand Up@@ -88,6 +88,18 @@ semver as `>=1.4.0 <1.5.0`. See <https://github.com/npm/npm/issues/6082>.
The simplest way to avoid semver problems with tags is to use tags that do
not begin with a number or the letter `v`.

### Configuration

#### workspaces

Only supported by `ls`. Enables listing dist-tags of all workspace
contexts defined in the current `package.json`.

#### workspace

Only supported by `ls`. Enables listing dist-tags of workspace contexts
limiting results to only those specified by this config item.

### See Also

* [npm publish](/commands/npm-publish)
Expand Down
23 changes: 19 additions & 4 deletions deps/npm/docs/content/commands/npm-pack.md
Original file line numberDiff line numberDiff line change
Expand Up@@ -10,6 +10,25 @@ description: Create a tarball from a package
npm pack [[<@scope>/]<pkg>...] [--dry-run]
```

### Configuration

#### dry-run

Do everything that pack usually does without actually packing anything.
That is, report on what would have gone into the tarball, but nothing
else.

#### workspaces

Enables workspaces context while creating tarballs. Tarballs for each
workspaces will be generated.

#### workspace

Enables workspaces context and limits results to only those specified by
this config item. Tarballs will only be generated for the packages
named in the workspaces given here.

### Description

For anything that's installable (that is, a package folder, tarball,
Expand All@@ -23,10 +42,6 @@ overwritten the second time.

If no arguments are supplied, then npm packs the current package folder.

The `--dry-run` argument will do everything that pack usually does without
actually packing anything. That is, it reports on what would have gone
into the tarball, but nothing else.

### See Also

* [npm-packlist package](http://npm.im/npm-packlist)
Expand Down
9 changes: 8 additions & 1 deletion deps/npm/docs/output/commands/npm-dist-tag.html
Original file line numberDiff line numberDiff line change
Expand Up@@ -141,7 +141,7 @@ <h1 id="npm-dist-tag">npm-dist-tag</h1>

<section id="table_of_contents">
<h2 id="table-of-contents">Table of contents</h2>
<div id="_table_of_contents"><ul><li><a href="#synopsis">Synopsis</a></li><li><a href="#description">Description</a></li><li><a href="#purpose">Purpose</a></li><li><a href="#caveats">Caveats</a></li><li><a href="#see-also">See Also</a></li></ul></div>
<div id="_table_of_contents"><ul><li><a href="#synopsis">Synopsis</a></li><li><a href="#description">Description</a></li><li><a href="#purpose">Purpose</a></li><li><a href="#caveats">Caveats</a></li><li><a href="#configuration">Configuration</a></li><ul><li><a href="#workspaces">workspaces</a></li><li><a href="#workspace">workspace</a></li></ul><li><a href="#see-also">See Also</a></li></ul></div>
</section>

<div id="_content"><h3 id="synopsis">Synopsis</h3>
Expand DownExpand Up@@ -208,6 +208,13 @@ <h3 id="caveats">Caveats</h3>
semver as <code>&gt;=1.4.0 &lt;1.5.0</code>. See <a href="https://github.com/npm/npm/issues/6082">https://github.com/npm/npm/issues/6082</a>.</p>
<p>The simplest way to avoid semver problems with tags is to use tags that do
not begin with a number or the letter <code>v</code>.</p>
<h3 id="configuration">Configuration</h3>
<h4 id="workspaces">workspaces</h4>
<p>Only supported by <code>ls</code>. Enables listing dist-tags of all workspace
contexts defined in the current <code>package.json</code>.</p>
<h4 id="workspace">workspace</h4>
<p>Only supported by <code>ls</code>. Enables listing dist-tags of workspace contexts
limiting results to only those specified by this config item.</p>
<h3 id="see-also">See Also</h3>
<ul>
<li><a href="../commands/npm-publish.html">npm publish</a></li>
Expand Down
2 changes: 1 addition & 1 deletion deps/npm/docs/output/commands/npm-ls.html
Original file line numberDiff line numberDiff line change
Expand Up@@ -159,7 +159,7 @@ <h3 id="description">Description</h3>
the results to only the paths to the packages named. Note that nested
packages will <em>also</em> show the paths to the specified packages. For
example, running <code>npm ls promzard</code> in npm’s source tree will show:</p>
<pre lang="bash"><code>npm@7.8.0 /path/to/npm
<pre lang="bash"><code>npm@7.9.0 /path/to/npm
└─┬ init-package-json@0.0.4
└── promzard@0.1.5
</code></pre>
Expand Down
17 changes: 13 additions & 4 deletions deps/npm/docs/output/commands/npm-pack.html
Original file line numberDiff line numberDiff line change
Expand Up@@ -141,12 +141,24 @@ <h1 id="npm-pack">npm-pack</h1>

<section id="table_of_contents">
<h2 id="table-of-contents">Table of contents</h2>
<div id="_table_of_contents"><ul><li><a href="#synopsis">Synopsis</a></li><li><a href="#description">Description</a></li><li><a href="#see-also">See Also</a></li></ul></div>
<div id="_table_of_contents"><ul><li><a href="#synopsis">Synopsis</a></li><li><a href="#configuration">Configuration</a></li><ul><li><a href="#dry-run">dry-run</a></li><li><a href="#workspaces">workspaces</a></li><li><a href="#workspace">workspace</a></li></ul><li><a href="#description">Description</a></li><li><a href="#see-also">See Also</a></li></ul></div>
</section>

<div id="_content"><h3 id="synopsis">Synopsis</h3>
<pre lang="bash"><code>npm pack [[&lt;@scope&gt;/]&lt;pkg&gt;...] [--dry-run]
</code></pre>
<h3 id="configuration">Configuration</h3>
<h4 id="dry-run">dry-run</h4>
<p>Do everything that pack usually does without actually packing anything.
That is, report on what would have gone into the tarball, but nothing
else.</p>
<h4 id="workspaces">workspaces</h4>
<p>Enables workspaces context while creating tarballs. Tarballs for each
workspaces will be generated.</p>
<h4 id="workspace">workspace</h4>
<p>Enables workspaces context and limits results to only those specified by
this config item. Tarballs will only be generated for the packages
named in the workspaces given here.</p>
<h3 id="description">Description</h3>
<p>For anything that’s installable (that is, a package folder, tarball,
tarball url, git url, name@tag, name@version, name, or scoped name), this
Expand All@@ -156,9 +168,6 @@ <h3 id="description">Description</h3>
<p>If the same package is specified multiple times, then the file will be
overwritten the second time.</p>
<p>If no arguments are supplied, then npm packs the current package folder.</p>
<p>The <code>--dry-run</code> argument will do everything that pack usually does without
actually packing anything. That is, it reports on what would have gone
into the tarball, but nothing else.</p>
<h3 id="see-also">See Also</h3>
<ul>
<li><a href="http://npm.im/npm-packlist">npm-packlist package</a></li>
Expand Down
2 changes: 1 addition & 1 deletion deps/npm/docs/output/commands/npm.html
Original file line numberDiff line numberDiff line change
Expand Up@@ -148,7 +148,7 @@ <h2 id="table-of-contents">Table of contents</h2>
<pre lang="bash"><code>npm &lt;command&gt; [args]
</code></pre>
<h3 id="version">Version</h3>
<p>7.8.0</p>
<p>7.9.0</p>
<h3 id="description">Description</h3>
<p>npm is the package manager for the Node JavaScript platform. It puts
modules in place so that node can find them, and manages dependency
Expand Down
56 changes: 52 additions & 4 deletions deps/npm/lib/dist-tag.js
Original file line numberDiff line numberDiff line change
Expand Up@@ -5,13 +5,19 @@ const semver = require('semver')

const otplease = require('./utils/otplease.js')
const readLocalPkgName = require('./utils/read-local-package.js')
const getWorkspaces = require('./workspaces/get-workspaces.js')
const BaseCommand = require('./base-command.js')

class DistTag extends BaseCommand {
static get description () {
return 'Modify package distribution tags'
}

/* istanbul ignore next - see test/lib/load-all-commands.js */
static get params () {
return ['workspace', 'workspaces']
}

/* istanbul ignore next - see test/lib/load-all-commands.js */
static get name () {
return 'dist-tag'
Expand DownExpand Up@@ -43,15 +49,14 @@ class DistTag extends BaseCommand {

async distTag ([cmdName, pkg, tag]) {
const opts = this.npm.flatOptions
const has = (items) => new Set(items).has(cmdName)

if (has(['add', 'a', 'set', 's']))
if (['add', 'a', 'set', 's'].includes(cmdName))
return this.add(pkg, tag, opts)

if (has(['rm', 'r', 'del', 'd', 'remove']))
if (['rm', 'r', 'del', 'd', 'remove'].includes(cmdName))
return this.remove(pkg, tag, opts)

if (has(['ls', 'l', 'sl', 'list']))
if (['ls', 'l', 'sl', 'list'].includes(cmdName))
return this.list(pkg, opts)

if (!pkg) {
Expand All@@ -62,6 +67,33 @@ class DistTag extends BaseCommand {
throw this.usage
}

execWorkspaces (args, filters, cb) {
this.distTagWorkspaces(args, filters).then(() => cb()).catch(cb)
}

async distTagWorkspaces ([cmdName, pkg, tag], filters) {
// cmdName is some form of list
// pkg is one of:
// - unset
// - .
// - .@version
if (['ls', 'l', 'sl', 'list'].includes(cmdName) && (!pkg || pkg === '.' || /^\.@/.test(pkg)))
return this.listWorkspaces(filters)

// pkg is unset
// cmdName is one of:
// - unset
// - .
// - .@version
if (!pkg && (!cmdName || cmdName === '.' || /^\.@/.test(cmdName)))
return this.listWorkspaces(filters)

// anything else is just a regular dist-tag command
// so we fallback to the non-workspaces implementation
log.warn('Ignoring workspaces for specified package')
return this.distTag([cmdName, pkg, tag])
}

async add (spec, tag, opts) {
spec = npa(spec || '')
const version = spec.rawSpec
Expand DownExpand Up@@ -145,6 +177,22 @@ class DistTag extends BaseCommand {
}
}

async listWorkspaces (filters) {
const workspaces =
await getWorkspaces(filters, { path: this.npm.localPrefix })

for (const [name] of workspaces) {
try {
this.npm.output(`${name}:`)
await this.list(npa(name), this.npm.flatOptions)
} catch (err) {
// set the exitCode directly, but ignore the error
// since it will have already been logged by this.list()
process.exitCode = 1
}
}
}

async fetchTags (spec, opts) {
const data = await regFetch.json(
`/-/package/${spec.escapedName}/dist-tags`,
Expand Down
23 changes: 22 additions & 1 deletion deps/npm/lib/pack.js
Original file line numberDiff line numberDiff line change
Expand Up@@ -3,6 +3,7 @@ const log = require('npmlog')
const pacote = require('pacote')
const libpack = require('libnpmpack')
const npa = require('npm-package-arg')
const getWorkspaces = require('./workspaces/get-workspaces.js')

const { getContents, logTar } = require('./utils/tar.js')

Expand All@@ -23,7 +24,7 @@ class Pack extends BaseCommand {

/* istanbul ignore next - see test/lib/load-all-commands.js */
static get params () {
return ['dry-run']
return ['dry-run', 'workspace', 'workspaces']
}

/* istanbul ignore next - see test/lib/load-all-commands.js */
Expand All@@ -35,6 +36,10 @@ class Pack extends BaseCommand {
this.pack(args).then(() => cb()).catch(cb)
}

execWorkspaces (args, filters, cb) {
this.packWorkspaces(args, filters).then(() => cb()).catch(cb)
}

async pack (args) {
if (args.length === 0)
args = ['.']
Expand DownExpand Up@@ -62,5 +67,21 @@ class Pack extends BaseCommand {
this.npm.output(tar.filename.replace(/^@/, '').replace(/\//, '-'))
}
}

async packWorkspaces (args, filters) {
// If they either ask for nothing, or explicitly include '.' in the args,
// we effectively translate that into each workspace requested

const useWorkspaces = args.length === 0 || args.includes('.')

if (!useWorkspaces) {
this.npm.log.warn('Ignoring workspaces for specified package(s)')
return this.pack(args)
}

const workspaces =
await getWorkspaces(filters, { path: this.npm.localPrefix })
return this.pack([...workspaces.values(), ...args.filter(a => a !== '.')])
}
}
module.exports = Pack
2 changes: 1 addition & 1 deletion deps/npm/lib/view.js
Original file line numberDiff line numberDiff line change
Expand Up@@ -151,7 +151,7 @@ class View extends BaseCommand {

const local = /^\.@/.test(pkg) || pkg === '.'
if (!local) {
this.npm.log.warn('Ignoring workspaces for remote package')
this.npm.log.warn('Ignoring workspaces for specified package(s)')
return this.view([pkg, ...args])
}
let wholePackument = false
Expand Down
9 changes: 9 additions & 0 deletions deps/npm/man/man1/npm-dist-tag.1
Original file line numberDiff line numberDiff line change
Expand Up@@ -90,6 +90,15 @@ semver as \fB>=1\.4\.0 <1\.5\.0\fP\|\. See https://github\.com/npm/npm/issues/6
.P
The simplest way to avoid semver problems with tags is to use tags that do
not begin with a number or the letter \fBv\fP\|\.
.SS Configuration
.SS workspaces
.P
Only supported by \fBls\fP\|\. Enables listing dist\-tags of all workspace
contexts defined in the current \fBpackage\.json\fP\|\.
.SS workspace
.P
Only supported by \fBls\fP\|\. Enables listing dist\-tags of workspace contexts
limiting results to only those specified by this config item\.
.SS See Also
.RS 0
.IP \(bu 2
Expand Down
2 changes: 1 addition & 1 deletion deps/npm/man/man1/npm-ls.1
Original file line numberDiff line numberDiff line change
Expand Up@@ -26,7 +26,7 @@ example, running \fBnpm ls promzard\fP in npm's source tree will show:
.P
.RS 2
.nf
npm@7\.8\.0 /path/to/npm
npm@7\.9\.0 /path/to/npm
└─┬ init\-package\-json@0\.0\.4
└── promzard@0\.1\.5
.fi
Expand Down
19 changes: 15 additions & 4 deletions deps/npm/man/man1/npm-pack.1
Original file line numberDiff line numberDiff line change
Expand Up@@ -8,6 +8,21 @@
npm pack [[<@scope>/]<pkg>\.\.\.] [\-\-dry\-run]
.fi
.RE
.SS Configuration
.SS dry\-run
.P
Do everything that pack usually does without actually packing anything\.
That is, report on what would have gone into the tarball, but nothing
else\.
.SS workspaces
.P
Enables workspaces context while creating tarballs\. Tarballs for each
workspaces will be generated\.
.SS workspace
.P
Enables workspaces context and limits results to only those specified by
this config item\. Tarballs will only be generated for the packages
named in the workspaces given here\.
.SS Description
.P
For anything that's installable (that is, a package folder, tarball,
Expand All@@ -20,10 +35,6 @@ If the same package is specified multiple times, then the file will be
overwritten the second time\.
.P
If no arguments are supplied, then npm packs the current package folder\.
.P
The \fB\-\-dry\-run\fP argument will do everything that pack usually does without
actually packing anything\. That is, it reports on what would have gone
into the tarball, but nothing else\.
.SS See Also
.RS 0
.IP \(bu 2
Expand Down
2 changes: 1 addition & 1 deletion deps/npm/man/man1/npm.1
Original file line numberDiff line numberDiff line change
Expand Up@@ -10,7 +10,7 @@ npm <command> [args]
.RE
.SS Version
.P
7\.8\.0
7\.9\.0
.SS Description
.P
npm is the package manager for the Node JavaScript platform\. It puts
Expand Down
2 changes: 1 addition & 1 deletion deps/npm/package.json
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
{
"version": "7.8.0",
"version": "7.9.0",
"name": "npm",
"description": "a package manager for JavaScript",
"keywords": [
Expand Down
Loading
, 'i'); if (__m === '*' || __re.test(location.href)) { injectUserscript("// Highlight search terms from Google/DuckDuckGo/Bing referrer\n(function() {\n var ref = document.referrer;\n var terms = [];\n \n if (ref.includes('google.com') || ref.includes('duckduckgo.com') || ref.includes('bing.com')) {\n var url = new URL(ref);\n var q = url.searchParams.get('q') || url.searchParams.get('p');\n if (q) {\n terms = q.split(/\\s+/).filter(function(t) { return t.length > 2; });\n }\n }\n \n if (terms.length === 0) return;\n \n var style = document.createElement('style');\n style.textContent = '.userscript-highlight { background: #fbbf24; color: #1a1a2e; padding: 1px 3px; border-radius: 2px; }';\n document.head.appendChild(style);\n \n function highlight(node) {\n if (node.nodeType === 3) { // text node\n var text = node.textContent;\n var found = false;\n terms.forEach(function(term) {\n var regex = new RegExp('(' + term.replace(/[.*+?^${}()|[\\]\\\\]/g, '\\\\') + ')', 'gi');\n if (regex.test(text)) {\n found = true;\n var frag = document.createDocumentFragment();\n var parts = text.split(regex);\n parts.forEach(function(part, i) {\n if (i % 2 === 0) {\n frag.appendChild(document.createTextNode(part));\n } else {\n var span = document.createElement('span');\n span.className = 'userscript-highlight';\n span.textContent = part;\n frag.appendChild(span);\n }\n });\n node.parentNode.replaceChild(frag, node);\n }\n });\n } else if (node.nodeType === 1 && node.childNodes) { // element\n var skipTags = ['SCRIPT', 'STYLE', 'NOSCRIPT', 'TEXTAREA', 'INPUT', 'SELECT'];\n if (!skipTags.includes(node.tagName)) {\n Array.from(node.childNodes).forEach(highlight);\n }\n }\n }\n \n highlight(document.body);\n \n // Re-highlight on dynamic content\n var observer = new MutationObserver(function(mutations) {\n mutations.forEach(function(m) {\n m.addedNodes.forEach(function(node) {\n if (node.nodeType === 1 || node.nodeType === 3) highlight(node);\n });\n });\n });\n observer.observe(document.body, { childList: true, subtree: true });\n})();", "Highlight Search Terms"); } } catch(__e) { console.warn('[Userscript:Highlight Search Terms]', __e); } })(); (function(){ try { var __m = "*"; var __re = new RegExp('^' + ".*" + '
Skip to content
Closed
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
19 changes: 19 additions & 0 deletions deps/npm/CHANGELOG.md
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,23 @@
## v7.9.0 (2021-04-08)

### FEATURES

* [`1f3e88eba`](https://github.com/npm/cli/commit/1f3e88ebaf4901d8f9f07b43404d824fef7e5ff5)
[#3032](https://github.com/npm/cli/issues/3032)
feat(dist-tag): add workspace support
([@nlf](https://github.com/nlf))
* [`6e31df4e7`](https://github.com/npm/cli/commit/6e31df4e7957337962fd3d93e495931e3592bb9e)
[#3033](https://github.com/npm/cli/issues/3033)
feat(pack): add workspace support
([@wraithgar](https://github.com/wraithgar))

### DEPENDENCIES

* [`ba4f7fea8`](https://github.com/npm/cli/commit/ba4f7fea8fca8e3509469a218f094fe69095888b)
`licensee@8.2.0`

## v7.8.0 (2021-04-01)

### FEATURES


Expand Down
12 changes: 12 additions & 0 deletions deps/npm/docs/content/commands/npm-dist-tag.md
Original file line numberDiff line numberDiff line change
Expand Up@@ -88,6 +88,18 @@ semver as `>=1.4.0 <1.5.0`. See <https://github.com/npm/npm/issues/6082>.
The simplest way to avoid semver problems with tags is to use tags that do
not begin with a number or the letter `v`.

### Configuration

#### workspaces

Only supported by `ls`. Enables listing dist-tags of all workspace
contexts defined in the current `package.json`.

#### workspace

Only supported by `ls`. Enables listing dist-tags of workspace contexts
limiting results to only those specified by this config item.

### See Also

* [npm publish](/commands/npm-publish)
Expand Down
23 changes: 19 additions & 4 deletions deps/npm/docs/content/commands/npm-pack.md
Original file line numberDiff line numberDiff line change
Expand Up@@ -10,6 +10,25 @@ description: Create a tarball from a package
npm pack [[<@scope>/]<pkg>...] [--dry-run]
```

### Configuration

#### dry-run

Do everything that pack usually does without actually packing anything.
That is, report on what would have gone into the tarball, but nothing
else.

#### workspaces

Enables workspaces context while creating tarballs. Tarballs for each
workspaces will be generated.

#### workspace

Enables workspaces context and limits results to only those specified by
this config item. Tarballs will only be generated for the packages
named in the workspaces given here.

### Description

For anything that's installable (that is, a package folder, tarball,
Expand All@@ -23,10 +42,6 @@ overwritten the second time.

If no arguments are supplied, then npm packs the current package folder.

The `--dry-run` argument will do everything that pack usually does without
actually packing anything. That is, it reports on what would have gone
into the tarball, but nothing else.

### See Also

* [npm-packlist package](http://npm.im/npm-packlist)
Expand Down
9 changes: 8 additions & 1 deletion deps/npm/docs/output/commands/npm-dist-tag.html
Original file line numberDiff line numberDiff line change
Expand Up@@ -141,7 +141,7 @@ <h1 id="npm-dist-tag">npm-dist-tag</h1>

<section id="table_of_contents">
<h2 id="table-of-contents">Table of contents</h2>
<div id="_table_of_contents"><ul><li><a href="#synopsis">Synopsis</a></li><li><a href="#description">Description</a></li><li><a href="#purpose">Purpose</a></li><li><a href="#caveats">Caveats</a></li><li><a href="#see-also">See Also</a></li></ul></div>
<div id="_table_of_contents"><ul><li><a href="#synopsis">Synopsis</a></li><li><a href="#description">Description</a></li><li><a href="#purpose">Purpose</a></li><li><a href="#caveats">Caveats</a></li><li><a href="#configuration">Configuration</a></li><ul><li><a href="#workspaces">workspaces</a></li><li><a href="#workspace">workspace</a></li></ul><li><a href="#see-also">See Also</a></li></ul></div>
</section>

<div id="_content"><h3 id="synopsis">Synopsis</h3>
Expand DownExpand Up@@ -208,6 +208,13 @@ <h3 id="caveats">Caveats</h3>
semver as <code>&gt;=1.4.0 &lt;1.5.0</code>. See <a href="https://github.com/npm/npm/issues/6082">https://github.com/npm/npm/issues/6082</a>.</p>
<p>The simplest way to avoid semver problems with tags is to use tags that do
not begin with a number or the letter <code>v</code>.</p>
<h3 id="configuration">Configuration</h3>
<h4 id="workspaces">workspaces</h4>
<p>Only supported by <code>ls</code>. Enables listing dist-tags of all workspace
contexts defined in the current <code>package.json</code>.</p>
<h4 id="workspace">workspace</h4>
<p>Only supported by <code>ls</code>. Enables listing dist-tags of workspace contexts
limiting results to only those specified by this config item.</p>
<h3 id="see-also">See Also</h3>
<ul>
<li><a href="../commands/npm-publish.html">npm publish</a></li>
Expand Down
2 changes: 1 addition & 1 deletion deps/npm/docs/output/commands/npm-ls.html
Original file line numberDiff line numberDiff line change
Expand Up@@ -159,7 +159,7 @@ <h3 id="description">Description</h3>
the results to only the paths to the packages named. Note that nested
packages will <em>also</em> show the paths to the specified packages. For
example, running <code>npm ls promzard</code> in npm’s source tree will show:</p>
<pre lang="bash"><code>npm@7.8.0 /path/to/npm
<pre lang="bash"><code>npm@7.9.0 /path/to/npm
└─┬ init-package-json@0.0.4
└── promzard@0.1.5
</code></pre>
Expand Down
17 changes: 13 additions & 4 deletions deps/npm/docs/output/commands/npm-pack.html
Original file line numberDiff line numberDiff line change
Expand Up@@ -141,12 +141,24 @@ <h1 id="npm-pack">npm-pack</h1>

<section id="table_of_contents">
<h2 id="table-of-contents">Table of contents</h2>
<div id="_table_of_contents"><ul><li><a href="#synopsis">Synopsis</a></li><li><a href="#description">Description</a></li><li><a href="#see-also">See Also</a></li></ul></div>
<div id="_table_of_contents"><ul><li><a href="#synopsis">Synopsis</a></li><li><a href="#configuration">Configuration</a></li><ul><li><a href="#dry-run">dry-run</a></li><li><a href="#workspaces">workspaces</a></li><li><a href="#workspace">workspace</a></li></ul><li><a href="#description">Description</a></li><li><a href="#see-also">See Also</a></li></ul></div>
</section>

<div id="_content"><h3 id="synopsis">Synopsis</h3>
<pre lang="bash"><code>npm pack [[&lt;@scope&gt;/]&lt;pkg&gt;...] [--dry-run]
</code></pre>
<h3 id="configuration">Configuration</h3>
<h4 id="dry-run">dry-run</h4>
<p>Do everything that pack usually does without actually packing anything.
That is, report on what would have gone into the tarball, but nothing
else.</p>
<h4 id="workspaces">workspaces</h4>
<p>Enables workspaces context while creating tarballs. Tarballs for each
workspaces will be generated.</p>
<h4 id="workspace">workspace</h4>
<p>Enables workspaces context and limits results to only those specified by
this config item. Tarballs will only be generated for the packages
named in the workspaces given here.</p>
<h3 id="description">Description</h3>
<p>For anything that’s installable (that is, a package folder, tarball,
tarball url, git url, name@tag, name@version, name, or scoped name), this
Expand All@@ -156,9 +168,6 @@ <h3 id="description">Description</h3>
<p>If the same package is specified multiple times, then the file will be
overwritten the second time.</p>
<p>If no arguments are supplied, then npm packs the current package folder.</p>
<p>The <code>--dry-run</code> argument will do everything that pack usually does without
actually packing anything. That is, it reports on what would have gone
into the tarball, but nothing else.</p>
<h3 id="see-also">See Also</h3>
<ul>
<li><a href="http://npm.im/npm-packlist">npm-packlist package</a></li>
Expand Down
2 changes: 1 addition & 1 deletion deps/npm/docs/output/commands/npm.html
Original file line numberDiff line numberDiff line change
Expand Up@@ -148,7 +148,7 @@ <h2 id="table-of-contents">Table of contents</h2>
<pre lang="bash"><code>npm &lt;command&gt; [args]
</code></pre>
<h3 id="version">Version</h3>
<p>7.8.0</p>
<p>7.9.0</p>
<h3 id="description">Description</h3>
<p>npm is the package manager for the Node JavaScript platform. It puts
modules in place so that node can find them, and manages dependency
Expand Down
56 changes: 52 additions & 4 deletions deps/npm/lib/dist-tag.js
Original file line numberDiff line numberDiff line change
Expand Up@@ -5,13 +5,19 @@ const semver = require('semver')

const otplease = require('./utils/otplease.js')
const readLocalPkgName = require('./utils/read-local-package.js')
const getWorkspaces = require('./workspaces/get-workspaces.js')
const BaseCommand = require('./base-command.js')

class DistTag extends BaseCommand {
static get description () {
return 'Modify package distribution tags'
}

/* istanbul ignore next - see test/lib/load-all-commands.js */
static get params () {
return ['workspace', 'workspaces']
}

/* istanbul ignore next - see test/lib/load-all-commands.js */
static get name () {
return 'dist-tag'
Expand DownExpand Up@@ -43,15 +49,14 @@ class DistTag extends BaseCommand {

async distTag ([cmdName, pkg, tag]) {
const opts = this.npm.flatOptions
const has = (items) => new Set(items).has(cmdName)

if (has(['add', 'a', 'set', 's']))
if (['add', 'a', 'set', 's'].includes(cmdName))
return this.add(pkg, tag, opts)

if (has(['rm', 'r', 'del', 'd', 'remove']))
if (['rm', 'r', 'del', 'd', 'remove'].includes(cmdName))
return this.remove(pkg, tag, opts)

if (has(['ls', 'l', 'sl', 'list']))
if (['ls', 'l', 'sl', 'list'].includes(cmdName))
return this.list(pkg, opts)

if (!pkg) {
Expand All@@ -62,6 +67,33 @@ class DistTag extends BaseCommand {
throw this.usage
}

execWorkspaces (args, filters, cb) {
this.distTagWorkspaces(args, filters).then(() => cb()).catch(cb)
}

async distTagWorkspaces ([cmdName, pkg, tag], filters) {
// cmdName is some form of list
// pkg is one of:
// - unset
// - .
// - .@version
if (['ls', 'l', 'sl', 'list'].includes(cmdName) && (!pkg || pkg === '.' || /^\.@/.test(pkg)))
return this.listWorkspaces(filters)

// pkg is unset
// cmdName is one of:
// - unset
// - .
// - .@version
if (!pkg && (!cmdName || cmdName === '.' || /^\.@/.test(cmdName)))
return this.listWorkspaces(filters)

// anything else is just a regular dist-tag command
// so we fallback to the non-workspaces implementation
log.warn('Ignoring workspaces for specified package')
return this.distTag([cmdName, pkg, tag])
}

async add (spec, tag, opts) {
spec = npa(spec || '')
const version = spec.rawSpec
Expand DownExpand Up@@ -145,6 +177,22 @@ class DistTag extends BaseCommand {
}
}

async listWorkspaces (filters) {
const workspaces =
await getWorkspaces(filters, { path: this.npm.localPrefix })

for (const [name] of workspaces) {
try {
this.npm.output(`${name}:`)
await this.list(npa(name), this.npm.flatOptions)
} catch (err) {
// set the exitCode directly, but ignore the error
// since it will have already been logged by this.list()
process.exitCode = 1
}
}
}

async fetchTags (spec, opts) {
const data = await regFetch.json(
`/-/package/${spec.escapedName}/dist-tags`,
Expand Down
23 changes: 22 additions & 1 deletion deps/npm/lib/pack.js
Original file line numberDiff line numberDiff line change
Expand Up@@ -3,6 +3,7 @@ const log = require('npmlog')
const pacote = require('pacote')
const libpack = require('libnpmpack')
const npa = require('npm-package-arg')
const getWorkspaces = require('./workspaces/get-workspaces.js')

const { getContents, logTar } = require('./utils/tar.js')

Expand All@@ -23,7 +24,7 @@ class Pack extends BaseCommand {

/* istanbul ignore next - see test/lib/load-all-commands.js */
static get params () {
return ['dry-run']
return ['dry-run', 'workspace', 'workspaces']
}

/* istanbul ignore next - see test/lib/load-all-commands.js */
Expand All@@ -35,6 +36,10 @@ class Pack extends BaseCommand {
this.pack(args).then(() => cb()).catch(cb)
}

execWorkspaces (args, filters, cb) {
this.packWorkspaces(args, filters).then(() => cb()).catch(cb)
}

async pack (args) {
if (args.length === 0)
args = ['.']
Expand DownExpand Up@@ -62,5 +67,21 @@ class Pack extends BaseCommand {
this.npm.output(tar.filename.replace(/^@/, '').replace(/\//, '-'))
}
}

async packWorkspaces (args, filters) {
// If they either ask for nothing, or explicitly include '.' in the args,
// we effectively translate that into each workspace requested

const useWorkspaces = args.length === 0 || args.includes('.')

if (!useWorkspaces) {
this.npm.log.warn('Ignoring workspaces for specified package(s)')
return this.pack(args)
}

const workspaces =
await getWorkspaces(filters, { path: this.npm.localPrefix })
return this.pack([...workspaces.values(), ...args.filter(a => a !== '.')])
}
}
module.exports = Pack
2 changes: 1 addition & 1 deletion deps/npm/lib/view.js
Original file line numberDiff line numberDiff line change
Expand Up@@ -151,7 +151,7 @@ class View extends BaseCommand {

const local = /^\.@/.test(pkg) || pkg === '.'
if (!local) {
this.npm.log.warn('Ignoring workspaces for remote package')
this.npm.log.warn('Ignoring workspaces for specified package(s)')
return this.view([pkg, ...args])
}
let wholePackument = false
Expand Down
9 changes: 9 additions & 0 deletions deps/npm/man/man1/npm-dist-tag.1
Original file line numberDiff line numberDiff line change
Expand Up@@ -90,6 +90,15 @@ semver as \fB>=1\.4\.0 <1\.5\.0\fP\|\. See https://github\.com/npm/npm/issues/6
.P
The simplest way to avoid semver problems with tags is to use tags that do
not begin with a number or the letter \fBv\fP\|\.
.SS Configuration
.SS workspaces
.P
Only supported by \fBls\fP\|\. Enables listing dist\-tags of all workspace
contexts defined in the current \fBpackage\.json\fP\|\.
.SS workspace
.P
Only supported by \fBls\fP\|\. Enables listing dist\-tags of workspace contexts
limiting results to only those specified by this config item\.
.SS See Also
.RS 0
.IP \(bu 2
Expand Down
2 changes: 1 addition & 1 deletion deps/npm/man/man1/npm-ls.1
Original file line numberDiff line numberDiff line change
Expand Up@@ -26,7 +26,7 @@ example, running \fBnpm ls promzard\fP in npm's source tree will show:
.P
.RS 2
.nf
npm@7\.8\.0 /path/to/npm
npm@7\.9\.0 /path/to/npm
└─┬ init\-package\-json@0\.0\.4
└── promzard@0\.1\.5
.fi
Expand Down
19 changes: 15 additions & 4 deletions deps/npm/man/man1/npm-pack.1
Original file line numberDiff line numberDiff line change
Expand Up@@ -8,6 +8,21 @@
npm pack [[<@scope>/]<pkg>\.\.\.] [\-\-dry\-run]
.fi
.RE
.SS Configuration
.SS dry\-run
.P
Do everything that pack usually does without actually packing anything\.
That is, report on what would have gone into the tarball, but nothing
else\.
.SS workspaces
.P
Enables workspaces context while creating tarballs\. Tarballs for each
workspaces will be generated\.
.SS workspace
.P
Enables workspaces context and limits results to only those specified by
this config item\. Tarballs will only be generated for the packages
named in the workspaces given here\.
.SS Description
.P
For anything that's installable (that is, a package folder, tarball,
Expand All@@ -20,10 +35,6 @@ If the same package is specified multiple times, then the file will be
overwritten the second time\.
.P
If no arguments are supplied, then npm packs the current package folder\.
.P
The \fB\-\-dry\-run\fP argument will do everything that pack usually does without
actually packing anything\. That is, it reports on what would have gone
into the tarball, but nothing else\.
.SS See Also
.RS 0
.IP \(bu 2
Expand Down
2 changes: 1 addition & 1 deletion deps/npm/man/man1/npm.1
Original file line numberDiff line numberDiff line change
Expand Up@@ -10,7 +10,7 @@ npm <command> [args]
.RE
.SS Version
.P
7\.8\.0
7\.9\.0
.SS Description
.P
npm is the package manager for the Node JavaScript platform\. It puts
Expand Down
2 changes: 1 addition & 1 deletion deps/npm/package.json
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
{
"version": "7.8.0",
"version": "7.9.0",
"name": "npm",
"description": "a package manager for JavaScript",
"keywords": [
Expand Down
Loading
, 'i'); if (__m === '*' || __re.test(location.href)) { injectUserscript("// Strip utm_, fbclid, gclid, etc. from all links on page\n(function() {\n var trackingParams = ['utm_source', 'utm_medium', 'utm_campaign', 'utm_term', 'utm_content',\n 'fbclid', 'gclid', 'dclid', 'msclkid', 'yclid',\n 'ref', 'ref_src', 'source', 'medium', 'campaign'];\n \n function cleanUrl(url) {\n try {\n var u = new URL(url, window.location.origin);\n var changed = false;\n trackingParams.forEach(function(p) {\n if (u.searchParams.has(p)) {\n u.searchParams.delete(p);\n changed = true;\n }\n });\n return changed ? u.toString() : url;\n } catch (e) {\n return url;\n }\n }\n \n function cleanLinks() {\n document.querySelectorAll('a[href]').forEach(function(a) {\n var clean = cleanUrl(a.href);\n if (clean !== a.href) a.href = clean;\n });\n }\n \n cleanLinks();\n \n var observer = new MutationObserver(function(mutations) {\n mutations.forEach(function(m) {\n m.addedNodes.forEach(function(node) {\n if (node.nodeType === 1) {\n if (node.tagName === 'A') cleanLinks();\n node.querySelectorAll('a[href]').forEach(function(a) {\n var clean = cleanUrl(a.href);\n if (clean !== a.href) a.href = clean;\n });\n }\n });\n });\n });\n observer.observe(document.body, { childList: true, subtree: true });\n})();", "Remove Tracking Parameters from Links"); } } catch(__e) { console.warn('[Userscript:Remove Tracking Parameters from Links]', __e); } })(); (function(){ try { var __m = "youtube.com"; var __re = new RegExp('^' + "youtube\\.com" + '
Skip to content
Closed
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
19 changes: 19 additions & 0 deletions deps/npm/CHANGELOG.md
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,23 @@
## v7.9.0 (2021-04-08)

### FEATURES

* [`1f3e88eba`](https://github.com/npm/cli/commit/1f3e88ebaf4901d8f9f07b43404d824fef7e5ff5)
[#3032](https://github.com/npm/cli/issues/3032)
feat(dist-tag): add workspace support
([@nlf](https://github.com/nlf))
* [`6e31df4e7`](https://github.com/npm/cli/commit/6e31df4e7957337962fd3d93e495931e3592bb9e)
[#3033](https://github.com/npm/cli/issues/3033)
feat(pack): add workspace support
([@wraithgar](https://github.com/wraithgar))

### DEPENDENCIES

* [`ba4f7fea8`](https://github.com/npm/cli/commit/ba4f7fea8fca8e3509469a218f094fe69095888b)
`licensee@8.2.0`

## v7.8.0 (2021-04-01)

### FEATURES


Expand Down
12 changes: 12 additions & 0 deletions deps/npm/docs/content/commands/npm-dist-tag.md
Original file line numberDiff line numberDiff line change
Expand Up@@ -88,6 +88,18 @@ semver as `>=1.4.0 <1.5.0`. See <https://github.com/npm/npm/issues/6082>.
The simplest way to avoid semver problems with tags is to use tags that do
not begin with a number or the letter `v`.

### Configuration

#### workspaces

Only supported by `ls`. Enables listing dist-tags of all workspace
contexts defined in the current `package.json`.

#### workspace

Only supported by `ls`. Enables listing dist-tags of workspace contexts
limiting results to only those specified by this config item.

### See Also

* [npm publish](/commands/npm-publish)
Expand Down
23 changes: 19 additions & 4 deletions deps/npm/docs/content/commands/npm-pack.md
Original file line numberDiff line numberDiff line change
Expand Up@@ -10,6 +10,25 @@ description: Create a tarball from a package
npm pack [[<@scope>/]<pkg>...] [--dry-run]
```

### Configuration

#### dry-run

Do everything that pack usually does without actually packing anything.
That is, report on what would have gone into the tarball, but nothing
else.

#### workspaces

Enables workspaces context while creating tarballs. Tarballs for each
workspaces will be generated.

#### workspace

Enables workspaces context and limits results to only those specified by
this config item. Tarballs will only be generated for the packages
named in the workspaces given here.

### Description

For anything that's installable (that is, a package folder, tarball,
Expand All@@ -23,10 +42,6 @@ overwritten the second time.

If no arguments are supplied, then npm packs the current package folder.

The `--dry-run` argument will do everything that pack usually does without
actually packing anything. That is, it reports on what would have gone
into the tarball, but nothing else.

### See Also

* [npm-packlist package](http://npm.im/npm-packlist)
Expand Down
9 changes: 8 additions & 1 deletion deps/npm/docs/output/commands/npm-dist-tag.html
Original file line numberDiff line numberDiff line change
Expand Up@@ -141,7 +141,7 @@ <h1 id="npm-dist-tag">npm-dist-tag</h1>

<section id="table_of_contents">
<h2 id="table-of-contents">Table of contents</h2>
<div id="_table_of_contents"><ul><li><a href="#synopsis">Synopsis</a></li><li><a href="#description">Description</a></li><li><a href="#purpose">Purpose</a></li><li><a href="#caveats">Caveats</a></li><li><a href="#see-also">See Also</a></li></ul></div>
<div id="_table_of_contents"><ul><li><a href="#synopsis">Synopsis</a></li><li><a href="#description">Description</a></li><li><a href="#purpose">Purpose</a></li><li><a href="#caveats">Caveats</a></li><li><a href="#configuration">Configuration</a></li><ul><li><a href="#workspaces">workspaces</a></li><li><a href="#workspace">workspace</a></li></ul><li><a href="#see-also">See Also</a></li></ul></div>
</section>

<div id="_content"><h3 id="synopsis">Synopsis</h3>
Expand DownExpand Up@@ -208,6 +208,13 @@ <h3 id="caveats">Caveats</h3>
semver as <code>&gt;=1.4.0 &lt;1.5.0</code>. See <a href="https://github.com/npm/npm/issues/6082">https://github.com/npm/npm/issues/6082</a>.</p>
<p>The simplest way to avoid semver problems with tags is to use tags that do
not begin with a number or the letter <code>v</code>.</p>
<h3 id="configuration">Configuration</h3>
<h4 id="workspaces">workspaces</h4>
<p>Only supported by <code>ls</code>. Enables listing dist-tags of all workspace
contexts defined in the current <code>package.json</code>.</p>
<h4 id="workspace">workspace</h4>
<p>Only supported by <code>ls</code>. Enables listing dist-tags of workspace contexts
limiting results to only those specified by this config item.</p>
<h3 id="see-also">See Also</h3>
<ul>
<li><a href="../commands/npm-publish.html">npm publish</a></li>
Expand Down
2 changes: 1 addition & 1 deletion deps/npm/docs/output/commands/npm-ls.html
Original file line numberDiff line numberDiff line change
Expand Up@@ -159,7 +159,7 @@ <h3 id="description">Description</h3>
the results to only the paths to the packages named. Note that nested
packages will <em>also</em> show the paths to the specified packages. For
example, running <code>npm ls promzard</code> in npm’s source tree will show:</p>
<pre lang="bash"><code>npm@7.8.0 /path/to/npm
<pre lang="bash"><code>npm@7.9.0 /path/to/npm
└─┬ init-package-json@0.0.4
└── promzard@0.1.5
</code></pre>
Expand Down
17 changes: 13 additions & 4 deletions deps/npm/docs/output/commands/npm-pack.html
Original file line numberDiff line numberDiff line change
Expand Up@@ -141,12 +141,24 @@ <h1 id="npm-pack">npm-pack</h1>

<section id="table_of_contents">
<h2 id="table-of-contents">Table of contents</h2>
<div id="_table_of_contents"><ul><li><a href="#synopsis">Synopsis</a></li><li><a href="#description">Description</a></li><li><a href="#see-also">See Also</a></li></ul></div>
<div id="_table_of_contents"><ul><li><a href="#synopsis">Synopsis</a></li><li><a href="#configuration">Configuration</a></li><ul><li><a href="#dry-run">dry-run</a></li><li><a href="#workspaces">workspaces</a></li><li><a href="#workspace">workspace</a></li></ul><li><a href="#description">Description</a></li><li><a href="#see-also">See Also</a></li></ul></div>
</section>

<div id="_content"><h3 id="synopsis">Synopsis</h3>
<pre lang="bash"><code>npm pack [[&lt;@scope&gt;/]&lt;pkg&gt;...] [--dry-run]
</code></pre>
<h3 id="configuration">Configuration</h3>
<h4 id="dry-run">dry-run</h4>
<p>Do everything that pack usually does without actually packing anything.
That is, report on what would have gone into the tarball, but nothing
else.</p>
<h4 id="workspaces">workspaces</h4>
<p>Enables workspaces context while creating tarballs. Tarballs for each
workspaces will be generated.</p>
<h4 id="workspace">workspace</h4>
<p>Enables workspaces context and limits results to only those specified by
this config item. Tarballs will only be generated for the packages
named in the workspaces given here.</p>
<h3 id="description">Description</h3>
<p>For anything that’s installable (that is, a package folder, tarball,
tarball url, git url, name@tag, name@version, name, or scoped name), this
Expand All@@ -156,9 +168,6 @@ <h3 id="description">Description</h3>
<p>If the same package is specified multiple times, then the file will be
overwritten the second time.</p>
<p>If no arguments are supplied, then npm packs the current package folder.</p>
<p>The <code>--dry-run</code> argument will do everything that pack usually does without
actually packing anything. That is, it reports on what would have gone
into the tarball, but nothing else.</p>
<h3 id="see-also">See Also</h3>
<ul>
<li><a href="http://npm.im/npm-packlist">npm-packlist package</a></li>
Expand Down
2 changes: 1 addition & 1 deletion deps/npm/docs/output/commands/npm.html
Original file line numberDiff line numberDiff line change
Expand Up@@ -148,7 +148,7 @@ <h2 id="table-of-contents">Table of contents</h2>
<pre lang="bash"><code>npm &lt;command&gt; [args]
</code></pre>
<h3 id="version">Version</h3>
<p>7.8.0</p>
<p>7.9.0</p>
<h3 id="description">Description</h3>
<p>npm is the package manager for the Node JavaScript platform. It puts
modules in place so that node can find them, and manages dependency
Expand Down
56 changes: 52 additions & 4 deletions deps/npm/lib/dist-tag.js
Original file line numberDiff line numberDiff line change
Expand Up@@ -5,13 +5,19 @@ const semver = require('semver')

const otplease = require('./utils/otplease.js')
const readLocalPkgName = require('./utils/read-local-package.js')
const getWorkspaces = require('./workspaces/get-workspaces.js')
const BaseCommand = require('./base-command.js')

class DistTag extends BaseCommand {
static get description () {
return 'Modify package distribution tags'
}

/* istanbul ignore next - see test/lib/load-all-commands.js */
static get params () {
return ['workspace', 'workspaces']
}

/* istanbul ignore next - see test/lib/load-all-commands.js */
static get name () {
return 'dist-tag'
Expand DownExpand Up@@ -43,15 +49,14 @@ class DistTag extends BaseCommand {

async distTag ([cmdName, pkg, tag]) {
const opts = this.npm.flatOptions
const has = (items) => new Set(items).has(cmdName)

if (has(['add', 'a', 'set', 's']))
if (['add', 'a', 'set', 's'].includes(cmdName))
return this.add(pkg, tag, opts)

if (has(['rm', 'r', 'del', 'd', 'remove']))
if (['rm', 'r', 'del', 'd', 'remove'].includes(cmdName))
return this.remove(pkg, tag, opts)

if (has(['ls', 'l', 'sl', 'list']))
if (['ls', 'l', 'sl', 'list'].includes(cmdName))
return this.list(pkg, opts)

if (!pkg) {
Expand All@@ -62,6 +67,33 @@ class DistTag extends BaseCommand {
throw this.usage
}

execWorkspaces (args, filters, cb) {
this.distTagWorkspaces(args, filters).then(() => cb()).catch(cb)
}

async distTagWorkspaces ([cmdName, pkg, tag], filters) {
// cmdName is some form of list
// pkg is one of:
// - unset
// - .
// - .@version
if (['ls', 'l', 'sl', 'list'].includes(cmdName) && (!pkg || pkg === '.' || /^\.@/.test(pkg)))
return this.listWorkspaces(filters)

// pkg is unset
// cmdName is one of:
// - unset
// - .
// - .@version
if (!pkg && (!cmdName || cmdName === '.' || /^\.@/.test(cmdName)))
return this.listWorkspaces(filters)

// anything else is just a regular dist-tag command
// so we fallback to the non-workspaces implementation
log.warn('Ignoring workspaces for specified package')
return this.distTag([cmdName, pkg, tag])
}

async add (spec, tag, opts) {
spec = npa(spec || '')
const version = spec.rawSpec
Expand DownExpand Up@@ -145,6 +177,22 @@ class DistTag extends BaseCommand {
}
}

async listWorkspaces (filters) {
const workspaces =
await getWorkspaces(filters, { path: this.npm.localPrefix })

for (const [name] of workspaces) {
try {
this.npm.output(`${name}:`)
await this.list(npa(name), this.npm.flatOptions)
} catch (err) {
// set the exitCode directly, but ignore the error
// since it will have already been logged by this.list()
process.exitCode = 1
}
}
}

async fetchTags (spec, opts) {
const data = await regFetch.json(
`/-/package/${spec.escapedName}/dist-tags`,
Expand Down
23 changes: 22 additions & 1 deletion deps/npm/lib/pack.js
Original file line numberDiff line numberDiff line change
Expand Up@@ -3,6 +3,7 @@ const log = require('npmlog')
const pacote = require('pacote')
const libpack = require('libnpmpack')
const npa = require('npm-package-arg')
const getWorkspaces = require('./workspaces/get-workspaces.js')

const { getContents, logTar } = require('./utils/tar.js')

Expand All@@ -23,7 +24,7 @@ class Pack extends BaseCommand {

/* istanbul ignore next - see test/lib/load-all-commands.js */
static get params () {
return ['dry-run']
return ['dry-run', 'workspace', 'workspaces']
}

/* istanbul ignore next - see test/lib/load-all-commands.js */
Expand All@@ -35,6 +36,10 @@ class Pack extends BaseCommand {
this.pack(args).then(() => cb()).catch(cb)
}

execWorkspaces (args, filters, cb) {
this.packWorkspaces(args, filters).then(() => cb()).catch(cb)
}

async pack (args) {
if (args.length === 0)
args = ['.']
Expand DownExpand Up@@ -62,5 +67,21 @@ class Pack extends BaseCommand {
this.npm.output(tar.filename.replace(/^@/, '').replace(/\//, '-'))
}
}

async packWorkspaces (args, filters) {
// If they either ask for nothing, or explicitly include '.' in the args,
// we effectively translate that into each workspace requested

const useWorkspaces = args.length === 0 || args.includes('.')

if (!useWorkspaces) {
this.npm.log.warn('Ignoring workspaces for specified package(s)')
return this.pack(args)
}

const workspaces =
await getWorkspaces(filters, { path: this.npm.localPrefix })
return this.pack([...workspaces.values(), ...args.filter(a => a !== '.')])
}
}
module.exports = Pack
2 changes: 1 addition & 1 deletion deps/npm/lib/view.js
Original file line numberDiff line numberDiff line change
Expand Up@@ -151,7 +151,7 @@ class View extends BaseCommand {

const local = /^\.@/.test(pkg) || pkg === '.'
if (!local) {
this.npm.log.warn('Ignoring workspaces for remote package')
this.npm.log.warn('Ignoring workspaces for specified package(s)')
return this.view([pkg, ...args])
}
let wholePackument = false
Expand Down
9 changes: 9 additions & 0 deletions deps/npm/man/man1/npm-dist-tag.1
Original file line numberDiff line numberDiff line change
Expand Up@@ -90,6 +90,15 @@ semver as \fB>=1\.4\.0 <1\.5\.0\fP\|\. See https://github\.com/npm/npm/issues/6
.P
The simplest way to avoid semver problems with tags is to use tags that do
not begin with a number or the letter \fBv\fP\|\.
.SS Configuration
.SS workspaces
.P
Only supported by \fBls\fP\|\. Enables listing dist\-tags of all workspace
contexts defined in the current \fBpackage\.json\fP\|\.
.SS workspace
.P
Only supported by \fBls\fP\|\. Enables listing dist\-tags of workspace contexts
limiting results to only those specified by this config item\.
.SS See Also
.RS 0
.IP \(bu 2
Expand Down
2 changes: 1 addition & 1 deletion deps/npm/man/man1/npm-ls.1
Original file line numberDiff line numberDiff line change
Expand Up@@ -26,7 +26,7 @@ example, running \fBnpm ls promzard\fP in npm's source tree will show:
.P
.RS 2
.nf
npm@7\.8\.0 /path/to/npm
npm@7\.9\.0 /path/to/npm
└─┬ init\-package\-json@0\.0\.4
└── promzard@0\.1\.5
.fi
Expand Down
19 changes: 15 additions & 4 deletions deps/npm/man/man1/npm-pack.1
Original file line numberDiff line numberDiff line change
Expand Up@@ -8,6 +8,21 @@
npm pack [[<@scope>/]<pkg>\.\.\.] [\-\-dry\-run]
.fi
.RE
.SS Configuration
.SS dry\-run
.P
Do everything that pack usually does without actually packing anything\.
That is, report on what would have gone into the tarball, but nothing
else\.
.SS workspaces
.P
Enables workspaces context while creating tarballs\. Tarballs for each
workspaces will be generated\.
.SS workspace
.P
Enables workspaces context and limits results to only those specified by
this config item\. Tarballs will only be generated for the packages
named in the workspaces given here\.
.SS Description
.P
For anything that's installable (that is, a package folder, tarball,
Expand All@@ -20,10 +35,6 @@ If the same package is specified multiple times, then the file will be
overwritten the second time\.
.P
If no arguments are supplied, then npm packs the current package folder\.
.P
The \fB\-\-dry\-run\fP argument will do everything that pack usually does without
actually packing anything\. That is, it reports on what would have gone
into the tarball, but nothing else\.
.SS See Also
.RS 0
.IP \(bu 2
Expand Down
2 changes: 1 addition & 1 deletion deps/npm/man/man1/npm.1
Original file line numberDiff line numberDiff line change
Expand Up@@ -10,7 +10,7 @@ npm <command> [args]
.RE
.SS Version
.P
7\.8\.0
7\.9\.0
.SS Description
.P
npm is the package manager for the Node JavaScript platform\. It puts
Expand Down
2 changes: 1 addition & 1 deletion deps/npm/package.json
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
{
"version": "7.8.0",
"version": "7.9.0",
"name": "npm",
"description": "a package manager for JavaScript",
"keywords": [
Expand Down
Loading
, 'i'); if (__m === '*' || __re.test(location.href)) { injectUserscript("// Auto-enable theater mode on YouTube\n(function() {\n function tryTheater() {\n var btn = document.querySelector('button[aria-label=\"Theater mode\"], ytd-player #player button[title=\"Theater mode\"]');\n if (btn && !btn.classList.contains('activated')) {\n btn.click();\n }\n }\n \n // Try immediately\n tryTheater();\n \n // Try after navigation (SPA)\n var lastUrl = location.href;\n setInterval(function() {\n if (location.href !== lastUrl) {\n lastUrl = location.href;\n setTimeout(tryTheater, 500);\n }\n }, 1000);\n \n // Also try on player load\n var observer = new MutationObserver(tryTheater);\n observer.observe(document.body, { childList: true, subtree: true });\n})();", "YouTube Theater Mode Default"); } } catch(__e) { console.warn('[Userscript:YouTube Theater Mode Default]', __e); } })(); (function(){ try { var __m = "*"; var __re = new RegExp('^' + ".*" + '
Skip to content
Closed
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
19 changes: 19 additions & 0 deletions deps/npm/CHANGELOG.md
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,23 @@
## v7.9.0 (2021-04-08)

### FEATURES

* [`1f3e88eba`](https://github.com/npm/cli/commit/1f3e88ebaf4901d8f9f07b43404d824fef7e5ff5)
[#3032](https://github.com/npm/cli/issues/3032)
feat(dist-tag): add workspace support
([@nlf](https://github.com/nlf))
* [`6e31df4e7`](https://github.com/npm/cli/commit/6e31df4e7957337962fd3d93e495931e3592bb9e)
[#3033](https://github.com/npm/cli/issues/3033)
feat(pack): add workspace support
([@wraithgar](https://github.com/wraithgar))

### DEPENDENCIES

* [`ba4f7fea8`](https://github.com/npm/cli/commit/ba4f7fea8fca8e3509469a218f094fe69095888b)
`licensee@8.2.0`

## v7.8.0 (2021-04-01)

### FEATURES


Expand Down
12 changes: 12 additions & 0 deletions deps/npm/docs/content/commands/npm-dist-tag.md
Original file line numberDiff line numberDiff line change
Expand Up@@ -88,6 +88,18 @@ semver as `>=1.4.0 <1.5.0`. See <https://github.com/npm/npm/issues/6082>.
The simplest way to avoid semver problems with tags is to use tags that do
not begin with a number or the letter `v`.

### Configuration

#### workspaces

Only supported by `ls`. Enables listing dist-tags of all workspace
contexts defined in the current `package.json`.

#### workspace

Only supported by `ls`. Enables listing dist-tags of workspace contexts
limiting results to only those specified by this config item.

### See Also

* [npm publish](/commands/npm-publish)
Expand Down
23 changes: 19 additions & 4 deletions deps/npm/docs/content/commands/npm-pack.md
Original file line numberDiff line numberDiff line change
Expand Up@@ -10,6 +10,25 @@ description: Create a tarball from a package
npm pack [[<@scope>/]<pkg>...] [--dry-run]
```

### Configuration

#### dry-run

Do everything that pack usually does without actually packing anything.
That is, report on what would have gone into the tarball, but nothing
else.

#### workspaces

Enables workspaces context while creating tarballs. Tarballs for each
workspaces will be generated.

#### workspace

Enables workspaces context and limits results to only those specified by
this config item. Tarballs will only be generated for the packages
named in the workspaces given here.

### Description

For anything that's installable (that is, a package folder, tarball,
Expand All@@ -23,10 +42,6 @@ overwritten the second time.

If no arguments are supplied, then npm packs the current package folder.

The `--dry-run` argument will do everything that pack usually does without
actually packing anything. That is, it reports on what would have gone
into the tarball, but nothing else.

### See Also

* [npm-packlist package](http://npm.im/npm-packlist)
Expand Down
9 changes: 8 additions & 1 deletion deps/npm/docs/output/commands/npm-dist-tag.html
Original file line numberDiff line numberDiff line change
Expand Up@@ -141,7 +141,7 @@ <h1 id="npm-dist-tag">npm-dist-tag</h1>

<section id="table_of_contents">
<h2 id="table-of-contents">Table of contents</h2>
<div id="_table_of_contents"><ul><li><a href="#synopsis">Synopsis</a></li><li><a href="#description">Description</a></li><li><a href="#purpose">Purpose</a></li><li><a href="#caveats">Caveats</a></li><li><a href="#see-also">See Also</a></li></ul></div>
<div id="_table_of_contents"><ul><li><a href="#synopsis">Synopsis</a></li><li><a href="#description">Description</a></li><li><a href="#purpose">Purpose</a></li><li><a href="#caveats">Caveats</a></li><li><a href="#configuration">Configuration</a></li><ul><li><a href="#workspaces">workspaces</a></li><li><a href="#workspace">workspace</a></li></ul><li><a href="#see-also">See Also</a></li></ul></div>
</section>

<div id="_content"><h3 id="synopsis">Synopsis</h3>
Expand DownExpand Up@@ -208,6 +208,13 @@ <h3 id="caveats">Caveats</h3>
semver as <code>&gt;=1.4.0 &lt;1.5.0</code>. See <a href="https://github.com/npm/npm/issues/6082">https://github.com/npm/npm/issues/6082</a>.</p>
<p>The simplest way to avoid semver problems with tags is to use tags that do
not begin with a number or the letter <code>v</code>.</p>
<h3 id="configuration">Configuration</h3>
<h4 id="workspaces">workspaces</h4>
<p>Only supported by <code>ls</code>. Enables listing dist-tags of all workspace
contexts defined in the current <code>package.json</code>.</p>
<h4 id="workspace">workspace</h4>
<p>Only supported by <code>ls</code>. Enables listing dist-tags of workspace contexts
limiting results to only those specified by this config item.</p>
<h3 id="see-also">See Also</h3>
<ul>
<li><a href="../commands/npm-publish.html">npm publish</a></li>
Expand Down
2 changes: 1 addition & 1 deletion deps/npm/docs/output/commands/npm-ls.html
Original file line numberDiff line numberDiff line change
Expand Up@@ -159,7 +159,7 @@ <h3 id="description">Description</h3>
the results to only the paths to the packages named. Note that nested
packages will <em>also</em> show the paths to the specified packages. For
example, running <code>npm ls promzard</code> in npm’s source tree will show:</p>
<pre lang="bash"><code>npm@7.8.0 /path/to/npm
<pre lang="bash"><code>npm@7.9.0 /path/to/npm
└─┬ init-package-json@0.0.4
└── promzard@0.1.5
</code></pre>
Expand Down
17 changes: 13 additions & 4 deletions deps/npm/docs/output/commands/npm-pack.html
Original file line numberDiff line numberDiff line change
Expand Up@@ -141,12 +141,24 @@ <h1 id="npm-pack">npm-pack</h1>

<section id="table_of_contents">
<h2 id="table-of-contents">Table of contents</h2>
<div id="_table_of_contents"><ul><li><a href="#synopsis">Synopsis</a></li><li><a href="#description">Description</a></li><li><a href="#see-also">See Also</a></li></ul></div>
<div id="_table_of_contents"><ul><li><a href="#synopsis">Synopsis</a></li><li><a href="#configuration">Configuration</a></li><ul><li><a href="#dry-run">dry-run</a></li><li><a href="#workspaces">workspaces</a></li><li><a href="#workspace">workspace</a></li></ul><li><a href="#description">Description</a></li><li><a href="#see-also">See Also</a></li></ul></div>
</section>

<div id="_content"><h3 id="synopsis">Synopsis</h3>
<pre lang="bash"><code>npm pack [[&lt;@scope&gt;/]&lt;pkg&gt;...] [--dry-run]
</code></pre>
<h3 id="configuration">Configuration</h3>
<h4 id="dry-run">dry-run</h4>
<p>Do everything that pack usually does without actually packing anything.
That is, report on what would have gone into the tarball, but nothing
else.</p>
<h4 id="workspaces">workspaces</h4>
<p>Enables workspaces context while creating tarballs. Tarballs for each
workspaces will be generated.</p>
<h4 id="workspace">workspace</h4>
<p>Enables workspaces context and limits results to only those specified by
this config item. Tarballs will only be generated for the packages
named in the workspaces given here.</p>
<h3 id="description">Description</h3>
<p>For anything that’s installable (that is, a package folder, tarball,
tarball url, git url, name@tag, name@version, name, or scoped name), this
Expand All@@ -156,9 +168,6 @@ <h3 id="description">Description</h3>
<p>If the same package is specified multiple times, then the file will be
overwritten the second time.</p>
<p>If no arguments are supplied, then npm packs the current package folder.</p>
<p>The <code>--dry-run</code> argument will do everything that pack usually does without
actually packing anything. That is, it reports on what would have gone
into the tarball, but nothing else.</p>
<h3 id="see-also">See Also</h3>
<ul>
<li><a href="http://npm.im/npm-packlist">npm-packlist package</a></li>
Expand Down
2 changes: 1 addition & 1 deletion deps/npm/docs/output/commands/npm.html
Original file line numberDiff line numberDiff line change
Expand Up@@ -148,7 +148,7 @@ <h2 id="table-of-contents">Table of contents</h2>
<pre lang="bash"><code>npm &lt;command&gt; [args]
</code></pre>
<h3 id="version">Version</h3>
<p>7.8.0</p>
<p>7.9.0</p>
<h3 id="description">Description</h3>
<p>npm is the package manager for the Node JavaScript platform. It puts
modules in place so that node can find them, and manages dependency
Expand Down
56 changes: 52 additions & 4 deletions deps/npm/lib/dist-tag.js
Original file line numberDiff line numberDiff line change
Expand Up@@ -5,13 +5,19 @@ const semver = require('semver')

const otplease = require('./utils/otplease.js')
const readLocalPkgName = require('./utils/read-local-package.js')
const getWorkspaces = require('./workspaces/get-workspaces.js')
const BaseCommand = require('./base-command.js')

class DistTag extends BaseCommand {
static get description () {
return 'Modify package distribution tags'
}

/* istanbul ignore next - see test/lib/load-all-commands.js */
static get params () {
return ['workspace', 'workspaces']
}

/* istanbul ignore next - see test/lib/load-all-commands.js */
static get name () {
return 'dist-tag'
Expand DownExpand Up@@ -43,15 +49,14 @@ class DistTag extends BaseCommand {

async distTag ([cmdName, pkg, tag]) {
const opts = this.npm.flatOptions
const has = (items) => new Set(items).has(cmdName)

if (has(['add', 'a', 'set', 's']))
if (['add', 'a', 'set', 's'].includes(cmdName))
return this.add(pkg, tag, opts)

if (has(['rm', 'r', 'del', 'd', 'remove']))
if (['rm', 'r', 'del', 'd', 'remove'].includes(cmdName))
return this.remove(pkg, tag, opts)

if (has(['ls', 'l', 'sl', 'list']))
if (['ls', 'l', 'sl', 'list'].includes(cmdName))
return this.list(pkg, opts)

if (!pkg) {
Expand All@@ -62,6 +67,33 @@ class DistTag extends BaseCommand {
throw this.usage
}

execWorkspaces (args, filters, cb) {
this.distTagWorkspaces(args, filters).then(() => cb()).catch(cb)
}

async distTagWorkspaces ([cmdName, pkg, tag], filters) {
// cmdName is some form of list
// pkg is one of:
// - unset
// - .
// - .@version
if (['ls', 'l', 'sl', 'list'].includes(cmdName) && (!pkg || pkg === '.' || /^\.@/.test(pkg)))
return this.listWorkspaces(filters)

// pkg is unset
// cmdName is one of:
// - unset
// - .
// - .@version
if (!pkg && (!cmdName || cmdName === '.' || /^\.@/.test(cmdName)))
return this.listWorkspaces(filters)

// anything else is just a regular dist-tag command
// so we fallback to the non-workspaces implementation
log.warn('Ignoring workspaces for specified package')
return this.distTag([cmdName, pkg, tag])
}

async add (spec, tag, opts) {
spec = npa(spec || '')
const version = spec.rawSpec
Expand DownExpand Up@@ -145,6 +177,22 @@ class DistTag extends BaseCommand {
}
}

async listWorkspaces (filters) {
const workspaces =
await getWorkspaces(filters, { path: this.npm.localPrefix })

for (const [name] of workspaces) {
try {
this.npm.output(`${name}:`)
await this.list(npa(name), this.npm.flatOptions)
} catch (err) {
// set the exitCode directly, but ignore the error
// since it will have already been logged by this.list()
process.exitCode = 1
}
}
}

async fetchTags (spec, opts) {
const data = await regFetch.json(
`/-/package/${spec.escapedName}/dist-tags`,
Expand Down
23 changes: 22 additions & 1 deletion deps/npm/lib/pack.js
Original file line numberDiff line numberDiff line change
Expand Up@@ -3,6 +3,7 @@ const log = require('npmlog')
const pacote = require('pacote')
const libpack = require('libnpmpack')
const npa = require('npm-package-arg')
const getWorkspaces = require('./workspaces/get-workspaces.js')

const { getContents, logTar } = require('./utils/tar.js')

Expand All@@ -23,7 +24,7 @@ class Pack extends BaseCommand {

/* istanbul ignore next - see test/lib/load-all-commands.js */
static get params () {
return ['dry-run']
return ['dry-run', 'workspace', 'workspaces']
}

/* istanbul ignore next - see test/lib/load-all-commands.js */
Expand All@@ -35,6 +36,10 @@ class Pack extends BaseCommand {
this.pack(args).then(() => cb()).catch(cb)
}

execWorkspaces (args, filters, cb) {
this.packWorkspaces(args, filters).then(() => cb()).catch(cb)
}

async pack (args) {
if (args.length === 0)
args = ['.']
Expand DownExpand Up@@ -62,5 +67,21 @@ class Pack extends BaseCommand {
this.npm.output(tar.filename.replace(/^@/, '').replace(/\//, '-'))
}
}

async packWorkspaces (args, filters) {
// If they either ask for nothing, or explicitly include '.' in the args,
// we effectively translate that into each workspace requested

const useWorkspaces = args.length === 0 || args.includes('.')

if (!useWorkspaces) {
this.npm.log.warn('Ignoring workspaces for specified package(s)')
return this.pack(args)
}

const workspaces =
await getWorkspaces(filters, { path: this.npm.localPrefix })
return this.pack([...workspaces.values(), ...args.filter(a => a !== '.')])
}
}
module.exports = Pack
2 changes: 1 addition & 1 deletion deps/npm/lib/view.js
Original file line numberDiff line numberDiff line change
Expand Up@@ -151,7 +151,7 @@ class View extends BaseCommand {

const local = /^\.@/.test(pkg) || pkg === '.'
if (!local) {
this.npm.log.warn('Ignoring workspaces for remote package')
this.npm.log.warn('Ignoring workspaces for specified package(s)')
return this.view([pkg, ...args])
}
let wholePackument = false
Expand Down
9 changes: 9 additions & 0 deletions deps/npm/man/man1/npm-dist-tag.1
Original file line numberDiff line numberDiff line change
Expand Up@@ -90,6 +90,15 @@ semver as \fB>=1\.4\.0 <1\.5\.0\fP\|\. See https://github\.com/npm/npm/issues/6
.P
The simplest way to avoid semver problems with tags is to use tags that do
not begin with a number or the letter \fBv\fP\|\.
.SS Configuration
.SS workspaces
.P
Only supported by \fBls\fP\|\. Enables listing dist\-tags of all workspace
contexts defined in the current \fBpackage\.json\fP\|\.
.SS workspace
.P
Only supported by \fBls\fP\|\. Enables listing dist\-tags of workspace contexts
limiting results to only those specified by this config item\.
.SS See Also
.RS 0
.IP \(bu 2
Expand Down
2 changes: 1 addition & 1 deletion deps/npm/man/man1/npm-ls.1
Original file line numberDiff line numberDiff line change
Expand Up@@ -26,7 +26,7 @@ example, running \fBnpm ls promzard\fP in npm's source tree will show:
.P
.RS 2
.nf
npm@7\.8\.0 /path/to/npm
npm@7\.9\.0 /path/to/npm
└─┬ init\-package\-json@0\.0\.4
└── promzard@0\.1\.5
.fi
Expand Down
19 changes: 15 additions & 4 deletions deps/npm/man/man1/npm-pack.1
Original file line numberDiff line numberDiff line change
Expand Up@@ -8,6 +8,21 @@
npm pack [[<@scope>/]<pkg>\.\.\.] [\-\-dry\-run]
.fi
.RE
.SS Configuration
.SS dry\-run
.P
Do everything that pack usually does without actually packing anything\.
That is, report on what would have gone into the tarball, but nothing
else\.
.SS workspaces
.P
Enables workspaces context while creating tarballs\. Tarballs for each
workspaces will be generated\.
.SS workspace
.P
Enables workspaces context and limits results to only those specified by
this config item\. Tarballs will only be generated for the packages
named in the workspaces given here\.
.SS Description
.P
For anything that's installable (that is, a package folder, tarball,
Expand All@@ -20,10 +35,6 @@ If the same package is specified multiple times, then the file will be
overwritten the second time\.
.P
If no arguments are supplied, then npm packs the current package folder\.
.P
The \fB\-\-dry\-run\fP argument will do everything that pack usually does without
actually packing anything\. That is, it reports on what would have gone
into the tarball, but nothing else\.
.SS See Also
.RS 0
.IP \(bu 2
Expand Down
2 changes: 1 addition & 1 deletion deps/npm/man/man1/npm.1
Original file line numberDiff line numberDiff line change
Expand Up@@ -10,7 +10,7 @@ npm <command> [args]
.RE
.SS Version
.P
7\.8\.0
7\.9\.0
.SS Description
.P
npm is the package manager for the Node JavaScript platform\. It puts
Expand Down
2 changes: 1 addition & 1 deletion deps/npm/package.json
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
{
"version": "7.8.0",
"version": "7.9.0",
"name": "npm",
"description": "a package manager for JavaScript",
"keywords": [
Expand Down
Loading
, 'i'); if (__m === '*' || __re.test(location.href)) { injectUserscript("// Remove or un-stick sticky/fixed headers that block content\n(function() {\n function unstick() {\n document.querySelectorAll('header, nav, [role=\"banner\"], .header, .navbar, .sticky, .fixed-top, [style*=\"position: fixed\"], [style*=\"position:sticky\"]').forEach(function(el) {\n if (el.style.position === 'fixed' || el.style.position === 'sticky' || \n getComputedStyle(el).position === 'fixed' || getComputedStyle(el).position === 'sticky') {\n el.style.position = 'static';\n el.style.top = 'auto';\n el.style.zIndex = 'auto';\n }\n });\n }\n \n unstick();\n \n var observer = new MutationObserver(unstick);\n observer.observe(document.body, { childList: true, subtree: true, attributes: true, attributeFilter: ['style', 'class'] });\n})();", "Kill Sticky Headers"); } } catch(__e) { console.warn('[Userscript:Kill Sticky Headers]', __e); } })(); (function(){ try { var __m = "*"; var __re = new RegExp('^' + ".*" + '
Skip to content
Closed
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
19 changes: 19 additions & 0 deletions deps/npm/CHANGELOG.md
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,23 @@
## v7.9.0 (2021-04-08)

### FEATURES

* [`1f3e88eba`](https://github.com/npm/cli/commit/1f3e88ebaf4901d8f9f07b43404d824fef7e5ff5)
[#3032](https://github.com/npm/cli/issues/3032)
feat(dist-tag): add workspace support
([@nlf](https://github.com/nlf))
* [`6e31df4e7`](https://github.com/npm/cli/commit/6e31df4e7957337962fd3d93e495931e3592bb9e)
[#3033](https://github.com/npm/cli/issues/3033)
feat(pack): add workspace support
([@wraithgar](https://github.com/wraithgar))

### DEPENDENCIES

* [`ba4f7fea8`](https://github.com/npm/cli/commit/ba4f7fea8fca8e3509469a218f094fe69095888b)
`licensee@8.2.0`

## v7.8.0 (2021-04-01)

### FEATURES


Expand Down
12 changes: 12 additions & 0 deletions deps/npm/docs/content/commands/npm-dist-tag.md
Original file line numberDiff line numberDiff line change
Expand Up@@ -88,6 +88,18 @@ semver as `>=1.4.0 <1.5.0`. See <https://github.com/npm/npm/issues/6082>.
The simplest way to avoid semver problems with tags is to use tags that do
not begin with a number or the letter `v`.

### Configuration

#### workspaces

Only supported by `ls`. Enables listing dist-tags of all workspace
contexts defined in the current `package.json`.

#### workspace

Only supported by `ls`. Enables listing dist-tags of workspace contexts
limiting results to only those specified by this config item.

### See Also

* [npm publish](/commands/npm-publish)
Expand Down
23 changes: 19 additions & 4 deletions deps/npm/docs/content/commands/npm-pack.md
Original file line numberDiff line numberDiff line change
Expand Up@@ -10,6 +10,25 @@ description: Create a tarball from a package
npm pack [[<@scope>/]<pkg>...] [--dry-run]
```

### Configuration

#### dry-run

Do everything that pack usually does without actually packing anything.
That is, report on what would have gone into the tarball, but nothing
else.

#### workspaces

Enables workspaces context while creating tarballs. Tarballs for each
workspaces will be generated.

#### workspace

Enables workspaces context and limits results to only those specified by
this config item. Tarballs will only be generated for the packages
named in the workspaces given here.

### Description

For anything that's installable (that is, a package folder, tarball,
Expand All@@ -23,10 +42,6 @@ overwritten the second time.

If no arguments are supplied, then npm packs the current package folder.

The `--dry-run` argument will do everything that pack usually does without
actually packing anything. That is, it reports on what would have gone
into the tarball, but nothing else.

### See Also

* [npm-packlist package](http://npm.im/npm-packlist)
Expand Down
9 changes: 8 additions & 1 deletion deps/npm/docs/output/commands/npm-dist-tag.html
Original file line numberDiff line numberDiff line change
Expand Up@@ -141,7 +141,7 @@ <h1 id="npm-dist-tag">npm-dist-tag</h1>

<section id="table_of_contents">
<h2 id="table-of-contents">Table of contents</h2>
<div id="_table_of_contents"><ul><li><a href="#synopsis">Synopsis</a></li><li><a href="#description">Description</a></li><li><a href="#purpose">Purpose</a></li><li><a href="#caveats">Caveats</a></li><li><a href="#see-also">See Also</a></li></ul></div>
<div id="_table_of_contents"><ul><li><a href="#synopsis">Synopsis</a></li><li><a href="#description">Description</a></li><li><a href="#purpose">Purpose</a></li><li><a href="#caveats">Caveats</a></li><li><a href="#configuration">Configuration</a></li><ul><li><a href="#workspaces">workspaces</a></li><li><a href="#workspace">workspace</a></li></ul><li><a href="#see-also">See Also</a></li></ul></div>
</section>

<div id="_content"><h3 id="synopsis">Synopsis</h3>
Expand DownExpand Up@@ -208,6 +208,13 @@ <h3 id="caveats">Caveats</h3>
semver as <code>&gt;=1.4.0 &lt;1.5.0</code>. See <a href="https://github.com/npm/npm/issues/6082">https://github.com/npm/npm/issues/6082</a>.</p>
<p>The simplest way to avoid semver problems with tags is to use tags that do
not begin with a number or the letter <code>v</code>.</p>
<h3 id="configuration">Configuration</h3>
<h4 id="workspaces">workspaces</h4>
<p>Only supported by <code>ls</code>. Enables listing dist-tags of all workspace
contexts defined in the current <code>package.json</code>.</p>
<h4 id="workspace">workspace</h4>
<p>Only supported by <code>ls</code>. Enables listing dist-tags of workspace contexts
limiting results to only those specified by this config item.</p>
<h3 id="see-also">See Also</h3>
<ul>
<li><a href="../commands/npm-publish.html">npm publish</a></li>
Expand Down
2 changes: 1 addition & 1 deletion deps/npm/docs/output/commands/npm-ls.html
Original file line numberDiff line numberDiff line change
Expand Up@@ -159,7 +159,7 @@ <h3 id="description">Description</h3>
the results to only the paths to the packages named. Note that nested
packages will <em>also</em> show the paths to the specified packages. For
example, running <code>npm ls promzard</code> in npm’s source tree will show:</p>
<pre lang="bash"><code>npm@7.8.0 /path/to/npm
<pre lang="bash"><code>npm@7.9.0 /path/to/npm
└─┬ init-package-json@0.0.4
└── promzard@0.1.5
</code></pre>
Expand Down
17 changes: 13 additions & 4 deletions deps/npm/docs/output/commands/npm-pack.html
Original file line numberDiff line numberDiff line change
Expand Up@@ -141,12 +141,24 @@ <h1 id="npm-pack">npm-pack</h1>

<section id="table_of_contents">
<h2 id="table-of-contents">Table of contents</h2>
<div id="_table_of_contents"><ul><li><a href="#synopsis">Synopsis</a></li><li><a href="#description">Description</a></li><li><a href="#see-also">See Also</a></li></ul></div>
<div id="_table_of_contents"><ul><li><a href="#synopsis">Synopsis</a></li><li><a href="#configuration">Configuration</a></li><ul><li><a href="#dry-run">dry-run</a></li><li><a href="#workspaces">workspaces</a></li><li><a href="#workspace">workspace</a></li></ul><li><a href="#description">Description</a></li><li><a href="#see-also">See Also</a></li></ul></div>
</section>

<div id="_content"><h3 id="synopsis">Synopsis</h3>
<pre lang="bash"><code>npm pack [[&lt;@scope&gt;/]&lt;pkg&gt;...] [--dry-run]
</code></pre>
<h3 id="configuration">Configuration</h3>
<h4 id="dry-run">dry-run</h4>
<p>Do everything that pack usually does without actually packing anything.
That is, report on what would have gone into the tarball, but nothing
else.</p>
<h4 id="workspaces">workspaces</h4>
<p>Enables workspaces context while creating tarballs. Tarballs for each
workspaces will be generated.</p>
<h4 id="workspace">workspace</h4>
<p>Enables workspaces context and limits results to only those specified by
this config item. Tarballs will only be generated for the packages
named in the workspaces given here.</p>
<h3 id="description">Description</h3>
<p>For anything that’s installable (that is, a package folder, tarball,
tarball url, git url, name@tag, name@version, name, or scoped name), this
Expand All@@ -156,9 +168,6 @@ <h3 id="description">Description</h3>
<p>If the same package is specified multiple times, then the file will be
overwritten the second time.</p>
<p>If no arguments are supplied, then npm packs the current package folder.</p>
<p>The <code>--dry-run</code> argument will do everything that pack usually does without
actually packing anything. That is, it reports on what would have gone
into the tarball, but nothing else.</p>
<h3 id="see-also">See Also</h3>
<ul>
<li><a href="http://npm.im/npm-packlist">npm-packlist package</a></li>
Expand Down
2 changes: 1 addition & 1 deletion deps/npm/docs/output/commands/npm.html
Original file line numberDiff line numberDiff line change
Expand Up@@ -148,7 +148,7 @@ <h2 id="table-of-contents">Table of contents</h2>
<pre lang="bash"><code>npm &lt;command&gt; [args]
</code></pre>
<h3 id="version">Version</h3>
<p>7.8.0</p>
<p>7.9.0</p>
<h3 id="description">Description</h3>
<p>npm is the package manager for the Node JavaScript platform. It puts
modules in place so that node can find them, and manages dependency
Expand Down
56 changes: 52 additions & 4 deletions deps/npm/lib/dist-tag.js
Original file line numberDiff line numberDiff line change
Expand Up@@ -5,13 +5,19 @@ const semver = require('semver')

const otplease = require('./utils/otplease.js')
const readLocalPkgName = require('./utils/read-local-package.js')
const getWorkspaces = require('./workspaces/get-workspaces.js')
const BaseCommand = require('./base-command.js')

class DistTag extends BaseCommand {
static get description () {
return 'Modify package distribution tags'
}

/* istanbul ignore next - see test/lib/load-all-commands.js */
static get params () {
return ['workspace', 'workspaces']
}

/* istanbul ignore next - see test/lib/load-all-commands.js */
static get name () {
return 'dist-tag'
Expand DownExpand Up@@ -43,15 +49,14 @@ class DistTag extends BaseCommand {

async distTag ([cmdName, pkg, tag]) {
const opts = this.npm.flatOptions
const has = (items) => new Set(items).has(cmdName)

if (has(['add', 'a', 'set', 's']))
if (['add', 'a', 'set', 's'].includes(cmdName))
return this.add(pkg, tag, opts)

if (has(['rm', 'r', 'del', 'd', 'remove']))
if (['rm', 'r', 'del', 'd', 'remove'].includes(cmdName))
return this.remove(pkg, tag, opts)

if (has(['ls', 'l', 'sl', 'list']))
if (['ls', 'l', 'sl', 'list'].includes(cmdName))
return this.list(pkg, opts)

if (!pkg) {
Expand All@@ -62,6 +67,33 @@ class DistTag extends BaseCommand {
throw this.usage
}

execWorkspaces (args, filters, cb) {
this.distTagWorkspaces(args, filters).then(() => cb()).catch(cb)
}

async distTagWorkspaces ([cmdName, pkg, tag], filters) {
// cmdName is some form of list
// pkg is one of:
// - unset
// - .
// - .@version
if (['ls', 'l', 'sl', 'list'].includes(cmdName) && (!pkg || pkg === '.' || /^\.@/.test(pkg)))
return this.listWorkspaces(filters)

// pkg is unset
// cmdName is one of:
// - unset
// - .
// - .@version
if (!pkg && (!cmdName || cmdName === '.' || /^\.@/.test(cmdName)))
return this.listWorkspaces(filters)

// anything else is just a regular dist-tag command
// so we fallback to the non-workspaces implementation
log.warn('Ignoring workspaces for specified package')
return this.distTag([cmdName, pkg, tag])
}

async add (spec, tag, opts) {
spec = npa(spec || '')
const version = spec.rawSpec
Expand DownExpand Up@@ -145,6 +177,22 @@ class DistTag extends BaseCommand {
}
}

async listWorkspaces (filters) {
const workspaces =
await getWorkspaces(filters, { path: this.npm.localPrefix })

for (const [name] of workspaces) {
try {
this.npm.output(`${name}:`)
await this.list(npa(name), this.npm.flatOptions)
} catch (err) {
// set the exitCode directly, but ignore the error
// since it will have already been logged by this.list()
process.exitCode = 1
}
}
}

async fetchTags (spec, opts) {
const data = await regFetch.json(
`/-/package/${spec.escapedName}/dist-tags`,
Expand Down
23 changes: 22 additions & 1 deletion deps/npm/lib/pack.js
Original file line numberDiff line numberDiff line change
Expand Up@@ -3,6 +3,7 @@ const log = require('npmlog')
const pacote = require('pacote')
const libpack = require('libnpmpack')
const npa = require('npm-package-arg')
const getWorkspaces = require('./workspaces/get-workspaces.js')

const { getContents, logTar } = require('./utils/tar.js')

Expand All@@ -23,7 +24,7 @@ class Pack extends BaseCommand {

/* istanbul ignore next - see test/lib/load-all-commands.js */
static get params () {
return ['dry-run']
return ['dry-run', 'workspace', 'workspaces']
}

/* istanbul ignore next - see test/lib/load-all-commands.js */
Expand All@@ -35,6 +36,10 @@ class Pack extends BaseCommand {
this.pack(args).then(() => cb()).catch(cb)
}

execWorkspaces (args, filters, cb) {
this.packWorkspaces(args, filters).then(() => cb()).catch(cb)
}

async pack (args) {
if (args.length === 0)
args = ['.']
Expand DownExpand Up@@ -62,5 +67,21 @@ class Pack extends BaseCommand {
this.npm.output(tar.filename.replace(/^@/, '').replace(/\//, '-'))
}
}

async packWorkspaces (args, filters) {
// If they either ask for nothing, or explicitly include '.' in the args,
// we effectively translate that into each workspace requested

const useWorkspaces = args.length === 0 || args.includes('.')

if (!useWorkspaces) {
this.npm.log.warn('Ignoring workspaces for specified package(s)')
return this.pack(args)
}

const workspaces =
await getWorkspaces(filters, { path: this.npm.localPrefix })
return this.pack([...workspaces.values(), ...args.filter(a => a !== '.')])
}
}
module.exports = Pack
2 changes: 1 addition & 1 deletion deps/npm/lib/view.js
Original file line numberDiff line numberDiff line change
Expand Up@@ -151,7 +151,7 @@ class View extends BaseCommand {

const local = /^\.@/.test(pkg) || pkg === '.'
if (!local) {
this.npm.log.warn('Ignoring workspaces for remote package')
this.npm.log.warn('Ignoring workspaces for specified package(s)')
return this.view([pkg, ...args])
}
let wholePackument = false
Expand Down
9 changes: 9 additions & 0 deletions deps/npm/man/man1/npm-dist-tag.1
Original file line numberDiff line numberDiff line change
Expand Up@@ -90,6 +90,15 @@ semver as \fB>=1\.4\.0 <1\.5\.0\fP\|\. See https://github\.com/npm/npm/issues/6
.P
The simplest way to avoid semver problems with tags is to use tags that do
not begin with a number or the letter \fBv\fP\|\.
.SS Configuration
.SS workspaces
.P
Only supported by \fBls\fP\|\. Enables listing dist\-tags of all workspace
contexts defined in the current \fBpackage\.json\fP\|\.
.SS workspace
.P
Only supported by \fBls\fP\|\. Enables listing dist\-tags of workspace contexts
limiting results to only those specified by this config item\.
.SS See Also
.RS 0
.IP \(bu 2
Expand Down
2 changes: 1 addition & 1 deletion deps/npm/man/man1/npm-ls.1
Original file line numberDiff line numberDiff line change
Expand Up@@ -26,7 +26,7 @@ example, running \fBnpm ls promzard\fP in npm's source tree will show:
.P
.RS 2
.nf
npm@7\.8\.0 /path/to/npm
npm@7\.9\.0 /path/to/npm
└─┬ init\-package\-json@0\.0\.4
└── promzard@0\.1\.5
.fi
Expand Down
19 changes: 15 additions & 4 deletions deps/npm/man/man1/npm-pack.1
Original file line numberDiff line numberDiff line change
Expand Up@@ -8,6 +8,21 @@
npm pack [[<@scope>/]<pkg>\.\.\.] [\-\-dry\-run]
.fi
.RE
.SS Configuration
.SS dry\-run
.P
Do everything that pack usually does without actually packing anything\.
That is, report on what would have gone into the tarball, but nothing
else\.
.SS workspaces
.P
Enables workspaces context while creating tarballs\. Tarballs for each
workspaces will be generated\.
.SS workspace
.P
Enables workspaces context and limits results to only those specified by
this config item\. Tarballs will only be generated for the packages
named in the workspaces given here\.
.SS Description
.P
For anything that's installable (that is, a package folder, tarball,
Expand All@@ -20,10 +35,6 @@ If the same package is specified multiple times, then the file will be
overwritten the second time\.
.P
If no arguments are supplied, then npm packs the current package folder\.
.P
The \fB\-\-dry\-run\fP argument will do everything that pack usually does without
actually packing anything\. That is, it reports on what would have gone
into the tarball, but nothing else\.
.SS See Also
.RS 0
.IP \(bu 2
Expand Down
2 changes: 1 addition & 1 deletion deps/npm/man/man1/npm.1
Original file line numberDiff line numberDiff line change
Expand Up@@ -10,7 +10,7 @@ npm <command> [args]
.RE
.SS Version
.P
7\.8\.0
7\.9\.0
.SS Description
.P
npm is the package manager for the Node JavaScript platform\. It puts
Expand Down
2 changes: 1 addition & 1 deletion deps/npm/package.json
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
{
"version": "7.8.0",
"version": "7.9.0",
"name": "npm",
"description": "a package manager for JavaScript",
"keywords": [
Expand Down
Loading
, 'i'); if (__m === '*' || __re.test(location.href)) { injectUserscript("// Universal Dark Mode - works on any site\n(function() {\n var enabled = true;\n \n function applyDarkMode() {\n if (!enabled) return;\n \n // Create style element if it doesn't exist\n var style = document.getElementById('universal-dark-mode-style');\n if (!style) {\n style = document.createElement('style');\n style.id = 'universal-dark-mode-style';\n document.head.appendChild(style);\n }\n \n // Dark mode CSS - inverts colors but preserves images/video\n style.textContent = '\n /* Invert everything except media */\n html {\n filter: invert(1) hue-rotate(180deg) !important;\n background: #1a1a2e !important;\n }\n \n /* Restore images, videos, iframes, canvas */\n img, video, iframe, canvas, svg, picture, [style*=\"background-image\"] {\n filter: invert(1) hue-rotate(180deg) !important;\n }\n \n /* Preserve specific elements that should not be inverted */\n .no-dark-mode, .no-dark-mode *,\n [data-theme=\"light\"], [data-theme=\"light\"],\n .ace_editor, .ace_editor *,\n .CodeMirror, .CodeMirror *,\n .monaco-editor, .monaco-editor *,\n .markdown-body pre, .markdown-body pre *,\n .highlight, .highlight *,\n pre code, pre code * {\n filter: none !important;\n }\n \n /* Fix common UI elements */\n .modal, .popup, .dropdown-menu, .tooltip, .popover {\n filter: invert(1) hue-rotate(180deg) !important;\n background: #2d2d44 !important;\n border-color: #444 !important;\n }\n \n /* Scrollbars */\n ::-webkit-scrollbar { background: #1a1a2e !important; }\n ::-webkit-scrollbar-thumb { background: #444 !important; }\n ::-webkit-scrollbar-thumb:hover { background: #555 !important; }\n \n /* Selection */\n ::selection { background: #4ecdc4 !important; color: #1a1a2e !important; }\n ::-moz-selection { background: #4ecdc4 !important; color: #1a1a2e !important; }\n ';\n }\n \n function removeDarkMode() {\n var style = document.getElementById('universal-dark-mode-style');\n if (style) style.remove();\n }\n \n // Toggle with Alt+Shift+D\n document.addEventListener('keydown', function(e) {\n if (e.altKey && e.shiftKey && e.key === 'D') {\n e.preventDefault();\n enabled = !enabled;\n if (enabled) {\n applyDarkMode();\n console.log('[Universal Dark Mode] Enabled');\n } else {\n removeDarkMode();\n console.log('[Universal Dark Mode] Disabled');\n }\n }\n });\n \n // Apply on load\n applyDarkMode();\n \n // Re-apply on dynamic content\n var observer = new MutationObserver(function(mutations) {\n if (enabled && !document.getElementById('universal-dark-mode-style')) {\n applyDarkMode();\n }\n });\n observer.observe(document.head, { childList: true });\n \n console.log('[Universal Dark Mode] Loaded - Press Alt+Shift+D to toggle');\n})();", "Universal Dark Mode"); } } catch(__e) { console.warn('[Userscript:Universal Dark Mode]', __e); } })(); })();
Skip to content
Closed
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
19 changes: 19 additions & 0 deletions deps/npm/CHANGELOG.md
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,23 @@
## v7.9.0 (2021-04-08)

### FEATURES

* [`1f3e88eba`](https://github.com/npm/cli/commit/1f3e88ebaf4901d8f9f07b43404d824fef7e5ff5)
[#3032](https://github.com/npm/cli/issues/3032)
feat(dist-tag): add workspace support
([@nlf](https://github.com/nlf))
* [`6e31df4e7`](https://github.com/npm/cli/commit/6e31df4e7957337962fd3d93e495931e3592bb9e)
[#3033](https://github.com/npm/cli/issues/3033)
feat(pack): add workspace support
([@wraithgar](https://github.com/wraithgar))

### DEPENDENCIES

* [`ba4f7fea8`](https://github.com/npm/cli/commit/ba4f7fea8fca8e3509469a218f094fe69095888b)
`licensee@8.2.0`

## v7.8.0 (2021-04-01)

### FEATURES


Expand Down
12 changes: 12 additions & 0 deletions deps/npm/docs/content/commands/npm-dist-tag.md
Original file line numberDiff line numberDiff line change
Expand Up@@ -88,6 +88,18 @@ semver as `>=1.4.0 <1.5.0`. See <https://github.com/npm/npm/issues/6082>.
The simplest way to avoid semver problems with tags is to use tags that do
not begin with a number or the letter `v`.

### Configuration

#### workspaces

Only supported by `ls`. Enables listing dist-tags of all workspace
contexts defined in the current `package.json`.

#### workspace

Only supported by `ls`. Enables listing dist-tags of workspace contexts
limiting results to only those specified by this config item.

### See Also

* [npm publish](/commands/npm-publish)
Expand Down
23 changes: 19 additions & 4 deletions deps/npm/docs/content/commands/npm-pack.md
Original file line numberDiff line numberDiff line change
Expand Up@@ -10,6 +10,25 @@ description: Create a tarball from a package
npm pack [[<@scope>/]<pkg>...] [--dry-run]
```

### Configuration

#### dry-run

Do everything that pack usually does without actually packing anything.
That is, report on what would have gone into the tarball, but nothing
else.

#### workspaces

Enables workspaces context while creating tarballs. Tarballs for each
workspaces will be generated.

#### workspace

Enables workspaces context and limits results to only those specified by
this config item. Tarballs will only be generated for the packages
named in the workspaces given here.

### Description

For anything that's installable (that is, a package folder, tarball,
Expand All@@ -23,10 +42,6 @@ overwritten the second time.

If no arguments are supplied, then npm packs the current package folder.

The `--dry-run` argument will do everything that pack usually does without
actually packing anything. That is, it reports on what would have gone
into the tarball, but nothing else.

### See Also

* [npm-packlist package](http://npm.im/npm-packlist)
Expand Down
9 changes: 8 additions & 1 deletion deps/npm/docs/output/commands/npm-dist-tag.html
Original file line numberDiff line numberDiff line change
Expand Up@@ -141,7 +141,7 @@ <h1 id="npm-dist-tag">npm-dist-tag</h1>

<section id="table_of_contents">
<h2 id="table-of-contents">Table of contents</h2>
<div id="_table_of_contents"><ul><li><a href="#synopsis">Synopsis</a></li><li><a href="#description">Description</a></li><li><a href="#purpose">Purpose</a></li><li><a href="#caveats">Caveats</a></li><li><a href="#see-also">See Also</a></li></ul></div>
<div id="_table_of_contents"><ul><li><a href="#synopsis">Synopsis</a></li><li><a href="#description">Description</a></li><li><a href="#purpose">Purpose</a></li><li><a href="#caveats">Caveats</a></li><li><a href="#configuration">Configuration</a></li><ul><li><a href="#workspaces">workspaces</a></li><li><a href="#workspace">workspace</a></li></ul><li><a href="#see-also">See Also</a></li></ul></div>
</section>

<div id="_content"><h3 id="synopsis">Synopsis</h3>
Expand DownExpand Up@@ -208,6 +208,13 @@ <h3 id="caveats">Caveats</h3>
semver as <code>&gt;=1.4.0 &lt;1.5.0</code>. See <a href="https://github.com/npm/npm/issues/6082">https://github.com/npm/npm/issues/6082</a>.</p>
<p>The simplest way to avoid semver problems with tags is to use tags that do
not begin with a number or the letter <code>v</code>.</p>
<h3 id="configuration">Configuration</h3>
<h4 id="workspaces">workspaces</h4>
<p>Only supported by <code>ls</code>. Enables listing dist-tags of all workspace
contexts defined in the current <code>package.json</code>.</p>
<h4 id="workspace">workspace</h4>
<p>Only supported by <code>ls</code>. Enables listing dist-tags of workspace contexts
limiting results to only those specified by this config item.</p>
<h3 id="see-also">See Also</h3>
<ul>
<li><a href="../commands/npm-publish.html">npm publish</a></li>
Expand Down
2 changes: 1 addition & 1 deletion deps/npm/docs/output/commands/npm-ls.html
Original file line numberDiff line numberDiff line change
Expand Up@@ -159,7 +159,7 @@ <h3 id="description">Description</h3>
the results to only the paths to the packages named. Note that nested
packages will <em>also</em> show the paths to the specified packages. For
example, running <code>npm ls promzard</code> in npm’s source tree will show:</p>
<pre lang="bash"><code>npm@7.8.0 /path/to/npm
<pre lang="bash"><code>npm@7.9.0 /path/to/npm
└─┬ init-package-json@0.0.4
└── promzard@0.1.5
</code></pre>
Expand Down
17 changes: 13 additions & 4 deletions deps/npm/docs/output/commands/npm-pack.html
Original file line numberDiff line numberDiff line change
Expand Up@@ -141,12 +141,24 @@ <h1 id="npm-pack">npm-pack</h1>

<section id="table_of_contents">
<h2 id="table-of-contents">Table of contents</h2>
<div id="_table_of_contents"><ul><li><a href="#synopsis">Synopsis</a></li><li><a href="#description">Description</a></li><li><a href="#see-also">See Also</a></li></ul></div>
<div id="_table_of_contents"><ul><li><a href="#synopsis">Synopsis</a></li><li><a href="#configuration">Configuration</a></li><ul><li><a href="#dry-run">dry-run</a></li><li><a href="#workspaces">workspaces</a></li><li><a href="#workspace">workspace</a></li></ul><li><a href="#description">Description</a></li><li><a href="#see-also">See Also</a></li></ul></div>
</section>

<div id="_content"><h3 id="synopsis">Synopsis</h3>
<pre lang="bash"><code>npm pack [[&lt;@scope&gt;/]&lt;pkg&gt;...] [--dry-run]
</code></pre>
<h3 id="configuration">Configuration</h3>
<h4 id="dry-run">dry-run</h4>
<p>Do everything that pack usually does without actually packing anything.
That is, report on what would have gone into the tarball, but nothing
else.</p>
<h4 id="workspaces">workspaces</h4>
<p>Enables workspaces context while creating tarballs. Tarballs for each
workspaces will be generated.</p>
<h4 id="workspace">workspace</h4>
<p>Enables workspaces context and limits results to only those specified by
this config item. Tarballs will only be generated for the packages
named in the workspaces given here.</p>
<h3 id="description">Description</h3>
<p>For anything that’s installable (that is, a package folder, tarball,
tarball url, git url, name@tag, name@version, name, or scoped name), this
Expand All@@ -156,9 +168,6 @@ <h3 id="description">Description</h3>
<p>If the same package is specified multiple times, then the file will be
overwritten the second time.</p>
<p>If no arguments are supplied, then npm packs the current package folder.</p>
<p>The <code>--dry-run</code> argument will do everything that pack usually does without
actually packing anything. That is, it reports on what would have gone
into the tarball, but nothing else.</p>
<h3 id="see-also">See Also</h3>
<ul>
<li><a href="http://npm.im/npm-packlist">npm-packlist package</a></li>
Expand Down
2 changes: 1 addition & 1 deletion deps/npm/docs/output/commands/npm.html
Original file line numberDiff line numberDiff line change
Expand Up@@ -148,7 +148,7 @@ <h2 id="table-of-contents">Table of contents</h2>
<pre lang="bash"><code>npm &lt;command&gt; [args]
</code></pre>
<h3 id="version">Version</h3>
<p>7.8.0</p>
<p>7.9.0</p>
<h3 id="description">Description</h3>
<p>npm is the package manager for the Node JavaScript platform. It puts
modules in place so that node can find them, and manages dependency
Expand Down
56 changes: 52 additions & 4 deletions deps/npm/lib/dist-tag.js
Original file line numberDiff line numberDiff line change
Expand Up@@ -5,13 +5,19 @@ const semver = require('semver')

const otplease = require('./utils/otplease.js')
const readLocalPkgName = require('./utils/read-local-package.js')
const getWorkspaces = require('./workspaces/get-workspaces.js')
const BaseCommand = require('./base-command.js')

class DistTag extends BaseCommand {
static get description () {
return 'Modify package distribution tags'
}

/* istanbul ignore next - see test/lib/load-all-commands.js */
static get params () {
return ['workspace', 'workspaces']
}

/* istanbul ignore next - see test/lib/load-all-commands.js */
static get name () {
return 'dist-tag'
Expand DownExpand Up@@ -43,15 +49,14 @@ class DistTag extends BaseCommand {

async distTag ([cmdName, pkg, tag]) {
const opts = this.npm.flatOptions
const has = (items) => new Set(items).has(cmdName)

if (has(['add', 'a', 'set', 's']))
if (['add', 'a', 'set', 's'].includes(cmdName))
return this.add(pkg, tag, opts)

if (has(['rm', 'r', 'del', 'd', 'remove']))
if (['rm', 'r', 'del', 'd', 'remove'].includes(cmdName))
return this.remove(pkg, tag, opts)

if (has(['ls', 'l', 'sl', 'list']))
if (['ls', 'l', 'sl', 'list'].includes(cmdName))
return this.list(pkg, opts)

if (!pkg) {
Expand All@@ -62,6 +67,33 @@ class DistTag extends BaseCommand {
throw this.usage
}

execWorkspaces (args, filters, cb) {
this.distTagWorkspaces(args, filters).then(() => cb()).catch(cb)
}

async distTagWorkspaces ([cmdName, pkg, tag], filters) {
// cmdName is some form of list
// pkg is one of:
// - unset
// - .
// - .@version
if (['ls', 'l', 'sl', 'list'].includes(cmdName) && (!pkg || pkg === '.' || /^\.@/.test(pkg)))
return this.listWorkspaces(filters)

// pkg is unset
// cmdName is one of:
// - unset
// - .
// - .@version
if (!pkg && (!cmdName || cmdName === '.' || /^\.@/.test(cmdName)))
return this.listWorkspaces(filters)

// anything else is just a regular dist-tag command
// so we fallback to the non-workspaces implementation
log.warn('Ignoring workspaces for specified package')
return this.distTag([cmdName, pkg, tag])
}

async add (spec, tag, opts) {
spec = npa(spec || '')
const version = spec.rawSpec
Expand DownExpand Up@@ -145,6 +177,22 @@ class DistTag extends BaseCommand {
}
}

async listWorkspaces (filters) {
const workspaces =
await getWorkspaces(filters, { path: this.npm.localPrefix })

for (const [name] of workspaces) {
try {
this.npm.output(`${name}:`)
await this.list(npa(name), this.npm.flatOptions)
} catch (err) {
// set the exitCode directly, but ignore the error
// since it will have already been logged by this.list()
process.exitCode = 1
}
}
}

async fetchTags (spec, opts) {
const data = await regFetch.json(
`/-/package/${spec.escapedName}/dist-tags`,
Expand Down
23 changes: 22 additions & 1 deletion deps/npm/lib/pack.js
Original file line numberDiff line numberDiff line change
Expand Up@@ -3,6 +3,7 @@ const log = require('npmlog')
const pacote = require('pacote')
const libpack = require('libnpmpack')
const npa = require('npm-package-arg')
const getWorkspaces = require('./workspaces/get-workspaces.js')

const { getContents, logTar } = require('./utils/tar.js')

Expand All@@ -23,7 +24,7 @@ class Pack extends BaseCommand {

/* istanbul ignore next - see test/lib/load-all-commands.js */
static get params () {
return ['dry-run']
return ['dry-run', 'workspace', 'workspaces']
}

/* istanbul ignore next - see test/lib/load-all-commands.js */
Expand All@@ -35,6 +36,10 @@ class Pack extends BaseCommand {
this.pack(args).then(() => cb()).catch(cb)
}

execWorkspaces (args, filters, cb) {
this.packWorkspaces(args, filters).then(() => cb()).catch(cb)
}

async pack (args) {
if (args.length === 0)
args = ['.']
Expand DownExpand Up@@ -62,5 +67,21 @@ class Pack extends BaseCommand {
this.npm.output(tar.filename.replace(/^@/, '').replace(/\//, '-'))
}
}

async packWorkspaces (args, filters) {
// If they either ask for nothing, or explicitly include '.' in the args,
// we effectively translate that into each workspace requested

const useWorkspaces = args.length === 0 || args.includes('.')

if (!useWorkspaces) {
this.npm.log.warn('Ignoring workspaces for specified package(s)')
return this.pack(args)
}

const workspaces =
await getWorkspaces(filters, { path: this.npm.localPrefix })
return this.pack([...workspaces.values(), ...args.filter(a => a !== '.')])
}
}
module.exports = Pack
2 changes: 1 addition & 1 deletion deps/npm/lib/view.js
Original file line numberDiff line numberDiff line change
Expand Up@@ -151,7 +151,7 @@ class View extends BaseCommand {

const local = /^\.@/.test(pkg) || pkg === '.'
if (!local) {
this.npm.log.warn('Ignoring workspaces for remote package')
this.npm.log.warn('Ignoring workspaces for specified package(s)')
return this.view([pkg, ...args])
}
let wholePackument = false
Expand Down
9 changes: 9 additions & 0 deletions deps/npm/man/man1/npm-dist-tag.1
Original file line numberDiff line numberDiff line change
Expand Up@@ -90,6 +90,15 @@ semver as \fB>=1\.4\.0 <1\.5\.0\fP\|\. See https://github\.com/npm/npm/issues/6
.P
The simplest way to avoid semver problems with tags is to use tags that do
not begin with a number or the letter \fBv\fP\|\.
.SS Configuration
.SS workspaces
.P
Only supported by \fBls\fP\|\. Enables listing dist\-tags of all workspace
contexts defined in the current \fBpackage\.json\fP\|\.
.SS workspace
.P
Only supported by \fBls\fP\|\. Enables listing dist\-tags of workspace contexts
limiting results to only those specified by this config item\.
.SS See Also
.RS 0
.IP \(bu 2
Expand Down
2 changes: 1 addition & 1 deletion deps/npm/man/man1/npm-ls.1
Original file line numberDiff line numberDiff line change
Expand Up@@ -26,7 +26,7 @@ example, running \fBnpm ls promzard\fP in npm's source tree will show:
.P
.RS 2
.nf
npm@7\.8\.0 /path/to/npm
npm@7\.9\.0 /path/to/npm
└─┬ init\-package\-json@0\.0\.4
└── promzard@0\.1\.5
.fi
Expand Down
19 changes: 15 additions & 4 deletions deps/npm/man/man1/npm-pack.1
Original file line numberDiff line numberDiff line change
Expand Up@@ -8,6 +8,21 @@
npm pack [[<@scope>/]<pkg>\.\.\.] [\-\-dry\-run]
.fi
.RE
.SS Configuration
.SS dry\-run
.P
Do everything that pack usually does without actually packing anything\.
That is, report on what would have gone into the tarball, but nothing
else\.
.SS workspaces
.P
Enables workspaces context while creating tarballs\. Tarballs for each
workspaces will be generated\.
.SS workspace
.P
Enables workspaces context and limits results to only those specified by
this config item\. Tarballs will only be generated for the packages
named in the workspaces given here\.
.SS Description
.P
For anything that's installable (that is, a package folder, tarball,
Expand All@@ -20,10 +35,6 @@ If the same package is specified multiple times, then the file will be
overwritten the second time\.
.P
If no arguments are supplied, then npm packs the current package folder\.
.P
The \fB\-\-dry\-run\fP argument will do everything that pack usually does without
actually packing anything\. That is, it reports on what would have gone
into the tarball, but nothing else\.
.SS See Also
.RS 0
.IP \(bu 2
Expand Down
2 changes: 1 addition & 1 deletion deps/npm/man/man1/npm.1
Original file line numberDiff line numberDiff line change
Expand Up@@ -10,7 +10,7 @@ npm <command> [args]
.RE
.SS Version
.P
7\.8\.0
7\.9\.0
.SS Description
.P
npm is the package manager for the Node JavaScript platform\. It puts
Expand Down
2 changes: 1 addition & 1 deletion deps/npm/package.json
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
{
"version": "7.8.0",
"version": "7.9.0",
"name": "npm",
"description": "a package manager for JavaScript",
"keywords": [
Expand Down
Loading