@gaganref/confect-cli 10.3.1-fork.1 → 10.3.1-fork.10

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 (44) hide show
  1. package/dist/Bundler.mjs.map +1 -1
  2. package/dist/CodegenError.mjs +1 -1
  3. package/dist/CodegenError.mjs.map +1 -1
  4. package/dist/ConfectDirectory.mjs.map +1 -1
  5. package/dist/ConvexConfig.mjs.map +1 -1
  6. package/dist/ConvexDirectory.mjs.map +1 -1
  7. package/dist/DirectoryOptions.mjs.map +1 -1
  8. package/dist/EntryPoint.mjs.map +1 -1
  9. package/dist/Evaluation.mjs.map +1 -1
  10. package/dist/EvaluationWorker.mjs.map +1 -1
  11. package/dist/FunctionModule.mjs.map +1 -1
  12. package/dist/FunctionPath.mjs.map +1 -1
  13. package/dist/FunctionPaths.mjs.map +1 -1
  14. package/dist/GenerationSnapshot.mjs.map +1 -1
  15. package/dist/GroupPaths.mjs.map +1 -1
  16. package/dist/ImplModulePath.mjs.map +1 -1
  17. package/dist/LeafModule.mjs +1 -1
  18. package/dist/LeafModule.mjs.map +1 -1
  19. package/dist/Remove.mjs.map +1 -1
  20. package/dist/Rollback.mjs.map +1 -1
  21. package/dist/SpecAssemblyNode.mjs.map +1 -1
  22. package/dist/SpecModulePath.mjs.map +1 -1
  23. package/dist/SyncState.mjs.map +1 -1
  24. package/dist/TableModule.mjs.map +1 -1
  25. package/dist/TableModulePath.mjs.map +1 -1
  26. package/dist/WatchBuild.mjs.map +1 -1
  27. package/dist/WatchTopology.mjs.map +1 -1
  28. package/dist/Watcher.mjs +49 -50
  29. package/dist/Watcher.mjs.map +1 -1
  30. package/dist/cliApp.mjs.map +1 -1
  31. package/dist/confect/codegen.mjs +31 -9
  32. package/dist/confect/codegen.mjs.map +1 -1
  33. package/dist/confect/declaration.mjs +4 -3
  34. package/dist/confect/declaration.mjs.map +1 -1
  35. package/dist/confect/dev.mjs.map +1 -1
  36. package/dist/confect.mjs.map +1 -1
  37. package/dist/index.mjs +0 -0
  38. package/dist/index.mjs.map +1 -1
  39. package/dist/log.mjs.map +1 -1
  40. package/dist/templates.mjs +6 -6
  41. package/dist/templates.mjs.map +1 -1
  42. package/dist/utils.mjs +1 -1
  43. package/dist/utils.mjs.map +1 -1
  44. package/package.json +3 -3
