@npmcli/arborist 5.2.1 → 5.3.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -673,7 +673,7 @@ Try using the package name instead, e.g:
673
673
  const breakingMessage = isSemVerMajor
674
674
  ? 'a SemVer major change'
675
675
  : 'outside your stated dependency range'
676
- log.warn('audit', `Updating ${name} to ${version},` +
676
+ log.warn('audit', `Updating ${name} to ${version}, ` +
677
677
  `which is ${breakingMessage}.`)
678
678
 
679
679
  await this[_add](node, { add: [`${name}@${version}`] })
@@ -22,6 +22,7 @@ const moveFile = require('@npmcli/move-file')
22
22
  const rimraf = promisify(require('rimraf'))
23
23
  const PackageJson = require('@npmcli/package-json')
24
24
  const packageContents = require('@npmcli/installed-package-contents')
25
+ const runScript = require('@npmcli/run-script')
25
26
  const { checkEngine, checkPlatform } = require('npm-install-checks')
26
27
  const _force = Symbol.for('force')
27
28
 
@@ -1516,6 +1517,30 @@ module.exports = cls => class Reifier extends cls {
1516
1517
 
1517
1518
  if (!this[_global]) {
1518
1519
  await this.actualTree.meta.save()
1520
+ const ignoreScripts = !!this.options.ignoreScripts
1521
+ // if we aren't doing a dry run or ignoring scripts and we actually made changes to the dep
1522
+ // tree, then run the dependencies scripts
1523
+ if (!this[_dryRun] && !ignoreScripts && this.diff && this.diff.children.length) {
1524
+ const { path, package: pkg } = this.actualTree.target
1525
+ const stdio = this.options.foregroundScripts ? 'inherit' : 'pipe'
1526
+ const { scripts = {} } = pkg
1527
+ for (const event of ['predependencies', 'dependencies', 'postdependencies']) {
1528
+ if (Object.prototype.hasOwnProperty.call(scripts, event)) {
1529
+ const timer = `reify:run:${event}`
1530
+ process.emit('time', timer)
1531
+ log.info('run', pkg._id, event, scripts[event])
1532
+ await runScript({
1533
+ event,
1534
+ path,
1535
+ pkg,
1536
+ stdioString: true,
1537
+ stdio,
1538
+ scriptShell: this.options.scriptShell,
1539
+ })
1540
+ process.emit('timeEnd', timer)
1541
+ }
1542
+ }
1543
+ }
1519
1544
  }
1520
1545
  }
1521
1546
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@npmcli/arborist",
3
- "version": "5.2.1",
3
+ "version": "5.3.0",
4
4
  "description": "Manage node_modules trees",
5
5
  "dependencies": {
6
6
  "@isaacs/string-locale-compare": "^1.1.0",
@@ -11,7 +11,7 @@
11
11
  "@npmcli/name-from-folder": "^1.0.1",
12
12
  "@npmcli/node-gyp": "^2.0.0",
13
13
  "@npmcli/package-json": "^2.0.0",
14
- "@npmcli/run-script": "^3.0.0",
14
+ "@npmcli/run-script": "^4.1.3",
15
15
  "bin-links": "^3.0.0",
16
16
  "cacache": "^16.0.6",
17
17
  "common-ancestor-path": "^1.0.1",
@@ -25,7 +25,7 @@
25
25
  "npm-pick-manifest": "^7.0.0",
26
26
  "npm-registry-fetch": "^13.0.0",
27
27
  "npmlog": "^6.0.2",
28
- "pacote": "^13.0.5",
28
+ "pacote": "^13.6.1",
29
29
  "parse-conflict-json": "^2.0.1",
30
30
  "proc-log": "^2.0.0",
31
31
  "promise-all-reject-late": "^1.0.0",