devflare 1.0.0-next.39 → 1.0.0-next.40
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/_chunks/account-BtWcv3X9.js +462 -0
- package/dist/_chunks/account-resources-CsmVowJp.js +159 -0
- package/dist/_chunks/ai-CBEuLdoP.js +322 -0
- package/dist/_chunks/api-TzdliH-6.js +568 -0
- package/dist/_chunks/build-3T6O4uIg.js +24 -0
- package/dist/_chunks/build-artifacts-8TqBSQkG.js +483 -0
- package/dist/_chunks/cli-BTF1X4SG.js +1128 -0
- package/dist/_chunks/cloudflare-BaloqI3H.js +157 -0
- package/dist/_chunks/colors-DiK6wPJ5.js +13 -0
- package/dist/_chunks/command-utils-BsfkmTqh.js +45 -0
- package/dist/_chunks/compiler-uoyAQ8zW.js +424 -0
- package/dist/_chunks/config-D5u-bEkn.js +78 -0
- package/dist/_chunks/config-path-DCPto4XB.js +42 -0
- package/dist/_chunks/context-CX50Y2Kb.js +2250 -0
- package/dist/_chunks/decorators-QmV57ixr.js +19 -0
- package/dist/_chunks/dependencies-C2oxFjU_.js +57 -0
- package/dist/_chunks/deploy-DMTr6JeR.js +915 -0
- package/dist/_chunks/dev-CvRHmRFZ.js +3456 -0
- package/dist/_chunks/doctor-DIG8DoFU.js +219 -0
- package/dist/_chunks/durable-object-DMtH0XYX.js +234 -0
- package/dist/_chunks/env-S0_nMVz1.js +125 -0
- package/dist/_chunks/family-DXC5SdFK.js +143 -0
- package/dist/_chunks/generated-artifacts-dMJY4KAt.js +32 -0
- package/dist/_chunks/glob-CmQOvunB.js +56 -0
- package/dist/_chunks/init-3moXTgpb.js +165 -0
- package/dist/_chunks/loader-DLXO60RO.js +1153 -0
- package/dist/_chunks/local-dev-vars-CTSa-wvF.js +81 -0
- package/dist/_chunks/local-hyperdrive-CJ90j46O.js +119 -0
- package/dist/_chunks/local-media-bindings-DsAW4AMF.js +335 -0
- package/dist/_chunks/local-secrets-DMmEOygL.js +123 -0
- package/dist/_chunks/local-workflow-entrypoints-Wip3o1u8.js +90 -0
- package/dist/_chunks/login-BmnDzDlH.js +51 -0
- package/dist/_chunks/package-metadata-DAuCkyvK.js +39 -0
- package/dist/_chunks/preferences-BKp_7XJx.js +241 -0
- package/dist/_chunks/preview-BhqDmq8I.js +456 -0
- package/dist/_chunks/preview-registry-ClAbLTHH.js +1186 -0
- package/dist/_chunks/preview-resources-DdXj8LMM.js +358 -0
- package/dist/_chunks/previews-Dlr13x5M.js +1134 -0
- package/dist/_chunks/productions-D3AnOHac.js +411 -0
- package/dist/_chunks/ref-CYJNAAe_.js +178 -0
- package/dist/_chunks/remote-CZnP-HLJ.js +79 -0
- package/dist/_chunks/remote-config-D39BY9ji.js +132 -0
- package/dist/_chunks/resolve-package-Y84HB3Nt.js +133 -0
- package/dist/_chunks/rolldown-runtime-CvQ6eiug.js +14 -0
- package/dist/_chunks/routes-C3FqES2W.js +796 -0
- package/dist/_chunks/runtime-FvXvfuZ2.js +550 -0
- package/dist/_chunks/schema-normalization-DWVleVxo.js +477 -0
- package/dist/_chunks/secrets-70eN0Q6C.js +95 -0
- package/dist/_chunks/token-kguIDmej.js +333 -0
- package/dist/_chunks/tokens-iVcgNXi-.js +221 -0
- package/dist/_chunks/types-OrLbzv4I.js +476 -0
- package/dist/_chunks/ui-BUoZApvE.js +103 -0
- package/dist/_chunks/usage-BBTGzjon.js +272 -0
- package/dist/_chunks/vite-CsI0E-uV.js +1235 -0
- package/dist/_chunks/vite-utils-OVLMV605.js +183 -0
- package/dist/_chunks/worker-CS1jgNFE.js +410 -0
- package/dist/_chunks/worker-bundler-dTTnYU3n.js +458 -0
- package/dist/_chunks/worker-entrypoint-CQW77lG8.js +247 -0
- package/dist/_chunks/workerName-CFJsLZA-.js +23 -0
- package/dist/bridge/index.d.ts +6 -6
- package/dist/bridge/miniflare.d.ts +2 -2
- package/dist/bridge/proxy.d.ts +1 -1
- package/dist/bridge/v2/body-streams.d.ts +1 -1
- package/dist/bridge/v2/codec.d.ts +4 -4
- package/dist/bridge/v2/index.d.ts +10 -10
- package/dist/bridge/v2/serialization.d.ts +1 -1
- package/dist/bridge/v2/value-codec.d.ts +1 -1
- package/dist/bridge/v2/value-serialization.d.ts.map +1 -1
- package/dist/bridge/v2/ws-relay.d.ts +3 -3
- package/dist/browser-shim/index.d.ts +2 -2
- package/dist/browser.d.ts +70 -70
- package/dist/browser.js +74 -2462
- package/dist/bundler/do-bundler.d.ts +1 -1
- package/dist/bundler/index.d.ts +3 -3
- package/dist/bundler/rolldown-shared.d.ts +1 -1
- package/dist/bundler/worker-bundler.d.ts +1 -1
- package/dist/cli/build-manifest.d.ts +1 -1
- package/dist/cli/command-utils.d.ts +1 -1
- package/dist/cli/commands/account.d.ts +1 -1
- package/dist/cli/commands/ai.d.ts +1 -1
- package/dist/cli/commands/build-artifacts.d.ts +5 -5
- package/dist/cli/commands/build.d.ts +1 -1
- package/dist/cli/commands/config.d.ts +1 -1
- package/dist/cli/commands/deploy/prepare.d.ts +2 -2
- package/dist/cli/commands/deploy/runtime.d.ts +1 -1
- package/dist/cli/commands/deploy/verification.d.ts +1 -1
- package/dist/cli/commands/deploy.d.ts +1 -1
- package/dist/cli/commands/dev.d.ts +1 -1
- package/dist/cli/commands/doctor.d.ts +1 -1
- package/dist/cli/commands/init.d.ts +1 -1
- package/dist/cli/commands/login.d.ts +1 -1
- package/dist/cli/commands/previews-support/cleanup.d.ts +1 -1
- package/dist/cli/commands/previews-support/family.d.ts +3 -3
- package/dist/cli/commands/previews-support/render.d.ts +3 -3
- package/dist/cli/commands/previews-support/theme.d.ts +2 -2
- package/dist/cli/commands/previews-support/types.d.ts +2 -2
- package/dist/cli/commands/previews.d.ts +1 -1
- package/dist/cli/commands/productions.d.ts +1 -1
- package/dist/cli/commands/remote.d.ts +1 -1
- package/dist/cli/commands/secrets.d.ts +1 -1
- package/dist/cli/commands/token.d.ts +1 -1
- package/dist/cli/commands/type-generation/discovery.d.ts +2 -2
- package/dist/cli/commands/type-generation/generator.d.ts +3 -3
- package/dist/cli/commands/type-generation/models.d.ts +1 -1
- package/dist/cli/commands/types.d.ts +1 -1
- package/dist/cli/commands/worker.d.ts +1 -1
- package/dist/cli/deploy-strategy.d.ts +1 -1
- package/dist/cli/deploy-target.d.ts +1 -1
- package/dist/cli/help-pages/pages/account.d.ts +1 -1
- package/dist/cli/help-pages/pages/core.d.ts +1 -1
- package/dist/cli/help-pages/pages/index.d.ts +1 -1
- package/dist/cli/help-pages/pages/misc.d.ts +1 -1
- package/dist/cli/help-pages/pages/previews.d.ts +1 -1
- package/dist/cli/help-pages/pages/productions.d.ts +1 -1
- package/dist/cli/help-pages/render.d.ts +2 -2
- package/dist/cli/help-pages/shared.d.ts +1 -1
- package/dist/cli/help.d.ts +2 -2
- package/dist/cli/index.js +2 -1383
- package/dist/cli/preview-bindings.d.ts +3 -3
- package/dist/cli/preview.d.ts +1 -1
- package/dist/cli/wrangler-auth.d.ts +1 -1
- package/dist/cloudflare/account-core.d.ts +2 -2
- package/dist/cloudflare/account-resources.d.ts +2 -2
- package/dist/cloudflare/account-status.d.ts +1 -1
- package/dist/cloudflare/account-workers.d.ts +2 -2
- package/dist/cloudflare/account.d.ts +7 -7
- package/dist/cloudflare/auth.d.ts +1 -1
- package/dist/cloudflare/index.d.ts +13 -13
- package/dist/cloudflare/index.js +4 -59
- package/dist/cloudflare/kv-namespace.d.ts +1 -1
- package/dist/cloudflare/preview-registry-cache.d.ts +1 -1
- package/dist/cloudflare/preview-registry-inference.d.ts +2 -2
- package/dist/cloudflare/preview-registry-records.d.ts +3 -3
- package/dist/cloudflare/preview-registry-shape.d.ts +2 -2
- package/dist/cloudflare/preview-registry-store.d.ts +3 -3
- package/dist/cloudflare/preview-registry-transport.d.ts +2 -2
- package/dist/cloudflare/preview-registry-types.d.ts +2 -2
- package/dist/cloudflare/preview-registry.d.ts +5 -5
- package/dist/cloudflare/tokens.d.ts +2 -2
- package/dist/cloudflare/usage.d.ts +2 -2
- package/dist/config/binding-resolution-helpers.d.ts +1 -1
- package/dist/config/compiler/bindings.d.ts +2 -2
- package/dist/config/compiler/core-helpers.d.ts +2 -2
- package/dist/config/compiler/do-workers.d.ts +2 -2
- package/dist/config/compiler/paths.d.ts +1 -1
- package/dist/config/compiler.d.ts +6 -6
- package/dist/config/define.d.ts +2 -2
- package/dist/config/deploy-resources.d.ts +5 -5
- package/dist/config/env-vars.d.ts +1 -1
- package/dist/config/framework-providers.d.ts +1 -1
- package/dist/config/index.d.ts +12 -12
- package/dist/config/loader.d.ts +2 -2
- package/dist/config/local-dev-vars.d.ts +1 -1
- package/dist/config/preview-resources.d.ts +4 -4
- package/dist/config/preview.d.ts +1 -1
- package/dist/config/ref.d.ts +2 -2
- package/dist/config/resolve-phased.d.ts +4 -4
- package/dist/config/resolve.d.ts +1 -1
- package/dist/config/resource-resolution.d.ts +6 -6
- package/dist/config/schema-env.d.ts +20 -20
- package/dist/config/schema-normalization.d.ts +1 -1
- package/dist/config/schema-types-bindings.d.ts +4 -4
- package/dist/config/schema-types-build.d.ts +1 -1
- package/dist/config/schema-types.d.ts +7 -7
- package/dist/config/schema.d.ts +46 -46
- package/dist/config/service-bindings-validation.d.ts +1 -1
- package/dist/config-entry.d.ts +6 -6
- package/dist/config-entry.js +3 -8
- package/dist/decorators/index.d.ts +2 -2
- package/dist/decorators/index.js +2 -9
- package/dist/dev-server/d1-migrations.d.ts +1 -1
- package/dist/dev-server/dev-server-state.d.ts +6 -6
- package/dist/dev-server/gateway-script.d.ts +1 -1
- package/dist/dev-server/index.d.ts +1 -1
- package/dist/dev-server/miniflare-bindings.d.ts +1 -1
- package/dist/dev-server/miniflare-dev-config.d.ts +5 -5
- package/dist/dev-server/miniflare-worker-config.d.ts +3 -3
- package/dist/dev-server/server-startup-helpers.d.ts +6 -6
- package/dist/dev-server/worker-surface-paths.d.ts +2 -2
- package/dist/index.d.ts +8 -8
- package/dist/index.js +9 -22
- package/dist/runtime/context-events.d.ts +1 -1
- package/dist/runtime/context.d.ts +3 -3
- package/dist/runtime/exports.d.ts +2 -2
- package/dist/runtime/index.d.ts +10 -10
- package/dist/runtime/index.js +5 -57
- package/dist/runtime/middleware.d.ts +1 -1
- package/dist/runtime/router/index.d.ts +3 -3
- package/dist/runtime/validation.d.ts +1 -1
- package/dist/secrets/local-secrets.d.ts +1 -1
- package/dist/shims/local-media-bindings.d.ts +1 -1
- package/dist/sveltekit/index.d.ts +1 -1
- package/dist/sveltekit/index.js +327 -9
- package/dist/sveltekit/local-bindings.d.ts +1 -1
- package/dist/sveltekit/platform.d.ts +1 -1
- package/dist/test/binding-hints.d.ts +2 -2
- package/dist/test/cf.d.ts +19 -19
- package/dist/test/index.d.ts +18 -18
- package/dist/test/index.js +4495 -46
- package/dist/test/offline-bindings.d.ts +3 -3
- package/dist/test/resolve-service-bindings.d.ts +1 -1
- package/dist/test/simple-context-bindings.d.ts +1 -1
- package/dist/test/simple-context-durable-objects.d.ts +1 -1
- package/dist/test/simple-context-env.d.ts +2 -2
- package/dist/test/simple-context-handlers.d.ts +2 -2
- package/dist/test/simple-context-lifecycle.d.ts +2 -2
- package/dist/test/simple-context-mfconfig.d.ts +1 -1
- package/dist/test/simple-context-multi-worker.d.ts +2 -2
- package/dist/test/simple-context-runtime.d.ts +1 -1
- package/dist/test/simple-context-startup.d.ts +1 -1
- package/dist/test/simple-context.d.ts +1 -1
- package/dist/test/utilities/env.d.ts +3 -3
- package/dist/test/utilities.d.ts +10 -10
- package/dist/test/worker.d.ts +1 -1
- package/dist/transform/index.d.ts +2 -2
- package/dist/utils/send-email.js +163 -19
- package/dist/vite/config-file.d.ts +2 -2
- package/dist/vite/index.d.ts +3 -3
- package/dist/vite/index.js +2 -31
- package/dist/vite/plugin-config-hook.d.ts +1 -1
- package/dist/vite/plugin-context.d.ts +3 -3
- package/dist/vite/plugin-durable-objects.d.ts +2 -2
- package/dist/vite/plugin-programmatic.d.ts +1 -1
- package/dist/vite/plugin-service-bindings.d.ts +2 -2
- package/dist/vite/plugin.d.ts +3 -3
- package/dist/worker-entry/composed-worker.d.ts +1 -1
- package/dist/worker-entry/routes.d.ts +2 -2
- package/dist/worker-entry/surface-paths.d.ts +1 -1
- package/dist/workflows/local-workflow-entrypoints.d.ts +1 -1
- package/package.json +5 -3
- package/dist/account-4tgh03a8.js +0 -484
- package/dist/ai-r3zqmxan.js +0 -261
- package/dist/api-6z01z734.js +0 -33
- package/dist/build-kw625v84.js +0 -51
- package/dist/config-ghk2bxj3.js +0 -102
- package/dist/deploy-9kee65n9.js +0 -1062
- package/dist/dev-x8zr249a.js +0 -3569
- package/dist/doctor-0ng5qrr1.js +0 -258
- package/dist/durable-object-0ybmg08a.js +0 -13
- package/dist/index-04wh9bxx.js +0 -514
- package/dist/index-0cc05hzv.js +0 -74
- package/dist/index-2yv7w548.js +0 -185
- package/dist/index-37x76zdn.js +0 -4
- package/dist/index-3cpzsr47.js +0 -125
- package/dist/index-3t6rypgc.js +0 -13
- package/dist/index-4mmpccrb.js +0 -309
- package/dist/index-5dkjffqz.js +0 -25
- package/dist/index-5hy7jmv3.js +0 -890
- package/dist/index-627srx16.js +0 -45
- package/dist/index-7m557715.js +0 -283
- package/dist/index-a8pnvg3r.js +0 -52
- package/dist/index-aabgympv.js +0 -39
- package/dist/index-atwc3csp.js +0 -256
- package/dist/index-cv4cvrxe.js +0 -2046
- package/dist/index-h7r11y4a.js +0 -539
- package/dist/index-hvtd936d.js +0 -1229
- package/dist/index-kcp7y951.js +0 -136
- package/dist/index-maw0jjnn.js +0 -147
- package/dist/index-mek9msfv.js +0 -705
- package/dist/index-n4xkaymm.js +0 -236
- package/dist/index-nkk59p3y.js +0 -579
- package/dist/index-phcrvs6d.js +0 -342
- package/dist/index-se4kw8tm.js +0 -460
- package/dist/index-x8s9rwfh.js +0 -2020
- package/dist/index-y7w3x9p1.js +0 -18
- package/dist/index-z9gy8w6b.js +0 -57
- package/dist/index-zdd0d9qa.js +0 -199
- package/dist/init-tb8jqgvr.js +0 -180
- package/dist/login-4h1sfsed.js +0 -75
- package/dist/previews-qr7c5j8h.js +0 -1336
- package/dist/productions-xpmd6bw8.js +0 -505
- package/dist/remote-kqcvhnfx.js +0 -192
- package/dist/secrets-6wbdsdek.js +0 -89
- package/dist/token-yp1qa70y.js +0 -419
- package/dist/types-15yv4cj3.js +0 -701
- package/dist/worker-1yg72jxg.js +0 -510
- package/dist/worker-entrypoint-y8s9kdcx.js +0 -15
|
@@ -0,0 +1,247 @@
|
|
|
1
|
+
import { t as __exportAll } from "./rolldown-runtime-CvQ6eiug.js";
|
|
2
|
+
import MagicString from "magic-string";
|
|
3
|
+
import ts from "typescript";
|
|
4
|
+
//#region src/worker-entry/extensions.ts
|
|
5
|
+
/** Extensions accepted as worker source modules. */
|
|
6
|
+
const SUPPORTED_WORKER_EXTENSIONS = [
|
|
7
|
+
".ts",
|
|
8
|
+
".tsx",
|
|
9
|
+
".mts",
|
|
10
|
+
".mjs",
|
|
11
|
+
".cts",
|
|
12
|
+
".cjs",
|
|
13
|
+
".js",
|
|
14
|
+
".jsx"
|
|
15
|
+
];
|
|
16
|
+
/** Subset of {@link SUPPORTED_WORKER_EXTENSIONS} that may host TypeScript-only syntax. */
|
|
17
|
+
const TS_WORKER_EXTENSIONS = [
|
|
18
|
+
".ts",
|
|
19
|
+
".tsx",
|
|
20
|
+
".mts",
|
|
21
|
+
".cts"
|
|
22
|
+
];
|
|
23
|
+
//#endregion
|
|
24
|
+
//#region src/transform/worker-entrypoint.ts
|
|
25
|
+
var worker_entrypoint_exports = /* @__PURE__ */ __exportAll({
|
|
26
|
+
findExportedFunctions: () => findExportedFunctions,
|
|
27
|
+
shouldEmitTsSyntax: () => shouldEmitTsSyntax,
|
|
28
|
+
shouldTransformWorker: () => shouldTransformWorker,
|
|
29
|
+
transformWorkerEntrypoint: () => transformWorkerEntrypoint
|
|
30
|
+
});
|
|
31
|
+
/**
|
|
32
|
+
* Find all exported functions in a worker.ts file using TypeScript AST
|
|
33
|
+
*/
|
|
34
|
+
function findExportedFunctions(code) {
|
|
35
|
+
const functions = [];
|
|
36
|
+
const sourceFile = ts.createSourceFile("worker.ts", code, ts.ScriptTarget.Latest, true, ts.ScriptKind.TS);
|
|
37
|
+
function visit(node) {
|
|
38
|
+
if (ts.isFunctionDeclaration(node) && node.name) {
|
|
39
|
+
const modifiers = ts.getModifiers(node);
|
|
40
|
+
const isExported = modifiers?.some((m) => m.kind === ts.SyntaxKind.ExportKeyword);
|
|
41
|
+
const isDefault = modifiers?.some((m) => m.kind === ts.SyntaxKind.DefaultKeyword);
|
|
42
|
+
if (isExported) {
|
|
43
|
+
const isAsync = modifiers?.some((m) => m.kind === ts.SyntaxKind.AsyncKeyword) ?? false;
|
|
44
|
+
const funcName = isDefault ? "fetch" : node.name.text;
|
|
45
|
+
const params = node.parameters.map((p) => code.substring(p.getStart(sourceFile), p.getEnd())).join(", ");
|
|
46
|
+
const returnType = node.type ? code.substring(node.type.getStart(sourceFile), node.type.getEnd()) : void 0;
|
|
47
|
+
functions.push({
|
|
48
|
+
name: funcName,
|
|
49
|
+
isAsync,
|
|
50
|
+
params,
|
|
51
|
+
returnType,
|
|
52
|
+
start: node.getStart(sourceFile),
|
|
53
|
+
end: node.getEnd(),
|
|
54
|
+
isDefault
|
|
55
|
+
});
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
if (ts.isFunctionDeclaration(node) && !node.name) {
|
|
59
|
+
const modifiers = ts.getModifiers(node);
|
|
60
|
+
const isExported = modifiers?.some((m) => m.kind === ts.SyntaxKind.ExportKeyword);
|
|
61
|
+
const isDefault = modifiers?.some((m) => m.kind === ts.SyntaxKind.DefaultKeyword);
|
|
62
|
+
if (isExported && isDefault) {
|
|
63
|
+
const isAsync = modifiers?.some((m) => m.kind === ts.SyntaxKind.AsyncKeyword) ?? false;
|
|
64
|
+
const params = node.parameters.map((p) => code.substring(p.getStart(sourceFile), p.getEnd())).join(", ");
|
|
65
|
+
const returnType = node.type ? code.substring(node.type.getStart(sourceFile), node.type.getEnd()) : void 0;
|
|
66
|
+
functions.push({
|
|
67
|
+
name: "fetch",
|
|
68
|
+
isAsync,
|
|
69
|
+
params,
|
|
70
|
+
returnType,
|
|
71
|
+
start: node.getStart(sourceFile),
|
|
72
|
+
end: node.getEnd(),
|
|
73
|
+
isDefault: true
|
|
74
|
+
});
|
|
75
|
+
}
|
|
76
|
+
}
|
|
77
|
+
if (ts.isVariableStatement(node)) {
|
|
78
|
+
if (ts.getModifiers(node)?.some((m) => m.kind === ts.SyntaxKind.ExportKeyword)) {
|
|
79
|
+
for (const decl of node.declarationList.declarations) if (ts.isIdentifier(decl.name) && decl.initializer) {
|
|
80
|
+
let funcExpr;
|
|
81
|
+
if (ts.isFunctionExpression(decl.initializer)) funcExpr = decl.initializer;
|
|
82
|
+
else if (ts.isArrowFunction(decl.initializer)) funcExpr = decl.initializer;
|
|
83
|
+
if (funcExpr) {
|
|
84
|
+
const isAsync = ts.getModifiers(funcExpr)?.some((m) => m.kind === ts.SyntaxKind.AsyncKeyword) ?? (ts.isArrowFunction(funcExpr) && funcExpr.modifiers?.some((m) => m.kind === ts.SyntaxKind.AsyncKeyword)) ?? false;
|
|
85
|
+
const params = funcExpr.parameters.map((p) => code.substring(p.getStart(sourceFile), p.getEnd())).join(", ");
|
|
86
|
+
const returnType = funcExpr.type ? code.substring(funcExpr.type.getStart(sourceFile), funcExpr.type.getEnd()) : void 0;
|
|
87
|
+
functions.push({
|
|
88
|
+
name: decl.name.text,
|
|
89
|
+
isAsync,
|
|
90
|
+
params,
|
|
91
|
+
returnType,
|
|
92
|
+
start: node.getStart(sourceFile),
|
|
93
|
+
end: node.getEnd()
|
|
94
|
+
});
|
|
95
|
+
}
|
|
96
|
+
}
|
|
97
|
+
}
|
|
98
|
+
}
|
|
99
|
+
ts.forEachChild(node, visit);
|
|
100
|
+
}
|
|
101
|
+
visit(sourceFile);
|
|
102
|
+
return functions;
|
|
103
|
+
}
|
|
104
|
+
/**
|
|
105
|
+
* Returns true when the filename has an extension that permits TS-only syntax.
|
|
106
|
+
* Gates injection of interfaces and type annotations into emitted worker code.
|
|
107
|
+
*/
|
|
108
|
+
function shouldEmitTsSyntax(filename) {
|
|
109
|
+
const lower = filename.toLowerCase();
|
|
110
|
+
return TS_WORKER_EXTENSIONS.some((ext) => lower.endsWith(ext));
|
|
111
|
+
}
|
|
112
|
+
/**
|
|
113
|
+
* Check if a file should be transformed as a worker entrypoint
|
|
114
|
+
* Returns true if the file has exported functions that could be RPC methods
|
|
115
|
+
*/
|
|
116
|
+
function shouldTransformWorker(code, filePath) {
|
|
117
|
+
const lower = filePath.toLowerCase();
|
|
118
|
+
if (!SUPPORTED_WORKER_EXTENSIONS.some((ext) => lower.endsWith(`worker${ext}`))) return false;
|
|
119
|
+
return findExportedFunctions(code).length > 0;
|
|
120
|
+
}
|
|
121
|
+
/**
|
|
122
|
+
* Transform a worker.ts file into a WorkerEntrypoint class
|
|
123
|
+
*
|
|
124
|
+
* @param code - Source code to transform
|
|
125
|
+
* @param id - File path/id for source mapping
|
|
126
|
+
* @param options - Transform options
|
|
127
|
+
* @returns Transformed code with source map
|
|
128
|
+
*/
|
|
129
|
+
function transformWorkerEntrypoint(code, id, options = {}) {
|
|
130
|
+
const className = options.className ?? "Worker";
|
|
131
|
+
const injectContext = options.injectContext ?? true;
|
|
132
|
+
const emitTs = shouldEmitTsSyntax(id);
|
|
133
|
+
const functions = findExportedFunctions(code);
|
|
134
|
+
if (functions.length === 0) return null;
|
|
135
|
+
const fetchFn = functions.find((f) => f.name === "fetch");
|
|
136
|
+
const rpcMethods = functions.filter((f) => f.name !== "fetch");
|
|
137
|
+
const needsFetchHelpers = Boolean(fetchFn);
|
|
138
|
+
const s = new MagicString(code);
|
|
139
|
+
const importStatement = `import { WorkerEntrypoint } from 'cloudflare:workers'\n`;
|
|
140
|
+
if (needsFetchHelpers) {
|
|
141
|
+
const runtimeImports = ["createFetchEvent", "invokeFetchHandler"];
|
|
142
|
+
if (injectContext) runtimeImports.push("runWithEventContext");
|
|
143
|
+
s.prepend(`import { ${runtimeImports.join(", ")} } from 'devflare/runtime'\n`);
|
|
144
|
+
}
|
|
145
|
+
s.prepend(importStatement);
|
|
146
|
+
const sourceFile = ts.createSourceFile("worker.ts", code, ts.ScriptTarget.Latest, true, ts.ScriptKind.TS);
|
|
147
|
+
const internalNameFor = (name) => name === "fetch" ? "__originalFetch" : `__original_${name}`;
|
|
148
|
+
function visit(node) {
|
|
149
|
+
if (ts.isFunctionDeclaration(node)) {
|
|
150
|
+
const modifiers = ts.getModifiers(node);
|
|
151
|
+
const exportMod = modifiers?.find((m) => m.kind === ts.SyntaxKind.ExportKeyword);
|
|
152
|
+
const defaultMod = modifiers?.find((m) => m.kind === ts.SyntaxKind.DefaultKeyword);
|
|
153
|
+
const asyncMod = modifiers?.find((m) => m.kind === ts.SyntaxKind.AsyncKeyword);
|
|
154
|
+
if (exportMod) {
|
|
155
|
+
const isDefault = Boolean(defaultMod);
|
|
156
|
+
const logicalName = isDefault ? "fetch" : node.name?.text;
|
|
157
|
+
if (logicalName) {
|
|
158
|
+
const internal = internalNameFor(logicalName);
|
|
159
|
+
if (isDefault && !node.name) {
|
|
160
|
+
const funcKeyword = node.getChildren(sourceFile).find((c) => c.kind === ts.SyntaxKind.FunctionKeyword);
|
|
161
|
+
if (funcKeyword) {
|
|
162
|
+
const asyncKw = asyncMod ? "async " : "";
|
|
163
|
+
s.overwrite(node.getStart(sourceFile), funcKeyword.getStart(sourceFile), `const ${internal} = ${asyncKw}`);
|
|
164
|
+
}
|
|
165
|
+
} else if (node.name) {
|
|
166
|
+
s.remove(exportMod.getStart(sourceFile), exportMod.getEnd());
|
|
167
|
+
if (defaultMod) s.remove(defaultMod.getStart(sourceFile), defaultMod.getEnd());
|
|
168
|
+
s.overwrite(node.name.getStart(sourceFile), node.name.getEnd(), internal);
|
|
169
|
+
}
|
|
170
|
+
}
|
|
171
|
+
}
|
|
172
|
+
} else if (ts.isVariableStatement(node)) {
|
|
173
|
+
const exportMod = ts.getModifiers(node)?.find((m) => m.kind === ts.SyntaxKind.ExportKeyword);
|
|
174
|
+
if (exportMod) {
|
|
175
|
+
let rewroteAny = false;
|
|
176
|
+
for (const decl of node.declarationList.declarations) if (ts.isIdentifier(decl.name) && decl.initializer && (ts.isFunctionExpression(decl.initializer) || ts.isArrowFunction(decl.initializer))) {
|
|
177
|
+
const internal = internalNameFor(decl.name.text);
|
|
178
|
+
s.overwrite(decl.name.getStart(sourceFile), decl.name.getEnd(), internal);
|
|
179
|
+
rewroteAny = true;
|
|
180
|
+
}
|
|
181
|
+
if (rewroteAny) s.remove(exportMod.getStart(sourceFile), exportMod.getEnd());
|
|
182
|
+
}
|
|
183
|
+
}
|
|
184
|
+
ts.forEachChild(node, visit);
|
|
185
|
+
}
|
|
186
|
+
visit(sourceFile);
|
|
187
|
+
let classBody = `\n\n// ============ Devflare WorkerEntrypoint ============\nclass ${className} extends WorkerEntrypoint {\n`;
|
|
188
|
+
if (fetchFn) {
|
|
189
|
+
classBody += `\t${emitTs ? "async fetch(request: Request): Promise<Response>" : "async fetch(request)"} {\n`;
|
|
190
|
+
classBody += `\t\tconst __devflareEvent = createFetchEvent(request, this.env, this.ctx)\n`;
|
|
191
|
+
if (injectContext) {
|
|
192
|
+
classBody += `\t\treturn runWithEventContext(\n`;
|
|
193
|
+
classBody += `\t\t\t__devflareEvent,\n`;
|
|
194
|
+
classBody += `\t\t\t() => invokeFetchHandler(__originalFetch, __devflareEvent)\n`;
|
|
195
|
+
classBody += `\t\t)\n`;
|
|
196
|
+
classBody += `\t}\n`;
|
|
197
|
+
} else {
|
|
198
|
+
classBody += `\t\treturn invokeFetchHandler(__originalFetch, __devflareEvent)\n`;
|
|
199
|
+
classBody += `\t}\n`;
|
|
200
|
+
}
|
|
201
|
+
}
|
|
202
|
+
for (const fn of rpcMethods) {
|
|
203
|
+
const asyncPrefix = fn.isAsync ? "async " : "";
|
|
204
|
+
const paramNames = extractParamNames(fn.params);
|
|
205
|
+
const signatureParams = emitTs ? fn.params : paramNames;
|
|
206
|
+
const returnType = emitTs && fn.returnType ? `: ${fn.returnType}` : "";
|
|
207
|
+
classBody += `\n\t${asyncPrefix}${fn.name}(${signatureParams})${returnType} {\n`;
|
|
208
|
+
classBody += `\t\treturn __original_${fn.name}(${paramNames})\n`;
|
|
209
|
+
classBody += `\t}\n`;
|
|
210
|
+
}
|
|
211
|
+
classBody += `}\n\n`;
|
|
212
|
+
classBody += `export { ${className} }\n`;
|
|
213
|
+
classBody += `export { ${className} as default }\n`;
|
|
214
|
+
classBody += `// ============ End Devflare WorkerEntrypoint ============\n`;
|
|
215
|
+
s.append(classBody);
|
|
216
|
+
return {
|
|
217
|
+
code: s.toString(),
|
|
218
|
+
map: s.generateMap({
|
|
219
|
+
source: id,
|
|
220
|
+
file: id + ".map",
|
|
221
|
+
includeContent: true
|
|
222
|
+
}),
|
|
223
|
+
rpcMethods: rpcMethods.map((fn) => fn.name),
|
|
224
|
+
className
|
|
225
|
+
};
|
|
226
|
+
}
|
|
227
|
+
/**
|
|
228
|
+
* Extract parameter names from a parameter string
|
|
229
|
+
* "a: number, b: string" -> "a, b"
|
|
230
|
+
*/
|
|
231
|
+
function extractParamNames(params) {
|
|
232
|
+
if (!params.trim()) return "";
|
|
233
|
+
const tempCode = `function f(${params}) {}`;
|
|
234
|
+
const sourceFile = ts.createSourceFile("temp.ts", tempCode, ts.ScriptTarget.Latest, true, ts.ScriptKind.TS);
|
|
235
|
+
const names = [];
|
|
236
|
+
function visit(node) {
|
|
237
|
+
if (ts.isFunctionDeclaration(node)) {
|
|
238
|
+
for (const param of node.parameters) if (ts.isIdentifier(param.name)) names.push(param.name.text);
|
|
239
|
+
else if (ts.isObjectBindingPattern(param.name) || ts.isArrayBindingPattern(param.name)) names.push(tempCode.substring(param.name.getStart(sourceFile), param.name.getEnd()));
|
|
240
|
+
}
|
|
241
|
+
ts.forEachChild(node, visit);
|
|
242
|
+
}
|
|
243
|
+
visit(sourceFile);
|
|
244
|
+
return names.join(", ");
|
|
245
|
+
}
|
|
246
|
+
//#endregion
|
|
247
|
+
export { worker_entrypoint_exports as n, SUPPORTED_WORKER_EXTENSIONS as r, transformWorkerEntrypoint as t };
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
//#region src/workerName.ts
|
|
2
|
+
/**
|
|
3
|
+
* The current worker's name from devflare.config.ts
|
|
4
|
+
*
|
|
5
|
+
* This value is injected at build time by the devflare bundler.
|
|
6
|
+
* In development (non-bundled), it will be 'unknown' or throw an error.
|
|
7
|
+
*
|
|
8
|
+
* @example
|
|
9
|
+
* import { workerName } from 'devflare'
|
|
10
|
+
*
|
|
11
|
+
* export default {
|
|
12
|
+
* fetch(request) {
|
|
13
|
+
* return new Response(`Hello from ${workerName}`)
|
|
14
|
+
* }
|
|
15
|
+
* }
|
|
16
|
+
*/
|
|
17
|
+
const workerName = (() => {
|
|
18
|
+
if (typeof __DEVFLARE_WORKER_NAME__ !== "undefined") return __DEVFLARE_WORKER_NAME__;
|
|
19
|
+
if (typeof process !== "undefined" && process.env?.DEVFLARE_WORKER_NAME) return process.env.DEVFLARE_WORKER_NAME;
|
|
20
|
+
return "unknown";
|
|
21
|
+
})();
|
|
22
|
+
//#endregion
|
|
23
|
+
export { workerName as t };
|
package/dist/bridge/index.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
export { type JsonMsg, type RpcCall, type RpcOk, type RpcErr, type StreamPull, type StreamOpen, type StreamEnd, type StreamAbort, type WsOpen, type WsOpened, type WsClose, type EventMsg, type HttpTransfer, type DecodedBinaryFrame, BinaryKind, BinaryFlags, BINARY_HEADER_SIZE, encodeBinaryFrame, decodeBinaryFrame, isFin, isText, parseJsonMsg, stringifyJsonMsg, nextRpcId, nextStreamId, nextWsId, resetIdCounters, DEFAULT_CHUNK_SIZE, HTTP_TRANSFER_THRESHOLD, DEFAULT_BRIDGE_PORT, DEFAULT_HTTP_PORT } from './v2/wire';
|
|
2
|
-
export { type SerializedRequest, type SerializedResponse, type BodyRef, serializeRequest, deserializeRequest, serializeResponse, deserializeResponse, serializeValue, deserializeValue, serializeDOId } from './v2/value-serialization';
|
|
3
|
-
export { type BridgeClientOptions, type PendingCall, BridgeClient, getClient } from './client';
|
|
4
|
-
export { type EnvProxyOptions, type BindingHints, createEnvProxy, bridgeEnv, initEnv, setBindingHints } from './proxy';
|
|
5
|
-
export { startMiniflare, startMiniflareFromConfig, getMiniflare, stopMiniflare, type MiniflareInstance, type MiniflareOptions } from './miniflare';
|
|
6
|
-
export { default as gateway } from './server';
|
|
1
|
+
export { type JsonMsg, type RpcCall, type RpcOk, type RpcErr, type StreamPull, type StreamOpen, type StreamEnd, type StreamAbort, type WsOpen, type WsOpened, type WsClose, type EventMsg, type HttpTransfer, type DecodedBinaryFrame, BinaryKind, BinaryFlags, BINARY_HEADER_SIZE, encodeBinaryFrame, decodeBinaryFrame, isFin, isText, parseJsonMsg, stringifyJsonMsg, nextRpcId, nextStreamId, nextWsId, resetIdCounters, DEFAULT_CHUNK_SIZE, HTTP_TRANSFER_THRESHOLD, DEFAULT_BRIDGE_PORT, DEFAULT_HTTP_PORT } from './v2/wire.js';
|
|
2
|
+
export { type SerializedRequest, type SerializedResponse, type BodyRef, serializeRequest, deserializeRequest, serializeResponse, deserializeResponse, serializeValue, deserializeValue, serializeDOId } from './v2/value-serialization.js';
|
|
3
|
+
export { type BridgeClientOptions, type PendingCall, BridgeClient, getClient } from './client.js';
|
|
4
|
+
export { type EnvProxyOptions, type BindingHints, createEnvProxy, bridgeEnv, initEnv, setBindingHints } from './proxy.js';
|
|
5
|
+
export { startMiniflare, startMiniflareFromConfig, getMiniflare, stopMiniflare, type MiniflareInstance, type MiniflareOptions } from './miniflare.js';
|
|
6
|
+
export { default as gateway } from './server.js';
|
|
7
7
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { Miniflare as MiniflareType } from 'miniflare';
|
|
2
|
-
import { type DevflareConfig } from '../config';
|
|
3
|
-
import { type LocalSecretWrappedBindingConfig } from '../secrets/local-secrets';
|
|
2
|
+
import { type DevflareConfig } from '../config/index.js';
|
|
3
|
+
import { type LocalSecretWrappedBindingConfig } from '../secrets/local-secrets.js';
|
|
4
4
|
export interface MiniflareInstance {
|
|
5
5
|
/** Ready promise - resolves when Miniflare is ready */
|
|
6
6
|
ready: Promise<void>;
|
package/dist/bridge/proxy.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { TransportV2BodyKind, TransportV2DecodedBinaryFrame } from './frames';
|
|
1
|
+
import type { TransportV2BodyKind, TransportV2DecodedBinaryFrame } from './frames.js';
|
|
2
2
|
/** Default maximum payload size per body chunk frame (256 KiB). */
|
|
3
3
|
export declare const TRANSPORT_V2_DEFAULT_BODY_CHUNK_SIZE: number;
|
|
4
4
|
export interface TransportV2BodyWriterOptions {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { TransportV2BodyReaderRegistry } from './body-streams';
|
|
2
|
-
import { TRANSPORT_V2_PROTOCOL_VERSION } from './frames';
|
|
3
|
-
import type { TransportV2DecodedBinaryFrame } from './frames';
|
|
4
|
-
import type { WebSocketLike } from './transport';
|
|
1
|
+
import { TransportV2BodyReaderRegistry } from './body-streams.js';
|
|
2
|
+
import { TRANSPORT_V2_PROTOCOL_VERSION } from './frames.js';
|
|
3
|
+
import type { TransportV2DecodedBinaryFrame } from './frames.js';
|
|
4
|
+
import type { WebSocketLike } from './transport.js';
|
|
5
5
|
export interface TransportV2HandshakeOk {
|
|
6
6
|
protocolVersion: typeof TRANSPORT_V2_PROTOCOL_VERSION;
|
|
7
7
|
capabilities: string[];
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
export { TRANSPORT_V2_PROTOCOL_VERSION, TRANSPORT_V2_UNSUPPORTED_VERSION_CLOSE_CODE, TRANSPORT_V2_BINARY_HEADER_SIZE, TransportV2BinaryKind, TransportV2BinaryFlags, encodeTransportV2BinaryFrame, decodeTransportV2BinaryFrame, transportV2IsFin, transportV2IsText, transportV2IsAbort, parseTransportV2ControlMsg, stringifyTransportV2ControlMsg, negotiateTransportV2Capabilities } from './frames';
|
|
2
|
-
export type { TransportV2Hello, TransportV2Welcome, TransportV2BodyKind, TransportV2BodyOpen, TransportV2BodyEnd, TransportV2BodyAbort, TransportV2ControlMsg, TransportV2DecodedBinaryFrame } from './frames';
|
|
3
|
-
export { TRANSPORT_V2_DEFAULT_BODY_CHUNK_SIZE, TransportV2BodyReaderRegistry, writeTransportV2Body } from './body-streams';
|
|
4
|
-
export type { TransportV2BodyWriterIo, TransportV2BodyWriterOptions } from './body-streams';
|
|
5
|
-
export { TransportV2Codec } from './codec';
|
|
6
|
-
export type { TransportV2CodecOptions, TransportV2HandshakeOk, TransportV2RpcCall, TransportV2RpcErr, TransportV2RpcMsg, TransportV2RpcOk, TransportV2WireError } from './codec';
|
|
7
|
-
export { createTransportV2Pair } from './transport';
|
|
8
|
-
export type { TransportV2InMemoryPair, WebSocketLike, WebSocketLikeCloseEvent, WebSocketLikeMessageEvent } from './transport';
|
|
9
|
-
export { deserializeRequestV2, deserializeResponseV2, serializeRequestV2, serializeResponseV2 } from './serialization';
|
|
10
|
-
export type { TransportV2BodyRef, TransportV2SerializedRequest, TransportV2SerializedResponse } from './serialization';
|
|
1
|
+
export { TRANSPORT_V2_PROTOCOL_VERSION, TRANSPORT_V2_UNSUPPORTED_VERSION_CLOSE_CODE, TRANSPORT_V2_BINARY_HEADER_SIZE, TransportV2BinaryKind, TransportV2BinaryFlags, encodeTransportV2BinaryFrame, decodeTransportV2BinaryFrame, transportV2IsFin, transportV2IsText, transportV2IsAbort, parseTransportV2ControlMsg, stringifyTransportV2ControlMsg, negotiateTransportV2Capabilities } from './frames.js';
|
|
2
|
+
export type { TransportV2Hello, TransportV2Welcome, TransportV2BodyKind, TransportV2BodyOpen, TransportV2BodyEnd, TransportV2BodyAbort, TransportV2ControlMsg, TransportV2DecodedBinaryFrame } from './frames.js';
|
|
3
|
+
export { TRANSPORT_V2_DEFAULT_BODY_CHUNK_SIZE, TransportV2BodyReaderRegistry, writeTransportV2Body } from './body-streams.js';
|
|
4
|
+
export type { TransportV2BodyWriterIo, TransportV2BodyWriterOptions } from './body-streams.js';
|
|
5
|
+
export { TransportV2Codec } from './codec.js';
|
|
6
|
+
export type { TransportV2CodecOptions, TransportV2HandshakeOk, TransportV2RpcCall, TransportV2RpcErr, TransportV2RpcMsg, TransportV2RpcOk, TransportV2WireError } from './codec.js';
|
|
7
|
+
export { createTransportV2Pair } from './transport.js';
|
|
8
|
+
export type { TransportV2InMemoryPair, WebSocketLike, WebSocketLikeCloseEvent, WebSocketLikeMessageEvent } from './transport.js';
|
|
9
|
+
export { deserializeRequestV2, deserializeResponseV2, serializeRequestV2, serializeResponseV2 } from './serialization.js';
|
|
10
|
+
export type { TransportV2BodyRef, TransportV2SerializedRequest, TransportV2SerializedResponse } from './serialization.js';
|
|
11
11
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"value-serialization.d.ts","sourceRoot":"","sources":["../../../src/bridge/v2/value-serialization.ts"],"names":[],"mappings":"AAgBA,8BAA8B;AAC9B,MAAM,WAAW,iBAAiB;IACjC,GAAG,EAAE,MAAM,CAAA;IACX,MAAM,EAAE,MAAM,CAAA;IACd,OAAO,EAAE,CAAC,MAAM,EAAE,MAAM,CAAC,EAAE,CAAA;IAC3B,IAAI,CAAC,EAAE,OAAO,GAAG,IAAI,CAAA;IACrB,QAAQ,CAAC,EAAE,QAAQ,GAAG,OAAO,GAAG,QAAQ,CAAA;IACxC,EAAE,CAAC,EAAE,OAAO,CAAA;CACZ;AAED,+BAA+B;AAC/B,MAAM,WAAW,kBAAkB;IAClC,MAAM,EAAE,MAAM,CAAA;IACd,UAAU,CAAC,EAAE,MAAM,CAAA;IACnB,OAAO,EAAE,CAAC,MAAM,EAAE,MAAM,CAAC,EAAE,CAAA;IAC3B,IAAI,CAAC,EAAE,OAAO,GA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K,EAAE,OAAO,CAAA;IACd,OAAO,EAAE,SAAS,EAAE,CAAA;CACpB,CAAC,CAMD;AAyFD,yDAAyD;AACzD,wBAAgB,gBAAgB,CAC/B,KAAK,EAAE,OAAO,EACd,SAAS,CAAC,EAAE,CAAC,GAAG,EAAE,MAAM,KAAK,cAAc,CAAC,UAAU,CAAC,GAAG,IAAI,GAC5D,OAAO,CAkFT;AAyHD,yCAAyC;AACzC,wBAAgB,YAAY,CAAC,KAAK,EAAE,UAAU,GAAG,MAAM,CAWtD;AAED,yCAAyC;AACzC,wBAAgB,YAAY,CAAC,GAAG,EAAE,MAAM,GAAG,UAAU,CAYpD"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import type { TransportV2Codec } from './codec';
|
|
2
|
-
import type { TransportV2AuxMsg } from './control-messages';
|
|
3
|
-
import type { TransportV2DecodedBinaryFrame } from './frames';
|
|
1
|
+
import type { TransportV2Codec } from './codec.js';
|
|
2
|
+
import type { TransportV2AuxMsg } from './control-messages.js';
|
|
3
|
+
import type { TransportV2DecodedBinaryFrame } from './frames.js';
|
|
4
4
|
export interface TransportV2WsProxyHandlers {
|
|
5
5
|
onMessage?: (data: string | Uint8Array) => void;
|
|
6
6
|
onClose?: (code?: number, reason?: string) => void;
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
export { createBrowserShim, type BrowserShimOptions, type BrowserShim } from './server';
|
|
2
|
-
export { createBrowserNodeHandler, type BrowserNodeHandlerOptions } from './handler';
|
|
1
|
+
export { createBrowserShim, type BrowserShimOptions, type BrowserShim } from './server.js';
|
|
2
|
+
export { createBrowserNodeHandler, type BrowserNodeHandlerOptions } from './handler.js';
|
|
3
3
|
//# sourceMappingURL=index.d.ts.map
|