@pnpm/building.policy 1100.0.18 → 1100.0.20

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/CHANGELOG.md CHANGED
@@ -1,5 +1,23 @@
1
1
  # @pnpm/building.policy
2
2
 
3
+ ## 1100.0.20
4
+
5
+ ### Patch Changes
6
+
7
+ - `pnpm remove` now prunes undecided entries (`"set this to true or false"`) from `allowBuilds` in `pnpm-workspace.yaml` when `sharedWorkspaceLockfile: true` and the corresponding packages are removed [pnpm/pnpm#13892](https://github.com/pnpm/pnpm/issues/13892).
8
+
9
+ - Updated dependencies:
10
+ - @pnpm/config.version-policy@1100.2.1
11
+ - @pnpm/deps.path@1101.0.0
12
+ - @pnpm/types@1102.0.0
13
+
14
+ ## 1100.0.19
15
+
16
+ ### Patch Changes
17
+
18
+ - Updated dependencies:
19
+ - @pnpm/config.version-policy@1100.2.0
20
+
3
21
  ## 1100.0.18
4
22
 
5
23
  ### Patch Changes
package/lib/index.d.ts CHANGED
@@ -1,4 +1,9 @@
1
1
  import type { AllowBuild, DepPath } from '@pnpm/types';
2
+ /**
3
+ * The placeholder value written to `allowBuilds` for a package whose build
4
+ * was ignored and still awaits an explicit `true`/`false` decision.
5
+ */
6
+ export declare const UNDECIDED_ALLOW_BUILD = "set this to true or false";
2
7
  export declare function isBuildExplicitlyDisallowed(depPath: DepPath, allowBuild?: AllowBuild): boolean;
3
8
  export declare function createAllowBuildFunction(opts: {
4
9
  dangerouslyAllowAllBuilds?: boolean;
@@ -10,3 +15,11 @@ export declare function createAllowBuildFunction(opts: {
10
15
  * git/tarball artifacts, whose name alone must not approve builds.
11
16
  */
12
17
  export declare function allowBuildKeyFromIgnoredBuild(depPath: DepPath): string;
18
+ /**
19
+ * The package name an `allowBuilds` key identifies — the key itself for a
20
+ * bare name, the name half of a `name@version` dep-path key — or
21
+ * `undefined` for keys carrying no single package name (hashless git-repo
22
+ * keys, malformed shapes). Cleanup may only drop an entry whose package
23
+ * this proves absent from a resolved-name index.
24
+ */
25
+ export declare function packageNameFromAllowBuildKey(key: string): string | undefined;
package/lib/index.js CHANGED
@@ -1,5 +1,10 @@
1
1
  import { expandPackageVersionSpecs } from '@pnpm/config.version-policy';
2
2
  import * as dp from '@pnpm/deps.path';
3
+ /**
4
+ * The placeholder value written to `allowBuilds` for a package whose build
5
+ * was ignored and still awaits an explicit `true`/`false` decision.
6
+ */
7
+ export const UNDECIDED_ALLOW_BUILD = 'set this to true or false';
3
8
  export function isBuildExplicitlyDisallowed(depPath, allowBuild) {
4
9
  return allowBuild?.(depPath) === false;
5
10
  }
@@ -87,6 +92,21 @@ export function allowBuildKeyFromIgnoredBuild(depPath) {
87
92
  return pkgIdWithPatchHash;
88
93
  return parsed.name;
89
94
  }
95
+ /**
96
+ * The package name an `allowBuilds` key identifies — the key itself for a
97
+ * bare name, the name half of a `name@version` dep-path key — or
98
+ * `undefined` for keys carrying no single package name (hashless git-repo
99
+ * keys, malformed shapes). Cleanup may only drop an entry whose package
100
+ * this proves absent from a resolved-name index.
101
+ */
102
+ export function packageNameFromAllowBuildKey(key) {
103
+ if (isGitRepoAllowBuildKey(key))
104
+ return undefined;
105
+ const name = key.indexOf('@', 1) === -1 ? key : dp.parse(key).name;
106
+ if (!name || name.includes(':'))
107
+ return undefined;
108
+ return name;
109
+ }
90
110
  function addAllowBuildRule(pkg, target) {
91
111
  if (isGitRepoAllowBuildKey(pkg)) {
92
112
  target.gitRepos.add(pkg);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pnpm/building.policy",
3
- "version": "1100.0.18",
3
+ "version": "1100.0.20",
4
4
  "description": "Create a function for filtering out dependencies that are not allowed to be built",
5
5
  "keywords": [
6
6
  "pnpm",
@@ -27,13 +27,13 @@
27
27
  "!*.map"
28
28
  ],
29
29
  "dependencies": {
30
- "@pnpm/config.version-policy": "1100.1.12",
31
- "@pnpm/deps.path": "1100.1.0",
32
- "@pnpm/types": "1101.9.0"
30
+ "@pnpm/config.version-policy": "1100.2.1",
31
+ "@pnpm/deps.path": "1101.0.0",
32
+ "@pnpm/types": "1102.0.0"
33
33
  },
34
34
  "devDependencies": {
35
35
  "@jest/globals": "30.4.1",
36
- "@pnpm/building.policy": "1100.0.18"
36
+ "@pnpm/building.policy": "1100.0.20"
37
37
  },
38
38
  "engines": {
39
39
  "node": ">=22.13"