Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: npm/cli
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: v6.14.4
Choose a base ref
...
head repository: npm/cli
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: v6.14.5
Choose a head ref
  • 16 commits
  • 31 files changed
  • 5 contributors

Commits on Apr 30, 2020

  1. Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature.
    Copy the full SHA
    b411f76 View commit details

Commits on May 1, 2020

  1. fix: relativize file links when inflating shrinkwrap

    PR-URL: #758
    Credit: @jsnajdr
    Close: #758
    Reviewed-by: @ruyadorno
    jsnajdr authored and ruyadorno committed May 1, 2020
    1

    Verified

    This commit was signed with the committer’s verified signature.
    christophehurpeau Christophe Hurpeau
    Copy the full SHA
    33ec41f View commit details
  2. chore(docs): Fixed example typo & code style in npm-scripts.md

    PR-URL: #1089
    Credit: @NNNaix
    Close: #1089
    Reviewed-by: @ruyadorno
    Naix Geng authored and ruyadorno committed May 1, 2020
    Copy the full SHA
    d16a34f View commit details
  3. docs: fix minor typos in CONTRIBUTING.md

    PR-URL: #1126
    Credit: @dylanzt
    Close: #1126
    Reviewed-by: @ruyadorno
    dylanzt authored and ruyadorno committed May 1, 2020
    Copy the full SHA
    3f7301b View commit details
  4. npm init help wrong command

    PR-URL: #1162
    Credit: @mum-never-proud
    Close: #1162
    Reviewed-by: @ruyadorno
    mum-never-proud authored and ruyadorno committed May 1, 2020
    Copy the full SHA
    94ed456 View commit details
  5. npm-registry-fetch@4.0.4

    ruyadorno committed May 1, 2020
    Copy the full SHA
    5587ac0 View commit details
  6. graceful-fs@4.2.4

    ruyadorno committed May 1, 2020
    Copy the full SHA
    07a4d88 View commit details
  7. mkdirp@0.5.5

    ruyadorno committed May 1, 2020
    Copy the full SHA
    8228d1f View commit details
  8. nopt@4.0.3

    ruyadorno committed May 1, 2020
    Copy the full SHA
    e6d2083 View commit details
  9. docs: changelog for 6.14.5

    ruyadorno committed May 1, 2020
    Copy the full SHA
    725bef8 View commit details
  10. chore: reenable windows ci

    ruyadorno committed May 1, 2020
    Copy the full SHA
    0f219cc View commit details
  11. Copy the full SHA
    36c878d View commit details
  12. Copy the full SHA
    19a0230 View commit details
  13. Copy the full SHA
    1238ee0 View commit details

Commits on May 4, 2020

  1. update AUTHORS

    ruyadorno committed May 4, 2020
    Copy the full SHA
    074f9a5 View commit details
  2. 6.14.5

    ruyadorno committed May 4, 2020
    Copy the full SHA
    abdf528 View commit details
4 changes: 2 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
name: Node CI

on: [push]
on: [push, pull_request]

jobs:
build:
strategy:
fail-fast: false
matrix:
node-version: [6.x, 8.x, 10.x, 12.x]
os: [ubuntu-latest]
os: [ubuntu-latest, windows-latest, macOS-latest]

runs-on: ${{ matrix.os }}

