@pnpm/building.policy 1100.0.2 → 1100.0.3
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 +2 -1
- package/lib/index.js +9 -0
- package/package.json +3 -2
package/lib/index.d.ts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import type { AllowBuild } from '@pnpm/types';
|
|
1
|
+
import type { AllowBuild, DepPath } from '@pnpm/types';
|
|
2
|
+
export declare function isBuildExplicitlyDisallowed(depPath: DepPath, allowBuild?: AllowBuild): boolean;
|
|
2
3
|
export declare function createAllowBuildFunction(opts: {
|
|
3
4
|
dangerouslyAllowAllBuilds?: boolean;
|
|
4
5
|
allowBuilds?: Record<string, boolean | string>;
|
package/lib/index.js
CHANGED
|
@@ -1,4 +1,13 @@
|
|
|
1
1
|
import { expandPackageVersionSpecs } from '@pnpm/config.version-policy';
|
|
2
|
+
import * as dp from '@pnpm/deps.path';
|
|
3
|
+
export function isBuildExplicitlyDisallowed(depPath, allowBuild) {
|
|
4
|
+
if (!allowBuild)
|
|
5
|
+
return false;
|
|
6
|
+
const { name, version } = dp.parse(depPath);
|
|
7
|
+
if (!name || !version)
|
|
8
|
+
return false;
|
|
9
|
+
return allowBuild(name, version) === false;
|
|
10
|
+
}
|
|
2
11
|
export function createAllowBuildFunction(opts) {
|
|
3
12
|
if (opts.dangerouslyAllowAllBuilds)
|
|
4
13
|
return () => true;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@pnpm/building.policy",
|
|
3
|
-
"version": "1100.0.
|
|
3
|
+
"version": "1100.0.3",
|
|
4
4
|
"description": "Create a function for filtering out dependencies that are not allowed to be built",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"pnpm",
|
|
@@ -25,11 +25,12 @@
|
|
|
25
25
|
],
|
|
26
26
|
"dependencies": {
|
|
27
27
|
"@pnpm/config.version-policy": "1100.0.2",
|
|
28
|
+
"@pnpm/deps.path": "1100.0.2",
|
|
28
29
|
"@pnpm/types": "1101.0.0"
|
|
29
30
|
},
|
|
30
31
|
"devDependencies": {
|
|
31
32
|
"@jest/globals": "30.3.0",
|
|
32
|
-
"@pnpm/building.policy": "1100.0.
|
|
33
|
+
"@pnpm/building.policy": "1100.0.3"
|
|
33
34
|
},
|
|
34
35
|
"engines": {
|
|
35
36
|
"node": ">=22.13"
|