@pnpm/config.package-is-installable 1100.1.6 → 1100.2.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/CHANGELOG.md +22 -0
- package/lib/index.d.ts +20 -0
- package/lib/index.js +14 -0
- package/package.json +7 -7
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,27 @@
|
|
|
1
1
|
# @pnpm/package-is-installable
|
|
2
2
|
|
|
3
|
+
## 1100.2.0
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- Added the `forceIgnoresPlatform` setting. When it is `false`, `pnpm install --force` skips optional dependencies whose `os`, `cpu` or `libc` do not match the host instead of installing all of them. The default stays `true` [#6133](https://github.com/pnpm/pnpm/issues/6133).
|
|
8
|
+
|
|
9
|
+
### Patch Changes
|
|
10
|
+
|
|
11
|
+
- Updated dependencies:
|
|
12
|
+
- @pnpm/cli.meta@1100.1.1
|
|
13
|
+
- @pnpm/core-loggers@1101.0.1
|
|
14
|
+
- @pnpm/engine.runtime.system-version@1100.0.12
|
|
15
|
+
- @pnpm/error@1100.2.0
|
|
16
|
+
- @pnpm/types@1102.1.1
|
|
17
|
+
|
|
18
|
+
## 1100.1.7
|
|
19
|
+
|
|
20
|
+
### Patch Changes
|
|
21
|
+
|
|
22
|
+
- Updated dependencies:
|
|
23
|
+
- @pnpm/core-loggers@1101.0.0
|
|
24
|
+
|
|
3
25
|
## 1100.1.6
|
|
4
26
|
|
|
5
27
|
### Patch Changes
|
package/lib/index.d.ts
CHANGED
|
@@ -26,6 +26,26 @@ export declare function checkPackageInstallability(pkgId: string, pkg: Installab
|
|
|
26
26
|
pnpmVersion?: string;
|
|
27
27
|
supportedArchitectures?: SupportedArchitectures;
|
|
28
28
|
}): null | UnsupportedEngineError | UnsupportedPlatformError;
|
|
29
|
+
export interface ForcedInstallabilityOptions {
|
|
30
|
+
engineStrict: boolean;
|
|
31
|
+
/**
|
|
32
|
+
* Install every package the lockfile names, whatever its `os`, `cpu`,
|
|
33
|
+
* `libc` or `engines` say: the installability check is skipped entirely.
|
|
34
|
+
*/
|
|
35
|
+
includeIncompatiblePackages: boolean;
|
|
36
|
+
}
|
|
37
|
+
/**
|
|
38
|
+
* How `--force` changes the installability check. It lifts `engineStrict`,
|
|
39
|
+
* as npm's does, so an `engines` mismatch on a required package warns
|
|
40
|
+
* instead of failing. Under `forceIgnoresPlatform` (the default) it also
|
|
41
|
+
* skips the check altogether, so optional dependencies for other platforms
|
|
42
|
+
* are installed instead of skipped.
|
|
43
|
+
*/
|
|
44
|
+
export declare function installabilityUnderForce(opts: {
|
|
45
|
+
engineStrict?: boolean;
|
|
46
|
+
force?: boolean;
|
|
47
|
+
forceIgnoresPlatform?: boolean;
|
|
48
|
+
}): ForcedInstallabilityOptions;
|
|
29
49
|
export declare function packageIsInstallable(pkgId: string, pkg: InstallabilityManifest, options: {
|
|
30
50
|
engineStrict?: boolean;
|
|
31
51
|
nodeVersion?: string;
|
package/lib/index.js
CHANGED
|
@@ -15,6 +15,20 @@ export { UnsupportedEngineError, UnsupportedPlatformError, };
|
|
|
15
15
|
export function checkPackageInstallability(pkgId, pkg, options) {
|
|
16
16
|
return checkPackage(pkgId, { engines: pkg.engines, ...effectivePlatform(pkg, options.optional) }, options);
|
|
17
17
|
}
|
|
18
|
+
/**
|
|
19
|
+
* How `--force` changes the installability check. It lifts `engineStrict`,
|
|
20
|
+
* as npm's does, so an `engines` mismatch on a required package warns
|
|
21
|
+
* instead of failing. Under `forceIgnoresPlatform` (the default) it also
|
|
22
|
+
* skips the check altogether, so optional dependencies for other platforms
|
|
23
|
+
* are installed instead of skipped.
|
|
24
|
+
*/
|
|
25
|
+
export function installabilityUnderForce(opts) {
|
|
26
|
+
const force = opts.force === true;
|
|
27
|
+
return {
|
|
28
|
+
engineStrict: opts.engineStrict === true && !force,
|
|
29
|
+
includeIncompatiblePackages: force && opts.forceIgnoresPlatform !== false,
|
|
30
|
+
};
|
|
31
|
+
}
|
|
18
32
|
export function packageIsInstallable(pkgId, pkg, options) {
|
|
19
33
|
const warn = checkPackageInstallability(pkgId, pkg, options);
|
|
20
34
|
if (warn == null)
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@pnpm/config.package-is-installable",
|
|
3
|
-
"version": "1100.
|
|
3
|
+
"version": "1100.2.0",
|
|
4
4
|
"description": "Checks if a package is installable on the current system",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"pnpm",
|
|
@@ -27,11 +27,11 @@
|
|
|
27
27
|
"!*.map"
|
|
28
28
|
],
|
|
29
29
|
"dependencies": {
|
|
30
|
-
"@pnpm/cli.meta": "1100.1.
|
|
31
|
-
"@pnpm/core-loggers": "
|
|
32
|
-
"@pnpm/engine.runtime.system-version": "1100.0.
|
|
33
|
-
"@pnpm/error": "1100.
|
|
34
|
-
"@pnpm/types": "1102.1.
|
|
30
|
+
"@pnpm/cli.meta": "1100.1.1",
|
|
31
|
+
"@pnpm/core-loggers": "1101.0.1",
|
|
32
|
+
"@pnpm/engine.runtime.system-version": "1100.0.12",
|
|
33
|
+
"@pnpm/error": "1100.2.0",
|
|
34
|
+
"@pnpm/types": "1102.1.1",
|
|
35
35
|
"detect-libc": "^2.1.2",
|
|
36
36
|
"execa": "npm:safe-execa@0.3.0",
|
|
37
37
|
"memoize": "^11.0.0",
|
|
@@ -42,7 +42,7 @@
|
|
|
42
42
|
},
|
|
43
43
|
"devDependencies": {
|
|
44
44
|
"@jest/globals": "30.4.1",
|
|
45
|
-
"@pnpm/config.package-is-installable": "1100.
|
|
45
|
+
"@pnpm/config.package-is-installable": "1100.2.0",
|
|
46
46
|
"@pnpm/logger": "1100.0.0",
|
|
47
47
|
"@types/semver": "7.8.0"
|
|
48
48
|
},
|