@visulima/package 5.0.0-alpha.4 → 5.0.0-alpha.6
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 +35 -0
- 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 +8 -6
- package/dist/packem_shared/PackageNotFoundError-BictYTIA.js +0 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,38 @@
|
|
|
1
|
+
## @visulima/package [5.0.0-alpha.6](https://github.com/visulima/visulima/compare/@visulima/package@5.0.0-alpha.5...@visulima/package@5.0.0-alpha.6) (2026-03-26)
|
|
2
|
+
|
|
3
|
+
### Features
|
|
4
|
+
|
|
5
|
+
* **web:** auto-generate packages page from workspace metadata ([623e520](https://github.com/visulima/visulima/commit/623e5207693a7fe720f5f2f179593a3654c880e3))
|
|
6
|
+
|
|
7
|
+
### Miscellaneous Chores
|
|
8
|
+
|
|
9
|
+
* update homepage URLs to visulima.com/packages/ format ([be42968](https://github.com/visulima/visulima/commit/be42968129df85fb074224435e33135ff44cab91))
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
### Dependencies
|
|
13
|
+
|
|
14
|
+
* **@visulima/fs:** upgraded to 5.0.0-alpha.6
|
|
15
|
+
* **@visulima/path:** upgraded to 3.0.0-alpha.7
|
|
16
|
+
|
|
17
|
+
## @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)
|
|
18
|
+
|
|
19
|
+
### Bug Fixes
|
|
20
|
+
|
|
21
|
+
* **package:** use workspace:* for internal [@visulima](https://github.com/visulima) deps ([e409128](https://github.com/visulima/visulima/commit/e409128c02a6d801dd385ae845c1ab28ca5c09da))
|
|
22
|
+
* **web:** improve build setup with incremental stats caching and prod install ([fe33e75](https://github.com/visulima/visulima/commit/fe33e75827586779b4b3a0c6d57b39f889ee6207))
|
|
23
|
+
|
|
24
|
+
### Miscellaneous Chores
|
|
25
|
+
|
|
26
|
+
* **package:** migrate deps to pnpm catalogs ([301fac4](https://github.com/visulima/visulima/commit/301fac41be88df7469155649467921a72ca740a6))
|
|
27
|
+
* **package:** update dependencies ([fb1a43d](https://github.com/visulima/visulima/commit/fb1a43de0fd345806d76aec660d48c627d576083))
|
|
28
|
+
* visulima website ([#591](https://github.com/visulima/visulima/issues/591)) ([59ab2e2](https://github.com/visulima/visulima/commit/59ab2e2befb03e51cd2088956f83d9b87de6d033))
|
|
29
|
+
|
|
30
|
+
|
|
31
|
+
### Dependencies
|
|
32
|
+
|
|
33
|
+
* **@visulima/fs:** upgraded to 5.0.0-alpha.5
|
|
34
|
+
* **@visulima/path:** upgraded to 3.0.0-alpha.6
|
|
35
|
+
|
|
1
36
|
## @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)
|
|
2
37
|
|
|
3
38
|
### Bug Fixes
|
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 };
|