@danielfgray/pg-sourcerer 0.2.0 → 0.2.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cli.js +25 -19
- package/dist/cli.js.map +1 -1
- package/dist/config.d.ts +1 -1
- package/dist/config.d.ts.map +1 -1
- package/dist/config.js +1 -1
- package/dist/config.js.map +1 -1
- package/dist/errors.d.ts +14 -1
- package/dist/errors.d.ts.map +1 -1
- package/dist/errors.js +2 -0
- package/dist/errors.js.map +1 -1
- package/dist/generate.d.ts +31 -21
- package/dist/generate.d.ts.map +1 -1
- package/dist/generate.js +53 -43
- package/dist/generate.js.map +1 -1
- package/dist/index.d.ts +20 -12
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +27 -13
- package/dist/index.js.map +1 -1
- package/dist/init.d.ts +0 -1
- package/dist/init.d.ts.map +1 -1
- package/dist/init.js +90 -35
- package/dist/init.js.map +1 -1
- package/dist/ir/extensions/queries.d.ts +264 -0
- package/dist/ir/extensions/queries.d.ts.map +1 -0
- package/dist/ir/extensions/queries.js +153 -0
- package/dist/ir/extensions/queries.js.map +1 -0
- package/dist/ir/extensions/schema-builder.d.ts +61 -0
- package/dist/ir/extensions/schema-builder.d.ts.map +1 -0
- package/dist/ir/extensions/schema-builder.js +5 -0
- package/dist/ir/extensions/schema-builder.js.map +1 -0
- package/dist/lib/conjure.d.ts +101 -0
- package/dist/lib/conjure.d.ts.map +1 -1
- package/dist/lib/conjure.js +204 -26
- package/dist/lib/conjure.js.map +1 -1
- package/dist/lib/hex.d.ts +10 -8
- package/dist/lib/hex.d.ts.map +1 -1
- package/dist/lib/hex.js +18 -15
- package/dist/lib/hex.js.map +1 -1
- package/dist/plugins/arktype.d.ts +27 -14
- package/dist/plugins/arktype.d.ts.map +1 -1
- package/dist/plugins/arktype.js +166 -130
- package/dist/plugins/arktype.js.map +1 -1
- package/dist/plugins/effect.d.ts +53 -0
- package/dist/plugins/effect.d.ts.map +1 -0
- package/dist/plugins/effect.js +1074 -0
- package/dist/plugins/effect.js.map +1 -0
- package/dist/plugins/http-elysia.d.ts +32 -0
- package/dist/plugins/http-elysia.d.ts.map +1 -0
- package/dist/plugins/http-elysia.js +613 -0
- package/dist/plugins/http-elysia.js.map +1 -0
- package/dist/plugins/http-express.d.ts +36 -0
- package/dist/plugins/http-express.d.ts.map +1 -0
- package/dist/plugins/http-express.js +388 -0
- package/dist/plugins/http-express.js.map +1 -0
- package/dist/plugins/http-hono.d.ts +36 -0
- package/dist/plugins/http-hono.d.ts.map +1 -0
- package/dist/plugins/http-hono.js +453 -0
- package/dist/plugins/http-hono.js.map +1 -0
- package/dist/plugins/http-orpc.d.ts +55 -0
- package/dist/plugins/http-orpc.d.ts.map +1 -0
- package/dist/plugins/http-orpc.js +370 -0
- package/dist/plugins/http-orpc.js.map +1 -0
- package/dist/plugins/http-trpc.d.ts +59 -0
- package/dist/plugins/http-trpc.d.ts.map +1 -0
- package/dist/plugins/http-trpc.js +392 -0
- package/dist/plugins/http-trpc.js.map +1 -0
- package/dist/plugins/kysely/queries.d.ts +92 -0
- package/dist/plugins/kysely/queries.d.ts.map +1 -0
- package/dist/plugins/kysely/queries.js +1169 -0
- package/dist/plugins/kysely/queries.js.map +1 -0
- package/dist/plugins/kysely/shared.d.ts +59 -0
- package/dist/plugins/kysely/shared.d.ts.map +1 -0
- package/dist/plugins/kysely/shared.js +247 -0
- package/dist/plugins/kysely/shared.js.map +1 -0
- package/dist/plugins/kysely/types.d.ts +22 -0
- package/dist/plugins/kysely/types.d.ts.map +1 -0
- package/dist/plugins/kysely/types.js +428 -0
- package/dist/plugins/kysely/types.js.map +1 -0
- package/dist/plugins/kysely.d.ts +72 -0
- package/dist/plugins/kysely.d.ts.map +1 -0
- package/dist/plugins/kysely.js +906 -0
- package/dist/plugins/kysely.js.map +1 -0
- package/dist/plugins/sql-queries.d.ts +55 -7
- package/dist/plugins/sql-queries.d.ts.map +1 -1
- package/dist/plugins/sql-queries.js +747 -121
- package/dist/plugins/sql-queries.js.map +1 -1
- package/dist/plugins/types.d.ts +20 -14
- package/dist/plugins/types.d.ts.map +1 -1
- package/dist/plugins/types.js +90 -112
- package/dist/plugins/types.js.map +1 -1
- package/dist/plugins/valibot.d.ts +45 -0
- package/dist/plugins/valibot.d.ts.map +1 -0
- package/dist/plugins/valibot.js +422 -0
- package/dist/plugins/valibot.js.map +1 -0
- package/dist/plugins/zod.d.ts +27 -14
- package/dist/plugins/zod.d.ts.map +1 -1
- package/dist/plugins/zod.js +231 -166
- package/dist/plugins/zod.js.map +1 -1
- package/dist/services/artifact-store.d.ts +11 -1
- package/dist/services/artifact-store.d.ts.map +1 -1
- package/dist/services/artifact-store.js +9 -0
- package/dist/services/artifact-store.js.map +1 -1
- package/dist/services/config-loader.d.ts +4 -0
- package/dist/services/config-loader.d.ts.map +1 -1
- package/dist/services/config-loader.js +1 -1
- package/dist/services/config-loader.js.map +1 -1
- package/dist/services/config.d.ts +57 -0
- package/dist/services/config.d.ts.map +1 -0
- package/dist/services/config.js +66 -0
- package/dist/services/config.js.map +1 -0
- package/dist/services/core-providers.d.ts +15 -0
- package/dist/services/core-providers.d.ts.map +1 -0
- package/dist/services/core-providers.js +23 -0
- package/dist/services/core-providers.js.map +1 -0
- package/dist/services/emissions.d.ts +14 -0
- package/dist/services/emissions.d.ts.map +1 -1
- package/dist/services/emissions.js +86 -47
- package/dist/services/emissions.js.map +1 -1
- package/dist/services/execution.d.ts +35 -0
- package/dist/services/execution.d.ts.map +1 -0
- package/dist/services/execution.js +86 -0
- package/dist/services/execution.js.map +1 -0
- package/dist/services/file-builder.d.ts +4 -0
- package/dist/services/file-builder.d.ts.map +1 -1
- package/dist/services/file-builder.js.map +1 -1
- package/dist/services/inflection.d.ts +2 -2
- package/dist/services/inflection.d.ts.map +1 -1
- package/dist/services/inflection.js +4 -4
- package/dist/services/inflection.js.map +1 -1
- package/dist/services/ir-builder.d.ts.map +1 -1
- package/dist/services/ir-builder.js +10 -3
- package/dist/services/ir-builder.js.map +1 -1
- package/dist/services/pg-types.d.ts +31 -0
- package/dist/services/pg-types.d.ts.map +1 -1
- package/dist/services/pg-types.js +24 -0
- package/dist/services/pg-types.js.map +1 -1
- package/dist/services/plugin-runner.d.ts +27 -37
- package/dist/services/plugin-runner.d.ts.map +1 -1
- package/dist/services/plugin-runner.js +73 -171
- package/dist/services/plugin-runner.js.map +1 -1
- package/dist/services/plugin.d.ts +350 -215
- package/dist/services/plugin.d.ts.map +1 -1
- package/dist/services/plugin.js +182 -130
- package/dist/services/plugin.js.map +1 -1
- package/dist/services/resolution.d.ts +38 -0
- package/dist/services/resolution.d.ts.map +1 -0
- package/dist/services/resolution.js +242 -0
- package/dist/services/resolution.js.map +1 -0
- package/dist/services/service-registry.d.ts +74 -0
- package/dist/services/service-registry.d.ts.map +1 -0
- package/dist/services/service-registry.js +61 -0
- package/dist/services/service-registry.js.map +1 -0
- package/dist/services/symbols.d.ts +59 -0
- package/dist/services/symbols.d.ts.map +1 -1
- package/dist/services/symbols.js +16 -0
- package/dist/services/symbols.js.map +1 -1
- package/dist/testing.d.ts +4 -25
- package/dist/testing.d.ts.map +1 -1
- package/dist/testing.js +2 -23
- package/dist/testing.js.map +1 -1
- package/package.json +1 -1
- package/dist/plugins/effect-model.d.ts +0 -17
- package/dist/plugins/effect-model.d.ts.map +0 -1
- package/dist/plugins/effect-model.js +0 -409
- package/dist/plugins/effect-model.js.map +0 -1
- package/dist/plugins/kysely-queries.d.ts +0 -66
- package/dist/plugins/kysely-queries.d.ts.map +0 -1
- package/dist/plugins/kysely-queries.js +0 -960
- package/dist/plugins/kysely-queries.js.map +0 -1
- package/dist/plugins/kysely-types.d.ts +0 -35
- package/dist/plugins/kysely-types.d.ts.map +0 -1
- package/dist/plugins/kysely-types.js +0 -601
- package/dist/plugins/kysely-types.js.map +0 -1
package/dist/cli.js
CHANGED
|
@@ -14,6 +14,7 @@ import { NodeContext, NodeRuntime } from "@effect/platform-node";
|
|
|
14
14
|
import { Console, Effect, Option } from "effect";
|
|
15
15
|
import { runGenerate } from "./generate.js";
|
|
16
16
|
import { runInit } from "./init.js";
|
|
17
|
+
import { ConfigWithInit } from "./services/config.js";
|
|
17
18
|
import packageJson from "../package.json" with { type: "json" };
|
|
18
19
|
// ============================================================================
|
|
19
20
|
// Options
|
|
@@ -21,16 +22,8 @@ import packageJson from "../package.json" with { type: "json" };
|
|
|
21
22
|
const configPath = Options.file("config").pipe(Options.withAlias("c"), Options.withDescription("Path to config file"), Options.optional);
|
|
22
23
|
const outputDir = Options.directory("output").pipe(Options.withAlias("o"), Options.withDescription("Override output directory"), Options.optional);
|
|
23
24
|
const dryRun = Options.boolean("dry-run").pipe(Options.withAlias("n"), Options.withDescription("Show what would be generated without writing files"), Options.withDefault(false));
|
|
24
|
-
/** Run init then optionally generate based on user choice */
|
|
25
|
-
const runInitThenGenerate = (originalError) => runInit.pipe(Effect.flatMap(result => result.runGenerate
|
|
26
|
-
? runGenerate({ configPath: result.configPath }).pipe(Effect.tap(res => {
|
|
27
|
-
const written = res.writeResults.filter(r => r.written).length;
|
|
28
|
-
return Console.log(`\n✓ Generated ${written} files`);
|
|
29
|
-
}), Effect.asVoid)
|
|
30
|
-
: Effect.void), Effect.catchAll(() => Effect.fail(originalError)));
|
|
31
25
|
const runGenerateCommand = (args) => {
|
|
32
26
|
const opts = {
|
|
33
|
-
configPath: Option.getOrUndefined(args.configPath),
|
|
34
27
|
outputDir: Option.getOrUndefined(args.outputDir),
|
|
35
28
|
dryRun: args.dryRun,
|
|
36
29
|
};
|
|
@@ -40,17 +33,28 @@ const runGenerateCommand = (args) => {
|
|
|
40
33
|
const suffix = args.dryRun ? " (dry run)" : "";
|
|
41
34
|
return Console.log(`\n✓ Generated ${args.dryRun ? total : written} files${suffix}`);
|
|
42
35
|
};
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
36
|
+
// Build config layer based on whether explicit path was provided
|
|
37
|
+
const configOpts = {
|
|
38
|
+
configPath: Option.getOrUndefined(args.configPath),
|
|
39
|
+
};
|
|
40
|
+
// Use ConfigWithInit - if no config found, it runs interactive prompts
|
|
41
|
+
const configLayer = ConfigWithInit(configOpts);
|
|
42
|
+
return runGenerate(opts).pipe(Effect.provide(configLayer), Effect.tap(logSuccess),
|
|
46
43
|
// Handle errors with extra details
|
|
47
44
|
Effect.catchTags({
|
|
48
|
-
ConfigInvalid: error => logErrorWithDetails(error, error.errors),
|
|
49
|
-
|
|
50
|
-
CapabilityCycle: error => Console.error(`\n✗ Error: ${error._tag}`).pipe(Effect.andThen(Console.error(` ${error.message}`)), Effect.andThen(Console.error(` Cycle: ${error.cycle.join(" → ")}`)), Effect.andThen(Effect.fail(error))),
|
|
45
|
+
ConfigInvalid: (error) => logErrorWithDetails(error, error.errors),
|
|
46
|
+
PluginCycle: (error) => Console.error(`\n✗ Error: ${error._tag}`).pipe(Effect.andThen(Console.error(` ${error.message}`)), Effect.andThen(Console.error(` Cycle: ${error.cycle.join(" → ")}`)), Effect.andThen(Effect.fail(error))),
|
|
51
47
|
}),
|
|
52
|
-
// Generic fallback for remaining errors
|
|
53
|
-
Effect.catchAll((error) =>
|
|
48
|
+
// Generic fallback for remaining tagged errors (GenerateError types)
|
|
49
|
+
Effect.catchAll((error) => {
|
|
50
|
+
// Handle tagged errors with _tag property
|
|
51
|
+
if (error && typeof error === "object" && "_tag" in error) {
|
|
52
|
+
const taggedError = error;
|
|
53
|
+
return Console.error(`\n✗ Error: ${taggedError._tag}`).pipe(Effect.andThen(Console.error(` ${taggedError.message ?? String(error)}`)), Effect.andThen(Effect.fail(error)));
|
|
54
|
+
}
|
|
55
|
+
// Plain errors (e.g., from init prompts)
|
|
56
|
+
return Console.error(`\n✗ Error: ${error instanceof Error ? error.message : String(error)}`).pipe(Effect.andThen(Effect.fail(error)));
|
|
57
|
+
}));
|
|
54
58
|
};
|
|
55
59
|
/** Log an error with a list of detail messages */
|
|
56
60
|
const logErrorWithDetails = (error, details) => Console.error(`\n✗ Error: ${error._tag}`).pipe(Effect.andThen(Console.error(` ${error.message}`)), Effect.andThen(Effect.forEach(details, e => Console.error(` - ${e}`))), Effect.andThen(Effect.fail(error)));
|
|
@@ -58,9 +62,11 @@ const logErrorWithDetails = (error, details) => Console.error(`\n✗ Error: ${er
|
|
|
58
62
|
// Commands
|
|
59
63
|
// ============================================================================
|
|
60
64
|
const generateCommand = Command.make("generate", { configPath, outputDir, dryRun }, runGenerateCommand);
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
65
|
+
/**
|
|
66
|
+
* Init command - just runs prompts and writes config file.
|
|
67
|
+
* Does NOT run generate afterwards (user runs that separately).
|
|
68
|
+
*/
|
|
69
|
+
const initCommand = Command.make("init", {}, () => runInit.pipe(Effect.tap(() => Console.log("\nRun 'pgsourcerer' to generate code.")), Effect.asVoid));
|
|
64
70
|
// Root command runs generate by default (which triggers init if no config)
|
|
65
71
|
const rootCommand = Command.make("pgsourcerer", { configPath, outputDir, dryRun }, runGenerateCommand).pipe(Command.withSubcommands([generateCommand, initCommand]));
|
|
66
72
|
// ============================================================================
|
package/dist/cli.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cli.js","sourceRoot":"","sources":["../src/cli.ts"],"names":[],"mappings":";AACA;;;;;;;;;GASG;AACH,OAAO,EAAE,OAAO,EAAE,OAAO,EAAE,MAAM,aAAa,CAAC;AAC/C,OAAO,EAAE,WAAW,EAAE,WAAW,EAAE,MAAM,uBAAuB,CAAC;AACjE,OAAO,EAAE,OAAO,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AACjD,OAAO,EAAE,WAAW,EAAsB,MAAM,eAAe,CAAC;AAChE,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACpC,OAAO,WAAW,MAAM,iBAAiB,CAAC,OAAO,IAAI,EAAE,MAAM,EAAE,CAAC;AAEhE,+EAA+E;AAC/E,UAAU;AACV,+EAA+E;AAE/E,MAAM,UAAU,GA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AE,CAChD,OAAO,CAAC,IAAI,CACV,MAAM,CAAC,GAAG,CAAC,GAAG,EAAE,CAAC,OAAO,CAAC,GAAG,CAAC,uCAAuC,CAAC,CAAC,EACtE,MAAM,CAAC,MAAM,CACd,CACF,CAAC;AAEF,2EAA2E;AAC3E,MAAM,WAAW,GAAG,OAAO,CAAC,IAAI,CAAC,aAAa,EAAE,EAAE,UAAU,EAAE,SAAS,EAAE,MAAM,EAAE,EAAE,kBAAkB,CAAC,CAAC,IAAI,CACzG,OAAO,CAAC,eAAe,CAAC,CAAC,eAAe,EAAE,WAAW,CAAC,CAAC,CACxD,CAAC;AAEF,+EAA+E;AAC/E,UAAU;AACV,+EAA+E;AAE/E,MAAM,GAAG,GAAG,OAAO,CAAC,GAAG,CAAC,WAAW,EAAE;IACnC,IAAI,EAAE,aAAa;IACnB,OAAO,EAAE,WAAW,CAAC,OAAO;CAC7B,CAAC,CAAC;AAEH,4BAA4B;AAC5B,GAAG,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC,IAAI,CAAC,MAAM,CAAC,OAAO,CAAC,WAAW,CAAC,KAAK,CAAC,EAAE,WAAW,CAAC,OAAO,CAAC,CAAC"}
|
package/dist/config.d.ts
CHANGED
|
@@ -61,7 +61,7 @@ export declare const Config: S.Struct<{
|
|
|
61
61
|
}>;
|
|
62
62
|
/** Inflection configuration (validated as Any, properly typed in ConfigInput) */
|
|
63
63
|
inflection: S.optional<typeof S.Any>;
|
|
64
|
-
/** Plugins to run
|
|
64
|
+
/** Plugins to run */
|
|
65
65
|
plugins: S.Array$<typeof S.Any>;
|
|
66
66
|
/** Formatter callback to transform generated code before writing (validated as Any, properly typed in ConfigInput) */
|
|
67
67
|
formatter: S.optional<typeof S.String>;
|
package/dist/config.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"config.d.ts","sourceRoot":"","sources":["../src/config.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,OAAO,EAAE,MAAM,IAAI,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 export const Config = S.Struct({
|
|
|
39
39
|
typeHints: S.optionalWith(S.Array(TypeHint), { default: () => [] }),
|
|
40
40
|
/** Inflection configuration (validated as Any, properly typed in ConfigInput) */
|
|
41
41
|
inflection: S.optional(S.Any),
|
|
42
|
-
/** Plugins to run
|
|
42
|
+
/** Plugins to run */
|
|
43
43
|
plugins: S.Array(S.Any),
|
|
44
44
|
/** Formatter callback to transform generated code before writing (validated as Any, properly typed in ConfigInput) */
|
|
45
45
|
formatter: S.optional(S.String),
|
package/dist/config.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"config.js","sourceRoot":"","sources":["../src/config.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,OAAO,EAAE,MAAM,IAAI,CAAC,EAAE,MAAM,QAAQ,CAAA;AAGpC;;GAEG;AACH,MAAM,CAAC,MAAM,aAAa,GAAG,CAAC,CAAC,MAAM,CAAC;IACpC,MAAM,EAAE,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,MAAM,CAAC;IAC5B,KAAK,EAAE,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,MAAM,CAAC;IAC3B,MAAM,EAAE,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,MAAM,CAAC;IAC5B,MAAM,EAAE,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,MAAM,CAAC;CAC7B,CAAC,CAAA;AAGF;;GAEG;AACH,MAAM,CAAC,MAAM,QAAQ,GAAG,CAAC,CAAC,MAAM,CAAC;IAC/B,KAAK,EAAE,aAAa;IACpB,KAAK,EAAE,CAAC,CAAC,MAAM,CAAC,EAAE,GAAG,EAAE,CAAC,CAAC,MAAM,EAAE,KAAK,EAAE,CAAC,CAAC,OAAO,EAAE,CAAC;CACrD,CAAC,CAAA;AAGF;;;;;;;GAOG;AACH,MAAM,CAAC,MAAM,MAAM,GAAG,CAAC,CAAC,MAAM,CAAC;IAC7B,iCAAiC;IACjC,gBAAgB,EAAE,CAAC,CAAC,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|
|
117
117
|
}> {
|
|
118
118
|
}
|
|
119
|
+
declare const UndefinedReference_base: new <A extends Record<string, any> = {}>(args: import("effect/Types").Equals<A, {}> extends true ? void : { readonly [P in keyof A as P extends "_tag" ? never : P]: A[P]; }) => import("effect/Cause").YieldableError & {
|
|
120
|
+
readonly _tag: "UndefinedReference";
|
|
121
|
+
} & Readonly<A>;
|
|
122
|
+
export declare class UndefinedReference extends UndefinedReference_base<ErrorBase & {
|
|
123
|
+
readonly references: readonly {
|
|
124
|
+
readonly capability: string;
|
|
125
|
+
readonly entity: string;
|
|
126
|
+
readonly shape?: string;
|
|
127
|
+
readonly requestedBy: string;
|
|
128
|
+
readonly inFile: string;
|
|
129
|
+
}[];
|
|
130
|
+
}> {
|
|
131
|
+
}
|
|
119
132
|
declare const FormatError_base: new <A extends Record<string, any> = {}>(args: import("effect/Types").Equals<A, {}> extends true ? void : { readonly [P in keyof A as P extends "_tag" ? never : P]: A[P]; }) => import("effect/Cause").YieldableError & {
|
|
120
133
|
readonly _tag: "FormatError";
|
|
121
134
|
} & Readonly<A>;
|
|
@@ -124,6 +137,6 @@ export declare class FormatError extends FormatError_base<ErrorBase & {
|
|
|
124
137
|
readonly cause: unknown;
|
|
125
138
|
}> {
|
|
126
139
|
}
|
|
127
|
-
export type SourcererError = ConfigNotFound | ConfigInvalid | ConnectionFailed | IntrospectionFailed | TagParseError | DuplicatePlugin | CapabilityNotSatisfied | CapabilityConflict | CapabilityCycle | PluginConfigInvalid | PluginExecutionFailed | EmitConflict | SymbolConflict | WriteError | FormatError;
|
|
140
|
+
export type SourcererError = ConfigNotFound | ConfigInvalid | ConnectionFailed | IntrospectionFailed | TagParseError | DuplicatePlugin | CapabilityNotSatisfied | CapabilityConflict | CapabilityCycle | PluginConfigInvalid | PluginExecutionFailed | EmitConflict | SymbolConflict | WriteError | UndefinedReference | FormatError;
|
|
128
141
|
export {};
|
|
129
142
|
//# sourceMappingURL=errors.d.ts.map
|
package/dist/errors.d.ts.map
CHANGED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d,aAAa,GACb,gBAAgB,GAChB,mBAAmB,GACnB,aAAa,GACb,eAAe,GACf,sBAAsB,GACtB,kBAAkB,GAClB,eAAe,GACf,mBAAmB,GACnB,qBAAqB,GACrB,YAAY,GACZ,cAAc,GACd,UAAU,GACV,kBAAkB,GAClB,WAAW,CAAA"}
|
package/dist/errors.js
CHANGED
|
@@ -36,6 +36,8 @@ export class SymbolConflict extends Data.TaggedError("SymbolConflict") {
|
|
|
36
36
|
}
|
|
37
37
|
export class WriteError extends Data.TaggedError("WriteError") {
|
|
38
38
|
}
|
|
39
|
+
export class UndefinedReference extends Data.TaggedError("UndefinedReference") {
|
|
40
|
+
}
|
|
39
41
|
export class FormatError extends Data.TaggedError("FormatError") {
|
|
40
42
|
}
|
|
41
43
|
//# sourceMappingURL=errors.js.map
|
package/dist/errors.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"errors.js","sourceRoot":"","sources":["../src/errors.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,OAAO,EAAE,IAAI,EAAE,MAAM,QAAQ,CAAA;AAO7B,uBAAuB;AACvB,MAAM,OAAO,cAAe,SAAQ,IAAI,CAAC,WAAW,CAAC,gBAAgB,CAEpE;CAAG;AAEJ,MAAM,OAAO,aAAc,SAAQ,IAAI,CAAC,WAAW,CAAC,eAAe,CAElE;CAAG;AAEJ,kBAAkB;AAClB,MAAM,OAAO,gBAAiB,SAAQ,IAAI,CAAC,WAAW,CAAC,kBAAkB,CAExE;CAAG;AAEJ,MAAM,OAAO,mBAAoB,SAAQ,IAAI,CAAC,WAAW,CAAC,qBAAqB,CAE9E;CAAG;AAEJ,oBAAoB;AACpB,MAAM,OAAO,aAAc,SAAQ,IAAI,CAAC,WAAW,CAAC,eAAe,CAOlE;CAAG;AAEJ,gBAAgB;AAChB,MAAM,OAAO,eAAgB,SAAQ,IAAI,CAAC,WAAW,CAAC,iBAAiB,CAEtE;CAAG;AAEJ,MAAM,OAAO,sBAAuB,SAA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,CAAC,eAAe,CAOlE;CAAG;AAEJ,gBAAgB;AAChB,MAAM,OAAO,eAAgB,SAAQ,IAAI,CAAC,WAAW,CAAC,iBAAiB,CAEtE;CAAG;AAEJ,MAAM,OAAO,sBAAuB,SAAQ,IAAI,CAAC,WAAW,CAAC,wBAAwB,CAEpF;CAAG;AAEJ,MAAM,OAAO,kBAAmB,SAAQ,IAAI,CAAC,WAAW,CAAC,oBAAoB,CAE5E;CAAG;AAEJ,MAAM,OAAO,eAAgB,SAAQ,IAAI,CAAC,WAAW,CAAC,iBAAiB,CAEtE;CAAG;AAEJ,MAAM,OAAO,mBAAoB,SAAQ,IAAI,CAAC,WAAW,CAAC,qBAAqB,CAE9E;CAAG;AAEJ,MAAM,OAAO,qBAAsB,SAAQ,IAAI,CAAC,WAAW,CAAC,uBAAuB,CAQlF;CAAG;AAEJ,kBAAkB;AAClB,MAAM,OAAO,YAAa,SAAQ,IAAI,CAAC,WAAW,CAAC,cAAc,CAEhE;CAAG;AAEJ,MAAM,OAAO,cAAe,SAAQ,IAAI,CAAC,WAAW,CAAC,gBAAgB,CAMpE;CAAG;AAEJ,MAAM,OAAO,UAAW,SAAQ,IAAI,CAAC,WAAW,CAAC,YAAY,CAE5D;CAAG;AAEJ,MAAM,OAAO,kBAAmB,SAAQ,IAAI,CAAC,WAAW,CAAC,oBAAoB,CAU5E;CAAG;AAEJ,MAAM,OAAO,WAAY,SAAQ,IAAI,CAAC,WAAW,CAAC,aAAa,CAE9D;CAAG"}
|
package/dist/generate.d.ts
CHANGED
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
* 1. Load config
|
|
6
6
|
* 2. Introspect database
|
|
7
7
|
* 3. Build IR
|
|
8
|
-
* 4.
|
|
8
|
+
* 4. Run providers
|
|
9
9
|
* 5. Write files
|
|
10
10
|
*
|
|
11
11
|
* Logging:
|
|
@@ -17,20 +17,16 @@
|
|
|
17
17
|
import { Effect, Layer } from "effect";
|
|
18
18
|
import { FileSystem, Path, CommandExecutor } from "@effect/platform";
|
|
19
19
|
import type { ResolvedConfig } from "./config.js";
|
|
20
|
-
import type
|
|
21
|
-
import {
|
|
20
|
+
import { type PluginRunResult, type PluginRunError } from "./services/plugin-runner.js";
|
|
21
|
+
import { ConfigService } from "./services/config.js";
|
|
22
22
|
import { DatabaseIntrospectionService } from "./services/introspection.js";
|
|
23
23
|
import { type WriteResult } from "./services/file-writer.js";
|
|
24
24
|
import { type SemanticIR } from "./ir/semantic-ir.js";
|
|
25
|
-
import { ConfigNotFound, ConfigInvalid, ConnectionFailed, IntrospectionFailed, TagParseError,
|
|
25
|
+
import { ConfigNotFound, ConfigInvalid, ConnectionFailed, IntrospectionFailed, TagParseError, WriteError, FormatError } from "./errors.js";
|
|
26
26
|
/**
|
|
27
27
|
* Options for the generate function
|
|
28
28
|
*/
|
|
29
29
|
export interface GenerateOptions {
|
|
30
|
-
/** Path to config file (optional - will search if not provided) */
|
|
31
|
-
readonly configPath?: string;
|
|
32
|
-
/** Directory to search for config from (default: cwd) */
|
|
33
|
-
readonly searchFrom?: string;
|
|
34
30
|
/** Override output directory from config */
|
|
35
31
|
readonly outputDir?: string;
|
|
36
32
|
/** Dry run - don't write files, just return what would be written */
|
|
@@ -45,31 +41,45 @@ export interface GenerateResult {
|
|
|
45
41
|
/** The built semantic IR */
|
|
46
42
|
readonly ir: SemanticIR;
|
|
47
43
|
/** Plugin execution results */
|
|
48
|
-
readonly pluginResult:
|
|
44
|
+
readonly pluginResult: PluginRunResult;
|
|
49
45
|
/** File write results */
|
|
50
46
|
readonly writeResults: readonly WriteResult[];
|
|
51
47
|
}
|
|
52
48
|
/**
|
|
53
49
|
* All possible errors from the generate pipeline
|
|
54
50
|
*/
|
|
55
|
-
export type GenerateError = ConfigNotFound | ConfigInvalid | ConnectionFailed | IntrospectionFailed | TagParseError |
|
|
51
|
+
export type GenerateError = ConfigNotFound | ConfigInvalid | ConnectionFailed | IntrospectionFailed | TagParseError | PluginRunError | WriteError | FormatError;
|
|
56
52
|
/**
|
|
57
|
-
* The main generate pipeline
|
|
53
|
+
* The main generate pipeline.
|
|
54
|
+
*
|
|
55
|
+
* Config is provided via ConfigService layer (Effect DI).
|
|
56
|
+
* Use ConfigFromFile or ConfigWithInit layers depending on context.
|
|
58
57
|
*/
|
|
59
|
-
export declare const generate: (options?: GenerateOptions) => Effect.Effect<GenerateResult, GenerateError,
|
|
58
|
+
export declare const generate: (options?: GenerateOptions) => Effect.Effect<GenerateResult, GenerateError, ConfigService | DatabaseIntrospectionService | FileSystem.FileSystem | Path.Path | CommandExecutor.CommandExecutor>;
|
|
60
59
|
/**
|
|
61
|
-
* Layer that provides
|
|
60
|
+
* Layer that provides database introspection for generate().
|
|
62
61
|
*
|
|
63
|
-
* Note:
|
|
64
|
-
*
|
|
65
|
-
* The generate() function creates the PluginRunner internally.
|
|
62
|
+
* Note: ConfigService is NOT included here - it must be provided separately
|
|
63
|
+
* via ConfigFromFile, ConfigWithInit, or ConfigTest layers.
|
|
66
64
|
*/
|
|
67
|
-
export declare const GenerateLive: Layer.Layer<
|
|
65
|
+
export declare const GenerateLive: Layer.Layer<DatabaseIntrospectionService, never, never>;
|
|
68
66
|
/**
|
|
69
|
-
* Run generate with
|
|
67
|
+
* Run generate with database introspection provided.
|
|
68
|
+
*
|
|
69
|
+
* ConfigService must still be provided by the caller via one of:
|
|
70
|
+
* - ConfigFromFile (load from disk, fail if not found)
|
|
71
|
+
* - ConfigWithInit (load from disk, or run interactive init)
|
|
72
|
+
* - ConfigTest (provide config directly for testing)
|
|
73
|
+
*
|
|
74
|
+
* @example
|
|
75
|
+
* ```typescript
|
|
76
|
+
* import { ConfigFromFile } from "./services/config.js"
|
|
70
77
|
*
|
|
71
|
-
*
|
|
72
|
-
*
|
|
78
|
+
* runGenerate({ dryRun: true }).pipe(
|
|
79
|
+
* Effect.provide(ConfigFromFile()),
|
|
80
|
+
* // ... platform layers
|
|
81
|
+
* )
|
|
82
|
+
* ```
|
|
73
83
|
*/
|
|
74
|
-
export declare const runGenerate: (options?: GenerateOptions) => Effect.Effect<GenerateResult, GenerateError, FileSystem.FileSystem | Path.Path | CommandExecutor.CommandExecutor>;
|
|
84
|
+
export declare const runGenerate: (options?: GenerateOptions) => Effect.Effect<GenerateResult, GenerateError, ConfigService | FileSystem.FileSystem | Path.Path | CommandExecutor.CommandExecutor>;
|
|
75
85
|
//# sourceMappingURL=generate.d.ts.map
|
package/dist/generate.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"generate.d.ts","sourceRoot":"","sources":["../src/generate.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AACH,OAAO,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,QAAQ,CAAA;AACtC,OAAO,EAAE,UAAU,EAAE,IAAI,EAAW,eAAe,EAAE,MAAM,kBAAkB,CAAA;AAC7E,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,aAAa,CAAA;
|
|
1
|
+
{"version":3,"file":"generate.d.ts","sourceRoot":"","sources":["../src/generate.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AACH,OAAO,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,QAAQ,CAAA;AACtC,OAAO,EAAE,UAAU,EAAE,IAAI,EAAW,eAAe,EAAE,MAAM,kBAAkB,CAAA;AAC7E,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,aAAa,CAAA;AAEjD,OAAO,EAAc,KAAK,eAAe,EAAE,KAAK,cAAc,EAAE,MAAM,6BAA6B,CAAA;AACnG,OAAO,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAA;AACpD,OAAO,EACL,4BAA4B,EAE7B,MAAM,6BAA6B,CAAA;AAEpC,OAAO,EAAoB,KAAK,WAAW,EAAE,MAAM,2BAA2B,CAAA;AAG9E,OAAO,EAKL,KAAK,UAAU,EAChB,MAAM,qBAAqB,CAAA;AAC5B,OAAO,EACL,cAAc,EACd,aAAa,EACb,gBAAgB,EAChB,mBA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6
6
|
* 2. Introspect database
|
|
7
7
|
* 3. Build IR
|
|
8
|
-
* 4.
|
|
8
|
+
* 4. Run providers
|
|
9
9
|
* 5. Write files
|
|
10
10
|
*
|
|
11
11
|
* Logging:
|
|
@@ -16,14 +16,14 @@
|
|
|
16
16
|
*/
|
|
17
17
|
import { Effect, Layer } from "effect";
|
|
18
18
|
import { Command } from "@effect/platform";
|
|
19
|
-
import {
|
|
19
|
+
import { runPlugins } from "./services/plugin-runner.js";
|
|
20
|
+
import { ConfigService } from "./services/config.js";
|
|
20
21
|
import { DatabaseIntrospectionService, DatabaseIntrospectionLive, } from "./services/introspection.js";
|
|
21
22
|
import { createIRBuilderService } from "./services/ir-builder.js";
|
|
22
|
-
import { PluginRunner } from "./services/plugin-runner.js";
|
|
23
23
|
import { createFileWriter } from "./services/file-writer.js";
|
|
24
|
-
import {
|
|
25
|
-
import {
|
|
26
|
-
import { getEnumEntities, getTableEntities, getDomainEntities, getCompositeEntities } from "./ir/semantic-ir.js";
|
|
24
|
+
import { createInflection, makeInflectionLayer } from "./services/inflection.js";
|
|
25
|
+
import { createTypeHintRegistry } from "./services/type-hints.js";
|
|
26
|
+
import { getEnumEntities, getTableEntities, getDomainEntities, getCompositeEntities, } from "./ir/semantic-ir.js";
|
|
27
27
|
import { FormatError, } from "./errors.js";
|
|
28
28
|
/**
|
|
29
29
|
* Run a formatter command on the output directory.
|
|
@@ -51,18 +51,15 @@ const runFormatter = (command, outputDir) => {
|
|
|
51
51
|
})));
|
|
52
52
|
};
|
|
53
53
|
/**
|
|
54
|
-
* The main generate pipeline
|
|
54
|
+
* The main generate pipeline.
|
|
55
|
+
*
|
|
56
|
+
* Config is provided via ConfigService layer (Effect DI).
|
|
57
|
+
* Use ConfigFromFile or ConfigWithInit layers depending on context.
|
|
55
58
|
*/
|
|
56
59
|
export const generate = (options = {}) => Effect.gen(function* () {
|
|
57
|
-
// 1.
|
|
60
|
+
// 1. Get configuration from Effect context (DI)
|
|
58
61
|
yield* Effect.logDebug("Loading configuration...");
|
|
59
|
-
const
|
|
60
|
-
const config = yield* configLoader.load(
|
|
61
|
-
// Only include defined properties to satisfy exactOptionalPropertyTypes
|
|
62
|
-
Object.fromEntries(Object.entries({
|
|
63
|
-
configPath: options.configPath,
|
|
64
|
-
searchFrom: options.searchFrom,
|
|
65
|
-
}).filter(([, v]) => v !== undefined)));
|
|
62
|
+
const config = yield* ConfigService;
|
|
66
63
|
yield* Effect.logDebug(`Config schemas: ${config.schemas.join(", ")}`);
|
|
67
64
|
yield* Effect.logDebug(`Config plugins: ${config.plugins.length}`);
|
|
68
65
|
// 2. Introspect database
|
|
@@ -86,10 +83,14 @@ export const generate = (options = {}) => Effect.gen(function* () {
|
|
|
86
83
|
// 3. Build IR with user's inflection config
|
|
87
84
|
yield* Effect.log("Building semantic IR...");
|
|
88
85
|
const irBuilder = createIRBuilderService();
|
|
89
|
-
// Create inflection
|
|
86
|
+
// Create inflection from config (or use defaults)
|
|
87
|
+
const inflection = createInflection(config.inflection);
|
|
90
88
|
const inflectionLayer = makeInflectionLayer(config.inflection);
|
|
91
89
|
const ir = yield* irBuilder
|
|
92
|
-
.build(introspection, {
|
|
90
|
+
.build(introspection, {
|
|
91
|
+
schemas: config.schemas,
|
|
92
|
+
role: config.role,
|
|
93
|
+
})
|
|
93
94
|
.pipe(Effect.provide(inflectionLayer));
|
|
94
95
|
const enumEntities = getEnumEntities(ir);
|
|
95
96
|
const tableEntities = getTableEntities(ir);
|
|
@@ -109,27 +110,21 @@ export const generate = (options = {}) => Effect.gen(function* () {
|
|
|
109
110
|
yield* Effect.logDebug(`Entities: ${entityNames.join(", ")}`);
|
|
110
111
|
}
|
|
111
112
|
if (enumEntities.length > 0) {
|
|
112
|
-
const enumNames = enumEntities.map(e => e.name).sort();
|
|
113
|
+
const enumNames = enumEntities.map((e) => e.name).sort();
|
|
113
114
|
yield* Effect.logDebug(`Enums: ${enumNames.join(", ")}`);
|
|
114
115
|
}
|
|
115
|
-
// 4.
|
|
116
|
-
// NOTE: We create the PluginRunner with the user's inflection layer
|
|
117
|
-
// so plugins use the same naming conventions as the IR
|
|
116
|
+
// 4. Run providers
|
|
118
117
|
yield* Effect.log("Running plugins...");
|
|
119
|
-
// Cast plugins from config to
|
|
120
|
-
// The config stores them as unknown[], but they should be ConfiguredPlugin[]
|
|
118
|
+
// Cast plugins from config to Plugin[]
|
|
121
119
|
const plugins = config.plugins;
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
yield* Effect.log(`Plugin order: ${pluginNames.join(" → ")}`);
|
|
131
|
-
return yield* runner.run(prepared, ir);
|
|
132
|
-
}).pipe(Effect.provide(typeHintsLayer), Effect.provide(Layer.provide(PluginRunner.DefaultWithoutDependencies, inflectionLayer)));
|
|
120
|
+
yield* Effect.log(`Plugins: ${plugins.map((p) => p.name).join(", ")}`);
|
|
121
|
+
// Create type hints registry from config
|
|
122
|
+
const typeHints = createTypeHintRegistry(config.typeHints ?? []);
|
|
123
|
+
const pluginResult = yield* runPlugins(plugins, {
|
|
124
|
+
ir,
|
|
125
|
+
typeHints,
|
|
126
|
+
inflection,
|
|
127
|
+
});
|
|
133
128
|
const emissions = pluginResult.emissions.getAll();
|
|
134
129
|
yield* Effect.log(`Generated ${emissions.length} files`);
|
|
135
130
|
// 5. Write files
|
|
@@ -148,7 +143,11 @@ export const generate = (options = {}) => Effect.gen(function* () {
|
|
|
148
143
|
}
|
|
149
144
|
// Log each file at debug level
|
|
150
145
|
yield* Effect.forEach(writeResults, (result) => {
|
|
151
|
-
const status = options.dryRun
|
|
146
|
+
const status = options.dryRun
|
|
147
|
+
? "(dry run)"
|
|
148
|
+
: result.written
|
|
149
|
+
? "✓"
|
|
150
|
+
: "–";
|
|
152
151
|
return Effect.logDebug(`${status} ${result.path}`);
|
|
153
152
|
}, { discard: true });
|
|
154
153
|
const written = writeResults.filter((r) => r.written).length;
|
|
@@ -162,18 +161,29 @@ export const generate = (options = {}) => Effect.gen(function* () {
|
|
|
162
161
|
};
|
|
163
162
|
});
|
|
164
163
|
/**
|
|
165
|
-
* Layer that provides
|
|
164
|
+
* Layer that provides database introspection for generate().
|
|
166
165
|
*
|
|
167
|
-
* Note:
|
|
168
|
-
*
|
|
169
|
-
* The generate() function creates the PluginRunner internally.
|
|
166
|
+
* Note: ConfigService is NOT included here - it must be provided separately
|
|
167
|
+
* via ConfigFromFile, ConfigWithInit, or ConfigTest layers.
|
|
170
168
|
*/
|
|
171
|
-
export const GenerateLive = Layer.
|
|
169
|
+
export const GenerateLive = Layer.effect(DatabaseIntrospectionService, DatabaseIntrospectionLive);
|
|
172
170
|
/**
|
|
173
|
-
* Run generate with
|
|
171
|
+
* Run generate with database introspection provided.
|
|
172
|
+
*
|
|
173
|
+
* ConfigService must still be provided by the caller via one of:
|
|
174
|
+
* - ConfigFromFile (load from disk, fail if not found)
|
|
175
|
+
* - ConfigWithInit (load from disk, or run interactive init)
|
|
176
|
+
* - ConfigTest (provide config directly for testing)
|
|
177
|
+
*
|
|
178
|
+
* @example
|
|
179
|
+
* ```typescript
|
|
180
|
+
* import { ConfigFromFile } from "./services/config.js"
|
|
174
181
|
*
|
|
175
|
-
*
|
|
176
|
-
*
|
|
182
|
+
* runGenerate({ dryRun: true }).pipe(
|
|
183
|
+
* Effect.provide(ConfigFromFile()),
|
|
184
|
+
* // ... platform layers
|
|
185
|
+
* )
|
|
186
|
+
* ```
|
|
177
187
|
*/
|
|
178
188
|
export const runGenerate = (options = {}) => generate(options).pipe(Effect.provide(GenerateLive));
|
|
179
189
|
//# sourceMappingURL=generate.js.map
|
package/dist/generate.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"generate.js","sourceRoot":"","sources":["../src/generate.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AACH,OAAO,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,QAAQ,CAAA;A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D,CAAC,EACD,EAAE,OAAO,EAAE,IAAI,EAAE,CAClB,CAAA;IAED,MAAM,OAAO,GAAG,YAAY,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,MAAM,CAAA;IAC5D,MAAM,YAAY,GAAG,OAAO,CAAC,MAAM,CAAC,CAAC,CAAC,YAAY,CAAC,CAAC,CAAC,EAAE,CAAA;IACvD,KAAK,CAAC,CAAC,MAAM,CAAC,GAAG,CAAC,SAAS,OAAO,SAAS,YAAY,EAAE,CAAC,CAAA;IAE1D,OAAO;QACL,MAAM;QACN,EAAE;QACF,YAAY;QACZ,YAAY;KACb,CAAA;AACH,CAAC,CAAC,CAAA;AAEJ;;;;;GAKG;AACH,MAAM,CAAC,MAAM,YAAY,GAAG,KAAK,CAAC,MAAM,CACtC,4BAA4B,EAC5B,yBAAyB,CAC1B,CAAA;AAED;;;;;;;;;;;;;;;;;GAiBG;AACH,MAAM,CAAC,MAAM,WAAW,GAAG,CACzB,UAA2B,EAAE,EAK7B,EAAE,CAAC,QAAQ,CAAC,OAAO,CAAC,CAAC,IAAI,CAAC,MAAM,CAAC,OAAO,CAAC,YAAY,CAAC,CAAC,CAAA"}
|
package/dist/index.d.ts
CHANGED
|
@@ -5,32 +5,40 @@
|
|
|
5
5
|
*/
|
|
6
6
|
export { Config, TypeHint, TypeHintMatch, type ResolvedConfig, type ConfigInput } from "./config.js";
|
|
7
7
|
export { type ConfigLoader, ConfigLoaderService, ConfigLoaderLive, createConfigLoader, defineConfig, } from "./services/config-loader.js";
|
|
8
|
+
export { ConfigService, ConfigFromFile, ConfigWithInit, ConfigTest, getConfigSearchPaths, } from "./services/config.js";
|
|
8
9
|
export * from "./errors.js";
|
|
9
10
|
export { type SemanticIR, type SemanticIRBuilder, type Entity, type TableEntity, type EnumEntity, type DomainEntity, type DomainConstraint, type CompositeEntity, type Shape, type Field, type Relation, type ExtensionInfo, type Artifact, type CapabilityKey, type PrimaryKey, type EntityKind, type DomainBaseTypeInfo, type FunctionEntity, type FunctionArg, type Volatility, createIRBuilder, freezeIR, isTableEntity, isEnumEntity, isDomainEntity, isCompositeEntity, isFunctionEntity, getTableEntities, getEnumEntities, getDomainEntities, getCompositeEntities, getFunctionEntities, type ReverseRelation, type AllRelations, getReverseRelations, getAllRelations, } from "./ir/index.js";
|
|
10
11
|
export { SmartTags, ShapeKind } from "./ir/index.js";
|
|
12
|
+
export { type ParamSource, type QueryMethodKind, type QueryMethodParam, type QueryMethodReturn, type CallSignature, type QueryMethod, type EntityQueriesExtension, type StandaloneFunction, type FunctionsExtension, EntityQueriesExtension as EntityQueriesExtensionSchema, FunctionsExtension as FunctionsExtensionSchema, } from "./ir/extensions/queries.js";
|
|
11
13
|
export { IR } from "./services/ir.js";
|
|
12
14
|
export { ArtifactStore, type ArtifactStoreImpl, createArtifactStore, ArtifactStoreLive } from "./services/artifact-store.js";
|
|
13
15
|
export { PluginMeta, type PluginMetaInfo } from "./services/plugin-meta.js";
|
|
14
|
-
export { type Plugin, type
|
|
16
|
+
export { type Plugin, type PluginContext, type PluginRegistry, type PluginError, type ResourceRequest, type DeferredResource, PluginNotFound, PluginCycle, PluginExecutionFailed, ResourceNotResolved, Plugins, PluginsLive, definePlugin, createPluginRegistry, } from "./services/plugin.js";
|
|
15
17
|
export { type CoreInflection, type InflectionConfig, type TransformFn, Inflection, inflect, defaultInflection, defaultTransforms, createInflection, makeInflectionLayer, composeInflectionConfigs, composeInflection, InflectionLive, } from "./services/inflection.js";
|
|
16
18
|
export { type TypeHintRegistry, type TypeHintFieldMatch, TypeHints, createTypeHintRegistry, emptyTypeHintRegistry, TypeHintsLive, } from "./services/type-hints.js";
|
|
17
|
-
export { PgTypeOid, TsType, type TypeMappingResult, type TypeMapper, type EnumLookupResult, ExtensionTypeMap, defaultPgToTs, getExtensionTypeMapping, composeMappers, wrapArrayType, wrapNullable, findEnumByPgName, } from "./services/pg-types.js";
|
|
18
|
-
export { type SymbolRegistry, type Symbol, type SymbolRef, type ImportStatement, type SymbolCollision, Symbols, createSymbolRegistry, SymbolsLive, } from "./services/symbols.js";
|
|
19
|
+
export { PgTypeOid, TsType, type TypeMappingResult, type TypeMapper, type EnumLookupResult, type CompositeLookupResult, ExtensionTypeMap, defaultPgToTs, getExtensionTypeMapping, composeMappers, wrapArrayType, wrapNullable, findEnumByPgName, findCompositeByPgName, } from "./services/pg-types.js";
|
|
20
|
+
export { type SymbolRegistry, type Symbol, type SymbolRef, type ImportStatement, type SymbolCollision, type MethodSymbol, type EntityMethods, Symbols, createSymbolRegistry, SymbolsLive, } from "./services/symbols.js";
|
|
21
|
+
export { type ServiceRegistry, Services, createServiceRegistry, ServicesLive, } from "./services/service-registry.js";
|
|
19
22
|
export { type EmissionBuffer, type EmissionEntry, Emissions, createEmissionBuffer, EmissionsLive, } from "./services/emissions.js";
|
|
20
|
-
export {
|
|
23
|
+
export { runPlugins, type PluginRunContext, type PluginRunResult, type PluginRunError, } from "./services/plugin-runner.js";
|
|
21
24
|
export { type FileWriter, type WriteResult, type WriteOptions, FileWriterSvc, createFileWriter, FileWriterLive, } from "./services/file-writer.js";
|
|
22
25
|
export { type ParsedComment, type TagContext, parseSmartTags, } from "./services/smart-tags-parser.js";
|
|
23
26
|
export { type IRBuilder, type IRBuilderOptions, IRBuilderSvc, IRBuilderLive, createIRBuilderService, } from "./services/ir-builder.js";
|
|
24
27
|
export { PluginTestLayers, createPluginTestLayer, } from "./testing.js";
|
|
25
28
|
export { conjure, cast, type ChainBuilder, type ObjBuilder, type ArrBuilder, type FnBuilder, type SymbolContext, type SymbolMeta, type SymbolStatement, type SymbolProgram, } from "./lib/conjure.js";
|
|
26
|
-
export { hex, type SqlStyle, type QueryParts, buildTemplateLiteral, buildAwaitSqlTag, buildAwaitSqlString, buildQuery, buildFirstRowDecl, buildAllRowsDecl, buildReturnQuery,
|
|
27
|
-
export { typesPlugin } from "./plugins/types.js";
|
|
28
|
-
export {
|
|
29
|
-
export {
|
|
30
|
-
export {
|
|
31
|
-
export { sqlQueriesPlugin } from "./plugins/sql-queries.js";
|
|
32
|
-
export {
|
|
33
|
-
export {
|
|
29
|
+
export { hex, type SqlStyle, type QueryParts, buildTemplateLiteral, buildAwaitSqlTag, buildAwaitSqlString, buildQuery, buildFirstRowDecl, buildAllRowsDecl, buildReturnQuery, } from "./lib/hex.js";
|
|
30
|
+
export { typesPlugin, types } from "./plugins/types.js";
|
|
31
|
+
export { zod, type ZodConfig } from "./plugins/zod.js";
|
|
32
|
+
export { arktype, type ArkTypeConfig } from "./plugins/arktype.js";
|
|
33
|
+
export { valibot, type ValibotConfig } from "./plugins/valibot.js";
|
|
34
|
+
export { sqlQueries, sqlQueries as sqlQueriesPlugin, type SqlQueriesConfig } from "./plugins/sql-queries.js";
|
|
35
|
+
export { effect, effectPlugin, type EffectConfig } from "./plugins/effect.js";
|
|
36
|
+
export { kysely, type KyselyConfig } from "./plugins/kysely.js";
|
|
37
|
+
export { httpElysia, type HttpElysiaConfig } from "./plugins/http-elysia.js";
|
|
38
|
+
export { httpExpress, type HttpExpressConfig } from "./plugins/http-express.js";
|
|
39
|
+
export { httpHono, type HttpHonoConfig } from "./plugins/http-hono.js";
|
|
40
|
+
export { httpTrpc, type HttpTrpcConfig } from "./plugins/http-trpc.js";
|
|
41
|
+
export { httpOrpc, type HttpOrpcConfig } from "./plugins/http-orpc.js";
|
|
34
42
|
export { generate, runGenerate, GenerateLive, type GenerateOptions, type GenerateResult, type GenerateError, } from "./generate.js";
|
|
35
43
|
export { type DatabaseIntrospection, type IntrospectOptions, DatabaseIntrospectionService, DatabaseIntrospectionLive, createDatabaseIntrospection, introspectDatabase, } from "./services/introspection.js";
|
|
36
44
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAGH,OAAO,EAAE,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