@feltdb/feltkit 0.3.7 → 0.3.9

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.
Files changed (91) hide show
  1. package/dist/app.d.ts +63 -1
  2. package/dist/app.js +57 -1
  3. package/dist/app.js.map +1 -1
  4. package/dist/cli/cloudflare.d.ts +20 -0
  5. package/dist/cli/cloudflare.js +128 -0
  6. package/dist/cli/cloudflare.js.map +1 -0
  7. package/dist/cli/deploy.d.ts +7 -4
  8. package/dist/cli/deploy.js +217 -7
  9. package/dist/cli/deploy.js.map +1 -1
  10. package/dist/cli/main.js +125 -37
  11. package/dist/cli/main.js.map +1 -1
  12. package/dist/cli/vercel.d.ts +8 -2
  13. package/dist/cli/vercel.js +23 -11
  14. package/dist/cli/vercel.js.map +1 -1
  15. package/dist/client/index.d.ts +73 -0
  16. package/dist/client/index.js +98 -0
  17. package/dist/client/index.js.map +1 -1
  18. package/dist/dashboard/assets/{index-dGaQg6ak.css → index-91I1zDK-.css} +1 -1
  19. package/dist/dashboard/assets/index-BhFOquA7.js +15 -0
  20. package/dist/dashboard/index.html +2 -2
  21. package/dist/errors.d.ts +3 -1
  22. package/dist/errors.js +2 -0
  23. package/dist/errors.js.map +1 -1
  24. package/dist/index.d.ts +1 -1
  25. package/dist/index.js.map +1 -1
  26. package/dist/react/index.d.ts +10 -0
  27. package/dist/react/index.js +6 -0
  28. package/dist/react/index.js.map +1 -1
  29. package/dist/runtime/account-links.d.ts +19 -0
  30. package/dist/runtime/account-links.js +45 -0
  31. package/dist/runtime/account-links.js.map +1 -0
  32. package/dist/runtime/accounts.d.ts +76 -0
  33. package/dist/runtime/accounts.js +222 -0
  34. package/dist/runtime/accounts.js.map +1 -0
  35. package/dist/runtime/agent.d.ts +1 -0
  36. package/dist/runtime/agent.js +5 -1
  37. package/dist/runtime/agent.js.map +1 -1
  38. package/dist/runtime/authority.d.ts +1 -0
  39. package/dist/runtime/authority.js +3 -0
  40. package/dist/runtime/authority.js.map +1 -1
  41. package/dist/runtime/contract.js +3 -0
  42. package/dist/runtime/contract.js.map +1 -1
  43. package/dist/runtime/data.js +4 -3
  44. package/dist/runtime/data.js.map +1 -1
  45. package/dist/runtime/deployment.js +2 -2
  46. package/dist/runtime/mail.d.ts +34 -0
  47. package/dist/runtime/mail.js +40 -0
  48. package/dist/runtime/mail.js.map +1 -0
  49. package/dist/runtime/projects.d.ts +3 -0
  50. package/dist/runtime/projects.js +1 -1
  51. package/dist/runtime/projects.js.map +1 -1
  52. package/dist/runtime/readiness.js +28 -2
  53. package/dist/runtime/readiness.js.map +1 -1
  54. package/dist/runtime/runtime.d.ts +32 -0
  55. package/dist/runtime/runtime.js +145 -5
  56. package/dist/runtime/runtime.js.map +1 -1
  57. package/dist/runtime/services.d.ts +16 -1
  58. package/dist/runtime/services.js +12 -0
  59. package/dist/runtime/services.js.map +1 -1
  60. package/dist/runtime/sessions.d.ts +2 -0
  61. package/dist/runtime/sessions.js +7 -0
  62. package/dist/runtime/sessions.js.map +1 -1
  63. package/dist/runtime/storage-check.js +1 -1
  64. package/dist/runtime/storage-check.js.map +1 -1
  65. package/dist/runtime/targets.d.ts +24 -10
  66. package/dist/runtime/targets.js +63 -5
  67. package/dist/runtime/targets.js.map +1 -1
  68. package/dist/server/admin.js +11 -0
  69. package/dist/server/admin.js.map +1 -1
  70. package/dist/server/agent-connect.d.ts +18 -0
  71. package/dist/server/agent-connect.js +18 -0
  72. package/dist/server/agent-connect.js.map +1 -0
  73. package/dist/server/index.d.ts +9 -0
  74. package/dist/server/index.js +109 -4
  75. package/dist/server/index.js.map +1 -1
  76. package/dist/server/oauth.d.ts +37 -0
  77. package/dist/server/oauth.js +165 -0
  78. package/dist/server/oauth.js.map +1 -0
  79. package/dist/server/production.d.ts +2 -2
  80. package/dist/server/production.js +4 -4
  81. package/dist/server/production.js.map +1 -1
  82. package/dist/server/project.d.ts +13 -0
  83. package/dist/server/project.js +64 -3
  84. package/dist/server/project.js.map +1 -1
  85. package/package.json +6 -5
  86. package/skills/.claude-plugin/marketplace.json +1 -1
  87. package/skills/.claude-plugin/plugin.json +1 -1
  88. package/skills/feltkit-agent/SKILL.md +11 -1
  89. package/skills/feltkit-build/SKILL.md +2 -0
  90. package/skills/feltkit-operations/SKILL.md +2 -1
  91. package/dist/dashboard/assets/index-OfCJSyfP.js +0 -15
