@feltdb/feltkit 0.0.0-stage → 0.1.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.
Files changed (91) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +22 -2
  3. package/bin/feltkit.js +3 -0
  4. package/dist/app.d.ts +151 -0
  5. package/dist/app.js +130 -0
  6. package/dist/app.js.map +1 -0
  7. package/dist/cli/deploy.d.ts +8 -0
  8. package/dist/cli/deploy.js +125 -0
  9. package/dist/cli/deploy.js.map +1 -0
  10. package/dist/cli/main.d.ts +9 -0
  11. package/dist/cli/main.js +365 -0
  12. package/dist/cli/main.js.map +1 -0
  13. package/dist/cli/output.d.ts +18 -0
  14. package/dist/cli/output.js +87 -0
  15. package/dist/cli/output.js.map +1 -0
  16. package/dist/client/index.d.ts +125 -0
  17. package/dist/client/index.js +306 -0
  18. package/dist/client/index.js.map +1 -0
  19. package/dist/dashboard/assets/index-BLnBFDJs.css +1 -0
  20. package/dist/dashboard/assets/index-CxJGCspE.js +15 -0
  21. package/dist/dashboard/index.html +16 -0
  22. package/dist/errors.d.ts +31 -0
  23. package/dist/errors.js +54 -0
  24. package/dist/errors.js.map +1 -0
  25. package/dist/index.d.ts +18 -0
  26. package/dist/index.js +12 -0
  27. package/dist/index.js.map +1 -0
  28. package/dist/react/index.d.ts +40 -0
  29. package/dist/react/index.js +85 -0
  30. package/dist/react/index.js.map +1 -0
  31. package/dist/runtime/activity.d.ts +97 -0
  32. package/dist/runtime/activity.js +99 -0
  33. package/dist/runtime/activity.js.map +1 -0
  34. package/dist/runtime/authority.d.ts +78 -0
  35. package/dist/runtime/authority.js +176 -0
  36. package/dist/runtime/authority.js.map +1 -0
  37. package/dist/runtime/changes.d.ts +34 -0
  38. package/dist/runtime/changes.js +85 -0
  39. package/dist/runtime/changes.js.map +1 -0
  40. package/dist/runtime/context.d.ts +51 -0
  41. package/dist/runtime/context.js +2 -0
  42. package/dist/runtime/context.js.map +1 -0
  43. package/dist/runtime/data.d.ts +139 -0
  44. package/dist/runtime/data.js +374 -0
  45. package/dist/runtime/data.js.map +1 -0
  46. package/dist/runtime/environment.d.ts +36 -0
  47. package/dist/runtime/environment.js +62 -0
  48. package/dist/runtime/environment.js.map +1 -0
  49. package/dist/runtime/instance.d.ts +77 -0
  50. package/dist/runtime/instance.js +230 -0
  51. package/dist/runtime/instance.js.map +1 -0
  52. package/dist/runtime/loader.d.ts +11 -0
  53. package/dist/runtime/loader.js +99 -0
  54. package/dist/runtime/loader.js.map +1 -0
  55. package/dist/runtime/projects.d.ts +51 -0
  56. package/dist/runtime/projects.js +139 -0
  57. package/dist/runtime/projects.js.map +1 -0
  58. package/dist/runtime/runtime.d.ts +178 -0
  59. package/dist/runtime/runtime.js +448 -0
  60. package/dist/runtime/runtime.js.map +1 -0
  61. package/dist/runtime/services.d.ts +177 -0
  62. package/dist/runtime/services.js +418 -0
  63. package/dist/runtime/services.js.map +1 -0
  64. package/dist/runtime/sessions.d.ts +55 -0
  65. package/dist/runtime/sessions.js +107 -0
  66. package/dist/runtime/sessions.js.map +1 -0
  67. package/dist/schema.d.ts +56 -0
  68. package/dist/schema.js +44 -0
  69. package/dist/schema.js.map +1 -0
  70. package/dist/server/admin.d.ts +115 -0
  71. package/dist/server/admin.js +326 -0
  72. package/dist/server/admin.js.map +1 -0
  73. package/dist/server/http.d.ts +19 -0
  74. package/dist/server/http.js +99 -0
  75. package/dist/server/http.js.map +1 -0
  76. package/dist/server/index.d.ts +52 -0
  77. package/dist/server/index.js +296 -0
  78. package/dist/server/index.js.map +1 -0
  79. package/dist/server/mcp.d.ts +12 -0
  80. package/dist/server/mcp.js +77 -0
  81. package/dist/server/mcp.js.map +1 -0
  82. package/dist/server/project.d.ts +60 -0
  83. package/dist/server/project.js +331 -0
  84. package/dist/server/project.js.map +1 -0
  85. package/dist/server/public.d.ts +14 -0
  86. package/dist/server/public.js +15 -0
  87. package/dist/server/public.js.map +1 -0
  88. package/dist/testing/index.d.ts +20 -0
  89. package/dist/testing/index.js +64 -0
  90. package/dist/testing/index.js.map +1 -0
  91. package/package.json +84 -4
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 Randy Kendel
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md CHANGED
@@ -1,3 +1,23 @@
1
- # Temporary Holding Version
1
+ # @feltdb/feltkit
2
2
 
