@galaxy-tool-util/schema 1.7.0 → 1.7.1
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.
|
@@ -20,6 +20,12 @@ export interface SerializeWorkflowOptions {
|
|
|
20
20
|
* `json` / `yaml` overrides).
|
|
21
21
|
*
|
|
22
22
|
* YAML uses `lineWidth: 0` to disable line-wrapping so diffs stay stable.
|
|
23
|
+
*
|
|
24
|
+
* The `yaml-1.1` schema is used for emission so the writer quotes plain scalars
|
|
25
|
+
* that a YAML 1.1 reader (e.g. PyYAML, which Galaxy uses) would otherwise coerce
|
|
26
|
+
* — the word-form booleans `no`/`yes`/`on`/`off`/`y`/`n`. Tool_state stores these
|
|
27
|
+
* as strings (a select option value like `"no"`); emitting them bare lets a 1.1
|
|
28
|
+
* reader decode them as booleans. Real numbers/booleans are unaffected.
|
|
23
29
|
*/
|
|
24
30
|
export declare function serializeWorkflow(data: Record<string, unknown>, format: WorkflowFormat, opts?: SerializeWorkflowOptions): string;
|
|
25
31
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"serialize.d.ts","sourceRoot":"","sources":["../../src/workflow/serialize.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAGH,OAAO,EAAgB,KAAK,cAAc,EAAE,MAAM,oBAAoB,CAAC;AAEvE,MAAM,WAAW,wBAAwB;IACvC,8CAA8C;IAC9C,IAAI,CAAC,EAAE,OAAO,CAAC;IACf,8CAA8C;IAC9C,IAAI,CAAC,EAAE,OAAO,CAAC;IACf,wDAAwD;IACxD,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,qEAAqE;IACrE,eAAe,CAAC,EAAE,OAAO,CAAC;CAC3B;AAED
|
|
1
|
+
{"version":3,"file":"serialize.d.ts","sourceRoot":"","sources":["../../src/workflow/serialize.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAGH,OAAO,EAAgB,KAAK,cAAc,EAAE,MAAM,oBAAoB,CAAC;AAEvE,MAAM,WAAW,wBAAwB;IACvC,8CAA8C;IAC9C,IAAI,CAAC,EAAE,OAAO,CAAC;IACf,8CAA8C;IAC9C,IAAI,CAAC,EAAE,OAAO,CAAC;IACf,wDAAwD;IACxD,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,qEAAqE;IACrE,eAAe,CAAC,EAAE,OAAO,CAAC;CAC3B;AAED;;;;;;;;;;;GAWG;AACH,wBAAgB,iBAAiB,CAC/B,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAC7B,MAAM,EAAE,cAAc,EACtB,IAAI,GAAE,wBAA6B,GAClC,MAAM,CAWR;AAED;;;GAGG;AACH,wBAAgB,aAAa,CAAC,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAAE,SAAS,CAAC,EAAE,MAAM,GAAG,cAAc,CAG/F"}
|
|
@@ -11,12 +11,18 @@ import { detectFormat } from "./detect-format.js";
|
|
|
11
11
|
* `json` / `yaml` overrides).
|
|
12
12
|
*
|
|
13
13
|
* YAML uses `lineWidth: 0` to disable line-wrapping so diffs stay stable.
|
|
14
|
+
*
|
|
15
|
+
* The `yaml-1.1` schema is used for emission so the writer quotes plain scalars
|
|
16
|
+
* that a YAML 1.1 reader (e.g. PyYAML, which Galaxy uses) would otherwise coerce
|
|
17
|
+
* — the word-form booleans `no`/`yes`/`on`/`off`/`y`/`n`. Tool_state stores these
|
|
18
|
+
* as strings (a select option value like `"no"`); emitting them bare lets a 1.1
|
|
19
|
+
* reader decode them as booleans. Real numbers/booleans are unaffected.
|
|
14
20
|
*/
|
|
15
21
|
export function serializeWorkflow(data, format, opts = {}) {
|
|
16
22
|
const useYaml = opts.yaml || (!opts.json && format === "format2");
|
|
17
23
|
const newline = opts.trailingNewline ?? true;
|
|
18
24
|
if (useYaml) {
|
|
19
|
-
const out = stringifyYaml(data, { lineWidth: 0 });
|
|
25
|
+
const out = stringifyYaml(data, { lineWidth: 0, schema: "yaml-1.1" });
|
|
20
26
|
// `yaml` already ends with a newline; don't double-append.
|
|
21
27
|
if (newline)
|
|
22
28
|
return out.endsWith("\n") ? out : out + "\n";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"serialize.js","sourceRoot":"","sources":["../../src/workflow/serialize.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EAAE,SAAS,IAAI,aAAa,EAAE,MAAM,MAAM,CAAC;AAClD,OAAO,EAAE,YAAY,EAAuB,MAAM,oBAAoB,CAAC;AAavE
|
|
1
|
+
{"version":3,"file":"serialize.js","sourceRoot":"","sources":["../../src/workflow/serialize.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EAAE,SAAS,IAAI,aAAa,EAAE,MAAM,MAAM,CAAC;AAClD,OAAO,EAAE,YAAY,EAAuB,MAAM,oBAAoB,CAAC;AAavE;;;;;;;;;;;GAWG;AACH,MAAM,UAAU,iBAAiB,CAC/B,IAA6B,EAC7B,MAAsB,EACtB,OAAiC,EAAE;IAEnC,MAAM,OAAO,GAAG,IAAI,CAAC,IAAI,IAAI,CAAC,CAAC,IAAI,CAAC,IAAI,IAAI,MAAM,KAAK,SAAS,CAAC,CAAC;IAClE,MAAM,OAAO,GAAG,IAAI,CAAC,eAAe,IAAI,IAAI,CAAC;IAC7C,IAAI,OAAO,EAAE,CAAC;QACZ,MAAM,GAAG,GAAG,aAAa,CAAC,IAAI,EAAE,EAAE,SAAS,EAAE,CAAC,EAAE,MAAM,EAAE,UAAU,EAAE,CAAC,CAAC;QACtE,2DAA2D;QAC3D,IAAI,OAAO;YAAE,OAAO,GAAG,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,GAAG,GAAG,IAAI,CAAC;QAC1D,OAAO,GAAG,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CA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