@galaxy-tool-util/cli 0.1.0 → 0.2.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/LICENSE +21 -0
- package/dist/bin/galaxy-tool-cache.js +15 -0
- package/dist/bin/galaxy-tool-cache.js.map +1 -1
- package/dist/bin/gxwf.d.ts +3 -0
- package/dist/bin/gxwf.d.ts.map +1 -0
- package/dist/bin/gxwf.js +126 -0
- package/dist/bin/gxwf.js.map +1 -0
- package/dist/commands/clean-tree.d.ts +23 -0
- package/dist/commands/clean-tree.d.ts.map +1 -0
- package/dist/commands/clean-tree.js +68 -0
- package/dist/commands/clean-tree.js.map +1 -0
- package/dist/commands/clean.d.ts +7 -0
- package/dist/commands/clean.d.ts.map +1 -0
- package/dist/commands/clean.js +38 -0
- package/dist/commands/clean.js.map +1 -0
- package/dist/commands/convert-tree.d.ts +31 -0
- package/dist/commands/convert-tree.d.ts.map +1 -0
- package/dist/commands/convert-tree.js +213 -0
- package/dist/commands/convert-tree.js.map +1 -0
- package/dist/commands/convert.d.ts +12 -0
- package/dist/commands/convert.d.ts.map +1 -0
- package/dist/commands/convert.js +119 -0
- package/dist/commands/convert.js.map +1 -0
- package/dist/commands/lint-tree.d.ts +27 -0
- package/dist/commands/lint-tree.d.ts.map +1 -0
- package/dist/commands/lint-tree.js +116 -0
- package/dist/commands/lint-tree.js.map +1 -0
- package/dist/commands/lint.d.ts +30 -0
- package/dist/commands/lint.d.ts.map +1 -0
- package/dist/commands/lint.js +147 -0
- package/dist/commands/lint.js.map +1 -0
- package/dist/commands/populate-workflow.d.ts +6 -0
- package/dist/commands/populate-workflow.d.ts.map +1 -0
- package/dist/commands/populate-workflow.js +55 -0
- package/dist/commands/populate-workflow.js.map +1 -0
- package/dist/commands/render-results.d.ts +11 -0
- package/dist/commands/render-results.d.ts.map +1 -0
- package/dist/commands/render-results.js +23 -0
- package/dist/commands/render-results.js.map +1 -0
- package/dist/commands/roundtrip-tree.d.ts +13 -0
- package/dist/commands/roundtrip-tree.d.ts.map +1 -0
- package/dist/commands/roundtrip-tree.js +116 -0
- package/dist/commands/roundtrip-tree.js.map +1 -0
- package/dist/commands/roundtrip.d.ts +30 -0
- package/dist/commands/roundtrip.d.ts.map +1 -0
- package/dist/commands/roundtrip.js +122 -0
- package/dist/commands/roundtrip.js.map +1 -0
- package/dist/commands/stateful-tool-inputs.d.ts +33 -0
- package/dist/commands/stateful-tool-inputs.d.ts.map +1 -0
- package/dist/commands/stateful-tool-inputs.js +73 -0
- package/dist/commands/stateful-tool-inputs.js.map +1 -0
- package/dist/commands/structural-schema.d.ts +6 -0
- package/dist/commands/structural-schema.d.ts.map +1 -0
- package/dist/commands/structural-schema.js +31 -0
- package/dist/commands/structural-schema.js.map +1 -0
- package/dist/commands/tree.d.ts +45 -0
- package/dist/commands/tree.d.ts.map +1 -0
- package/dist/commands/tree.js +155 -0
- package/dist/commands/tree.js.map +1 -0
- package/dist/commands/validate-tree.d.ts +29 -0
- package/dist/commands/validate-tree.d.ts.map +1 -0
- package/dist/commands/validate-tree.js +118 -0
- package/dist/commands/validate-tree.js.map +1 -0
- package/dist/commands/validate-workflow-json-schema.d.ts.map +1 -1
- package/dist/commands/validate-workflow-json-schema.js +49 -16
- package/dist/commands/validate-workflow-json-schema.js.map +1 -1
- package/dist/commands/validate-workflow.d.ts +1 -0
- package/dist/commands/validate-workflow.d.ts.map +1 -1
- package/dist/commands/validate-workflow.js +57 -56
- package/dist/commands/validate-workflow.js.map +1 -1
- package/dist/commands/workflow-io.d.ts +16 -0
- package/dist/commands/workflow-io.d.ts.map +1 -0
- package/dist/commands/workflow-io.js +47 -0
- package/dist/commands/workflow-io.js.map +1 -0
- package/dist/index.d.ts +26 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +24 -0
- package/dist/index.js.map +1 -1
- package/package.json +15 -15
- package/dist/bin/galaxy-workflow-validate.d.ts +0 -3
- package/dist/bin/galaxy-workflow-validate.d.ts.map +0 -1
- package/dist/bin/galaxy-workflow-validate.js +0 -17
- package/dist/bin/galaxy-workflow-validate.js.map +0 -1
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2025 John Chilton
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
|
@@ -4,7 +4,9 @@ import { runAdd } from "../commands/add.js";
|
|
|
4
4
|
import { runList } from "../commands/list.js";
|
|
5
5
|
import { runInfo } from "../commands/info.js";
|
|
6
6
|
import { runClear } from "../commands/clear.js";
|
|
7
|
+
import { runPopulateWorkflow } from "../commands/populate-workflow.js";
|
|
7
8
|
import { runSchema } from "../commands/schema.js";
|
|
9
|
+
import { runStructuralSchema } from "../commands/structural-schema.js";
|
|
8
10
|
const program = new Command();
|
|
9
11
|
program
|
|
10
12
|
.name("galaxy-tool-cache")
|
|
@@ -46,5 +48,18 @@ program
|
|
|
46
48
|
.option("--output <file>", "Output file (default: stdout)")
|
|
47
49
|
.option("--cache-dir <dir>", "Cache directory")
|
|
48
50
|
.action(runSchema);
|
|
51
|
+
program
|
|
52
|
+
.command("populate-workflow")
|
|
53
|
+
.description("Scan a workflow and cache all referenced tools")
|
|
54
|
+
.argument("<file>", "Workflow file (.ga, .gxwf.yml)")
|
|
55
|
+
.option("--cache-dir <dir>", "Cache directory")
|
|
56
|
+
.option("--galaxy-url <url>", "Galaxy instance URL for fallback")
|
|
57
|
+
.action(runPopulateWorkflow);
|
|
58
|
+
program
|
|
59
|
+
.command("structural-schema")
|
|
60
|
+
.description("Export the structural JSON Schema for Galaxy workflows")
|
|
61
|
+
.option("--format <fmt>", "Workflow format: format2 (default) or native", "format2")
|
|
62
|
+
.option("--output <file>", "Output file (default: stdout)")
|
|
63
|
+
.action(runStructuralSchema);
|
|
49
64
|
program.parse();
|
|
50
65
|
//# sourceMappingURL=galaxy-tool-cache.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"galaxy-tool-cache.js","sourceRoot":"","sources":["../../src/bin/galaxy-tool-cache.ts"],"names":[],"mappings":";AAEA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACpC,OAAO,EAAE,MAAM,EAAE,MAAM,oBAAoB,CAAC;AAC5C,OAAO,EAAE,OAAO,EAAE,MAAM,qBAAqB,CAAC;AAC9C,OAAO,EAAE,OAAO,EAAE,MAAM,qBAAqB,CAAC;AAC9C,OAAO,EAAE,QAAQ,EAAE,MAAM,sBAAsB,CAAC;AAChD,OAAO,EAAE,SAAS,EAAE,MAAM,uBAAuB,CAAC;
|
|
1
|
+
{"version":3,"file":"galaxy-tool-cache.js","sourceRoot":"","sources":["../../src/bin/galaxy-tool-cache.ts"],"names":[],"mappings":";AAE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.d.ts","sourceRoot":"","sources":["../../src/bin/gxwf.ts"],"names":[],"mappings":""}
|
package/dist/bin/gxwf.js
ADDED
|
@@ -0,0 +1,126 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
import { Command } from "commander";
|
|
3
|
+
import { runClean } from "../commands/clean.js";
|
|
4
|
+
import { runCleanTree } from "../commands/clean-tree.js";
|
|
5
|
+
import { runConvert } from "../commands/convert.js";
|
|
6
|
+
import { runConvertTree } from "../commands/convert-tree.js";
|
|
7
|
+
import { runRoundtrip } from "../commands/roundtrip.js";
|
|
8
|
+
import { runRoundtripTree } from "../commands/roundtrip-tree.js";
|
|
9
|
+
import { runLint } from "../commands/lint.js";
|
|
10
|
+
import { runLintTree } from "../commands/lint-tree.js";
|
|
11
|
+
import { runValidateWorkflow } from "../commands/validate-workflow.js";
|
|
12
|
+
import { runValidateTree } from "../commands/validate-tree.js";
|
|
13
|
+
const program = new Command();
|
|
14
|
+
program
|
|
15
|
+
.name("gxwf")
|
|
16
|
+
.description("Galaxy workflow operations — validate, clean, lint, convert (single-file and tree)")
|
|
17
|
+
.version("1.0.0");
|
|
18
|
+
program
|
|
19
|
+
.command("validate")
|
|
20
|
+
.description("Validate Galaxy workflow files (structure + optional tool state)")
|
|
21
|
+
.argument("<file>", "Workflow file (.ga, .gxwf.yml)")
|
|
22
|
+
.option("--format <fmt>", "Force format: native or format2 (auto-detected by default)")
|
|
23
|
+
.option("--no-tool-state", "Skip tool state validation")
|
|
24
|
+
.option("--cache-dir <dir>", "Tool cache directory")
|
|
25
|
+
.option("--mode <mode>", "Validation backend: effect (default) or json-schema", "effect")
|
|
26
|
+
.option("--tool-schema-dir <dir>", "Directory of pre-exported per-tool JSON Schemas (for offline json-schema mode)")
|
|
27
|
+
.action(runValidateWorkflow);
|
|
28
|
+
program
|
|
29
|
+
.command("clean")
|
|
30
|
+
.description("Strip stale keys and decode legacy tool_state encoding")
|
|
31
|
+
.argument("<file>", "Workflow file (.ga, .gxwf.yml)")
|
|
32
|
+
.option("--output <file>", "Write cleaned workflow to file (default: stdout)")
|
|
33
|
+
.option("--diff", "Show diff of changes instead of writing output")
|
|
34
|
+
.option("--format <fmt>", "Force format: native or format2 (auto-detected by default)")
|
|
35
|
+
.action(runClean);
|
|
36
|
+
program
|
|
37
|
+
.command("lint")
|
|
38
|
+
.description("Lint Galaxy workflow — structural checks, best practices, tool state validation")
|
|
39
|
+
.argument("<file>", "Workflow file (.ga, .gxwf.yml)")
|
|
40
|
+
.option("--skip-best-practices", "Skip annotation/creator/license/label checks")
|
|
41
|
+
.option("--skip-state-validation", "Skip tool state validation against cached tool definitions")
|
|
42
|
+
.option("--cache-dir <dir>", "Tool cache directory (for state validation)")
|
|
43
|
+
.option("--format <fmt>", "Force format: native or format2 (auto-detected by default)")
|
|
44
|
+
.option("--json", "Output structured JSON result")
|
|
45
|
+
.action(runLint);
|
|
46
|
+
program
|
|
47
|
+
.command("convert")
|
|
48
|
+
.description("Convert between native (.ga) and format2 (.gxwf.yml) formats")
|
|
49
|
+
.argument("<file>", "Workflow file (.ga, .gxwf.yml)")
|
|
50
|
+
.option("--to <format>", "Target format: native or format2 (infers opposite by default)")
|
|
51
|
+
.option("--output <file>", "Write result to file (default: stdout)")
|
|
52
|
+
.option("--compact", "Omit position info in format2 output")
|
|
53
|
+
.option("--json", "Force JSON output")
|
|
54
|
+
.option("--yaml", "Force YAML output")
|
|
55
|
+
.option("--format <fmt>", "Force source format (auto-detected by default)")
|
|
56
|
+
.option("--stateful", "Use cached tool definitions for schema-aware state re-encoding")
|
|
57
|
+
.option("--cache-dir <dir>", "Tool cache directory (for --stateful)")
|
|
58
|
+
.action(runConvert);
|
|
59
|
+
program
|
|
60
|
+
.command("roundtrip")
|
|
61
|
+
.description("Roundtrip-validate a native workflow: native → format2 → native, diff tool_state")
|
|
62
|
+
.argument("<file>", "Native workflow file (.ga)")
|
|
63
|
+
.option("--cache-dir <dir>", "Tool cache directory")
|
|
64
|
+
.option("--format <fmt>", "Force source format (must resolve to native)")
|
|
65
|
+
.option("--json", "Output structured JSON report")
|
|
66
|
+
.option("--errors-only", "Suppress benign diffs and clean steps from output")
|
|
67
|
+
.option("--benign-only", "Show only steps with benign diffs (no errors, no failures)")
|
|
68
|
+
.option("--brief", "Omit per-diff list; show only the one-line summary")
|
|
69
|
+
.action(runRoundtrip);
|
|
70
|
+
// -- Tree (batch) variants --
|
|
71
|
+
program
|
|
72
|
+
.command("validate-tree")
|
|
73
|
+
.description("Batch validate all workflows under a directory")
|
|
74
|
+
.argument("<dir>", "Directory to scan for workflows")
|
|
75
|
+
.option("--format <fmt>", "Force format: native or format2 (auto-detected by default)")
|
|
76
|
+
.option("--no-tool-state", "Skip tool state validation")
|
|
77
|
+
.option("--cache-dir <dir>", "Tool cache directory")
|
|
78
|
+
.option("--mode <mode>", "Validation backend: effect (default) or json-schema", "effect")
|
|
79
|
+
.option("--tool-schema-dir <dir>", "Directory of pre-exported per-tool JSON Schemas (for offline json-schema mode)")
|
|
80
|
+
.option("--json", "Output structured JSON report")
|
|
81
|
+
.action(runValidateTree);
|
|
82
|
+
program
|
|
83
|
+
.command("lint-tree")
|
|
84
|
+
.description("Batch lint all workflows under a directory")
|
|
85
|
+
.argument("<dir>", "Directory to scan for workflows")
|
|
86
|
+
.option("--skip-best-practices", "Skip annotation/creator/license/label checks")
|
|
87
|
+
.option("--skip-state-validation", "Skip tool state validation against cached tool definitions")
|
|
88
|
+
.option("--cache-dir <dir>", "Tool cache directory (for state validation)")
|
|
89
|
+
.option("--format <fmt>", "Force format: native or format2 (auto-detected by default)")
|
|
90
|
+
.option("--json", "Output structured JSON report")
|
|
91
|
+
.action(runLintTree);
|
|
92
|
+
program
|
|
93
|
+
.command("clean-tree")
|
|
94
|
+
.description("Batch clean all workflows under a directory")
|
|
95
|
+
.argument("<dir>", "Directory to scan for workflows")
|
|
96
|
+
.option("--output-dir <dir>", "Write cleaned workflows to directory (mirrors source tree)")
|
|
97
|
+
.option("--format <fmt>", "Force format: native or format2 (auto-detected by default)")
|
|
98
|
+
.option("--json", "Output structured JSON report")
|
|
99
|
+
.action(runCleanTree);
|
|
100
|
+
program
|
|
101
|
+
.command("convert-tree")
|
|
102
|
+
.description("Batch convert all workflows under a directory")
|
|
103
|
+
.argument("<dir>", "Directory to scan for workflows")
|
|
104
|
+
.option("--to <format>", "Target format: native or format2 (infers opposite by default)")
|
|
105
|
+
.option("--output-dir <dir>", "Write converted workflows to directory (required)")
|
|
106
|
+
.option("--compact", "Omit position info in format2 output")
|
|
107
|
+
.option("--report-json", "Output structured JSON report")
|
|
108
|
+
.option("--json", "Force JSON output for converted files")
|
|
109
|
+
.option("--yaml", "Force YAML output")
|
|
110
|
+
.option("--format <fmt>", "Force source format (auto-detected by default)")
|
|
111
|
+
.option("--stateful", "Use cached tool definitions for schema-aware state re-encoding")
|
|
112
|
+
.option("--cache-dir <dir>", "Tool cache directory (for --stateful)")
|
|
113
|
+
.action(runConvertTree);
|
|
114
|
+
program
|
|
115
|
+
.command("roundtrip-tree")
|
|
116
|
+
.description("Batch roundtrip-validate native workflows under a directory")
|
|
117
|
+
.argument("<dir>", "Directory to scan for native workflows")
|
|
118
|
+
.option("--cache-dir <dir>", "Tool cache directory")
|
|
119
|
+
.option("--format <fmt>", "Force source format (must resolve to native)")
|
|
120
|
+
.option("--json", "Output structured JSON report")
|
|
121
|
+
.option("--errors-only", "List only files with errors or failures")
|
|
122
|
+
.option("--benign-only", "List only files with benign diffs (no errors, no failures)")
|
|
123
|
+
.option("--brief", "Omit per-file lines; print only the aggregate summary")
|
|
124
|
+
.action(runRoundtripTree);
|
|
125
|
+
program.parse();
|
|
126
|
+
//# sourceMappingURL=gxwf.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"gxwf.js","sourceRoot":"","sources":["../../src/bin/gxwf.ts"],"names":[],"mappings":";AAEA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACpC,OAAO,EAAE,QAAQ,EAAE,MAAM,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@@
|
|
|
1
|
+
import { type TreeSummary } from "./tree.js";
|
|
2
|
+
export interface CleanTreeOptions {
|
|
3
|
+
outputDir?: string;
|
|
4
|
+
format?: string;
|
|
5
|
+
json?: boolean;
|
|
6
|
+
}
|
|
7
|
+
export interface WorkflowCleanResult {
|
|
8
|
+
relativePath: string;
|
|
9
|
+
changed: boolean;
|
|
10
|
+
}
|
|
11
|
+
export interface CleanTreeReport {
|
|
12
|
+
root: string;
|
|
13
|
+
results: (WorkflowCleanResult | {
|
|
14
|
+
relativePath: string;
|
|
15
|
+
error: string;
|
|
16
|
+
})[];
|
|
17
|
+
summary: TreeSummary & {
|
|
18
|
+
changed: number;
|
|
19
|
+
unchanged: number;
|
|
20
|
+
};
|
|
21
|
+
}
|
|
22
|
+
export declare function runCleanTree(dir: string, opts: CleanTreeOptions): Promise<void>;
|
|
23
|
+
//# sourceMappingURL=clean-tree.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"clean-tree.d.ts","sourceRoot":"","sources":["../../src/commands/clean-tree.ts"],"names":[],"mappings":"AAOA,OAAO,EAAmD,KAAK,WAAW,EAAE,MAAM,WAAW,CAAC;AAE9F,MAAM,WAAW,gBAAgB;IAC/B,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,IAAI,CAAC,EAAE,OAAO,CAAC;CAChB;AAED,MAAM,WAAW,mBAAmB;IAClC,YAAY,EAAE,MAAM,CAAC;IACrB,OAAO,EAAE,OAAO,CAAC;CAClB;AAED,MAAM,WAAW,eAAe;IAC9B,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,EAAE,CAAC,mBAAmB,GAAG;QAAE,YAAY,EAAE,MAAM,CAAC;QAAC,KAAK,EAAE,MAAM,CAAA;KAAE,CAAC,EAAE,CAAC;IAC3E,OAAO,EAAE,WAAW,GAAG;QAAE,OAAO,EAAE,MAAM,CAAC;QAAC,SAAS,EAAE,MAAM,CAAA;KAAE,CAAC;CAC/D;AAED,wBAAsB,YAAY,CAAC,GAAG,EAAE,MAAM,EAAE,IAAI,EAAE,gBAAgB,GAAG,OAAO,CAAC,IAAI,CAAC,CA4CrF"}
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* `gxwf clean-tree` — batch clean all workflows under a directory.
|
|
3
|
+
*/
|
|
4
|
+
import { cleanWorkflow } from "@galaxy-tool-util/schema";
|
|
5
|
+
import { mkdir, writeFile } from "node:fs/promises";
|
|
6
|
+
import { dirname, join } from "node:path";
|
|
7
|
+
import { resolveFormat, serializeWorkflow } from "./workflow-io.js";
|
|
8
|
+
import { collectTree, summarizeOutcomes } from "./tree.js";
|
|
9
|
+
export async function runCleanTree(dir, opts) {
|
|
10
|
+
const outputDir = opts.outputDir;
|
|
11
|
+
const treeResult = await collectTree(dir, async (info, data) => {
|
|
12
|
+
const format = resolveFormat(data, opts.format);
|
|
13
|
+
const before = JSON.stringify(data);
|
|
14
|
+
cleanWorkflow(data);
|
|
15
|
+
const changed = JSON.stringify(data) !== before;
|
|
16
|
+
if (outputDir) {
|
|
17
|
+
const outPath = join(outputDir, info.relativePath);
|
|
18
|
+
await mkdir(dirname(outPath), { recursive: true });
|
|
19
|
+
const serialized = serializeWorkflow(data, format);
|
|
20
|
+
await writeFile(outPath, serialized, "utf-8");
|
|
21
|
+
}
|
|
22
|
+
return { relativePath: info.relativePath, changed };
|
|
23
|
+
});
|
|
24
|
+
const report = buildCleanReport(treeResult);
|
|
25
|
+
if (opts.json) {
|
|
26
|
+
console.log(JSON.stringify(report, null, 2));
|
|
27
|
+
process.exitCode = report.summary.changed > 0 ? 1 : 0;
|
|
28
|
+
return;
|
|
29
|
+
}
|
|
30
|
+
// Text output
|
|
31
|
+
for (const outcome of treeResult.outcomes) {
|
|
32
|
+
if (outcome.error) {
|
|
33
|
+
console.error(` ${outcome.info.relativePath}: ERROR (${outcome.error})`);
|
|
34
|
+
continue;
|
|
35
|
+
}
|
|
36
|
+
const r = outcome.result;
|
|
37
|
+
console.log(` ${r.relativePath}: ${r.changed ? "CHANGED" : "clean"}`);
|
|
38
|
+
}
|
|
39
|
+
const s = report.summary;
|
|
40
|
+
const suffix = outputDir ? ` (written to ${outputDir})` : "";
|
|
41
|
+
console.log(`\nSummary: ${s.total} workflows | ${s.changed} changed, ${s.unchanged} unchanged${suffix}`);
|
|
42
|
+
// Exit 1 if any workflows had stale keys (like Python's clean-tree)
|
|
43
|
+
process.exitCode = s.changed > 0 ? 1 : 0;
|
|
44
|
+
}
|
|
45
|
+
function buildCleanReport(treeResult) {
|
|
46
|
+
const results = [];
|
|
47
|
+
let changed = 0;
|
|
48
|
+
let unchanged = 0;
|
|
49
|
+
for (const o of treeResult.outcomes) {
|
|
50
|
+
if (o.error) {
|
|
51
|
+
results.push({ relativePath: o.info.relativePath, error: o.error });
|
|
52
|
+
continue;
|
|
53
|
+
}
|
|
54
|
+
if (o.skipped) {
|
|
55
|
+
results.push({ relativePath: o.info.relativePath, error: `SKIPPED: ${o.skipReason}` });
|
|
56
|
+
continue;
|
|
57
|
+
}
|
|
58
|
+
const r = o.result;
|
|
59
|
+
results.push(r);
|
|
60
|
+
if (r.changed)
|
|
61
|
+
changed++;
|
|
62
|
+
else
|
|
63
|
+
unchanged++;
|
|
64
|
+
}
|
|
65
|
+
const wfSummary = summarizeOutcomes(treeResult.outcomes, (r) => r.changed);
|
|
66
|
+
return { root: treeResult.root, results, summary: { ...wfSummary, changed, unchanged } };
|
|
67
|
+
}
|
|
68
|
+
//# sourceMappingURL=clean-tree.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"clean-tree.js","sourceRoot":"","sources":["../../src/commands/clean-tree.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,OAAO,EAAE,aAAa,EAAE,MAAM,0BAA0B,CAAC;AACzD,OAAO,EAAE,KAAK,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAC;AACpD,OAAO,EAAE,OAAO,E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AG,OAAO,CAAC,IAAI,CAAC,CAgClF"}
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* `gxwf clean` — strip stale keys and decode legacy tool_state encoding.
|
|
3
|
+
*/
|
|
4
|
+
import { cleanWorkflow } from "@galaxy-tool-util/schema";
|
|
5
|
+
import { readWorkflowFile, resolveFormat, serializeWorkflow, writeWorkflowOutput, } from "./workflow-io.js";
|
|
6
|
+
export async function runClean(filePath, opts) {
|
|
7
|
+
const data = await readWorkflowFile(filePath);
|
|
8
|
+
if (!data)
|
|
9
|
+
return;
|
|
10
|
+
const format = resolveFormat(data, opts.format);
|
|
11
|
+
const before = opts.diff ? JSON.stringify(data, null, 2) : null;
|
|
12
|
+
cleanWorkflow(data);
|
|
13
|
+
if (opts.diff) {
|
|
14
|
+
const after = JSON.stringify(data, null, 2);
|
|
15
|
+
if (before === after) {
|
|
16
|
+
console.log("No changes.");
|
|
17
|
+
return;
|
|
18
|
+
}
|
|
19
|
+
// Simple line-by-line diff
|
|
20
|
+
const beforeLines = before.split("\n");
|
|
21
|
+
const afterLines = after.split("\n");
|
|
22
|
+
const maxLen = Math.max(beforeLines.length, afterLines.length);
|
|
23
|
+
for (let i = 0; i < maxLen; i++) {
|
|
24
|
+
const bLine = beforeLines[i];
|
|
25
|
+
const aLine = afterLines[i];
|
|
26
|
+
if (bLine !== aLine) {
|
|
27
|
+
if (bLine !== undefined)
|
|
28
|
+
console.log(`- ${bLine}`);
|
|
29
|
+
if (aLine !== undefined)
|
|
30
|
+
console.log(`+ ${aLine}`);
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
return;
|
|
34
|
+
}
|
|
35
|
+
const output = serializeWorkflow(data, format);
|
|
36
|
+
await writeWorkflowOutput(output, opts.output, "Cleaned workflow");
|
|
37
|
+
}
|
|
38
|
+
//# sourceMappingURL=clean.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"clean.js","sourceRoot":"","sources":["../../src/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AAC,CAAC,CAAC,CAAC;YAC7B,MAAM,KAAK,GAAG,UAAU,CAAC,CAAC,CAAC,CAAC;YAC5B,IAAI,KAAK,KAAK,KAAK,EAAE,CAAC;gBACpB,IAAI,KAAK,KAAK,SAAS;oBAAE,OAAO,CAAC,GAAG,CAAC,KAAK,KAAK,EAAE,CAAC,CAAC;gBACnD,IAAI,KAAK,KAAK,SAAS;oBAAE,OAAO,CAAC,GAAG,CAAC,KAAK,KAAK,EAAE,CAAC,CAAC;YACrD,CAAC;QACH,CAAC;QACD,OAAO;IACT,CAAC;IAED,MAAM,MAAM,GAAG,iBAAiB,CAAC,IAAI,EAAE,MAAM,CAAC,CAAC;IAC/C,MAAM,mBAAmB,CAAC,MAAM,EAAE,IAAI,CAAC,MAAM,EAAE,kBAAkB,CAAC,CAAC;AACrE,CAAC"}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { type StepConversionStatus } from "@galaxy-tool-util/schema";
|
|
2
|
+
import { type ToolLoadStatus } from "./stateful-tool-inputs.js";
|
|
3
|
+
import { type TreeSummary } from "./tree.js";
|
|
4
|
+
export interface ConvertTreeOptions {
|
|
5
|
+
to?: string;
|
|
6
|
+
outputDir?: string;
|
|
7
|
+
compact?: boolean;
|
|
8
|
+
yaml?: boolean;
|
|
9
|
+
format?: string;
|
|
10
|
+
json?: boolean;
|
|
11
|
+
reportJson?: boolean;
|
|
12
|
+
stateful?: boolean;
|
|
13
|
+
cacheDir?: string;
|
|
14
|
+
}
|
|
15
|
+
export interface WorkflowConvertResult {
|
|
16
|
+
relativePath: string;
|
|
17
|
+
sourceFormat: string;
|
|
18
|
+
targetFormat: string;
|
|
19
|
+
statefulSteps?: StepConversionStatus[];
|
|
20
|
+
toolLoadErrors?: ToolLoadStatus[];
|
|
21
|
+
}
|
|
22
|
+
export interface ConvertTreeReport {
|
|
23
|
+
root: string;
|
|
24
|
+
results: (WorkflowConvertResult | {
|
|
25
|
+
relativePath: string;
|
|
26
|
+
error: string;
|
|
27
|
+
})[];
|
|
28
|
+
summary: TreeSummary;
|
|
29
|
+
}
|
|
30
|
+
export declare function runConvertTree(dir: string, opts: ConvertTreeOptions): Promise<void>;
|
|
31
|
+
//# sourceMappingURL=convert-tree.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"convert-tree.d.ts","sourceRoot":"","sources":["../../src/commands/convert-tree.ts"],"names":[],"mappings":"AAIA,OAAO,EAML,KAAK,oBAAoB,EAE1B,MAAM,0BAA0B,CAAC;AAGlC,OAAO,EAA6B,KAAK,cAAc,EAAE,MAAM,2BAA2B,CAAC;AAG3F,OAAO,EAAmD,KAAK,WAAW,EAAE,MAAM,WAAW,CAAC;AAE9F,MAAM,WAAW,kBAAkB;IACjC,EAAE,CAAC,EAAE,MAAM,CAAC;IACZ,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,IAAI,CAAC,EAAE,OAAO,CAAC;IACf,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,IAAI,CAAC,EAAE,OAAO,CAAC;IACf,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,QAAQ,CAAC,EAAE,MAAM,CAAC;CACnB;AAED,MAAM,WAAW,qBAAqB;IACpC,YAAY,EAAE,MAAM,CAAC;IACrB,YAAY,EAAE,MAAM,CAAC;IACrB,YAAY,EAAE,MAAM,CAAC;IACrB,aAAa,CAAC,EAAE,oBAAoB,EAAE,CAAC;IACvC,cAAc,CAAC,EAAE,cAAc,EAAE,CAAC;CACnC;AAED,MAAM,WAAW,iBAAiB;IAChC,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,EAAE,CAAC,qBAAqB,GAAG;QAAE,YAAY,EAAE,MAAM,CAAC;QAAC,KAAK,EAAE,MAAM,CAAA;KAAE,CAAC,EAAE,CAAC;IAC7E,OAAO,EAAE,WAAW,CAAC;CACtB;AAED,wBAAsB,cAAc,CAAC,GAAG,EAAE,MAAM,EAAE,IAAI,EAAE,kBAAkB,GAAG,OAAO,CAAC,IAAI,CAAC,CA0JzF"}
|
|
@@ -0,0 +1,213 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* `gxwf convert-tree` — batch convert all workflows under a directory.
|
|
3
|
+
*/
|
|
4
|
+
import { ToolCache } from "@galaxy-tool-util/core";
|
|
5
|
+
import { toFormat2, toFormat2Stateful, toNative, toNativeStateful, } from "@galaxy-tool-util/schema";
|
|
6
|
+
import { mkdir, writeFile } from "node:fs/promises";
|
|
7
|
+
import { dirname, join, basename } from "node:path";
|
|
8
|
+
import { loadToolInputsForWorkflow } from "./stateful-tool-inputs.js";
|
|
9
|
+
import { createDefaultResolver } from "./url-resolver.js";
|
|
10
|
+
import { resolveFormat, serializeWorkflow } from "./workflow-io.js";
|
|
11
|
+
import { collectTree, summarizeOutcomes } from "./tree.js";
|
|
12
|
+
export async function runConvertTree(dir, opts) {
|
|
13
|
+
const outputDir = opts.outputDir;
|
|
14
|
+
if (!outputDir) {
|
|
15
|
+
console.error("--output-dir is required for convert-tree");
|
|
16
|
+
process.exitCode = 1;
|
|
17
|
+
return;
|
|
18
|
+
}
|
|
19
|
+
// Shared tool cache for stateful mode (loaded once per run)
|
|
20
|
+
let cache = null;
|
|
21
|
+
if (opts.stateful) {
|
|
22
|
+
cache = new ToolCache({ cacheDir: opts.cacheDir });
|
|
23
|
+
await cache.index.load();
|
|
24
|
+
if (cache.index.listAll().length === 0) {
|
|
25
|
+
console.warn("Tool cache is empty — stateful conversion will fall back for every step");
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
const treeResult = await collectTree(dir, async (info, data) => {
|
|
29
|
+
const sourceFormat = resolveFormat(data, opts.format);
|
|
30
|
+
const targetFormat = resolveTargetFormat(sourceFormat, opts.to);
|
|
31
|
+
if (sourceFormat === targetFormat) {
|
|
32
|
+
return {
|
|
33
|
+
relativePath: info.relativePath,
|
|
34
|
+
sourceFormat,
|
|
35
|
+
targetFormat,
|
|
36
|
+
};
|
|
37
|
+
}
|
|
38
|
+
let result;
|
|
39
|
+
let statefulSteps;
|
|
40
|
+
let toolLoadErrors;
|
|
41
|
+
if (opts.stateful && cache) {
|
|
42
|
+
const expansionOpts = {
|
|
43
|
+
resolver: createDefaultResolver({
|
|
44
|
+
workflowDirectory: dirname(join(dir, info.relativePath)),
|
|
45
|
+
}),
|
|
46
|
+
};
|
|
47
|
+
const { resolver, status: toolStatus } = await loadToolInputsForWorkflow(data, sourceFormat, cache, expansionOpts);
|
|
48
|
+
const failedLoads = toolStatus.filter((s) => !s.loaded);
|
|
49
|
+
if (failedLoads.length > 0)
|
|
50
|
+
toolLoadErrors = failedLoads;
|
|
51
|
+
if (targetFormat === "format2") {
|
|
52
|
+
const r = toFormat2Stateful(data, resolver);
|
|
53
|
+
result = r.workflow;
|
|
54
|
+
statefulSteps = r.steps;
|
|
55
|
+
if (opts.compact)
|
|
56
|
+
stripPositionInfo(result);
|
|
57
|
+
}
|
|
58
|
+
else {
|
|
59
|
+
const r = toNativeStateful(data, resolver);
|
|
60
|
+
result = r.workflow;
|
|
61
|
+
statefulSteps = r.steps;
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
else if (targetFormat === "format2") {
|
|
65
|
+
result = toFormat2(data);
|
|
66
|
+
if (opts.compact) {
|
|
67
|
+
stripPositionInfo(result);
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
else {
|
|
71
|
+
result = toNative(data);
|
|
72
|
+
}
|
|
73
|
+
const serialized = serializeWorkflow(result, targetFormat, {
|
|
74
|
+
json: opts.json,
|
|
75
|
+
yaml: opts.yaml,
|
|
76
|
+
});
|
|
77
|
+
// Write to output dir, adjusting extension for target format
|
|
78
|
+
const outName = renameForFormat(info.relativePath, targetFormat);
|
|
79
|
+
const outPath = join(outputDir, outName);
|
|
80
|
+
await mkdir(dirname(outPath), { recursive: true });
|
|
81
|
+
await writeFile(outPath, serialized, "utf-8");
|
|
82
|
+
return {
|
|
83
|
+
relativePath: info.relativePath,
|
|
84
|
+
sourceFormat,
|
|
85
|
+
targetFormat,
|
|
86
|
+
statefulSteps,
|
|
87
|
+
toolLoadErrors,
|
|
88
|
+
};
|
|
89
|
+
});
|
|
90
|
+
const report = buildConvertReport(treeResult);
|
|
91
|
+
// Aggregate stateful step counts across files
|
|
92
|
+
let statefulFallbacks = 0;
|
|
93
|
+
if (opts.stateful) {
|
|
94
|
+
for (const r of report.results) {
|
|
95
|
+
if ("statefulSteps" in r && r.statefulSteps) {
|
|
96
|
+
statefulFallbacks += r.statefulSteps.filter((s) => !s.converted).length;
|
|
97
|
+
}
|
|
98
|
+
}
|
|
99
|
+
}
|
|
100
|
+
if (opts.reportJson) {
|
|
101
|
+
console.log(JSON.stringify(report, null, 2));
|
|
102
|
+
process.exitCode = report.summary.error > 0 || statefulFallbacks > 0 ? 1 : 0;
|
|
103
|
+
return;
|
|
104
|
+
}
|
|
105
|
+
// Text output
|
|
106
|
+
for (const outcome of treeResult.outcomes) {
|
|
107
|
+
if (outcome.error) {
|
|
108
|
+
console.error(` ${outcome.info.relativePath}: ERROR (${outcome.error})`);
|
|
109
|
+
continue;
|
|
110
|
+
}
|
|
111
|
+
const r = outcome.result;
|
|
112
|
+
if (r.sourceFormat === r.targetFormat) {
|
|
113
|
+
console.warn(` ${r.relativePath}: already ${r.targetFormat}, skipped`);
|
|
114
|
+
}
|
|
115
|
+
else {
|
|
116
|
+
let line = ` ${r.relativePath}: ${r.sourceFormat} → ${r.targetFormat}`;
|
|
117
|
+
if (r.statefulSteps) {
|
|
118
|
+
const converted = r.statefulSteps.filter((s) => s.converted).length;
|
|
119
|
+
line += ` [stateful ${converted}/${r.statefulSteps.length}]`;
|
|
120
|
+
}
|
|
121
|
+
console.log(line);
|
|
122
|
+
if (r.toolLoadErrors) {
|
|
123
|
+
for (const t of r.toolLoadErrors) {
|
|
124
|
+
const ver = t.toolVersion ? `@${t.toolVersion}` : "";
|
|
125
|
+
console.error(` tool ${t.toolId}${ver}: ${t.error}`);
|
|
126
|
+
}
|
|
127
|
+
}
|
|
128
|
+
}
|
|
129
|
+
}
|
|
130
|
+
const s = report.summary;
|
|
131
|
+
console.log(`\nSummary: ${s.total} workflows converted (written to ${outputDir})`);
|
|
132
|
+
if (opts.stateful) {
|
|
133
|
+
console.log(`Stateful: ${statefulFallbacks} step(s) fell back to schema-free`);
|
|
134
|
+
// Aggregate failure classes across all files
|
|
135
|
+
const byClass = new Map();
|
|
136
|
+
for (const r of report.results) {
|
|
137
|
+
if ("statefulSteps" in r && r.statefulSteps) {
|
|
138
|
+
for (const step of r.statefulSteps) {
|
|
139
|
+
if (!step.converted) {
|
|
140
|
+
const cls = step.failureClass ?? "unknown";
|
|
141
|
+
byClass.set(cls, (byClass.get(cls) ?? 0) + 1);
|
|
142
|
+
}
|
|
143
|
+
}
|
|
144
|
+
}
|
|
145
|
+
}
|
|
146
|
+
if (byClass.size > 0) {
|
|
147
|
+
const summary = Array.from(byClass.entries())
|
|
148
|
+
.map(([k, v]) => `${k}=${v}`)
|
|
149
|
+
.join(", ");
|
|
150
|
+
console.log(` fallback breakdown: ${summary}`);
|
|
151
|
+
}
|
|
152
|
+
}
|
|
153
|
+
process.exitCode = s.error > 0 || statefulFallbacks > 0 ? 1 : 0;
|
|
154
|
+
}
|
|
155
|
+
function resolveTargetFormat(sourceFormat, toOpt) {
|
|
156
|
+
if (toOpt === "native" || toOpt === "format2")
|
|
157
|
+
return toOpt;
|
|
158
|
+
return sourceFormat === "native" ? "format2" : "native";
|
|
159
|
+
}
|
|
160
|
+
/** Rename a relative path's extension for the target format. */
|
|
161
|
+
function renameForFormat(relPath, targetFormat) {
|
|
162
|
+
const dir = dirname(relPath);
|
|
163
|
+
let name = basename(relPath);
|
|
164
|
+
// Strip known workflow extensions
|
|
165
|
+
if (name.endsWith(".gxwf.yml"))
|
|
166
|
+
name = name.slice(0, -9);
|
|
167
|
+
else if (name.endsWith(".gxwf.yaml"))
|
|
168
|
+
name = name.slice(0, -10);
|
|
169
|
+
else if (name.endsWith(".ga"))
|
|
170
|
+
name = name.slice(0, -3);
|
|
171
|
+
else if (name.endsWith(".json"))
|
|
172
|
+
name = name.slice(0, -5);
|
|
173
|
+
else if (name.endsWith(".yml"))
|
|
174
|
+
name = name.slice(0, -4);
|
|
175
|
+
else if (name.endsWith(".yaml"))
|
|
176
|
+
name = name.slice(0, -5);
|
|
177
|
+
const ext = targetFormat === "format2" ? ".gxwf.yml" : ".ga";
|
|
178
|
+
const newName = name + ext;
|
|
179
|
+
return dir === "." ? newName : join(dir, newName);
|
|
180
|
+
}
|
|
181
|
+
/** Recursively remove position-related keys from format2 output. */
|
|
182
|
+
function stripPositionInfo(obj) {
|
|
183
|
+
delete obj.position;
|
|
184
|
+
for (const val of Object.values(obj)) {
|
|
185
|
+
if (Array.isArray(val)) {
|
|
186
|
+
for (const item of val) {
|
|
187
|
+
if (item && typeof item === "object") {
|
|
188
|
+
stripPositionInfo(item);
|
|
189
|
+
}
|
|
190
|
+
}
|
|
191
|
+
}
|
|
192
|
+
else if (val && typeof val === "object") {
|
|
193
|
+
stripPositionInfo(val);
|
|
194
|
+
}
|
|
195
|
+
}
|
|
196
|
+
}
|
|
197
|
+
function buildConvertReport(treeResult) {
|
|
198
|
+
const results = [];
|
|
199
|
+
for (const o of treeResult.outcomes) {
|
|
200
|
+
if (o.error) {
|
|
201
|
+
results.push({ relativePath: o.info.relativePath, error: o.error });
|
|
202
|
+
continue;
|
|
203
|
+
}
|
|
204
|
+
if (o.skipped) {
|
|
205
|
+
results.push({ relativePath: o.info.relativePath, error: `SKIPPED: ${o.skipReason}` });
|
|
206
|
+
continue;
|
|
207
|
+
}
|
|
208
|
+
results.push(o.result);
|
|
209
|
+
}
|
|
210
|
+
const wfSummary = summarizeOutcomes(treeResult.outcomes);
|
|
211
|
+
return { root: treeResult.root, results, summary: wfSummary };
|
|
212
|
+
}
|
|
213
|
+
//# sourceMappingURL=convert-tree.js.map
|
|
@@ -0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