@lovable.dev/workflows-sdk 0.0.0-dev.59 → 0.0.0-dev.60
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-D1b9OmsG.js → branch-metadata-C8JF4mRD.js} +1 -1
- package/dist/cli/generate-manifests.d.ts +1 -0
- package/dist/cli/generate-manifests.js +30 -0
- package/dist/{context-escapes-CcYvmmKH.js → context-escapes-CaWQZiKA.js} +1 -1
- package/dist/{duplicate-ids-BZhMnS7n.js → duplicate-ids-piCSoy97.js} +1 -1
- package/dist/durable-ids-B8WBvR9R.js +2 -0
- package/dist/durable-ids-CdlFkNKw.js +4 -0
- package/dist/generate-DGdzUQcG.js +1251 -0
- package/dist/graph-C_Y_mGVf.js +2 -0
- package/dist/{graph-CwRl2SGh.js → graph-DSYE4aER.js} +2 -2
- package/dist/index.js +3 -3
- package/dist/{nested-operations-CoaLLZl0.js → nested-operations-CEA4t4q_.js} +1 -1
- package/dist/{operation-descriptions-DlYyD27h.js → operation-descriptions-BtUOwQoK.js} +1 -1
- package/dist/plugin-CXlzS4_y.js +379 -0
- package/dist/{step-metadata-CCsEws4V.js → step-metadata-DvieDJGl.js} +1 -1
- package/dist/vite.js +1 -360
- package/dist/{wait-deadlines-CCgWwxqQ.js → wait-deadlines-DULtPtuu.js} +1 -1
- package/dist/{generate-DI9qaUrI.js → workflow_manifest_pb-DnavtUll.js} +26 -1275
- package/package.json +4 -1
- package/dist/durable-ids-Cx341nJQ.js +0 -17
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { };
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
import { a as loadManifests, i as writeManifests, n as PLUGIN_NAME, t as DEFAULT_ENTRY } from "../plugin-CXlzS4_y.js";
|
|
3
|
+
import { resolve } from "node:path";
|
|
4
|
+
import { existsSync } from "node:fs";
|
|
5
|
+
import { resolveConfig } from "vite";
|
|
6
|
+
//#region src/cli/generate-manifests.ts
|
|
7
|
+
const SDK_ERROR_PREFIX = "@lovable.dev/workflows-sdk:";
|
|
8
|
+
async function generate() {
|
|
9
|
+
const config = await resolveConfig({ logLevel: "silent" }, "build", "production", "production");
|
|
10
|
+
const plugin = config.plugins.find((candidate) => candidate.name === PLUGIN_NAME);
|
|
11
|
+
if (plugin) {
|
|
12
|
+
await writeManifests(config.root, await loadManifests(config, plugin.api));
|
|
13
|
+
return;
|
|
14
|
+
}
|
|
15
|
+
if (existsSync(resolve(config.root, "src/lib/workflows/index.ts"))) throw new Error(`${SDK_ERROR_PREFIX} ${DEFAULT_ENTRY} exists, but the Vite config has no workflowsPlugin(). Add workflowsPlugin() from "@lovable.dev/workflows-sdk/vite" to its plugins.`);
|
|
16
|
+
await writeManifests(config.root, []);
|
|
17
|
+
}
|
|
18
|
+
function describe(error) {
|
|
19
|
+
if (!(error instanceof Error)) return String(error);
|
|
20
|
+
const text = error.message.startsWith(SDK_ERROR_PREFIX) ? error.message : error.stack ?? error.message;
|
|
21
|
+
return error.cause === void 0 ? text : `${text}\nCaused by: ${describe(error.cause)}`;
|
|
22
|
+
}
|
|
23
|
+
try {
|
|
24
|
+
await generate();
|
|
25
|
+
} catch (error) {
|
|
26
|
+
console.error(describe(error));
|
|
27
|
+
process.exitCode = 1;
|
|
28
|
+
}
|
|
29
|
+
//#endregion
|
|
30
|
+
export {};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { loadTypeScript,
|
|
1
|
+
import { n as loadTypeScript, r as workflowHandlerSource } from "./graph-DSYE4aER.js";
|
|
2
2
|
//#region src/manifests/context-escapes.ts
|
|
3
3
|
const durableMethods = /* @__PURE__ */ new Set([
|
|
4
4
|
"step",
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { loadTypeScript,
|
|
1
|
+
import { n as loadTypeScript, r as workflowHandlerSource } from "./graph-DSYE4aER.js";
|
|
2
2
|
//#region src/manifests/duplicate-ids.ts
|
|
3
3
|
/** Where an explicit `{ id }` would sit for each operation. */
|
|
4
4
|
const optionsArgument = {
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
//#region src/core/durable-ids.ts
|
|
2
|
+
const DURABLE_ID_REQUIRED = "every durable operation needs an explicit, workflow-unique id: ctx.approve({ id, title }), ctx.waitForEvent(name, { id }), ctx.sleep(ms, { id }), ctx.now({ id }), ctx.uuid({ id })";
|
|
3
|
+
//#endregion
|
|
4
|
+
export { DURABLE_ID_REQUIRED as t };
|