@prisma-next/config 0.6.0-dev.4 → 0.6.0-dev.6

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.
@@ -54,11 +54,20 @@ interface ContractConfig {
54
54
  */
55
55
  readonly source: ContractSourceProvider;
56
56
  /**
57
- * Path to contract.json artifact. Defaults to 'src/prisma/contract.json'.
58
- * The .d.ts types file will be colocated (e.g., contract.json -> contract.d.ts).
57
+ * Path to contract.json artifact. Providers that know an input path (PSL,
58
+ * `typescriptContractFromPath`) derive an output colocated with that input
59
+ * so this rarely needs to be set explicitly. The `.d.ts` types file is
60
+ * always emitted next to the JSON (e.g., `contract.json` → `contract.d.ts`).
59
61
  */
60
62
  readonly output?: string;
61
63
  }
64
+ /**
65
+ * Last-resort fallback used by `normalizeContractConfig` when neither the
66
+ * caller nor the provider has supplied an `output`. Providers that carry
67
+ * an input path (PSL, `typescriptContractFromPath`) prefer a colocated
68
+ * default; this constant is only reached by providers like `typescriptContract`
69
+ * that hold an in-memory contract with no source path to anchor on.
70
+ */
62
71
  declare const DEFAULT_CONTRACT_OUTPUT = "src/prisma/contract.json";