@@ -47,7 +47,7 @@ const runtimeSchemaEffect = Effect.fnUntraced(function* ({ tableModules, compone
47
47
  yield* Effect.forEach(tableModules, ({ tableName, importPath }) => cbw.writeLine(`import ${tableName} from "${importPath}";`));
48
48
  }
49
49
  yield* cbw.blankLine();
50
- if (component) yield* cbw.writeLine(`import { target as $target } from "./id";`);
50
+ if (component) yield* cbw.writeLine(`import { target as $target } from "./id.js";`);
51
51
  if (tableModules.length === 0) yield* cbw.writeLine(`const databaseSchema: $DatabaseSchema.DatabaseSchema${component ? "<{}, typeof $target>" : ""} = $DatabaseSchema.make({}${component ? ", $target" : ""});`);
52
52
  else {
53
53
  yield* cbw.writeLine(`const databaseSchema: $DatabaseSchema.DatabaseSchema<{`);
@@ -145,7 +145,7 @@ const tableWrapper = ({ tableName, unnamedImportPath, component = false }) => ta
145
145
  const tableWrapperEffect = Effect.fnUntraced(function* ({ tableName, unnamedImportPath, component = false }) {
146
146
  const cbw = new CodeBlockWriter({ indentNumberOfSpaces: 2 });
147
147
  yield* cbw.writeLine(`import unnamed from "${unnamedImportPath}";`);
148
- if (component) yield* cbw.writeLine(`import { scope } from "../id";`);
148
+ if (component) yield* cbw.writeLine(`import { scope } from "../id.js";`);
149
149
  yield* cbw.blankLine();
150
150
  yield* cbw.writeLine(`export default unnamed("${tableName}"${component ? ", scope" : ""});`);
151
151
  return yield* cbw.toString();
@@ -232,8 +232,8 @@ const refsEffect = Effect.fnUntraced(function* ({ specImportPath }) {
232
232
  const componentContract = Effect.fnUntraced(function* ({ tableNames }) {
233
233
  const cbw = new CodeBlockWriter({ indentNumberOfSpaces: 2 });
234
234
  yield* cbw.writeLine("import { Component } from \"@confect/core\";");
235
- yield* cbw.writeLine("import spec from \"./spec\";");
236
- yield* cbw.writeLine("import { scope } from \"./id\";");
235
+ yield* cbw.writeLine("import spec from \"./spec.js\";");
236
+ yield* cbw.writeLine("import { scope } from \"./id.js\";");
237
237
  yield* cbw.blankLine();
238
238
  const names = Array.map([
239
239
  ...tableNames,
@@ -349,8 +349,8 @@ const servicesEffect = Effect.fnUntraced(function* ({ schemaImportPath, componen
349
349
  }));
350
350
  yield* cbw.writeLine(`} from "@confect/server";`);
351
351
  yield* cbw.writeLine(`import type schemaDefinition from "${schemaImportPath}";`);
352
- yield* cbw.writeLine(`import type { Docs } from "./docs";`);
353
- if (component) yield* cbw.writeLine(`import type { scope } from "./id";`);
352
+ yield* cbw.writeLine(`import type { Docs } from "./docs.js";`);
353
+ if (component) yield* cbw.writeLine(`import type { scope } from "./id.js";`);
354
354
  yield* cbw.blankLine();
355
355
  if (!component) {
356
356
  yield* cbw.writeLine("export const Auth = Auth_.Auth;");
@@ -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\";\nimport {\n render as renderSpecAssembly,\n type SpecAssemblyNode,\n} from \"./SpecAssemblyNode\";\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\";`);\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\";`);\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\";');\n yield* cbw.writeLine('import { scope } from \"./id\";');\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\";`);\n if (component) yield* cbw.writeLine(`import type { scope } from \"./id\";`);\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,I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rB,OAAO,IAAI,UACT,+DACF;CACA,OAAO,IAAI,UACT,gEACF;CACA,OAAO,IAAI,UAAU;CAGrB,OAAO,IAAI,UACT,yDACF;CACA,OAAO,IAAI,UACT,4DACF;CACA,OAAO,IAAI,UAAU;CAGrB,OAAO,IAAI,UAAU,+CAA+C;CACpE,OAAO,IAAI,OACT,IAAI,UACF,oEAAoE,YAAY,mBAAmB,IACrG,CACF;CACA,OAAO,IAAI,UAAU,yBAAyB;CAC9C,OAAO,IAAI,OACT,IAAI,UACF,oEAAoE,YAAY,mBAAmB,IACrG,CACF;CACA,OAAO,IAAI,UAAU,MAAM;CAC3B,OAAO,IAAI,UAAU,oDAAoD;CACzE,OAAO,IAAI,UAAU;CAGrB,OAAO,IAAI,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}: 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,E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;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/dist/utils.mjs CHANGED
@@ -23,7 +23,7 @@ const toPosixPath = (path, pathStr) => pipe(String.split(pathStr, path.sep), Arr
23
23
  const toModuleImportPath = Effect.fnUntraced(function* (relativePath) {
24
24
  const path = yield* Path.Path;
25
25
  const withoutExt = toPosixPath(path, yield* removePathExtension(relativePath));
26
- return String.startsWith(".")(withoutExt) ? withoutExt : `./${withoutExt}`;
26
+ return String.startsWith(".")(withoutExt) ? `${withoutExt}.js` : `./${withoutExt}.js`;
27
27
  });
28
28
  const writeFileStringAndLog = Effect.fnUntraced(function* (filePath, contents) {
29
29
  const fs = yield* FileSystem.FileSystem;
@@ -1 +1 @@
1
- {"version":3,"file":"utils.mjs","names":["templates.http","templates.crons","templates.authConfig"],"sources":["../src/utils.ts"],"sourcesContent":["import * as FileSystem from \"effect/FileSystem\";\nimport * as Path from \"effect/Path\";\nimport type { PlatformError } from \"effect/PlatformError\";\nimport { pipe } from \"effect/Function\";\nimport * as Array from \"effect/Array\";\nimport * as Effect from \"effect/Effect\";\nimport * as DateTime from \"effect/DateTime\";\nimport * as Option from \"effect/Option\";\nimport * as String from \"effect/String\";\nimport { logFileAdded, logFileModified } from \"./log\";\nimport { ConfectDirectory } from \"./ConfectDirectory\";\nimport { ConvexDirectory } from \"./ConvexDirectory\";\nimport * as templates from \"./templates\";\n\nexport const removePathExtension = Effect.fnUntraced(function* (\n pathStr: string,\n) {\n const path = yield* Path.Path;\n\n return String.slice(0, -path.extname(pathStr).length)(pathStr);\n});\n\nexport const toPosixPath = (path: Path.Path, pathStr: string): string =>\n pipe(String.split(pathStr, path.sep), Array.join(\"/\"));\n\n/**\n * Ensures a relative path is a valid ESM/TS module specifier (e.g. `spec` →\n * `./spec`).\n */\nexport const toModuleImportPath = Effect.fnUntraced(function* (\n relativePath: string,\n) {\n const path = yield* Path.Path;\n const withoutExt = toPosixPath(\n path,\n yield* removePathExtension(relativePath),\n );\n return String.startsWith(\".\")(withoutExt) ? withoutExt : `./${withoutExt}`;\n});\n\nexport const writeFileStringAndLog = Effect.fnUntraced(function* (\n filePath: string,\n contents: string,\n) {\n const fs = yield* FileSystem.FileSystem;\n if (!(yield* fs.exists(filePath))) {\n yield* fs.writeFileString(filePath, contents);\n yield* logFileAdded(filePath);\n return;\n }\n const existing = yield* fs.readFileString(filePath);\n if (existing !== contents) {\n yield* fs.writeFileString(filePath, contents);\n yield* logFileModified(filePath);\n }\n});\n\nexport const findProjectRoot = Effect.gen(function* () {\n const fs = yield* FileSystem.FileSystem;\n const path = yield* Path.Path;\n\n const startDir = path.resolve(\".\");\n const root = path.parse(startDir).root;\n\n const directories = Array.unfold(startDir, (dir) =>\n dir === root\n ? Option.none()\n : Option.some([dir, path.dirname(dir)] as const),\n );\n\n const projectRoot = yield* Effect.findFirst(directories, (dir) =>\n fs.exists(path.join(dir, \"package.json\")),\n );\n\n return Option.getOrElse(projectRoot, () => startDir);\n});\n\nexport type WriteChange = \"Added\" | \"Modified\" | \"Unchanged\";\n\nexport const writeFileString = Effect.fnUntraced(function* (\n filePath: string,\n contents: string,\n): Effect.fn.Return<WriteChange, PlatformError, FileSystem.FileSystem> {\n const fs = yield* FileSystem.FileSystem;\n\n if (!(yield* fs.exists(filePath))) {\n yield* fs.writeFileString(filePath, contents);\n return \"Added\";\n }\n const existing = yield* fs.readFileString(filePath);\n if (existing !== contents) {\n yield* fs.writeFileString(filePath, contents);\n return \"Modified\";\n }\n return \"Unchanged\";\n});\n\nexport const removePathIfExists = Effect.fnUntraced(function* (\n filePath: string,\n): Effect.fn.Return<void, PlatformError, FileSystem.FileSystem> {\n const fs = yield* FileSystem.FileSystem;\n\n if (!(yield* fs.exists(filePath))) {\n return;\n }\n\n yield* fs\n .remove(filePath)\n .pipe(\n Effect.catchTag(\"PlatformError\", (error) =>\n error.reason._tag === \"NotFound\" ? Effect.void : Effect.fail(error),\n ),\n );\n});\n\n/**\n * Bump the mtime of `convex/schema.ts` so the Convex CLI's chokidar watcher\n * emits a `change` event after explicit codegen, bootstrap, or recovery.\n * Recovery can leave generated contents unchanged, so it needs an explicit\n * notification to release Convex from a previous error. Ordinary successful\n * watch updates rely on their source/output changes instead of invalidating a\n * Convex push that may already be processing those changes.\n */\nexport const touchConvexSchema = Effect.gen(function* () {\n const fs = yield* FileSystem.FileSystem;\n const path = yield* Path.Path;\n const convexDirectory = yield* ConvexDirectory.get;\n const schemaPath = path.join(convexDirectory, \"schema.ts\");\n\n if (!(yield* fs.exists(schemaPath))) {\n return;\n }\n\n const now = yield* DateTime.nowAsDate;\n yield* fs.utimes(schemaPath, now, now);\n});\n\nconst generateOptionalFile = Effect.fnUntraced(function* (\n confectFile: string,\n convexFile: string,\n generateContents: (importPath: string) => Effect.Effect<string>,\n) {\n const fs = yield* FileSystem.FileSystem;\n const path = yield* Path.Path;\n const confectDirectory = yield* ConfectDirectory.get;\n const convexDirectory = yield* ConvexDirectory.get;\n\n const confectFilePath = path.join(confectDirectory, confectFile);\n\n if (!(yield* fs.exists(confectFilePath))) {\n return Option.none();\n }\n\n const convexFilePath = path.join(convexDirectory, convexFile);\n const relativeImportPath = path.relative(\n path.dirname(convexFilePath),\n confectFilePath,\n );\n const contents = yield* generateContents(\n yield* toModuleImportPath(relativeImportPath),\n );\n const change = yield* writeFileString(convexFilePath, contents);\n return Option.some({ change, convexFilePath });\n});\n\nexport const generateHttp = generateOptionalFile(\n \"http.ts\",\n \"http.ts\",\n (importPath) => templates.http({ httpImportPath: importPath }),\n);\n\nexport const generateCrons = generateOptionalFile(\n \"crons.ts\",\n \"crons.ts\",\n (importPath) => templates.crons({ cronsImportPath: importPath }),\n);\n\nexport const generateAuthConfig = generateOptionalFile(\n \"auth.ts\",\n \"auth.config.ts\",\n (importPath) => templates.authConfig({ authImportPath: importPath }),\n);\n"],"mappings":";;;;;;;;;;;;;AAcA,MAAa,sBAAsB,OAAO,WAAW,WACnD,SACA;CACA,MAAM,OAAO,OAAO,KAAK;CAEzB,OAAO,OAAO,MAAM,GAAG,CAAC,KAAK,QAAQ,OAAO,CAAC,CAAC,MAAM,CAAC,CAAC,OAAO;AAC/D,CAAC;AAED,MAAa,eAAe,MAAiB,YAC3C,KAAK,OAAO,MAAM,SAAS,KAAK,GAAG,GAAG,MAAM,KAAK,GAAG,CAAC;;;;;AAMvD,MAAa,qBAAqB,OAAO,WAAW,WAClD,cACA;CACA,MAAM,OAAO,OAAO,KAAK;CACzB,MAAM,aAAa,YACjB,MACA,OAAO,oBAAoB,YAAY,CACzC;CACA,OAAO,OAAO,WAAW,GAAG,CAAC,CAAC,UAAU,IAAI,aAAa,KAAK;AAChE,CAAC;AAED,MAAa,wBAAwB,OAAO,WAAW,WACrD,UACA,UACA;CACA,MAAM,KAAK,OAAO,WAAW;CAC7B,IAAI,EAAE,OAAO,GAAG,OAAO,QAAQ,IAAI;EACjC,OAAO,GAAG,gBAAgB,UAAU,QAAQ;EAC5C,OAAO,aAAa,QAAQ;EAC5B;CACF;CAEA,KAAI,OADoB,GAAG,eAAe,QAAQ,OACjC,UAAU;EACzB,OAAO,GAAG,gBAAgB,UAAU,QAAQ;EAC5C,OAAO,gBAAgB,QAAQ;CACjC;AACF,CAAC;AAE8B,OAAO,IAAI,aAAa;CACrD,MAAM,KAAK,OAAO,WAAW;CAC7B,MAAM,OAAO,OAAO,KAAK;CAEzB,MAAM,WAAW,KAAK,QAAQ,GAAG;CACjC,MAAM,OAAO,KAAK,MAAM,QAAQ,CAAC,CAAC;CAElC,MAAM,cAAc,MAAM,OAAO,WAAW,QAC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KAAK,OAAO,WAAW;CAC7B,MAAM,OAAO,OAAO,KAAK;CACzB,MAAM,mBAAmB,OAAO,iBAAiB;CACjD,MAAM,kBAAkB,OAAO,gBAAgB;CAE/C,MAAM,kBAAkB,KAAK,KAAK,kBAAkB,WAAW;CAE/D,IAAI,EAAE,OAAO,GAAG,OAAO,eAAe,IACpC,OAAO,OAAO,KAAK;CAGrB,MAAM,iBAAiB,KAAK,KAAK,iBAAiB,UAAU;CAC5D,MAAM,qBAAqB,KAAK,SAC9B,KAAK,QAAQ,cAAc,GAC3B,eACF;CACA,MAAM,WAAW,OAAO,iBACtB,OAAO,mBAAmB,kBAAkB,CAC9C;CACA,MAAM,SAAS,OAAO,gBAAgB,gBAAgB,QAAQ;CAC9D,OAAO,OAAO,KAAK;EAAE;EAAQ;CAAe,CAAC;AAC/C,CAAC;AAED,MAAa,eAAe,qBAC1B,WACA,YACC,eAAeA,KAAe,EAAE,gBAAgB,WAAW,CAAC,CAC/D;AAEA,MAAa,gBAAgB,qBAC3B,YACA,aACC,eAAeC,MAAgB,EAAE,iBAAiB,WAAW,CAAC,CACjE;AAEA,MAAa,qBAAqB,qBAChC,WACA,mBACC,eAAeC,WAAqB,EAAE,gBAAgB,WAAW,CAAC,CACrE"}
1
+ {"version":3,"file":"utils.mjs","names":["templates.http","templates.crons","templates.authConfig"],"sources":["../src/utils.ts"],"sourcesContent":["import * as FileSystem from \"effect/FileSystem\";\nimport * as Path from \"effect/Path\";\nimport type { PlatformError } from \"effect/PlatformError\";\nimport { pipe } from \"effect/Function\";\nimport * as Array from \"effect/Array\";\nimport * as Effect from \"effect/Effect\";\nimport * as DateTime from \"effect/DateTime\";\nimport * as Option from \"effect/Option\";\nimport * as String from \"effect/String\";\nimport { logFileAdded, logFileModified } from \"./log.js\";\nimport { ConfectDirectory } from \"./ConfectDirectory.js\";\nimport { ConvexDirectory } from \"./ConvexDirectory.js\";\nimport * as templates from \"./templates.js\";\n\nexport const removePathExtension = Effect.fnUntraced(function* (\n pathStr: string,\n) {\n const path = yield* Path.Path;\n\n return String.slice(0, -path.extname(pathStr).length)(pathStr);\n});\n\nexport const toPosixPath = (path: Path.Path, pathStr: string): string =>\n pipe(String.split(pathStr, path.sep), Array.join(\"/\"));\n\n/**\n * Ensures a relative path is a valid ESM/TS module specifier (e.g. `spec` →\n * `./spec`).\n */\nexport const toModuleImportPath = Effect.fnUntraced(function* (\n relativePath: string,\n) {\n const path = yield* Path.Path;\n const withoutExt = toPosixPath(\n path,\n yield* removePathExtension(relativePath),\n );\n return String.startsWith(\".\")(withoutExt)\n ? `${withoutExt}.js`\n : `./${withoutExt}.js`;\n});\n\nexport const writeFileStringAndLog = Effect.fnUntraced(function* (\n filePath: string,\n contents: string,\n) {\n const fs = yield* FileSystem.FileSystem;\n if (!(yield* fs.exists(filePath))) {\n yield* fs.writeFileString(filePath, contents);\n yield* logFileAdded(filePath);\n return;\n }\n const existing = yield* fs.readFileString(filePath);\n if (existing !== contents) {\n yield* fs.writeFileString(filePath, contents);\n yield* logFileModified(filePath);\n }\n});\n\nexport const findProjectRoot = Effect.gen(function* () {\n const fs = yield* FileSystem.FileSystem;\n const path = yield* Path.Path;\n\n const startDir = path.resolve(\".\");\n const root = path.parse(startDir).root;\n\n const directories = Array.unfold(startDir, (dir) =>\n dir === root\n ? Option.none()\n : Option.some([dir, path.dirname(dir)] as const),\n );\n\n const projectRoot = yield* Effect.findFirst(directories, (dir) =>\n fs.exists(path.join(dir, \"package.json\")),\n );\n\n return Option.getOrElse(projectRoot, () => startDir);\n});\n\nexport type WriteChange = \"Added\" | \"Modified\" | \"Unchanged\";\n\nexport const writeFileString = Effect.fnUntraced(function* (\n filePath: string,\n contents: string,\n): Effect.fn.Return<WriteChange, PlatformError, FileSystem.FileSystem> {\n const fs = yield* FileSystem.FileSystem;\n\n if (!(yield* fs.exists(filePath))) {\n yield* fs.writeFileString(filePath, contents);\n return \"Added\";\n }\n const existing = yield* fs.readFileString(filePath);\n if (existing !== contents) {\n yield* fs.writeFileString(filePath, contents);\n return \"Modified\";\n }\n return \"Unchanged\";\n});\n\nexport const removePathIfExists = Effect.fnUntraced(function* (\n filePath: string,\n): Effect.fn.Return<void, PlatformError, FileSystem.FileSystem> {\n const fs = yield* FileSystem.FileSystem;\n\n if (!(yield* fs.exists(filePath))) {\n return;\n }\n\n yield* fs\n .remove(filePath)\n .pipe(\n Effect.catchTag(\"PlatformError\", (error) =>\n error.reason._tag === \"NotFound\" ? Effect.void : Effect.fail(error),\n ),\n );\n});\n\n/**\n * Bump the mtime of `convex/schema.ts` so the Convex CLI's chokidar watcher\n * emits a `change` event after explicit codegen, bootstrap, or recovery.\n * Recovery can leave generated contents unchanged, so it needs an explicit\n * notification to release Convex from a previous error. Ordinary successful\n * watch updates rely on their source/output changes instead of invalidating a\n * Convex push that may already be processing those changes.\n */\nexport const touchConvexSchema = Effect.gen(function* () {\n const fs = yield* FileSystem.FileSystem;\n const path = yield* Path.Path;\n const convexDirectory = yield* ConvexDirectory.get;\n const schemaPath = path.join(convexDirectory, \"schema.ts\");\n\n if (!(yield* fs.exists(schemaPath))) {\n return;\n }\n\n const now = yield* DateTime.nowAsDate;\n yield* fs.utimes(schemaPath, now, now);\n});\n\nconst generateOptionalFile = Effect.fnUntraced(function* (\n confectFile: string,\n convexFile: string,\n generateContents: (importPath: string) => Effect.Effect<string>,\n) {\n const fs = yield* FileSystem.FileSystem;\n const path = yield* Path.Path;\n const confectDirectory = yield* ConfectDirectory.get;\n const convexDirectory = yield* ConvexDirectory.get;\n\n const confectFilePath = path.join(confectDirectory, confectFile);\n\n if (!(yield* fs.exists(confectFilePath))) {\n return Option.none();\n }\n\n const convexFilePath = path.join(convexDirectory, convexFile);\n const relativeImportPath = path.relative(\n path.dirname(convexFilePath),\n confectFilePath,\n );\n const contents = yield* generateContents(\n yield* toModuleImportPath(relativeImportPath),\n );\n const change = yield* writeFileString(convexFilePath, contents);\n return Option.some({ change, convexFilePath });\n});\n\nexport const generateHttp = generateOptionalFile(\n \"http.ts\",\n \"http.ts\",\n (importPath) => templates.http({ httpImportPath: importPath }),\n);\n\nexport const generateCrons = generateOptionalFile(\n \"crons.ts\",\n \"crons.ts\",\n (importPath) => templates.crons({ cronsImportPath: importPath }),\n);\n\nexport const generateAuthConfig = generateOptionalFile(\n \"auth.ts\",\n \"auth.config.ts\",\n (importPath) => templates.authConfig({ authImportPath: importPath }),\n);\n"],"mappings":";;;;;;;;;;;;;AAcA,MAAa,sBAAsB,OAAO,WAAW,WACnD,SACA;CACA,MAAM,OAAO,OAAO,KAAK;CAEzB,OAAO,OAAO,MAAM,GAAG,CAAC,KAAK,QAAQ,OAAO,CAAC,CAAC,MAAM,CAAC,CAAC,OAAO;AAC/D,CAAC;AAED,MAAa,eAAe,MAAiB,YAC3C,KAAK,OAAO,MAAM,SAAS,KAAK,GAAG,GAAG,MAAM,KAAK,GAAG,CAAC;;;;;AAMvD,MAAa,qBAAqB,OAAO,WAAW,WAClD,cACA;CACA,MAAM,OAAO,OAAO,KAAK;CACzB,MAAM,aAAa,YACjB,MACA,OAAO,oBAAoB,YAAY,CACzC;CACA,OAAO,OAAO,WAAW,GAAG,CAAC,CAAC,UAAU,IACpC,GAAG,WAAW,OACd,KAAK,WAAW;AACtB,CAAC;AAED,MAAa,wBAAwB,OAAO,WAAW,WACrD,UACA,UACA;CACA,MAAM,KAAK,OAAO,WAAW;CAC7B,IAAI,EAAE,OAAO,GAAG,OAAO,QAAQ,IAAI;EACjC,OAAO,GAAG,gBAAgB,UAAU,QAAQ;EAC5C,OAAO,aAAa,QAAQ;EAC5B;CACF;CAEA,KAAI,OADoB,GAAG,eAAe,QAAQ,OACjC,UAAU;EACzB,OAAO,GAAG,gBAAgB,UAAU,QAAQ;EAC5C,OAAO,gBAAgB,QAAQ;CACjC;AACF,CAAC;AAE8B,OAAO,IAAI,aAAa;CACrD,MAAM,KAAK,OAAO,WAAW;CAC7B,MAAM,OAAO,OAAO,KAAK;CAEzB,MAAM,WAAW,KAAK,QAAQ,GAAG;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KAAK,GAAG;AACvC,CAAC;AAED,MAAM,uBAAuB,OAAO,WAAW,WAC7C,aACA,YACA,kBACA;CACA,MAAM,KAAK,OAAO,WAAW;CAC7B,MAAM,OAAO,OAAO,KAAK;CACzB,MAAM,mBAAmB,OAAO,iBAAiB;CACjD,MAAM,kBAAkB,OAAO,gBAAgB;CAE/C,MAAM,kBAAkB,KAAK,KAAK,kBAAkB,WAAW;CAE/D,IAAI,EAAE,OAAO,GAAG,OAAO,eAAe,IACpC,OAAO,OAAO,KAAK;CAGrB,MAAM,iBAAiB,KAAK,KAAK,iBAAiB,UAAU;CAC5D,MAAM,qBAAqB,KAAK,SAC9B,KAAK,QAAQ,cAAc,GAC3B,eACF;CACA,MAAM,WAAW,OAAO,iBACtB,OAAO,mBAAmB,kBAAkB,CAC9C;CACA,MAAM,SAAS,OAAO,gBAAgB,gBAAgB,QAAQ;CAC9D,OAAO,OAAO,KAAK;EAAE;EAAQ;CAAe,CAAC;AAC/C,CAAC;AAED,MAAa,eAAe,qBAC1B,WACA,YACC,eAAeA,KAAe,EAAE,gBAAgB,WAAW,CAAC,CAC/D;AAEA,MAAa,gBAAgB,qBAC3B,YACA,aACC,eAAeC,MAAgB,EAAE,iBAAiB,WAAW,CAAC,CACjE;AAEA,MAAa,qBAAqB,qBAChC,WACA,mBACC,eAAeC,WAAqB,EAAE,gBAAgB,WAAW,CAAC,CACrE"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@gaganref/confect-cli",
3
- "version": "10.3.1-fork.1",
3
+ "version": "10.3.1-fork.10",
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.1",
13
- "@confect/server": "npm:@gaganref/confect-server@10.3.1-fork.1",
12
+ "@confect/core": "npm:@gaganref/confect-core@10.3.1-fork.10",
13
+ "@confect/server": "npm:@gaganref/confect-server@10.3.1-fork.10",
14
14
  "effect": "^4.0.4"
15
15
  },
16
16
  "description": "Developer tooling for codegen and sync",