@vite-hub/workflow 0.1.0 → 0.3.1
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 +144 -43
- package/dist/{app-CzPoP84f.js → app-CmMq8l4t.js} +1 -1
- package/dist/client-CU5rELC0.js +658 -0
- package/dist/{cloudflare-nF4abPd4.js → cloudflare-BfFnNWB0.js} +2 -2
- package/dist/{cloudflare-env-BNrYo29x.js → cloudflare-env-CGLx7lUd.js} +44 -42
- package/dist/cloudflare-env-lookup-CfX6wZKb.d.ts +4 -0
- package/dist/{cloudflare-env-CIjdFTv6.d.ts → cloudflare-shared-CTqh_a2s.d.ts} +2 -2
- package/dist/{config-IJMb0eeZ.js → config-DCvRDlxA.js} +41 -40
- package/dist/definition.d.ts +19 -0
- package/dist/definition.js +31 -0
- package/dist/delay--ESDybVT.js +81 -0
- package/dist/dev-recorder-CTN5Fkao.js +10 -0
- package/dist/durability.d.ts +23 -0
- package/dist/durability.js +62 -0
- package/dist/error-diagnostics-8YNJ37rP.js +286 -0
- package/dist/error-diagnostics-DSkCJC_L.js +266 -0
- package/dist/errors-DCqRnZpN.js +35 -0
- package/dist/errors-DVwFb6Fd.d.ts +56 -0
- package/dist/index.d.ts +13 -60
- package/dist/index.js +6 -17
- package/dist/object-Da1zyPCR.js +11 -0
- package/dist/openworkflow-TEaNk0LV.d.ts +50 -0
- package/dist/openworkflow-defaults-DDig2M4s.js +26 -0
- package/dist/openworkflow-storage-Dj9zUAsk.js +28 -0
- package/dist/openworkflow.d.ts +2 -0
- package/dist/openworkflow.js +2 -0
- package/dist/{operations-tNUdj3G4.d.ts → operation-definition-8gOe-ubD.d.ts} +37 -15
- package/dist/operations-B0L8kV5s.js +329 -0
- package/dist/operations.d.ts +40 -6
- package/dist/operations.js +163 -736
- package/dist/{out-CsaJxg8m.js → out-fRNaVslw.js} +31 -1429
- package/dist/run-error-DBWqiJHH.js +110 -0
- package/dist/runtime/cloudflare-runner.d.ts +3 -5
- package/dist/runtime/cloudflare-runner.js +24 -42
- package/dist/runtime/cloudflare-shared.d.ts +2 -2
- package/dist/runtime/cloudflare-shared.js +1 -1
- package/dist/runtime/cloudflare-vite.d.ts +3 -2
- package/dist/runtime/cloudflare-vite.js +47 -1
- package/dist/runtime/dev-runs.d.ts +4 -0
- package/dist/runtime/dev-runs.js +73 -0
- package/dist/runtime/execute.d.ts +20 -4
- package/dist/runtime/execute.js +118 -12
- package/dist/runtime/openworkflow-worker.d.ts +29 -2
- package/dist/runtime/openworkflow-worker.js +156 -38
- package/dist/runtime/openworkflow.d.ts +2 -21
- package/dist/runtime/openworkflow.js +273 -36
- package/dist/runtime/state.d.ts +3 -1
- package/dist/runtime/state.js +11 -7
- package/dist/runtime/vercel-vite.d.ts +1 -1
- package/dist/runtime/vercel-vite.js +7 -4
- package/dist/types-CnKVDnEp.d.ts +241 -0
- package/dist/{vercel-D-ZNtB_u.js → vercel-BZU_O6ay.js} +51 -22
- package/dist/vite.d.ts +219 -27
- package/dist/vite.js +1787 -1183
- package/package.json +28 -50
- package/dist/client-DsGM3M4U.js +0 -389
- package/dist/cloudflare-shared-CaxrMD1A.d.ts +0 -1
- package/dist/cloudflare-vite-B3IabBsv.js +0 -47
- package/dist/error-diagnostics-A_8Kp-48.js +0 -116
- package/dist/error-diagnostics-pwNFvAHP.js +0 -67
- package/dist/operations-B_rYG71W.js +0 -230
- package/dist/provider-operation-CW2cYfVy.js +0 -65
- package/dist/runtime-type-DBCvIh5x.js +0 -7
- package/dist/types-D82WmfZa.d.ts +0 -180
package/dist/vite.d.ts
CHANGED
|
@@ -1,7 +1,19 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { n as OperationContributionEntry } from "./
|
|
3
|
-
import { Plugin } from "
|
|
4
|
-
import { Plugin as Plugin$1
|
|
1
|
+
import { C as WorkflowOptions, i as DiscoveredWorkflowDefinition } from "./types-CnKVDnEp.js";
|
|
2
|
+
import { n as OperationContributionEntry } from "./operation-definition-8gOe-ubD.js";
|
|
3
|
+
import { Plugin, ResolvedConfig, UserConfig } from "vite";
|
|
4
|
+
import { Plugin as Plugin$1 } from "esbuild";
|
|
5
|
+
//#region src/internal/runtime-modules.d.ts
|
|
6
|
+
type WorkflowRuntimeModuleName = "cloudflare-runner" | "cloudflare-vite" | "dev-runs" | "execute" | "openworkflow-worker" | "state" | "vercel-vite";
|
|
7
|
+
/**
|
|
8
|
+
* The file path of a Workflow runtime module. Generated code imports it by path, so it needs no package export.
|
|
9
|
+
* Schedule and Agent output receive these paths from the Workflow plugin.
|
|
10
|
+
*/
|
|
11
|
+
export declare function workflowRuntimeModule(name: WorkflowRuntimeModuleName): string;
|
|
12
|
+
//#endregion
|
|
13
|
+
//#region ../internal/src/deployment.d.ts
|
|
14
|
+
/** The host that ViteHub builds for: the `host` option of `vitehub()` and the value of `VITEHUB_HOST`. */
|
|
15
|
+
type ViteHubHost = "cloudflare" | "deno" | "netlify" | "node" | "vercel";
|
|
16
|
+
//#endregion
|
|
5
17
|
//#region ../internal/src/inspect.d.ts
|
|
6
18
|
interface ViteHubDefinitionField {
|
|
7
19
|
label: string;
|
|
@@ -28,18 +40,122 @@ interface ViteHubProviderOutputEntry {
|
|
|
28
40
|
/** Absolute path. */
|
|
29
41
|
path: string;
|
|
30
42
|
}
|
|
43
|
+
/**
|
|
44
|
+
* Where an inspected resource id came from. `name` means the host binds the resource by its name and needs no id.
|
|
45
|
+
* The CLI sets `provider-output` when only a generated Wrangler config names the id.
|
|
46
|
+
*/
|
|
47
|
+
type ViteHubResourceIdSource = "config" | "env" | "name" | "provider-output" | "provision-state";
|
|
48
|
+
/** One host resource that a Definition or store maps to. Owner packages read only local config and Provision State. */
|
|
49
|
+
interface ViteHubResourceSummary {
|
|
50
|
+
/** Cloudflare binding name, so the CLI can find the id in generated Wrangler config. */
|
|
51
|
+
binding?: string;
|
|
52
|
+
/** Definition or store name. */
|
|
53
|
+
definition: string;
|
|
54
|
+
/** Env variable that supplied the id when `source` is `env`. */
|
|
55
|
+
env?: string;
|
|
56
|
+
host: "cloudflare" | "vercel";
|
|
57
|
+
id?: string;
|
|
58
|
+
/** Same resource kind names as Provision actions, for example `cloudflare-d1`. */
|
|
59
|
+
kind: string;
|
|
60
|
+
/** Resource name on the host, when the config names it. */
|
|
61
|
+
name?: string;
|
|
62
|
+
/** Explains how the host finds the resource when no id or name is known locally. */
|
|
63
|
+
note?: string;
|
|
64
|
+
owner: string;
|
|
65
|
+
/** Absent when no id is known yet. */
|
|
66
|
+
source?: ViteHubResourceIdSource;
|
|
67
|
+
}
|
|
31
68
|
interface ViteHubInspectionContributor {
|
|
32
69
|
definitions?: readonly ViteHubDefinitionInspector[];
|
|
33
70
|
providerOutput?: readonly ViteHubProviderOutputEntry[];
|
|
71
|
+
resources?: () => readonly ViteHubResourceSummary[] | Promise<readonly ViteHubResourceSummary[]>;
|
|
34
72
|
}
|
|
35
73
|
type ViteHubInspectionContributorFactory = () => ViteHubInspectionContributor | undefined | Promise<ViteHubInspectionContributor | undefined>;
|
|
36
74
|
interface ViteHubInspectionPluginMetadata {
|
|
37
75
|
inspect?: ViteHubInspectionContributor | ViteHubInspectionContributorFactory;
|
|
38
76
|
}
|
|
39
77
|
//#endregion
|
|
78
|
+
//#region ../internal/src/build/deployment-plan-output.d.ts
|
|
79
|
+
/**
|
|
80
|
+
* One set of host variables that the deployed app reads, as `deployment.json` lists it: a Server Env declaration, or
|
|
81
|
+
* a variable that a primitive reads itself, such as `VITEHUB_SECRET` or `BLOB_READ_WRITE_TOKEN`.
|
|
82
|
+
* It holds names only, so `vitehub deploy` can check the host without booting Vite. It never holds a value.
|
|
83
|
+
*/
|
|
84
|
+
interface DeploymentEnvEntry {
|
|
85
|
+
/** The declaration path, such as `env.server.github.token`, when it is safe to show. Primitive entries have none. */
|
|
86
|
+
path?: string;
|
|
87
|
+
/** The host variable names, in read order. The first name that is set supplies the value. */
|
|
88
|
+
names: readonly string[];
|
|
89
|
+
/** Any variable whose name starts with this prefix supplies the value, such as `VITEHUB_CONSOLE_KEY_`. */
|
|
90
|
+
prefix?: string;
|
|
91
|
+
required: boolean;
|
|
92
|
+
secret: boolean;
|
|
93
|
+
/** A default supplies the value when no name is set. */
|
|
94
|
+
hasDefault: boolean;
|
|
95
|
+
/** The primitives that read these names, such as `blob`. Server Env declarations have none. */
|
|
96
|
+
owners?: readonly string[];
|
|
97
|
+
}
|
|
98
|
+
/** What a primitive needs to know to name the variables it reads in the deployed app. */
|
|
99
|
+
interface DeploymentEnvContext {
|
|
100
|
+
host: ViteHubHost;
|
|
101
|
+
}
|
|
102
|
+
/**
|
|
103
|
+
* The host variables that a primitive reads itself, outside the Server Env registry, for one host and its resolved
|
|
104
|
+
* config. A Vite plugin exposes it as `api.deploymentEnv`, and the build writes the result to `deployment.json`.
|
|
105
|
+
* Return names only, never values.
|
|
106
|
+
*/
|
|
107
|
+
type DeploymentEnvContribution = (context: DeploymentEnvContext) => readonly DeploymentEnvEntry[];
|
|
108
|
+
//#endregion
|
|
109
|
+
//#region ../internal/src/durability.d.ts
|
|
110
|
+
/**
|
|
111
|
+
* One durability reporter that a primitive's Vite plugin contributes through `vitehub.durability`. The Node server
|
|
112
|
+
* imports `export` from `module` at boot and calls it with `input` and the server environment. It returns the
|
|
113
|
+
* `Durability` lines of `@vite-hub/runtime/durability`.
|
|
114
|
+
*/
|
|
115
|
+
interface DurabilityContribution {
|
|
116
|
+
/** The primitive that the reporter describes, such as `kv`. Other reporters find its result by this id. */
|
|
117
|
+
primitive: string;
|
|
118
|
+
/** The absolute file of the reporter module. */
|
|
119
|
+
module: string;
|
|
120
|
+
export: string;
|
|
121
|
+
/**
|
|
122
|
+
* The resolved configuration of the primitive, as plain JSON data. The build writes it into the server with
|
|
123
|
+
* `JSON.stringify`, so do not put credentials here.
|
|
124
|
+
*/
|
|
125
|
+
input: unknown;
|
|
126
|
+
}
|
|
127
|
+
/** The `vitehub.durability` field of a primitive's Vite plugin. */
|
|
128
|
+
interface DurabilityPluginMetadata {
|
|
129
|
+
/** Called after Vite resolves the config. Return an empty list when the primitive is off. */
|
|
130
|
+
durability?: () => readonly DurabilityContribution[];
|
|
131
|
+
}
|
|
132
|
+
//#endregion
|
|
133
|
+
//#region ../internal/src/build/vite.d.ts
|
|
134
|
+
interface ProviderOutputEnvironmentOwner {
|
|
135
|
+
/** Install as the plugin's `buildApp` hook. */
|
|
136
|
+
buildApp: (builder: {
|
|
137
|
+
environments: Record<string, {
|
|
138
|
+
isBuilt: boolean;
|
|
139
|
+
}>;
|
|
140
|
+
}) => Promise<void>;
|
|
141
|
+
/** Install as the plugin's `nitro` module. */
|
|
142
|
+
nitro: {
|
|
143
|
+
name: string;
|
|
144
|
+
setup: (nitro: {
|
|
145
|
+
options: {
|
|
146
|
+
static?: boolean;
|
|
147
|
+
};
|
|
148
|
+
}) => void;
|
|
149
|
+
};
|
|
150
|
+
/** Whether a later environment of the same Vite build writes Provider Output. */
|
|
151
|
+
defers: (context: {
|
|
152
|
+
environment?: object;
|
|
153
|
+
} | undefined) => boolean;
|
|
154
|
+
}
|
|
155
|
+
//#endregion
|
|
40
156
|
//#region src/discovery.d.ts
|
|
41
157
|
export declare function discoverWorkflowDefinitions(options: {
|
|
42
|
-
mode?: "vite-suffix";
|
|
158
|
+
mode?: "vite-suffix" | "standalone";
|
|
43
159
|
rootDir: string;
|
|
44
160
|
scanDirs?: string[];
|
|
45
161
|
serverDirs?: string[];
|
|
@@ -48,6 +164,10 @@ export declare function discoverWorkflowDefinitions(options: {
|
|
|
48
164
|
scanDirs: string[];
|
|
49
165
|
}): DiscoveredWorkflowDefinition[];
|
|
50
166
|
//#endregion
|
|
167
|
+
//#region src/internal/registry-types.d.ts
|
|
168
|
+
/** Types `steps` in `defineWorkflow(name, handler)` with the step files of each folder Workflow. */
|
|
169
|
+
export declare function createWorkflowTypes(file: string, definitions: DiscoveredWorkflowDefinition[], importBase?: string): string;
|
|
170
|
+
//#endregion
|
|
51
171
|
//#region ../internal/src/console.d.ts
|
|
52
172
|
type MaybePromise<T> = T | Promise<T>;
|
|
53
173
|
/** Lists discovered Definitions in a sidebar and shows the selected Definition's fields. */
|
|
@@ -56,7 +176,15 @@ interface ViteHubConsoleDefinitionCatalogView {
|
|
|
56
176
|
/** States which runtime data this catalog does not include. */
|
|
57
177
|
notice: string;
|
|
58
178
|
}
|
|
179
|
+
/** Lists Workspace Definitions like a catalog, and browses the refs, revisions, and files of the selected one. */
|
|
180
|
+
interface ViteHubConsoleWorkspaceBrowserView {
|
|
181
|
+
kind: "workspace-browser";
|
|
182
|
+
/** States which runtime data the browser does not include. */
|
|
183
|
+
notice: string;
|
|
184
|
+
}
|
|
59
185
|
interface ViteHubConsoleRecordColumn {
|
|
186
|
+
/** Set it for a column with few values, such as a status. The Console then filters the table by its values. */
|
|
187
|
+
filter?: boolean;
|
|
60
188
|
/** Key in `ViteHubConsoleRecord.cells`. */
|
|
61
189
|
key: string;
|
|
62
190
|
label: string;
|
|
@@ -81,8 +209,42 @@ interface ViteHubConsoleOperationColumn {
|
|
|
81
209
|
/** Dot path into each item of the result, such as `author.name` or `messages.0.body`. */
|
|
82
210
|
key: string;
|
|
83
211
|
label: string;
|
|
84
|
-
/**
|
|
85
|
-
|
|
212
|
+
/**
|
|
213
|
+
* `datetime` shows a time in milliseconds since the epoch as a relative date, such as `5m ago`. `excerpt` cuts a long
|
|
214
|
+
* text. `status` shows the value as a status with a colored dot, such as `Open`. `tones` picks the color of each value.
|
|
215
|
+
* `switch` shows a boolean as a switch that calls the `switch` operation.
|
|
216
|
+
*/
|
|
217
|
+
format?: "datetime" | "excerpt" | "status" | "switch";
|
|
218
|
+
/** The color of each value of a `status` column, such as `{ open: "info", resolved: "success" }`. Other values are neutral. */
|
|
219
|
+
tones?: Readonly<Record<string, "error" | "info" | "neutral" | "success" | "warning">>;
|
|
220
|
+
/**
|
|
221
|
+
* What a `switch` column calls when the user flips it: `operation` with an input that maps each key of `input` to a
|
|
222
|
+
* dot path of the item, and the column `key` to the new value. `{ operation: "skills.set", input: { name: "name" } }`
|
|
223
|
+
* on the column `enabled` calls `skills.set` with `{ name, enabled }`, then loads the list again. A user who may only
|
|
224
|
+
* read the section sees the switch disabled.
|
|
225
|
+
*/
|
|
226
|
+
switch?: {
|
|
227
|
+
operation: string;
|
|
228
|
+
input: Readonly<Record<string, string>>;
|
|
229
|
+
};
|
|
230
|
+
}
|
|
231
|
+
/**
|
|
232
|
+
* A button on each row that calls `operation` with the Console user, then loads the list again. `input` maps each input
|
|
233
|
+
* key to a dot path of the item, as a `switch` column does.
|
|
234
|
+
*/
|
|
235
|
+
interface ViteHubConsoleOperationAction {
|
|
236
|
+
label: string;
|
|
237
|
+
operation: string;
|
|
238
|
+
input: Readonly<Record<string, string>>;
|
|
239
|
+
/**
|
|
240
|
+
* The result is `{ url }`, such as a one-time link or a provider sign-in: the Console opens it in a new tab, and loads
|
|
241
|
+
* the list again when the person comes back. The URL must be `https:`, or `http:` on a loopback host.
|
|
242
|
+
*/
|
|
243
|
+
tab?: true;
|
|
244
|
+
/** Show the button only on rows where each dot path holds one of the listed values. */
|
|
245
|
+
when?: Readonly<Record<string, readonly string[]>>;
|
|
246
|
+
/** Ask this question before the call. `{path}` takes a value from the item. */
|
|
247
|
+
confirm?: string;
|
|
86
248
|
}
|
|
87
249
|
/** A chip above the list. Choosing it merges `input` into the operation input. The first chip is the default. */
|
|
88
250
|
interface ViteHubConsoleOperationFilter {
|
|
@@ -96,13 +258,24 @@ interface ViteHubConsoleOperationFilter {
|
|
|
96
258
|
* array of objects with an `id`. A failure of the operation, with its `fix`, shows where the list would be.
|
|
97
259
|
*/
|
|
98
260
|
interface ViteHubConsoleOperationView {
|
|
261
|
+
/** Buttons on each row. A user who may only read the section does not see them. */
|
|
262
|
+
actions?: readonly ViteHubConsoleOperationAction[];
|
|
99
263
|
columns: readonly ViteHubConsoleOperationColumn[];
|
|
264
|
+
/**
|
|
265
|
+
* Opens the item of a row in a side panel. `comment-thread` shows an item of `comments.list` as a comment thread
|
|
266
|
+
* where the user reads, replies, resolves, reopens, and mentions people. The panel calls the `comments.*` operations
|
|
267
|
+
* with the Console user, and `?thread=<id>` in the URL opens it.
|
|
268
|
+
*/
|
|
269
|
+
detail?: {
|
|
270
|
+
kind: "comment-thread";
|
|
271
|
+
};
|
|
100
272
|
filters?: readonly ViteHubConsoleOperationFilter[];
|
|
101
273
|
kind: "operation-view";
|
|
102
274
|
/**
|
|
103
275
|
* Makes each row a link: `{path}` placeholders take values from the item and are URL-encoded, and `{path:path}` takes an
|
|
104
|
-
* app path and encodes each segment (a value that is not an app path, such as `//evil.com/x`, gives no link).
|
|
105
|
-
* `
|
|
276
|
+
* app path and encodes each segment (a value that is not an app path, such as `//evil.com/x`, gives no link).
|
|
277
|
+
* `{path:href}` takes an app URL that is already encoded, with its query, as it is. Rows where `when.path` is not
|
|
278
|
+
* `when.equals` get none.
|
|
106
279
|
*/
|
|
107
280
|
link?: {
|
|
108
281
|
label?: string;
|
|
@@ -126,7 +299,17 @@ interface ViteHubConsoleAuthView {
|
|
|
126
299
|
notice: string;
|
|
127
300
|
}
|
|
128
301
|
interface ViteHubConsoleAuthSection extends ViteHubConsoleSectionDescriptor<ViteHubConsoleAuthView> {}
|
|
129
|
-
|
|
302
|
+
/**
|
|
303
|
+
* The webhooks of the app, their pending debounce timers, and their delivery log. The Console calls the `webhooks.*`
|
|
304
|
+
* operations of `@vite-hub/webhooks` with the Console user to list them, send a test, send a pending delivery now,
|
|
305
|
+
* cancel it, and redeliver. It has no build-time data.
|
|
306
|
+
*/
|
|
307
|
+
interface ViteHubConsoleWebhooksView {
|
|
308
|
+
kind: "webhooks";
|
|
309
|
+
notice: string;
|
|
310
|
+
}
|
|
311
|
+
interface ViteHubConsoleWebhooksSection extends ViteHubConsoleSectionDescriptor<ViteHubConsoleWebhooksView> {}
|
|
312
|
+
type ViteHubConsoleSectionView = ViteHubConsoleOperationView | ViteHubConsoleAuthView | ViteHubConsoleWebhooksView | ViteHubConsoleDefinitionCatalogView | ViteHubConsoleRecordTableView | ViteHubConsoleDocumentEditorView | ViteHubConsoleWorkspaceBrowserView;
|
|
130
313
|
/**
|
|
131
314
|
* The overview of a document editor section: document counts by state, the changes that wait for a publish, recent
|
|
132
315
|
* activity, and a New button per collection. It reads the owner `overview` action.
|
|
@@ -236,8 +419,8 @@ interface ViteHubConsoleServerExport {
|
|
|
236
419
|
/** Named export of `module`. */
|
|
237
420
|
export: string;
|
|
238
421
|
/**
|
|
239
|
-
*
|
|
240
|
-
* path that the application can import.
|
|
422
|
+
* Absolute path of the owner module, such as `ownModule(import.meta.url, "runtime/console")`, or an owner package
|
|
423
|
+
* specifier that the host maps to a module path that the application can import.
|
|
241
424
|
*/
|
|
242
425
|
module: string;
|
|
243
426
|
}
|
|
@@ -248,7 +431,8 @@ interface ViteHubConsoleServerExport {
|
|
|
248
431
|
interface ViteHubConsoleRuntimeReader extends ViteHubConsoleServerExport {}
|
|
249
432
|
/**
|
|
250
433
|
* A record table that also reads records at request time. The Console shows the build-time records of `read` first,
|
|
251
|
-
* then the records of the `runtime` reader. A runtime record
|
|
434
|
+
* then the records of the `runtime` reader. A runtime record updates the build-time record with the same id: its cells
|
|
435
|
+
* and fields replace the build-time ones with the same key or label.
|
|
252
436
|
*/
|
|
253
437
|
interface ViteHubConsoleRuntimeRecordTableSection<TOptions = void> extends ViteHubConsoleSectionDescriptor<ViteHubConsoleRecordTableView> {
|
|
254
438
|
/** Reads build-time records on the server. When omitted, the section has only runtime records. */
|
|
@@ -284,7 +468,7 @@ interface ViteHubConsoleDocumentEditorSection<TOptions = void> extends ViteHubCo
|
|
|
284
468
|
* A Console section that an owner package contributes. The owner defines the label, icon, view, and data reader.
|
|
285
469
|
* `TOptions` is the discovery context that the host passes to `read`.
|
|
286
470
|
*/
|
|
287
|
-
type ViteHubConsoleSectionContribution<TOptions = void> = ViteHubConsoleAuthSection | ViteHubConsoleDefinitionCatalogSection<TOptions> | ViteHubConsoleRecordTableSection<TOptions> | ViteHubConsoleRuntimeRecordTableSection<TOptions> | ViteHubConsoleDocumentEditorSection<TOptions> | ViteHubConsoleOperationSection;
|
|
471
|
+
type ViteHubConsoleSectionContribution<TOptions = void> = ViteHubConsoleAuthSection | ViteHubConsoleWebhooksSection | ViteHubConsoleDefinitionCatalogSection<TOptions> | ViteHubConsoleRecordTableSection<TOptions> | ViteHubConsoleRuntimeRecordTableSection<TOptions> | ViteHubConsoleDocumentEditorSection<TOptions> | ViteHubConsoleOperationSection;
|
|
288
472
|
/** A fix that the owner names for a feature the project lacks, such as `Add authorize to defineContent().` */
|
|
289
473
|
interface ViteHubConsoleDocumentHint {
|
|
290
474
|
/** One sentence that names the fix. Text in backticks shows as code. */
|
|
@@ -332,41 +516,49 @@ interface WorkflowNitroConfigOptions {
|
|
|
332
516
|
projectRoot: string;
|
|
333
517
|
serverDirs?: string[];
|
|
334
518
|
transformRegistry?: (code: string, id: string) => string | Promise<string>;
|
|
519
|
+
viteConfig?: UserConfig;
|
|
335
520
|
}
|
|
336
|
-
export type WorkflowVitePlugin = Plugin
|
|
337
|
-
|
|
521
|
+
export type WorkflowVitePlugin = Plugin & Partial<Pick<ProviderOutputEnvironmentOwner, "nitro">> & {
|
|
522
|
+
/** The variables that Workflow reads on the deployed host. See `workflowDeploymentEnv()`. */
|
|
523
|
+
api: {
|
|
524
|
+
deploymentEnv: DeploymentEnvContribution;
|
|
525
|
+
};
|
|
526
|
+
vitehub?: ViteHubInspectionPluginMetadata & DurabilityPluginMetadata & {
|
|
338
527
|
operations?: readonly OperationContributionEntry[];
|
|
339
528
|
workflow?: {
|
|
340
529
|
createNitroConfig?: (options: WorkflowNitroConfigOptions) => Promise<Record<string, unknown>>;
|
|
341
530
|
prepareScheduleRuntime?: (artifactDir?: string, config?: ResolvedConfig) => Promise<{
|
|
342
531
|
bundleAlias: Record<string, string>;
|
|
343
|
-
bundlePlugins?: Plugin[];
|
|
344
|
-
importBase: string;
|
|
532
|
+
bundlePlugins?: Plugin$1[];
|
|
345
533
|
native: boolean;
|
|
346
534
|
registryFile: string;
|
|
535
|
+
runtimeModules: {
|
|
536
|
+
state: string;
|
|
537
|
+
vercelVite: string;
|
|
538
|
+
};
|
|
347
539
|
} | undefined>;
|
|
348
540
|
};
|
|
349
541
|
};
|
|
350
542
|
};
|
|
351
543
|
interface InternalWorkflowModuleOptions {
|
|
352
|
-
|
|
544
|
+
/** The module that exports `getPostgresConnectionUrl()`. Default `@vite-hub/database`. */
|
|
545
|
+
databaseImport?: string;
|
|
353
546
|
hosting?: string;
|
|
354
547
|
implicitlyEnabled?: boolean;
|
|
355
548
|
importBase?: string;
|
|
356
549
|
providerImportAliases?: Record<string, string>;
|
|
357
|
-
|
|
550
|
+
/**
|
|
551
|
+
* The app that the Workflow Provider Output serves next to the Workflows. `true` finds `src/server.ts` or
|
|
552
|
+
* `src/worker.ts`, a file name such as `"server-workflow.ts"` picks that file in `src`, and `false` serves no app.
|
|
553
|
+
*/
|
|
554
|
+
includeUserAppEntry?: boolean | string;
|
|
358
555
|
workspaceDependencyRuntimeImports?: {
|
|
359
556
|
sandboxTask?: string;
|
|
360
557
|
sandboxTaskRuntimeState?: string;
|
|
361
558
|
shellWorkspace?: string;
|
|
362
559
|
};
|
|
363
|
-
|
|
364
|
-
}
|
|
365
|
-
export declare function hubWorkflow(options?: WorkflowModuleOptions, internalOptions?: InternalWorkflowModuleOptions): WorkflowVitePlugin;
|
|
366
|
-
declare module "vite" {
|
|
367
|
-
interface UserConfig {
|
|
368
|
-
workflow?: WorkflowModuleOptions;
|
|
369
|
-
}
|
|
560
|
+
workspaceRuntimeModule?: string;
|
|
370
561
|
}
|
|
562
|
+
export declare function hubWorkflow(options?: WorkflowOptions, internalOptions?: InternalWorkflowModuleOptions): WorkflowVitePlugin;
|
|
371
563
|
//#endregion
|
|
372
564
|
export type { WorkflowInspectionOptions };
|