63
72
  declare function normalizeContractConfig(contract: ContractConfig): ContractConfig & {
64
73
  readonly output: string;
@@ -121,4 +130,4 @@ interface PrismaNextConfig<TFamilyId extends string = string, TTargetId extends
121
130
  declare function defineConfig<TFamilyId extends string = string, TTargetId extends string = string>(config: PrismaNextConfig<TFamilyId, TTargetId>): PrismaNextConfig<TFamilyId, TTargetId>;
122
131
  //#endregion
123
132
  export { normalizeContractConfig as a, ContractSourceDiagnosticPosition as c, ContractSourceProvider as d, defineConfig as i, ContractSourceDiagnosticSpan as l, DEFAULT_CONTRACT_OUTPUT as n, ContractSourceContext as o, PrismaNextConfig as r, ContractSourceDiagnostic as s, ContractConfig as t, ContractSourceDiagnostics as u };
124
- //# sourceMappingURL=config-types-CrHPZdb2.d.mts.map
133
+ //# sourceMappingURL=config-types-BDbcSJQg.d.mts.map
@@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,IAAA,GACP,OAAA,EAAS,qBAAA,KACN,OAAA,CAAQ,MAAA,CAAO,QAAA,EAAU,yBAAA;AAAA;;;AA3ChC;;;AAAA,UCYiB,cAAA;EDXN;;;;EAAA,SCgBA,MAAA,EAAQ,sBAAA;EDXF;;;;;;EAAA,SCkBN,MAAA;AAAA;;;ADbX;;;;;cCuBa,uBAAA;AAAA,iBAEG,uBAAA,CACd,QAAA,EAAU,cAAA,GACT,cAAA;EAAA,SAA4B,MAAA;AAAA;;;;;;;;;UAed,gBAAA;EAAA,SAKN,MAAA,EAAQ,uBAAA,CAAwB,SAAA;EAAA,SAChC,MAAA,EAAQ,uBAAA,CAAwB,SAAA,EAAW,SAAA;EAAA,SAC3C,OAAA,EAAS,wBAAA,CAAyB,SAAA,EAAW,SAAA;EAAA,SAC7C,cAAA,YAA0B,0BAAA,CAA2B,SAAA,EAAW,SAAA;EDpChE;;;;;;EAAA,SC2CA,MAAA,GAAS,uBAAA,CAChB,SAAA,EACA,SAAA,EACA,qBAAA,CAAsB,SAAA,EAAW,SAAA,GACjC,WAAA;ED1Ca;;;;EAAA,SCgDN,EAAA;ID5Ca;;;;;IAAA,SCkDX,UAAA,GAAa,WAAA;EAAA;EDnDf;;;;EAAA,SCyDA,QAAA,GAAW,cAAA;EDvDc;;;EAAA,SC2DzB,UAAA;IDvDM,oGCyDJ,GAAA;EAAA;AAAA;;;;;;;;;AApFb;;;iBAkIgB,YAAA,sEAAA,CACd,MAAA,EAAQ,gBAAA,CAAiB,SAAA,EAAW,SAAA,IACnC,gBAAA,CAAiB,SAAA,EAAW,SAAA"}
@@ -1,2 +1,2 @@
1
- import { a as normalizeContractConfig, c as ContractSourceDiagnosticPosition, d as ContractSourceProvider, i as defineConfig, l as ContractSourceDiagnosticSpan, n as DEFAULT_CONTRACT_OUTPUT, o as ContractSourceContext, r as PrismaNextConfig, s as ContractSourceDiagnostic, t as ContractConfig, u as ContractSourceDiagnostics } from "./config-types-CrHPZdb2.mjs";
1
+ import { a as normalizeContractConfig, c as ContractSourceDiagnosticPosition, d as ContractSourceProvider, i as defineConfig, l as ContractSourceDiagnosticSpan, n as DEFAULT_CONTRACT_OUTPUT, o as ContractSourceContext, r as PrismaNextConfig, s as ContractSourceDiagnostic, t as ContractConfig, u as ContractSourceDiagnostics } from "./config-types-BDbcSJQg.mjs";
2
2
  export { type ContractConfig, type ContractSourceContext, type ContractSourceDiagnostic, type ContractSourceDiagnosticPosition, type ContractSourceDiagnosticSpan, type ContractSourceDiagnostics, type ContractSourceProvider, DEFAULT_CONTRACT_OUTPUT, type PrismaNextConfig, defineConfig, normalizeContractConfig };
@@ -1,5 +1,12 @@
1
1
  import { type } from "arktype";
2
2
  //#region src/config-types.ts
3
+ /**
4
+ * Last-resort fallback used by `normalizeContractConfig` when neither the
5
+ * caller nor the provider has supplied an `output`. Providers that carry
6
+ * an input path (PSL, `typescriptContractFromPath`) prefer a colocated
7
+ * default; this constant is only reached by providers like `typescriptContract`
8
+ * that hold an in-memory contract with no source path to anchor on.
9
+ */
3
10
  const DEFAULT_CONTRACT_OUTPUT = "src/prisma/contract.json";
4
11
  function normalizeContractConfig(contract) {
5
12
  return {
@@ -1 +1 @@
1
- {"version":3,"file":"config-types.mjs","names":[],"sources":["../src/config-types.ts"],"sourcesContent":["import type {\n ControlAdapterDescriptor,\n ControlDriverDescriptor,\n ControlDriverInstance,\n ControlExtensionDescriptor,\n ControlFamilyDescriptor,\n ControlTargetDescriptor,\n} from '@prisma-next/framework-components/control';\nimport { type } from 'arktype';\nimport type { ContractSourceProvider } from './contract-source-types';\n\n/**\n * Type alias for CLI driver instances.\n * Uses string for both family and target IDs for maximum flexibility.\n */\nexport type CliDriver = ControlDriverInstance<string, string>;\n\n/**\n * Contract configuration specifying source and artifact locations.\n */\nexport interface ContractConfig {\n /**\n * Contract source provider. The provider is always async and must return\n * a Result containing either a Contract or structured diagnostics.\n */\n readonly source: ContractSourceProvider;\n /**\n * Path to contract.json artifact. Defaults to 'src/prisma/contract.json'.\n * The .d.ts types file will be colocated (e.g., contract.json -> contract.d.ts).\n */\n readonly output?: string;\n}\n\nexport const DEFAULT_CONTRACT_OUTPUT = 'src/prisma/contract.json';\n\nexport function normalizeContractConfig(\n contract: ContractConfig,\n): ContractConfig & { readonly output: string } {\n return {\n source: contract.source,\n output: contract.output ?? DEFAULT_CONTRACT_OUTPUT,\n };\n}\n\n/**\n * Configuration for Prisma Next CLI.\n * Uses Control*Descriptor types for type-safe wiring with compile-time compatibility checks.\n *\n * @template TFamilyId - The family ID (e.g., 'sql', 'document')\n * @template TTargetId - The target ID (e.g., 'postgres', 'mysql')\n * @template TConnection - The driver connection input type (defaults to `unknown` for config flexibility)\n */\nexport interface PrismaNextConfig<\n TFamilyId extends string = string,\n TTargetId extends string = string,\n TConnection = unknown,\n> {\n readonly family: ControlFamilyDescriptor<TFamilyId>;\n readonly target: ControlTargetDescriptor<TFamilyId, TTargetId>;\n readonly adapter: ControlAdapterDescriptor<TFamilyId, TTargetId>;\n readonly extensionPacks?: readonly ControlExtensionDescriptor<TFamilyId, TTargetId>[];\n /**\n * Driver descriptor for DB-connected CLI commands.\n * Required for DB-connected commands (e.g., db verify).\n * Optional for commands that don't need database access (e.g., emit).\n * The driver's connection type matches the TConnection config parameter.\n */\n readonly driver?: ControlDriverDescriptor<\n TFamilyId,\n TTargetId,\n ControlDriverInstance<TFamilyId, TTargetId>,\n TConnection\n >;\n /**\n * Database connection configuration.\n * The connection type is driver-specific (e.g., URL string for Postgres).\n */\n readonly db?: {\n /**\n * Driver-specific connection input.\n * For Postgres: a connection string (URL).\n * For other drivers: may be a structured object.\n */\n readonly connection?: TConnection;\n };\n /**\n * Contract configuration. Specifies source and artifact locations.\n * Required for emit command; optional for other commands that only read artifacts.\n */\n readonly contract?: ContractConfig;\n /**\n * Migration configuration. Controls where on-disk migration packages are stored.\n */\n readonly migrations?: {\n /** Directory for migration packages, relative to config file. Defaults to 'migrations'. */\n readonly dir?: string;\n };\n}\n\nconst ContractSourceInputSchema = type('string');\n\nexport const ContractSourceProviderSchema = type({\n 'inputs?': ContractSourceInputSchema.array(),\n load: 'Function',\n});\n\nexport const ContractConfigSchema = type({\n source: ContractSourceProviderSchema,\n 'output?': 'string',\n});\n\n/**\n * Arktype schema for PrismaNextConfig validation.\n * Note: This validates structure only. Descriptor objects (family, target, adapter) are validated separately.\n */\nconst MigrationsConfigSchema = type({\n 'dir?': 'string',\n});\n\nconst PrismaNextConfigSchema = type({\n family: 'unknown', // ControlFamilyDescriptor - validated separately\n target: 'unknown', // ControlTargetDescriptor - validated separately\n adapter: 'unknown', // ControlAdapterDescriptor - validated separately\n 'extensionPacks?': 'unknown[]',\n 'driver?': 'unknown', // ControlDriverDescriptor - validated separately (optional)\n 'db?': 'unknown',\n 'contract?': ContractConfigSchema,\n 'migrations?': MigrationsConfigSchema,\n});\n\n/**\n * Helper function to define a Prisma Next config.\n * Validates and normalizes the config using Arktype, then returns the normalized IR.\n *\n * Normalization:\n * - contract.output defaults to DEFAULT_CONTRACT_OUTPUT if missing\n *\n * @param config - Raw config input from user\n * @returns Normalized config IR with defaults applied\n * @throws Error if config structure is invalid\n */\nexport function defineConfig<TFamilyId extends string = string, TTargetId extends string = string>(\n config: PrismaNextConfig<TFamilyId, TTargetId>,\n): PrismaNextConfig<TFamilyId, TTargetId> {\n // Validate structure using Arktype\n const validated = PrismaNextConfigSchema(config);\n if (validated instanceof type.errors) {\n const messages = validated.map((p: { message: string }) => p.message).join('; ');\n throw new Error(`Config validation failed: ${messages}`);\n }\n\n // Normalize contract config if present\n if (config.contract) {\n // Return normalized config\n return {\n ...config,\n contract: normalizeContractConfig(config.contract),\n };\n }\n\n // Return config as-is if no contract (preserve literal types)\n return config;\n}\n"],"mappings":";;AAiCA,MAAa,0BAA0B;AAEvC,SAAgB,wBACd,UAC8C;CAC9C,OAAO;EACL,QAAQ,SAAS;EACjB,QAAQ,SAAS,UAAA;EAClB;;AA8EH,MAAM,yBAAyB,KAAK;CAClC,QAAQ;CACR,QAAQ;CACR,SAAS;CACT,mBAAmB;CACnB,WAAW;CACX,OAAO;CACP,aApBkC,KAAK;EACvC,QAN0C,KAAK;GAC/C,WAHgC,KAAK,SAG1B,CAA0B,OAAO;GAC5C,MAAM;GACP,CAGS;EACR,WAAW;EACZ,CAiBc;CACb,eAZ6B,KAAK,EAClC,QAAQ,UACT,CAUsC;CACtC,CAAC;;;;;;;;;;;;AAaF,SAAgB,aACd,QACwC;CAExC,MAAM,YAAY,uBAAuB,OAAO;CAChD,IAAI,qBAAqB,KAAK,QAAQ;EACpC,MAAM,WAAW,UAAU,KAAK,MAA2B,EAAE,QAAQ,CAAC,KAAK,KAAK;EAChF,MAAM,IAAI,MAAM,6BAA6B,WAAW;;CAI1D,IAAI,OAAO,UAET,OAAO;EACL,GAAG;EACH,UAAU,wBAAwB,OAAO,SAAS;EACnD;CAIH,OAAO"}
1
+ {"version":3,"file":"config-types.mjs","names":[],"sources":["../src/config-types.ts"],"sourcesContent":["import type {\n ControlAdapterDescriptor,\n ControlDriverDescriptor,\n ControlDriverInstance,\n ControlExtensionDescriptor,\n ControlFamilyDescriptor,\n ControlTargetDescriptor,\n} from '@prisma-next/framework-components/control';\nimport { type } from 'arktype';\nimport type { ContractSourceProvider } from './contract-source-types';\n\n/**\n * Type alias for CLI driver instances.\n * Uses string for both family and target IDs for maximum flexibility.\n */\nexport type CliDriver = ControlDriverInstance<string, string>;\n\n/**\n * Contract configuration specifying source and artifact locations.\n */\nexport interface ContractConfig {\n /**\n * Contract source provider. The provider is always async and must return\n * a Result containing either a Contract or structured diagnostics.\n */\n readonly source: ContractSourceProvider;\n /**\n * Path to contract.json artifact. Providers that know an input path (PSL,\n * `typescriptContractFromPath`) derive an output colocated with that input\n * so this rarely needs to be set explicitly. The `.d.ts` types file is\n * always emitted next to the JSON (e.g., `contract.json` `contract.d.ts`).\n */\n readonly output?: string;\n}\n\n/**\n * Last-resort fallback used by `normalizeContractConfig` when neither the\n * caller nor the provider has supplied an `output`. Providers that carry\n * an input path (PSL, `typescriptContractFromPath`) prefer a colocated\n * default; this constant is only reached by providers like `typescriptContract`\n * that hold an in-memory contract with no source path to anchor on.\n */\nexport const DEFAULT_CONTRACT_OUTPUT = 'src/prisma/contract.json';\n\nexport function normalizeContractConfig(\n contract: ContractConfig,\n): ContractConfig & { readonly output: string } {\n return {\n source: contract.source,\n output: contract.output ?? DEFAULT_CONTRACT_OUTPUT,\n };\n}\n\n/**\n * Configuration for Prisma Next CLI.\n * Uses Control*Descriptor types for type-safe wiring with compile-time compatibility checks.\n *\n * @template TFamilyId - The family ID (e.g., 'sql', 'document')\n * @template TTargetId - The target ID (e.g., 'postgres', 'mysql')\n * @template TConnection - The driver connection input type (defaults to `unknown` for config flexibility)\n */\nexport interface PrismaNextConfig<\n TFamilyId extends string = string,\n TTargetId extends string = string,\n TConnection = unknown,\n> {\n readonly family: ControlFamilyDescriptor<TFamilyId>;\n readonly target: ControlTargetDescriptor<TFamilyId, TTargetId>;\n readonly adapter: ControlAdapterDescriptor<TFamilyId, TTargetId>;\n readonly extensionPacks?: readonly ControlExtensionDescriptor<TFamilyId, TTargetId>[];\n /**\n * Driver descriptor for DB-connected CLI commands.\n * Required for DB-connected commands (e.g., db verify).\n * Optional for commands that don't need database access (e.g., emit).\n * The driver's connection type matches the TConnection config parameter.\n */\n readonly driver?: ControlDriverDescriptor<\n TFamilyId,\n TTargetId,\n ControlDriverInstance<TFamilyId, TTargetId>,\n TConnection\n >;\n /**\n * Database connection configuration.\n * The connection type is driver-specific (e.g., URL string for Postgres).\n */\n readonly db?: {\n /**\n * Driver-specific connection input.\n * For Postgres: a connection string (URL).\n * For other drivers: may be a structured object.\n */\n readonly connection?: TConnection;\n };\n /**\n * Contract configuration. Specifies source and artifact locations.\n * Required for emit command; optional for other commands that only read artifacts.\n */\n readonly contract?: ContractConfig;\n /**\n * Migration configuration. Controls where on-disk migration packages are stored.\n */\n readonly migrations?: {\n /** Directory for migration packages, relative to config file. Defaults to 'migrations'. */\n readonly dir?: string;\n };\n}\n\nconst ContractSourceInputSchema = type('string');\n\nexport const ContractSourceProviderSchema = type({\n 'inputs?': ContractSourceInputSchema.array(),\n load: 'Function',\n});\n\nexport const ContractConfigSchema = type({\n source: ContractSourceProviderSchema,\n 'output?': 'string',\n});\n\n/**\n * Arktype schema for PrismaNextConfig validation.\n * Note: This validates structure only. Descriptor objects (family, target, adapter) are validated separately.\n */\nconst MigrationsConfigSchema = type({\n 'dir?': 'string',\n});\n\nconst PrismaNextConfigSchema = type({\n family: 'unknown', // ControlFamilyDescriptor - validated separately\n target: 'unknown', // ControlTargetDescriptor - validated separately\n adapter: 'unknown', // ControlAdapterDescriptor - validated separately\n 'extensionPacks?': 'unknown[]',\n 'driver?': 'unknown', // ControlDriverDescriptor - validated separately (optional)\n 'db?': 'unknown',\n 'contract?': ContractConfigSchema,\n 'migrations?': MigrationsConfigSchema,\n});\n\n/**\n * Helper function to define a Prisma Next config.\n * Validates and normalizes the config using Arktype, then returns the normalized IR.\n *\n * Normalization:\n * - contract.output defaults to DEFAULT_CONTRACT_OUTPUT if missing\n *\n * @param config - Raw config input from user\n * @returns Normalized config IR with defaults applied\n * @throws Error if config structure is invalid\n */\nexport function defineConfig<TFamilyId extends string = string, TTargetId extends string = string>(\n config: PrismaNextConfig<TFamilyId, TTargetId>,\n): PrismaNextConfig<TFamilyId, TTargetId> {\n // Validate structure using Arktype\n const validated = PrismaNextConfigSchema(config);\n if (validated instanceof type.errors) {\n const messages = validated.map((p: { message: string }) => p.message).join('; ');\n throw new Error(`Config validation failed: ${messages}`);\n }\n\n // Normalize contract config if present\n if (config.contract) {\n // Return normalized config\n return {\n ...config,\n contract: normalizeContractConfig(config.contract),\n };\n }\n\n // Return config as-is if no contract (preserve literal types)\n return config;\n}\n"],"mappings":";;;;;;;;;AA0CA,MAAa,0BAA0B;AAEvC,SAAgB,wBACd,UAC8C;CAC9C,OAAO;EACL,QAAQ,SAAS;EACjB,QAAQ,SAAS,UAAA;EAClB;;AA8EH,MAAM,yBAAyB,KAAK;CAClC,QAAQ;CACR,QAAQ;CACR,SAAS;CACT,mBAAmB;CACnB,WAAW;CACX,OAAO;CACP,aApBkC,KAAK;EACvC,QAN0C,KAAK;GAC/C,WAHgC,KAAK,SAG1B,CAA0B,OAAO;GAC5C,MAAM;GACP,CAGS;EACR,WAAW;EACZ,CAiBc;CACb,eAZ6B,KAAK,EAClC,QAAQ,UACT,CAUsC;CACtC,CAAC;;;;;;;;;;;;AAaF,SAAgB,aACd,QACwC;CAExC,MAAM,YAAY,uBAAuB,OAAO;CAChD,IAAI,qBAAqB,KAAK,QAAQ;EACpC,MAAM,WAAW,UAAU,KAAK,MAA2B,EAAE,QAAQ,CAAC,KAAK,KAAK;EAChF,MAAM,IAAI,MAAM,6BAA6B,WAAW;;CAI1D,IAAI,OAAO,UAET,OAAO;EACL,GAAG;EACH,UAAU,wBAAwB,OAAO,SAAS;EACnD;CAIH,OAAO"}
@@ -1,4 +1,4 @@
1
- import { r as PrismaNextConfig } from "./config-types-CrHPZdb2.mjs";
1
+ import { r as PrismaNextConfig } from "./config-types-BDbcSJQg.mjs";
2
2
 
3
3
  //#region src/config-validation.d.ts
4
4
  /**
package/package.json CHANGED
@@ -1,22 +1,22 @@
1
1
  {
2
2
  "name": "@prisma-next/config",
3
- "version": "0.6.0-dev.4",
3
+ "version": "0.6.0-dev.6",
4
4
  "license": "Apache-2.0",
5
5
  "type": "module",
6
6
  "sideEffects": false,
7
7
  "description": "Prisma Next config authoring types and validation",
8
8
  "dependencies": {
9
9
  "arktype": "^2.1.29",
10
- "@prisma-next/contract": "0.6.0-dev.4",
11
- "@prisma-next/framework-components": "0.6.0-dev.4",
12
- "@prisma-next/utils": "0.6.0-dev.4"
10
+ "@prisma-next/contract": "0.6.0-dev.6",
11
+ "@prisma-next/framework-components": "0.6.0-dev.6",
12
+ "@prisma-next/utils": "0.6.0-dev.6"
13
13
  },
14
14
  "devDependencies": {
15
15
  "tsdown": "0.22.0",
16
16
  "typescript": "5.9.3",
17
17
  "vitest": "4.1.5",
18
- "@prisma-next/tsconfig": "0.0.0",
19
- "@prisma-next/tsdown": "0.0.0"
18
+ "@prisma-next/tsdown": "0.0.0",
19
+ "@prisma-next/tsconfig": "0.0.0"
20
20
  },
21
21
  "files": [
22
22
  "dist",
@@ -25,12 +25,21 @@ export interface ContractConfig {
25
25
  */
26
26
  readonly source: ContractSourceProvider;
27
27
  /**
28
- * Path to contract.json artifact. Defaults to 'src/prisma/contract.json'.
29
- * The .d.ts types file will be colocated (e.g., contract.json -> contract.d.ts).
28
+ * Path to contract.json artifact. Providers that know an input path (PSL,
29
+ * `typescriptContractFromPath`) derive an output colocated with that input
30
+ * so this rarely needs to be set explicitly. The `.d.ts` types file is
31
+ * always emitted next to the JSON (e.g., `contract.json` → `contract.d.ts`).
30
32
  */
31
33
  readonly output?: string;
32
34
  }
33
35
 
36
+ /**
37
+ * Last-resort fallback used by `normalizeContractConfig` when neither the
38
+ * caller nor the provider has supplied an `output`. Providers that carry
39
+ * an input path (PSL, `typescriptContractFromPath`) prefer a colocated
40
+ * default; this constant is only reached by providers like `typescriptContract`
41
+ * that hold an in-memory contract with no source path to anchor on.
42
+ */
34
43
  export const DEFAULT_CONTRACT_OUTPUT = 'src/prisma/contract.json';
35
44
 
36
45
  export function normalizeContractConfig(