@jigx/sdk-tools 1.2.0-next.3 → 1.2.0-next.5
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 +27 -1
- package/dist/cli.js +83 -0
- package/dist/cli.js.map +1 -1
- package/dist/index.d.ts +2 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1 -0
- package/dist/index.js.map +1 -1
- package/dist/migrator/converters/app-index.d.ts +53 -0
- package/dist/migrator/converters/app-index.d.ts.map +1 -0
- package/dist/migrator/converters/app-index.js +206 -0
- package/dist/migrator/converters/app-index.js.map +1 -0
- package/dist/migrator/converters/assets.d.ts +7 -0
- package/dist/migrator/converters/assets.d.ts.map +1 -0
- package/dist/migrator/converters/assets.js +58 -0
- package/dist/migrator/converters/assets.js.map +1 -0
- package/dist/migrator/converters/components.d.ts +4 -0
- package/dist/migrator/converters/components.d.ts.map +1 -0
- package/dist/migrator/converters/components.js +7 -0
- package/dist/migrator/converters/components.js.map +1 -0
- package/dist/migrator/converters/databases.d.ts +9 -0
- package/dist/migrator/converters/databases.d.ts.map +1 -0
- package/dist/migrator/converters/databases.js +45 -0
- package/dist/migrator/converters/databases.js.map +1 -0
- package/dist/migrator/converters/datasources.d.ts +46 -0
- package/dist/migrator/converters/datasources.d.ts.map +1 -0
- package/dist/migrator/converters/datasources.js +445 -0
- package/dist/migrator/converters/datasources.js.map +1 -0
- package/dist/migrator/converters/functions.d.ts +13 -0
- package/dist/migrator/converters/functions.d.ts.map +1 -0
- package/dist/migrator/converters/functions.js +444 -0
- package/dist/migrator/converters/functions.js.map +1 -0
- package/dist/migrator/converters/index.d.ts +11 -0
- package/dist/migrator/converters/index.d.ts.map +1 -0
- package/dist/migrator/converters/index.js +9 -0
- package/dist/migrator/converters/index.js.map +1 -0
- package/dist/migrator/converters/scripts.d.ts +10 -0
- package/dist/migrator/converters/scripts.d.ts.map +1 -0
- package/dist/migrator/converters/scripts.js +28 -0
- package/dist/migrator/converters/scripts.js.map +1 -0
- package/dist/migrator/converters/translations.d.ts +5 -0
- package/dist/migrator/converters/translations.d.ts.map +1 -0
- package/dist/migrator/converters/translations.js +25 -0
- package/dist/migrator/converters/translations.js.map +1 -0
- package/dist/migrator/converters/types.d.ts +35 -0
- package/dist/migrator/converters/types.d.ts.map +1 -0
- package/dist/migrator/converters/types.js +2 -0
- package/dist/migrator/converters/types.js.map +1 -0
- package/dist/migrator/errors.d.ts +5 -0
- package/dist/migrator/errors.d.ts.map +1 -0
- package/dist/migrator/errors.js +8 -0
- package/dist/migrator/errors.js.map +1 -0
- package/dist/migrator/index.d.ts +6 -0
- package/dist/migrator/index.d.ts.map +1 -0
- package/dist/migrator/index.js +4 -0
- package/dist/migrator/index.js.map +1 -0
- package/dist/migrator/migrate.d.ts +75 -0
- package/dist/migrator/migrate.d.ts.map +1 -0
- package/dist/migrator/migrate.js +439 -0
- package/dist/migrator/migrate.js.map +1 -0
- package/dist/migrator/module-writer.d.ts +26 -0
- package/dist/migrator/module-writer.d.ts.map +1 -0
- package/dist/migrator/module-writer.js +26 -0
- package/dist/migrator/module-writer.js.map +1 -0
- package/dist/migrator/nodes/action-definition.d.ts +11 -0
- package/dist/migrator/nodes/action-definition.d.ts.map +1 -0
- package/dist/migrator/nodes/action-definition.js +75 -0
- package/dist/migrator/nodes/action-definition.js.map +1 -0
- package/dist/migrator/nodes/app-events.d.ts +29 -0
- package/dist/migrator/nodes/app-events.d.ts.map +1 -0
- package/dist/migrator/nodes/app-events.js +40 -0
- package/dist/migrator/nodes/app-events.js.map +1 -0
- package/dist/migrator/nodes/attach.d.ts +61 -0
- package/dist/migrator/nodes/attach.d.ts.map +1 -0
- package/dist/migrator/nodes/attach.js +174 -0
- package/dist/migrator/nodes/attach.js.map +1 -0
- package/dist/migrator/nodes/builder-access.d.ts +16 -0
- package/dist/migrator/nodes/builder-access.d.ts.map +1 -0
- package/dist/migrator/nodes/builder-access.js +81 -0
- package/dist/migrator/nodes/builder-access.js.map +1 -0
- package/dist/migrator/nodes/codegen.d.ts +33 -0
- package/dist/migrator/nodes/codegen.d.ts.map +1 -0
- package/dist/migrator/nodes/codegen.js +77 -0
- package/dist/migrator/nodes/codegen.js.map +1 -0
- package/dist/migrator/nodes/index.d.ts +6 -0
- package/dist/migrator/nodes/index.d.ts.map +1 -0
- package/dist/migrator/nodes/index.js +6 -0
- package/dist/migrator/nodes/index.js.map +1 -0
- package/dist/migrator/nodes/node-shape.d.ts +39 -0
- package/dist/migrator/nodes/node-shape.d.ts.map +1 -0
- package/dist/migrator/nodes/node-shape.js +65 -0
- package/dist/migrator/nodes/node-shape.js.map +1 -0
- package/dist/migrator/nodes/probe.d.ts +66 -0
- package/dist/migrator/nodes/probe.d.ts.map +1 -0
- package/dist/migrator/nodes/probe.js +46 -0
- package/dist/migrator/nodes/probe.js.map +1 -0
- package/dist/migrator/nodes/rules/action-list.d.ts +4 -0
- package/dist/migrator/nodes/rules/action-list.d.ts.map +1 -0
- package/dist/migrator/nodes/rules/action-list.js +14 -0
- package/dist/migrator/nodes/rules/action-list.js.map +1 -0
- package/dist/migrator/nodes/rules/action-slots.d.ts +13 -0
- package/dist/migrator/nodes/rules/action-slots.d.ts.map +1 -0
- package/dist/migrator/nodes/rules/action-slots.js +35 -0
- package/dist/migrator/nodes/rules/action-slots.js.map +1 -0
- package/dist/migrator/nodes/rules/banner.d.ts +8 -0
- package/dist/migrator/nodes/rules/banner.d.ts.map +1 -0
- package/dist/migrator/nodes/rules/banner.js +34 -0
- package/dist/migrator/nodes/rules/banner.js.map +1 -0
- package/dist/migrator/nodes/rules/custom-component.d.ts +7 -0
- package/dist/migrator/nodes/rules/custom-component.d.ts.map +1 -0
- package/dist/migrator/nodes/rules/custom-component.js +8 -0
- package/dist/migrator/nodes/rules/custom-component.js.map +1 -0
- package/dist/migrator/nodes/rules/dropdown.d.ts +4 -0
- package/dist/migrator/nodes/rules/dropdown.d.ts.map +1 -0
- package/dist/migrator/nodes/rules/dropdown.js +3 -0
- package/dist/migrator/nodes/rules/dropdown.js.map +1 -0
- package/dist/migrator/nodes/rules/execute-entity.d.ts +7 -0
- package/dist/migrator/nodes/rules/execute-entity.d.ts.map +1 -0
- package/dist/migrator/nodes/rules/execute-entity.js +40 -0
- package/dist/migrator/nodes/rules/execute-entity.js.map +1 -0
- package/dist/migrator/nodes/rules/field-row.d.ts +4 -0
- package/dist/migrator/nodes/rules/field-row.d.ts.map +1 -0
- package/dist/migrator/nodes/rules/field-row.js +3 -0
- package/dist/migrator/nodes/rules/field-row.js.map +1 -0
- package/dist/migrator/nodes/rules/index.d.ts +16 -0
- package/dist/migrator/nodes/rules/index.d.ts.map +1 -0
- package/dist/migrator/nodes/rules/index.js +44 -0
- package/dist/migrator/nodes/rules/index.js.map +1 -0
- package/dist/migrator/nodes/rules/list-item.d.ts +7 -0
- package/dist/migrator/nodes/rules/list-item.d.ts.map +1 -0
- package/dist/migrator/nodes/rules/list-item.js +40 -0
- package/dist/migrator/nodes/rules/list-item.js.map +1 -0
- package/dist/migrator/nodes/rules/list.d.ts +4 -0
- package/dist/migrator/nodes/rules/list.d.ts.map +1 -0
- package/dist/migrator/nodes/rules/list.js +7 -0
- package/dist/migrator/nodes/rules/list.js.map +1 -0
- package/dist/migrator/nodes/rules/method-names.d.ts +10 -0
- package/dist/migrator/nodes/rules/method-names.d.ts.map +1 -0
- package/dist/migrator/nodes/rules/method-names.js +33 -0
- package/dist/migrator/nodes/rules/method-names.js.map +1 -0
- package/dist/migrator/nodes/rules/screen-slots.d.ts +10 -0
- package/dist/migrator/nodes/rules/screen-slots.d.ts.map +1 -0
- package/dist/migrator/nodes/rules/screen-slots.js +9 -0
- package/dist/migrator/nodes/rules/screen-slots.js.map +1 -0
- package/dist/migrator/nodes/rules/set-jig-state.d.ts +4 -0
- package/dist/migrator/nodes/rules/set-jig-state.d.ts.map +1 -0
- package/dist/migrator/nodes/rules/set-jig-state.js +9 -0
- package/dist/migrator/nodes/rules/set-jig-state.js.map +1 -0
- package/dist/migrator/nodes/rules/state-key.d.ts +7 -0
- package/dist/migrator/nodes/rules/state-key.d.ts.map +1 -0
- package/dist/migrator/nodes/rules/state-key.js +16 -0
- package/dist/migrator/nodes/rules/state-key.js.map +1 -0
- package/dist/migrator/nodes/rules/summary.d.ts +7 -0
- package/dist/migrator/nodes/rules/summary.d.ts.map +1 -0
- package/dist/migrator/nodes/rules/summary.js +16 -0
- package/dist/migrator/nodes/rules/summary.js.map +1 -0
- package/dist/migrator/nodes/rules/sync-entities.d.ts +7 -0
- package/dist/migrator/nodes/rules/sync-entities.d.ts.map +1 -0
- package/dist/migrator/nodes/rules/sync-entities.js +17 -0
- package/dist/migrator/nodes/rules/sync-entities.js.map +1 -0
- package/dist/migrator/nodes/rules/types.d.ts +35 -0
- package/dist/migrator/nodes/rules/types.d.ts.map +1 -0
- package/dist/migrator/nodes/rules/types.js +7 -0
- package/dist/migrator/nodes/rules/types.js.map +1 -0
- package/dist/migrator/nodes/screen.d.ts +13 -0
- package/dist/migrator/nodes/screen.d.ts.map +1 -0
- package/dist/migrator/nodes/screen.js +403 -0
- package/dist/migrator/nodes/screen.js.map +1 -0
- package/dist/migrator/normalize.d.ts +42 -0
- package/dist/migrator/normalize.d.ts.map +1 -0
- package/dist/migrator/normalize.js +167 -0
- package/dist/migrator/normalize.js.map +1 -0
- package/dist/migrator/project-writer.d.ts +34 -0
- package/dist/migrator/project-writer.d.ts.map +1 -0
- package/dist/migrator/project-writer.js +65 -0
- package/dist/migrator/project-writer.js.map +1 -0
- package/dist/migrator/prune.d.ts +58 -0
- package/dist/migrator/prune.d.ts.map +1 -0
- package/dist/migrator/prune.js +171 -0
- package/dist/migrator/prune.js.map +1 -0
- package/dist/migrator/read-solution.d.ts +38 -0
- package/dist/migrator/read-solution.d.ts.map +1 -0
- package/dist/migrator/read-solution.js +144 -0
- package/dist/migrator/read-solution.js.map +1 -0
- package/dist/migrator/report.d.ts +76 -0
- package/dist/migrator/report.d.ts.map +1 -0
- package/dist/migrator/report.js +53 -0
- package/dist/migrator/report.js.map +1 -0
- package/dist/migrator/ts-printer.d.ts +19 -0
- package/dist/migrator/ts-printer.d.ts.map +1 -0
- package/dist/migrator/ts-printer.js +70 -0
- package/dist/migrator/ts-printer.js.map +1 -0
- package/dist/migrator/verify-entity.d.ts +21 -0
- package/dist/migrator/verify-entity.d.ts.map +1 -0
- package/dist/migrator/verify-entity.js +22 -0
- package/dist/migrator/verify-entity.js.map +1 -0
- package/dist/scaffolder/index.d.ts +1 -0
- package/dist/scaffolder/index.d.ts.map +1 -1
- package/dist/scaffolder/index.js +1 -0
- package/dist/scaffolder/index.js.map +1 -1
- package/dist/scaffolder/templates.d.ts +11 -2
- package/dist/scaffolder/templates.d.ts.map +1 -1
- package/dist/scaffolder/templates.js +7 -3
- package/dist/scaffolder/templates.js.map +1 -1
- package/package.json +2 -1
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
import { todoComment } from '../module-writer.js';
|
|
2
|
+
import { lit } from '../ts-printer.js';
|
|
3
|
+
/** Indent of a generated `register` body; `lit` continuation lines are relative to it. */
|
|
4
|
+
const BODY_INDENT = ' ';
|
|
5
|
+
/**
|
|
6
|
+
* Generated-code buffer for one module: statement chunks plus variable naming
|
|
7
|
+
* (`c1`, `a2`, `panel3`, `summary4`). Forks share the variable counter, so chunks
|
|
8
|
+
* generated separately for one module never reuse a name.
|
|
9
|
+
*/
|
|
10
|
+
export class Gen {
|
|
11
|
+
lines = [];
|
|
12
|
+
indent = BODY_INDENT;
|
|
13
|
+
counter;
|
|
14
|
+
constructor(counter = { value: 0 }) {
|
|
15
|
+
this.counter = counter;
|
|
16
|
+
}
|
|
17
|
+
/** Returns the next free variable name with the given prefix. */
|
|
18
|
+
nextVar(prefix) {
|
|
19
|
+
this.counter.value++;
|
|
20
|
+
return `${prefix}${this.counter.value}`;
|
|
21
|
+
}
|
|
22
|
+
/** Appends one statement chunk (continuation lines carry their own indent). */
|
|
23
|
+
push(chunk) {
|
|
24
|
+
this.lines.push(chunk);
|
|
25
|
+
}
|
|
26
|
+
/** An empty buffer that shares this buffer's variable counter. */
|
|
27
|
+
fork() {
|
|
28
|
+
return new Gen(this.counter);
|
|
29
|
+
}
|
|
30
|
+
/** The chunks as one `register`-body statement: every chunk after the first gets the body indent. */
|
|
31
|
+
code() {
|
|
32
|
+
return this.lines.join(`\n${BODY_INDENT}`);
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
/** Variable prefix per node kind: `a` actions, `c` components, `panel`/`summary` screen parts. */
|
|
36
|
+
function varPrefix(nodeType) {
|
|
37
|
+
if (nodeType.startsWith('action.'))
|
|
38
|
+
return 'a';
|
|
39
|
+
if (nodeType === 'jig-actions')
|
|
40
|
+
return 'panel';
|
|
41
|
+
if (nodeType === 'jig-summary')
|
|
42
|
+
return 'summary';
|
|
43
|
+
return 'c';
|
|
44
|
+
}
|
|
45
|
+
/**
|
|
46
|
+
* Prints a verified plan under `parentExpr`: the factory call with chained calls, then
|
|
47
|
+
* unchained calls and children on its variable. Skipped children become
|
|
48
|
+
* `// TODO(migrate)` comments in their legacy position.
|
|
49
|
+
*/
|
|
50
|
+
export function emitPlan(options) {
|
|
51
|
+
const { plan, parentExpr, gen } = options;
|
|
52
|
+
const chained = plan.calls.filter((call) => call.chain);
|
|
53
|
+
const separate = plan.calls.filter((call) => !call.chain);
|
|
54
|
+
const hasTypedChild = plan.slots.some((slot) => slot.items.some((item) => item.type === 'typed'));
|
|
55
|
+
const name = hasTypedChild || separate.length > 0 ? gen.nextVar(varPrefix(plan.nodeType)) : undefined;
|
|
56
|
+
const args = (values, indent) => values.map((value) => lit(value, indent)).join(', ');
|
|
57
|
+
const { holder, method } = plan.accessor;
|
|
58
|
+
const factory = method === undefined ? holder : `${holder}.${method}`;
|
|
59
|
+
const input = plan.input === undefined ? '' : lit(plan.input, gen.indent);
|
|
60
|
+
const chainIndent = `${gen.indent} `;
|
|
61
|
+
const chain = chained
|
|
62
|
+
.map((call) => `\n${chainIndent}.${call.method}(${args(call.args, chainIndent)})`)
|
|
63
|
+
.join('');
|
|
64
|
+
gen.push(`${name === undefined ? '' : `const ${name} = `}${parentExpr}.${factory}(${input})${chain}`);
|
|
65
|
+
const owner = name ?? parentExpr;
|
|
66
|
+
for (const call of separate)
|
|
67
|
+
gen.push(`${owner}.${call.method}(${args(call.args, gen.indent)})`);
|
|
68
|
+
for (const slot of plan.slots) {
|
|
69
|
+
for (const item of slot.items) {
|
|
70
|
+
if (item.type === 'typed')
|
|
71
|
+
emitPlan({ plan: item.plan, parentExpr: owner, gen });
|
|
72
|
+
else
|
|
73
|
+
gen.push(todoComment(item.gap));
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
}
|
|
77
|
+
//# sourceMappingURL=codegen.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"codegen.js","sourceRoot":"","sources":["../../../src/migrator/nodes/codegen.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,qBAAqB,CAAA;AACjD,OAAO,EAAE,GAAG,EAAE,MAAM,kBAAkB,CAAA;AAGtC,0FAA0F;AAC1F,MAAM,WAAW,GAAG,IAAI,CAAA;AAExB;;;;GAIG;AACH,MAAM,OAAO,GAAG;IACL,KAAK,GAAa,EAAE,CAAA;IACpB,MAAM,GAAG,WAAW,CAAA;IACZ,OAAO,CAAmB;IAE3C,YAAY,OAAO,GAAsB,EAAE,KAAK,EAAE,CAAC,EAAE;QACnD,IAAI,CAAC,OAAO,GAAG,OAAO,CAAA;IACxB,CAAC;IAED,iEAAiE;IACjE,OAAO,CAAC,MAAc;QACpB,IAAI,CAAC,OAAO,CAAC,KAAK,EAAE,CAAA;QACpB,OAAO,GAAG,MAAM,GAAG,IAAI,CAAC,OAAO,CAAC,KAAK,EAAE,CAAA;IACzC,CAAC;IAED,+EAA+E;IAC/E,IAAI,CAAC,KAAa;QAChB,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,KAAK,CAAC,CAAA;IACxB,CAAC;IA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AAC,GAAG,CAAC,CAAA;IAChG,KAAK,MAAM,IAAI,IAAI,IAAI,CAAC,KAAK,EAAE,CAAC;QAC9B,KAAK,MAAM,IAAI,IAAI,IAAI,CAAC,KAAK,EAAE,CAAC;YAC9B,IAAI,IAAI,CAAC,IAAI,KAAK,OAAO;gBAAE,QAAQ,CAAC,EAAE,IAAI,EAAE,IAAI,CAAC,IAAI,EAAE,UAAU,EAAE,KAAK,EAAE,GAAG,EAAE,CAAC,CAAA;;gBAC3E,GAAG,CAAC,IAAI,CAAC,WAAW,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,CAAA;QACtC,CAAC;IACH,CAAC;AACH,CAAC"}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
export { convertAction } from './action-definition.js';
|
|
2
|
+
export { APP_EVENTS, convertAppEvent } from './app-events.js';
|
|
3
|
+
export { Gen } from './codegen.js';
|
|
4
|
+
export { convertJig } from './screen.js';
|
|
5
|
+
export { firstLine, messageSlug, toJsonValue } from './builder-access.js';
|
|
6
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/migrator/nodes/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,wBAAwB,CAAA;AACtD,OAAO,EAAE,UAAU,EAAE,eAAe,EAAE,MAAM,iBAAiB,CAAA;AAC7D,OAAO,EAAE,GAAG,EAAE,MAAM,cAAc,CAAA;AAClC,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAA;AACxC,OAAO,EAAE,SAAS,EAAE,WAAW,EAAE,WAAW,EAAE,MAAM,qBAAqB,CAAA"}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
export { convertAction } from './action-definition.js';
|
|
2
|
+
export { APP_EVENTS, convertAppEvent } from './app-events.js';
|
|
3
|
+
export { Gen } from './codegen.js';
|
|
4
|
+
export { convertJig } from './screen.js';
|
|
5
|
+
export { firstLine, messageSlug, toJsonValue } from './builder-access.js';
|
|
6
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/migrator/nodes/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,wBAAwB,CAAA;AACtD,OAAO,EAAE,UAAU,EAAE,eAAe,EAAE,MAAM,iBAAiB,CAAA;AAC7D,OAAO,EAAE,GAAG,EAAE,MAAM,cAAc,CAAA;AAClC,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAA;AACxC,OAAO,EAAE,SAAS,EAAE,WAAW,EAAE,WAAW,EAAE,MAAM,qBAAqB,CAAA"}
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import { type Call, type Obj } from './rules/index.js';
|
|
2
|
+
/** A legacy component or action node: `{ type, instanceId?, when?, options? }`. */
|
|
3
|
+
export interface LegacyNode {
|
|
4
|
+
readonly type: string;
|
|
5
|
+
readonly [key: string]: unknown;
|
|
6
|
+
}
|
|
7
|
+
/** A child slot of a node: an `options` key holding one node or a node list. */
|
|
8
|
+
export interface NodeSlot {
|
|
9
|
+
readonly key: string;
|
|
10
|
+
readonly nodes: readonly LegacyNode[];
|
|
11
|
+
readonly list: boolean;
|
|
12
|
+
}
|
|
13
|
+
/** A node split into factory input, builder calls and child slots. */
|
|
14
|
+
interface SplitNode {
|
|
15
|
+
readonly type: 'split';
|
|
16
|
+
readonly input: Obj;
|
|
17
|
+
readonly calls: readonly Call[];
|
|
18
|
+
readonly slots: readonly NodeSlot[];
|
|
19
|
+
}
|
|
20
|
+
/** Result of `split`: the split node, or a shape with no typed form. */
|
|
21
|
+
export type SplitResult = SplitNode | {
|
|
22
|
+
readonly type: 'shape';
|
|
23
|
+
};
|
|
24
|
+
/** Whether a value is a component or action node. */
|
|
25
|
+
export declare function isNode(value: unknown): value is LegacyNode;
|
|
26
|
+
/** Whether a value is a non-empty list of component or action nodes. */
|
|
27
|
+
export declare function isNodeList(value: unknown): value is LegacyNode[];
|
|
28
|
+
/**
|
|
29
|
+
* Splits a node into flat factory input, builder calls and child slots.
|
|
30
|
+
*
|
|
31
|
+
* `options` keys become input, except nodes and node lists, which become slots.
|
|
32
|
+
* A `style` with only liftable keys is flattened into the input; the node type's
|
|
33
|
+
* rule then reshapes the input and pulls out builder calls.
|
|
34
|
+
* The shape is not expressible when an option collides with a top-level key.
|
|
35
|
+
* A type whose rule declares `whole` hands the whole node to its factory instead.
|
|
36
|
+
*/
|
|
37
|
+
export declare function split(node: LegacyNode): SplitResult;
|
|
38
|
+
export {};
|
|
39
|
+
//# sourceMappingURL=node-shape.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"node-shape.d.ts","sourceRoot":"","sources":["../../../src/migrator/nodes/node-shape.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,KAAK,IAAI,EAAE,KAAK,GAAG,EAAS,MAAM,kBAAkB,CAAA;AAE7D,mFAAmF;AACnF,MAAM,WAAW,UAAU;IACzB,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAA;IACrB,QAAQ,EAAE,GAAG,EAAE,MAAM,GAAG,OAAO,CAAA;CAChC;AAED,gFAAgF;AAChF,MAAM,WAAW,QAAQ;IACvB,QAAQ,CAAC,GAAG,EAAE,MAAM,CAAA;IACpB,QAAQ,CAAC,KAAK,EAAE,SAAS,UAAU,EAAE,CAAA;IACrC,QAAQ,CAAC,IAAI,EAAE,OAAO,CAAA;CACvB;AAED,sEAAsE;AACtE,UAAU,SAAS;IACjB,QAAQ,CAAC,IAAI,EAAE,OAAO,CAAA;IACtB,QAAQ,CAAC,KAAK,EAAE,GAAG,CAAA;IACnB,QAAQ,CAAC,KAAK,EAAE,SAAS,IAAI,EAAE,CAAA;IAC/B,QAAQ,CAAC,KAAK,EAAE,SAAS,QAAQ,EAAE,CAAA;CACpC;AAED,wEAAwE;AACxE,MAAM,MAAM,WAAW,GAAG,SAAS,GAAG;IAAE,QAAQ,CAAC,IAAI,EAAE,OAAO,CAAA;CAAE,CAAA;AAkBhE,qDAAqD;AACrD,wBAAgB,MAAM,CAAC,KAAK,EAAE,OAAO,GAAG,KAAK,IAAI,UAAU,CAE1D;AAED,wEAAwE;AACxE,wBAAgB,UAAU,CAAC,KAAK,EAAE,OAAO,GAAG,KAAK,IAAI,UAAU,EAAE,CAEhE;AAED;;;;;;;;GAQG;AACH,wBAAgB,KAAK,CAAC,IAAI,EAAE,UAAU,GAAG,WAAW,CAwBnD"}
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
import { isPlainObject } from '../normalize.js';
|
|
2
|
+
import { RULES } from './rules/index.js';
|
|
3
|
+
const NODE_TYPE = /^(?:component|action)\./;
|
|
4
|
+
const SHAPE = { type: 'shape' };
|
|
5
|
+
/** Style keys an action takes flat (the SDK nests them under `style`). */
|
|
6
|
+
const ACTION_STYLE_KEYS = [
|
|
7
|
+
'isPrimary',
|
|
8
|
+
'isDanger',
|
|
9
|
+
'isPlain',
|
|
10
|
+
'isSecondary',
|
|
11
|
+
'isDisabled',
|
|
12
|
+
];
|
|
13
|
+
/** Style keys form fields take flat (the SDK nests them under `style`). */
|
|
14
|
+
const COMPONENT_STYLE_KEYS = ['isDisabled', 'isBusy', 'isPositive', 'flex'];
|
|
15
|
+
/** Whether a value is a component or action node. */
|
|
16
|
+
export function isNode(value) {
|
|
17
|
+
return isPlainObject(value) && typeof value.type === 'string' && NODE_TYPE.test(value.type);
|
|
18
|
+
}
|
|
19
|
+
/** Whether a value is a non-empty list of component or action nodes. */
|
|
20
|
+
export function isNodeList(value) {
|
|
21
|
+
return Array.isArray(value) && value.length > 0 && value.every((item) => isNode(item));
|
|
22
|
+
}
|
|
23
|
+
/**
|
|
24
|
+
* Splits a node into flat factory input, builder calls and child slots.
|
|
25
|
+
*
|
|
26
|
+
* `options` keys become input, except nodes and node lists, which become slots.
|
|
27
|
+
* A `style` with only liftable keys is flattened into the input; the node type's
|
|
28
|
+
* rule then reshapes the input and pulls out builder calls.
|
|
29
|
+
* The shape is not expressible when an option collides with a top-level key.
|
|
30
|
+
* A type whose rule declares `whole` hands the whole node to its factory instead.
|
|
31
|
+
*/
|
|
32
|
+
export function split(node) {
|
|
33
|
+
const rule = RULES[node.type];
|
|
34
|
+
if (rule?.whole)
|
|
35
|
+
return { type: 'split', input: rule.whole(node), calls: [], slots: [] };
|
|
36
|
+
const { type, instanceId, when, options, ...extra } = node;
|
|
37
|
+
const input = { ...extra };
|
|
38
|
+
if (instanceId !== undefined)
|
|
39
|
+
input.instanceId = instanceId;
|
|
40
|
+
if (when !== undefined)
|
|
41
|
+
input.when = when;
|
|
42
|
+
if (options !== undefined && !isPlainObject(options))
|
|
43
|
+
return SHAPE;
|
|
44
|
+
const slots = [];
|
|
45
|
+
for (const [key, value] of Object.entries(options ?? {})) {
|
|
46
|
+
if (key in input)
|
|
47
|
+
return SHAPE;
|
|
48
|
+
if (isNode(value))
|
|
49
|
+
slots.push({ key, nodes: [value], list: false });
|
|
50
|
+
else if (isNodeList(value))
|
|
51
|
+
slots.push({ key, nodes: value, list: true });
|
|
52
|
+
else
|
|
53
|
+
input[key] = value;
|
|
54
|
+
}
|
|
55
|
+
const liftable = type.startsWith('action.') ? ACTION_STYLE_KEYS : COMPONENT_STYLE_KEYS;
|
|
56
|
+
const { style } = input;
|
|
57
|
+
if (isPlainObject(style) && Object.keys(style).every((key) => liftable.includes(key))) {
|
|
58
|
+
delete input.style;
|
|
59
|
+
Object.assign(input, style);
|
|
60
|
+
}
|
|
61
|
+
rule?.input?.(input);
|
|
62
|
+
const calls = rule?.calls?.(input) ?? [];
|
|
63
|
+
return { type: 'split', input, calls, slots };
|
|
64
|
+
}
|
|
65
|
+
//# sourceMappingURL=node-shape.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"node-shape.js","sourceRoot":"","sources":["../../../src/migrator/nodes/node-shape.ts"],"names":[],"mappings":"A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C,CAAC,EAAE,CAAC;QACtF,OAAO,KAAK,CAAC,KAAK,CAAA;QAClB,MAAM,CAAC,MAAM,CAAC,KAAK,EAAE,KAAK,CAAC,CAAA;IAC7B,CAAC;IACD,IAAI,EAAE,KAAK,EAAE,CAAC,KAAK,CAAC,CAAA;IACpB,MAAM,KAAK,GAAG,IAAI,EAAE,KAAK,EAAE,CAAC,KAAK,CAAC,IAAI,EAAE,CAAA;IACxC,OAAO,EAAE,IAAI,EAAE,OAAO,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,CAAA;AAC/C,CAAC"}
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
import { type NodeGap } from '../report.js';
|
|
2
|
+
import { type Call, type Obj } from './rules/index.js';
|
|
3
|
+
/** Name of the scratch Applications the probes build on. */
|
|
4
|
+
export declare const PROBE_APP_NAME = "migrate-probe";
|
|
5
|
+
/** How a parent creates a child: `parent[holder](input)` or `parent[holder][method](input)`. */
|
|
6
|
+
export interface Accessor {
|
|
7
|
+
readonly holder: string;
|
|
8
|
+
readonly method?: string;
|
|
9
|
+
}
|
|
10
|
+
/** Where a parent's built output keeps a child slot: under `options` (nodes) or at its root. */
|
|
11
|
+
export type ChildRoot = 'options' | 'root';
|
|
12
|
+
/** A verified typed node: the factory call, its builder calls and its child slots. */
|
|
13
|
+
export interface NodePlan {
|
|
14
|
+
readonly nodeType: string;
|
|
15
|
+
readonly accessor: Accessor;
|
|
16
|
+
/** Factory input; `undefined` calls the factory without parameters. */
|
|
17
|
+
readonly input: Obj | undefined;
|
|
18
|
+
readonly calls: readonly Call[];
|
|
19
|
+
readonly slots: readonly SlotPlan[];
|
|
20
|
+
}
|
|
21
|
+
/** One child slot of a plan, in legacy order; skipped children keep their position. */
|
|
22
|
+
export interface SlotPlan {
|
|
23
|
+
readonly key: string;
|
|
24
|
+
readonly items: readonly SlotItem[];
|
|
25
|
+
}
|
|
26
|
+
export type SlotItem = {
|
|
27
|
+
readonly type: 'typed';
|
|
28
|
+
readonly plan: NodePlan;
|
|
29
|
+
} | {
|
|
30
|
+
readonly type: 'skip';
|
|
31
|
+
readonly gap: NodeGap;
|
|
32
|
+
};
|
|
33
|
+
/** Creates a fresh scratch parent builder (the chain of its ancestors, without siblings). */
|
|
34
|
+
export type ParentFactory = () => unknown;
|
|
35
|
+
/**
|
|
36
|
+
* Replays a plan on `parent` through public factories: the factory call, the builder
|
|
37
|
+
* calls, then every typed child. Inputs are cloned, so a plan replays any number of times.
|
|
38
|
+
* Returns the created builder.
|
|
39
|
+
*/
|
|
40
|
+
export declare function replay(options: {
|
|
41
|
+
readonly parent: unknown;
|
|
42
|
+
readonly plan: NodePlan;
|
|
43
|
+
/** Replay child slots too (default). Off for ancestor chains, which carry no siblings. */
|
|
44
|
+
readonly withChildren?: boolean;
|
|
45
|
+
}): unknown;
|
|
46
|
+
export type ProbeResult = {
|
|
47
|
+
readonly type: 'built';
|
|
48
|
+
readonly value: unknown;
|
|
49
|
+
} | {
|
|
50
|
+
readonly type: 'error';
|
|
51
|
+
readonly message: string;
|
|
52
|
+
};
|
|
53
|
+
/**
|
|
54
|
+
* Builds `candidate` on a scratch parent and returns what the parent's `build()` holds
|
|
55
|
+
* at `slot` (the last entry for a list slot), or the error a call or the build threw.
|
|
56
|
+
*
|
|
57
|
+
* The scratch parent comes from `parentFactory`, so the real parent is never touched.
|
|
58
|
+
*/
|
|
59
|
+
export declare function probe(options: {
|
|
60
|
+
readonly parentFactory: ParentFactory;
|
|
61
|
+
readonly childRoot: ChildRoot;
|
|
62
|
+
readonly slot: string;
|
|
63
|
+
readonly list: boolean;
|
|
64
|
+
readonly candidate: NodePlan;
|
|
65
|
+
}): ProbeResult;
|
|
66
|
+
//# sourceMappingURL=probe.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"probe.d.ts","sourceRoot":"","sources":["../../../src/migrator/nodes/probe.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,OAAO,EAAE,MAAM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AI,EAAE,QAAQ,CAAA;IACvB,0FAA0F;IAC1F,QAAQ,CAAC,YAAY,CAAC,EAAE,OAAO,CAAA;CAChC,GAAG,OAAO,CAcV;AAED,MAAM,MAAM,WAAW,GACnB;IAAE,QAAQ,CAAC,IAAI,EAAE,OAAO,CAAC;IAAC,QAAQ,CAAC,KAAK,EAAE,OAAO,CAAA;CAAE,GACnD;IAAE,QAAQ,CAAC,IAAI,EAAE,OAAO,CAAC;IAAC,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAA;CAAE,CAAA;AAExD;;;;;GAKG;AACH,wBAAgB,KAAK,CAAC,OAAO,EAAE;IAC7B,QAAQ,CAAC,aAAa,EAAE,aAAa,CAAA;IACrC,QAAQ,CAAC,SAAS,EAAE,SAAS,CAAA;IAC7B,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAA;IACrB,QAAQ,CAAC,IAAI,EAAE,OAAO,CAAA;IACtB,QAAQ,CAAC,SAAS,EAAE,QAAQ,CAAA;CAC7B,GAAG,WAAW,CAYd"}
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import { firstLine, invoke, member } from './builder-access.js';
|
|
2
|
+
/** Name of the scratch Applications the probes build on. */
|
|
3
|
+
export const PROBE_APP_NAME = 'migrate-probe';
|
|
4
|
+
/**
|
|
5
|
+
* Replays a plan on `parent` through public factories: the factory call, the builder
|
|
6
|
+
* calls, then every typed child. Inputs are cloned, so a plan replays any number of times.
|
|
7
|
+
* Returns the created builder.
|
|
8
|
+
*/
|
|
9
|
+
export function replay(options) {
|
|
10
|
+
const { parent, plan, withChildren = true } = options;
|
|
11
|
+
const { holder, method } = plan.accessor;
|
|
12
|
+
const args = plan.input === undefined ? [] : [structuredClone(plan.input)];
|
|
13
|
+
const builder = invoke(parent, method === undefined ? holder : `${holder}.${method}`, args);
|
|
14
|
+
for (const call of plan.calls)
|
|
15
|
+
invoke(builder, call.method, structuredClone(call.args));
|
|
16
|
+
if (withChildren) {
|
|
17
|
+
for (const slot of plan.slots) {
|
|
18
|
+
for (const item of slot.items) {
|
|
19
|
+
if (item.type === 'typed')
|
|
20
|
+
replay({ parent: builder, plan: item.plan });
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
return builder;
|
|
25
|
+
}
|
|
26
|
+
/**
|
|
27
|
+
* Builds `candidate` on a scratch parent and returns what the parent's `build()` holds
|
|
28
|
+
* at `slot` (the last entry for a list slot), or the error a call or the build threw.
|
|
29
|
+
*
|
|
30
|
+
* The scratch parent comes from `parentFactory`, so the real parent is never touched.
|
|
31
|
+
*/
|
|
32
|
+
export function probe(options) {
|
|
33
|
+
const { parentFactory, childRoot, slot, list, candidate } = options;
|
|
34
|
+
try {
|
|
35
|
+
const parent = parentFactory();
|
|
36
|
+
replay({ parent, plan: candidate });
|
|
37
|
+
const built = invoke(parent, 'build', []);
|
|
38
|
+
const container = childRoot === 'options' ? member(built, 'options') : built;
|
|
39
|
+
const value = member(container, slot);
|
|
40
|
+
return { type: 'built', value: list && Array.isArray(value) ? value.at(-1) : value };
|
|
41
|
+
}
|
|
42
|
+
catch (error) {
|
|
43
|
+
return { type: 'error', message: firstLine(error) };
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
//# sourceMappingURL=probe.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"probe.js","sourceRoot":"","sources":["../../../src/migrator/nodes/probe.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,SAAS,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,qBAAqB,CAAA;AAG/D,4DAA4D;AAC5D,MAAM,CAAC,MAAM,cAAc,GAAG,eAAe,CAAA;AAkC7C;;;;GAIG;AACH,MAAM,UAAU,MAAM,CAAC,OAKtB;IACC,MAAM,EAAE,MAAM,EAAE,IAAI,EAAE,YAAY,GAAG,IAAI,EAAE,GAAG,OAAO,CAAA;IACrD,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,GAAG,IAAI,CAAC,QAAQ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AS,CAAC,CAAC,CAAC,MAAM,CAAC,KAAK,EAAE,SAAS,CAAC,CAAC,CAAC,CAAC,KAAK,CAAA;QAC5E,MAAM,KAAK,GAAG,MAAM,CAAC,SAAS,EAAE,IAAI,CAAC,CAAA;QACrC,OAAO,EAAE,IAAI,EAAE,OAAO,EAAE,KAAK,EAAE,IAAI,IAAI,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,KAAK,EAAE,CAAA;IACtF,CAAC;IAAC,OAAO,KAAK,EAAE,CAAC;QACf,OAAO,EAAE,IAAI,EAAE,OAAO,EAAE,OAAO,EAAE,SAAS,CAAC,KAAK,CAAC,EAAE,CAAA;IACrD,CAAC;AACH,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"action-list.d.ts","sourceRoot":"","sources":["../../../../src/migrator/nodes/rules/action-list.ts"],"names":[],"mappings":"AAAA,OAAO,EAAQ,KAAK,IAAI,EAAE,MAAM,YAAY,CAAA;AAE5C,uEAAuE;AACvE,eAAO,MAAM,cAAc,EAAE,IAO5B,CAAA"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { take } from './types.js';
|
|
2
|
+
/** `action.action-list`: legacy `isSequential` → SDK `concurrency`. */
|
|
3
|
+
export const actionListRule = {
|
|
4
|
+
input: (input) => {
|
|
5
|
+
const sequential = take(input, 'isSequential');
|
|
6
|
+
if (sequential === true)
|
|
7
|
+
input.concurrency = 'sequential';
|
|
8
|
+
else if (sequential === false)
|
|
9
|
+
input.concurrency = 'parallel';
|
|
10
|
+
else if (typeof sequential === 'string')
|
|
11
|
+
input.concurrency = sequential;
|
|
12
|
+
},
|
|
13
|
+
};
|
|
14
|
+
//# sourceMappingURL=action-list.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"action-list.js","sourceRoot":"","sources":["../../../../src/migrator/nodes/rules/action-list.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAa,MAAM,YAAY,CAAA;AAE5C,uEAAuE;AACvE,MAAM,CAAC,MAAM,cAAc,GAAS;IAClC,KAAK,EAAE,CAAC,KAAK,EAAE,EAAE;QACf,MAAM,UAAU,GAAG,IAAI,CAAC,KAAK,EAAE,cAAc,CAAC,CAAA;QAC9C,IAAI,UAAU,KAAK,IAAI;YAAE,KAAK,CAAC,WAAW,GAAG,YAAY,CAAA;aACpD,IAAI,UAAU,KAAK,KAAK;YAAE,KAAK,CAAC,WAAW,GAAG,UAAU,CAAA;aACxD,IAAI,OAAO,UAAU,KAAK,QAAQ;YAAE,KAAK,CAAC,WAAW,GAAG,UAAU,CAAA;IACzE,CAAC;CACF,CAAA"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { type Obj } from './types.js';
|
|
2
|
+
/**
|
|
3
|
+
* Whether the SDK types refuse an action input in this slot although it builds:
|
|
4
|
+
* - a button factory needs `title` or `icon` (`WithTitle`)
|
|
5
|
+
* - an in-background factory takes no button keys (`title`, `icon`, `isHidden`, styles)
|
|
6
|
+
*/
|
|
7
|
+
export declare function rejectsActionInSlot(options: {
|
|
8
|
+
readonly type: string;
|
|
9
|
+
readonly input: Obj;
|
|
10
|
+
readonly parentType: string;
|
|
11
|
+
readonly slot: string;
|
|
12
|
+
}): boolean;
|
|
13
|
+
//# sourceMappingURL=action-slots.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"action-slots.d.ts","sourceRoot":"","sources":["../../../../src/migrator/nodes/rules/action-slots.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,GAAG,EAAE,MAAM,YAAY,CAAA;AAyBrC;;;;GAIG;AACH,wBAAgB,mBAAmB,CAAC,OAAO,EAAE;IAC3C,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAA;IACrB,QAAQ,CAAC,KAAK,EAAE,GAAG,CAAA;IACnB,QAAQ,CAAC,UAAU,EAAE,MAAM,CAAA;IAC3B,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAA;CACtB,GAAG,OAAO,CAUV"}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
/** Keys the in-background action factories omit from their input types (`OmitButtonOptions`). */
|
|
2
|
+
const BUTTON_KEYS = [
|
|
3
|
+
'title',
|
|
4
|
+
'icon',
|
|
5
|
+
'isHidden',
|
|
6
|
+
'isPrimary',
|
|
7
|
+
'isDanger',
|
|
8
|
+
'isPlain',
|
|
9
|
+
'isDisabled',
|
|
10
|
+
];
|
|
11
|
+
/** `show-alert` keeps `title` and `icon` in its in-background input type. */
|
|
12
|
+
const ALERT_KEYS = ['title', 'icon'];
|
|
13
|
+
/** Slots filled through button action factories (`ActionOnButtonBuilders`), per parent type. */
|
|
14
|
+
const BUTTON_SLOTS = {
|
|
15
|
+
'jig-actions': ['children'],
|
|
16
|
+
'component.banner': ['actions'],
|
|
17
|
+
'component.jig-header': ['actions'],
|
|
18
|
+
'component.menu-item': ['onPress'],
|
|
19
|
+
'component.event': ['onButtonPress'],
|
|
20
|
+
};
|
|
21
|
+
/**
|
|
22
|
+
* Whether the SDK types refuse an action input in this slot although it builds:
|
|
23
|
+
* - a button factory needs `title` or `icon` (`WithTitle`)
|
|
24
|
+
* - an in-background factory takes no button keys (`title`, `icon`, `isHidden`, styles)
|
|
25
|
+
*/
|
|
26
|
+
export function rejectsActionInSlot(options) {
|
|
27
|
+
const { type, input, parentType, slot } = options;
|
|
28
|
+
if (!type.startsWith('action.'))
|
|
29
|
+
return false;
|
|
30
|
+
if (BUTTON_SLOTS[parentType]?.includes(slot)) {
|
|
31
|
+
return input.title === undefined && input.icon === undefined;
|
|
32
|
+
}
|
|
33
|
+
return BUTTON_KEYS.some((key) => input[key] !== undefined && !(type === 'action.show-alert' && ALERT_KEYS.includes(key)));
|
|
34
|
+
}
|
|
35
|
+
//# sourceMappingURL=action-slots.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"action-slots.js","sourceRoot":"","sources":["../../../../src/migrator/nodes/rules/action-slots.ts"],"names":[],"mappings":"AAEA,iGAAiG;AACjG,MAAM,WAAW,GAAsB;IACrC,OAAO;IACP,MAAM;IACN,UAAU;IACV,WAAW;IACX,UAAU;IACV,SAAS;IACT,YAAY;CACb,CAAA;AAED,6EAA6E;AAC7E,MAAM,UAAU,GAAsB,CAAC,OAAO,EAAE,MAAM,CAAC,CAAA;AAEvD,gGAAgG;AAChG,MAAM,YAAY,GAAyD;IACzE,aAAa,EAAE,CAAC,UAAU,CAAC;IAC3B,kBAAkB,EAAE,CAAC,SAAS,CAAC;IAC/B,sBAAsB,EAAE,CAAC,SAAS,CAAC;IACnC,qBAAqB,EAAE,CAAC,SAAS,CAAC;IAClC,iBAAiB,EAAE,CAAC,eAAe,CAAC;CACrC,CAAA;AAED;;;;GAIG;AACH,MAAM,UAAU,mBAAmB,CAAC,OAKnC;IACC,MAAM,EAAE,IAAI,EAAE,KAAK,EAAE,UAAU,EAAE,IAAI,EAAE,GAAG,OAAO,CAAA;IACjD,IAAI,CAAC,IAAI,CAAC,UAAU,CAAC,SAAS,CAAC;QAAE,OAAO,KAAK,CAAA;IAC7C,IAAI,YAAY,CAAC,UAAU,CAAC,EAAE,QAAQ,CAAC,IAAI,CAAC,EAAE,CAAC;QAC7C,OAAO,KAAK,CAAC,KAAK,KAAK,SAAS,IAAI,KAAK,CAAC,IAAI,KAAK,SAAS,CAAA;IAC9D,CAAC;IACD,OAAO,WAAW,CAAC,IAAI,CACrB,CAAC,GAAG,EAAE,EAAE,CACN,KAAK,CAAC,GAAG,CAAC,KAAK,SAAS,IAAI,CAAC,CAAC,IAAI,KAAK,mBAAmB,IAAI,UAAU,CAAC,QAAQ,CAAC,GAAG,CAAC,CAAC,CAC1F,CAAA;AACH,CAAC"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { type Rule } from './types.js';
|
|
2
|
+
/**
|
|
3
|
+
* `component.banner`: an icon `leftElement` → `icon`/`iconColor`/`iconType`/`iconShape`,
|
|
4
|
+
* `style` flags → `isNegative`/`isPositive`/`isWarning`, `actions` through `addAction`.
|
|
5
|
+
* Any other key leaves the option in place, so the probe reports it as a gap.
|
|
6
|
+
*/
|
|
7
|
+
export declare const bannerRule: Rule;
|
|
8
|
+
//# sourceMappingURL=banner.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"banner.d.ts","sourceRoot":"","sources":["../../../../src/migrator/nodes/rules/banner.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,KAAK,IAAI,EAAE,MAAM,YAAY,CAAA;AAatC;;;;GAIG;AACH,eAAO,MAAM,UAAU,EAAE,IAgBxB,CAAA"}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import { isPlainObject } from '../../normalize.js';
|
|
2
|
+
/** Legacy `leftElement` icon keys → the banner's flat icon inputs. */
|
|
3
|
+
const ICON_INPUTS = {
|
|
4
|
+
icon: 'icon',
|
|
5
|
+
color: 'iconColor',
|
|
6
|
+
type: 'iconType',
|
|
7
|
+
shape: 'iconShape',
|
|
8
|
+
};
|
|
9
|
+
/** Legacy `style` flags the banner takes as flat inputs. */
|
|
10
|
+
const STYLE_INPUTS = ['isNegative', 'isPositive', 'isWarning'];
|
|
11
|
+
/**
|
|
12
|
+
* `component.banner`: an icon `leftElement` → `icon`/`iconColor`/`iconType`/`iconShape`,
|
|
13
|
+
* `style` flags → `isNegative`/`isPositive`/`isWarning`, `actions` through `addAction`.
|
|
14
|
+
* Any other key leaves the option in place, so the probe reports it as a gap.
|
|
15
|
+
*/
|
|
16
|
+
export const bannerRule = {
|
|
17
|
+
input: (input) => {
|
|
18
|
+
const { leftElement, style } = input;
|
|
19
|
+
if (isPlainObject(leftElement) && leftElement.element === 'icon') {
|
|
20
|
+
const { element: _element, ...rest } = leftElement;
|
|
21
|
+
if (Object.keys(rest).every((key) => key in ICON_INPUTS)) {
|
|
22
|
+
delete input.leftElement;
|
|
23
|
+
for (const [key, value] of Object.entries(rest))
|
|
24
|
+
input[ICON_INPUTS[key]] = value;
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
if (isPlainObject(style) && Object.keys(style).every((key) => STYLE_INPUTS.includes(key))) {
|
|
28
|
+
delete input.style;
|
|
29
|
+
Object.assign(input, style);
|
|
30
|
+
}
|
|
31
|
+
},
|
|
32
|
+
holders: { actions: 'addAction' },
|
|
33
|
+
};
|
|
34
|
+
//# sourceMappingURL=banner.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"banner.js","sourceRoot":"","sources":["../../../../src/migrator/nodes/rules/banner.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAA;AAGlD,sEAAsE;AACtE,MAAM,WAAW,GAAqC;IACpD,IAAI,EAAE,MAAM;IACZ,KAAK,EAAE,WAAW;IAClB,IAAI,EAAE,UAAU;IAChB,KAAK,EAAE,WAAW;CACnB,CAAA;AAED,4DAA4D;AAC5D,MAAM,YAAY,GAAsB,CAAC,YAAY,EAAE,YAAY,EAAE,WAAW,CAAC,CAAA;AAEjF;;;;GAIG;AACH,MAAM,CAAC,MAAM,UAAU,GAAS;IAC9B,KAAK,EAAE,CAAC,KAAK,EAAE,EAAE;QACf,MAAM,EAAE,WAAW,EAAE,KAAK,EAAE,GAAG,KAAK,CAAA;QACpC,IAAI,aAAa,CAAC,WAAW,CAAC,IAAI,WAAW,CAAC,OAAO,KAAK,MAAM,EAAE,CAAC;YACjE,MAAM,EAAE,OAAO,EAAE,QAAQ,EAAE,GAAG,IAAI,EAAE,GAAG,WAAW,CAAA;YAClD,IAAI,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,KAAK,CAAC,CAAC,GAAG,EAAE,EAAE,CAAC,GAAG,IAAI,WAAW,CAAC,EAAE,CAAC;gBACzD,OAAO,KAAK,CAAC,WAAW,CAAA;gBACxB,KAAK,MAAM,CAAC,GAAG,EAAE,KAAK,CAAC,IAAI,MAAM,CAAC,OAAO,CAAC,IAAI,CAAC;oBAAE,KAAK,CAAC,WAAW,CAAC,GAAG,CAAC,CAAC,GAAG,KAAK,CAAA;YAClF,CAAC;QACH,CAAC;QACD,IAAI,aAAa,CAAC,KAAK,CAAC,IAAI,MAAM,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,KAAK,CAAC,CAAC,GAAG,EAAE,EAAE,CAAC,YAAY,CAAC,QAAQ,CAAC,GAAG,CAAC,CAAC,EAAE,CAAC;YAC1F,OAAO,KAAK,CAAC,KAAK,CAAA;YAClB,MAAM,CAAC,MAAM,CAAC,KAAK,EAAE,KAAK,CAAC,CAAA;QAC7B,CAAC;IACH,CAAC;IACD,OAAO,EAAE,EAAE,OAAO,EAAE,WAAW,EAAE;CAClC,CAAA"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { type Rule } from './types.js';
|
|
2
|
+
/**
|
|
3
|
+
* `component.custom-component`: the SDK's interop builder takes the whole usage node as
|
|
4
|
+
* `{ json }` and emits it unchanged, so inline `options.children` stay data, not slots.
|
|
5
|
+
*/
|
|
6
|
+
export declare const customComponentRule: Rule;
|
|
7
|
+
//# sourceMappingURL=custom-component.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"custom-component.d.ts","sourceRoot":"","sources":["../../../../src/migrator/nodes/rules/custom-component.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,IAAI,EAAE,MAAM,YAAY,CAAA;AAEtC;;;GAGG;AACH,eAAO,MAAM,mBAAmB,EAAE,IAEjC,CAAA"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* `component.custom-component`: the SDK's interop builder takes the whole usage node as
|
|
3
|
+
* `{ json }` and emits it unchanged, so inline `options.children` stay data, not slots.
|
|
4
|
+
*/
|
|
5
|
+
export const customComponentRule = {
|
|
6
|
+
whole: (node) => ({ json: node }),
|
|
7
|
+
};
|
|
8
|
+
//# sourceMappingURL=custom-component.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"custom-component.js","sourceRoot":"","sources":["../../../../src/migrator/nodes/rules/custom-component.ts"],"names":[],"mappings":"AAEA;;;GAGG;AACH,MAAM,CAAC,MAAM,mBAAmB,GAAS;IACvC,KAAK,EAAE,CAAC,IAAI,EAAE,EAAE,CAAC,CAAC,EAAE,IAAI,EAAE,IAAI,EAAE,CAAC;CAClC,CAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"dropdown.d.ts","sourceRoot":"","sources":["../../../../src/migrator/nodes/rules/dropdown.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,IAAI,EAAE,MAAM,YAAY,CAAA;AAEtC,wEAAwE;AACxE,eAAO,MAAM,YAAY,EAAE,IAA0C,CAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"dropdown.js","sourceRoot":"","sources":["../../../../src/migrator/nodes/rules/dropdown.ts"],"names":[],"mappings":"AAEA,wEAAwE;AACxE,MAAM,CAAC,MAAM,YAAY,GAAS,EAAE,OAAO,EAAE,EAAE,IAAI,EAAE,YAAY,EAAE,EAAE,CAAA"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { type Rule } from './types.js';
|
|
2
|
+
/**
|
|
3
|
+
* `action.execute-entity` and `action.execute-entities`: legacy `goBack` → SDK `_goBack`;
|
|
4
|
+
* provider, data and parameters via calls.
|
|
5
|
+
*/
|
|
6
|
+
export declare const executeEntityRule: Rule;
|
|
7
|
+
//# sourceMappingURL=execute-entity.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"execute-entity.d.ts","sourceRoot":"","sources":["../../../../src/migrator/nodes/rules/execute-entity.ts"],"names":[],"mappings":"AAAA,OAAO,EAAmB,KAAK,IAAI,EAAE,MAAM,YAAY,CAAA;AA8BvD;;;GAGG;AACH,eAAO,MAAM,iBAAiB,EAAE,IAK/B,CAAA"}
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import { take } from './types.js';
|
|
2
|
+
/** Legacy data provider → `executeEntity` provider method. */
|
|
3
|
+
const PROVIDER_METHOD = {
|
|
4
|
+
DATA_PROVIDER_LOCAL: 'local',
|
|
5
|
+
DATA_PROVIDER_DYNAMIC: 'dynamicData',
|
|
6
|
+
DATA_PROVIDER_REST: 'rest',
|
|
7
|
+
DATA_PROVIDER_SOAP: 'soap',
|
|
8
|
+
DATA_PROVIDER_SQL: 'sql',
|
|
9
|
+
};
|
|
10
|
+
/** `provider` + `entity` + `method` → `.<provider>(entity, method)`, then `data`, `parameters`, `file`. */
|
|
11
|
+
function executeEntityCalls(input) {
|
|
12
|
+
const calls = [];
|
|
13
|
+
const { provider } = input;
|
|
14
|
+
const providerMethod = typeof provider === 'string' ? PROVIDER_METHOD[provider] : undefined;
|
|
15
|
+
if (providerMethod && input.entity !== undefined && input.method !== undefined) {
|
|
16
|
+
delete input.provider;
|
|
17
|
+
calls.push({
|
|
18
|
+
method: providerMethod,
|
|
19
|
+
args: [take(input, 'entity'), take(input, 'method')],
|
|
20
|
+
chain: true,
|
|
21
|
+
});
|
|
22
|
+
}
|
|
23
|
+
for (const key of ['data', 'parameters', 'file']) {
|
|
24
|
+
if (input[key] !== undefined)
|
|
25
|
+
calls.push({ method: key, args: [take(input, key)], chain: true });
|
|
26
|
+
}
|
|
27
|
+
return calls;
|
|
28
|
+
}
|
|
29
|
+
/**
|
|
30
|
+
* `action.execute-entity` and `action.execute-entities`: legacy `goBack` → SDK `_goBack`;
|
|
31
|
+
* provider, data and parameters via calls.
|
|
32
|
+
*/
|
|
33
|
+
export const executeEntityRule = {
|
|
34
|
+
input: (input) => {
|
|
35
|
+
if ('goBack' in input)
|
|
36
|
+
input._goBack = take(input, 'goBack');
|
|
37
|
+
},
|
|
38
|
+
calls: executeEntityCalls,
|
|
39
|
+
};
|
|
40
|
+
//# sourceMappingURL=execute-entity.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"execute-entity.js","sourceRoot":"","sources":["../../../../src/migrator/nodes/rules/execute-entity.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAwB,MAAM,YAAY,CAAA;AAEvD,8DAA8D;AAC9D,MAAM,eAAe,GAAqC;IACxD,mBAAmB,EAAE,OAAO;IAC5B,qBAAqB,EAAE,aAAa;IACpC,kBAAkB,EAAE,MAAM;IAC1B,kBAAkB,EAAE,MAAM;IAC1B,iBAAiB,EAAE,KAAK;CACzB,CAAA;AAED,2GAA2G;AAC3G,SAAS,kBAAkB,CAAC,KAA8B;IACxD,MAAM,KAAK,GAAW,EAAE,CAAA;IACxB,MAAM,EAAE,QAAQ,EAAE,GAAG,KAAK,CAAA;IAC1B,MAAM,cAAc,GAAG,OAAO,QAAQ,KAAK,QAAQ,CAAC,CAAC,CAAC,eAAe,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC,SAAS,CAAA;IAC3F,IAAI,cAAc,IAAI,KAAK,CAAC,MAAM,KAAK,SAAS,IAAI,KAAK,CAAC,MAAM,KAAK,SAAS,EAAE,CAAC;QAC/E,OAAO,KAAK,CAAC,QAAQ,CAAA;QACrB,KAAK,CAAC,IAAI,CAAC;YACT,MAAM,EAAE,cAAc;YACtB,IAAI,EAAE,CAAC,IAAI,CAAC,KAAK,EAAE,QAAQ,CAAC,EAAE,IAAI,CAAC,KAAK,EAAE,QAAQ,CAAC,CAAC;YACpD,KAAK,EAAE,IAAI;SACZ,CAAC,CAAA;IACJ,CAAC;IACD,KAAK,MAAM,GAAG,IAAI,CAAC,MAAM,EAAE,YAAY,EAAE,MAAM,CAAC,EAAE,CAAC;QACjD,IAAI,KAAK,CAAC,GAAG,CAAC,KAAK,SAAS;YAAE,KAAK,CAAC,IAAI,CAAC,EAAE,MAAM,EAAE,GAAG,EAAE,IAAI,EAAE,CAAC,IAAI,CAAC,KAAK,EAAE,GAAG,CAAC,CAAC,EAAE,KAAK,EAAE,IAAI,EAAE,CAAC,CAAA;IAClG,CAAC;IACD,OAAO,KAAK,CAAA;AACd,CAAC;AAED;;;GAGG;AACH,MAAM,CAAC,MAAM,iBAAiB,GAAS;IACrC,KAAK,EAAE,CAAC,KAAK,EAAE,EAAE;QACf,IAAI,QAAQ,IAAI,KAAK;YAAE,KAAK,CAAC,OAAO,GAAG,IAAI,CAAC,KAAK,EAAE,QAAQ,CAAC,CAAA;IAC9D,CAAC;IACD,KAAK,EAAE,kBAAkB;CAC1B,CAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"field-row.d.ts","sourceRoot":"","sources":["../../../../src/migrator/nodes/rules/field-row.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,IAAI,EAAE,MAAM,YAAY,CAAA;AAEtC,qFAAqF;AACrF,eAAO,MAAM,YAAY,EAAE,IAA4C,CAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"field-row.js","sourceRoot":"","sources":["../../../../src/migrator/nodes/rules/field-row.ts"],"names":[],"mappings":"AAEA,qFAAqF;AACrF,MAAM,CAAC,MAAM,YAAY,GAAS,EAAE,OAAO,EAAE,EAAE,QAAQ,EAAE,UAAU,EAAE,EAAE,CAAA"}
|