@pnpm/cli.utils 1101.0.18 → 1101.0.19

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,19 @@
1
1
  # @pnpm/cli-utils
2
2
 
3
+ ## 1101.0.19
4
+
5
+ ### Patch Changes
6
+
7
+ - Republished every package: the tarballs published by the v11.13.1 through v11.16.0 releases were missing most of their compiled files due to a packing bug [#13164](https://github.com/pnpm/pnpm/issues/13164).
8
+
9
+ - Updated dependencies:
10
+ - @pnpm/cli.meta@1100.0.11
11
+ - @pnpm/config.package-is-installable@1100.0.16
12
+ - @pnpm/error@1100.1.0
13
+ - @pnpm/pkg-manifest.utils@1100.2.12
14
+ - @pnpm/types@1101.6.0
15
+ - @pnpm/workspace.project-manifest-reader@1100.0.20
16
+
3
17
  ## 1101.0.18
4
18
 
5
19
  ### Patch Changes
package/lib/index.d.ts ADDED
@@ -0,0 +1,7 @@
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;
@@ -0,0 +1,13 @@
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;
@@ -0,0 +1,27 @@
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
@@ -0,0 +1 @@
1
+ export declare function interactivePromptPageSize(): number;
@@ -0,0 +1,5 @@
1
+ export function interactivePromptPageSize() {
2
+ const availableRows = process.stdout.rows;
3
+ return availableRows == null ? 7 : Math.max(7, availableRows - 6);
4
+ }
5
+ //# sourceMappingURL=promptPageSize.js.map
@@ -0,0 +1,3 @@
1
+ export declare function readDepNameCompletions(dir?: string): Promise<Array<{
2
+ name: string;
3
+ }>>;
@@ -0,0 +1,7 @@
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
@@ -0,0 +1,20 @@
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 {};
@@ -0,0 +1,20 @@
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
@@ -0,0 +1,13 @@
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 {};
@@ -0,0 +1,17 @@
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 ADDED
@@ -0,0 +1,20 @@
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 ADDED
@@ -0,0 +1,25 @@
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
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pnpm/cli.utils",
3
- "version": "1101.0.18",
3
+ "version": "1101.0.19",
4
4
  "description": "Utils for pnpm commands",
5
5
  "keywords": [
6
6
  "pnpm",
@@ -27,12 +27,12 @@
27
27
  "!*.map"
28
28
  ],
29
29
  "dependencies": {
30
- "@pnpm/cli.meta": "1100.0.10",
31
- "@pnpm/config.package-is-installable": "1100.0.15",
32
- "@pnpm/error": "1100.0.1",
33
- "@pnpm/pkg-manifest.utils": "1100.2.11",
34
- "@pnpm/types": "1101.5.0",
35
- "@pnpm/workspace.project-manifest-reader": "1100.0.19",
30
+ "@pnpm/cli.meta": "1100.0.11",
31
+ "@pnpm/config.package-is-installable": "1100.0.16",
32
+ "@pnpm/error": "1100.1.0",
33
+ "@pnpm/pkg-manifest.utils": "1100.2.12",
34
+ "@pnpm/types": "1101.6.0",
35
+ "@pnpm/workspace.project-manifest-reader": "1100.0.20",
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.18",
43
+ "@pnpm/cli.utils": "1101.0.19",
44
44
  "@pnpm/logger": "1100.0.0"
45
45
  },
46
46
  "engines": {