@actiondock/builder 2.15.0 → 2.16.0
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/dist/entry-generators.d.ts +2 -9
- package/dist/entry-generators.js +21 -43
- package/dist/export-composite.d.ts +1 -1
- package/dist/export-composite.js +51 -125
- package/dist/export-source.js +7 -32
- package/dist/exporter.js +3 -33
- package/dist/planner.js +78 -74
- package/dist/skill/templates.d.ts +5 -7
- package/dist/skill/templates.js +67 -96
- package/dist/skill-md.d.ts +0 -8
- package/dist/skill-md.js +0 -46
- package/dist/types.d.ts +0 -9
- package/package.json +3 -3
- package/dist/derived-graph.d.ts +0 -4
- package/dist/derived-graph.js +0 -30
- package/dist/source-graph.d.ts +0 -4
- package/dist/source-graph.js +0 -33
package/dist/source-graph.js
DELETED
|
@@ -1,33 +0,0 @@
|
|
|
1
|
-
import { realpathSync } from "node:fs";
|
|
2
|
-
import { resolve } from "node:path";
|
|
3
|
-
import { ActionDockError } from "@actiondock/core";
|
|
4
|
-
import { loadManifest } from "@actiondock/core/project";
|
|
5
|
-
import { PackageGraphBuilder } from "@actiondock/core/graph";
|
|
6
|
-
import { BuilderError } from "./errors.js";
|
|
7
|
-
/** 源码导出只使用显式包与正式安装依赖;显式兄弟包优先于任何依赖查找。 */
|
|
8
|
-
export function createSourcePackageGraph(projectRoots, rootManifest) {
|
|
9
|
-
const packages = new Map();
|
|
10
|
-
const register = (pkg) => {
|
|
11
|
-
const existing = packages.get(pkg.id);
|
|
12
|
-
if (existing && realpathSync(existing.root) !== realpathSync(pkg.root)) {
|
|
13
|
-
throw new ActionDockError("PACKAGE_ID_CONFLICT", `Package ID '${pkg.id}' is declared by multiple directories: '${existing.root}' and '${pkg.root}'`);
|
|
14
|
-
}
|
|
15
|
-
packages.set(pkg.id, pkg);
|
|
16
|
-
};
|
|
17
|
-
for (const [index, root] of projectRoots.entries()) {
|
|
18
|
-
const absRoot = resolve(root);
|
|
19
|
-
const manifest = index === 0 && rootManifest ? rootManifest : loadManifest(absRoot);
|
|
20
|
-
if (!manifest)
|
|
21
|
-
throw new BuilderError(`Missing actiondock.json at '${absRoot}'`);
|
|
22
|
-
register({ id: manifest.id, root: absRoot, manifest });
|
|
23
|
-
}
|
|
24
|
-
const packageRoots = Object.fromEntries(Array.from(packages.values(), (p) => [p.id, p.root]));
|
|
25
|
-
// 每个显式包的正式依赖均纳入闭包,统一查重后再构造供所有规划共享的图。
|
|
26
|
-
for (const pkg of Array.from(packages.values())) {
|
|
27
|
-
const graph = new PackageGraphBuilder({ root: pkg.root, manifest: pkg.manifest, packageRoots, allowDevLinks: false }).buildSync();
|
|
28
|
-
for (const node of graph.packages.values()) {
|
|
29
|
-
register({ id: node.packageId, root: node.root, manifest: node.manifest });
|
|
30
|
-
}
|
|
31
|
-
}
|
|
32
|
-
return new PackageGraphBuilder({ packages: Array.from(packages.values()), validateDependencies: true }).buildSync();
|
|
33
|
-
}
|