@pnpm/config.package-is-installable 1100.0.16 → 1100.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/CHANGELOG.md +14 -0
- package/lib/index.d.ts +16 -2
- package/lib/index.js +11 -1
- package/package.json +7 -7
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,19 @@
|
|
|
1
1
|
# @pnpm/package-is-installable
|
|
2
2
|
|
|
3
|
+
## 1100.1.0
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- Fixed an installed optional dependency being left without one of its own required dependencies. When a package reached through `optionalDependencies` is installable on the current system but one of its regular `dependencies` is not, a lockfile-based install skipped that dependency and installed the parent anyway, so importing the parent failed with `MODULE_NOT_FOUND`. The dependency is now installed, and an install-check warning reports the incompatibility. A dependency is still only skipped when every path to it is optional, or when the package that pulls it in was itself skipped [#13286](https://github.com/pnpm/pnpm/issues/13286).
|
|
8
|
+
|
|
9
|
+
### Patch Changes
|
|
10
|
+
|
|
11
|
+
- Updated dependencies:
|
|
12
|
+
- @pnpm/cli.meta@1100.0.12
|
|
13
|
+
- @pnpm/core-loggers@1100.3.0
|
|
14
|
+
- @pnpm/engine.runtime.system-version@1100.0.7
|
|
15
|
+
- @pnpm/types@1101.7.0
|
|
16
|
+
|
|
3
17
|
## 1100.0.16
|
|
4
18
|
|
|
5
19
|
### Patch Changes
|
package/lib/index.d.ts
CHANGED
|
@@ -5,14 +5,28 @@ export type { Engine } from './checkEngine.js';
|
|
|
5
5
|
export type { Platform, WantedPlatform } from './checkPlatform.js';
|
|
6
6
|
export { inferPlatformFromPackageName } from './inferPlatformFromPackageName.js';
|
|
7
7
|
export { UnsupportedEngineError, UnsupportedPlatformError, type WantedEngine, };
|
|
8
|
-
export
|
|
8
|
+
export interface InstallabilityManifest {
|
|
9
9
|
name: string;
|
|
10
10
|
version: string;
|
|
11
11
|
engines?: WantedEngine;
|
|
12
12
|
cpu?: string[];
|
|
13
13
|
os?: string[];
|
|
14
14
|
libc?: string[];
|
|
15
|
-
}
|
|
15
|
+
}
|
|
16
|
+
/**
|
|
17
|
+
* The installability verdict on its own — `null` when the package is
|
|
18
|
+
* installable — without the logging and the `engineStrict` throw that
|
|
19
|
+
* [packageIsInstallable] wraps around it. Callers that have to classify a
|
|
20
|
+
* package before they know how to report it use this, so the report is
|
|
21
|
+
* emitted exactly once.
|
|
22
|
+
*/
|
|
23
|
+
export declare function checkPackageInstallability(pkgId: string, pkg: InstallabilityManifest, options: {
|
|
24
|
+
nodeVersion?: string;
|
|
25
|
+
optional: boolean;
|
|
26
|
+
pnpmVersion?: string;
|
|
27
|
+
supportedArchitectures?: SupportedArchitectures;
|
|
28
|
+
}): null | UnsupportedEngineError | UnsupportedPlatformError;
|
|
29
|
+
export declare function packageIsInstallable(pkgId: string, pkg: InstallabilityManifest, options: {
|
|
16
30
|
engineStrict?: boolean;
|
|
17
31
|
nodeVersion?: string;
|
|
18
32
|
optional: boolean;
|
package/lib/index.js
CHANGED
|
@@ -5,8 +5,18 @@ import { checkPlatform, UnsupportedPlatformError } from './checkPlatform.js';
|
|
|
5
5
|
import { inferPlatformFromPackageName } from './inferPlatformFromPackageName.js';
|
|
6
6
|
export { inferPlatformFromPackageName } from './inferPlatformFromPackageName.js';
|
|
7
7
|
export { UnsupportedEngineError, UnsupportedPlatformError, };
|
|
8
|
+
/**
|
|
9
|
+
* The installability verdict on its own — `null` when the package is
|
|
10
|
+
* installable — without the logging and the `engineStrict` throw that
|
|
11
|
+
* [packageIsInstallable] wraps around it. Callers that have to classify a
|
|
12
|
+
* package before they know how to report it use this, so the report is
|
|
13
|
+
* emitted exactly once.
|
|
14
|
+
*/
|
|
15
|
+
export function checkPackageInstallability(pkgId, pkg, options) {
|
|
16
|
+
return checkPackage(pkgId, { engines: pkg.engines, ...effectivePlatform(pkg, options.optional) }, options);
|
|
17
|
+
}
|
|
8
18
|
export function packageIsInstallable(pkgId, pkg, options) {
|
|
9
|
-
const warn =
|
|
19
|
+
const warn = checkPackageInstallability(pkgId, pkg, options);
|
|
10
20
|
if (warn == null)
|
|
11
21
|
return true;
|
|
12
22
|
installCheckLogger.warn({
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@pnpm/config.package-is-installable",
|
|
3
|
-
"version": "1100.0
|
|
3
|
+
"version": "1100.1.0",
|
|
4
4
|
"description": "Checks if a package is installable on the current system",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"pnpm",
|
|
@@ -27,22 +27,22 @@
|
|
|
27
27
|
"!*.map"
|
|
28
28
|
],
|
|
29
29
|
"dependencies": {
|
|
30
|
-
"@pnpm/cli.meta": "1100.0.
|
|
31
|
-
"@pnpm/core-loggers": "1100.
|
|
32
|
-
"@pnpm/engine.runtime.system-version": "1100.0.
|
|
30
|
+
"@pnpm/cli.meta": "1100.0.12",
|
|
31
|
+
"@pnpm/core-loggers": "1100.3.0",
|
|
32
|
+
"@pnpm/engine.runtime.system-version": "1100.0.7",
|
|
33
33
|
"@pnpm/error": "1100.1.0",
|
|
34
|
-
"@pnpm/types": "1101.
|
|
34
|
+
"@pnpm/types": "1101.7.0",
|
|
35
35
|
"detect-libc": "^2.1.2",
|
|
36
36
|
"execa": "npm:safe-execa@0.3.0",
|
|
37
37
|
"memoize": "^11.0.0",
|
|
38
|
-
"semver": "^7.8.
|
|
38
|
+
"semver": "^7.8.5"
|
|
39
39
|
},
|
|
40
40
|
"peerDependencies": {
|
|
41
41
|
"@pnpm/logger": "^1100.0.0"
|
|
42
42
|
},
|
|
43
43
|
"devDependencies": {
|
|
44
44
|
"@jest/globals": "30.4.1",
|
|
45
|
-
"@pnpm/config.package-is-installable": "1100.0
|
|
45
|
+
"@pnpm/config.package-is-installable": "1100.1.0",
|
|
46
46
|
"@pnpm/logger": "1100.0.0",
|
|
47
47
|
"@types/semver": "7.7.1"
|
|
48
48
|
},
|