@vltpkg/run 1.0.9 → 1.1.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.
package/dist/index.d.ts CHANGED
@@ -53,7 +53,7 @@ export type RunOptions = SharedOptions & {
53
53
  /**
54
54
  * Pass in a manifest to avoid having to read it at all
55
55
  */
56
- manifest?: Pick<Manifest, 'scripts' | 'gypfile'>;
56
+ manifest?: Pick<Manifest, 'scripts' | 'gypfile' | 'hasInstallScript'>;
57
57
  /**
58
58
  * if the script is not defined in package.json#scripts, just ignore it and
59
59
  * treat as success. Otherwise, treat as an error. Default false.
package/dist/index.js CHANGED
@@ -102,10 +102,13 @@ const runImpl = async (options, execImpl, empty) => {
102
102
  // npm adds a `"install": "node-gyp rebuild"` if a binding.gyp
103
103
  // is present at the time of publish, EVEN IF it's not included
104
104
  // in the package. So, we need to read the actual package.json
105
- // in those cases.
106
- const untrustworthy = !!(manifest?.gypfile &&
107
- arg0 === 'install' &&
108
- manifest.scripts?.install === 'node-gyp rebuild');
105
+ // in those cases. Likewise an abbreviated registry manifest only
106
+ // says `hasInstallScript`, and the scripts live on disk.
107
+ const untrustworthy = !!manifest &&
108
+ ((manifest.gypfile === true &&
109
+ arg0 === 'install' &&
110
+ manifest.scripts?.install === 'node-gyp rebuild') ||
111
+ (manifest.hasInstallScript === true && !manifest.scripts));
109
112
  const pj = (untrustworthy ? undefined : manifest) ??
110
113
  packageJson.read(options.cwd);
111
114
  const { scripts } = pj;
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@vltpkg/run",
3
3
  "description": "Run package.json scripts and execute commands",
4
- "version": "1.0.9",
4
+ "version": "1.1.0",
5
5
  "repository": {
6
6
  "type": "git",
7
7
  "url": "git+https://github.com/vltpkg/vltpkg.git",
@@ -13,11 +13,11 @@
13
13
  "url": "http://vlt.sh"
14
14
  },
15
15
  "dependencies": {
16
- "@vltpkg/error-cause": "1.0.9",
17
- "@vltpkg/package-json": "1.0.9",
18
- "@vltpkg/promise-spawn": "1.0.9",
19
- "@vltpkg/types": "1.0.9",
20
- "@vltpkg/xdg": "1.0.9",
16
+ "@vltpkg/error-cause": "1.1.0",
17
+ "@vltpkg/package-json": "1.1.0",
18
+ "@vltpkg/promise-spawn": "1.1.0",
19
+ "@vltpkg/types": "1.1.0",
20
+ "@vltpkg/xdg": "1.1.0",
21
21
  "foreground-child": "^3.3.1",
22
22
  "walk-up-path": "^4.0.0"
23
23
  },