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