webpipe-js 2.0.40 → 2.0.42
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/index.cjs +13 -5
- package/dist/index.d.cts +2 -0
- package/dist/index.d.ts +2 -0
- package/dist/index.mjs +13 -5
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -523,7 +523,9 @@ var Parser = class {
|
|
|
523
523
|
const start = this.pos;
|
|
524
524
|
this.expect("|>");
|
|
525
525
|
this.skipInlineSpaces();
|
|
526
|
+
const nameStart = this.pos;
|
|
526
527
|
const name = this.parseIdentifier();
|
|
528
|
+
const nameEnd = this.pos;
|
|
527
529
|
const args = this.parseInlineArgs();
|
|
528
530
|
this.skipInlineSpaces();
|
|
529
531
|
let config = "";
|
|
@@ -543,7 +545,7 @@ var Parser = class {
|
|
|
543
545
|
const parsedJoinTargets = name === "join" ? this.parseJoinTaskNames(config) : void 0;
|
|
544
546
|
this.skipWhitespaceOnly();
|
|
545
547
|
const end = this.pos;
|
|
546
|
-
return { kind: "Regular", name, args, config, configType, configStart, configEnd, condition, parsedJoinTargets, start, end };
|
|
548
|
+
return { kind: "Regular", name, nameStart, nameEnd, args, config, configType, configStart, configEnd, condition, parsedJoinTargets, start, end };
|
|
547
549
|
}
|
|
548
550
|
/**
|
|
549
551
|
* Parse optional step condition (tag expression after the config)
|
|
@@ -1865,10 +1867,16 @@ function formatPipelineStep(step, indent = " ") {
|
|
|
1865
1867
|
} else if (step.kind === "Dispatch") {
|
|
1866
1868
|
const lines = [`${indent}|> dispatch`];
|
|
1867
1869
|
step.branches.forEach((branch) => {
|
|
1868
|
-
|
|
1869
|
-
|
|
1870
|
-
|
|
1871
|
-
|
|
1870
|
+
if (branch.pipeline.steps.length === 1) {
|
|
1871
|
+
const inlineStep = formatPipelineStep(branch.pipeline.steps[0], indent + " ");
|
|
1872
|
+
const stepContent = inlineStep.substring((indent + " ").length);
|
|
1873
|
+
lines.push(`${indent} case ${formatTagExpr(branch.condition)}: ${stepContent}`);
|
|
1874
|
+
} else {
|
|
1875
|
+
lines.push(`${indent} case ${formatTagExpr(branch.condition)}:`);
|
|
1876
|
+
branch.pipeline.steps.forEach((branchStep) => {
|
|
1877
|
+
lines.push(formatPipelineStep(branchStep, indent + " "));
|
|
1878
|
+
});
|
|
1879
|
+
}
|
|
1872
1880
|
});
|
|
1873
1881
|
if (step.default) {
|
|
1874
1882
|
lines.push(`${indent} default:`);
|
package/dist/index.d.cts
CHANGED
package/dist/index.d.ts
CHANGED
package/dist/index.mjs
CHANGED
|
@@ -470,7 +470,9 @@ var Parser = class {
|
|
|
470
470
|
const start = this.pos;
|
|
471
471
|
this.expect("|>");
|
|
472
472
|
this.skipInlineSpaces();
|
|
473
|
+
const nameStart = this.pos;
|
|
473
474
|
const name = this.parseIdentifier();
|
|
475
|
+
const nameEnd = this.pos;
|
|
474
476
|
const args = this.parseInlineArgs();
|
|
475
477
|
this.skipInlineSpaces();
|
|
476
478
|
let config = "";
|
|
@@ -490,7 +492,7 @@ var Parser = class {
|
|
|
490
492
|
const parsedJoinTargets = name === "join" ? this.parseJoinTaskNames(config) : void 0;
|
|
491
493
|
this.skipWhitespaceOnly();
|
|
492
494
|
const end = this.pos;
|
|
493
|
-
return { kind: "Regular", name, args, config, configType, configStart, configEnd, condition, parsedJoinTargets, start, end };
|
|
495
|
+
return { kind: "Regular", name, nameStart, nameEnd, args, config, configType, configStart, configEnd, condition, parsedJoinTargets, start, end };
|
|
494
496
|
}
|
|
495
497
|
/**
|
|
496
498
|
* Parse optional step condition (tag expression after the config)
|
|
@@ -1812,10 +1814,16 @@ function formatPipelineStep(step, indent = " ") {
|
|
|
1812
1814
|
} else if (step.kind === "Dispatch") {
|
|
1813
1815
|
const lines = [`${indent}|> dispatch`];
|
|
1814
1816
|
step.branches.forEach((branch) => {
|
|
1815
|
-
|
|
1816
|
-
|
|
1817
|
-
|
|
1818
|
-
|
|
1817
|
+
if (branch.pipeline.steps.length === 1) {
|
|
1818
|
+
const inlineStep = formatPipelineStep(branch.pipeline.steps[0], indent + " ");
|
|
1819
|
+
const stepContent = inlineStep.substring((indent + " ").length);
|
|
1820
|
+
lines.push(`${indent} case ${formatTagExpr(branch.condition)}: ${stepContent}`);
|
|
1821
|
+
} else {
|
|
1822
|
+
lines.push(`${indent} case ${formatTagExpr(branch.condition)}:`);
|
|
1823
|
+
branch.pipeline.steps.forEach((branchStep) => {
|
|
1824
|
+
lines.push(formatPipelineStep(branchStep, indent + " "));
|
|
1825
|
+
});
|
|
1826
|
+
}
|
|
1819
1827
|
});
|
|
1820
1828
|
if (step.default) {
|
|
1821
1829
|
lines.push(`${indent} default:`);
|