ts2workflows 0.11.0 → 0.12.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/README.md +17 -7
- package/dist/ast/expressions.d.ts +37 -41
- package/dist/ast/expressions.d.ts.map +1 -1
- package/dist/ast/expressions.js +124 -255
- package/dist/ast/statements.d.ts +132 -0
- package/dist/ast/statements.d.ts.map +1 -0
- package/dist/ast/statements.js +197 -0
- package/dist/ast/steps.d.ts +82 -194
- package/dist/ast/steps.d.ts.map +1 -1
- package/dist/ast/steps.js +862 -523
- package/dist/ast/workflows.d.ts +14 -7
- package/dist/ast/workflows.d.ts.map +1 -1
- package/dist/ast/workflows.js +19 -10
- package/dist/cli.js +45 -32
- package/dist/errors.d.ts +4 -0
- package/dist/errors.d.ts.map +1 -1
- package/dist/errors.js +7 -0
- package/dist/transpiler/index.d.ts +14 -1
- package/dist/transpiler/index.d.ts.map +1 -1
- package/dist/transpiler/index.js +150 -31
- package/dist/transpiler/linker.d.ts +3 -0
- package/dist/transpiler/linker.d.ts.map +1 -0
- package/dist/transpiler/linker.js +41 -0
- package/dist/transpiler/parseexpressions.d.ts +11 -0
- package/dist/transpiler/parseexpressions.d.ts.map +1 -0
- package/dist/transpiler/{expressions.js → parseexpressions.js} +90 -103
- package/dist/transpiler/parsestatement.d.ts +7 -0
- package/dist/transpiler/parsestatement.d.ts.map +1 -0
- package/dist/transpiler/parsestatement.js +862 -0
- package/dist/transpiler/stepnames.d.ts +3 -0
- package/dist/transpiler/stepnames.d.ts.map +1 -0
- package/dist/transpiler/stepnames.js +17 -0
- package/dist/transpiler/transformations.d.ts +3 -19
- package/dist/transpiler/transformations.d.ts.map +1 -1
- package/dist/transpiler/transformations.js +267 -322
- package/language_reference.md +8 -2
- package/package.json +8 -6
- package/dist/ast/stepnames.d.ts +0 -9
- package/dist/ast/stepnames.d.ts.map +0 -1
- package/dist/ast/stepnames.js +0 -280
- package/dist/transpiler/expressions.d.ts +0 -11
- package/dist/transpiler/expressions.d.ts.map +0 -1
- package/dist/transpiler/statements.d.ts +0 -10
- package/dist/transpiler/statements.d.ts.map +0 -1
- package/dist/transpiler/statements.js +0 -1098
- package/dist/utils.d.ts +0 -2
- package/dist/utils.d.ts.map +0 -1
- package/dist/utils.js +0 -3
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"stepnames.d.ts","sourceRoot":"","sources":["../../src/transpiler/stepnames.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,qBAAqB,EAAE,WAAW,EAAE,MAAM,qBAAqB,CAAA;AAaxE,wBAAgB,iBAAiB,CAC/B,YAAY,EAAE,qBAAqB,EAAE,GACpC,WAAW,CAOb"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { toStepSubworkflow } from '../ast/steps.js';
|
|
2
|
+
import { WorkflowApp } from '../ast/workflows.js';
|
|
3
|
+
function createStepNameGenerator() {
|
|
4
|
+
const counters = new Map();
|
|
5
|
+
return (prefix) => {
|
|
6
|
+
const i = counters.get(prefix) ?? 1;
|
|
7
|
+
counters.set(prefix, i + 1);
|
|
8
|
+
return `${prefix}${i}`;
|
|
9
|
+
};
|
|
10
|
+
}
|
|
11
|
+
export function generateStepNames(subworkflows) {
|
|
12
|
+
const transformed = subworkflows.map((subworkflow) => {
|
|
13
|
+
const generateLabel = createStepNameGenerator();
|
|
14
|
+
return toStepSubworkflow(subworkflow, generateLabel);
|
|
15
|
+
});
|
|
16
|
+
return new WorkflowApp(transformed);
|
|
17
|
+
}
|
|
@@ -1,22 +1,6 @@
|
|
|
1
|
-
import {
|
|
2
|
-
export declare function transformAST(steps: WorkflowStepAST[]): WorkflowStepAST[];
|
|
1
|
+
import { WorkflowStatement } from '../ast/statements.js';
|
|
3
2
|
/**
|
|
4
|
-
*
|
|
5
|
-
*
|
|
6
|
-
* For example, transforms this:
|
|
7
|
-
*
|
|
8
|
-
* switch:
|
|
9
|
-
* - condition: ${x > 0}
|
|
10
|
-
* steps:
|
|
11
|
-
* - next1:
|
|
12
|
-
* steps:
|
|
13
|
-
* next: target1
|
|
14
|
-
*
|
|
15
|
-
* into this:
|
|
16
|
-
*
|
|
17
|
-
* switch:
|
|
18
|
-
* - condition: ${x > 0}
|
|
19
|
-
* next: target1
|
|
3
|
+
* Performs various transformations on the AST.
|
|
20
4
|
*/
|
|
21
|
-
export declare function
|
|
5
|
+
export declare function transformAST(statements: WorkflowStatement[]): WorkflowStatement[];
|
|
22
6
|
//# sourceMappingURL=transformations.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"transformations.d.ts","sourceRoot":"","sources":["../../src/transpiler/transformations.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"transformations.d.ts","sourceRoot":"","sources":["../../src/transpiler/transformations.ts"],"names":[],"mappings":"AAmBA,OAAO,EAcL,iBAAiB,EAClB,MAAM,sBAAsB,CAAA;AAG7B;;GAEG;AACH,wBAAgB,YAAY,CAC1B,UAAU,EAAE,iBAAiB,EAAE,GAC9B,iBAAiB,EAAE,CAUrB"}
|