Skip to content

Use allow/deny list in docs #1699

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 55 commits into from
Closed
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
55 commits
Select commit Hold shift + click to select a range
2e05298
chore(docs): fixed links to cli commands
claudiahdz Jun 24, 2020
0ca3509
Update npm-link.md
peterfich May 13, 2020
3dd429e
docs: Add note about dropped `*` filenames
maxwellgerber Jun 2, 2020
c49b6ae
[email protected]
kemitchell Jun 10, 2020
9a2e2e7
docs: Fix typo
seanpoulter Jun 14, 2020
b7ad775
fix: wrong `npm doctor` command result
vanishcode Jun 10, 2020
1aec4cb
test: add test for `npm doctor` that ping registry returns error
vanishcode Jun 16, 2020
479e45c
style: fix lint error with no trailing comma
vanishcode Jun 16, 2020
a9857b8
chore: remove auth info from logs
claudiahdz Jun 26, 2020
94eca63
[email protected]
claudiahdz Jun 30, 2020
66aab41
docs: changelog for 6.14.6
claudiahdz Jul 1, 2020
46e91d9
update AUTHORS
claudiahdz Jul 7, 2020
66092d5
6.14.6
claudiahdz Jul 7, 2020
6a6151f
[email protected]
claudiahdz Jul 20, 2020
2d78481
deps: update mkdirp on tacks
claudiahdz Jul 20, 2020
4e129d1
deps: uninstall npm-registry-couchapp
claudiahdz Jul 20, 2020
8e1869e
deps: fix outdated dev deps
claudiahdz Jul 20, 2020
de51088
fix: npm explore spawn shell correctly
jasisk Feb 7, 2020
36e6c01
fix: git tag handling regression on shrinkwrap
claudiahdz Jul 20, 2020
1961c93
Fix package id in shrinkwrap lifecycle step output
bz2 Nov 6, 2019
8788889
fix: gracefully handle error during npm install
Mar 11, 2020
6fe2bdc
fix: npm ls --parseable --long output
ruyadorno Jul 21, 2020
dc21422
[email protected]
claudiahdz Jul 21, 2020
d341f88
[email protected]
claudiahdz Jul 21, 2020
3e168d4
[email protected]
claudiahdz Jul 21, 2020
6ae942a
[email protected]
claudiahdz Jul 21, 2020
6a35e3d
[email protected]
claudiahdz Jul 21, 2020
e6e8d29
docs: changelog for 6.14.7
claudiahdz Jul 21, 2020
a81da2b
update AUTHORS
claudiahdz Jul 21, 2020
42e4625
6.14.7
claudiahdz Jul 21, 2020
1ae6850
chore: add/update github issue templates
darcyclarke Aug 6, 2020
304833b
chore: fix issue templates to allow for bug filing again
darcyclarke Aug 6, 2020
ad8fe71
chore: adding labels to new bugs
darcyclarke Aug 6, 2020
f468036
chore: rename bug template for v7
darcyclarke Aug 13, 2020
f54c465
Update bug_7.md
darcyclarke Aug 13, 2020
cf61302
chore: fix up issue templates
darcyclarke Aug 14, 2020
dc001af
fix: typo in v6 issue template
darcyclarke Aug 14, 2020
9b273f0
[email protected]
ruyadorno Aug 14, 2020
1a2daa5
[email protected]
ruyadorno Aug 14, 2020
620b0ff
[email protected]
ruyadorno Aug 14, 2020
c605266
test: increase whoami with bearer auth timeout
LocutusOfBorg Jun 23, 2020
42dcb3e
Docs: add missing metadata in semver page
tripu Jul 28, 2020
f5da2b9
fix: npm install --dev deprecation message
sandratatarevicova Jul 28, 2020
956077a
Node-gyp supports both Python and legacy Python
cclauss Aug 5, 2020
376bc08
fix: remove unused broken require
aduh95 Aug 12, 2020
b72920f
chore: Do not send user secret in the referer header
Aug 12, 2020
807443f
test: fix missing JSON.stringify
ruyadorno Aug 17, 2020
e2abf49
docs: changelog for 6.14.8
ruyadorno Aug 17, 2020
d4e6e41
update AUTHORS
ruyadorno Aug 17, 2020
39a25ae
6.14.8
ruyadorno Aug 17, 2020
542dad8
Use allow/deny list in docs
Aug 21, 2020
5db2908
Update phrase
luciomartinez Aug 28, 2020
2f1ce13
Update phrase
luciomartinez Aug 28, 2020
ba6f2ee
Update phrase
luciomartinez Aug 28, 2020
75cd049
Update phrase
luciomartinez Aug 28, 2020
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
Prev Previous commit
Next Next commit
Fix package id in shrinkwrap lifecycle step output
Currently all logging related to shrinkwrap steps reports 'undefined'
for the package in output and log messages.