2 changes: 1 addition & 1 deletion .npmignore
Original file line number Diff line number Diff line change
@@ -24,5 +24,5 @@ html/*.png

*.pyc


Session.vim
.nyc_output
3 changes: 0 additions & 3 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -12,9 +12,6 @@ node_js:

env: "DEPLOY_VERSION=testing"

notifications:
slack: npm-inc:kRqQjto7YbINqHPb1X6nS3g8

install:
- "node . install"

4 changes: 4 additions & 0 deletions AUTHORS
Original file line number Diff line number Diff line change
@@ -691,3 +691,7 @@ Vitaliy Markitanov <9357021+vit100@users.noreply.github.com>
simon_s <simon_s@afimilk.co.il>
John Kennedy <john.kennedy.9147@gmail.com>
Bernard Kitchens <bernard@npmjs.com>
Jarda Snajdr <jsnajdr@gmail.com>
Naix Geng <1308363651@qq.com>
Dylan Treisman <dylanzt@gmail.com>
mum-never-proud <abhuz@hotmail.com>
15 changes: 15 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,18 @@
## 6.14.5 (2020-05-01)

### BUG FIXES

* [`33ec41f18`](https://github.com/npm/cli/commit/33ec41f18f557146607cb14a7a38c707fce6d42c) [#758](https://github.com/npm/cli/pull/758) fix: relativize file links when inflating shrinkwrap ([@jsnajdr](https://github.com/jsnajdr))
* [`94ed456df`](https://github.com/npm/cli/commit/94ed456dfb0b122fd4192429024f034d06c3c454) [#1162](https://github.com/npm/cli/pull/1162) fix: npm init help output ([@mum-never-proud](https://github.com/mum-never-proud))

### DEPENDENCIES

* [`5587ac01f`](https://github.com/npm/cli/commit/5587ac01ffd0d2ea830a6bbb67bb34a611ffc409) `npm-registry-fetch@4.0.4`
* [`fc5d94c39`](https://github.com/npm/npm-registry-fetch/commit/fc5d94c39ca218d78df77249ab3a6bf1d9ed9db1) fix: removed default timeout
* [`07a4d8884`](https://github.com/npm/cli/commit/07a4d8884448359bac485a49c05fd2d23d06834b) `graceful-fs@4.2.4`
* [`8228d1f2e`](https://github.com/npm/cli/commit/8228d1f2e427ad9adee617266108acd1ee39b4a5) `mkdirp@0.5.5`
* [`e6d208317`](https://github.com/npm/cli/commit/e6d20831740a84aea766da2a2913cf82a4d56ada) `nopt@4.0.3`

## 6.14.4 (2020-03-24)

### DEPENDENCIES
6 changes: 3 additions & 3 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -73,7 +73,7 @@ All interactions in the npm repository are covered by the [npm Code of Conduct](
# Make sure you install the dependencies first before running tests.
$ npm install
# Run tests for the CLI (it could take awhile).
# Run tests for the CLI (it could take a while).
$ npm run test
```

@@ -97,7 +97,7 @@ $ make link
#################
# ALTERNATIVELY
#################
# If ou're working on a feature or bug, you can run the same command on your
# If you're working on a feature or bug, you can run the same command on your
# working branch and link that code.
# Create new branch to work from (there are many ways)
@@ -130,7 +130,7 @@ let you know that it's sent the request to start the benchmark suite.

![image](https://user-images.githubusercontent.com/2818462/72312698-e2e57f80-3656-11ea-9fcf-4a8f6b97b0d1.png)

If you've updated your pull-reuqest and you'd like to run the the benchmark suite again, simple update your original comment, by adding `test this please ✅` again, or simply just adding another emoji to the **end**. _(The trigger is the phrase "test this please ✅" at the beginning of a comment. Updates will trigger as well, so long as the phrase stays at the beginning.)_.
If you've updated your pull-request and you'd like to run the the benchmark suite again, simple update your original comment, by adding `test this please ✅` again, or simply just adding another emoji to the **end**. _(The trigger is the phrase "test this please ✅" at the beginning of a comment. Updates will trigger as well, so long as the phrase stays at the beginning.)_.

![image](https://user-images.githubusercontent.com/2818462/72313006-ec231c00-3657-11ea-9bd9-227634d67362.png)

10 changes: 5 additions & 5 deletions docs/content/cli-commands/npm.md
Original file line number Diff line number Diff line change
@@ -57,14 +57,14 @@ on a preinstalled git.

If one of the packages npm tries to install is a native node module and
requires compiling of C++ Code, npm will use
[node-gyp](https://github.com/TooTallNate/node-gyp) for that task.
For a Unix system, [node-gyp](https://github.com/TooTallNate/node-gyp)
[node-gyp](https://github.com/nodejs/node-gyp) for that task.
For a Unix system, [node-gyp](https://github.com/nodejs/node-gyp)
needs Python, make and a buildchain like GCC. On Windows,
Python and Microsoft Visual Studio C++ are needed. Python 3 is
not supported by [node-gyp](https://github.com/TooTallNate/node-gyp).
not supported by [node-gyp](https://github.com/nodejs/node-gyp).
For more information visit
[the node-gyp repository](https://github.com/TooTallNate/node-gyp) and
the [node-gyp Wiki](https://github.com/TooTallNate/node-gyp/wiki).
[the node-gyp repository](https://github.com/nodejs/node-gyp) and
the [node-gyp Wiki](https://github.com/nodejs/node-gyp/wiki).

### Directories

42 changes: 28 additions & 14 deletions docs/content/using-npm/scripts.md
Original file line number Diff line number Diff line change
@@ -145,9 +145,15 @@ suites, then those executables will be added to the `PATH` for
executing the scripts. So, if your package.json has this:

```json
{ "name" : "foo"
, "dependencies" : { "bar" : "0.1.x" }
, "scripts": { "start" : "bar ./test" } }
{
"name" : "foo",
"dependencies" : {
"bar" : "0.1.x"
},
"scripts": {
"start" : "bar ./test"
}
}
```

then you could run `npm start` to execute the `bar` script, which is
@@ -176,9 +182,15 @@ there is a config param of `<name>[@<version>]:<key>`. For example,
if the package.json has this:

```json
{ "name" : "foo"
, "config" : { "port" : "8080" }
, "scripts" : { "start" : "node server.js" } }
{
"name" : "foo",
"config" : {
"port" : "8080"
},
"scripts" : {
"start" : "node server.js"
}
}
```

and the server.js is this:
@@ -213,10 +225,11 @@ process.env.npm_package_scripts_install === "foo.js"
For example, if your package.json contains this:

```json
{ "scripts" :
{ "install" : "scripts/install.js"
, "postinstall" : "scripts/postinstall.js"
, "uninstall" : "scripts/uninstall.js"
{
"scripts" : {
"install" : "scripts/install.js",
"postinstall" : "scripts/install.js",
"uninstall" : "scripts/uninstall.js"
}
}
```
@@ -232,10 +245,11 @@ If you want to run a make command, you can do so. This works just
fine:

```json
{ "scripts" :
{ "preinstall" : "./configure"
, "install" : "make && make install"
, "test" : "make test"
{
"scripts" : {
"preinstall" : "./configure",
"install" : "make && make install",
"test" : "make test"
}
}
```
2 changes: 1 addition & 1 deletion lib/init.js
Original file line number Diff line number Diff line change
@@ -63,7 +63,7 @@ function init (args, cb) {
'This utility will walk you through creating a package.json file.',
'It only covers the most common items, and tries to guess sensible defaults.',
'',
'See `npm help json` for definitive documentation on these fields',
'See `npm help init` for definitive documentation on these fields',
'and exactly what they do.',
'',
'Use `npm install <pkg>` afterwards to install a package and',
8 changes: 6 additions & 2 deletions lib/install/deps.js
Original file line number Diff line number Diff line change
@@ -74,7 +74,10 @@ function doesChildVersionMatch (child, requested, requestor) {
var childReq = child.package._requested
if (childReq) {
if (childReq.rawSpec === requested.rawSpec) return true
if (childReq.type === requested.type && childReq.saveSpec === requested.saveSpec) return true
if (childReq.type === requested.type) {
if (childReq.saveSpec === requested.saveSpec) return true
if (childReq.fetchSpec === requested.fetchSpec) return true
}
}
// If _requested didn't exist OR if it didn't match then we'll try using
// _from. We pass it through npa to normalize the specifier.
@@ -200,6 +203,7 @@ function removeObsoleteDep (child, log) {
})
}

exports.packageRelativePath = packageRelativePath
function packageRelativePath (tree) {
if (!tree) return ''
var requested = tree.package._requested || {}
@@ -570,7 +574,7 @@ function addDependency (name, versionSpec, tree, log, done) {
try {
var req = childDependencySpecifier(tree, name, versionSpec)
if (tree.swRequires && tree.swRequires[name]) {
var swReq = childDependencySpecifier(tree, name, tree.swRequires[name], tree.package._where)
var swReq = childDependencySpecifier(tree, name, tree.swRequires[name])
}
} catch (err) {
return done(err)
7 changes: 5 additions & 2 deletions lib/install/get-requested.js
Original file line number Diff line number Diff line change
@@ -1,12 +1,15 @@
'use strict'
const npa = require('npm-package-arg')
const moduleName = require('../utils/module-name.js')

const packageRelativePath = require('./deps').packageRelativePath
module.exports = function (child, reqBy) {
if (!child.requiredBy.length) return
if (!reqBy) reqBy = child.requiredBy[0]
const deps = reqBy.package.dependencies || {}
const devDeps = reqBy.package.devDependencies || {}
const optDeps = reqBy.package.optionalDependencies || {}
const name = moduleName(child)
return npa.resolve(name, deps[name] || devDeps[name], reqBy.realpath)
const spec = deps[name] || devDeps[name] || optDeps[name]
const where = packageRelativePath(reqBy)
return npa.resolve(name, spec, where)
}
23 changes: 22 additions & 1 deletion lib/install/inflate-shrinkwrap.js
Original file line number Diff line number Diff line change
@@ -89,6 +89,20 @@ function tarballToVersion (name, tb) {
return match[2] || match[1]
}

function relativizeLink (name, spec, topPath, requested) {
if (!spec.startsWith('file:')) {
return
}

let requestedPath = requested.fetchSpec
if (requested.type === 'file') {
requestedPath = path.dirname(requestedPath)
}

const relativized = path.relative(requestedPath, path.resolve(topPath, spec.slice(5)))
return 'file:' + relativized
}

function inflatableChild (onDiskChild, name, topPath, tree, sw, requested, opts) {
validate('OSSOOOO|ZSSOOOO', arguments)
const usesIntegrity = (
@@ -101,7 +115,14 @@ function inflatableChild (onDiskChild, name, topPath, tree, sw, requested, opts)
sw.resolved = sw.version
sw.version = regTarball
}
if (sw.requires) Object.keys(sw.requires).map(_ => { sw.requires[_] = tarballToVersion(_, sw.requires[_]) || sw.requires[_] })
if (sw.requires) {
Object.keys(sw.requires).forEach(name => {
const spec = sw.requires[name]
sw.requires[name] = tarballToVersion(name, spec) ||
relativizeLink(name, spec, topPath, requested) ||
spec
})
}
const modernLink = requested.type === 'directory' && !sw.from
if (hasModernMeta(onDiskChild) && childIsEquivalent(sw, requested, onDiskChild)) {
// The version on disk matches the shrinkwrap entry.
30 changes: 19 additions & 11 deletions node_modules/graceful-fs/graceful-fs.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

22 changes: 11 additions & 11 deletions node_modules/graceful-fs/package.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading