@pnpm/exec.prepare-package 1100.0.15 → 1100.0.16
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/lib/index.d.ts +1 -0
- package/lib/index.js +7 -3
- package/package.json +7 -7
package/lib/index.d.ts
CHANGED
package/lib/index.js
CHANGED
|
@@ -23,12 +23,16 @@ export async function preparePackage(opts, gitRootDir, subDir) {
|
|
|
23
23
|
if (opts.ignoreScripts)
|
|
24
24
|
return { shouldBeBuilt: true, pkgDir };
|
|
25
25
|
// Check if the package is allowed to run build scripts
|
|
26
|
-
// If allowBuild is undefined or returns false, block the build
|
|
27
|
-
|
|
26
|
+
// If allowBuild is undefined or returns false, block the build.
|
|
27
|
+
// The depPath is synthesized from the resolution id rather than read from
|
|
28
|
+
// a lockfile; resolution ids of git and tarball artifacts are never
|
|
29
|
+
// semver-shaped, so the policy derives an untrusted package identity.
|
|
30
|
+
const depPath = `${manifest.name}@${opts.pkgResolutionId}`;
|
|
31
|
+
if (!opts.allowBuild?.(depPath)) {
|
|
28
32
|
throw new PnpmError('GIT_DEP_PREPARE_NOT_ALLOWED', `The git-hosted package "${manifest.name}@${manifest.version}" needs to execute build scripts but is not in the "allowBuilds" allowlist.`, {
|
|
29
33
|
hint: `Add the package to "allowBuilds" in your project's pnpm-workspace.yaml to allow it to run scripts. For example:
|
|
30
34
|
allowBuilds:
|
|
31
|
-
${
|
|
35
|
+
${depPath}: true`,
|
|
32
36
|
});
|
|
33
37
|
}
|
|
34
38
|
const pm = (await preferredPM(gitRootDir))?.name ?? 'npm';
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@pnpm/exec.prepare-package",
|
|
3
|
-
"version": "1100.0.
|
|
3
|
+
"version": "1100.0.16",
|
|
4
4
|
"description": "Prepares a Git-hosted package",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"pnpm",
|
|
@@ -31,17 +31,17 @@
|
|
|
31
31
|
"execa": "npm:safe-execa@0.3.0",
|
|
32
32
|
"preferred-pm": "^5.0.0",
|
|
33
33
|
"ramda": "npm:@pnpm/ramda@0.28.1",
|
|
34
|
-
"@pnpm/
|
|
35
|
-
"@pnpm/
|
|
36
|
-
"@pnpm/
|
|
37
|
-
"@pnpm/
|
|
34
|
+
"@pnpm/error": "1100.0.0",
|
|
35
|
+
"@pnpm/exec.lifecycle": "1100.0.16",
|
|
36
|
+
"@pnpm/pkg-manifest.reader": "1100.0.7",
|
|
37
|
+
"@pnpm/types": "1101.3.1"
|
|
38
38
|
},
|
|
39
39
|
"devDependencies": {
|
|
40
40
|
"@jest/globals": "30.3.0",
|
|
41
41
|
"@types/ramda": "0.31.1",
|
|
42
42
|
"load-json-file": "^7.0.1",
|
|
43
|
-
"@pnpm/prepare": "1100.0.
|
|
44
|
-
"@pnpm/
|
|
43
|
+
"@pnpm/exec.prepare-package": "1100.0.16",
|
|
44
|
+
"@pnpm/prepare": "1100.0.14",
|
|
45
45
|
"@pnpm/test-fixtures": "1100.0.0",
|
|
46
46
|
"@pnpm/test-ipc-server": "1100.0.0"
|
|
47
47
|
},
|