@lovable.dev/workflows-sdk 0.0.0-dev.21 → 0.0.0-dev.22
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/{branch-metadata-D3f-8DT-.js → branch-metadata-BBVwmGtr.js} +1 -1
- package/dist/{context-escapes-DPKbDPIx.js → context-escapes-hJTV5O7I.js} +1 -1
- package/dist/{duplicate-ids-C4Ug3kFs.js → duplicate-ids-CBASgH8g.js} +1 -1
- package/dist/{generate-CrIdSenf.js → generate-DJ7bQOT7.js} +7 -7
- package/dist/{graph-BDLuv4B_.js → graph-DKuhUjgo.js} +15 -8
- package/dist/index.js +1 -1
- package/dist/{nested-operations-IG6_OTsi.js → nested-operations-CspliO3h.js} +1 -1
- package/dist/{operation-descriptions-DWsquPYE.js → operation-descriptions-ugamonwF.js} +1 -1
- package/dist/{step-metadata-CPpfxR2q.js → step-metadata-DJRmHyNE.js} +1 -1
- package/dist/vite.js +1 -1
- package/package.json +1 -1
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { t as defaultDurableId } from "./durable-ids-LsygHSZC.js";
|
|
2
|
-
import { loadTypeScript, t as workflowHandlerSource } from "./graph-
|
|
2
|
+
import { loadTypeScript, t as workflowHandlerSource } from "./graph-DKuhUjgo.js";
|
|
3
3
|
//#region src/manifests/duplicate-ids.ts
|
|
4
4
|
/** Where an explicit `{ id }` would sit for each operation. */
|
|
5
5
|
const optionsArgument = {
|
|
@@ -183,13 +183,13 @@ function serializeSchema(schema, direction, label) {
|
|
|
183
183
|
}
|
|
184
184
|
}
|
|
185
185
|
async function generateManifests(definition) {
|
|
186
|
-
const { extractWorkflowGraph } = await import("./graph-
|
|
187
|
-
const { findBranchMetadataIssues } = await import("./branch-metadata-
|
|
188
|
-
const { findWorkflowContextEscapes } = await import("./context-escapes-
|
|
189
|
-
const { findDuplicateOperationIds } = await import("./duplicate-ids-
|
|
190
|
-
const { findNestedDurableOperations } = await import("./nested-operations-
|
|
191
|
-
const { findOperationDescriptionIssues } = await import("./operation-descriptions-
|
|
192
|
-
const { findStepMetadataIssues } = await import("./step-metadata-
|
|
186
|
+
const { extractWorkflowGraph } = await import("./graph-DKuhUjgo.js");
|
|
187
|
+
const { findBranchMetadataIssues } = await import("./branch-metadata-BBVwmGtr.js");
|
|
188
|
+
const { findWorkflowContextEscapes } = await import("./context-escapes-hJTV5O7I.js");
|
|
189
|
+
const { findDuplicateOperationIds } = await import("./duplicate-ids-CBASgH8g.js");
|
|
190
|
+
const { findNestedDurableOperations } = await import("./nested-operations-CspliO3h.js");
|
|
191
|
+
const { findOperationDescriptionIssues } = await import("./operation-descriptions-ugamonwF.js");
|
|
192
|
+
const { findStepMetadataIssues } = await import("./step-metadata-DJRmHyNE.js");
|
|
193
193
|
const collection = registerWorkflows(definition);
|
|
194
194
|
const manifests = [];
|
|
195
195
|
for (const workflow of collection.workflows) {
|
|
@@ -427,25 +427,28 @@ async function extractWorkflowGraph(handler) {
|
|
|
427
427
|
if (statement.elseStatement) visit(statement.elseStatement);
|
|
428
428
|
return result;
|
|
429
429
|
}
|
|
430
|
-
function statementFlow(normal, thrown = path([], false), returned = path([], false)) {
|
|
430
|
+
function statementFlow(normal, thrown = path([], false), returned = path([], false), stopped = path([], false)) {
|
|
431
431
|
return {
|
|
432
432
|
normal,
|
|
433
433
|
thrown,
|
|
434
|
-
returned
|
|
434
|
+
returned,
|
|
435
|
+
stopped
|
|
435
436
|
};
|
|
436
437
|
}
|
|
437
438
|
function statements(items, parents, branchDepth) {
|
|
438
439
|
let normal = path(parents);
|
|
439
440
|
let thrown = path([], false);
|
|
440
441
|
let returned = path([], false);
|
|
442
|
+
let stopped = path([], false);
|
|
441
443
|
for (const statement of items) {
|
|
442
444
|
if (!normal.reachable) break;
|
|
443
445
|
const flow = walkStatement(statement, normal.tails, branchDepth);
|
|
444
446
|
normal = flow.normal;
|
|
445
447
|
thrown = mergePaths(thrown, flow.thrown);
|
|
446
448
|
returned = mergePaths(returned, flow.returned);
|
|
449
|
+
stopped = mergePaths(stopped, flow.stopped);
|
|
447
450
|
}
|
|
448
|
-
return statementFlow(normal, thrown, returned);
|
|
451
|
+
return statementFlow(normal, thrown, returned, stopped);
|
|
449
452
|
}
|
|
450
453
|
function walkStatement(statement, parents, branchDepth) {
|
|
451
454
|
if (ts.isBlock(statement)) return statements(statement.statements, parents, branchDepth);
|
|
@@ -461,7 +464,10 @@ async function extractWorkflowGraph(handler) {
|
|
|
461
464
|
return statementFlow(path([], false), mergePaths(result.thrown, path(result.tails)));
|
|
462
465
|
}
|
|
463
466
|
if (ts.isVariableStatement(statement)) {
|
|
464
|
-
if (statement.declarationList.declarations.some((item) => contains(item.name, (child) => ts.isIdentifier(child) && (child.text === "Promise" || child.text === context))))
|
|
467
|
+
if (statement.declarationList.declarations.some((item) => contains(item.name, (child) => ts.isIdentifier(child) && (child.text === "Promise" || child.text === context)))) {
|
|
468
|
+
const tails = unknown("Shadowed context or Promise bindings are not supported yet", parents);
|
|
469
|
+
return statementFlow(path([], false), path([], false), path([], false), path(tails));
|
|
470
|
+
}
|
|
465
471
|
let tails = parents;
|
|
466
472
|
let thrown = path([], false);
|
|
467
473
|
for (const item of statement.declarationList.declarations) {
|
|
@@ -500,7 +506,7 @@ async function extractWorkflowGraph(handler) {
|
|
|
500
506
|
}] : branchTails;
|
|
501
507
|
const thenFlow = walkStatement(statement.thenStatement, thenParents, branchDepth + 1);
|
|
502
508
|
const elseFlow = statement.elseStatement ? walkStatement(statement.elseStatement, elseParents, branchDepth + 1) : statementFlow(path(elseParents));
|
|
503
|
-
return statementFlow(mergePaths(thenFlow.normal, elseFlow.normal), mergePaths(conditionFlow.thrown, thenFlow.thrown, elseFlow.thrown), mergePaths(thenFlow.returned, elseFlow.returned));
|
|
509
|
+
return statementFlow(mergePaths(thenFlow.normal, elseFlow.normal), mergePaths(conditionFlow.thrown, thenFlow.thrown, elseFlow.thrown), mergePaths(thenFlow.returned, elseFlow.returned), mergePaths(thenFlow.stopped, elseFlow.stopped));
|
|
504
510
|
}
|
|
505
511
|
if (ts.isTryStatement(statement)) {
|
|
506
512
|
const tryFlow = walkStatement(statement.tryBlock, parents, branchDepth);
|
|
@@ -513,15 +519,16 @@ async function extractWorkflowGraph(handler) {
|
|
|
513
519
|
const normal = mergePaths(tryFlow.normal, catchFlow.normal);
|
|
514
520
|
const thrown = catchBlock ? catchFlow.thrown : tryFlow.thrown;
|
|
515
521
|
const returned = mergePaths(tryFlow.returned, catchFlow.returned);
|
|
516
|
-
const
|
|
522
|
+
const stopped = mergePaths(tryFlow.stopped, catchFlow.stopped);
|
|
523
|
+
const flow = statementFlow(normal, thrown, returned, stopped);
|
|
517
524
|
if (!statement.finallyBlock) return flow;
|
|
518
525
|
const finallyHasDurableOperations = contains(statement.finallyBlock, durableCall);
|
|
519
526
|
const finallyHasAbruptCompletion = contains(statement.finallyBlock, (node) => ts.isReturnStatement(node) || ts.isThrowStatement(node), true);
|
|
520
527
|
if (!finallyHasDurableOperations && !finallyHasAbruptCompletion) return flow;
|
|
521
|
-
const finallyParents = mergePaths(normal, thrown, returned);
|
|
528
|
+
const finallyParents = mergePaths(normal, thrown, returned, stopped);
|
|
522
529
|
const finallyFlow = walkStatement(statement.finallyBlock, finallyParents.tails, branchDepth);
|
|
523
530
|
const completedFinally = finallyFlow.normal.reachable;
|
|
524
|
-
return statementFlow(path(finallyFlow.normal.tails, normal.reachable && completedFinally), mergePaths(finallyFlow.thrown, path(finallyFlow.normal.tails, thrown.reachable && completedFinally)), mergePaths(finallyFlow.returned, path(finallyFlow.normal.tails, returned.reachable && completedFinally)));
|
|
531
|
+
return statementFlow(path(finallyFlow.normal.tails, normal.reachable && completedFinally), mergePaths(finallyFlow.thrown, path(finallyFlow.normal.tails, thrown.reachable && completedFinally)), mergePaths(finallyFlow.returned, path(finallyFlow.normal.tails, returned.reachable && completedFinally)), mergePaths(finallyFlow.stopped, path(finallyFlow.normal.tails, stopped.reachable && completedFinally)));
|
|
525
532
|
}
|
|
526
533
|
if (ts.isEmptyStatement(statement)) return statementFlow(path(parents));
|
|
527
534
|
return statementFlow(path(unknown("Loops and other control flow are not supported yet", parents)));
|
package/dist/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { a as defineSchedule, c as weekly, i as registerWorkflows, n as createMiddleware, o as daily, r as createWorkflow, s as hourly, t as generateManifests } from "./generate-
|
|
1
|
+
import { a as defineSchedule, c as weekly, i as registerWorkflows, n as createMiddleware, o as daily, r as createWorkflow, s as hourly, t as generateManifests } from "./generate-DJ7bQOT7.js";
|
|
2
2
|
import { t as defaultDurableId } from "./durable-ids-LsygHSZC.js";
|
|
3
3
|
import { WorkflowRequestParseError, inMemoryRunStore, parseWorkflowRequest, runWorkflow } from "@tanstack/workflow-core";
|
|
4
4
|
//#region src/stacks/tanstack/sse.ts
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { loadTypeScript, t as workflowHandlerSource } from "./graph-
|
|
1
|
+
import { loadTypeScript, t as workflowHandlerSource } from "./graph-DKuhUjgo.js";
|
|
2
2
|
//#region src/manifests/step-metadata.ts
|
|
3
3
|
async function findStepMetadataIssues(handler) {
|
|
4
4
|
const api = await loadTypeScript();
|
package/dist/vite.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { t as generateManifests } from "./generate-
|
|
1
|
+
import { t as generateManifests } from "./generate-DJ7bQOT7.js";
|
|
2
2
|
import { dirname, isAbsolute, join, relative, resolve, sep } from "node:path";
|
|
3
3
|
import { createServer } from "vite";
|
|
4
4
|
import { lstat, mkdir, mkdtemp, readdir, rename, rm, writeFile } from "node:fs/promises";
|