@visulima/package 5.0.0-alpha.3 → 5.0.0-alpha.5
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 +48 -0
- package/LICENSE.md +1 -1
- package/dist/error.js +1 -1
- package/dist/index.js +6 -1
- package/dist/monorepo.js +118 -1
- package/dist/package-json.js +620 -4
- package/dist/package-manager.js +231 -9
- package/dist/package.js +81 -1
- package/dist/packem_shared/PackageNotFoundError-CJmAqa_k.js +46 -0
- package/dist/pnpm.js +105 -1
- package/package.json +7 -5
- package/dist/packem_shared/PackageNotFoundError-BictYTIA.js +0 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,51 @@
|
|
|
1
|
+
## @visulima/package [5.0.0-alpha.5](https://github.com/visulima/visulima/compare/@visulima/package@5.0.0-alpha.4...@visulima/package@5.0.0-alpha.5) (2026-03-26)
|
|
2
|
+
|
|
3
|
+
### Bug Fixes
|
|
4
|
+
|
|
5
|
+
* **package:** use workspace:* for internal [@visulima](https://github.com/visulima) deps ([e409128](https://github.com/visulima/visulima/commit/e409128c02a6d801dd385ae845c1ab28ca5c09da))
|
|
6
|
+
* **web:** improve build setup with incremental stats caching and prod install ([fe33e75](https://github.com/visulima/visulima/commit/fe33e75827586779b4b3a0c6d57b39f889ee6207))
|
|
7
|
+
|
|
8
|
+
### Miscellaneous Chores
|
|
9
|
+
|
|
10
|
+
* **package:** migrate deps to pnpm catalogs ([301fac4](https://github.com/visulima/visulima/commit/301fac41be88df7469155649467921a72ca740a6))
|
|
11
|
+
* **package:** update dependencies ([fb1a43d](https://github.com/visulima/visulima/commit/fb1a43de0fd345806d76aec660d48c627d576083))
|
|
12
|
+
* visulima website ([#591](https://github.com/visulima/visulima/issues/591)) ([59ab2e2](https://github.com/visulima/visulima/commit/59ab2e2befb03e51cd2088956f83d9b87de6d033))
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
### Dependencies
|
|
16
|
+
|
|
17
|
+
* **@visulima/fs:** upgraded to 5.0.0-alpha.5
|
|
18
|
+
* **@visulima/path:** upgraded to 3.0.0-alpha.6
|
|
19
|
+
|
|
20
|
+
## @visulima/package [5.0.0-alpha.4](https://github.com/visulima/visulima/compare/@visulima/package@5.0.0-alpha.3...@visulima/package@5.0.0-alpha.4) (2026-03-06)
|
|
21
|
+
|
|
22
|
+
### Bug Fixes
|
|
23
|
+
|
|
24
|
+
* **package:** update packem to 2.0.0-alpha.54 ([e5b3249](https://github.com/visulima/visulima/commit/e5b3249026a425b7a42443f66a08f8f68c3d62e4))
|
|
25
|
+
* **package:** use intentionally malformed JSON in bad workspace fixture ([a6680e7](https://github.com/visulima/visulima/commit/a6680e7a97aeae643c26b69bc5eb6c64c28de278))
|
|
26
|
+
|
|
27
|
+
### Documentation
|
|
28
|
+
|
|
29
|
+
* **humanizer,html,iso-locale,package,tsconfig:** add comprehensive Fumadocs documentation ([19781ce](https://github.com/visulima/visulima/commit/19781ce5d27605971a9f2fdf0a99863effd98091))
|
|
30
|
+
|
|
31
|
+
### Miscellaneous Chores
|
|
32
|
+
|
|
33
|
+
* **package:** update dependencies ([d89cde6](https://github.com/visulima/visulima/commit/d89cde6792e9036d0690cfaf9b771e26b24faac8))
|
|
34
|
+
* **package:** update dependencies ([4b62cf8](https://github.com/visulima/visulima/commit/4b62cf85e6ef4deac4ef01c8a7e15bcf49ecbe80))
|
|
35
|
+
* **tooling:** update dependencies ([7f6f9d3](https://github.com/visulima/visulima/commit/7f6f9d3c41b170c53659ab34b79ceb23e4e9660a))
|
|
36
|
+
* update lock file maintenance ([d83e716](https://github.com/visulima/visulima/commit/d83e71697b75d24704185b66bb521a934d2db02d))
|
|
37
|
+
* year update ([47f4105](https://github.com/visulima/visulima/commit/47f410596ce7190cfea36a073db32e0cec50bbcd))
|
|
38
|
+
|
|
39
|
+
### Tests
|
|
40
|
+
|
|
41
|
+
* **package:** fix broken JSON test fixture ([46141d6](https://github.com/visulima/visulima/commit/46141d6472d8de20512109200a12e79c48ddc33c))
|
|
42
|
+
|
|
43
|
+
|
|
44
|
+
### Dependencies
|
|
45
|
+
|
|
46
|
+
* **@visulima/fs:** upgraded to 5.0.0-alpha.4
|
|
47
|
+
* **@visulima/path:** upgraded to 3.0.0-alpha.5
|
|
48
|
+
|
|
1
49
|
## @visulima/package [5.0.0-alpha.3](https://github.com/visulima/visulima/compare/@visulima/package@5.0.0-alpha.2...@visulima/package@5.0.0-alpha.3) (2025-12-27)
|
|
2
50
|
|
|
3
51
|
### Bug Fixes
|
package/LICENSE.md
CHANGED
package/dist/error.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
export { default as PackageNotFoundError } from './packem_shared/PackageNotFoundError-CJmAqa_k.js';
|
package/dist/index.js
CHANGED
|
@@ -1 +1,6 @@
|
|
|
1
|
-
|
|
1
|
+
export { default as PackageNotFoundError } from './packem_shared/PackageNotFoundError-CJmAqa_k.js';
|
|
2
|
+
export { findMonorepoRoot, findMonorepoRootSync } from './monorepo.js';
|
|
3
|
+
export { findPackageRoot, findPackageRootSync } from './package.js';
|
|
4
|
+
export { ensurePackages, findPackageJson, findPackageJsonSync, getPackageJsonProperty, hasPackageJsonAnyDependency, hasPackageJsonProperty, parsePackageJson, parsePackageJsonSync, writePackageJson, writePackageJsonSync } from './package-json.js';
|
|
5
|
+
export { findLockFile, findLockFileSync, findPackageManager, findPackageManagerSync, generateMissingPackagesInstallMessage, getPackageManagerVersion, identifyInitiatingPackageManager } from './package-manager.js';
|
|
6
|
+
export { isPackageInWorkspace, readPnpmCatalogs, readPnpmCatalogsSync, resolveCatalogReference, resolveCatalogReferences, resolveDependenciesCatalogReferences } from './pnpm.js';
|
package/dist/monorepo.js
CHANGED
|
@@ -1 +1,118 @@
|
|
|
1
|
-
|
|
1
|
+
import { createRequire as __cjs_createRequire } from "node:module";
|
|
2
|
+
|
|
3
|
+
const __cjs_require = __cjs_createRequire(import.meta.url);
|
|
4
|
+
|
|
5
|
+
const __cjs_getProcess = typeof globalThis !== "undefined" && typeof globalThis.process !== "undefined" ? globalThis.process : process;
|
|
6
|
+
|
|
7
|
+
const __cjs_getBuiltinModule = (module) => {
|
|
8
|
+
// Check if we're in Node.js and version supports getBuiltinModule
|
|
9
|
+
if (typeof __cjs_getProcess !== "undefined" && __cjs_getProcess.versions && __cjs_getProcess.versions.node) {
|
|
10
|
+
const [major, minor] = __cjs_getProcess.versions.node.split(".").map(Number);
|
|
11
|
+
// Node.js 20.16.0+ and 22.3.0+
|
|
12
|
+
if (major > 22 || (major === 22 && minor >= 3) || (major === 20 && minor >= 16)) {
|
|
13
|
+
return __cjs_getProcess.getBuiltinModule(module);
|
|
14
|
+
}
|
|
15
|
+
}
|
|
16
|
+
// Fallback to createRequire
|
|
17
|
+
return __cjs_require(module);
|
|
18
|
+
};
|
|
19
|
+
|
|
20
|
+
const {
|
|
21
|
+
existsSync,
|
|
22
|
+
readFileSync
|
|
23
|
+
} = __cjs_getBuiltinModule("node:fs");
|
|
24
|
+
import { findUp, readJson, findUpSync, readJsonSync } from '@visulima/fs';
|
|
25
|
+
import { NotFoundError } from '@visulima/fs/error';
|
|
26
|
+
import { dirname, join } from '@visulima/path';
|
|
27
|
+
import { findPackageManager, findPackageManagerSync } from './package-manager.js';
|
|
28
|
+
|
|
29
|
+
const findMonorepoRoot = async (cwd) => {
|
|
30
|
+
const workspaceFilePath = await findUp(["lerna.json", "turbo.json"], {
|
|
31
|
+
type: "file",
|
|
32
|
+
...cwd && { cwd }
|
|
33
|
+
});
|
|
34
|
+
if (workspaceFilePath?.endsWith("lerna.json")) {
|
|
35
|
+
const lerna = await readJson(workspaceFilePath);
|
|
36
|
+
if (lerna.useWorkspaces || lerna.packages) {
|
|
37
|
+
return {
|
|
38
|
+
path: dirname(workspaceFilePath),
|
|
39
|
+
strategy: "lerna"
|
|
40
|
+
};
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
const isTurbo = workspaceFilePath?.endsWith("turbo.json");
|
|
44
|
+
try {
|
|
45
|
+
const { packageManager, path } = await findPackageManager(cwd);
|
|
46
|
+
if (["npm", "yarn"].includes(packageManager)) {
|
|
47
|
+
const packageJsonFilePath = join(path, "package.json");
|
|
48
|
+
if (existsSync(packageJsonFilePath)) {
|
|
49
|
+
const packageJson = readFileSync(join(path, "package.json"), "utf8");
|
|
50
|
+
if (packageJson.includes("workspaces")) {
|
|
51
|
+
return {
|
|
52
|
+
path,
|
|
53
|
+
strategy: isTurbo ? "turbo" : packageManager
|
|
54
|
+
};
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
} else if (packageManager === "pnpm") {
|
|
58
|
+
const pnpmWorkspacesFilePath = join(path, "pnpm-workspace.yaml");
|
|
59
|
+
if (existsSync(pnpmWorkspacesFilePath)) {
|
|
60
|
+
return {
|
|
61
|
+
path,
|
|
62
|
+
strategy: isTurbo ? "turbo" : "pnpm"
|
|
63
|
+
};
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
} catch (error) {
|
|
67
|
+
if (!(error instanceof NotFoundError)) {
|
|
68
|
+
throw error;
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
throw new Error(`No monorepo root could be found upwards from the directory ${cwd} using lerna, yarn, pnpm, or npm as indicators.`);
|
|
72
|
+
};
|
|
73
|
+
const findMonorepoRootSync = (cwd) => {
|
|
74
|
+
const workspaceFilePath = findUpSync(["lerna.json", "turbo.json"], {
|
|
75
|
+
type: "file",
|
|
76
|
+
...cwd && { cwd }
|
|
77
|
+
});
|
|
78
|
+
if (workspaceFilePath?.endsWith("lerna.json")) {
|
|
79
|
+
const lerna = readJsonSync(workspaceFilePath);
|
|
80
|
+
if (lerna.useWorkspaces || lerna.packages) {
|
|
81
|
+
return {
|
|
82
|
+
path: dirname(workspaceFilePath),
|
|
83
|
+
strategy: "lerna"
|
|
84
|
+
};
|
|
85
|
+
}
|
|
86
|
+
}
|
|
87
|
+
const isTurbo = workspaceFilePath?.endsWith("turbo.json");
|
|
88
|
+
try {
|
|
89
|
+
const { packageManager, path } = findPackageManagerSync(cwd);
|
|
90
|
+
if (["npm", "yarn"].includes(packageManager)) {
|
|
91
|
+
const packageJsonFilePath = join(path, "package.json");
|
|
92
|
+
if (existsSync(packageJsonFilePath)) {
|
|
93
|
+
const packageJson = readFileSync(join(path, "package.json"), "utf8");
|
|
94
|
+
if (packageJson.includes("workspaces")) {
|
|
95
|
+
return {
|
|
96
|
+
path,
|
|
97
|
+
strategy: isTurbo ? "turbo" : packageManager
|
|
98
|
+
};
|
|
99
|
+
}
|
|
100
|
+
}
|
|
101
|
+
} else if (packageManager === "pnpm") {
|
|
102
|
+
const pnpmWorkspacesFilePath = join(path, "pnpm-workspace.yaml");
|
|
103
|
+
if (existsSync(pnpmWorkspacesFilePath)) {
|
|
104
|
+
return {
|
|
105
|
+
path,
|
|
106
|
+
strategy: isTurbo ? "turbo" : "pnpm"
|
|
107
|
+
};
|
|
108
|
+
}
|
|
109
|
+
}
|
|
110
|
+
} catch (error) {
|
|
111
|
+
if (!(error instanceof NotFoundError)) {
|
|
112
|
+
throw error;
|
|
113
|
+
}
|
|
114
|
+
}
|
|
115
|
+
throw new Error(`No monorepo root could be found upwards from the directory ${cwd} using lerna, yarn, pnpm, or npm as indicators.`);
|
|
116
|
+
};
|
|
117
|
+
|
|
118
|
+
export { findMonorepoRoot, findMonorepoRootSync };
|