3
- This version is a temporary placeholder for this package. An operational version to replace this has been submitted for review and is awaiting a staged release.
3
+ The FeltKit SDK, runtime, server, CLI, React bindings, and dashboard.
4
+
5
+ ```bash
6
+ npm create feltkit@latest my-app && cd my-app && npm install && npm run dev
7
+ ```
8
+
9
+ | Import | Use |
10
+ |---|---|
11
+ | `@feltdb/feltkit` | `feltkit()`, `s`, collections, `app.query`, `app.mutation`, `fail`, types |
12
+ | `@feltdb/feltkit/client` | `createClient`, `createApi`, `ref` — call functions from a browser or Node |
13
+ | `@feltdb/feltkit/react` | `FeltKitProvider`, `useQuery`, `useQueryState`, `useMutation`, `useSession`, `useConnectionState` |
14
+ | `@feltdb/feltkit/testing` | `createTestApp()` — run the app in-process against an isolated FeltDB instance |
15
+ | `@feltdb/feltkit/server` | `startServer` and friends, for embedding |
16
+ | bin `feltkit` | `create`, `dev`, `build`, `start`, `test`, `inspect`, `deploy`, `session`, `doctor`, `codegen` |
17
+
18
+ Built on [`@feltdb/core`](https://www.npmjs.com/package/@feltdb/core),
19
+ [`@appport/sdk`](https://www.npmjs.com/package/@appport/sdk), and
20
+ [`@appport/services`](https://www.npmjs.com/package/@appport/services). Every component
21
+ of a FeltKit application shares one FeltDB instance per environment.
22
+
23
+ Documentation: https://github.com/rkendel1/concave#readme
package/bin/feltkit.js ADDED
@@ -0,0 +1,3 @@
1
+ #!/usr/bin/env node
2
+ import { run } from "../dist/cli/main.js";
3
+ await run();
package/dist/app.d.ts ADDED
@@ -0,0 +1,151 @@
1
+ /**
2
+ * The application definition: what a developer writes.
3
+ *
4
+ * Definitions are plain data. Nothing here opens a database, starts a server, or
5
+ * registers anything globally; the runtime (`FeltKitRuntime`) reads these
6
+ * definitions and wires them to the environment's single FeltDB instance.
7
+ */
8
+ import type { Schema } from "@appport/sdk";
9
+ import { type Doc, type InferShape, type ShapeInput, type Simplify } from "./schema.js";
10
+ import type { MutationCtx, QueryCtx } from "./runtime/context.js";
11
+ declare const APP: unique symbol;
12
+ declare const COLLECTION: unique symbol;
13
+ declare const FUNCTION: unique symbol;
14
+ /** Collection names owned by the layers underneath. Application collections may not use them. */
15
+ export declare const RESERVED_COLLECTIONS: Set<string>;
16
+ export interface DevUser {
17
+ /** Stable principal id. */
18
+ id: string;
19
+ name?: string;
20
+ /** Role names from `roles`. */
21
+ roles: string[];
22
+ type?: "user" | "agent" | "service";
23
+ }
24
+ export interface PrincipalInput {
25
+ id: string;
26
+ type?: "user" | "agent" | "service";
27
+ displayName?: string;
28
+ roles: string[];
29
+ }
30
+ export interface AuthenticateRequest {
31
+ method: string;
32
+ path: string;
33
+ headers: Readonly<Record<string, string | undefined>>;
34
+ }
35
+ export interface FeltKitOptions {
36
+ /** Application name. Used as the AppPort application id and the FeltDB namespace. */
37
+ name: string;
38
+ version?: string;
39
+ description?: string;
40
+ /**
41
+ * Role → permissions. Permissions are AppPort permission strings; `tasks.*` grants
42
+ * every `tasks.` permission and `*` grants everything.
43
+ */
44
+ roles?: Record<string, string[]>;
45
+ auth?: {
46
+ /**
47
+ * Production identity hook: verify the request with your identity provider and
48
+ * return the principal, or null. Called only when no FeltKit session token is present.
49
+ * FeltKit never trusts identity claims sent by a client without this hook.
50
+ */
51
+ authenticate?: (request: AuthenticateRequest) => PrincipalInput | null | Promise<PrincipalInput | null>;
52
+ /** Session lifetime. Default 7 days. */
53
+ sessionTtlMs?: number;
54
+ };
55
+ /** Development-only identities you can sign in as. Ignored outside development and test. */
56
+ dev?: {
57
+ users?: DevUser[];
58
+ };
59
+ /** AppPort Services, run on the application's FeltDB instance. */
60
+ services?: {
61
+ /** Files: records with audit and authorization; bytes in the same instance. */
62
+ files?: boolean | {
63
+ maxBytes?: number;
64
+ };
65
+ /** In-app notifications; each principal reads only its own. Needs @appport/services >= 0.5.0. */
66
+ notifications?: boolean;
67
+ /** Configuration variables for the current environment. Needs @appport/services >= 0.5.0. */
68
+ configuration?: boolean;
69
+ };
70
+ activity?: {
71
+ /** What to record. Default: "all" in development/test, "writes" in production. */
72
+ record?: "all" | "writes" | "errors";
73
+ /** Entries kept. Default 2000. */
74
+ retain?: number;
75
+ };
76
+ }
77
+ export interface CollectionDefinition<S extends ShapeInput = ShapeInput> {
78
+ readonly [COLLECTION]: true;
79
+ readonly name: string;
80
+ readonly shape: S;
81
+ readonly schema: Schema;
82
+ readonly description?: string;
83
+ /** Type-only marker. */
84
+ readonly $doc?: Doc<S>;
85
+ }
86
+ export type Access = "public" | "authenticated" | (string & {});
87
+ export interface CapabilityExposure {
88
+ /** AppPort capability name, e.g. "tasks.complete". */
89
+ name: string;
90
+ description?: string;
91
+ version?: number;
92
+ }
93
+ export type FunctionKind = "query" | "mutation";
94
+ export interface FunctionConfig<Kind extends FunctionKind, A extends ShapeInput, R> {
95
+ args?: A;
96
+ /** Output contract. Required when the function is exposed as a capability. */
97
+ returns?: Schema<R>;
98
+ /**
99
+ * Who may call it: "public", "authenticated" (default), or a permission string such
100
+ * as "tasks.write". Checked before the handler runs, on every interface.
101
+ */
102
+ access?: Access;
103
+ description?: string;
104
+ /** Publish this function as an AppPort capability (discoverable by agents and other apps). */
105
+ capability?: CapabilityExposure | string;
106
+ handler: (ctx: Kind extends "query" ? QueryCtx : MutationCtx, args: Simplify<InferShape<A>>) => R | Promise<R>;
107
+ }
108
+ export interface FunctionDefinition<Kind extends FunctionKind = FunctionKind, Args = any, Result = any> {
109
+ readonly [FUNCTION]: true;
110
+ readonly kind: Kind;
111
+ readonly args: ShapeInput;
112
+ readonly argsSchema: Schema;
113
+ readonly returns?: Schema;
114
+ readonly access: Access;
115
+ readonly description?: string;
116
+ readonly capability?: Required<Pick<CapabilityExposure, "name" | "version">> & {
117
+ description?: string;
118
+ };
119
+ readonly handler: (ctx: any, args: any) => unknown;
120
+ readonly app: FeltKitApp;
121
+ /** Type-only markers. */
122
+ readonly $args?: Args;
123
+ readonly $result?: Result;
124
+ }
125
+ export type QueryDefinition<Args = any, Result = any> = FunctionDefinition<"query", Args, Result>;
126
+ export type MutationDefinition<Args = any, Result = any> = FunctionDefinition<"mutation", Args, Result>;
127
+ type Handler<Kind extends FunctionKind, R> = (ctx: Kind extends "query" ? QueryCtx : MutationCtx) => R | Promise<R>;
128
+ export declare class FeltKitApp {
129
+ readonly [APP] = true;
130
+ readonly options: Readonly<FeltKitOptions>;
131
+ readonly collections: Map<string, CollectionDefinition<ShapeInput>>;
132
+ constructor(options: FeltKitOptions);
133
+ get name(): string;
134
+ /** Declare a collection of records stored in the application's FeltDB instance. */
135
+ collection<S extends ShapeInput>(name: string, shape: S, options?: {
136
+ description?: string;
137
+ }): CollectionDefinition<S>;
138
+ /** A read-only function. Its database handle cannot write. */
139
+ query<R>(handler: Handler<"query", R>): QueryDefinition<{}, Awaited<R>>;
140
+ query<A extends ShapeInput = {}, R = unknown>(config: FunctionConfig<"query", A, R>): QueryDefinition<Simplify<InferShape<A>>, Awaited<R>>;
141
+ /** A function that changes state. All of its writes commit atomically, or none do. */
142
+ mutation<R>(handler: Handler<"mutation", R>): MutationDefinition<{}, Awaited<R>>;
143
+ mutation<A extends ShapeInput = {}, R = unknown>(config: FunctionConfig<"mutation", A, R>): MutationDefinition<Simplify<InferShape<A>>, Awaited<R>>;
144
+ private define;
145
+ }
146
+ /** Define a FeltKit application. */
147
+ export declare function feltkit(options: FeltKitOptions): FeltKitApp;
148
+ export declare function isFeltKitApp(value: unknown): value is FeltKitApp;
149
+ export declare function isFunctionDefinition(value: unknown): value is FunctionDefinition;
150
+ export declare function isCollectionDefinition(value: unknown): value is CollectionDefinition;
151
+ export {};
package/dist/app.js ADDED
@@ -0,0 +1,130 @@
1
+ import { validateName } from "@appport/protocol";
2
+ import { RESERVED_FIELDS, shapeToObjectSchema } from "./schema.js";
3
+ const APP = Symbol.for("feltkit.app");
4
+ const COLLECTION = Symbol.for("feltkit.collection");
5
+ const FUNCTION = Symbol.for("feltkit.function");
6
+ /** Collection names owned by the layers underneath. Application collections may not use them. */
7
+ export const RESERVED_COLLECTIONS = new Set([
8
+ // AppPort Services (every service it can construct on the shared instance)
9
+ "files",
10
+ "file_audit_events",
11
+ "service_effect_evidence",
12
+ "notifications",
13
+ "notification_deliveries",
14
+ "notification_audit_events",
15
+ "api_keys",
16
+ "api_key_prefixes",
17
+ "api_key_audit_events",
18
+ "webhook_endpoints",
19
+ "webhook_deliveries",
20
+ "webhook_audit_events",
21
+ "webhook_integrations",
22
+ "inbound_webhook_events",
23
+ "jobs",
24
+ "job_schedules",
25
+ "job_audit_events",
26
+ ]);
27
+ const RESERVED_PREFIXES = ["_feltkit", "_flow", "_feltdb", "_appport"];
28
+ export class FeltKitApp {
29
+ [APP] = true;
30
+ options;
31
+ collections = new Map();
32
+ constructor(options) {
33
+ if (!options || typeof options.name !== "string" || !/^[a-z][a-z0-9-]{0,62}$/.test(options.name)) {
34
+ throw new TypeError(`feltkit({ name }) needs a lowercase name of letters, digits, and dashes (got ${JSON.stringify(options?.name)}).`);
35
+ }
36
+ for (const [role, permissions] of Object.entries(options.roles ?? {})) {
37
+ if (!Array.isArray(permissions) || permissions.some((p) => typeof p !== "string" || !p)) {
38
+ throw new TypeError(`Role "${role}" must map to an array of permission strings.`);
39
+ }
40
+ }
41
+ for (const user of options.dev?.users ?? []) {
42
+ for (const role of user.roles) {
43
+ if (!options.roles?.[role])
44
+ throw new TypeError(`Dev user "${user.id}" has role "${role}", which is not declared in roles.`);
45
+ }
46
+ }
47
+ this.options = Object.freeze({ ...options });
48
+ }
49
+ get name() {
50
+ return this.options.name;
51
+ }
52
+ /** Declare a collection of records stored in the application's FeltDB instance. */
53
+ collection(name, shape, options = {}) {
54
+ if (!/^[a-z][a-zA-Z0-9_]{0,62}$/.test(name)) {
55
+ throw new TypeError(`Collection name "${name}" must start with a lowercase letter and contain only letters, digits, and "_".`);
56
+ }
57
+ if (RESERVED_COLLECTIONS.has(name) || RESERVED_PREFIXES.some((prefix) => name.startsWith(prefix))) {
58
+ throw new TypeError(`Collection name "${name}" is reserved by the platform. Choose another name.`);
59
+ }
60
+ if (this.collections.has(name))
61
+ throw new TypeError(`Collection "${name}" is declared twice.`);
62
+ for (const field of RESERVED_FIELDS) {
63
+ if (field in shape)
64
+ throw new TypeError(`Collection "${name}" may not declare "${field}"; FeltDB manages it.`);
65
+ }
66
+ const definition = {
67
+ [COLLECTION]: true,
68
+ name,
69
+ shape,
70
+ schema: shapeToObjectSchema(shape),
71
+ ...(options.description ? { description: options.description } : {}),
72
+ };
73
+ this.collections.set(name, definition);
74
+ return definition;
75
+ }
76
+ query(input) {
77
+ return this.define("query", input);
78
+ }
79
+ mutation(input) {
80
+ return this.define("mutation", input);
81
+ }
82
+ define(kind, input) {
83
+ const config = (typeof input === "function" ? { handler: input } : input);
84
+ if (!config || typeof config.handler !== "function")
85
+ throw new TypeError(`app.${kind}() needs a handler function.`);
86
+ const args = config.args ?? {};
87
+ let capability;
88
+ if (config.capability) {
89
+ const exposure = typeof config.capability === "string" ? { name: config.capability } : config.capability;
90
+ const check = validateName(exposure.name);
91
+ if (!check.valid) {
92
+ throw new TypeError(`Capability name "${exposure.name}" is not a valid AppPort name: ${check.reason} (e.g. "tasks.complete").`);
93
+ }
94
+ if (!config.returns) {
95
+ throw new TypeError(`Capability "${exposure.name}" needs a \`returns\` schema: AppPort publishes and enforces its output contract.`);
96
+ }
97
+ capability = {
98
+ name: exposure.name,
99
+ version: exposure.version ?? 1,
100
+ ...((exposure.description ?? config.description) ? { description: exposure.description ?? config.description } : {}),
101
+ };
102
+ }
103
+ return Object.freeze({
104
+ [FUNCTION]: true,
105
+ kind,
106
+ args,
107
+ argsSchema: shapeToObjectSchema(args),
108
+ ...(config.returns ? { returns: config.returns } : {}),
109
+ access: config.access ?? "authenticated",
110
+ ...(config.description ? { description: config.description } : {}),
111
+ ...(capability ? { capability } : {}),
112
+ handler: config.handler,
113
+ app: this,
114
+ });
115
+ }
116
+ }
117
+ /** Define a FeltKit application. */
118
+ export function feltkit(options) {
119
+ return new FeltKitApp(options);
120
+ }
121
+ export function isFeltKitApp(value) {
122
+ return typeof value === "object" && value !== null && value[APP] === true;
123
+ }
124
+ export function isFunctionDefinition(value) {
125
+ return typeof value === "object" && value !== null && value[FUNCTION] === true;
126
+ }
127
+ export function isCollectionDefinition(value) {
128
+ return typeof value === "object" && value !== null && value[COLLECTION] === true;
129
+ }
130
+ //# sourceMappingURL=app.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"app.js","sourceRoot":"","sources":["../src/app.ts"],"names":[],"mappings":"AAQA,OAAO,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AACjD,OAAO,EAAE,eAAe,EAAE,m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WAAW,CAAC,CAAC,CAAC,EAAE,WAAW,EAAE,MAAM,CAAC,WAAW,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;YAClE,GAAG,CAAC,UAAU,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,8 @@
1
+ export declare function deploy(options: {
2
+ projectDir: string;
3
+ out?: string;
4
+ }): Promise<{
5
+ dir: string;
6
+ application: string;
7
+ build: import("../server/project.js").BuildResult;
8
+ }>;
@@ -0,0 +1,125 @@
1
+ /**
2
+ * `feltkit deploy`: a verified, self-contained deployment artifact.
3
+ *
4
+ * FeltKit does not operate a hosting service. Deploy builds the application, proves
5
+ * the production build boots and answers (against a throwaway state directory, so
6
+ * no real state is touched), and writes a directory any Node 20+ host or container
7
+ * can run.
8
+ */
9
+ import { cpSync, existsSync, mkdirSync, mkdtempSync, readFileSync, rmSync, writeFileSync } from "node:fs";
10
+ import { tmpdir } from "node:os";
11
+ import { join, resolve } from "node:path";
12
+ import { FeltKitError } from "../errors.js";
13
+ import { silentLogger } from "../runtime/runtime.js";
14
+ import { BUILD_DIR, SDK_VERSION, build, readPackageJson, startProduction } from "../server/project.js";
15
+ export async function deploy(options) {
16
+ const projectDir = resolve(options.projectDir);
17
+ const pkg = readPackageJson(projectDir);
18
+ const result = await build(projectDir);
19
+ // Verify the production build boots. Isolated state, random port, then stop.
20
+ const scratch = mkdtempSync(join(tmpdir(), "feltkit-deploy-check-"));
21
+ const previous = { state: process.env.FELTKIT_STATE_DIR, url: process.env.FELTDB_URL };
22
+ process.env.FELTKIT_STATE_DIR = join(scratch, "state");
23
+ delete process.env.FELTDB_URL;
24
+ try {
25
+ const server = await startProduction({ projectDir, port: 0, host: "127.0.0.1", environment: "production", logger: silentLogger });
26
+ try {
27
+ const health = await fetch(`${server.server.url}/_feltkit/health`);
28
+ if (!health.ok)
29
+ throw new FeltKitError("UNAVAILABLE", `The production build started but /_feltkit/health answered ${health.status}.`);
30
+ const manifest = await fetch(`${server.server.url}/appport/manifest`);
31
+ if (!manifest.ok && manifest.status !== 404)
32
+ throw new FeltKitError("UNAVAILABLE", `The AppPort endpoint answered ${manifest.status}.`);
33
+ if (result.client) {
34
+ const page = await fetch(`${server.server.url}/`);
35
+ if (!page.ok || !(await page.text()).includes("<div id=\"root\""))
36
+ throw new FeltKitError("UNAVAILABLE", "The production build did not serve the frontend.");
37
+ }
38
+ }
39
+ finally {
40
+ await server.close();
41
+ }
42
+ }
43
+ finally {
44
+ if (previous.state === undefined)
45
+ delete process.env.FELTKIT_STATE_DIR;
46
+ else
47
+ process.env.FELTKIT_STATE_DIR = previous.state;
48
+ if (previous.url !== undefined)
49
+ process.env.FELTDB_URL = previous.url;
50
+ rmSync(scratch, { recursive: true, force: true });
51
+ }
52
+ const stamp = new Date().toISOString().replace(/[:.]/g, "-");
53
+ const dir = resolve(options.out ?? join(projectDir, ".feltkit", "deploy", `${result.application}-${stamp}`));
54
+ if (existsSync(dir))
55
+ throw new FeltKitError("CONFIGURATION", `${dir} already exists; choose another --out.`);
56
+ mkdirSync(dir, { recursive: true });
57
+ cpSync(join(projectDir, BUILD_DIR), join(dir, BUILD_DIR), { recursive: true });
58
+ if (result.client)
59
+ cpSync(result.client, join(dir, "dist", "client"), { recursive: true });
60
+ const runtimeDeps = Object.fromEntries(Object.entries({ ...(pkg.dependencies ?? {}) }).filter(([name]) => !["react", "react-dom"].includes(name)));
61
+ writeFileSync(join(dir, "package.json"), `${JSON.stringify({
62
+ name: `${pkg.name ?? result.application}-deploy`,
63
+ private: true,
64
+ version: pkg.version ?? "0.0.0",
65
+ type: "module",
66
+ engines: { node: ">=20.11" },
67
+ scripts: { start: "feltkit start" },
68
+ dependencies: runtimeDeps,
69
+ ...(pkg.overrides ? { overrides: pkg.overrides } : {}),
70
+ }, null, 2)}\n`);
71
+ if (existsSync(join(projectDir, "package-lock.json")))
72
+ cpSync(join(projectDir, "package-lock.json"), join(dir, "package-lock.json"));
73
+ writeFileSync(join(dir, "Dockerfile"), `FROM node:22-slim
74
+ WORKDIR /app
75
+ COPY package*.json ./
76
+ RUN npm install --omit=dev --no-audit --no-fund
77
+ COPY . .
78
+ ENV NODE_ENV=production PORT=3000 FELTKIT_STATE_DIR=/data/state
79
+ VOLUME ["/data"]
80
+ EXPOSE 3000
81
+ USER node
82
+ # node directly (not npx), so SIGTERM reaches FeltKit and it shuts down cleanly.
83
+ CMD ["node", "node_modules/feltkit/bin/feltkit.js", "start", "--host", "0.0.0.0"]
84
+ `);
85
+ writeFileSync(join(dir, ".dockerignore"), "node_modules\n.feltkit/production\n");
86
+ writeFileSync(join(dir, "DEPLOY.md"), `# Deploying ${result.application}
87
+
88
+ Built with feltkit ${SDK_VERSION} on ${new Date().toISOString()}.
89
+ Verified: the production build booted against a temporary state directory and
90
+ answered /_feltkit/health${result.client ? " and served the frontend" : ""}.
91
+
92
+ ## Run
93
+
94
+ npm install --omit=dev
95
+ PORT=3000 npm start
96
+
97
+ or
98
+
99
+ docker build -t ${result.application} .
100
+ docker run -p 3000:3000 -v ${result.application}-data:/data ${result.application}
101
+
102
+ ## State (one FeltDB instance for the production environment)
103
+
104
+ | Setting | Effect |
105
+ |---|---|
106
+ | \`FELTDB_URL\` + \`FELTDB_TOKEN\` | Use a FeltDB server. The token comes from your secret manager; FeltKit never writes it to disk. |
107
+ | \`FELTKIT_STATE_DIR\` | Use a local, durable FeltDB directory (mount a volume). The Docker image defaults to \`/data/state\`. |
108
+ | neither | \`.feltkit/production/state\` beside the app. |
109
+
110
+ Run one process per environment. The local runtime is a single-host store.
111
+
112
+ ## Identity
113
+
114
+ Production has no development sign-in. Either supply \`auth.authenticate\` in
115
+ \`feltkit({ ... })\` to verify requests with your identity provider, or issue
116
+ session tokens to known principals:
117
+
118
+ npx feltkit session create --env production --id ops-bot --type agent --role agent
119
+
120
+ The dashboard is not served in production. Setting \`FELTKIT_DASHBOARD=1\` serves it
121
+ behind the admin token in \`.feltkit/production/admin-token\`; data edits stay disabled.
122
+ `);
123
+ return { dir, application: result.application, build: result };
124
+ }
125
+ //# sourceMappingURL=deploy.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"deploy.js","sourceRoot":"","sources":["../../src/cli/deploy.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AACH,OAAO,EAAE,MAAM,EAAE,UAAU,EAAE,SAAS,EAAE,WAAW,EAAE,YAAY,EAAE,MAAM,EAAE,aAAa,EAAE,MAAM,SAAS,CAAC;AAC1G,OAAO,EAAE,MAAM,EAAE,MAAM,SAAS,CAAC;AACjC,OAAO,EAAE,IAAI,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAC1C,OAAO,EAAE,YAAY,EAAE,MAAM,cAAc,CAAC;AAC5C,OAAO,EAAE,YAAY,EAAE,MAAM,uBAAuB,CAAC;AACrD,OAAO,EAAE,SAAS,EAAE,WAAW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,EAAE,GAAG,CAAC,SAAS,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;KACvD,EACD,IAAI,EACJ,CAAC,CACF,IAAI,CACN,CAAC;IACF,IAAI,UAAU,CAAC,IAAI,CAAC,UAAU,EAAE,mBAAmB,CAAC,CAAC;QAAE,MAAM,CAAC,IAAI,CAAC,UAAU,EAAE,mBAAmB,CAAC,EAAE,IAAI,CAAC,GAAG,EAAE,mBAAmB,CAAC,CAAC,CAAC;IACrI,aAAa,CACX,IAAI,CAAC,GAAG,EAAE,YAAY,CAAC,EACvB;;;;;;;;;;;CAWH,CACE,CAAC;IACF,aAAa,CAAC,IAAI,CAAC,GAAG,EAAE,eAAe,CAAC,EAAE,qCAAqC,CAAC,CAAC;IACjF,aAAa,CACX,IAAI,CAAC,GAAG,EAAE,WAAW,CAAC,EACtB,eAAe,MAAM,CAAC,WAAW;;qBAEhB,WAAW,OAAO,IAAI,IAAI,EAAE,CAAC,WAAW,EAAE;;2BAEpC,MAAM,CAAC,MAAM,CAAC,CAAC,CAAC,0BAA0B,CAAC,CAAC,CAAC,EAAE;;;;;;;;;sBASpD,MAAM,CAAC,WAAW;iCACP,MAAM,CAAC,WAAW,eAAe,MAAM,CAAC,WAAW;;;;;;;;;;;;;;;;;;;;;;CAsBnF,CACE,CAAC;IACF,OAAO,EAAE,GAAG,EAAE,WAAW,EAAE,MAAM,CAAC,WAAW,EAAE,KAAK,EAAE,MAAM,EAAE,CAAC;AACjE,CAAC"}
@@ -0,0 +1,9 @@
1
+ interface Parsed {
2
+ command: string | undefined;
3
+ positional: string[];
4
+ flags: Record<string, string | boolean>;
5
+ }
6
+ export declare function parseArgs(argv: string[]): Parsed;
7
+ export declare function main(argv?: string[]): Promise<number>;
8
+ export declare function run(): Promise<void>;
9
+ export {};