mirror of
https://github.com/windmill-labs/windmill.git
synced 2026-09-10 16:05:58 +00:00
chore(cli): remove NUL edge-key separator + refresh stale macro comments
Address Codex P2 nits: (1) the macro edge map packed (lib, consumer) into a string with a literal NUL separator, which made localGraph.ts read as a binary file to grep/rg — replace with a nested lib->consumer Map (no separator); (2) comments claiming macro nodes/edges are 'deployed graph only' contradicted this PR's local derivation — describe the code as it is.
This commit is contained in:
@@ -59,8 +59,9 @@ export type GraphRunnable = {
|
||||
// schema-contract warnings; only present when set (default `warn` is absent),
|
||||
// mirroring the deployed graph node.
|
||||
materialize_on_schema_change?: string;
|
||||
// `// macros` library: the macros it defines (deployed graph only — the wasm
|
||||
// asset parser does not emit them). Non-empty ⇒ definition-only node.
|
||||
// `// macros` library: the macros it defines. Derived locally by
|
||||
// `buildMacroEdges` (the wasm asset parser emits neither the marker nor the
|
||||
// registry). Non-empty ⇒ definition-only node.
|
||||
macros?: { name: string; params?: string; is_table?: boolean }[];
|
||||
};
|
||||
export type GraphEdge = {
|
||||
@@ -95,7 +96,7 @@ export type AssetGraph = {
|
||||
edges: GraphEdge[];
|
||||
triggers: GraphTrigger[];
|
||||
// ƒ edges from a `// macros` library to the scripts calling its macros
|
||||
// (deployed graph only).
|
||||
// (present on both the deployed graph and the locally-derived one).
|
||||
macro_edges?: {
|
||||
lib_path: string;
|
||||
consumer_path: string;
|
||||
@@ -697,14 +698,19 @@ function buildMacroEdges(
|
||||
// (`all` is this folder's scripts).
|
||||
const pipelinePaths = new Set(runnables.map((r) => r.path));
|
||||
type EdgeAgg = { names: Set<string>; viaUse: boolean };
|
||||
const edgeMap = new Map<string, EdgeAgg>();
|
||||
const edgeKey = (lib: string, consumer: string) => `${lib} | ||||