@visulima/package 5.0.0-alpha.11 → 5.0.0-alpha.13

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,3 +1,28 @@
1
+ ## @visulima/package [5.0.0-alpha.13](https://github.com/visulima/visulima/compare/@visulima/package@5.0.0-alpha.12...@visulima/package@5.0.0-alpha.13) (2026-05-06)
2
+
3
+ ### Miscellaneous Chores
4
+
5
+ * **package:** apply prettier and eslint quote-style auto-fix ([0316bca](https://github.com/visulima/visulima/commit/0316bca0deca444ff12675bc760c7091ce243d31))
6
+ * **package:** housekeeping cleanup ([113978b](https://github.com/visulima/visulima/commit/113978b0babcfc7879514aec076f6e2d5e7afab0))
7
+
8
+
9
+ ### Dependencies
10
+
11
+ * **@visulima/fs:** upgraded to 5.0.0-alpha.14
12
+
13
+ ## @visulima/package [5.0.0-alpha.12](https://github.com/visulima/visulima/compare/@visulima/package@5.0.0-alpha.11...@visulima/package@5.0.0-alpha.12) (2026-05-04)
14
+
15
+ ### Miscellaneous Chores
16
+
17
+ * **package:** upgrade packem to 2.0.0-alpha.76 ([b2ef62b](https://github.com/visulima/visulima/commit/b2ef62b72a84545cb025a250cbe7e3e36b34330d))
18
+ * re-sort workspace package.json files via vis sort-package-json ([f625696](https://github.com/visulima/visulima/commit/f625696cfac974325774b3243e1a83c3d23acbd7))
19
+ * simplify pnpm-workspace packages list ([7cab221](https://github.com/visulima/visulima/commit/7cab221163632d9b7aa044a6f88c49083103a869))
20
+
21
+
22
+ ### Dependencies
23
+
24
+ * **@visulima/fs:** upgraded to 5.0.0-alpha.13
25
+
1
26
  ## @visulima/package [5.0.0-alpha.11](https://github.com/visulima/visulima/compare/@visulima/package@5.0.0-alpha.10...@visulima/package@5.0.0-alpha.11) (2026-04-22)
2
27
 
3
28
  ### Bug Fixes
package/dist/error.d.ts CHANGED
@@ -1 +1,15 @@
1
- export { default as PackageNotFoundError } from "./error/package-not-found-error.d.ts";
1
+ /**
2
+ * Error thrown when a package was not found.
3
+ */
4
+ declare class PackageNotFoundError extends Error {
5
+ /**
6
+ * @param packageName The name of the package that was not found.
7
+ * @param packageManager The package manager used to install the package.
8
+ */
9
+ constructor(packageName: string[] | string, packageManager?: string);
10
+ get code(): string;
11
+ set code(_name: string);
12
+ override get name(): string;
13
+ override set name(_name: string);
14
+ }
15
+ export { PackageNotFoundError };
package/dist/error.js CHANGED
@@ -1 +1 @@
1
- export { default as PackageNotFoundError } from './packem_shared/PackageNotFoundError-C0ltLzw7.js';
1
+ import{default as a}from"./packem_shared/PackageNotFoundError--qHnCLzN.js";export{a as PackageNotFoundError};
package/dist/index.d.ts CHANGED
@@ -1,13 +1,13 @@
1
- export { default as PackageNotFoundError } from "./error/package-not-found-error.d.ts";
2
- export type { LockFileEntry, LockFileIntegrity, LockFileIntegrityAlgorithm, LockFileParseResult, LockFileType } from "./lockfile.d.ts";
3
- export { decodeSriIntegrity, parseBunLockFile, parseLockFile, parseLockFileContent, parseLockFileSync, parseNpmLockFile, parsePnpmLockFile, parseYarnLockFile, } from "./lockfile.d.ts";
4
- export type { RootMonorepo, Strategy } from "./monorepo.d.ts";
5
- export { findMonorepoRoot, findMonorepoRootSync } from "./monorepo.d.ts";
6
- export { findPackageRoot, findPackageRootSync } from "./package.d.ts";
7
- export type { FindPackageJsonCache, NormalizedReadResult } from "./package-json.d.ts";
8
- export { ensurePackages, findPackageJson, findPackageJsonSync, getPackageJsonProperty, hasPackageJsonAnyDependency, hasPackageJsonProperty, parsePackageJson, parsePackageJsonSync, writePackageJson, writePackageJsonSync, } from "./package-json.d.ts";
9
- export type { PackageManager, PackageManagerResult } from "./package-manager.d.ts";
10
- export { findLockFile, findLockFileSync, findPackageManager, findPackageManagerSync, generateMissingPackagesInstallMessage, getPackageManagerVersion, identifyInitiatingPackageManager, } from "./package-manager.d.ts";
11
- export type { PnpmCatalog, PnpmCatalogs } from "./pnpm.d.ts";
12
- export { isPackageInWorkspace, readPnpmCatalogs, readPnpmCatalogsSync, resolveCatalogReference, resolveCatalogReferences, resolveDependenciesCatalogReferences, } from "./pnpm.d.ts";
13
- export type { EnsurePackagesOptions, NormalizedPackageJson, PackageJson } from "./types.d.ts";
1
+ export { PackageNotFoundError } from "./error.js";
2
+ export { type LockFileEntry, type LockFileIntegrity, type LockFileIntegrityAlgorithm, type LockFileParseResult, type LockFileType, decodeSriIntegrity, parseBunLockFile, parseLockFile, parseLockFileContent, parseLockFileSync, parseNpmLockFile, parsePnpmLockFile, parseYarnLockFile } from "./lockfile.js";
3
+ export { type RootMonorepo, type Strategy, findMonorepoRoot, findMonorepoRootSync } from "./monorepo.js";
4
+ export { findPackageRoot, findPackageRootSync } from "./package.js";
5
+ export { type E as EnsurePackagesOptions, type F as FindPackageJsonCache, type N as NormalizedPackageJson, type a as NormalizedReadResult, type P as PackageJson, e as ensurePackages, f as findPackageJson, b as findPackageJsonSync, g as getPackageJsonProperty, h as hasPackageJsonAnyDependency, c as hasPackageJsonProperty, p as parsePackageJson, d as parsePackageJsonSync, w as writePackageJson, i as writePackageJsonSync } from "./packem_shared/package-json.d-R9WIRfmM.js";
6
+ export { type PackageManager, type PackageManagerResult, findLockFile, findLockFileSync, findPackageManager, findPackageManagerSync, generateMissingPackagesInstallMessage, getPackageManagerVersion, identifyInitiatingPackageManager } from "./package-manager.js";
7
+ export { type PnpmCatalog, type PnpmCatalogs, isPackageInWorkspace, readPnpmCatalogs, readPnpmCatalogsSync, resolveCatalogReference, resolveCatalogReferences, resolveDependenciesCatalogReferences } from "./pnpm.js";
8
+ import '@visulima/fs';
9
+ import 'type-fest';
10
+ import '@antfu/install-pkg';
11
+ import '@inquirer/core';
12
+ import '@inquirer/type';
13
+ import 'normalize-package-data';
package/dist/index.js CHANGED
@@ -1,7 +1 @@
1
- export { default as PackageNotFoundError } from './packem_shared/PackageNotFoundError-C0ltLzw7.js';
2
- export { decodeSriIntegrity, parseBunLockFile, parseLockFile, parseLockFileContent, parseLockFileSync, parseNpmLockFile, parsePnpmLockFile, parseYarnLockFile } from './lockfile.js';
3
- export { findMonorepoRoot, findMonorepoRootSync } from './monorepo.js';
4
- export { findPackageRoot, findPackageRootSync } from './package.js';
5
- export { ensurePackages, findPackageJson, findPackageJsonSync, getPackageJsonProperty, hasPackageJsonAnyDependency, hasPackageJsonProperty, parsePackageJson, parsePackageJsonSync, writePackageJson, writePackageJsonSync } from './package-json.js';
6
- export { findLockFile, findLockFileSync, findPackageManager, findPackageManagerSync, generateMissingPackagesInstallMessage, getPackageManagerVersion, identifyInitiatingPackageManager } from './package-manager.js';
7
- export { isPackageInWorkspace, readPnpmCatalogs, readPnpmCatalogsSync, resolveCatalogReference, resolveCatalogReferences, resolveDependenciesCatalogReferences } from './pnpm.js';
1
+ import{default as o}from"./packem_shared/PackageNotFoundError--qHnCLzN.js";import{decodeSriIntegrity as r,parseBunLockFile as c,parseLockFile as s,parseLockFileContent as g,parseLockFileSync as i,parseNpmLockFile as t,parsePnpmLockFile as k,parseYarnLockFile as p}from"./lockfile.js";import{findMonorepoRoot as f,findMonorepoRootSync as l}from"./monorepo.js";import{findPackageRoot as y,findPackageRootSync as m}from"./package.js";import{ensurePackages as S,findPackageJson as J,findPackageJsonSync as L,getPackageJsonProperty as M,hasPackageJsonAnyDependency as x,hasPackageJsonProperty as R,parsePackageJson as C,parsePackageJsonSync as u,writePackageJson as I,writePackageJsonSync as v}from"./package-json.js";import{findLockFile as w,findLockFileSync as D,findPackageManager as N,findPackageManagerSync as A,generateMissingPackagesInstallMessage as B,getPackageManagerVersion as E,identifyInitiatingPackageManager as V}from"./package-manager.js";import{isPackageInWorkspace as Y,readPnpmCatalogs as b,readPnpmCatalogsSync as j,resolveCatalogReference as q,resolveCatalogReferences as z,resolveDependenciesCatalogReferences as G}from"./pnpm.js";export{o as PackageNotFoundError,r as decodeSriIntegrity,S as ensurePackages,w as findLockFile,D as findLockFileSync,f as findMonorepoRoot,l as findMonorepoRootSync,J as findPackageJson,L as findPackageJsonSync,N as findPackageManager,A as findPackageManagerSync,y as findPackageRoot,m as findPackageRootSync,B as generateMissingPackagesInstallMessage,M as getPackageJsonProperty,E as getPackageManagerVersion,x as hasPackageJsonAnyDependency,R as hasPackageJsonProperty,V as identifyInitiatingPackageManager,Y as isPackageInWorkspace,c as parseBunLockFile,s as parseLockFile,g as parseLockFileContent,i as parseLockFileSync,t as parseNpmLockFile,C as parsePackageJson,u as parsePackageJsonSync,k as parsePnpmLockFile,p as parseYarnLockFile,b as readPnpmCatalogs,j as readPnpmCatalogsSync,q as resolveCatalogReference,z as resolveCatalogReferences,G as resolveDependenciesCatalogReferences,I as writePackageJson,v as writePackageJsonSync};
@@ -1,113 +1,114 @@
1
1
  /** Lockfiles the parser recognises. Legacy binary `bun.lockb` is unsupported. */
2
- export type LockFileType = "bun" | "npm" | "pnpm" | "yarn";
2
+ type LockFileType = "bun" | "npm" | "pnpm" | "yarn";
3
3
  /** SRI algorithms the parser can decode into hex. */
4
- export type LockFileIntegrityAlgorithm = "sha256" | "sha384" | "sha512";
4
+ type LockFileIntegrityAlgorithm = "sha256" | "sha384" | "sha512";
5
5
  /** Decoded integrity digest: algorithm + lowercase hex string. */
6
- export interface LockFileIntegrity {
7
- algorithm: LockFileIntegrityAlgorithm;
8
- hex: string;
6
+ interface LockFileIntegrity {
7
+ algorithm: LockFileIntegrityAlgorithm;
8
+ hex: string;
9
9
  }
10
10
  /** A single resolved package extracted from a lockfile. */
11
- export interface LockFileEntry {
12
- /**
13
- * Declared runtime dependencies — `name → specifier[]` map. Values
14
- * are arrays so pnpm v9+ peer-context variants (the same dep name
15
- * resolved to different versions under different peer contexts)
16
- * can all be preserved. npm, yarn v1, bun, and pnpm v6-v8 always
17
- * produce single-element arrays; pnpm v9+ may produce multi-element
18
- * arrays for peer-context-sensitive deps.
19
- *
20
- * Specifiers are whatever the lockfile recorded — a range
21
- * (`^1.0.0`) for npm / yarn / bun, or an already-resolved exact
22
- * version for pnpm. Callers resolve each specifier against
23
- * {@link LockFileEntry.version} values elsewhere in the lockfile
24
- * when they need a concrete edge.
25
- */
26
- dependencies?: Record<string, string[]>;
27
- /** Decoded SRI digest, if the lockfile recorded one. */
28
- integrity?: LockFileIntegrity;
29
- /** Package name — `lodash` or `@scope/name`. */
30
- name: string;
31
- /** Declared optional dependencies, same shape as `dependencies`. */
32
- optionalDependencies?: Record<string, string[]>;
33
- /** Declared peer dependencies, same shape as `dependencies`. */
34
- peerDependencies?: Record<string, string[]>;
35
- /** Resolved exact version — e.g. `4.17.21`. */
36
- version: string;
11
+ interface LockFileEntry {
12
+ /**
13
+ * Declared runtime dependencies — `name → specifier[]` map. Values
14
+ * are arrays so pnpm v9+ peer-context variants (the same dep name
15
+ * resolved to different versions under different peer contexts)
16
+ * can all be preserved. npm, yarn v1, bun, and pnpm v6-v8 always
17
+ * produce single-element arrays; pnpm v9+ may produce multi-element
18
+ * arrays for peer-context-sensitive deps.
19
+ *
20
+ * Specifiers are whatever the lockfile recorded — a range
21
+ * (`^1.0.0`) for npm / yarn / bun, or an already-resolved exact
22
+ * version for pnpm. Callers resolve each specifier against
23
+ * {@link LockFileEntry.version} values elsewhere in the lockfile
24
+ * when they need a concrete edge.
25
+ */
26
+ dependencies?: Record<string, string[]>;
27
+ /** Decoded SRI digest, if the lockfile recorded one. */
28
+ integrity?: LockFileIntegrity;
29
+ /** Package name — `lodash` or `@scope/name`. */
30
+ name: string;
31
+ /** Declared optional dependencies, same shape as `dependencies`. */
32
+ optionalDependencies?: Record<string, string[]>;
33
+ /** Declared peer dependencies, same shape as `dependencies`. */
34
+ peerDependencies?: Record<string, string[]>;
35
+ /** Resolved exact version — e.g. `4.17.21`. */
36
+ version: string;
37
37
  }
38
38
  /** Result of locating + parsing a lockfile on disk. */
39
- export interface LockFileParseResult {
40
- entries: LockFileEntry[];
41
- /** Absolute path of the lockfile that was parsed. */
42
- path: string;
43
- type: LockFileType;
39
+ interface LockFileParseResult {
40
+ entries: LockFileEntry[];
41
+ /** Absolute path of the lockfile that was parsed. */
42
+ path: string;
43
+ type: LockFileType;
44
44
  }
45
45
  /**
46
- * Decodes a Subresource Integrity string (`sha512-&lt;base64>`) into a
47
- * `{ algorithm, hex }` pair. Returns `undefined` if the string is
48
- * malformed, oversized, or uses an unsupported algorithm.
49
- * @param sri Full SRI string, e.g. `sha512-&lt;base64>`.
50
- * @returns Decoded algorithm + hex digest, or `undefined` when the
51
- * input can't be parsed.
52
- */
53
- export declare const decodeSriIntegrity: (sri: string) => LockFileIntegrity | undefined;
46
+ * Decodes a Subresource Integrity string (`sha512-&lt;base64>`) into a
47
+ * `{ algorithm, hex }` pair. Returns `undefined` if the string is
48
+ * malformed, oversized, or uses an unsupported algorithm.
49
+ * @param sri Full SRI string, e.g. `sha512-&lt;base64>`.
50
+ * @returns Decoded algorithm + hex digest, or `undefined` when the
51
+ * input can't be parsed.
52
+ */
53
+ declare const decodeSriIntegrity: (sri: string) => LockFileIntegrity | undefined;
54
54
  /**
55
- * Parses `package-lock.json` (npm v2 / v3 format).
56
- * @param content Raw JSON text of the lockfile.
57
- * @returns One {@link LockFileEntry} per distinct `name@version`.
58
- */
59
- export declare const parseNpmLockFile: (content: string) => LockFileEntry[];
55
+ * Parses `package-lock.json` (npm v2 / v3 format).
56
+ * @param content Raw JSON text of the lockfile.
57
+ * @returns One {@link LockFileEntry} per distinct `name@version`.
58
+ */
59
+ declare const parseNpmLockFile: (content: string) => LockFileEntry[];
60
60
  /**
61
- * Parses `pnpm-lock.yaml`. Regex-based; works for lockfile v6 through
62
- * v9. v9 moves concrete resolved dependency versions out of `packages:`
63
- * and into `snapshots:`; this parser reads both sections and unions
64
- * their dep-maps onto the final entry.
65
- * @param content Raw YAML text of the lockfile.
66
- * @returns One {@link LockFileEntry} per distinct `name@version`.
67
- */
68
- export declare const parsePnpmLockFile: (content: string) => LockFileEntry[];
61
+ * Parses `pnpm-lock.yaml`. Regex-based; works for lockfile v6 through
62
+ * v9. v9 moves concrete resolved dependency versions out of `packages:`
63
+ * and into `snapshots:`; this parser reads both sections and unions
64
+ * their dep-maps onto the final entry.
65
+ * @param content Raw YAML text of the lockfile.
66
+ * @returns One {@link LockFileEntry} per distinct `name@version`.
67
+ */
68
+ declare const parsePnpmLockFile: (content: string) => LockFileEntry[];
69
69
  /**
70
- * Parses `yarn.lock` for Yarn Classic (v1) and Berry (v2+). Berry's
71
- * XXH64 `checksum:` is not a cryptographic hash and is intentionally
72
- * dropped; only v1's SRI `integrity:` flows through to
73
- * {@link LockFileEntry.integrity}.
74
- * @param content Raw text of the lockfile.
75
- * @returns One {@link LockFileEntry} per distinct `name@version`.
76
- */
77
- export declare const parseYarnLockFile: (content: string) => LockFileEntry[];
70
+ * Parses `yarn.lock` for Yarn Classic (v1) and Berry (v2+). Berry's
71
+ * XXH64 `checksum:` is not a cryptographic hash and is intentionally
72
+ * dropped; only v1's SRI `integrity:` flows through to
73
+ * {@link LockFileEntry.integrity}.
74
+ * @param content Raw text of the lockfile.
75
+ * @returns One {@link LockFileEntry} per distinct `name@version`.
76
+ */
77
+ declare const parseYarnLockFile: (content: string) => LockFileEntry[];
78
78
  /**
79
- * Parses `bun.lock` (Bun v1.1+, JSON-ish with trailing commas). The
80
- * binary `bun.lockb` format is not supported.
81
- *
82
- * Attribution: format + tuple layout verified against lockparse
83
- * (https://github.com/43081j/lockparse, MIT).
84
- * @param content Raw text of the lockfile.
85
- * @returns One {@link LockFileEntry} per distinct `name@version`.
86
- */
87
- export declare const parseBunLockFile: (content: string) => LockFileEntry[];
79
+ * Parses `bun.lock` (Bun v1.1+, JSON-ish with trailing commas). The
80
+ * binary `bun.lockb` format is not supported.
81
+ *
82
+ * Attribution: format + tuple layout verified against lockparse
83
+ * (https://github.com/43081j/lockparse, MIT).
84
+ * @param content Raw text of the lockfile.
85
+ * @returns One {@link LockFileEntry} per distinct `name@version`.
86
+ */
87
+ declare const parseBunLockFile: (content: string) => LockFileEntry[];
88
88
  /**
89
- * Parses raw lockfile content of the given type. Returns an empty
90
- * array if the content is malformed or doesn't contain any package
91
- * entries.
92
- * @param content Raw text of the lockfile.
93
- * @param type Which parser to dispatch to.
94
- * @returns One {@link LockFileEntry} per distinct `name@version`.
95
- */
96
- export declare const parseLockFileContent: (content: string, type: LockFileType) => LockFileEntry[];
89
+ * Parses raw lockfile content of the given type. Returns an empty
90
+ * array if the content is malformed or doesn't contain any package
91
+ * entries.
92
+ * @param content Raw text of the lockfile.
93
+ * @param type Which parser to dispatch to.
94
+ * @returns One {@link LockFileEntry} per distinct `name@version`.
95
+ */
96
+ declare const parseLockFileContent: (content: string, type: LockFileType) => LockFileEntry[];
97
97
  /**
98
- * Walks up from `cwd`, locates the nearest supported lockfile, reads
99
- * it, and returns the parsed entries alongside the lockfile type and
100
- * absolute path.
101
- * @param cwd Directory to start the search from. Defaults to
102
- * `process.cwd()` (delegated to `findUp`).
103
- * @returns The parsed result, keyed by the discovered lockfile path.
104
- * @throws If no supported lockfile can be found above `cwd`.
105
- */
106
- export declare const parseLockFile: (cwd?: URL | string) => Promise<LockFileParseResult>;
98
+ * Walks up from `cwd`, locates the nearest supported lockfile, reads
99
+ * it, and returns the parsed entries alongside the lockfile type and
100
+ * absolute path.
101
+ * @param cwd Directory to start the search from. Defaults to
102
+ * `process.cwd()` (delegated to `findUp`).
103
+ * @returns The parsed result, keyed by the discovered lockfile path.
104
+ * @throws If no supported lockfile can be found above `cwd`.
105
+ */
106
+ declare const parseLockFile: (cwd?: URL | string) => Promise<LockFileParseResult>;
107
107
  /**
108
- * Synchronous counterpart to {@link parseLockFile}.
109
- * @param cwd Directory to start the search from.
110
- * @returns The parsed result, keyed by the discovered lockfile path.
111
- * @throws If no supported lockfile can be found above `cwd`.
112
- */
113
- export declare const parseLockFileSync: (cwd?: URL | string) => LockFileParseResult;
108
+ * Synchronous counterpart to {@link parseLockFile}.
109
+ * @param cwd Directory to start the search from.
110
+ * @returns The parsed result, keyed by the discovered lockfile path.
111
+ * @throws If no supported lockfile can be found above `cwd`.
112
+ */
113
+ declare const parseLockFileSync: (cwd?: URL | string) => LockFileParseResult;
114
+ export { LockFileEntry, LockFileIntegrity, LockFileIntegrityAlgorithm, LockFileParseResult, LockFileType, decodeSriIntegrity, parseBunLockFile, parseLockFile, parseLockFileContent, parseLockFileSync, parseNpmLockFile, parsePnpmLockFile, parseYarnLockFile };