libnpmpack 5.0.0-pre.0 → 5.0.0-pre.2

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.
Files changed (2) hide show
  1. package/lib/index.js +6 -2
  2. package/package.json +15 -6
package/lib/index.js CHANGED
@@ -5,6 +5,7 @@ const npa = require('npm-package-arg')
5
5
  const runScript = require('@npmcli/run-script')
6
6
  const path = require('path')
7
7
  const util = require('util')
8
+ const Arborist = require('@npmcli/arborist')
8
9
  const writeFile = util.promisify(require('fs').writeFile)
9
10
 
10
11
  module.exports = pack
@@ -18,13 +19,15 @@ async function pack (spec = 'file:.', opts = {}) {
18
19
  // mode
19
20
  const banner = !opts.silent
20
21
 
22
+ const stdio = opts.foregroundScripts ? 'inherit' : 'pipe'
23
+
21
24
  if (spec.type === 'directory') {
22
25
  // prepack
23
26
  await runScript({
24
27
  ...opts,
25
28
  event: 'prepack',
26
29
  path: spec.fetchSpec,
27
- stdio: 'inherit',
30
+ stdio,
28
31
  pkg: manifest,
29
32
  banner,
30
33
  })
@@ -33,6 +36,7 @@ async function pack (spec = 'file:.', opts = {}) {
33
36
  // packs tarball
34
37
  const tarball = await pacote.tarball(manifest._resolved, {
35
38
  ...opts,
39
+ Arborist,
36
40
  integrity: manifest._integrity,
37
41
  })
38
42
 
@@ -50,7 +54,7 @@ async function pack (spec = 'file:.', opts = {}) {
50
54
  ...opts,
51
55
  event: 'postpack',
52
56
  path: spec.fetchSpec,
53
- stdio: 'inherit',
57
+ stdio,
54
58
  pkg: manifest,
55
59
  banner,
56
60
  env: {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "libnpmpack",
3
- "version": "5.0.0-pre.0",
3
+ "version": "5.0.0-pre.2",
4
4
  "description": "Programmatic API for the bits behind npm pack",
5
5
  "author": "GitHub Inc.",
6
6
  "main": "lib/index.js",
@@ -15,16 +15,17 @@
15
15
  "scripts": {
16
16
  "lint": "eslint \"**/*.js\"",
17
17
  "test": "tap",
18
- "posttest": "npm run lint",
18
+ "posttest": "node ../.. run lint",
19
19
  "postlint": "template-oss-check",
20
- "lintfix": "npm run lint -- --fix",
20
+ "lintfix": "node ../.. run lint -- --fix",
21
21
  "snap": "tap",
22
22
  "template-oss-apply": "template-oss-apply --force"
23
23
  },
24
24
  "devDependencies": {
25
25
  "@npmcli/eslint-config": "^3.1.0",
26
- "@npmcli/template-oss": "4.0.0",
26
+ "@npmcli/template-oss": "4.5.0",
27
27
  "nock": "^13.0.7",
28
+ "spawk": "^1.7.1",
28
29
  "tap": "^16.0.1"
29
30
  },
30
31
  "repository": {
@@ -35,15 +36,23 @@
35
36
  "bugs": "https://github.com/npm/libnpmpack/issues",
36
37
  "homepage": "https://npmjs.com/package/libnpmpack",
37
38
  "dependencies": {
39
+ "@npmcli/arborist": "^6.0.0-pre.4",
38
40
  "@npmcli/run-script": "^4.1.3",
39
41
  "npm-package-arg": "^9.0.1",
40
- "pacote": "^13.6.1"
42
+ "pacote": "^14.0.0"
41
43
  },
42
44
  "engines": {
43
45
  "node": "^14.17.0 || ^16.13.0 || >=18.0.0"
44
46
  },
45
47
  "templateOSS": {
46
48
  "//@npmcli/template-oss": "This file is partially managed by @npmcli/template-oss. Edits may be overwritten.",
47
- "version": "4.0.0"
49
+ "version": "4.5.0",
50
+ "content": "../../scripts/template-oss/index.js"
51
+ },
52
+ "tap": {
53
+ "nyc-arg": [
54
+ "--exclude",
55
+ "tap-snapshots/**"
56
+ ]
48
57
  }
49
58
  }