This is due to the package associated with the `idealTree` being
recreated in the `savePackageJson()` method which precedes these
steps. For now, just copy forward the `_id` attribute which lifecycle
logging expects, but note that mutating `package` here is surprising.

Fixes npm/npm#20756

PR-URL: #288
Credit: @bz2
Close: #288
Reviewed-by: @claudiahdz
  • Loading branch information
bz2 authored and claudiahdz committed Jul 20, 2020
commit 1961c9369c92bf8fe530cecba9834ca3c7f5567c
3 changes: 3 additions & 0 deletions lib/install.js
Original file line number Diff line number Diff line change
Expand Up @@ -650,6 +650,9 @@ Installer.prototype.saveToDependencies = function (cb) {
validate('F', arguments)
if (this.failing) return cb()
log.silly('install', 'saveToDependencies')
// Note idealTree will be mutated during the save operations below as the
// package is reloaded from disk to preserve additional details. This means
// steps after postInstall will see a slightly different package object.
if (this.saveOnlyLock) {
saveShrinkwrap(this.idealTree, cb)
} else {
Expand Down
4 changes: 4 additions & 0 deletions lib/install/save.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ const iferr = require('iferr')
const log = require('npmlog')
const moduleName = require('../utils/module-name.js')
const npm = require('../npm.js')
const packageId = require('../utils/package-id.js')
const parseJSON = require('../utils/parse-json.js')
const path = require('path')
const stringifyPackage = require('stringify-package')
Expand Down Expand Up @@ -131,6 +132,9 @@ function savePackageJson (tree, next) {
} else {
writeFileAtomic(saveTarget, json, next)
}

// Restore derived id as it was removed when reloading from disk
tree.package._id = packageId(tree.package)
}))
}

Expand Down
5 changes: 5 additions & 0 deletions test/common-tap.js
Original file line number Diff line number Diff line change
Expand Up @@ -283,3 +283,8 @@ Environment.prototype.extend = function (env) {
}
return self
}

var reEscape = /[\\[\](){}*?+.^$|]/g
exports.escapeForRe = function (string) {
return string.replace(reEscape, '\\$&')
}
35 changes: 35 additions & 0 deletions test/tap/install-lifecycle.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
var fs = require('graceful-fs')
var path = require('path')
var test = require('tap').test
var common = require('../common-tap.js')
var pkg = common.pkg

test('npm install execution order', function (t) {
const packageJson = {
name: 'life-test',
version: '0.0.1',
description: 'Test for npm install execution order',
scripts: {
install: 'true',
preinstall: 'true',
preshrinkwrap: 'true',
postinstall: 'true',
postshrinkwrap: 'true',
shrinkwrap: 'true'
}
}
fs.writeFileSync(path.resolve(pkg, 'package.json'), JSON.stringify(packageJson), 'utf8')
common.npm(['install', '--loglevel=error'], { cwd: pkg }, function (err, code, stdout, stderr) {
if (err) throw err

t.comment(stdout)
t.comment(stderr)

const steps = ['preinstall', 'install', 'postinstall', 'preshrinkwrap', 'shrinkwrap', 'postshrinkwrap']
const expectedLines = steps.map(function (step) {
return '> ' + packageJson.name + '@' + packageJson.version + ' ' + step
})
t.match(stdout, new RegExp(expectedLines.map(common.escapeForRe).join('(.|\n)*')))
t.end()
})
})