@gaganref/confect-cli 10.3.1-fork.17 → 10.3.1-fork.19

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.
@@ -1 +1 @@
1
- {"version":3,"file":"templates.mjs","names":["renderSpecAssembly"],"sources":["../src/templates.ts"],"sourcesContent":["import type * as IdScope from \"@confect/core/IdScope\";\nimport * as Array from \"effect/Array\";\nimport * as Effect from \"effect/Effect\";\nimport type * as GroupSpec from \"@confect/core/GroupSpec\";\nimport { CodeBlockWriter } from \"./CodeBlockWriter.js\";\nimport {\n render as renderSpecAssembly,\n type SpecAssemblyNode,\n} from \"./SpecAssemblyNode.js\";\n\n/**\n * Emit `convex/schema.ts` as a one-line re-export of the codegen-emitted deploy\n * schema in `confect/_generated/convexSchema.ts`. Deploy-time consumers (the\n * Convex CLI, `convex-test`) keep reading `convex/schema.ts`; the runtime\n * `DatabaseSchema` in `confect/_generated/schema.ts` is untouched by this\n * file.\n */\nexport const schema = ({\n convexSchemaImportPath,\n}: Parameters<typeof schemaEffect>[0]) =>\n schemaEffect({ convexSchemaImportPath });\n\nconst schemaEffect = Effect.fnUntraced(function* ({\n convexSchemaImportPath,\n}: {\n convexSchemaImportPath: string;\n}) {\n const cbw = new CodeBlockWriter({ indentNumberOfSpaces: 2 });\n\n yield* cbw.writeLine(`export { default } from \"${convexSchemaImportPath}\";`);\n\n return yield* cbw.toString();\n});\n\ninterface TableModuleBinding {\n readonly importPath: string;\n readonly tableName: string;\n}\n\n/**\n * Emit `confect/_generated/schema.ts`—the runtime `DatabaseSchema` used by\n * impls and the per-group registries (and downstream by per-function bundles\n * for codec lookup). Every table wrapper at\n * `confect/_generated/tables/<name>.ts` is imported statically and registered\n * as a value entry on the `DatabaseSchema.make({...})` call. Per-table laziness\n * lives inside each `Table`: its `Fields` and `Doc` are lazy memoised getters\n * that only evaluate the user-supplied field-schema callback on first access,\n * so unused tables in a function bundle never pay schema-construction cost\n * despite the static import.\n *\n * The `DatabaseSchema` import is aliased to `$DatabaseSchema` because each\n * table is imported under its own (filename-derived) name; a table named\n * `DatabaseSchema` would otherwise collide with the library import and emit a\n * duplicate-binding file. The leading `$` makes the alias collision-proof:\n * `validateConfectTableIdentifier` requires names to match\n * `/^[a-zA-Z][a-zA-Z0-9_]*$/`, which forbids `$`, so no valid table import can\n * ever shadow it.\n */\nexport const runtimeSchema = ({\n tableModules,\n component = false,\n}: Parameters<typeof runtimeSchemaEffect>[0]) =>\n runtimeSchemaEffect({ tableModules, component });\n\nconst runtimeSchemaEffect = Effect.fnUntraced(function* ({\n tableModules,\n component = false,\n}: {\n tableModules: ReadonlyArray<TableModuleBinding>;\n component?: boolean;\n}) {\n const cbw = new CodeBlockWriter({ indentNumberOfSpaces: 2 });\n\n yield* cbw.writeLine(\n `import { DatabaseSchema as $DatabaseSchema } from \"@confect/server\";`,\n );\n\n if (tableModules.length > 0) {\n yield* cbw.blankLine();\n yield* Effect.forEach(tableModules, ({ tableName, importPath }) =>\n cbw.writeLine(`import ${tableName} from \"${importPath}\";`),\n );\n }\n\n yield* cbw.blankLine();\n\n if (component) {\n yield* cbw.writeLine(`import { target as $target } from \"./id.js\";`);\n }\n\n if (tableModules.length === 0) {\n yield* cbw.writeLine(\n `const databaseSchema: $DatabaseSchema.DatabaseSchema${component ? \"<{}, typeof $target>\" : \"\"} = $DatabaseSchema.make({}${component ? \", $target\" : \"\"});`,\n );\n } else {\n yield* cbw.writeLine(\n `const databaseSchema: $DatabaseSchema.DatabaseSchema<{`,\n );\n yield* cbw.indent(\n Effect.forEach(\n tableModules,\n ({ tableName }) =>\n cbw.writeLine(`readonly ${tableName}: typeof ${tableName};`),\n { discard: true },\n ),\n );\n yield* cbw.writeLine(\n `}${component ? \", typeof $target\" : \"\"}> = $DatabaseSchema.make({`,\n );\n yield* cbw.indent(\n Effect.gen(function* () {\n for (const { tableName } of tableModules) {\n yield* cbw.writeLine(`${tableName},`);\n }\n }),\n );\n yield* cbw.writeLine(`}${component ? \", $target\" : \"\"});`);\n }\n\n yield* cbw.blankLine();\n yield* cbw.writeLine(`export default databaseSchema;`);\n\n return yield* cbw.toString();\n});\n\n/**\n * Emit `confect/_generated/convexSchema.ts`—the Convex deploy-time\n * `SchemaDefinition`. Imports every table from its generated wrapper at\n * `_generated/tables/<name>` and calls `defineSchema({...})` exactly once.\n * `Table.tableDefinition` lives in `@confect/server` because it is the\n * `defineTable` binding; the generated table wrappers themselves stay\n * client-safe (`Fields`/`Doc` from `@confect/core`).\n *\n * The `defineSchema` and `Table` imports are aliased with a leading `$` because\n * each table is imported under its own (filename-derived) name; a table named\n * `defineSchema` or `Table` would otherwise collide with the library import and\n * emit a duplicate-binding file. `validateConfectTableIdentifier` requires\n * names to match `/^[a-zA-Z][a-zA-Z0-9_]*$/`, which forbids `$`, so no valid\n * table import can ever shadow them.\n */\nexport const convexSchema = ({\n tableModules,\n}: Parameters<typeof convexSchemaEffect>[0]) =>\n convexSchemaEffect({ tableModules });\n\nconst convexSchemaEffect = Effect.fnUntraced(function* ({\n tableModules,\n}: {\n tableModules: ReadonlyArray<TableModuleBinding>;\n}) {\n const cbw = new CodeBlockWriter({ indentNumberOfSpaces: 2 });\n\n yield* cbw.writeLine(\n `import { defineSchema as $defineSchema } from \"convex/server\";`,\n );\n\n if (tableModules.length > 0) {\n yield* cbw.writeLine(`import { Table as $Table } from \"@confect/server\";`);\n yield* cbw.blankLine();\n yield* Effect.forEach(tableModules, ({ tableName, importPath }) =>\n cbw.writeLine(`import ${tableName} from \"${importPath}\";`),\n );\n }\n\n yield* cbw.blankLine();\n\n if (tableModules.length === 0) {\n yield* cbw.writeLine(`export default $defineSchema({});`);\n } else {\n yield* cbw.writeLine(`export default $defineSchema({`);\n yield* cbw.indent(\n Effect.gen(function* () {\n for (const { tableName } of tableModules) {\n yield* cbw.writeLine(\n `${tableName}: $Table.tableDefinition(${tableName}),`,\n );\n }\n }),\n );\n yield* cbw.writeLine(`});`);\n }\n\n return yield* cbw.toString();\n});\n\n/**\n * Emit `confect/_generated/id.ts`—a type-constrained `Id` constructor and a\n * `TableNames` union derived from the user's `confect/tables/*.ts` filenames.\n * User-authored table modules import `Id` from this file to declare cross-table\n * id references without typing the destination name as a free string (and\n * without ever importing each other transitively).\n *\n * `Id` also accepts Convex system tables, with the component scope when\n * present. `TableNames` includes only user tables and resolves to `never` for\n * an empty table directory.\n */\nexport const id = ({ tableNames, scope }: Parameters<typeof idEffect>[0]) =>\n idEffect({ tableNames, scope });\n\nconst idEffect = Effect.fnUntraced(function* ({\n tableNames,\n scope,\n}: {\n tableNames: ReadonlyArray<string>;\n scope?: IdScope.Component<string> | undefined;\n}) {\n const cbw = new CodeBlockWriter({ indentNumberOfSpaces: 2 });\n\n yield* cbw.writeLine(\n `import { GenericId${scope === undefined ? \"\" : \", IdScope\"} } from \"@confect/core\";`,\n );\n yield* cbw.writeLine(\n `import type { SystemTableNames } from \"convex/server\";`,\n );\n yield* cbw.blankLine();\n if (scope !== undefined) {\n yield* cbw.writeLine(\n // oxlint-disable-next-line effecttsgo/prefer-schema-over-json -- Emit an escaped TypeScript string literal, not a JSON payload.\n `export const scope = IdScope.component(${JSON.stringify(scope.slice(\"component:\".length))});`,\n );\n yield* cbw.writeLine(\n `export const target = { kind: \"component\", scope } as const;`,\n );\n }\n\n const union =\n tableNames.length === 0\n ? \"never\"\n : tableNames.map((n) => `\"${n}\"`).join(\" | \");\n yield* cbw.writeLine(`export type TableNames = ${union};`);\n yield* cbw.blankLine();\n\n yield* cbw.writeLine(\n `export type Id<TableName extends TableNames | SystemTableNames> = GenericId.GenericId<TableName${scope === undefined ? \"\" : \", typeof scope\"}>;`,\n );\n yield* cbw.blankLine();\n\n yield* cbw.writeLine(\n `export const Id = <const TableName extends TableNames | SystemTableNames>(`,\n );\n yield* cbw.indent(cbw.writeLine(`tableName: TableName,`));\n yield* cbw.writeLine(\n `) => GenericId.GenericId(tableName${scope === undefined ? \"\" : \", scope\"});`,\n );\n\n return yield* cbw.toString();\n});\n\n/**\n * Emit `confect/_generated/tables/<tableName>.ts`—a two-line wrapper that\n * imports the user-authored `UnnamedTable` and binds the file basename to it,\n * producing the fully-named `Table` value that downstream consumers (schema,\n * specs, impls) read.\n */\nexport const tableWrapper = ({\n tableName,\n unnamedImportPath,\n component = false,\n}: Parameters<typeof tableWrapperEffect>[0]) =>\n tableWrapperEffect({ tableName, unnamedImportPath, component });\n\nconst tableWrapperEffect = Effect.fnUntraced(function* ({\n tableName,\n unnamedImportPath,\n component = false,\n}: {\n tableName: string;\n unnamedImportPath: string;\n component?: boolean;\n}) {\n const cbw = new CodeBlockWriter({ indentNumberOfSpaces: 2 });\n\n yield* cbw.writeLine(`import unnamed from \"${unnamedImportPath}\";`);\n if (component) yield* cbw.writeLine(`import { scope } from \"../id.js\";`);\n yield* cbw.blankLine();\n yield* cbw.writeLine(\n `export default unnamed(\"${tableName}\"${component ? \", scope\" : \"\"});`,\n );\n\n return yield* cbw.toString();\n});\n\nexport const http = ({ httpImportPath }: Parameters<typeof httpEffect>[0]) =>\n httpEffect({ httpImportPath });\n\nconst httpEffect = Effect.fnUntraced(function* ({\n httpImportPath,\n}: {\n httpImportPath: string;\n}) {\n const cbw = new CodeBlockWriter({ indentNumberOfSpaces: 2 });\n\n yield* cbw.writeLine(`import http from \"${httpImportPath}\";`);\n yield* cbw.newLine();\n yield* cbw.writeLine(`export default http;`);\n\n return yield* cbw.toString();\n});\n\n/**\n * Emit `convex/http.ts` for a declared backend: the Convex router serving\n * `confect/http.ts`'s routes, typed by the generated database schema.\n */\nexport const declaredHttp = Effect.fnUntraced(function* ({\n schemaImportPath,\n httpImportPath,\n}: {\n schemaImportPath: string;\n httpImportPath: string;\n}) {\n const cbw = new CodeBlockWriter({ indentNumberOfSpaces: 2 });\n\n yield* cbw.writeLine(\n \"// Generated by `confect codegen` from confect/http.ts. Do not edit.\",\n );\n yield* cbw.writeLine(`import { HttpRouter } from \"@confect/server\";`);\n yield* cbw.writeLine(`import schema from \"${schemaImportPath}\";`);\n yield* cbw.writeLine(`import http from \"${httpImportPath}\";`);\n yield* cbw.newLine();\n yield* cbw.writeLine(\n `export default HttpRouter.forSchema(schema)(http.routes, { api: http.api });`,\n );\n\n return yield* cbw.toString();\n});\n\nexport const crons = ({ cronsImportPath }: Parameters<typeof cronsEffect>[0]) =>\n cronsEffect({ cronsImportPath });\n\nconst cronsEffect = Effect.fnUntraced(function* ({\n cronsImportPath,\n}: {\n cronsImportPath: string;\n}) {\n const cbw = new CodeBlockWriter({ indentNumberOfSpaces: 2 });\n\n yield* cbw.writeLine(`import crons from \"${cronsImportPath}\";`);\n yield* cbw.newLine();\n yield* cbw.writeLine(`export default crons.convexCronJobs;`);\n\n return yield* cbw.toString();\n});\n\nexport const authConfig = ({\n authImportPath,\n}: Parameters<typeof authConfigEffect>[0]) =>\n authConfigEffect({ authImportPath });\n\nconst authConfigEffect = Effect.fnUntraced(function* ({\n authImportPath,\n}: {\n authImportPath: string;\n}) {\n const cbw = new CodeBlockWriter({ indentNumberOfSpaces: 2 });\n\n yield* cbw.writeLine(`import auth from \"${authImportPath}\";`);\n yield* cbw.newLine();\n yield* cbw.writeLine(`export default auth;`);\n\n return yield* cbw.toString();\n});\n\n/**\n * Emit `confect/_generated/components.ts`—a typed registry of the Convex\n * components installed via `app.use(...)` in `convex/convex.config.ts`. Mirrors\n * the `components` export of Convex's generated `convex/_generated/api`: the\n * runtime value is `componentsGeneric()` (a name-preserving proxy), and each\n * entry is typed with the `ComponentApi` that component packages export from\n * `_generated/component.js`. Unlike `convex/_generated/api`, this file exists\n * before `convex codegen` ever runs, so impl modules can import it\n * safely—`confect codegen` bundles and evaluates each impl's import graph, and\n * `convex/_generated/api` doesn't exist yet at that point.\n *\n * The `as any` cast is confined here: `componentsGeneric()` is typed\n * `AnyChildComponents`, which deliberately doesn't overlap the precise registry\n * type; the `Components` annotation on the const supplies the real type.\n */\nexport const components = ({\n components: installedComponents,\n}: Parameters<typeof componentsEffect>[0]) =>\n componentsEffect({ components: installedComponents });\n\nconst componentsEffect = Effect.fnUntraced(function* ({\n components: installedComponents,\n}: {\n components: ReadonlyArray<{ name: string; typeImportPath: string }>;\n}) {\n const cbw = new CodeBlockWriter({ indentNumberOfSpaces: 2 });\n\n yield* cbw.writeLine(`import { componentsGeneric } from \"convex/server\";`);\n yield* cbw.blankLine();\n\n if (installedComponents.length === 0) {\n yield* cbw.writeLine(`export type Components = {};`);\n } else {\n yield* cbw.writeLine(`export type Components = {`);\n yield* cbw.indent(\n Effect.forEach(\n installedComponents,\n ({ name, typeImportPath }) =>\n cbw.writeLine(\n `\"${name}\": import(\"${typeImportPath}/_generated/component.js\").ComponentApi<\"${name}\">;`,\n ),\n { discard: true },\n ),\n );\n yield* cbw.writeLine(`};`);\n }\n yield* cbw.blankLine();\n\n yield* cbw.writeLine(\n `export const components: Components = componentsGeneric() as any;`,\n );\n\n return yield* cbw.toString();\n});\n\nexport const refs = ({ specImportPath }: Parameters<typeof refsEffect>[0]) =>\n refsEffect({ specImportPath });\n\nconst refsEffect = Effect.fnUntraced(function* ({\n specImportPath,\n}: {\n specImportPath: string;\n}) {\n const cbw = new CodeBlockWriter({ indentNumberOfSpaces: 2 });\n\n yield* cbw.writeLine(`import { Refs } from \"@confect/core\";`);\n yield* cbw.writeLine(`import spec from \"${specImportPath}\";`);\n yield* cbw.blankLine();\n yield* cbw.writeLine(\n `const refs: Refs.FromSpec<typeof spec> = Refs.make(spec);`,\n );\n yield* cbw.blankLine();\n yield* cbw.writeLine(`export default refs;`);\n\n return yield* cbw.toString();\n});\n\nexport const componentContract = Effect.fnUntraced(function* ({\n tableNames,\n}: {\n tableNames: ReadonlyArray<string>;\n}) {\n const cbw = new CodeBlockWriter({ indentNumberOfSpaces: 2 });\n yield* cbw.writeLine('import { Component } from \"@confect/core\";');\n yield* cbw.writeLine('import spec from \"./spec.js\";');\n yield* cbw.writeLine('import { scope } from \"./id.js\";');\n yield* cbw.blankLine();\n const names = Array.map(\n [...tableNames, \"_storage\", \"_scheduled_functions\"],\n (name) => `\"${name}\"`,\n );\n yield* cbw.writeLine(\n `const component: Component.Component<typeof spec, typeof scope, ${names.join(\" | \")}> = Component.make(spec, scope, [${names.join(\", \")}]);`,\n );\n yield* cbw.writeLine(\"export default component;\");\n return yield* cbw.toString();\n});\n\n/**\n * Emit `_generated/docs.ts`: one named `type <table>` alias per table plus a\n * `Docs` registry. Each alias is `Document.Document<typeof schemaDefinition,\n * \"<table>\">`, so it stays structurally exact while giving the document a\n * _name_—declaration emit then prints e.g. `NotesDoc` instead of expanding the\n * row structure. A `type` alias (rather than an extending `interface`) is used\n * so it works for every document shape: object tables, but also union schemas\n * (`Schema.Union`) and other non-object documents, which an `interface …\n * extends` cannot represent (TS2312). The registry is threaded into the\n * generated `DatabaseReader`/`DatabaseWriter` tags so query/mutation helpers\n * print named documents with no user annotations.\n */\nexport const docs = ({\n schemaImportPath,\n tables,\n}: Parameters<typeof docsEffect>[0]) =>\n docsEffect({ schemaImportPath, tables });\n\nconst docsEffect = Effect.fnUntraced(function* ({\n schemaImportPath,\n tables,\n}: {\n schemaImportPath: string;\n tables: ReadonlyArray<{ tableName: string; docName: string }>;\n}) {\n const cbw = new CodeBlockWriter({ indentNumberOfSpaces: 2 });\n\n // With no tables there is nothing to import—emitting the (unused) imports\n // would trip `noUnusedLocals`.\n if (tables.length === 0) {\n yield* cbw.writeLine(`export interface Docs {}`);\n return yield* cbw.toString();\n }\n\n yield* cbw.writeLine(`import type { Document } from \"@confect/server\";`);\n yield* cbw.writeLine(\n `import type schemaDefinition from \"${schemaImportPath}\";`,\n );\n yield* cbw.blankLine();\n\n for (const { tableName, docName } of tables) {\n yield* cbw.writeLine(\n `export type ${docName} = Document.Document<typeof schemaDefinition, \"${tableName}\">;`,\n );\n }\n yield* cbw.blankLine();\n\n yield* cbw.writeLine(`export interface Docs {`);\n yield* cbw.indent(\n Effect.gen(function* () {\n for (const { tableName, docName } of tables) {\n yield* cbw.writeLine(`${tableName}: ${docName};`);\n }\n }),\n );\n yield* cbw.writeLine(`}`);\n\n return yield* cbw.toString();\n});\n\nexport const registeredFunctionsForGroup = ({\n spec,\n schemaImportPath,\n specImportPath,\n implImportPath,\n}: Parameters<typeof registeredFunctionsForGroupEffect>[0]) =>\n registeredFunctionsForGroupEffect({\n spec,\n schemaImportPath,\n specImportPath,\n implImportPath,\n });\n\nconst registeredFunctionsForGroupEffect = Effect.fnUntraced(function* ({\n spec,\n schemaImportPath,\n specImportPath,\n implImportPath,\n}: {\n spec: GroupSpec.AnyWithProps;\n schemaImportPath: string;\n specImportPath: string;\n implImportPath: string;\n}) {\n const cbw = new CodeBlockWriter({ indentNumberOfSpaces: 2 });\n const useNode = spec.runtime === \"Node\";\n\n const hasConfectFunctions = (group: GroupSpec.AnyWithProps): boolean =>\n Object.values(group.functions).some(\n (functionSpec) => functionSpec.functionProvenance._tag === \"Confect\",\n ) || Object.values(group.groups).some(hasConfectFunctions);\n const forwarding = !useNode && hasConfectFunctions(spec);\n\n if (useNode) {\n yield* cbw.writeLine(\n `import { RegisteredNodeFunction } from \"@confect/server/node\";`,\n );\n } else if (!forwarding) {\n yield* cbw.writeLine(\n `import { RegisteredFunctions } from \"@confect/server\";`,\n );\n } else {\n yield* cbw.writeLine(\n `import { ConvexFunctionDefinitions, RegisteredConvexFunction, type RegisteredFunctions } from \"@confect/server\";`,\n );\n }\n\n yield* cbw.writeLine(`import databaseSchema from \"${schemaImportPath}\";`);\n yield* cbw.writeLine(`import groupLayer from \"${implImportPath}\";`);\n yield* cbw.blankLine();\n // The group's own leaf spec is referenced type-only (`typeof import(...)`),\n // so the spec module is erased at transpile time and never enters the\n // per-function bundle; only `databaseSchema` and the impl are runtime\n // imports. Typing from the leaf spec (not the project-wide assembled spec)\n // keeps the registry's type dependent solely on its own group.\n const specType = `typeof import(\"${specImportPath}\")[\"default\"]`;\n if (useNode) {\n yield* cbw.writeLine(\n `export default RegisteredNodeFunction.buildForGroup<${specType}>(databaseSchema, groupLayer);`,\n );\n } else if (!forwarding) {\n yield* cbw.writeLine(\n `export default RegisteredFunctions.buildForGroup<${specType}>(databaseSchema, groupLayer);`,\n );\n } else {\n const bindings = (group: GroupSpec.AnyWithProps, path: string): string =>\n `{\n${[\n ...Object.entries(group.functions).map(([name, functionSpec]) => {\n const key = JSON.stringify(name);\n const definition = `${path}[${key}]`;\n return `[${key}]: ${\n functionSpec.functionProvenance._tag === \"Convex\"\n ? `${definition}.handler`\n : `RegisteredConvexFunction.register({ ...${definition}, handler: forward(${definition}.handler) })`\n },`;\n }),\n ...Object.entries(group.groups).map(([name, child]) => {\n const key = JSON.stringify(name);\n return `[${key}]: ${bindings(child, `${path}[${key}]`)},`;\n }),\n].join(\"\\n\")}\n}`;\n yield* cbw.writeLine(`const forward = <Ctx, Args, Returns>(handler: (ctx: Ctx, args: Args) => Promise<Returns>) => (ctx: Ctx, args: Args) => handler(ctx, args);\n\nconst definitions = ConvexFunctionDefinitions.buildForGroup<${specType}>(databaseSchema, groupLayer);\n\nexport default ${bindings(spec, \"definitions\")} as RegisteredFunctions.RegisteredFunctionsForGroupSpec<${specType}>;`);\n }\n\n return yield* cbw.toString();\n});\n\nexport const services = ({\n schemaImportPath,\n component = false,\n}: Parameters<typeof servicesEffect>[0]) =>\n servicesEffect({ schemaImportPath, component });\n\nconst servicesEffect = Effect.fnUntraced(function* ({\n schemaImportPath,\n component = false,\n}: {\n schemaImportPath: string;\n component?: boolean;\n}) {\n const cbw = new CodeBlockWriter({ indentNumberOfSpaces: 2 });\n\n // Imports\n yield* cbw.writeLine(\"import {\");\n yield* cbw.indent(\n Effect.gen(function* () {\n yield* cbw.writeLine(\"ActionCtx as ActionCtx_,\");\n yield* cbw.writeLine(\"ActionRunner as ActionRunner_,\");\n if (!component) yield* cbw.writeLine(\"Auth as Auth_,\");\n yield* cbw.writeLine(\"type DataModel,\");\n yield* cbw.writeLine(\"DatabaseReader as DatabaseReader_,\");\n yield* cbw.writeLine(\"DatabaseWriter as DatabaseWriter_,\");\n yield* cbw.writeLine(\"ExecutionMetadata as ExecutionMetadata_,\");\n yield* cbw.writeLine(\"MutationCtx as MutationCtx_,\");\n yield* cbw.writeLine(\"MutationRunner as MutationRunner_,\");\n yield* cbw.writeLine(\n \"MutationTransactionContext as MutationTransactionContext_,\",\n );\n yield* cbw.writeLine(\"QueryCtx as QueryCtx_,\");\n yield* cbw.writeLine(\"QueryRunner as QueryRunner_,\");\n yield* cbw.writeLine(\n \"QueryTransactionContext as QueryTransactionContext_,\",\n );\n yield* cbw.writeLine(\"RequestMetadata as RequestMetadata_,\");\n yield* cbw.writeLine(\"Scheduler as Scheduler_,\");\n if (!component) yield* cbw.writeLine(\"Storage as Storage_,\");\n yield* cbw.writeLine(\"StorageActionWriter as StorageActionWriter_,\");\n yield* cbw.writeLine(\"StorageReader as StorageReader_,\");\n yield* cbw.writeLine(\"StorageWriter as StorageWriter_,\");\n yield* cbw.writeLine(\"TransactionMetadata as TransactionMetadata_,\");\n yield* cbw.writeLine(\"VectorSearch as VectorSearch_,\");\n }),\n );\n yield* cbw.writeLine(`} from \"@confect/server\";`);\n yield* cbw.writeLine(\n `import type schemaDefinition from \"${schemaImportPath}\";`,\n );\n yield* cbw.writeLine(`import type { Docs } from \"./docs.js\";`);\n if (component) yield* cbw.writeLine(`import type { scope } from \"./id.js\";`);\n yield* cbw.blankLine();\n\n // Auth\n if (!component) {\n yield* cbw.writeLine(\"export const Auth = Auth_.Auth;\");\n yield* cbw.writeLine(\"export type Auth = typeof Auth.Identifier;\");\n }\n yield* cbw.blankLine();\n\n yield* cbw.writeLine(\n \"export const ExecutionMetadata = ExecutionMetadata_.ExecutionMetadata;\",\n );\n yield* cbw.writeLine(\n \"export type ExecutionMetadata = typeof ExecutionMetadata.Identifier;\",\n );\n yield* cbw.blankLine();\n\n yield* cbw.writeLine(\n \"export const RequestMetadata = RequestMetadata_.RequestMetadata;\",\n );\n yield* cbw.writeLine(\n \"export type RequestMetadata = typeof RequestMetadata.Identifier;\",\n );\n yield* cbw.blankLine();\n\n yield* cbw.writeLine(\n \"export const TransactionMetadata = TransactionMetadata_.TransactionMetadata;\",\n );\n yield* cbw.writeLine(\n \"export type TransactionMetadata = typeof TransactionMetadata.Identifier;\",\n );\n yield* cbw.blankLine();\n\n // Scheduler\n yield* cbw.writeLine(\n component\n ? \"export const Scheduler = Scheduler_.forScope<typeof scope>();\"\n : \"export const Scheduler = Scheduler_.Scheduler;\",\n );\n yield* cbw.writeLine(\"export type Scheduler = typeof Scheduler.Identifier;\");\n yield* cbw.blankLine();\n\n if (!component) {\n yield* cbw.writeLine(\"export const Storage = Storage_.Storage;\");\n yield* cbw.writeLine(\"export type Storage = typeof Storage.Identifier;\");\n yield* cbw.blankLine();\n }\n\n // StorageReader\n yield* cbw.writeLine(\n `export const StorageReader = StorageReader_.StorageReader${component ? \".forScope<typeof scope>()\" : \"\"};`,\n );\n yield* cbw.writeLine(\n \"export type StorageReader = typeof StorageReader.Identifier;\",\n );\n yield* cbw.blankLine();\n\n // StorageWriter\n yield* cbw.writeLine(\n `export const StorageWriter = StorageWriter_.StorageWriter${component ? \".forScope<typeof scope>()\" : \"\"};`,\n );\n yield* cbw.writeLine(\n \"export type StorageWriter = typeof StorageWriter.Identifier;\",\n );\n yield* cbw.blankLine();\n\n // StorageActionWriter\n yield* cbw.writeLine(\n `export const StorageActionWriter = StorageActionWriter_.StorageActionWriter${component ? \".forScope<typeof scope>()\" : \"\"};`,\n );\n yield* cbw.writeLine(\n \"export type StorageActionWriter = typeof StorageActionWriter.Identifier;\",\n );\n yield* cbw.blankLine();\n\n // VectorSearch\n yield* cbw.writeLine(\n \"export const VectorSearch: VectorSearch_.VectorSearchTag<\",\n );\n yield* cbw.indent(\n cbw.writeLine(\"DataModel.FromSchema<typeof schemaDefinition>\"),\n );\n yield* cbw.writeLine(\n \"> = VectorSearch_.VectorSearch<DataModel.FromSchema<typeof schemaDefinition>>();\",\n );\n yield* cbw.writeLine(\n \"export type VectorSearch = typeof VectorSearch.Identifier;\",\n );\n yield* cbw.blankLine();\n\n // DatabaseReader\n yield* cbw.writeLine(\n \"export const DatabaseReader: DatabaseReader_.DatabaseReaderTag<\",\n );\n yield* cbw.indent(\n Effect.gen(function* () {\n yield* cbw.writeLine(\"typeof schemaDefinition,\");\n yield* cbw.writeLine(\"Docs\");\n }),\n );\n yield* cbw.writeLine(\n \"> = DatabaseReader_.DatabaseReader<typeof schemaDefinition, Docs>();\",\n );\n yield* cbw.writeLine(\n \"export type DatabaseReader = typeof DatabaseReader.Identifier;\",\n );\n yield* cbw.blankLine();\n\n // DatabaseWriter\n yield* cbw.writeLine(\n \"export const DatabaseWriter: DatabaseWriter_.DatabaseWriterTag<\",\n );\n yield* cbw.indent(\n Effect.gen(function* () {\n yield* cbw.writeLine(\"typeof schemaDefinition,\");\n yield* cbw.writeLine(\"Docs\");\n }),\n );\n yield* cbw.writeLine(\n \"> = DatabaseWriter_.DatabaseWriter<typeof schemaDefinition, Docs>();\",\n );\n yield* cbw.writeLine(\n \"export type DatabaseWriter = typeof DatabaseWriter.Identifier;\",\n );\n yield* cbw.blankLine();\n\n yield* cbw.writeLine(\n \"export const QueryTransactionContext = QueryTransactionContext_.QueryTransactionContext;\",\n );\n yield* cbw.writeLine(\n \"export type QueryTransactionContext = typeof QueryTransactionContext.Identifier;\",\n );\n yield* cbw.blankLine();\n yield* cbw.writeLine(\n \"export const MutationTransactionContext = MutationTransactionContext_.MutationTransactionContext;\",\n );\n yield* cbw.writeLine(\n \"export type MutationTransactionContext = typeof MutationTransactionContext.Identifier;\",\n );\n yield* cbw.blankLine();\n\n // QueryRunner\n yield* cbw.writeLine(\"export const QueryRunner = QueryRunner_.QueryRunner;\");\n yield* cbw.writeLine(\n \"export type QueryRunner = typeof QueryRunner.Identifier;\",\n );\n yield* cbw.blankLine();\n\n // MutationRunner\n yield* cbw.writeLine(\n \"export const MutationRunner = MutationRunner_.MutationRunner;\",\n );\n yield* cbw.writeLine(\n \"export type MutationRunner = typeof MutationRunner.Identifier;\",\n );\n yield* cbw.blankLine();\n\n // ActionRunner\n yield* cbw.writeLine(\n \"export const ActionRunner = ActionRunner_.ActionRunner;\",\n );\n yield* cbw.writeLine(\n \"export type ActionRunner = typeof ActionRunner.Identifier;\",\n );\n yield* cbw.blankLine();\n\n // QueryCtx\n yield* cbw.writeLine(\"export const QueryCtx: QueryCtx_.QueryCtxTag<\");\n yield* cbw.indent(\n cbw.writeLine(\n `DataModel.ToConvex<DataModel.FromSchema<typeof schemaDefinition>>${component ? \", typeof scope\" : \"\"}`,\n ),\n );\n yield* cbw.writeLine(\"> = QueryCtx_.QueryCtx<\");\n yield* cbw.indent(\n cbw.writeLine(\n `DataModel.ToConvex<DataModel.FromSchema<typeof schemaDefinition>>${component ? \", typeof scope\" : \"\"}`,\n ),\n );\n yield* cbw.writeLine(\">();\");\n yield* cbw.writeLine(\"export type QueryCtx = typeof QueryCtx.Identifier;\");\n yield* cbw.blankLine();\n\n // MutationCtx\n yield* cbw.writeLine(\n \"export const MutationCtx: MutationCtx_.MutationCtxTag<\",\n );\n yield* cbw.indent(\n cbw.writeLine(\n `DataModel.ToConvex<DataModel.FromSchema<typeof schemaDefinition>>${component ? \", typeof scope\" : \"\"}`,\n ),\n );\n yield* cbw.writeLine(\"> = MutationCtx_.MutationCtx<\");\n yield* cbw.indent(\n cbw.writeLine(\n `DataModel.ToConvex<DataModel.FromSchema<typeof schemaDefinition>>${component ? \", typeof scope\" : \"\"}`,\n ),\n );\n yield* cbw.writeLine(\">();\");\n yield* cbw.writeLine(\n \"export type MutationCtx = typeof MutationCtx.Identifier;\",\n );\n yield* cbw.blankLine();\n\n // ActionCtx\n yield* cbw.writeLine(\"export const ActionCtx: ActionCtx_.ActionCtxTag<\");\n yield* cbw.indent(\n cbw.writeLine(\n `DataModel.ToConvex<DataModel.FromSchema<typeof schemaDefinition>>${component ? \", typeof scope\" : \"\"}`,\n ),\n );\n yield* cbw.writeLine(\"> = ActionCtx_.ActionCtx<\");\n yield* cbw.indent(\n cbw.writeLine(\n `DataModel.ToConvex<DataModel.FromSchema<typeof schemaDefinition>>${component ? \", typeof scope\" : \"\"}`,\n ),\n );\n yield* cbw.writeLine(\">();\");\n yield* cbw.writeLine(\"export type ActionCtx = typeof ActionCtx.Identifier;\");\n\n return yield* cbw.toString();\n});\n\nexport const assembledSpec = ({\n nodes,\n}: {\n nodes: ReadonlyArray<SpecAssemblyNode>;\n}) => renderSpecAssembly(nodes);\n"],"mappings":";;;;;;;;;;;;AAiBA,MAAa,UAAU,EACrB,6BAEA,aAAa,EAAE,uBAAuB,CAAC;AAEzC,MAAM,eAAe,OAAO,WAAW,WAAW,EAChD,0BAGC;CACD,MAAM,MAAM,IAAI,gBAAgB,EAAE,sBAAsB,EAAE,CAAC;CAE3D,OAAO,IAAI,UAAU,4BAA4B,uBAAuB,GAAG;CAE3E,OAAO,OAAO,IAAI,SAAS;AAC7B,CAAC;;;;;;;;;;;;;;;;;;;;AA0BD,MAAa,iBAAiB,EAC5B,cACA,YAAY,YAEZ,oBAAoB;CAAE;CAAc;AAAU,CAAC;AAEjD,MAAM,sBAAsB,OAAO,WAAW,WAAW,EACvD,cACA,YAAY,SAIX;CACD,MAAM,MAAM,IAAI,gBAAgB,EAAE,sBAAsB,EAAE,CAAC;CAE3D,OAAO,IAAI,UACT,sEACF;CAEA,IAAI,aAAa,SAAS,GAAG;EAC3B,OAAO,IAAI,UAAU;EACrB,OAAO,OAAO,QAAQ,eAAe,EAAE,WAAW,iBAChD,IAAI,UAAU,UAAU,UAAU,SAAS,WAAW,GAAG,CAC3D;CACF;CAEA,OAAO,IAAI,UAAU;CAErB,IAAI,WACF,OAAO,IAAI,UAAU,8CAA8C;CAGrE,IAAI,aAAa,WAAW,GAC1B,OAAO,IAAI,UACT,uDAAuD,YAAY,yBAAyB,GAAG,4BAA4B,YAAY,cAAc,GAAG,GAC1J;MACK;EACL,OAAO,IAAI,UACT,wDACF;EACA,OAAO,IAAI,OACT,OAAO,QACL,eACC,EAAE,gBACD,IAAI,UAAU,YAAY,UAAU,W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AI,UACT,wDACF;CACA,OAAO,IAAI,OACT,IAAI,UACF,oEAAoE,YAAY,mBAAmB,IACrG,CACF;CACA,OAAO,IAAI,UAAU,+BAA+B;CACpD,OAAO,IAAI,OACT,IAAI,UACF,oEAAoE,YAAY,mBAAmB,IACrG,CACF;CACA,OAAO,IAAI,UAAU,MAAM;CAC3B,OAAO,IAAI,UACT,0DACF;CACA,OAAO,IAAI,UAAU;CAGrB,OAAO,IAAI,UAAU,kDAAkD;CACvE,OAAO,IAAI,OACT,IAAI,UACF,oEAAoE,YAAY,mBAAmB,IACrG,CACF;CACA,OAAO,IAAI,UAAU,2BAA2B;CAChD,OAAO,IAAI,OACT,IAAI,UACF,oEAAoE,YAAY,mBAAmB,IACrG,CACF;CACA,OAAO,IAAI,UAAU,MAAM;CAC3B,OAAO,IAAI,UAAU,sDAAsD;CAE3E,OAAO,OAAO,IAAI,SAAS;AAC7B,CAAC;AAED,MAAa,iBAAiB,EAC5B,YAGIA,OAAmB,KAAK"}
1
+ {"version":3,"file":"templates.mjs","names":["renderSpecAssembly"],"sources":["../src/templates.ts"],"sourcesContent":["import type * as IdScope from \"@confect/core/IdScope\";\nimport * as Array from \"effect/Array\";\nimport * as Effect from \"effect/Effect\";\nimport type * as GroupSpec from \"@confect/core/GroupSpec\";\nimport { CodeBlockWriter } from \"./CodeBlockWriter.js\";\nimport {\n render as renderSpecAssembly,\n type SpecAssemblyNode,\n} from \"./SpecAssemblyNode.js\";\n\n/**\n * Emit `convex/schema.ts` as a one-line re-export of the codegen-emitted deploy\n * schema in `confect/_generated/convexSchema.ts`. Deploy-time consumers (the\n * Convex CLI, `convex-test`) keep reading `convex/schema.ts`; the runtime\n * `DatabaseSchema` in `confect/_generated/schema.ts` is untouched by this\n * file.\n */\nexport const schema = ({\n convexSchemaImportPath,\n}: Parameters<typeof schemaEffect>[0]) =>\n schemaEffect({ convexSchemaImportPath });\n\nconst schemaEffect = Effect.fnUntraced(function* ({\n convexSchemaImportPath,\n}: {\n convexSchemaImportPath: string;\n}) {\n const cbw = new CodeBlockWriter({ indentNumberOfSpaces: 2 });\n\n yield* cbw.writeLine(`export { default } from \"${convexSchemaImportPath}\";`);\n\n return yield* cbw.toString();\n});\n\ninterface TableModuleBinding {\n readonly importPath: string;\n readonly tableName: string;\n}\n\n/**\n * Emit `confect/_generated/schema.ts`—the runtime `DatabaseSchema` used by\n * impls and the per-group registries (and downstream by per-function bundles\n * for codec lookup). Every table wrapper at\n * `confect/_generated/tables/<name>.ts` is imported statically and registered\n * as a value entry on the `DatabaseSchema.make({...})` call. Per-table laziness\n * lives inside each `Table`: its `Fields` and `Doc` are lazy memoised getters\n * that only evaluate the user-supplied field-schema callback on first access,\n * so unused tables in a function bundle never pay schema-construction cost\n * despite the static import.\n *\n * The `DatabaseSchema` import is aliased to `$DatabaseSchema` because each\n * table is imported under its own (filename-derived) name; a table named\n * `DatabaseSchema` would otherwise collide with the library import and emit a\n * duplicate-binding file. The leading `$` makes the alias collision-proof:\n * `validateConfectTableIdentifier` requires names to match\n * `/^[a-zA-Z][a-zA-Z0-9_]*$/`, which forbids `$`, so no valid table import can\n * ever shadow it.\n */\nexport const runtimeSchema = ({\n tableModules,\n component = false,\n}: Parameters<typeof runtimeSchemaEffect>[0]) =>\n runtimeSchemaEffect({ tableModules, component });\n\nconst runtimeSchemaEffect = Effect.fnUntraced(function* ({\n tableModules,\n component = false,\n}: {\n tableModules: ReadonlyArray<TableModuleBinding>;\n component?: boolean;\n}) {\n const cbw = new CodeBlockWriter({ indentNumberOfSpaces: 2 });\n\n yield* cbw.writeLine(\n `import { DatabaseSchema as $DatabaseSchema } from \"@confect/server\";`,\n );\n\n if (tableModules.length > 0) {\n yield* cbw.blankLine();\n yield* Effect.forEach(tableModules, ({ tableName, importPath }) =>\n cbw.writeLine(`import ${tableName} from \"${importPath}\";`),\n );\n }\n\n yield* cbw.blankLine();\n\n if (component) {\n yield* cbw.writeLine(`import { target as $target } from \"./id.js\";`);\n }\n\n if (tableModules.length === 0) {\n yield* cbw.writeLine(\n `const databaseSchema: $DatabaseSchema.DatabaseSchema${component ? \"<{}, typeof $target>\" : \"\"} = $DatabaseSchema.make({}${component ? \", $target\" : \"\"});`,\n );\n } else {\n yield* cbw.writeLine(\n `const databaseSchema: $DatabaseSchema.DatabaseSchema<{`,\n );\n yield* cbw.indent(\n Effect.forEach(\n tableModules,\n ({ tableName }) =>\n cbw.writeLine(`readonly ${tableName}: typeof ${tableName};`),\n { discard: true },\n ),\n );\n yield* cbw.writeLine(\n `}${component ? \", typeof $target\" : \"\"}> = $DatabaseSchema.make({`,\n );\n yield* cbw.indent(\n Effect.gen(function* () {\n for (const { tableName } of tableModules) {\n yield* cbw.writeLine(`${tableName},`);\n }\n }),\n );\n yield* cbw.writeLine(`}${component ? \", $target\" : \"\"});`);\n }\n\n yield* cbw.blankLine();\n yield* cbw.writeLine(`export default databaseSchema;`);\n\n return yield* cbw.toString();\n});\n\n/**\n * Emit `confect/_generated/convexSchema.ts`—the Convex deploy-time\n * `SchemaDefinition`. Imports every table from its generated wrapper at\n * `_generated/tables/<name>` and calls `defineSchema({...})` exactly once.\n * `Table.tableDefinition` lives in `@confect/server` because it is the\n * `defineTable` binding; the generated table wrappers themselves stay\n * client-safe (`Fields`/`Doc` from `@confect/core`).\n *\n * The `defineSchema` and `Table` imports are aliased with a leading `$` because\n * each table is imported under its own (filename-derived) name; a table named\n * `defineSchema` or `Table` would otherwise collide with the library import and\n * emit a duplicate-binding file. `validateConfectTableIdentifier` requires\n * names to match `/^[a-zA-Z][a-zA-Z0-9_]*$/`, which forbids `$`, so no valid\n * table import can ever shadow them.\n */\nexport const convexSchema = ({\n tableModules,\n}: Parameters<typeof convexSchemaEffect>[0]) =>\n convexSchemaEffect({ tableModules });\n\nconst convexSchemaEffect = Effect.fnUntraced(function* ({\n tableModules,\n}: {\n tableModules: ReadonlyArray<TableModuleBinding>;\n}) {\n const cbw = new CodeBlockWriter({ indentNumberOfSpaces: 2 });\n\n yield* cbw.writeLine(\n `import { defineSchema as $defineSchema } from \"convex/server\";`,\n );\n\n if (tableModules.length > 0) {\n yield* cbw.writeLine(`import { Table as $Table } from \"@confect/server\";`);\n yield* cbw.blankLine();\n yield* Effect.forEach(tableModules, ({ tableName, importPath }) =>\n cbw.writeLine(`import ${tableName} from \"${importPath}\";`),\n );\n }\n\n yield* cbw.blankLine();\n\n if (tableModules.length === 0) {\n yield* cbw.writeLine(`export default $defineSchema({});`);\n } else {\n yield* cbw.writeLine(`export default $defineSchema({`);\n yield* cbw.indent(\n Effect.gen(function* () {\n for (const { tableName } of tableModules) {\n yield* cbw.writeLine(\n `${tableName}: $Table.tableDefinition(${tableName}),`,\n );\n }\n }),\n );\n yield* cbw.writeLine(`});`);\n }\n\n return yield* cbw.toString();\n});\n\n/**\n * Emit `confect/_generated/id.ts`—a type-constrained `Id` constructor and a\n * `TableNames` union derived from the user's `confect/tables/*.ts` filenames.\n * User-authored table modules import `Id` from this file to declare cross-table\n * id references without typing the destination name as a free string (and\n * without ever importing each other transitively).\n *\n * `Id` also accepts Convex system tables, with the component scope when\n * present. `TableNames` includes only user tables and resolves to `never` for\n * an empty table directory.\n */\nexport const id = ({ tableNames, scope }: Parameters<typeof idEffect>[0]) =>\n idEffect({ tableNames, scope });\n\nconst idEffect = Effect.fnUntraced(function* ({\n tableNames,\n scope,\n}: {\n tableNames: ReadonlyArray<string>;\n scope?: IdScope.Component<string> | undefined;\n}) {\n const cbw = new CodeBlockWriter({ indentNumberOfSpaces: 2 });\n\n yield* cbw.writeLine(\n `import { GenericId${scope === undefined ? \"\" : \", IdScope\"} } from \"@confect/core\";`,\n );\n yield* cbw.writeLine(\n `import type { SystemTableNames } from \"convex/server\";`,\n );\n yield* cbw.blankLine();\n if (scope !== undefined) {\n yield* cbw.writeLine(\n // oxlint-disable-next-line effecttsgo/prefer-schema-over-json -- Emit an escaped TypeScript string literal, not a JSON payload.\n `export const scope = IdScope.component(${JSON.stringify(scope.slice(\"component:\".length))});`,\n );\n yield* cbw.writeLine(\n `export const target = { kind: \"component\", scope } as const;`,\n );\n }\n\n const union =\n tableNames.length === 0\n ? \"never\"\n : tableNames.map((n) => `\"${n}\"`).join(\" | \");\n yield* cbw.writeLine(`export type TableNames = ${union};`);\n yield* cbw.blankLine();\n\n yield* cbw.writeLine(\n `export type Id<TableName extends TableNames | SystemTableNames> = GenericId.GenericId<TableName${scope === undefined ? \"\" : \", typeof scope\"}>;`,\n );\n yield* cbw.blankLine();\n\n yield* cbw.writeLine(\n `export const Id = <const TableName extends TableNames | SystemTableNames>(`,\n );\n yield* cbw.indent(cbw.writeLine(`tableName: TableName,`));\n yield* cbw.writeLine(\n `) => GenericId.GenericId(tableName${scope === undefined ? \"\" : \", scope\"});`,\n );\n\n return yield* cbw.toString();\n});\n\n/**\n * Emit `confect/_generated/tables/<tableName>.ts`—a two-line wrapper that\n * imports the user-authored `UnnamedTable` and binds the file basename to it,\n * producing the fully-named `Table` value that downstream consumers (schema,\n * specs, impls) read.\n */\nexport const tableWrapper = ({\n tableName,\n unnamedImportPath,\n component = false,\n}: Parameters<typeof tableWrapperEffect>[0]) =>\n tableWrapperEffect({ tableName, unnamedImportPath, component });\n\nconst tableWrapperEffect = Effect.fnUntraced(function* ({\n tableName,\n unnamedImportPath,\n component = false,\n}: {\n tableName: string;\n unnamedImportPath: string;\n component?: boolean;\n}) {\n const cbw = new CodeBlockWriter({ indentNumberOfSpaces: 2 });\n\n yield* cbw.writeLine(`import unnamed from \"${unnamedImportPath}\";`);\n if (component) yield* cbw.writeLine(`import { scope } from \"../id.js\";`);\n yield* cbw.blankLine();\n yield* cbw.writeLine(\n `export default unnamed(\"${tableName}\"${component ? \", scope\" : \"\"});`,\n );\n\n return yield* cbw.toString();\n});\n\nexport const http = ({ httpImportPath }: Parameters<typeof httpEffect>[0]) =>\n httpEffect({ httpImportPath });\n\nconst httpEffect = Effect.fnUntraced(function* ({\n httpImportPath,\n}: {\n httpImportPath: string;\n}) {\n const cbw = new CodeBlockWriter({ indentNumberOfSpaces: 2 });\n\n yield* cbw.writeLine(`import http from \"${httpImportPath}\";`);\n yield* cbw.newLine();\n yield* cbw.writeLine(`export default http;`);\n\n return yield* cbw.toString();\n});\n\n/**\n * Emit `convex/http.ts` for a declared backend: the Convex router serving\n * `confect/http.ts`'s routes, typed by the generated database schema.\n */\nexport const declaredHttp = Effect.fnUntraced(function* ({\n schemaImportPath,\n httpImportPath,\n}: {\n schemaImportPath: string;\n httpImportPath: string;\n}) {\n const cbw = new CodeBlockWriter({ indentNumberOfSpaces: 2 });\n\n yield* cbw.writeLine(\n \"// Generated by `confect codegen` from confect/http.ts. Do not edit.\",\n );\n yield* cbw.writeLine(`import { HttpRouter } from \"@confect/server\";`);\n yield* cbw.writeLine(`import schema from \"${schemaImportPath}\";`);\n yield* cbw.writeLine(`import http from \"${httpImportPath}\";`);\n yield* cbw.newLine();\n yield* cbw.writeLine(\n `export default HttpRouter.forSchema(schema)(http.routes, { api: http.api });`,\n );\n\n return yield* cbw.toString();\n});\n\nexport const crons = ({ cronsImportPath }: Parameters<typeof cronsEffect>[0]) =>\n cronsEffect({ cronsImportPath });\n\nconst cronsEffect = Effect.fnUntraced(function* ({\n cronsImportPath,\n}: {\n cronsImportPath: string;\n}) {\n const cbw = new CodeBlockWriter({ indentNumberOfSpaces: 2 });\n\n yield* cbw.writeLine(`import crons from \"${cronsImportPath}\";`);\n yield* cbw.newLine();\n yield* cbw.writeLine(`export default crons.convexCronJobs;`);\n\n return yield* cbw.toString();\n});\n\nexport const authConfig = ({\n authImportPath,\n}: Parameters<typeof authConfigEffect>[0]) =>\n authConfigEffect({ authImportPath });\n\nconst authConfigEffect = Effect.fnUntraced(function* ({\n authImportPath,\n}: {\n authImportPath: string;\n}) {\n const cbw = new CodeBlockWriter({ indentNumberOfSpaces: 2 });\n\n yield* cbw.writeLine(`import auth from \"${authImportPath}\";`);\n yield* cbw.newLine();\n yield* cbw.writeLine(`export default auth;`);\n\n return yield* cbw.toString();\n});\n\n/**\n * Emit `confect/_generated/components.ts`—a typed registry of the Convex\n * components installed via `app.use(...)` in `convex/convex.config.ts`. Mirrors\n * the `components` export of Convex's generated `convex/_generated/api`: the\n * runtime value is `componentsGeneric()` (a name-preserving proxy), and each\n * entry is typed with the `ComponentApi` that component packages export from\n * `_generated/component.js`. Unlike `convex/_generated/api`, this file exists\n * before `convex codegen` ever runs, so impl modules can import it\n * safely—`confect codegen` bundles and evaluates each impl's import graph, and\n * `convex/_generated/api` doesn't exist yet at that point.\n *\n * The `as any` cast is confined here: `componentsGeneric()` is typed\n * `AnyChildComponents`, which deliberately doesn't overlap the precise registry\n * type; the `Components` annotation on the const supplies the real type.\n */\nexport const components = ({\n components: installedComponents,\n}: Parameters<typeof componentsEffect>[0]) =>\n componentsEffect({ components: installedComponents });\n\nconst componentsEffect = Effect.fnUntraced(function* ({\n components: installedComponents,\n}: {\n components: ReadonlyArray<{ name: string; typeImportPath: string }>;\n}) {\n const cbw = new CodeBlockWriter({ indentNumberOfSpaces: 2 });\n\n yield* cbw.writeLine(`import { componentsGeneric } from \"convex/server\";`);\n yield* cbw.blankLine();\n\n if (installedComponents.length === 0) {\n yield* cbw.writeLine(`export type Components = {};`);\n } else {\n yield* cbw.writeLine(`export type Components = {`);\n yield* cbw.indent(\n Effect.forEach(\n installedComponents,\n ({ name, typeImportPath }) =>\n cbw.writeLine(\n `\"${name}\": import(\"${typeImportPath}/_generated/component.js\").ComponentApi<\"${name}\">;`,\n ),\n { discard: true },\n ),\n );\n yield* cbw.writeLine(`};`);\n }\n yield* cbw.blankLine();\n\n yield* cbw.writeLine(\n `export const components: Components = componentsGeneric() as any;`,\n );\n\n return yield* cbw.toString();\n});\n\nexport const refs = ({ specImportPath }: Parameters<typeof refsEffect>[0]) =>\n refsEffect({ specImportPath });\n\nconst refsEffect = Effect.fnUntraced(function* ({\n specImportPath,\n}: {\n specImportPath: string;\n}) {\n const cbw = new CodeBlockWriter({ indentNumberOfSpaces: 2 });\n\n yield* cbw.writeLine(`import { Refs } from \"@confect/core\";`);\n yield* cbw.writeLine(`import spec from \"${specImportPath}\";`);\n yield* cbw.blankLine();\n yield* cbw.writeLine(\n `const refs: Refs.FromSpec<typeof spec> = Refs.make(spec);`,\n );\n yield* cbw.blankLine();\n yield* cbw.writeLine(`export default refs;`);\n\n return yield* cbw.toString();\n});\n\nexport const componentContract = Effect.fnUntraced(function* ({\n tableNames,\n}: {\n tableNames: ReadonlyArray<string>;\n}) {\n const cbw = new CodeBlockWriter({ indentNumberOfSpaces: 2 });\n yield* cbw.writeLine('import { Component } from \"@confect/core\";');\n yield* cbw.writeLine('import spec from \"./spec.js\";');\n yield* cbw.writeLine('import { scope } from \"./id.js\";');\n yield* cbw.blankLine();\n const names = Array.map(\n [...tableNames, \"_storage\", \"_scheduled_functions\"],\n (name) => `\"${name}\"`,\n );\n yield* cbw.writeLine(\n `const component: Component.Component<typeof spec, typeof scope, ${names.join(\" | \")}> = Component.make(spec, scope, [${names.join(\", \")}]);`,\n );\n yield* cbw.writeLine(\"export default component;\");\n return yield* cbw.toString();\n});\n\n/**\n * Emit `_generated/docs.ts`: one named `type <table>` alias per table plus a\n * `Docs` registry. Each alias is `Document.Document<typeof schemaDefinition,\n * \"<table>\">`, so it stays structurally exact while giving the document a\n * _name_—declaration emit then prints e.g. `NotesDoc` instead of expanding the\n * row structure. A `type` alias (rather than an extending `interface`) is used\n * so it works for every document shape: object tables, but also union schemas\n * (`Schema.Union`) and other non-object documents, which an `interface …\n * extends` cannot represent (TS2312). The registry is threaded into the\n * generated `DatabaseReader`/`DatabaseWriter` tags so query/mutation helpers\n * print named documents with no user annotations.\n */\nexport const docs = ({\n schemaImportPath,\n tables,\n}: Parameters<typeof docsEffect>[0]) =>\n docsEffect({ schemaImportPath, tables });\n\nconst docsEffect = Effect.fnUntraced(function* ({\n schemaImportPath,\n tables,\n}: {\n schemaImportPath: string;\n tables: ReadonlyArray<{ tableName: string; docName: string }>;\n}) {\n const cbw = new CodeBlockWriter({ indentNumberOfSpaces: 2 });\n\n // With no tables there is nothing to import—emitting the (unused) imports\n // would trip `noUnusedLocals`.\n if (tables.length === 0) {\n yield* cbw.writeLine(`export interface Docs {}`);\n return yield* cbw.toString();\n }\n\n yield* cbw.writeLine(`import type { Document } from \"@confect/server\";`);\n yield* cbw.writeLine(\n `import type schemaDefinition from \"${schemaImportPath}\";`,\n );\n yield* cbw.blankLine();\n\n for (const { tableName, docName } of tables) {\n yield* cbw.writeLine(\n `export type ${docName} = Document.Document<typeof schemaDefinition, \"${tableName}\">;`,\n );\n }\n yield* cbw.blankLine();\n\n yield* cbw.writeLine(`export interface Docs {`);\n yield* cbw.indent(\n Effect.gen(function* () {\n for (const { tableName, docName } of tables) {\n yield* cbw.writeLine(`${tableName}: ${docName};`);\n }\n }),\n );\n yield* cbw.writeLine(`}`);\n\n return yield* cbw.toString();\n});\n\nexport const registeredFunctionsForGroup = ({\n spec,\n schemaImportPath,\n specImportPath,\n implImportPath,\n groupPath = \"\",\n required = [],\n}: Parameters<typeof registeredFunctionsForGroupEffect>[0]) =>\n registeredFunctionsForGroupEffect({\n spec,\n schemaImportPath,\n specImportPath,\n implImportPath,\n groupPath,\n required,\n });\n\nconst registeredFunctionsForGroupEffect = Effect.fnUntraced(function* ({\n spec,\n schemaImportPath,\n specImportPath,\n implImportPath,\n groupPath = \"\",\n required = [],\n}: {\n spec: GroupSpec.AnyWithProps;\n schemaImportPath: string;\n specImportPath: string;\n implImportPath: string;\n groupPath?: string;\n required?: ReadonlyArray<{ readonly key: string }>;\n}) {\n const cbw = new CodeBlockWriter({ indentNumberOfSpaces: 2 });\n const useNode = spec.runtime === \"Node\";\n\n const hasConfectFunctions = (group: GroupSpec.AnyWithProps): boolean =>\n Object.values(group.functions).some(\n (functionSpec) => functionSpec.functionProvenance._tag === \"Confect\",\n ) || Object.values(group.groups).some(hasConfectFunctions);\n const forwarding = !useNode && hasConfectFunctions(spec);\n\n if (useNode) {\n yield* cbw.writeLine(\n `import { RegisteredNodeFunction } from \"@confect/server/node\";`,\n );\n } else if (!forwarding) {\n yield* cbw.writeLine(\n `import { RegisteredFunctions } from \"@confect/server\";`,\n );\n } else {\n yield* cbw.writeLine(\n `import { ConvexFunctionDefinitions, RegisteredConvexFunction, type RegisteredFunctions } from \"@confect/server\";`,\n );\n }\n\n if (required.length > 0) {\n yield* cbw.writeLine(`import { GroupImpl } from \"@confect/server\";`);\n }\n yield* cbw.writeLine(`import databaseSchema from \"${schemaImportPath}\";`);\n yield* cbw.writeLine(`import groupLayer from \"${implImportPath}\";`);\n yield* cbw.blankLine();\n // The group's own leaf spec is referenced type-only (`typeof import(...)`),\n // so the spec module is erased at transpile time and never enters the\n // per-function bundle; only `databaseSchema` and the impl are runtime\n // imports. Typing from the leaf spec (not the project-wide assembled spec)\n // keeps the registry's type dependent solely on its own group.\n const groupLayer =\n required.length === 0\n ? \"groupLayer\"\n : // oxlint-disable-next-line effecttsgo/prefer-schema-over-json -- Emit escaped TypeScript string literals, not JSON payloads.\n `groupLayer.pipe(GroupImpl.finalize({ required: [${required.map(({ key }) => `{ key: ${JSON.stringify(key)} }`).join(\", \")}], groupPath: ${JSON.stringify(groupPath)} }))`;\n const specType = `typeof import(\"${specImportPath}\")[\"default\"]`;\n if (useNode) {\n yield* cbw.writeLine(\n `export default RegisteredNodeFunction.buildForGroup<${specType}>(databaseSchema, ${groupLayer});`,\n );\n } else if (!forwarding) {\n yield* cbw.writeLine(\n `export default RegisteredFunctions.buildForGroup<${specType}>(databaseSchema, ${groupLayer});`,\n );\n } else {\n const bindings = (group: GroupSpec.AnyWithProps, path: string): string =>\n `{\n${[\n ...Object.entries(group.functions).map(([name, functionSpec]) => {\n const key = JSON.stringify(name);\n const definition = `${path}[${key}]`;\n return `[${key}]: ${\n functionSpec.functionProvenance._tag === \"Convex\"\n ? `${definition}.handler`\n : `RegisteredConvexFunction.register({ ...${definition}, handler: forward(${definition}.handler) })`\n },`;\n }),\n ...Object.entries(group.groups).map(([name, child]) => {\n const key = JSON.stringify(name);\n return `[${key}]: ${bindings(child, `${path}[${key}]`)},`;\n }),\n].join(\"\\n\")}\n}`;\n yield* cbw.writeLine(`const forward = <Ctx, Args, Returns>(handler: (ctx: Ctx, args: Args) => Promise<Returns>) => (ctx: Ctx, args: Args) => handler(ctx, args);\n\nconst definitions = ConvexFunctionDefinitions.buildForGroup<${specType}>(databaseSchema, ${groupLayer});\n\nexport default ${bindings(spec, \"definitions\")} as RegisteredFunctions.RegisteredFunctionsForGroupSpec<${specType}>;`);\n }\n\n return yield* cbw.toString();\n});\n\nexport const services = ({\n schemaImportPath,\n component = false,\n}: Parameters<typeof servicesEffect>[0]) =>\n servicesEffect({ schemaImportPath, component });\n\nconst servicesEffect = Effect.fnUntraced(function* ({\n schemaImportPath,\n component = false,\n}: {\n schemaImportPath: string;\n component?: boolean;\n}) {\n const cbw = new CodeBlockWriter({ indentNumberOfSpaces: 2 });\n\n // Imports\n yield* cbw.writeLine(\"import {\");\n yield* cbw.indent(\n Effect.gen(function* () {\n yield* cbw.writeLine(\"ActionCtx as ActionCtx_,\");\n yield* cbw.writeLine(\"ActionRunner as ActionRunner_,\");\n if (!component) yield* cbw.writeLine(\"Auth as Auth_,\");\n yield* cbw.writeLine(\"type DataModel,\");\n yield* cbw.writeLine(\"DatabaseReader as DatabaseReader_,\");\n yield* cbw.writeLine(\"DatabaseWriter as DatabaseWriter_,\");\n yield* cbw.writeLine(\"ExecutionMetadata as ExecutionMetadata_,\");\n yield* cbw.writeLine(\"MutationCtx as MutationCtx_,\");\n yield* cbw.writeLine(\"MutationRunner as MutationRunner_,\");\n yield* cbw.writeLine(\n \"MutationTransactionContext as MutationTransactionContext_,\",\n );\n yield* cbw.writeLine(\"QueryCtx as QueryCtx_,\");\n yield* cbw.writeLine(\"QueryRunner as QueryRunner_,\");\n yield* cbw.writeLine(\n \"QueryTransactionContext as QueryTransactionContext_,\",\n );\n yield* cbw.writeLine(\"RequestMetadata as RequestMetadata_,\");\n yield* cbw.writeLine(\"Scheduler as Scheduler_,\");\n if (!component) yield* cbw.writeLine(\"Storage as Storage_,\");\n yield* cbw.writeLine(\"StorageActionWriter as StorageActionWriter_,\");\n yield* cbw.writeLine(\"StorageReader as StorageReader_,\");\n yield* cbw.writeLine(\"StorageWriter as StorageWriter_,\");\n yield* cbw.writeLine(\"TransactionMetadata as TransactionMetadata_,\");\n yield* cbw.writeLine(\"VectorSearch as VectorSearch_,\");\n }),\n );\n yield* cbw.writeLine(`} from \"@confect/server\";`);\n yield* cbw.writeLine(\n `import type schemaDefinition from \"${schemaImportPath}\";`,\n );\n yield* cbw.writeLine(`import type { Docs } from \"./docs.js\";`);\n if (component) yield* cbw.writeLine(`import type { scope } from \"./id.js\";`);\n yield* cbw.blankLine();\n\n // Auth\n if (!component) {\n yield* cbw.writeLine(\"export const Auth = Auth_.Auth;\");\n yield* cbw.writeLine(\"export type Auth = typeof Auth.Identifier;\");\n }\n yield* cbw.blankLine();\n\n yield* cbw.writeLine(\n \"export const ExecutionMetadata = ExecutionMetadata_.ExecutionMetadata;\",\n );\n yield* cbw.writeLine(\n \"export type ExecutionMetadata = typeof ExecutionMetadata.Identifier;\",\n );\n yield* cbw.blankLine();\n\n yield* cbw.writeLine(\n \"export const RequestMetadata = RequestMetadata_.RequestMetadata;\",\n );\n yield* cbw.writeLine(\n \"export type RequestMetadata = typeof RequestMetadata.Identifier;\",\n );\n yield* cbw.blankLine();\n\n yield* cbw.writeLine(\n \"export const TransactionMetadata = TransactionMetadata_.TransactionMetadata;\",\n );\n yield* cbw.writeLine(\n \"export type TransactionMetadata = typeof TransactionMetadata.Identifier;\",\n );\n yield* cbw.blankLine();\n\n // Scheduler\n yield* cbw.writeLine(\n component\n ? \"export const Scheduler = Scheduler_.forScope<typeof scope>();\"\n : \"export const Scheduler = Scheduler_.Scheduler;\",\n );\n yield* cbw.writeLine(\"export type Scheduler = typeof Scheduler.Identifier;\");\n yield* cbw.blankLine();\n\n if (!component) {\n yield* cbw.writeLine(\"export const Storage = Storage_.Storage;\");\n yield* cbw.writeLine(\"export type Storage = typeof Storage.Identifier;\");\n yield* cbw.blankLine();\n }\n\n // StorageReader\n yield* cbw.writeLine(\n `export const StorageReader = StorageReader_.StorageReader${component ? \".forScope<typeof scope>()\" : \"\"};`,\n );\n yield* cbw.writeLine(\n \"export type StorageReader = typeof StorageReader.Identifier;\",\n );\n yield* cbw.blankLine();\n\n // StorageWriter\n yield* cbw.writeLine(\n `export const StorageWriter = StorageWriter_.StorageWriter${component ? \".forScope<typeof scope>()\" : \"\"};`,\n );\n yield* cbw.writeLine(\n \"export type StorageWriter = typeof StorageWriter.Identifier;\",\n );\n yield* cbw.blankLine();\n\n // StorageActionWriter\n yield* cbw.writeLine(\n `export const StorageActionWriter = StorageActionWriter_.StorageActionWriter${component ? \".forScope<typeof scope>()\" : \"\"};`,\n );\n yield* cbw.writeLine(\n \"export type StorageActionWriter = typeof StorageActionWriter.Identifier;\",\n );\n yield* cbw.blankLine();\n\n // VectorSearch\n yield* cbw.writeLine(\n \"export const VectorSearch: VectorSearch_.VectorSearchTag<\",\n );\n yield* cbw.indent(\n cbw.writeLine(\"DataModel.FromSchema<typeof schemaDefinition>\"),\n );\n yield* cbw.writeLine(\n \"> = VectorSearch_.VectorSearch<DataModel.FromSchema<typeof schemaDefinition>>();\",\n );\n yield* cbw.writeLine(\n \"export type VectorSearch = typeof VectorSearch.Identifier;\",\n );\n yield* cbw.blankLine();\n\n // DatabaseReader\n yield* cbw.writeLine(\n \"export const DatabaseReader: DatabaseReader_.DatabaseReaderTag<\",\n );\n yield* cbw.indent(\n Effect.gen(function* () {\n yield* cbw.writeLine(\"typeof schemaDefinition,\");\n yield* cbw.writeLine(\"Docs\");\n }),\n );\n yield* cbw.writeLine(\n \"> = DatabaseReader_.DatabaseReader<typeof schemaDefinition, Docs>();\",\n );\n yield* cbw.writeLine(\n \"export type DatabaseReader = typeof DatabaseReader.Identifier;\",\n );\n yield* cbw.blankLine();\n\n // DatabaseWriter\n yield* cbw.writeLine(\n \"export const DatabaseWriter: DatabaseWriter_.DatabaseWriterTag<\",\n );\n yield* cbw.indent(\n Effect.gen(function* () {\n yield* cbw.writeLine(\"typeof schemaDefinition,\");\n yield* cbw.writeLine(\"Docs\");\n }),\n );\n yield* cbw.writeLine(\n \"> = DatabaseWriter_.DatabaseWriter<typeof schemaDefinition, Docs>();\",\n );\n yield* cbw.writeLine(\n \"export type DatabaseWriter = typeof DatabaseWriter.Identifier;\",\n );\n yield* cbw.blankLine();\n\n yield* cbw.writeLine(\n \"export const QueryTransactionContext = QueryTransactionContext_.QueryTransactionContext;\",\n );\n yield* cbw.writeLine(\n \"export type QueryTransactionContext = typeof QueryTransactionContext.Identifier;\",\n );\n yield* cbw.blankLine();\n yield* cbw.writeLine(\n \"export const MutationTransactionContext = MutationTransactionContext_.MutationTransactionContext;\",\n );\n yield* cbw.writeLine(\n \"export type MutationTransactionContext = typeof MutationTransactionContext.Identifier;\",\n );\n yield* cbw.blankLine();\n\n // QueryRunner\n yield* cbw.writeLine(\"export const QueryRunner = QueryRunner_.QueryRunner;\");\n yield* cbw.writeLine(\n \"export type QueryRunner = typeof QueryRunner.Identifier;\",\n );\n yield* cbw.blankLine();\n\n // MutationRunner\n yield* cbw.writeLine(\n \"export const MutationRunner = MutationRunner_.MutationRunner;\",\n );\n yield* cbw.writeLine(\n \"export type MutationRunner = typeof MutationRunner.Identifier;\",\n );\n yield* cbw.blankLine();\n\n // ActionRunner\n yield* cbw.writeLine(\n \"export const ActionRunner = ActionRunner_.ActionRunner;\",\n );\n yield* cbw.writeLine(\n \"export type ActionRunner = typeof ActionRunner.Identifier;\",\n );\n yield* cbw.blankLine();\n\n // QueryCtx\n yield* cbw.writeLine(\"export const QueryCtx: QueryCtx_.QueryCtxTag<\");\n yield* cbw.indent(\n cbw.writeLine(\n `DataModel.ToConvex<DataModel.FromSchema<typeof schemaDefinition>>${component ? \", typeof scope\" : \"\"}`,\n ),\n );\n yield* cbw.writeLine(\"> = QueryCtx_.QueryCtx<\");\n yield* cbw.indent(\n cbw.writeLine(\n `DataModel.ToConvex<DataModel.FromSchema<typeof schemaDefinition>>${component ? \", typeof scope\" : \"\"}`,\n ),\n );\n yield* cbw.writeLine(\">();\");\n yield* cbw.writeLine(\"export type QueryCtx = typeof QueryCtx.Identifier;\");\n yield* cbw.blankLine();\n\n // MutationCtx\n yield* cbw.writeLine(\n \"export const MutationCtx: MutationCtx_.MutationCtxTag<\",\n );\n yield* cbw.indent(\n cbw.writeLine(\n `DataModel.ToConvex<DataModel.FromSchema<typeof schemaDefinition>>${component ? \", typeof scope\" : \"\"}`,\n ),\n );\n yield* cbw.writeLine(\"> = MutationCtx_.MutationCtx<\");\n yield* cbw.indent(\n cbw.writeLine(\n `DataModel.ToConvex<DataModel.FromSchema<typeof schemaDefinition>>${component ? \", typeof scope\" : \"\"}`,\n ),\n );\n yield* cbw.writeLine(\">();\");\n yield* cbw.writeLine(\n \"export type MutationCtx = typeof MutationCtx.Identifier;\",\n );\n yield* cbw.blankLine();\n\n // ActionCtx\n yield* cbw.writeLine(\"export const ActionCtx: ActionCtx_.ActionCtxTag<\");\n yield* cbw.indent(\n cbw.writeLine(\n `DataModel.ToConvex<DataModel.FromSchema<typeof schemaDefinition>>${component ? \", typeof scope\" : \"\"}`,\n ),\n );\n yield* cbw.writeLine(\"> = ActionCtx_.ActionCtx<\");\n yield* cbw.indent(\n cbw.writeLine(\n `DataModel.ToConvex<DataModel.FromSchema<typeof schemaDefinition>>${component ? \", typeof scope\" : \"\"}`,\n ),\n );\n yield* cbw.writeLine(\">();\");\n yield* cbw.writeLine(\"export type ActionCtx = typeof ActionCtx.Identifier;\");\n\n return yield* cbw.toString();\n});\n\nexport const assembledSpec = ({\n nodes,\n}: {\n nodes: ReadonlyArray<SpecAssemblyNode>;\n}) => renderSpecAssembly(nodes);\n"],"mappings":";;;;;;;;;;;;AAiBA,MAAa,UAAU,EACrB,6BAEA,aAAa,EAAE,uBAAuB,CAAC;AAEzC,MAAM,eAAe,OAAO,WAAW,WAAW,EACh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T,IAAI,UACF,oEAAoE,YAAY,mBAAmB,IACrG,CACF;CACA,OAAO,IAAI,UAAU,+BAA+B;CACpD,OAAO,IAAI,OACT,IAAI,UACF,oEAAoE,YAAY,mBAAmB,IACrG,CACF;CACA,OAAO,IAAI,UAAU,MAAM;CAC3B,OAAO,IAAI,UACT,0DACF;CACA,OAAO,IAAI,UAAU;CAGrB,OAAO,IAAI,UAAU,kDAAkD;CACvE,OAAO,IAAI,OACT,IAAI,UACF,oEAAoE,YAAY,mBAAmB,IACrG,CACF;CACA,OAAO,IAAI,UAAU,2BAA2B;CAChD,OAAO,IAAI,OACT,IAAI,UACF,oEAAoE,YAAY,mBAAmB,IACrG,CACF;CACA,OAAO,IAAI,UAAU,MAAM;CAC3B,OAAO,IAAI,UAAU,sDAAsD;CAE3E,OAAO,OAAO,IAAI,SAAS;AAC7B,CAAC;AAED,MAAa,iBAAiB,EAC5B,YAGIA,OAAmB,KAAK"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@gaganref/confect-cli",
3
- "version": "10.3.1-fork.17",
3
+ "version": "10.3.1-fork.19",
4
4
  "dependencies": {
5
5
  "@effect/platform-node": "^4.0.4",
6
6
  "bundle-require": "^5.1.0",
@@ -9,8 +9,8 @@
9
9
  "exsolve": "^1.1.3"
10
10
  },
11
11
  "peerDependencies": {
12
- "@confect/core": "npm:@gaganref/confect-core@10.3.1-fork.17",
13
- "@confect/server": "npm:@gaganref/confect-server@10.3.1-fork.17",
12
+ "@confect/core": "npm:@gaganref/confect-core@10.3.1-fork.19",
13
+ "@confect/server": "npm:@gaganref/confect-server@10.3.1-fork.19",
14
14
  "effect": "^4.0.4"
15
15
  },
16
16
  "description": "Developer tooling for codegen and sync",