-
Notifications
You must be signed in to change notification settings - Fork 30k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
PR-URL: #36543 Reviewed-By: Luigi Pinca <[email protected]> Reviewed-By: Anna Henningsen <[email protected]> Reviewed-By: Ruy Adorno <[email protected]> Reviewed-By: Joyee Cheung <[email protected]>
- Loading branch information
1 parent
7b8d373
commit b0393fa
Showing
41 changed files
with
2,217 additions
and
562 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,62 @@ | ||
## 7.2.0 (2020-12-15) | ||
|
||
### FEATURES | ||
|
||
* [`a9c4b158c`](https://github.com/npm/cli/commit/a9c4b158c46dd0d0c8d8744a97750ffd0c30cc09) | ||
[#2342](https://github.com/npm/cli/issues/2342) | ||
allow npm rebuild to accept a path to a module | ||
([@nlf](https://github.com/nlf)) | ||
|
||
### DEPENDENCIES | ||
|
||
* [`beb371800`](https://github.com/npm/cli/commit/beb371800292140bf3882253c447168a378bc154) | ||
[#2334](https://github.com/npm/cli/issues/2334) | ||
remove unused top level dep tough-cookie | ||
([@darcyclarke](https://github.com/darcyclarke)) | ||
* [`d45e181d1`](https://github.com/npm/cli/commit/d45e181d17dd88d82b3a97f8d9cd5fa5b6230e48) | ||
[#2335](https://github.com/npm/cli/issues/2335) | ||
`[email protected]`, `@npmcli/[email protected]` | ||
([@isaacs](https://github.com/isaacs)) | ||
* [`ef4b18b5a`](https://github.com/npm/cli/commit/ef4b18b5a70381b264d234817cff32eeb6848a73) | ||
[#2309](https://github.com/npm/cli/issues/2309) | ||
`@npmcli/[email protected]` | ||
* properly remove deps when no lockfile and package.json is present | ||
* [`c6c013e6e`](https://github.com/npm/cli/commit/c6c013e6ebc4fe036695db1fd491eb68f3b57c68) | ||
`[email protected]` | ||
* [`a1a2134aa`](https://github.com/npm/cli/commit/a1a2134aa9a1092493db6d6c9a729ff5203f0dd4) | ||
remove unused sorted-object dep | ||
([@nlf](https://github.com/nlf)) | ||
* [`85c2a2d31`](https://github.com/npm/cli/commit/85c2a2d318ae066fb2c161174f5aea97e18bc9c5) | ||
[#2344](https://github.com/npm/cli/issues/2344) | ||
remove editor dependency | ||
([@nlf](https://github.com/nlf)) | ||
|
||
### TESTING | ||
|
||
* [`3a6dd511c`](https://github.com/npm/cli/commit/3a6dd511c944c5f2699825a99bba1dde333a45ef) | ||
npm edit | ||
([@nlf](https://github.com/nlf)) | ||
* [`3ba5de4e7`](https://github.com/npm/cli/commit/3ba5de4e7f6c5c0f995a29844926d6ed2833addd) | ||
[#2347](https://github.com/npm/cli/issues/2347) | ||
npm help-search | ||
([@nlf](https://github.com/nlf)) | ||
* [`6caf19f49`](https://github.com/npm/cli/commit/6caf19f491e144be3e2a1a50f492dad48b01f361) | ||
[#2348](https://github.com/npm/cli/issues/2348) | ||
npm help | ||
([@nlf](https://github.com/nlf)) | ||
* [`cb5847e32`](https://github.com/npm/cli/commit/cb5847e3203c52062485b5de68e4f6d29b33c361) | ||
[#2349](https://github.com/npm/cli/issues/2349) | ||
npm hook | ||
([@nlf](https://github.com/nlf)) | ||
* [`996a2f6b1`](https://github.com/npm/cli/commit/996a2f6b130d6678998a2f6a5ec97d75534d5f66) | ||
[#2353](https://github.com/npm/cli/issues/2353) | ||
npm org | ||
([@nlf](https://github.com/nlf)) | ||
* [`8c67c38a4`](https://github.com/npm/cli/commit/8c67c38a4f476ff5be938db6b6b3ee9ac6b44db5) | ||
[#2354](https://github.com/npm/cli/issues/2354) | ||
npm set | ||
([@nlf](https://github.com/nlf)) | ||
|
||
## 7.1.2 (2020-12-11) | ||
|
||
### DEPENDENCIES | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -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.1.2 /path/to/npm | ||
<pre lang="bash"><code>npm@7.2.0 /path/to/npm | ||
└─┬ [email protected] | ||
└── [email protected] | ||
</code></pre> | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,52 +1,36 @@ | ||
// npm edit <pkg> | ||
// open the package folder in the $EDITOR | ||
|
||
module.exports = edit | ||
edit.usage = 'npm edit <pkg>[/<subpkg>...]' | ||
const { resolve } = require('path') | ||
const fs = require('graceful-fs') | ||
const { spawn } = require('child_process') | ||
const npm = require('./npm.js') | ||
const usageUtil = require('./utils/usage.js') | ||
const splitPackageNames = require('./utils/split-package-names.js') | ||
|
||
edit.completion = require('./utils/completion/installed-shallow.js') | ||
|
||
var npm = require('./npm.js') | ||
var path = require('path') | ||
var fs = require('graceful-fs') | ||
var editor = require('editor') | ||
var noProgressTillDone = require('./utils/no-progress-while-running').tillDone | ||
const usage = usageUtil('edit', 'npm edit <pkg>[/<subpkg>...]') | ||
const completion = require('./utils/completion/installed-shallow.js') | ||
|
||
function edit (args, cb) { | ||
var p = args[0] | ||
if (args.length !== 1 || !p) | ||
return cb(edit.usage) | ||
var e = npm.config.get('editor') | ||
if (!e) { | ||
return cb(new Error( | ||
"No editor set. Set the 'editor' config, or $EDITOR environ." | ||
)) | ||
} | ||
p = p.split('/') | ||
// combine scoped parts | ||
.reduce(function (parts, part) { | ||
if (parts.length === 0) | ||
return [part] | ||
|
||
var lastPart = parts[parts.length - 1] | ||
// check if previous part is the first part of a scoped package | ||
if (lastPart[0] === '@' && !lastPart.includes('/')) | ||
parts[parts.length - 1] += '/' + part | ||
else | ||
parts.push(part) | ||
|
||
return parts | ||
}, []) | ||
.join('/node_modules/') | ||
.replace(/(\/node_modules)+/, '/node_modules') | ||
var f = path.resolve(npm.dir, p) | ||
fs.lstat(f, function (er) { | ||
if (er) | ||
return cb(er) | ||
editor(f, { editor: e }, noProgressTillDone(function (er) { | ||
if (er) | ||
return cb(er) | ||
npm.commands.rebuild(args, cb) | ||
})) | ||
if (args.length !== 1) | ||
return cb(usage) | ||
|
||
const path = splitPackageNames(args[0]) | ||
const dir = resolve(npm.dir, path) | ||
|
||
fs.lstat(dir, (err) => { | ||
if (err) | ||
return cb(err) | ||
|
||
const [bin, ...args] = npm.config.get('editor').split(/\s+/) | ||
const editor = spawn(bin, [...args, dir], { stdio: 'inherit' }) | ||
editor.on('exit', (code) => { | ||
if (code) | ||
return cb(new Error(`editor process exited with code: ${code}`)) | ||
|
||
npm.commands.rebuild([dir], cb) | ||
}) | ||
}) | ||
} | ||
|
||
module.exports = Object.assign(edit, { completion, usage }) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.