@pnpm/cli.utils 1101.0.14 → 1101.0.15
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 +9 -0
- package/package.json +5 -5
- package/lib/index.d.ts +0 -7
- package/lib/packageIsInstallable.d.ts +0 -13
- package/lib/packageIsInstallable.js +0 -27
- package/lib/promptPageSize.d.ts +0 -1
- package/lib/promptPageSize.js +0 -5
- package/lib/readDepNameCompletions.d.ts +0 -3
- package/lib/readDepNameCompletions.js +0 -7
- package/lib/readProjectManifest.d.ts +0 -20
- package/lib/readProjectManifest.js +0 -20
- package/lib/recursiveSummary.d.ts +0 -13
- package/lib/recursiveSummary.js +0 -17
- package/lib/style.d.ts +0 -20
- package/lib/style.js +0 -25
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,14 @@
|
|
|
1
1
|
# @pnpm/cli-utils
|
|
2
2
|
|
|
3
|
+
## 1101.0.15
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- Updated dependencies:
|
|
8
|
+
- @pnpm/config.package-is-installable@1100.0.14
|
|
9
|
+
- @pnpm/pkg-manifest.utils@1100.2.8
|
|
10
|
+
- @pnpm/workspace.project-manifest-reader@1100.0.16
|
|
11
|
+
|
|
3
12
|
## 1101.0.14
|
|
4
13
|
|
|
5
14
|
### Patch Changes
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@pnpm/cli.utils",
|
|
3
|
-
"version": "1101.0.
|
|
3
|
+
"version": "1101.0.15",
|
|
4
4
|
"description": "Utils for pnpm commands",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"pnpm",
|
|
@@ -28,11 +28,11 @@
|
|
|
28
28
|
],
|
|
29
29
|
"dependencies": {
|
|
30
30
|
"@pnpm/cli.meta": "1100.0.9",
|
|
31
|
-
"@pnpm/config.package-is-installable": "1100.0.
|
|
31
|
+
"@pnpm/config.package-is-installable": "1100.0.14",
|
|
32
32
|
"@pnpm/error": "1100.0.1",
|
|
33
|
-
"@pnpm/pkg-manifest.utils": "1100.2.
|
|
33
|
+
"@pnpm/pkg-manifest.utils": "1100.2.8",
|
|
34
34
|
"@pnpm/types": "1101.4.0",
|
|
35
|
-
"@pnpm/workspace.project-manifest-reader": "1100.0.
|
|
35
|
+
"@pnpm/workspace.project-manifest-reader": "1100.0.16",
|
|
36
36
|
"chalk": "^5.6.2",
|
|
37
37
|
"load-json-file": "^7.0.1"
|
|
38
38
|
},
|
|
@@ -40,7 +40,7 @@
|
|
|
40
40
|
"@pnpm/logger": "^1100.0.0"
|
|
41
41
|
},
|
|
42
42
|
"devDependencies": {
|
|
43
|
-
"@pnpm/cli.utils": "1101.0.
|
|
43
|
+
"@pnpm/cli.utils": "1101.0.15",
|
|
44
44
|
"@pnpm/logger": "1100.0.0"
|
|
45
45
|
},
|
|
46
46
|
"engines": {
|
package/lib/index.d.ts
DELETED
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
export * from './packageIsInstallable.js';
|
|
2
|
-
export * from './promptPageSize.js';
|
|
3
|
-
export * from './readDepNameCompletions.js';
|
|
4
|
-
export * from './readProjectManifest.js';
|
|
5
|
-
export * from './recursiveSummary.js';
|
|
6
|
-
export * from './style.js';
|
|
7
|
-
export declare function docsUrl(cmd: string): string;
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import { type WantedEngine } from '@pnpm/config.package-is-installable';
|
|
2
|
-
import type { SupportedArchitectures } from '@pnpm/types';
|
|
3
|
-
export declare function packageIsInstallable(pkgPath: string, pkg: {
|
|
4
|
-
packageManager?: string;
|
|
5
|
-
engines?: WantedEngine;
|
|
6
|
-
cpu?: string[];
|
|
7
|
-
os?: string[];
|
|
8
|
-
libc?: string[];
|
|
9
|
-
}, opts: {
|
|
10
|
-
engineStrict?: boolean;
|
|
11
|
-
nodeVersion?: string;
|
|
12
|
-
supportedArchitectures?: SupportedArchitectures;
|
|
13
|
-
}): void;
|
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
import { packageManager } from '@pnpm/cli.meta';
|
|
2
|
-
import { checkPackage, UnsupportedEngineError } from '@pnpm/config.package-is-installable';
|
|
3
|
-
import { logger } from '@pnpm/logger';
|
|
4
|
-
export function packageIsInstallable(pkgPath, pkg, opts) {
|
|
5
|
-
const currentPnpmVersion = packageManager.name === 'pnpm'
|
|
6
|
-
? packageManager.version
|
|
7
|
-
: undefined;
|
|
8
|
-
const err = checkPackage(pkgPath, pkg, {
|
|
9
|
-
nodeVersion: opts.nodeVersion,
|
|
10
|
-
pnpmVersion: currentPnpmVersion,
|
|
11
|
-
supportedArchitectures: opts.supportedArchitectures ?? {
|
|
12
|
-
os: ['current'],
|
|
13
|
-
cpu: ['current'],
|
|
14
|
-
libc: ['current'],
|
|
15
|
-
},
|
|
16
|
-
});
|
|
17
|
-
if (err === null)
|
|
18
|
-
return;
|
|
19
|
-
if ((err instanceof UnsupportedEngineError && err.wanted.pnpm) ??
|
|
20
|
-
opts.engineStrict)
|
|
21
|
-
throw err;
|
|
22
|
-
logger.warn({
|
|
23
|
-
message: `Unsupported ${err instanceof UnsupportedEngineError ? 'engine' : 'platform'}: wanted: ${JSON.stringify(err.wanted)} (current: ${JSON.stringify(err.current)})`,
|
|
24
|
-
prefix: pkgPath,
|
|
25
|
-
});
|
|
26
|
-
}
|
|
27
|
-
//# sourceMappingURL=packageIsInstallable.js.map
|
package/lib/promptPageSize.d.ts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export declare function interactivePromptPageSize(): number;
|
package/lib/promptPageSize.js
DELETED
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import { getAllDependenciesFromManifest } from '@pnpm/pkg-manifest.utils';
|
|
2
|
-
import { readProjectManifest } from '@pnpm/workspace.project-manifest-reader';
|
|
3
|
-
export async function readDepNameCompletions(dir) {
|
|
4
|
-
const { manifest } = await readProjectManifest(dir ?? process.cwd());
|
|
5
|
-
return Object.keys(getAllDependenciesFromManifest(manifest)).map((name) => ({ name }));
|
|
6
|
-
}
|
|
7
|
-
//# sourceMappingURL=readDepNameCompletions.js.map
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
import type { ProjectManifest, SupportedArchitectures } from '@pnpm/types';
|
|
2
|
-
export interface ReadProjectManifestOpts {
|
|
3
|
-
engineStrict?: boolean;
|
|
4
|
-
nodeVersion?: string;
|
|
5
|
-
supportedArchitectures?: SupportedArchitectures;
|
|
6
|
-
}
|
|
7
|
-
interface BaseReadProjectManifestResult {
|
|
8
|
-
fileName: string;
|
|
9
|
-
writeProjectManifest: (manifest: ProjectManifest, force?: boolean) => Promise<void>;
|
|
10
|
-
}
|
|
11
|
-
export interface ReadProjectManifestResult extends BaseReadProjectManifestResult {
|
|
12
|
-
manifest: ProjectManifest;
|
|
13
|
-
}
|
|
14
|
-
export declare function readProjectManifest(projectDir: string, opts?: ReadProjectManifestOpts): Promise<ReadProjectManifestResult>;
|
|
15
|
-
export declare function readProjectManifestOnly(projectDir: string, opts?: ReadProjectManifestOpts): Promise<ProjectManifest>;
|
|
16
|
-
export interface TryReadProjectManifestResult extends BaseReadProjectManifestResult {
|
|
17
|
-
manifest: ProjectManifest | null;
|
|
18
|
-
}
|
|
19
|
-
export declare function tryReadProjectManifest(projectDir: string, opts: ReadProjectManifestOpts): Promise<TryReadProjectManifestResult>;
|
|
20
|
-
export {};
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
import * as utils from '@pnpm/workspace.project-manifest-reader';
|
|
2
|
-
import { packageIsInstallable } from './packageIsInstallable.js';
|
|
3
|
-
export async function readProjectManifest(projectDir, opts = {}) {
|
|
4
|
-
const { fileName, manifest, writeProjectManifest } = await utils.readProjectManifest(projectDir);
|
|
5
|
-
packageIsInstallable(projectDir, manifest, opts); // eslint-disable-line @typescript-eslint/no-explicit-any
|
|
6
|
-
return { fileName, manifest, writeProjectManifest };
|
|
7
|
-
}
|
|
8
|
-
export async function readProjectManifestOnly(projectDir, opts = {}) {
|
|
9
|
-
const manifest = await utils.readProjectManifestOnly(projectDir);
|
|
10
|
-
packageIsInstallable(projectDir, manifest, opts); // eslint-disable-line @typescript-eslint/no-explicit-any
|
|
11
|
-
return manifest;
|
|
12
|
-
}
|
|
13
|
-
export async function tryReadProjectManifest(projectDir, opts) {
|
|
14
|
-
const { fileName, manifest, writeProjectManifest } = await utils.tryReadProjectManifest(projectDir);
|
|
15
|
-
if (manifest == null)
|
|
16
|
-
return { fileName, manifest, writeProjectManifest };
|
|
17
|
-
packageIsInstallable(projectDir, manifest, opts); // eslint-disable-line @typescript-eslint/no-explicit-any
|
|
18
|
-
return { fileName, manifest, writeProjectManifest };
|
|
19
|
-
}
|
|
20
|
-
//# sourceMappingURL=readProjectManifest.js.map
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
interface ActionFailure {
|
|
2
|
-
status: 'failure';
|
|
3
|
-
duration?: number;
|
|
4
|
-
prefix: string;
|
|
5
|
-
message: string;
|
|
6
|
-
error: Error;
|
|
7
|
-
}
|
|
8
|
-
export type RecursiveSummary = Record<string, {
|
|
9
|
-
status: 'passed' | 'queued' | 'running' | 'skipped';
|
|
10
|
-
duration?: number;
|
|
11
|
-
} | ActionFailure>;
|
|
12
|
-
export declare function throwOnCommandFail(command: string, recursiveSummary: RecursiveSummary): void;
|
|
13
|
-
export {};
|
package/lib/recursiveSummary.js
DELETED
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
import { PnpmError } from '@pnpm/error';
|
|
2
|
-
class RecursiveFailError extends PnpmError {
|
|
3
|
-
failures;
|
|
4
|
-
passes;
|
|
5
|
-
constructor(command, recursiveSummary, failures) {
|
|
6
|
-
super('RECURSIVE_FAIL', `"${command}" failed in ${failures.length} packages`);
|
|
7
|
-
this.failures = failures;
|
|
8
|
-
this.passes = Object.values(recursiveSummary).filter(({ status }) => status === 'passed').length;
|
|
9
|
-
}
|
|
10
|
-
}
|
|
11
|
-
export function throwOnCommandFail(command, recursiveSummary) {
|
|
12
|
-
const failures = Object.values(recursiveSummary).filter(({ status }) => status === 'failure');
|
|
13
|
-
if (failures.length > 0) {
|
|
14
|
-
throw new RecursiveFailError(command, recursiveSummary, failures);
|
|
15
|
-
}
|
|
16
|
-
}
|
|
17
|
-
//# sourceMappingURL=recursiveSummary.js.map
|
package/lib/style.d.ts
DELETED
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
export declare const TABLE_OPTIONS: {
|
|
2
|
-
border: {
|
|
3
|
-
topBody: string;
|
|
4
|
-
topJoin: string;
|
|
5
|
-
topLeft: string;
|
|
6
|
-
topRight: string;
|
|
7
|
-
bottomBody: string;
|
|
8
|
-
bottomJoin: string;
|
|
9
|
-
bottomLeft: string;
|
|
10
|
-
bottomRight: string;
|
|
11
|
-
bodyJoin: string;
|
|
12
|
-
bodyLeft: string;
|
|
13
|
-
bodyRight: string;
|
|
14
|
-
joinBody: string;
|
|
15
|
-
joinJoin: string;
|
|
16
|
-
joinLeft: string;
|
|
17
|
-
joinRight: string;
|
|
18
|
-
};
|
|
19
|
-
columns: {};
|
|
20
|
-
};
|
package/lib/style.js
DELETED
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
import chalk from 'chalk';
|
|
2
|
-
export const TABLE_OPTIONS = {
|
|
3
|
-
border: {
|
|
4
|
-
topBody: '─',
|
|
5
|
-
topJoin: '┬',
|
|
6
|
-
topLeft: '┌',
|
|
7
|
-
topRight: '┐',
|
|
8
|
-
bottomBody: '─',
|
|
9
|
-
bottomJoin: '┴',
|
|
10
|
-
bottomLeft: '└',
|
|
11
|
-
bottomRight: '┘',
|
|
12
|
-
bodyJoin: '│',
|
|
13
|
-
bodyLeft: '│',
|
|
14
|
-
bodyRight: '│',
|
|
15
|
-
joinBody: '─',
|
|
16
|
-
joinJoin: '┼',
|
|
17
|
-
joinLeft: '├',
|
|
18
|
-
joinRight: '┤',
|
|
19
|
-
},
|
|
20
|
-
columns: {},
|
|
21
|
-
};
|
|
22
|
-
for (const [key, value] of Object.entries(TABLE_OPTIONS.border)) {
|
|
23
|
-
TABLE_OPTIONS.border[key] = chalk.grey(value);
|
|
24
|
-
}
|
|
25
|
-
//# sourceMappingURL=style.js.map
|