@vite-hub/workflow 0.8.0 → 0.9.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/dist/{client-T41cNf3k.js → client-EqfVxh7z.js} +9 -9
- package/dist/{cloudflare-concurrency-counter-CDHHiMfn.js → cloudflare-concurrency-counter-ClJbAi_S.js} +1 -1
- package/dist/{cloudflare-env-DHhzRZOs.js → cloudflare-env-CiI2UtWD.js} +0 -4
- package/dist/{config-G0z9jHLM.js → config-BmCUU0cM.js} +1 -1
- package/dist/definition.js +1 -1
- package/dist/{delay-B4azP18B.js → delay-p5EJWtCp.js} +1 -1
- package/dist/{error-diagnostics-35AEmfve.js → error-diagnostics-BDtBsCLZ.js} +1 -1
- package/dist/{execute-zu08sWGG.js → execute-B47oa9GC.js} +2 -2
- package/dist/index.js +3 -3
- package/dist/{openworkflow-zD8luED5.js → openworkflow-B-Mkb0RK.js} +2 -2
- package/dist/{operations-C2XbDDDV.js → operations-DfcC--r7.js} +3 -3
- package/dist/operations.js +1 -2
- package/dist/runtime/cloudflare-concurrency.js +1 -1
- package/dist/runtime/cloudflare-runner.js +5 -5
- package/dist/runtime/cloudflare-shared.js +1 -1
- package/dist/runtime/cloudflare-vite.js +2 -2
- package/dist/runtime/execute.js +1 -1
- package/dist/runtime/openworkflow-worker.js +2 -2
- package/dist/runtime/openworkflow.js +1 -1
- package/dist/runtime/state.js +2 -2
- package/dist/runtime/vercel-vite.js +1 -1
- package/dist/{signals-CdaxRNjN.js → signals-DpdrHuD3.js} +1 -1
- package/dist/{vercel-DRezYOUp.js → vercel-5t11Q1sg.js} +2 -2
- package/dist/vite.js +5 -39
- package/package.json +4 -3
|
@@ -1,18 +1,18 @@
|
|
|
1
|
-
import { a as getCloudflareEnv, n as resolveWaitUntil } from "./cloudflare-env-
|
|
2
|
-
import { t as normalizeWorkflowOptions } from "./config-
|
|
1
|
+
import { a as getCloudflareEnv, n as resolveWaitUntil } from "./cloudflare-env-CiI2UtWD.js";
|
|
2
|
+
import { t as normalizeWorkflowOptions } from "./config-BmCUU0cM.js";
|
|
3
3
|
import { n as createWorkflowError } from "./errors-CZf7oz4k.js";
|
|
4
|
-
import { t as workflowErrorDiagnostics } from "./error-diagnostics-
|
|
5
|
-
import { d as encodeNameHex, s as getCloudflareWorkflowBindingName, u as isCloudflareInstanceNotFound } from "./cloudflare-concurrency-counter-
|
|
6
|
-
import { a as toCloudflareStartParams, i as resolveWorkflowStartAt } from "./delay-
|
|
4
|
+
import { t as workflowErrorDiagnostics } from "./error-diagnostics-BDtBsCLZ.js";
|
|
5
|
+
import { d as encodeNameHex, s as getCloudflareWorkflowBindingName, u as isCloudflareInstanceNotFound } from "./cloudflare-concurrency-counter-ClJbAi_S.js";
|
|
6
|
+
import { a as toCloudflareStartParams, i as resolveWorkflowStartAt } from "./delay-p5EJWtCp.js";
|
|
7
7
|
import { t as getWorkflowDevRecorder } from "./dev-recorder-Dltdmlkv.js";
|
|
8
|
-
import { o as runSerializedWorkflowHandler } from "./execute-
|
|
8
|
+
import { o as runSerializedWorkflowHandler } from "./execute-B47oa9GC.js";
|
|
9
9
|
import { cloudflareSignalEventType } from "./runtime/cloudflare-runner.js";
|
|
10
|
-
import { a as getOpenWorkflowRun, d as runOpenWorkflow, t as cancelOpenWorkflowRun, u as resumeOpenWorkflowSignal } from "./openworkflow-
|
|
10
|
+
import { a as getOpenWorkflowRun, d as runOpenWorkflow, t as cancelOpenWorkflowRun, u as resumeOpenWorkflowSignal } from "./openworkflow-B-Mkb0RK.js";
|
|
11
11
|
import { a as safeWorkflowName, i as runWorkflowProviderOperation, t as toWorkflowRunError } from "./run-error-zZh1_IBo.js";
|
|
12
12
|
import { t as emitWorkflowFailed } from "./run-failed-BcSjSU2t.js";
|
|
13
|
-
import { i as readWorkflowSignalToken, o as resumeInlineWorkflowSignal } from "./signals-
|
|
13
|
+
import { i as readWorkflowSignalToken, o as resumeInlineWorkflowSignal } from "./signals-DpdrHuD3.js";
|
|
14
14
|
import { getInlineWorkflowDefinitions, getWorkflowRunState, getWorkflowRuntimeConfig, getWorkflowRuntimeEvent, getWorkflowRuntimeRegistry, loadWorkflowDefinition, registerInlineWorkflowDefinition, runWithWorkflowRuntimeEvent, setWorkflowRun } from "./runtime/state.js";
|
|
15
|
-
import { a as startVercelWorkflow, n as inspectVercelWorkflowRun, r as resumeVercelWorkflowSignal, t as cancelVercelWorkflow } from "./vercel-
|
|
15
|
+
import { a as startVercelWorkflow, n as inspectVercelWorkflowRun, r as resumeVercelWorkflowSignal, t as cancelVercelWorkflow } from "./vercel-5t11Q1sg.js";
|
|
16
16
|
import { getViteHubErrorShape, isRuntimeDiagnostic, toResultError } from "@vite-hub/runtime";
|
|
17
17
|
import { getViteHubTestMode } from "@vite-hub/runtime/internal/test-mode";
|
|
18
18
|
import { deserializeResponse, isSerializedResponse } from "@vite-hub/runtime/internal/response";
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { n as invariantError } from "./invariant-Dj2R1eMr.js";
|
|
2
|
-
import { t as workflowErrorDiagnostics } from "./error-diagnostics-
|
|
2
|
+
import { t as workflowErrorDiagnostics } from "./error-diagnostics-BDtBsCLZ.js";
|
|
3
3
|
// ../internal/src/integrations/hex.ts
|
|
4
4
|
const textEncoder = new TextEncoder();
|
|
5
5
|
new TextDecoder();
|
|
@@ -43,10 +43,6 @@ function getCloudflareEnv(event, options = {}) {
|
|
|
43
43
|
const runtimeGlobal = globalThis;
|
|
44
44
|
const activeEnvStorage = runtimeGlobal[activeEnvStorageKey] ||= new AsyncLocalStorage();
|
|
45
45
|
const globalEnvProbe = Symbol("vitehub.cloudflare.global-env-probe");
|
|
46
|
-
/**
|
|
47
|
-
* Under the Nitro Cloudflare dev server, `cloudflare:workers` exports unenv's env proxy, which reads every key from
|
|
48
|
-
* `globalThis.__env__`. Storing that proxy in `__env__` makes it read itself, and the next read overflows the stack.
|
|
49
|
-
*/
|
|
50
46
|
function readsGlobalEnv(env) {
|
|
51
47
|
const scope = globalThis;
|
|
52
48
|
const owned = Object.hasOwn(scope, "__env__");
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { t as isRecord } from "./object-CAK6UYR5.js";
|
|
2
|
-
import { t as workflowErrorDiagnostics } from "./error-diagnostics-
|
|
2
|
+
import { t as workflowErrorDiagnostics } from "./error-diagnostics-BDtBsCLZ.js";
|
|
3
3
|
import { defu } from "defu";
|
|
4
4
|
/** Maps a host name or a Nitro preset name, such as `cloudflare-module` or `node-server`, to its ViteHub host. */
|
|
5
5
|
function hostFromNitroPreset(value) {
|
package/dist/definition.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { t as isRecord } from "./object-CAK6UYR5.js";
|
|
2
|
-
import { t as workflowErrorDiagnostics } from "./error-diagnostics-
|
|
2
|
+
import { t as workflowErrorDiagnostics } from "./error-diagnostics-BDtBsCLZ.js";
|
|
3
3
|
// src/definition.ts
|
|
4
4
|
const workflowDefinitionKeys = /* @__PURE__ */ new Set([
|
|
5
5
|
"concurrency",
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { t as workflowErrorDiagnostics } from "./error-diagnostics-
|
|
1
|
+
import { t as workflowErrorDiagnostics } from "./error-diagnostics-BDtBsCLZ.js";
|
|
2
2
|
import { parseDuration } from "@vite-hub/runtime";
|
|
3
3
|
// src/runtime/delay.ts
|
|
4
4
|
const maximumTime = 864e13;
|
|
@@ -289,7 +289,7 @@ const workflowErrorDiagnostics = /*#__PURE__*/ defineDiagnostics({
|
|
|
289
289
|
},
|
|
290
290
|
WORKFLOW_RENAMED_PROVIDER_KEY: {
|
|
291
291
|
why: ({ value }) => `\`workflow.provider\` is ${value}. ViteHub renamed this key to \`driver\`, and it does not read \`provider\`, so Workflow would not use the driver you chose.`,
|
|
292
|
-
fix: ({ value }) => `Set \`workflow: { driver: ${value} }
|
|
292
|
+
fix: ({ value }) => `Set \`workflow: { driver: ${value} }\`.`
|
|
293
293
|
},
|
|
294
294
|
WORKFLOW_ROOT_STEP_SIGNAL: {
|
|
295
295
|
why: ({ name }) => `[vitehub] The Workflow ${JSON.stringify(name)} called \`signal.wait()\` in its root step. Only a folder Workflow can wait for a signal: move it to \`server/workflows/${name}/index.ts\` and put the work in numbered step files.`,
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { n as invariantError } from "./invariant-Dj2R1eMr.js";
|
|
2
|
-
import { t as workflowErrorDiagnostics } from "./error-diagnostics-
|
|
2
|
+
import { t as workflowErrorDiagnostics } from "./error-diagnostics-BDtBsCLZ.js";
|
|
3
3
|
import { n as createWorkflowError, r as isNonRetryableError, t as NonRetryableError } from "./errors-CZf7oz4k.js";
|
|
4
4
|
import { t as getWorkflowDevRecorder } from "./dev-recorder-Dltdmlkv.js";
|
|
5
|
-
import { n as createWorkflowSignalToken, r as openInlineWorkflowSignal, s as waitForInlineWorkflowSignal, t as closeInlineWorkflowSignals } from "./signals-
|
|
5
|
+
import { n as createWorkflowSignalToken, r as openInlineWorkflowSignal, s as waitForInlineWorkflowSignal, t as closeInlineWorkflowSignals } from "./signals-DpdrHuD3.js";
|
|
6
6
|
import { t as isRecord } from "./object-CAK6UYR5.js";
|
|
7
7
|
import { isResponse, serializeResponse, toResponse } from "@vite-hub/runtime/internal/response";
|
|
8
8
|
// src/runtime/concurrency.ts
|
package/dist/index.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { defineWorkflow } from "./definition.js";
|
|
2
2
|
import { t as NonRetryableError } from "./errors-CZf7oz4k.js";
|
|
3
|
-
import { s as getCloudflareWorkflowBindingName } from "./cloudflare-concurrency-counter-
|
|
4
|
-
import { a as resumeWorkflow, i as getWorkflowRun, n as createWorkflow, o as startWorkflow, r as deferWorkflow, t as cancelWorkflow } from "./client-
|
|
5
|
-
import { t as workflowErrorDiagnostics } from "./error-diagnostics-
|
|
3
|
+
import { s as getCloudflareWorkflowBindingName } from "./cloudflare-concurrency-counter-ClJbAi_S.js";
|
|
4
|
+
import { a as resumeWorkflow, i as getWorkflowRun, n as createWorkflow, o as startWorkflow, r as deferWorkflow, t as cancelWorkflow } from "./client-EqfVxh7z.js";
|
|
5
|
+
import { t as workflowErrorDiagnostics } from "./error-diagnostics-BDtBsCLZ.js";
|
|
6
6
|
// src/runtime/payload.ts
|
|
7
7
|
/** Reads a JSON body as parsed JSON and any other body as text. The value is not checked: pass it to `validatePayload()`. */
|
|
8
8
|
async function readRequestPayload(request) {
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { n as invariantError } from "./invariant-Dj2R1eMr.js";
|
|
2
|
-
import { d as toNonRetryableStepResult, i as resolveWorkflowStepOptions, n as readNonRetryableStepResult, o as runSerializedWorkflowHandler, p as withWorkflowStepTimeout, u as toDurationMilliseconds } from "./execute-
|
|
2
|
+
import { d as toNonRetryableStepResult, i as resolveWorkflowStepOptions, n as readNonRetryableStepResult, o as runSerializedWorkflowHandler, p as withWorkflowStepTimeout, u as toDurationMilliseconds } from "./execute-B47oa9GC.js";
|
|
3
3
|
import { n as createWorkflowError } from "./errors-CZf7oz4k.js";
|
|
4
4
|
import { i as runWorkflowProviderOperation, n as getWorkflowProviderStatus, t as toWorkflowRunError } from "./run-error-zZh1_IBo.js";
|
|
5
5
|
import { t as emitWorkflowFailed } from "./run-failed-BcSjSU2t.js";
|
|
6
6
|
import { t as resolveOpenWorkflowStorage } from "./openworkflow-storage-Dde_f0es.js";
|
|
7
|
-
import { t as workflowErrorDiagnostics } from "./error-diagnostics-
|
|
7
|
+
import { t as workflowErrorDiagnostics } from "./error-diagnostics-BDtBsCLZ.js";
|
|
8
8
|
import { t as defaultOpenWorkflowSqlitePath } from "./openworkflow-defaults-1n0DbLdb.js";
|
|
9
9
|
import { deserializeResponse, isSerializedResponse } from "@vite-hub/runtime/internal/response";
|
|
10
10
|
// src/runtime/openworkflow-slots.ts
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { n as redactInspectionValue, t as redactInspectionText } from "./inspect-NBCAwsxi.js";
|
|
2
2
|
import { t as isRecord } from "./object-CAK6UYR5.js";
|
|
3
|
-
import { t as workflowErrorDiagnostics } from "./error-diagnostics-
|
|
4
|
-
import { a as resumeWorkflow, i as getWorkflowRun, o as startWorkflow, t as cancelWorkflow } from "./client-
|
|
3
|
+
import { t as workflowErrorDiagnostics } from "./error-diagnostics-BDtBsCLZ.js";
|
|
4
|
+
import { a as resumeWorkflow, i as getWorkflowRun, o as startWorkflow, t as cancelWorkflow } from "./client-EqfVxh7z.js";
|
|
5
5
|
import { t as getWorkflowDevRecorder } from "./dev-recorder-Dltdmlkv.js";
|
|
6
|
-
import { a as getOpenWorkflowRun, i as findOpenWorkflowRuns, s as listOpenWorkflowRuns, t as cancelOpenWorkflowRun } from "./openworkflow-
|
|
6
|
+
import { a as getOpenWorkflowRun, i as findOpenWorkflowRuns, s as listOpenWorkflowRuns, t as cancelOpenWorkflowRun } from "./openworkflow-B-Mkb0RK.js";
|
|
7
7
|
import { t as toWorkflowRunError } from "./run-error-zZh1_IBo.js";
|
|
8
8
|
import { getInlineWorkflowDefinitions, getWorkflowRuntimeConfig, getWorkflowRuntimeRegistry } from "./runtime/state.js";
|
|
9
9
|
import { getViteHubTestMode } from "@vite-hub/runtime/internal/test-mode";
|
package/dist/operations.js
CHANGED
|
@@ -139,7 +139,7 @@ function table(rows) {
|
|
|
139
139
|
return rows.map((row) => row.map((cell, column) => column === row.length - 1 ? cell : cell.padEnd(widths[column])).join(" ")).join("\n");
|
|
140
140
|
}
|
|
141
141
|
// src/operations.ts
|
|
142
|
-
const runtime = () => import("./operations-
|
|
142
|
+
const runtime = () => import("./operations-DfcC--r7.js");
|
|
143
143
|
const name = v.pipe(v.string(), v.check((value) => value.trim() !== "", "Name a Workflow."));
|
|
144
144
|
const runId = v.pipe(v.string(), v.check((value) => value.trim() !== "", "Pass the id of a run."));
|
|
145
145
|
const maxRequestBytes = 1048576;
|
|
@@ -227,7 +227,6 @@ function formatRuns({ runs }) {
|
|
|
227
227
|
function json(value) {
|
|
228
228
|
return JSON.stringify(value ?? null, null, 2);
|
|
229
229
|
}
|
|
230
|
-
/** The steps of a run that `vite dev` recorded. A run of another runtime has no steps. */
|
|
231
230
|
function stepLines(steps) {
|
|
232
231
|
if (!steps) return [];
|
|
233
232
|
if (!steps.length) return ["Steps: none"];
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { i as createCloudflareConcurrencyCounter } from "../cloudflare-concurrency-counter-
|
|
1
|
+
import { i as createCloudflareConcurrencyCounter } from "../cloudflare-concurrency-counter-ClJbAi_S.js";
|
|
2
2
|
import { DurableObject } from "cloudflare:workers";
|
|
3
3
|
// src/runtime/cloudflare-concurrency.ts
|
|
4
4
|
/**
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import { r as runWithActiveCloudflareEnv } from "../cloudflare-env-
|
|
1
|
+
import { r as runWithActiveCloudflareEnv } from "../cloudflare-env-CiI2UtWD.js";
|
|
2
2
|
import { n as createWorkflowError, r as isNonRetryableError } from "../errors-CZf7oz4k.js";
|
|
3
|
-
import { a as createCloudflareConcurrencySlots, s as getCloudflareWorkflowBindingName } from "../cloudflare-concurrency-counter-
|
|
4
|
-
import { t as fromCloudflareStartParams } from "../delay-
|
|
5
|
-
import { i as resolveWorkflowStepOptions, o as runSerializedWorkflowHandler } from "../execute-
|
|
3
|
+
import { a as createCloudflareConcurrencySlots, s as getCloudflareWorkflowBindingName } from "../cloudflare-concurrency-counter-ClJbAi_S.js";
|
|
4
|
+
import { t as fromCloudflareStartParams } from "../delay-p5EJWtCp.js";
|
|
5
|
+
import { i as resolveWorkflowStepOptions, o as runSerializedWorkflowHandler } from "../execute-B47oa9GC.js";
|
|
6
6
|
import { t as emitWorkflowFailed } from "../run-failed-BcSjSU2t.js";
|
|
7
7
|
import { loadWorkflowDefinition, runWithWorkflowRuntimeEvent, setWorkflowRuntimeConfig, setWorkflowRuntimeRegistry } from "./state.js";
|
|
8
|
-
import { t as workflowErrorDiagnostics } from "../error-diagnostics-
|
|
8
|
+
import { t as workflowErrorDiagnostics } from "../error-diagnostics-BDtBsCLZ.js";
|
|
9
9
|
import { hasRunFailedListeners } from "@vite-hub/runtime/internal/run-failed";
|
|
10
10
|
// src/runtime/cloudflare-runner.ts
|
|
11
11
|
function cloudflareSignalEventType(signal) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export { t as createCloudflareRuntimeEvent, r as runWithActiveCloudflareEnv, i as setActiveCloudflareEnv } from "../cloudflare-env-
|
|
1
|
+
export { t as createCloudflareRuntimeEvent, r as runWithActiveCloudflareEnv, i as setActiveCloudflareEnv } from "../cloudflare-env-CiI2UtWD.js";
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { t as resolveAppFetch } from "../app-Cpa9qCXr.js";
|
|
2
|
-
import { t as normalizeWorkflowOptions } from "../config-
|
|
3
|
-
import { r as runWithActiveCloudflareEnv, t as createCloudflareRuntimeEvent } from "../cloudflare-env-
|
|
2
|
+
import { t as normalizeWorkflowOptions } from "../config-BmCUU0cM.js";
|
|
3
|
+
import { r as runWithActiveCloudflareEnv, t as createCloudflareRuntimeEvent } from "../cloudflare-env-CiI2UtWD.js";
|
|
4
4
|
import { runWithWorkflowRuntimeEvent, setWorkflowRuntimeConfig, setWorkflowRuntimeRegistry } from "./state.js";
|
|
5
5
|
import "./cloudflare-shared.js";
|
|
6
6
|
// ../internal/src/runtime/cloudflare-hosted.ts
|
package/dist/runtime/execute.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export { t as createWorkflowSteps, n as readNonRetryableStepResult, r as rejectDirectGeneratedWorkflowCall, i as resolveWorkflowStepOptions, a as runProviderStep, o as runSerializedWorkflowHandler, s as runWorkflowHandler, c as runWorkflowRootStep, l as runWorkflowStepAttempt, u as toDurationMilliseconds, d as toNonRetryableStepResult, f as toStepPropertyName, p as withWorkflowStepTimeout } from "../execute-
|
|
1
|
+
export { t as createWorkflowSteps, n as readNonRetryableStepResult, r as rejectDirectGeneratedWorkflowCall, i as resolveWorkflowStepOptions, a as runProviderStep, o as runSerializedWorkflowHandler, s as runWorkflowHandler, c as runWorkflowRootStep, l as runWorkflowStepAttempt, u as toDurationMilliseconds, d as toNonRetryableStepResult, f as toStepPropertyName, p as withWorkflowStepTimeout } from "../execute-B47oa9GC.js";
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { c as registerOpenWorkflowDefinition, f as setOpenWorkflowDatabaseUrl, n as describeOpenWorkflowStorage, o as getOpenWorkflowRuntime, p as setOpenWorkflowImporter, r as detachOpenWorkflowRuntimes } from "../openworkflow-
|
|
1
|
+
import { c as registerOpenWorkflowDefinition, f as setOpenWorkflowDatabaseUrl, n as describeOpenWorkflowStorage, o as getOpenWorkflowRuntime, p as setOpenWorkflowImporter, r as detachOpenWorkflowRuntimes } from "../openworkflow-B-Mkb0RK.js";
|
|
2
2
|
import { i as runWorkflowProviderOperation } from "../run-error-zZh1_IBo.js";
|
|
3
3
|
import { getWorkflowRuntimeConfig, getWorkflowRuntimeRegistry, loadWorkflowDefinition, setWorkflowRuntimeConfig, setWorkflowRuntimeRegistry } from "./state.js";
|
|
4
4
|
import { n as createWorkflowError } from "../errors-CZf7oz4k.js";
|
|
5
|
-
import { t as workflowErrorDiagnostics } from "../error-diagnostics-
|
|
5
|
+
import { t as workflowErrorDiagnostics } from "../error-diagnostics-BDtBsCLZ.js";
|
|
6
6
|
import { ViteHubError } from "@vite-hub/runtime";
|
|
7
7
|
import { onShutdown } from "@vite-hub/runtime/internal/shutdown";
|
|
8
8
|
// src/runtime/openworkflow-worker.ts
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export { t as cancelOpenWorkflowRun, n as describeOpenWorkflowStorage, r as detachOpenWorkflowRuntimes, i as findOpenWorkflowRuns, a as getOpenWorkflowRun, o as getOpenWorkflowRuntime, s as listOpenWorkflowRuns, c as registerOpenWorkflowDefinition, l as resetOpenWorkflowRuntime, u as resumeOpenWorkflowSignal, d as runOpenWorkflow, f as setOpenWorkflowDatabaseUrl, p as setOpenWorkflowImporter } from "../openworkflow-
|
|
1
|
+
export { t as cancelOpenWorkflowRun, n as describeOpenWorkflowStorage, r as detachOpenWorkflowRuntimes, i as findOpenWorkflowRuns, a as getOpenWorkflowRun, o as getOpenWorkflowRuntime, s as listOpenWorkflowRuns, c as registerOpenWorkflowDefinition, l as resetOpenWorkflowRuntime, u as resumeOpenWorkflowSignal, d as runOpenWorkflow, f as setOpenWorkflowDatabaseUrl, p as setOpenWorkflowImporter } from "../openworkflow-B-Mkb0RK.js";
|
package/dist/runtime/state.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { t as workflowErrorDiagnostics } from "../error-diagnostics-
|
|
1
|
+
import { t as workflowErrorDiagnostics } from "../error-diagnostics-BDtBsCLZ.js";
|
|
2
2
|
import { n as setWorkflowDevRecorder } from "../dev-recorder-Dltdmlkv.js";
|
|
3
|
-
import { a as resetInlineWorkflowSignals } from "../signals-
|
|
3
|
+
import { a as resetInlineWorkflowSignals } from "../signals-DpdrHuD3.js";
|
|
4
4
|
import { AsyncLocalStorage } from "node:async_hooks";
|
|
5
5
|
// src/runtime/state.ts
|
|
6
6
|
const RUNS_LIMIT = 1024;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { t as resolveAppFetch } from "../app-Cpa9qCXr.js";
|
|
2
2
|
import { runWithWorkflowRuntimeEvent, setWorkflowRuntimeConfig, setWorkflowRuntimeRegistry } from "./state.js";
|
|
3
|
-
import { i as setVercelWorkflowRuntimeModules } from "../vercel-
|
|
3
|
+
import { i as setVercelWorkflowRuntimeModules } from "../vercel-5t11Q1sg.js";
|
|
4
4
|
import { waitUntil } from "@vercel/functions";
|
|
5
5
|
import { H3 } from "h3";
|
|
6
6
|
// ../internal/src/runtime/vercel-hosted.ts
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { n as createWorkflowError } from "./errors-CZf7oz4k.js";
|
|
2
|
-
import { s as workflowStartAtKey } from "./delay-
|
|
2
|
+
import { s as workflowStartAtKey } from "./delay-p5EJWtCp.js";
|
|
3
3
|
import { a as safeWorkflowName, i as runWorkflowProviderOperation, r as isWorkflowBoundaryError, t as toWorkflowRunError } from "./run-error-zZh1_IBo.js";
|
|
4
|
-
import { t as workflowErrorDiagnostics } from "./error-diagnostics-
|
|
4
|
+
import { t as workflowErrorDiagnostics } from "./error-diagnostics-BDtBsCLZ.js";
|
|
5
5
|
import { deserializeResponse, isSerializedResponse } from "@vite-hub/runtime/internal/response";
|
|
6
6
|
// src/runtime/vercel.ts
|
|
7
7
|
async function loadVercelWorkflowRuntime() {
|
package/dist/vite.js
CHANGED
|
@@ -3,12 +3,12 @@ import { n as invariantError, t as invariant } from "./invariant-Dj2R1eMr.js";
|
|
|
3
3
|
import { workflowDurabilityUrl } from "./durability.js";
|
|
4
4
|
import { t as internalErrorDiagnostics } from "./error-diagnostics-CsiNo_oI.js";
|
|
5
5
|
import { n as isRecordOrFunction, t as isRecord } from "./object-CAK6UYR5.js";
|
|
6
|
-
import { n as getHostingProvider, r as normalizeHosting, t as normalizeWorkflowOptions } from "./config-
|
|
6
|
+
import { n as getHostingProvider, r as normalizeHosting, t as normalizeWorkflowOptions } from "./config-BmCUU0cM.js";
|
|
7
7
|
import { r as relativeDefinitionFile } from "./inspect-NBCAwsxi.js";
|
|
8
|
-
import { c as getCloudflareWorkflowClassName, l as getLegacyCloudflareWorkflowClassName, n as cloudflareConcurrencyClassName, o as createCloudflareWorkflowBindings, r as cloudflareConcurrencyMigrationTag, t as cloudflareConcurrencyBinding } from "./cloudflare-concurrency-counter-
|
|
9
|
-
import { t as workflowErrorDiagnostics } from "./error-diagnostics-
|
|
10
|
-
import { f as toStepPropertyName, i as resolveWorkflowStepOptions } from "./execute-
|
|
11
|
-
import { n as generatedNativeEntryKey, o as vercelNativeRegistryKey, r as generatedNativeRootStepKey, s as workflowStartAtKey } from "./delay-
|
|
8
|
+
import { c as getCloudflareWorkflowClassName, l as getLegacyCloudflareWorkflowClassName, n as cloudflareConcurrencyClassName, o as createCloudflareWorkflowBindings, r as cloudflareConcurrencyMigrationTag, t as cloudflareConcurrencyBinding } from "./cloudflare-concurrency-counter-ClJbAi_S.js";
|
|
9
|
+
import { t as workflowErrorDiagnostics } from "./error-diagnostics-BDtBsCLZ.js";
|
|
10
|
+
import { f as toStepPropertyName, i as resolveWorkflowStepOptions } from "./execute-B47oa9GC.js";
|
|
11
|
+
import { n as generatedNativeEntryKey, o as vercelNativeRegistryKey, r as generatedNativeRootStepKey, s as workflowStartAtKey } from "./delay-p5EJWtCp.js";
|
|
12
12
|
import { t as defaultOpenWorkflowSqlitePath } from "./openworkflow-defaults-1n0DbLdb.js";
|
|
13
13
|
import { builtinModules, createRequire, isBuiltin } from "node:module";
|
|
14
14
|
import { dirname, normalize, relative, resolve } from "pathe";
|
|
@@ -419,11 +419,9 @@ function isRelativeSpecifier(path) {
|
|
|
419
419
|
function isBareSpecifier(id) {
|
|
420
420
|
return !/^(?:\.{1,2}(?:[\\/]|$)|[\\/]|[A-Za-z]:[\\/]|\0|#|[a-z][a-z0-9+.-]*:)/i.test(id);
|
|
421
421
|
}
|
|
422
|
-
/** The folder that a relative import of `importer` resolves from, as esbuild's `resolveDir`. */
|
|
423
422
|
function importerDir(importer, workingDir) {
|
|
424
423
|
return importer && isAbsolute(importer) ? dirname$1(importer) : workingDir;
|
|
425
424
|
}
|
|
426
|
-
/** Rolldown resolves a specifier from an importer file. A bundle entry has none, so use a file in the working folder. */
|
|
427
425
|
function importerFor(importer, workingDir) {
|
|
428
426
|
return importer ?? join(workingDir, "__vitehub_entry__.js");
|
|
429
427
|
}
|
|
@@ -456,11 +454,6 @@ function collectPackageExportCandidates(packageName, exportsValue, packageRelati
|
|
|
456
454
|
}
|
|
457
455
|
return candidates;
|
|
458
456
|
}
|
|
459
|
-
/**
|
|
460
|
-
* Resolves `specifier` from a resolveId hook without running that hook again. `flag` in `custom` also skips the hook in
|
|
461
|
-
* resolutions that other plugins start from this one. `skipSelf` is still needed: when two equal resolutions run at the
|
|
462
|
-
* same time, Rolldown 1.2 can give one of them no `custom`, and the hook would then wait on its own resolution.
|
|
463
|
-
*/
|
|
464
457
|
function resolveFrom(context, specifier, request, workingDir, flag) {
|
|
465
458
|
return context.resolve(specifier, importerFor(request.importer, workingDir), {
|
|
466
459
|
custom: {
|
|
@@ -777,9 +770,6 @@ function createWasmModulePlugin(outdir, workingDir, copy) {
|
|
|
777
770
|
}
|
|
778
771
|
};
|
|
779
772
|
}
|
|
780
|
-
/**
|
|
781
|
-
* Leaves package imports external. Resolve package.json import mappings first, and preserve unmapped host imports.
|
|
782
|
-
*/
|
|
783
773
|
function createExternalPackagesPlugin() {
|
|
784
774
|
return {
|
|
785
775
|
name: "vitehub-external-packages",
|
|
@@ -865,7 +855,6 @@ function createOptionalImportPlugin() {
|
|
|
865
855
|
}
|
|
866
856
|
};
|
|
867
857
|
}
|
|
868
|
-
/** Matches import paths as esbuild's `external` does: `*` is a wildcard, and a package name also matches its subpaths. */
|
|
869
858
|
function createExternalMatcher(patterns) {
|
|
870
859
|
if (!patterns?.length) return;
|
|
871
860
|
const matchers = patterns.map((pattern) => {
|
|
@@ -877,7 +866,6 @@ function createExternalMatcher(patterns) {
|
|
|
877
866
|
});
|
|
878
867
|
return (id) => matchers.some((matches) => matches(id));
|
|
879
868
|
}
|
|
880
|
-
/** Returns the modules of the chunks that no chunk loaded from the entry chunk imports. */
|
|
881
869
|
function findUnusedChunkModules(chunks) {
|
|
882
870
|
const used = new Set(chunks.filter((chunk) => chunk.isEntry));
|
|
883
871
|
for (const chunk of used) for (const other of chunks) if (!used.has(other) && chunk.code.includes(other.fileName)) used.add(other);
|
|
@@ -3230,7 +3218,6 @@ async function copyRetainedSourceTree(source, target, filter) {
|
|
|
3230
3218
|
}
|
|
3231
3219
|
await copyEntry(source, target, false);
|
|
3232
3220
|
}
|
|
3233
|
-
/** Copies a file or folder and follows links. `node_modules` folders and paths that disappear during the copy are skipped. */
|
|
3234
3221
|
async function copyTree(source, target) {
|
|
3235
3222
|
const info = await unlessGone(() => stat(source));
|
|
3236
3223
|
if (!info) return;
|
|
@@ -3508,16 +3495,11 @@ function objectProperties(object) {
|
|
|
3508
3495
|
function findProperty(object, name) {
|
|
3509
3496
|
return objectProperties(object).findLast((property) => property.key === name);
|
|
3510
3497
|
}
|
|
3511
|
-
/** The value of a template literal without substitutions. */
|
|
3512
3498
|
function staticTemplate(node) {
|
|
3513
3499
|
if (node.expressions.length) return dynamic;
|
|
3514
3500
|
return node.quasis[0]?.value.cooked ?? dynamic;
|
|
3515
3501
|
}
|
|
3516
3502
|
const escapePattern = /\\(u\{[^}]*\}?|u[\s\S]{0,4}|x[\s\S]{0,2}|0\d|[\s\S])/g;
|
|
3517
|
-
/**
|
|
3518
|
-
* True when a string literal has an escape that strict mode code rejects. The parser recovers from some bad escapes
|
|
3519
|
-
* and accepts legacy octal escapes, so the scanner checks them again.
|
|
3520
|
-
*/
|
|
3521
3503
|
function hasInvalidEscape(raw) {
|
|
3522
3504
|
for (const [, escape = ""] of raw.matchAll(escapePattern)) if (escape.startsWith("u{")) {
|
|
3523
3505
|
const code = escape.slice(2, -1);
|
|
@@ -3578,7 +3560,6 @@ function staticValue(node) {
|
|
|
3578
3560
|
function isLineTerminator(char) {
|
|
3579
3561
|
return char === "\n" || char === "\r" || char === "\u2028" || char === "\u2029";
|
|
3580
3562
|
}
|
|
3581
|
-
/** Comments, JSX text, and string, template, and regular expression literals, sorted by position. Templates are not split. */
|
|
3582
3563
|
function literalSpans(module) {
|
|
3583
3564
|
const spans = module.comments.map((comment) => ({
|
|
3584
3565
|
end: comment.end,
|
|
@@ -3668,7 +3649,6 @@ async function rebasePublishedProviderSourceLinks(stagedSourcesDir, retainedSour
|
|
|
3668
3649
|
};
|
|
3669
3650
|
await visit(stagedSourcesDir);
|
|
3670
3651
|
}
|
|
3671
|
-
/** Lists the existing published source paths that `contents` names, in every form that the rewrite reads. */
|
|
3672
3652
|
function referencedProviderSourcePaths(contents, publishedSourcesDir) {
|
|
3673
3653
|
const prefixes = [{
|
|
3674
3654
|
decode: (path) => path,
|
|
@@ -3694,9 +3674,7 @@ function referencedProviderSourcePaths(contents, publishedSourcesDir) {
|
|
|
3694
3674
|
}
|
|
3695
3675
|
return [...references].filter((reference) => ![...references].some((parent) => parent !== reference && pathContains$1(parent, reference)));
|
|
3696
3676
|
}
|
|
3697
|
-
/** Dotenv files (`.env*`, Wrangler `.dev.vars*`), registry credentials, and Wrangler state hold local secrets. */
|
|
3698
3677
|
const localSecretFile$1 = /^(?:\.env|\.dev\.vars)(?:\..*)?$|^\.(?:netrc|npmrc|wrangler)$/;
|
|
3699
|
-
/** A retained snapshot and a deployment never receive local secret files, even inside a directory that the code names. */
|
|
3700
3678
|
function isLocalSecretFile(path) {
|
|
3701
3679
|
return localSecretFile$1.test(basename(path));
|
|
3702
3680
|
}
|
|
@@ -3804,10 +3782,6 @@ function pathContains$1(parent, child) {
|
|
|
3804
3782
|
const nested = relative$1(parent, child);
|
|
3805
3783
|
return !nested || !nested.startsWith(`..${sep}`) && nested !== ".." && !isAbsolute(nested);
|
|
3806
3784
|
}
|
|
3807
|
-
/**
|
|
3808
|
-
* Creates a check that tells whether a path belongs to a dependency: a named package installed under `node_modules`,
|
|
3809
|
-
* or a named package outside the configured roots, such as a linked workspace package.
|
|
3810
|
-
*/
|
|
3811
3785
|
function createDependencySourceCheck(roots) {
|
|
3812
3786
|
const namedPackages = /* @__PURE__ */ new Map();
|
|
3813
3787
|
const isNamedPackage = (directory) => {
|
|
@@ -3955,7 +3929,6 @@ function resolveComputedModuleSource(file, specifier, resolveFrom = file) {
|
|
|
3955
3929
|
return;
|
|
3956
3930
|
}
|
|
3957
3931
|
}
|
|
3958
|
-
/** The index of the delimiter that closes the one at `open`. `masked` has no literals or comments. */
|
|
3959
3932
|
function matchingDelimiter(masked, open) {
|
|
3960
3933
|
let depth = 0;
|
|
3961
3934
|
for (let index = open; index < masked.length; index++) {
|
|
@@ -3964,7 +3937,6 @@ function matchingDelimiter(masked, open) {
|
|
|
3964
3937
|
else if ((char === ")" || char === "]" || char === "}") && --depth === 0) return index;
|
|
3965
3938
|
}
|
|
3966
3939
|
}
|
|
3967
|
-
/** Splits `source.slice(start, end)` at top-level commas. */
|
|
3968
3940
|
function splitTopLevel(source, masked, start, end) {
|
|
3969
3941
|
const parts = [];
|
|
3970
3942
|
let depth = 0;
|
|
@@ -4368,12 +4340,6 @@ function packageMetadataSourcesForPath(root, path) {
|
|
|
4368
4340
|
}
|
|
4369
4341
|
return sources;
|
|
4370
4342
|
}
|
|
4371
|
-
/**
|
|
4372
|
-
* Generated Provider Output can import a package by the physical pnpm store path
|
|
4373
|
-
* that Vite resolved during the source build. Retained source trees do not copy
|
|
4374
|
-
* `node_modules/.pnpm`, so keep only the store package directories that the
|
|
4375
|
-
* traced source graph actually references.
|
|
4376
|
-
*/
|
|
4377
4343
|
function pnpmStorePackageRoot(root, source) {
|
|
4378
4344
|
const segments = relative$1(root, source).split(sep);
|
|
4379
4345
|
let nodeModulesIndex = -1;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@vite-hub/workflow",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.9.0",
|
|
4
4
|
"description": "Workflow primitives and Vite integration for ViteHub.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"background-jobs",
|
|
@@ -65,7 +65,7 @@
|
|
|
65
65
|
},
|
|
66
66
|
"dependencies": {
|
|
67
67
|
"@valibot/to-json-schema": "^1.8.0",
|
|
68
|
-
"@vite-hub/runtime": "0.
|
|
68
|
+
"@vite-hub/runtime": "0.9.0",
|
|
69
69
|
"defu": "^6.1.7",
|
|
70
70
|
"esbuild": "^0.28.2",
|
|
71
71
|
"h3": "^2.0.8",
|
|
@@ -80,6 +80,7 @@
|
|
|
80
80
|
"@types/node": "^24.19.2",
|
|
81
81
|
"@vercel/functions": "^3.11.3",
|
|
82
82
|
"@vite-hub/internal": "0.0.1",
|
|
83
|
+
"fast-check": "^4.11.0",
|
|
83
84
|
"publint": "^0.3.25",
|
|
84
85
|
"typescript": "^6.0.3",
|
|
85
86
|
"vite": "^8.3.8",
|
|
@@ -88,7 +89,7 @@
|
|
|
88
89
|
},
|
|
89
90
|
"peerDependencies": {
|
|
90
91
|
"@vercel/functions": "^3.11.3",
|
|
91
|
-
"@vite-hub/database": "0.
|
|
92
|
+
"@vite-hub/database": "0.9.0",
|
|
92
93
|
"@workflow/builders": "^5.1.4",
|
|
93
94
|
"vite": ">=8.0.0",
|
|
94
95
|
"workflow": "^5.7.1"
|