package/dist/app.d.ts CHANGED
@@ -13,7 +13,11 @@ import type { MutationCtx, QueryCtx } from "./runtime/context.js";
13
13
  declare const APP: unique symbol;
14
14
  declare const COLLECTION: unique symbol;
15
15
  declare const FUNCTION: unique symbol;
16
- /** Collection names owned by the layers underneath. Application collections may not use them. */
16
+ /**
17
+ * Collection names owned by the layers underneath. Application collections may not use them.
18
+ * The AppPort Services part is AppPort Services' own SERVICE_COLLECTIONS, written out so the app
19
+ * definition does not load that package; a test fails when the two differ.
20
+ */
17
21
  export declare const RESERVED_COLLECTIONS: Set<string>;
18
22
  export interface DevUser {
19
23
  /** Stable principal id. */
@@ -29,6 +33,50 @@ export interface PrincipalInput {
29
33
  displayName?: string;
30
34
  roles: string[];
31
35
  }
36
+ /** Built-in accounts. See `auth.accounts`. */
37
+ export interface AccountsOptions {
38
+ /** Roles a new account gets. Each must be declared in `roles`. */
39
+ roles: string[];
40
+ /** `false` closes sign-up; existing accounts still sign in. Default open. */
41
+ signUp?: boolean;
42
+ /**
43
+ * Account e-mail (verifying an address, resetting a password), delivered by AppPort Services'
44
+ * notifications through Mailerport. Development keeps every message in a local inbox (printed
45
+ * by `feltkit dev`); production sends through the Mailerport service at MAILPORT_URL with
46
+ * MAILPORT_API_KEY. Turns on `services.notifications`.
47
+ */
48
+ email?: AccountEmailOptions;
49
+ }
50
+ export interface AccountEmailOptions {
51
+ /** The sender address, e.g. "auth@example.com". Register it on your Mailerport service as `identity`. */
52
+ from: string;
53
+ /** Mailerport sender identity. Default "auth". */
54
+ identity?: string;
55
+ /** "required": an account signs in only once its address is verified. Default "optional": a verification e-mail is sent and the session says whether the address is verified. */
56
+ verify?: "required" | "optional";
57
+ }
58
+ /** A sign-in provider: its OAuth client id, and where its client secret is kept. */
59
+ export interface ProviderClient {
60
+ clientId: string;
61
+ /** Default `credential-ref:<provider id>-client-secret`. */
62
+ clientSecret?: `credential-ref:${string}`;
63
+ }
64
+ /** Any OpenID Connect provider (Microsoft, Okta, Auth0, GitLab, …), found by its issuer's discovery document. */
65
+ export interface OidcProvider extends ProviderClient {
66
+ /** Lowercase letters, digits, dashes; used in its URLs and its default credential. */
67
+ id: string;
68
+ /** Shown on the sign-in button. Default: the id. */
69
+ name?: string;
70
+ /** The issuer, e.g. "https://login.microsoftonline.com/<tenant>/v2.0". */
71
+ issuer: string;
72
+ /** Default ["openid", "email", "profile"]. */
73
+ scopes?: string[];
74
+ }
75
+ export interface SignInProviders {
76
+ google?: ProviderClient;
77
+ github?: ProviderClient;
78
+ oidc?: OidcProvider[];
79
+ }
32
80
  export interface AuthenticateRequest {
33
81
  method: string;
34
82
  path: string;
@@ -53,6 +101,20 @@ export interface FeltKitOptions {
53
101
  authenticate?: (request: AuthenticateRequest) => PrincipalInput | null | Promise<PrincipalInput | null>;
54
102
  /** Session lifetime. Default 7 days. */
55
103
  sessionTtlMs?: number;
104
+ /**
105
+ * Built-in accounts: people sign up and sign in to the app with an e-mail address and a
106
+ * password, stored in the app's own FeltDB (only a scrypt hash of the password). A new
107
+ * account gets `roles`, which must be declared in `roles`. `signUp: false` closes sign-up
108
+ * (existing accounts still sign in).
109
+ */
110
+ accounts?: AccountsOptions;
111
+ /**
112
+ * Sign in with Google, GitHub, or any OpenID Connect provider: set a provider's client id
113
+ * here and its client secret as a credential (`credential-ref:<id>-client-secret` by default,
114
+ * that is FELTKIT_CREDENTIAL_GOOGLE_CLIENT_SECRET). Needs `accounts`: a person who signs in
115
+ * with a provider gets the account for that provider's verified e-mail address.
116
+ */
117
+ providers?: SignInProviders;
56
118
  };
57
119
  /** Development-only identities you can sign in as. Ignored outside development and test. */
58
120
  dev?: {
package/dist/app.js CHANGED
@@ -3,7 +3,11 @@ import { RESERVED_FIELDS, shapeToObjectSchema } from "./schema.js";
3
3
  const APP = Symbol.for("feltkit.app");
4
4
  const COLLECTION = Symbol.for("feltkit.collection");
5
5
  const FUNCTION = Symbol.for("feltkit.function");
6
- /** Collection names owned by the layers underneath. Application collections may not use them. */
6
+ /**
7
+ * Collection names owned by the layers underneath. Application collections may not use them.
8
+ * The AppPort Services part is AppPort Services' own SERVICE_COLLECTIONS, written out so the app
9
+ * definition does not load that package; a test fails when the two differ.
10
+ */
7
11
  export const RESERVED_COLLECTIONS = new Set([
8
12
  // AppPort Services (every service it can construct on the shared instance)
9
13
  "files",
@@ -26,6 +30,10 @@ export const RESERVED_COLLECTIONS = new Set([
26
30
  "ConfigurationVariables",
27
31
  "ConfigurationSecrets",
28
32
  "ConfigurationAuditEvents",
33
+ // Configuration's secret custody (AppPort Services 0.9+).
34
+ "Secrets",
35
+ "SecretVersions",
36
+ "SecretAuditEvents",
29
37
  ]);
30
38
  const RESERVED_PREFIXES = ["_feltkit", "_flow", "_feltdb", "_appport"];
31
39
  export class FeltKitApp {
@@ -48,6 +56,54 @@ export class FeltKitApp {
48
56
  throw new TypeError(`Dev user "${user.id}" has role "${role}", which is not declared in roles.`);
49
57
  }
50
58
  }
59
+ const accounts = options.auth?.accounts;
60
+ if (accounts !== undefined) {
61
+ if (!Array.isArray(accounts.roles) || accounts.roles.length === 0)
62
+ throw new TypeError("auth.accounts needs the roles a new account gets: { roles: [\"member\"] }.");
63
+ for (const role of accounts.roles) {
64
+ if (!options.roles?.[role])
65
+ throw new TypeError(`auth.accounts gives new accounts role "${role}", which is not declared in roles.`);
66
+ }
67
+ const email = accounts.email;
68
+ if (email !== undefined) {
69
+ if (typeof email?.from !== "string" || !/^[^\s@<>]+@[^\s@<>]+\.[^\s@<>]+$/.test(email.from))
70
+ throw new TypeError('auth.accounts.email needs the sender address: { from: "auth@example.com" }.');
71
+ if (email.identity !== undefined && !/^[a-z][a-z0-9_-]{0,63}$/.test(email.identity))
72
+ throw new TypeError("auth.accounts.email.identity is a Mailerport identity name: lowercase letters, digits, - and _.");
73
+ if (email.verify !== undefined && email.verify !== "required" && email.verify !== "optional")
74
+ throw new TypeError('auth.accounts.email.verify is "required" or "optional".');
75
+ }
76
+ }
77
+ const providers = options.auth?.providers;
78
+ if (providers !== undefined) {
79
+ if (!accounts)
80
+ throw new TypeError("auth.providers needs auth.accounts: a person who signs in with a provider gets an account, with its roles.");
81
+ const ids = new Set();
82
+ const check = (id, p) => {
83
+ if (!p)
84
+ return;
85
+ if (!/^[a-z][a-z0-9-]{0,31}$/.test(id))
86
+ throw new TypeError(`Sign-in provider id "${id}" must be lowercase letters, digits, and dashes.`);
87
+ if (ids.has(id))
88
+ throw new TypeError(`Sign-in provider "${id}" is declared twice.`);
89
+ ids.add(id);
90
+ if (typeof p.clientId !== "string" || !p.clientId.trim())
91
+ throw new TypeError(`auth.providers: ${id} needs its OAuth clientId.`);
92
+ if (p.clientSecret !== undefined && !/^credential-ref:[A-Za-z0-9][A-Za-z0-9._:-]{0,199}$/.test(p.clientSecret))
93
+ throw new TypeError(`auth.providers: ${id}.clientSecret is a credential reference ("credential-ref:<id>"), never the secret itself.`);
94
+ };
95
+ check("google", providers.google);
96
+ check("github", providers.github);
97
+ for (const p of providers.oidc ?? []) {
98
+ check(p.id, p);
99
+ // http only on this machine (a local test issuer); production refuses even that.
100
+ if (typeof p.issuer !== "string" || !/^(https:\/\/|http:\/\/(localhost|127\.0\.0\.1)(:\d+)?(\/|$))/.test(p.issuer))
101
+ throw new TypeError(`auth.providers: ${p.id}.issuer must be an https URL.`);
102
+ }
103
+ }
104
+ // Account e-mail is delivered by AppPort Services' notifications.
105
+ if (accounts?.email && !options.services?.notifications)
106
+ options = { ...options, services: { ...options.services, notifications: true } };
51
107
  this.options = Object.freeze({ ...options });
52
108
  }
53
109
  get name() {
package/dist/app.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"app.js","sourceRoot":"","s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AAU,CAAC,CAAC,CAAC,EAAE,UAAU,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;YACrC,OAAO,EAAE,MAAM,CAAC,OAAO;YACvB,GAAG,EAAE,IAAI;SACV,CAAC,CAAC;IACL,CAAC;CACF;AAED,oCAAoC;AACpC,MAAM,UAAU,OAAO,CAAC,OAAuB;IAC7C,OAAO,IAAI,UAAU,CAAC,OAAO,CAAC,CAAC;AACjC,CAAC;AAED,MAAM,UAAU,YAAY,CAAC,KAAc;IACzC,OAAO,OAAO,KAAK,KAAK,QAAQ,IAAI,KAAK,KAAK,IAAI,IAAK,KAAiC,CAAC,GAAG,CAAC,KAAK,IAAI,CAAC;AACzG,CAAC;AAED,MAAM,UAAU,oBAAoB,CAAC,KAAc;IACjD,OAAO,OAAO,KAAK,KAAK,QAAQ,IAAI,KAAK,KAAK,IAAI,IAAK,KAAiC,CAAC,QAAQ,CAAC,KAAK,IAAI,CAAC;AAC9G,CAAC;AAED,MAAM,UAAU,sBAAsB,CAAC,KAAc;IACnD,OAAO,OAAO,KAAK,KAAK,QAAQ,IAAI,KAAK,KAAK,IAAI,IAAK,KAAiC,CAAC,UAAU,CAAC,KAAK,IAAI,CAAC;AAChH,CAAC"}
@@ -0,0 +1,20 @@
1
+ import type { VercelEnvPlan } from "./vercel.js";
2
+ /** wrangler and the containers library the artifact pins (both published at least two weeks before they were pinned). */
3
+ export declare const WRANGLER_VERSION = "4.151.2";
4
+ export declare const CONTAINERS_VERSION = "0.3.7";
5
+ /** wrangler builds the image with the local Docker: say so before uploading anything. */
6
+ export declare function ensureDocker(artifact: string): Promise<void>;
7
+ /** The artifact's wrangler and @cloudflare/containers, installed once (FELTKIT_WRANGLER_CLI skips it). */
8
+ export declare function ensureCloudflareTools(artifact: string, report: (line: string) => void): Promise<void>;
9
+ /** The URL wrangler printed for the Worker: its workers.dev address, else the last https URL that is not Cloudflare's dashboard. */
10
+ export declare function workerUrl(output: string): string | null;
11
+ /** `wrangler secret bulk` with the plan's values as JSON on stdin (the Worker must exist: deploy once first). */
12
+ export declare function uploadCloudflareSecrets(plan: VercelEnvPlan): Promise<void>;
13
+ /**
14
+ * `wrangler deploy --secrets-file`: the code, the image and the secrets in one step. wrangler's
15
+ * output is shown as it runs (scrubbed of the values) and read for the Worker's URL.
16
+ */
17
+ export declare function cloudflareDeploy(plan: VercelEnvPlan): Promise<{
18
+ code: number;
19
+ url: string | null;
20
+ }>;
@@ -0,0 +1,128 @@
1
+ /**
2
+ * `feltkit cloudflare env` and `feltkit cloudflare deploy`: set a Cloudflare Worker's secrets from
3
+ * the values FeltDB gave you, then deploy, for an artifact built with `feltkit deploy --target cloudflare`.
4
+ *
5
+ * What is uploaded is exactly what `feltkit vercel env` would upload (planPlatformEnv: the
6
+ * artifact's variables, FeltKit's settings and credentials; never the control key, FELTDB_MANAGED_*
7
+ * or VITE_*), all as Worker secrets: the artifact's Worker passes them to the container. `deploy`
8
+ * sends them with the code in one `wrangler deploy --secrets-file`, from a file only this user can
9
+ * read that is deleted as soon as wrangler returns; `env` sends them with `wrangler secret bulk` on
10
+ * stdin. Values are never printed or put in argv.
11
+ *
12
+ * wrangler builds the container image with the local Docker, so Docker must be running. wrangler
13
+ * and @cloudflare/containers are the artifact's own devDependencies (pinned by `feltkit deploy`),
14
+ * installed into it on first use; the image installs only the app's runtime dependencies.
15
+ */
16
+ import { spawn } from "node:child_process";
17
+ import { existsSync, mkdtempSync, rmSync, writeFileSync } from "node:fs";
18
+ import { tmpdir } from "node:os";
19
+ import { join } from "node:path";
20
+ import { FeltKitError } from "../errors.js";
21
+ /** wrangler and the containers library the artifact pins (both published at least two weeks before they were pinned). */
22
+ export const WRANGLER_VERSION = "4.151.2";
23
+ export const CONTAINERS_VERSION = "0.3.7";
24
+ function run(command, args, options) {
25
+ return new Promise((done, fail) => {
26
+ const child = spawn(command, args, { cwd: options.cwd, stdio: [options.input === undefined ? "inherit" : "pipe", "pipe", "pipe"] });
27
+ let output = "";
28
+ const take = (chunk) => {
29
+ output += chunk;
30
+ if (options.show)
31
+ process.stderr.write(chunk);
32
+ };
33
+ child.stdout.on("data", take);
34
+ child.stderr.on("data", take);
35
+ child.once("error", (error) => fail(new FeltKitError("UNAVAILABLE", `Could not run ${command}: ${error.message}`)));
36
+ child.once("exit", (code) => done({ code: code ?? 1, output }));
37
+ if (options.input !== undefined)
38
+ child.stdin.end(options.input);
39
+ });
40
+ }
41
+ /** wrangler: FELTKIT_WRANGLER_CLI (a path), else the artifact's own (npx, after installing it). */
42
+ function wranglerCommand(args) {
43
+ const cli = process.env.FELTKIT_WRANGLER_CLI;
44
+ return cli ? [cli, args] : ["npx", ["--no-install", "wrangler", ...args]];
45
+ }
46
+ /** wrangler builds the image with the local Docker: say so before uploading anything. */
47
+ export async function ensureDocker(artifact) {
48
+ const docker = process.env.FELTKIT_DOCKER_CLI ?? "docker";
49
+ let result;
50
+ try {
51
+ result = await run(docker, ["info", "--format", "{{.ServerVersion}}"], { cwd: artifact });
52
+ }
53
+ catch {
54
+ result = { code: 1, output: "" };
55
+ }
56
+ if (result.code !== 0) {
57
+ throw new FeltKitError("UNAVAILABLE", "Docker is not running here, and Cloudflare Containers builds the app's image with it (`wrangler deploy` runs `docker build`). Nothing was uploaded.", {
58
+ hint: "Start Docker Desktop (or the Docker daemon), then run this again.",
59
+ });
60
+ }
61
+ }
62
+ /** The artifact's wrangler and @cloudflare/containers, installed once (FELTKIT_WRANGLER_CLI skips it). */
63
+ export async function ensureCloudflareTools(artifact, report) {
64
+ if (process.env.FELTKIT_WRANGLER_CLI)
65
+ return;
66
+ if (existsSync(join(artifact, "node_modules", "wrangler")) && existsSync(join(artifact, "node_modules", "@cloudflare", "containers")))
67
+ return;
68
+ report(`Installing wrangler ${WRANGLER_VERSION} and @cloudflare/containers ${CONTAINERS_VERSION} into the artifact (once)…`);
69
+ const installed = await run("npm", ["install", "--no-audit", "--no-fund"], { cwd: artifact });
70
+ if (installed.code !== 0)
71
+ throw new FeltKitError("UNAVAILABLE", `npm install in ${artifact} failed (exit ${installed.code}); nothing was uploaded.`, { hint: installed.output.trim().split("\n").slice(-4).join("\n") });
72
+ }
73
+ /** The URL wrangler printed for the Worker: its workers.dev address, else the last https URL that is not Cloudflare's dashboard. */
74
+ export function workerUrl(output) {
75
+ const urls = (output.match(/https:\/\/[^\s"'`)\]]+/g) ?? []).map((url) => url.replace(/[.,;]$/, "").replace(/\/$/, ""));
76
+ const dev = urls.filter((url) => /\.workers\.dev$/.test(new URL(url).hostname));
77
+ if (dev.length)
78
+ return dev[dev.length - 1];
79
+ const own = urls.filter((url) => !/(^|\.)cloudflare\.com$/.test(new URL(url).hostname));
80
+ return own.length ? own[own.length - 1] : null;
81
+ }
82
+ /** Scrubs every planned value out of text before it is shown. */
83
+ function scrub(text, plan) {
84
+ let out = text;
85
+ for (const value of Object.values(plan.values))
86
+ if (value.length >= 4)
87
+ out = out.split(value).join("…");
88
+ return out;
89
+ }
90
+ /** `wrangler secret bulk` with the plan's values as JSON on stdin (the Worker must exist: deploy once first). */
91
+ export async function uploadCloudflareSecrets(plan) {
92
+ const [command, args] = wranglerCommand(["secret", "bulk"]);
93
+ const result = await run(command, args, { cwd: plan.artifact, input: JSON.stringify(plan.values) });
94
+ if (result.code !== 0) {
95
+ throw new FeltKitError("UNAVAILABLE", `wrangler secret bulk failed (exit ${result.code}).`, {
96
+ hint: `${scrub(result.output, plan).trim().split("\n").slice(-4).join("\n")}\nA Worker that was never deployed has no secrets to set: run \`npx feltkit cloudflare deploy\`.`,
97
+ });
98
+ }
99
+ }
100
+ /**
101
+ * `wrangler deploy --secrets-file`: the code, the image and the secrets in one step. wrangler's
102
+ * output is shown as it runs (scrubbed of the values) and read for the Worker's URL.
103
+ */
104
+ export async function cloudflareDeploy(plan) {
105
+ const dir = mkdtempSync(join(tmpdir(), "feltkit-cloudflare-"));
106
+ const file = join(dir, "secrets.json");
107
+ try {
108
+ writeFileSync(file, JSON.stringify(plan.values), { mode: 0o600 });
109
+ const [command, args] = wranglerCommand(["deploy", "--secrets-file", file]);
110
+ const result = await new Promise((done, fail) => {
111
+ const child = spawn(command, args, { cwd: plan.artifact, stdio: ["inherit", "pipe", "pipe"] });
112
+ let output = "";
113
+ const show = (chunk) => {
114
+ output += chunk;
115
+ process.stderr.write(scrub(String(chunk), plan));
116
+ };
117
+ child.stdout.on("data", show);
118
+ child.stderr.on("data", show);
119
+ child.once("error", (error) => fail(new FeltKitError("UNAVAILABLE", `Could not run wrangler (${command}): ${error.message}`)));
120
+ child.once("exit", (code) => done({ code: code ?? 1, output }));
121
+ });
122
+ return { code: result.code, url: result.code === 0 ? workerUrl(result.output) : null };
123
+ }
124
+ finally {
125
+ rmSync(dir, { recursive: true, force: true });
126
+ }
127
+ }
128
+ //# sourceMappingURL=cloudflare.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"cloudflare.js","sourceRoot":"","sources":["../../src/cli/cloudflare.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AACH,OAAO,EAAE,KAAK,EAAE,MAAM,oBAAoB,CAAC;AAC3C,OAAO,EAAE,UAAU,EAAE,WAAW,EAAE,MAAM,EAAE,aAAa,EAAE,MAAM,SAAS,CAAC;AACzE,OAAO,EAAE,MAAM,EAAE,MAAM,SAAS,CAAC;AACjC,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AACjC,OAAO,EAAE,YAAY,EAAE,MAAM,cAAc,CAAC;AAG5C,yHAAyH;AACzH,MAAM,CAAC,MAAM,gBAAgB,GAAG,SAAS,CAAC;AAC1C,MAAM,CAAC,MAAM,kBAAkB,GAAG,OAAO,CAAC;AAE1C,SAAS,GAAG,CAAC,OAAe,EAAE,IAAc,EAAE,OAAwD;IACpG,OAAO,IAAI,OAAO,CAAC,CAAC,IAAI,EAAE,IAAI,EAAE,EAAE;QAChC,MAAM,KAAK,GAAG,KAAK,CAAC,OAAO,EAAE,IAAI,EAAE,EAAE,GAAG,EAAE,OAAO,CAAC,GAAG,EAAE,KAAK,EAAE,CA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AC;QAClE,CAAC,CAAC,CAAC;QACH,OAAO,EAAE,IAAI,EAAE,MAAM,CAAC,IAAI,EAAE,GAAG,EAAE,MAAM,CAAC,IAAI,KAAK,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,IAAI,EAAE,CAAC;IACzF,CAAC;YAAS,CAAC;QACT,MAAM,CAAC,GAAG,EAAE,EAAE,SAAS,EAAE,IAAI,EAAE,KAAK,EAAE,IAAI,EAAE,CAAC,CAAC;IAChD,CAAC;AACH,CAAC"}
@@ -1,18 +1,19 @@
1
- import { DEPLOY_TARGETS, VERCEL_DATA, type DeployTarget, type StorageMode, type VercelData } from "../runtime/targets.js";
2
- export { DEPLOY_TARGETS, VERCEL_DATA, type DeployTarget, type VercelData };
1
+ import { DEPLOY_TARGETS, PLATFORM_DATA, VERCEL_DATA, type DeployTarget, type PlatformData, type StorageMode, type VercelData } from "../runtime/targets.js";
2
+ export { DEPLOY_TARGETS, PLATFORM_DATA, VERCEL_DATA, type DeployTarget, type PlatformData, type VercelData };
3
3
  export { DEPLOY_DIR } from "../runtime/deployment.js";
4
4
  export declare function deploy(options: {
5
5
  projectDir: string;
6
6
  out?: string;
7
7
  target?: DeployTarget;
8
- data?: VercelData;
8
+ data?: PlatformData;
9
+ instances?: number;
9
10
  }): Promise<{
10
11
  dir: string;
11
12
  application: string;
12
13
  build: import("../server/project.js").BuildResult;
13
14
  apiKeys: boolean;
14
15
  target: DeployTarget;
15
- data: VercelData | undefined;
16
+ data: PlatformData | undefined;
16
17
  storage: StorageMode;
17
18
  services: string[];
18
19
  credentialRefs: string[];
@@ -21,3 +22,5 @@ export declare function deploy(options: {
21
22
  /** Sentence case to mid-sentence: only the first letter. */
22
23
  export declare const lower: (text: string) => string;
23
24
  export declare const variable: (ref: string) => string;
25
+ /** The compatibility date the Worker is built for: one the pinned wrangler (WRANGLER_VERSION) knows. */
26
+ export declare const CLOUDFLARE_COMPATIBILITY_DATE = "2026-10-01";