Skip to content

Instantly share code, notes, and snippets.

View isaacs's full-sized avatar
🔮
only way out is through

isaacs isaacs

🔮
only way out is through
View GitHub Profile
diff --git a/lib/shrinkwrap.js b/lib/shrinkwrap.js
index cff9f096..0a19ef93 100644
--- a/lib/shrinkwrap.js
+++ b/lib/shrinkwrap.js
@@ -714,6 +714,7 @@ class Shrinkwrap {
resolved,
integrity,
hasShrinkwrap,
+ version,
} = this.get(node.path)
#!/bin/bash
rm -rf packages package-lock.json node_modules
cat >package.json <<PJ
{
"devDependencies": {
"abbrev": "1.1.0"
}
}
TAP version 13
# Subtest: create all fixtures
ok 1 - manual/sync created
ok 2 - manual/async created
ok 3 - windows/sync created
ok 4 - windows/async created
ok 5 - posix/sync created
ok 6 - posix/async created
ok 7 - native/sync created
ok 8 - native/async created
const {
rmSync,
promises: {
rm,
},
} = require('fs')
const rimrafNative = (path, opts) => rm(path, {
...opts,
force: true,
diff --git a/docs/content/commands/npm-ls.md b/docs/content/commands/npm-ls.md
index fb752742d..3c6621763 100644
--- a/docs/content/commands/npm-ls.md
+++ b/docs/content/commands/npm-ls.md
@@ -199,6 +199,16 @@ brand new workspace within the project.
This value is not exported to the environment for child processes.
+#### `workspaces`
+
diff --git a/lib/utils/explain-dep.js b/lib/utils/explain-dep.js
index 765839231..944b4be62 100644
--- a/lib/utils/explain-dep.js
+++ b/lib/utils/explain-dep.js
@@ -108,7 +108,7 @@ const explainDependents = ({ name, dependents }, depth, color) => {
const explainEdge = ({ name, type, bundled, from, spec }, depth, color) => {
const { bold } = color ? chalk : nocolor
const dep = type === 'workspace'
- ? bold(relative('.', spec.slice('file:'.length)))
+ ? bold(relative(from.location, spec.slice('file:'.length)))
diff --git a/lib/utils/explain-dep.js b/lib/utils/explain-dep.js
index c01bc780b..7cb726296 100644
--- a/lib/utils/explain-dep.js
+++ b/lib/utils/explain-dep.js
@@ -7,19 +7,24 @@ const nocolor = {
cyan: s => s,
magenta: s => s,
blue: s => s,
+ green: s => s,
}
diff --git a/lib/node.js b/lib/node.js
index 1bb84140..d17e4b2a 100644
--- a/lib/node.js
+++ b/lib/node.js
@@ -400,6 +400,10 @@ class Node {
for (const edge of edges)
why.dependents.push(edge.explain(seen))
}
+
+ if (this.linksIn.size)
diff --git a/docs/content/commands/npm-exec.md b/docs/content/commands/npm-exec.md
index 2364da32c..f728ac6e0 100644
--- a/docs/content/commands/npm-exec.md
+++ b/docs/content/commands/npm-exec.md
@@ -260,18 +260,21 @@ an error.
#### workspace
-* Alias: `-w`
-* Type: Array
// package.json in the project root
{
"name": "my-workspace-project",
"version": "1.2.3",
"workspaces": {
"packages": [
// four packages in the folder
// w: should share peer and intra-project deps with other workspaces
// x: has peerDependency on react-native, should be isolated
// y: depends on z, but at a different version, by design