@prisma-next/errors
Advanced tools
| //#region src/control.ts | ||
| /** | ||
| * Structured CLI error that contains all information needed for error envelopes. | ||
| * Call sites throw these errors with full context. | ||
| */ | ||
| var CliStructuredError = class extends Error { | ||
| code; | ||
| domain; | ||
| severity; | ||
| why; | ||
| fix; | ||
| where; | ||
| meta; | ||
| docsUrl; | ||
| constructor(code, summary, options) { | ||
| super(summary); | ||
| this.name = "CliStructuredError"; | ||
| this.code = code; | ||
| this.domain = options?.domain ?? "CLI"; | ||
| this.severity = options?.severity ?? "error"; | ||
| this.why = options?.why; | ||
| this.fix = options?.fix === options?.why ? void 0 : options?.fix; | ||
| this.where = options?.where ? { | ||
| path: options.where.path, | ||
| line: options.where.line | ||
| } : void 0; | ||
| this.meta = options?.meta; | ||
| this.docsUrl = options?.docsUrl; | ||
| } | ||
| /** | ||
| * Converts this error to a CLI error envelope for output formatting. | ||
| */ | ||
| toEnvelope() { | ||
| return { | ||
| ok: false, | ||
| code: `${{ | ||
| CLI: "PN-CLI-", | ||
| RUN: "PN-RUN-", | ||
| MIG: "PN-MIG-" | ||
| }[this.domain]}${this.code}`, | ||
| domain: this.domain, | ||
| severity: this.severity, | ||
| summary: this.message, | ||
| why: this.why, | ||
| fix: this.fix, | ||
| where: this.where, | ||
| meta: this.meta, | ||
| docsUrl: this.docsUrl | ||
| }; | ||
| } | ||
| /** | ||
| * Type guard to check if an error is a CliStructuredError. | ||
| * Uses duck-typing to work across module boundaries where instanceof may fail. | ||
| */ | ||
| static is(error) { | ||
| if (!(error instanceof Error)) return false; | ||
| const candidate = error; | ||
| return candidate.name === "CliStructuredError" && typeof candidate.code === "string" && (candidate.domain === "CLI" || candidate.domain === "RUN" || candidate.domain === "MIG") && typeof candidate.toEnvelope === "function"; | ||
| } | ||
| }; | ||
| /** | ||
| * Config file not found or missing. | ||
| */ | ||
| function errorConfigFileNotFound(configPath, options) { | ||
| return new CliStructuredError("4001", "Config file not found", { | ||
| domain: "CLI", | ||
| ...options?.why ? { why: options.why } : { why: "Config file not found" }, | ||
| fix: "Run 'prisma-next init' to create a config file", | ||
| docsUrl: "https://prisma-next.dev/docs/cli/config", | ||
| ...configPath ? { where: { path: configPath } } : {} | ||
| }); | ||
| } | ||
| /** | ||
| * Contract configuration missing from config. | ||
| */ | ||
| function errorContractConfigMissing(options) { | ||
| return new CliStructuredError("4002", "Contract configuration missing", { | ||
| domain: "CLI", | ||
| why: options?.why ?? "The contract configuration is required for emit", | ||
| fix: "Add contract configuration to your prisma-next.config.ts", | ||
| docsUrl: "https://prisma-next.dev/docs/cli/contract-emit" | ||
| }); | ||
| } | ||
| /** | ||
| * Contract validation failed. | ||
| */ | ||
| function errorContractValidationFailed(reason, options) { | ||
| return new CliStructuredError("4003", "Contract validation failed", { | ||
| domain: "CLI", | ||
| why: reason, | ||
| fix: "Re-run `prisma-next contract emit`, or fix the contract file and try again", | ||
| docsUrl: "https://prisma-next.dev/docs/contracts", | ||
| ...options?.where ? { where: options.where } : {} | ||
| }); | ||
| } | ||
| /** | ||
| * File not found. | ||
| */ | ||
| function errorFileNotFound(filePath, options) { | ||
| return new CliStructuredError("4004", "File not found", { | ||
| domain: "CLI", | ||
| why: options?.why ?? `File not found: ${filePath}`, | ||
| fix: options?.fix ?? "Check that the file path is correct", | ||
| where: { path: filePath }, | ||
| ...options?.docsUrl ? { docsUrl: options.docsUrl } : {} | ||
| }); | ||
| } | ||
| /** | ||
| * Database connection is required but not provided. | ||
| */ | ||
| function errorDatabaseConnectionRequired(options) { | ||
| const runHint = options?.retryCommand ? `Run \`${options.retryCommand}\`` : options?.commandName ? `Run \`prisma-next ${options.commandName} --db <url>\`` : "Provide `--db <url>`"; | ||
| return new CliStructuredError("4005", "Database connection is required", { | ||
| domain: "CLI", | ||
| why: options?.why ?? "Database connection is required for this command", | ||
| fix: `${runHint}, or set \`db: { connection: "postgres://…" }\` in prisma-next.config.ts` | ||
| }); | ||
| } | ||
| /** | ||
| * Query runner factory is required but not provided in config. | ||
| */ | ||
| function errorQueryRunnerFactoryRequired(options) { | ||
| return new CliStructuredError("4006", "Query runner factory is required", { | ||
| domain: "CLI", | ||
| why: options?.why ?? "Config.db.queryRunnerFactory is required for db verify", | ||
| fix: "Add db.queryRunnerFactory to prisma-next.config.ts", | ||
| docsUrl: "https://prisma-next.dev/docs/cli/db-verify" | ||
| }); | ||
| } | ||
| /** | ||
| * Family verify.readMarker is required but not provided. | ||
| */ | ||
| function errorFamilyReadMarkerSqlRequired(options) { | ||
| return new CliStructuredError("4007", "Family readMarker() is required", { | ||
| domain: "CLI", | ||
| why: options?.why ?? "Family verify.readMarker is required for db verify", | ||
| fix: "Ensure family.verify.readMarker() is exported by your family package", | ||
| docsUrl: "https://prisma-next.dev/docs/cli/db-verify" | ||
| }); | ||
| } | ||
| /** | ||
| * JSON output format not supported. | ||
| */ | ||
| function errorJsonFormatNotSupported(options) { | ||
| return new CliStructuredError("4008", "Unsupported JSON format", { | ||
| domain: "CLI", | ||
| why: `The ${options.command} command does not support --json ${options.format}`, | ||
| fix: `Use --json ${options.supportedFormats.join(" or ")}, or omit --json for human output`, | ||
| meta: { | ||
| command: options.command, | ||
| format: options.format, | ||
| supportedFormats: options.supportedFormats | ||
| } | ||
| }); | ||
| } | ||
| /** | ||
| * Driver is required for DB-connected commands but not provided. | ||
| */ | ||
| function errorDriverRequired(options) { | ||
| return new CliStructuredError("4010", "Driver is required for DB-connected commands", { | ||
| domain: "CLI", | ||
| why: options?.why ?? "Config.driver is required for DB-connected commands", | ||
| fix: "Add a control-plane driver to prisma-next.config.ts (e.g. import a driver descriptor and set `driver: postgresDriver`)", | ||
| docsUrl: "https://prisma-next.dev/docs/cli/config" | ||
| }); | ||
| } | ||
| /** | ||
| * Contract requires extension packs that are not provided by config descriptors. | ||
| */ | ||
| function errorContractMissingExtensionPacks(options) { | ||
| const missing = [...options.missingExtensionPacks].sort(); | ||
| return new CliStructuredError("4011", "Missing extension packs in config", { | ||
| domain: "CLI", | ||
| why: missing.length === 1 ? `Contract requires extension pack '${missing[0]}', but CLI config does not provide a matching descriptor.` : `Contract requires extension packs ${missing.map((p) => `'${p}'`).join(", ")}, but CLI config does not provide matching descriptors.`, | ||
| fix: "Add the missing extension descriptors to `extensions` in prisma-next.config.ts", | ||
| docsUrl: "https://prisma-next.dev/docs/cli/config", | ||
| meta: { | ||
| missingExtensionPacks: missing, | ||
| providedComponentIds: [...options.providedComponentIds].sort() | ||
| } | ||
| }); | ||
| } | ||
| /** | ||
| * Migration planning failed due to conflicts. | ||
| */ | ||
| function errorMigrationPlanningFailed(options) { | ||
| const conflictSummaries = options.conflicts.map((c) => c.summary); | ||
| const computedWhy = options.why ?? conflictSummaries.join("\n"); | ||
| const conflictFixes = options.conflicts.map((c) => c.why).filter((why) => typeof why === "string"); | ||
| return new CliStructuredError("4020", "Migration planning failed", { | ||
| domain: "CLI", | ||
| why: computedWhy, | ||
| fix: conflictFixes.length > 0 ? conflictFixes.join("\n") : "Use `db verify --schema-only` to inspect conflicts, or ensure the database is empty", | ||
| meta: { conflicts: options.conflicts }, | ||
| docsUrl: "https://prisma-next.dev/docs/cli/db-init" | ||
| }); | ||
| } | ||
| /** | ||
| * Target does not support migrations (missing createPlanner/createRunner). | ||
| */ | ||
| function errorTargetMigrationNotSupported(options) { | ||
| return new CliStructuredError("4021", "Target does not support migrations", { | ||
| domain: "CLI", | ||
| why: options?.why ?? "The configured target does not provide migration planner/runner", | ||
| fix: "Select a target that provides migrations (it must export `target.migrations` for db init)", | ||
| docsUrl: "https://prisma-next.dev/docs/cli/db-init" | ||
| }); | ||
| } | ||
| /** | ||
| * Config validation error (missing required fields). | ||
| */ | ||
| function errorConfigValidation(field, options) { | ||
| return new CliStructuredError("4009", "Config validation error", { | ||
| domain: "CLI", | ||
| why: options?.why ?? `Config must have a "${field}" field`, | ||
| fix: "Check your prisma-next.config.ts and ensure all required fields are provided", | ||
| docsUrl: "https://prisma-next.dev/docs/cli/config" | ||
| }); | ||
| } | ||
| /** | ||
| * Generic unexpected error. | ||
| */ | ||
| function errorUnexpected(message, options) { | ||
| return new CliStructuredError("4999", "Unexpected error", { | ||
| domain: "CLI", | ||
| why: options?.why ?? message, | ||
| fix: options?.fix ?? "Check the error message and try again" | ||
| }); | ||
| } | ||
| //#endregion | ||
| export { errorContractMissingExtensionPacks as a, errorDriverRequired as c, errorJsonFormatNotSupported as d, errorMigrationPlanningFailed as f, errorUnexpected as h, errorContractConfigMissing as i, errorFamilyReadMarkerSqlRequired as l, errorTargetMigrationNotSupported as m, errorConfigFileNotFound as n, errorContractValidationFailed as o, errorQueryRunnerFactoryRequired as p, errorConfigValidation as r, errorDatabaseConnectionRequired as s, CliStructuredError as t, errorFileNotFound as u }; | ||
| //# sourceMappingURL=control-BHDp3kOD.mjs.map |
| {"version":3,"file":"control-BHDp3kOD.mjs","names":[],"sources":["../src/control.ts"],"sourcesContent":["/**\n * CLI error envelope for output formatting.\n * This is the serialized form of a CliStructuredError.\n */\nexport interface CliErrorEnvelope {\n readonly ok: false;\n readonly code: string;\n readonly domain: string;\n readonly severity: 'error' | 'warn' | 'info';\n readonly summary: string;\n readonly why: string | undefined;\n readonly fix: string | undefined;\n readonly where:\n | {\n readonly path: string | undefined;\n readonly line: number | undefined;\n }\n | undefined;\n readonly meta: Record<string, unknown> | undefined;\n readonly docsUrl: string | undefined;\n}\n\n/**\n * Minimal conflict data structure expected by CLI output.\n */\nexport interface CliErrorConflict {\n readonly kind: string;\n readonly summary: string;\n readonly why?: string;\n}\n\n/**\n * Structured CLI error that contains all information needed for error envelopes.\n * Call sites throw these errors with full context.\n */\nexport class CliStructuredError extends Error {\n readonly code: string;\n readonly domain: 'CLI' | 'RUN' | 'MIG';\n readonly severity: 'error' | 'warn' | 'info';\n readonly why: string | undefined;\n readonly fix: string | undefined;\n readonly where:\n | {\n readonly path: string | undefined;\n readonly line: number | undefined;\n }\n | undefined;\n readonly meta: Record<string, unknown> | undefined;\n readonly docsUrl: string | undefined;\n\n constructor(\n code: string,\n summary: string,\n options?: {\n readonly domain?: 'CLI' | 'RUN' | 'MIG';\n readonly severity?: 'error' | 'warn' | 'info';\n readonly why?: string;\n readonly fix?: string;\n readonly where?: { readonly path?: string; readonly line?: number };\n readonly meta?: Record<string, unknown>;\n readonly docsUrl?: string;\n },\n ) {\n super(summary);\n this.name = 'CliStructuredError';\n this.code = code;\n this.domain = options?.domain ?? 'CLI';\n this.severity = options?.severity ?? 'error';\n this.why = options?.why;\n this.fix = options?.fix === options?.why ? undefined : options?.fix;\n this.where = options?.where\n ? {\n path: options.where.path,\n line: options.where.line,\n }\n : undefined;\n this.meta = options?.meta;\n this.docsUrl = options?.docsUrl;\n }\n\n /**\n * Converts this error to a CLI error envelope for output formatting.\n */\n toEnvelope(): CliErrorEnvelope {\n const domainPrefixes = { CLI: 'PN-CLI-', RUN: 'PN-RUN-', MIG: 'PN-MIG-' } as const;\n const codePrefix = domainPrefixes[this.domain];\n return {\n ok: false as const,\n code: `${codePrefix}${this.code}`,\n domain: this.domain,\n severity: this.severity,\n summary: this.message,\n why: this.why,\n fix: this.fix,\n where: this.where,\n meta: this.meta,\n docsUrl: this.docsUrl,\n };\n }\n\n /**\n * Type guard to check if an error is a CliStructuredError.\n * Uses duck-typing to work across module boundaries where instanceof may fail.\n */\n static is(error: unknown): error is CliStructuredError {\n if (!(error instanceof Error)) {\n return false;\n }\n const candidate = error as CliStructuredError;\n return (\n candidate.name === 'CliStructuredError' &&\n typeof candidate.code === 'string' &&\n (candidate.domain === 'CLI' || candidate.domain === 'RUN' || candidate.domain === 'MIG') &&\n typeof candidate.toEnvelope === 'function'\n );\n }\n}\n\n// ============================================================================\n// Config Errors (PN-CLI-4001-4007)\n// ============================================================================\n\n/**\n * Config file not found or missing.\n */\nexport function errorConfigFileNotFound(\n configPath?: string,\n options?: {\n readonly why?: string;\n },\n): CliStructuredError {\n return new CliStructuredError('4001', 'Config file not found', {\n domain: 'CLI',\n ...(options?.why ? { why: options.why } : { why: 'Config file not found' }),\n fix: \"Run 'prisma-next init' to create a config file\",\n docsUrl: 'https://prisma-next.dev/docs/cli/config',\n ...(configPath ? { where: { path: configPath } } : {}),\n });\n}\n\n/**\n * Contract configuration missing from config.\n */\nexport function errorContractConfigMissing(options?: {\n readonly why?: string;\n}): CliStructuredError {\n return new CliStructuredError('4002', 'Contract configuration missing', {\n domain: 'CLI',\n why: options?.why ?? 'The contract configuration is required for emit',\n fix: 'Add contract configuration to your prisma-next.config.ts',\n docsUrl: 'https://prisma-next.dev/docs/cli/contract-emit',\n });\n}\n\n/**\n * Contract validation failed.\n */\nexport function errorContractValidationFailed(\n reason: string,\n options?: {\n readonly where?: { readonly path?: string; readonly line?: number };\n },\n): CliStructuredError {\n return new CliStructuredError('4003', 'Contract validation failed', {\n domain: 'CLI',\n why: reason,\n fix: 'Re-run `prisma-next contract emit`, or fix the contract file and try again',\n docsUrl: 'https://prisma-next.dev/docs/contracts',\n ...(options?.where ? { where: options.where } : {}),\n });\n}\n\n/**\n * File not found.\n */\nexport function errorFileNotFound(\n filePath: string,\n options?: {\n readonly why?: string;\n readonly fix?: string;\n readonly docsUrl?: string;\n },\n): CliStructuredError {\n return new CliStructuredError('4004', 'File not found', {\n domain: 'CLI',\n why: options?.why ?? `File not found: ${filePath}`,\n fix: options?.fix ?? 'Check that the file path is correct',\n where: { path: filePath },\n ...(options?.docsUrl ? { docsUrl: options.docsUrl } : {}),\n });\n}\n\n/**\n * Database connection is required but not provided.\n */\nexport function errorDatabaseConnectionRequired(options?: {\n readonly why?: string;\n readonly commandName?: string;\n readonly retryCommand?: string;\n}): CliStructuredError {\n const runHint = options?.retryCommand\n ? `Run \\`${options.retryCommand}\\``\n : options?.commandName\n ? `Run \\`prisma-next ${options.commandName} --db <url>\\``\n : 'Provide `--db <url>`';\n return new CliStructuredError('4005', 'Database connection is required', {\n domain: 'CLI',\n why: options?.why ?? 'Database connection is required for this command',\n fix: `${runHint}, or set \\`db: { connection: \"postgres://…\" }\\` in prisma-next.config.ts`,\n });\n}\n\n/**\n * Query runner factory is required but not provided in config.\n */\nexport function errorQueryRunnerFactoryRequired(options?: {\n readonly why?: string;\n}): CliStructuredError {\n return new CliStructuredError('4006', 'Query runner factory is required', {\n domain: 'CLI',\n why: options?.why ?? 'Config.db.queryRunnerFactory is required for db verify',\n fix: 'Add db.queryRunnerFactory to prisma-next.config.ts',\n docsUrl: 'https://prisma-next.dev/docs/cli/db-verify',\n });\n}\n\n/**\n * Family verify.readMarker is required but not provided.\n */\nexport function errorFamilyReadMarkerSqlRequired(options?: {\n readonly why?: string;\n}): CliStructuredError {\n return new CliStructuredError('4007', 'Family readMarker() is required', {\n domain: 'CLI',\n why: options?.why ?? 'Family verify.readMarker is required for db verify',\n fix: 'Ensure family.verify.readMarker() is exported by your family package',\n docsUrl: 'https://prisma-next.dev/docs/cli/db-verify',\n });\n}\n\n/**\n * JSON output format not supported.\n */\nexport function errorJsonFormatNotSupported(options: {\n readonly command: string;\n readonly format: string;\n readonly supportedFormats: readonly string[];\n}): CliStructuredError {\n return new CliStructuredError('4008', 'Unsupported JSON format', {\n domain: 'CLI',\n why: `The ${options.command} command does not support --json ${options.format}`,\n fix: `Use --json ${options.supportedFormats.join(' or ')}, or omit --json for human output`,\n meta: {\n command: options.command,\n format: options.format,\n supportedFormats: options.supportedFormats,\n },\n });\n}\n\n/**\n * Driver is required for DB-connected commands but not provided.\n */\nexport function errorDriverRequired(options?: { readonly why?: string }): CliStructuredError {\n return new CliStructuredError('4010', 'Driver is required for DB-connected commands', {\n domain: 'CLI',\n why: options?.why ?? 'Config.driver is required for DB-connected commands',\n fix: 'Add a control-plane driver to prisma-next.config.ts (e.g. import a driver descriptor and set `driver: postgresDriver`)',\n docsUrl: 'https://prisma-next.dev/docs/cli/config',\n });\n}\n\n/**\n * Contract requires extension packs that are not provided by config descriptors.\n */\nexport function errorContractMissingExtensionPacks(options: {\n readonly missingExtensionPacks: readonly string[];\n readonly providedComponentIds: readonly string[];\n}): CliStructuredError {\n const missing = [...options.missingExtensionPacks].sort();\n return new CliStructuredError('4011', 'Missing extension packs in config', {\n domain: 'CLI',\n why:\n missing.length === 1\n ? `Contract requires extension pack '${missing[0]}', but CLI config does not provide a matching descriptor.`\n : `Contract requires extension packs ${missing.map((p) => `'${p}'`).join(', ')}, but CLI config does not provide matching descriptors.`,\n fix: 'Add the missing extension descriptors to `extensions` in prisma-next.config.ts',\n docsUrl: 'https://prisma-next.dev/docs/cli/config',\n meta: {\n missingExtensionPacks: missing,\n providedComponentIds: [...options.providedComponentIds].sort(),\n },\n });\n}\n\n/**\n * Migration planning failed due to conflicts.\n */\nexport function errorMigrationPlanningFailed(options: {\n readonly conflicts: readonly CliErrorConflict[];\n readonly why?: string;\n}): CliStructuredError {\n const conflictSummaries = options.conflicts.map((c) => c.summary);\n const computedWhy = options.why ?? conflictSummaries.join('\\n');\n\n const conflictFixes = options.conflicts\n .map((c) => c.why)\n .filter((why): why is string => typeof why === 'string');\n const computedFix =\n conflictFixes.length > 0\n ? conflictFixes.join('\\n')\n : 'Use `db verify --schema-only` to inspect conflicts, or ensure the database is empty';\n\n return new CliStructuredError('4020', 'Migration planning failed', {\n domain: 'CLI',\n why: computedWhy,\n fix: computedFix,\n meta: { conflicts: options.conflicts },\n docsUrl: 'https://prisma-next.dev/docs/cli/db-init',\n });\n}\n\n/**\n * Target does not support migrations (missing createPlanner/createRunner).\n */\nexport function errorTargetMigrationNotSupported(options?: {\n readonly why?: string;\n}): CliStructuredError {\n return new CliStructuredError('4021', 'Target does not support migrations', {\n domain: 'CLI',\n why: options?.why ?? 'The configured target does not provide migration planner/runner',\n fix: 'Select a target that provides migrations (it must export `target.migrations` for db init)',\n docsUrl: 'https://prisma-next.dev/docs/cli/db-init',\n });\n}\n\n/**\n * Config validation error (missing required fields).\n */\nexport function errorConfigValidation(\n field: string,\n options?: {\n readonly why?: string;\n },\n): CliStructuredError {\n return new CliStructuredError('4009', 'Config validation error', {\n domain: 'CLI',\n why: options?.why ?? `Config must have a \"${field}\" field`,\n fix: 'Check your prisma-next.config.ts and ensure all required fields are provided',\n docsUrl: 'https://prisma-next.dev/docs/cli/config',\n });\n}\n\n// ============================================================================\n// Generic Error\n// ============================================================================\n\n/**\n * Generic unexpected error.\n */\nexport function errorUnexpected(\n message: string,\n options?: {\n readonly why?: string;\n readonly fix?: string;\n },\n): CliStructuredError {\n return new CliStructuredError('4999', 'Unexpected error', {\n domain: 'CLI',\n why: options?.why ?? message,\n fix: options?.fix ?? 'Check the error message and try again',\n });\n}\n"],"mappings":";;;;;AAmCA,IAAa,qBAAb,cAAwC,MAAM;CAC5C,AAAS;CACT,AAAS;CACT,AAAS;CACT,AAAS;CACT,AAAS;CACT,AAAS;CAMT,AAAS;CACT,AAAS;CAET,YACE,MACA,SACA,SASA;AACA,QAAM,QAAQ;AACd,OAAK,OAAO;AACZ,OAAK,OAAO;AACZ,OAAK,SAAS,SAAS,UAAU;AACjC,OAAK,WAAW,SAAS,YAAY;AACrC,OAAK,MAAM,SAAS;AACpB,OAAK,MAAM,SAAS,QAAQ,SAAS,MAAM,SAAY,SAAS;AAChE,OAAK,QAAQ,SAAS,QAClB;GACE,MAAM,QAAQ,MAAM;GACpB,MAAM,QAAQ,MAAM;GACrB,GACD;AACJ,OAAK,OAAO,SAAS;AACrB,OAAK,UAAU,SAAS;;;;;CAM1B,aAA+B;AAG7B,SAAO;GACL,IAAI;GACJ,MAAM,GAJe;IAAE,KAAK;IAAW,KAAK;IAAW,KAAK;IAAW,CACvC,KAAK,UAGf,KAAK;GAC3B,QAAQ,KAAK;GACb,UAAU,KAAK;GACf,SAAS,KAAK;GACd,KAAK,KAAK;GACV,KAAK,KAAK;GACV,OAAO,KAAK;GACZ,MAAM,KAAK;GACX,SAAS,KAAK;GACf;;;;;;CAOH,OAAO,GAAG,OAA6C;AACrD,MAAI,EAAE,iBAAiB,OACrB,QAAO;EAET,MAAM,YAAY;AAClB,SACE,UAAU,SAAS,wBACnB,OAAO,UAAU,SAAS,aACzB,UAAU,WAAW,SAAS,UAAU,WAAW,SAAS,UAAU,WAAW,UAClF,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Q,QAAuB,OAAO,QAAQ,SAAS;AAM1D,QAAO,IAAI,mBAAmB,QAAQ,6BAA6B;EACjE,QAAQ;EACR,KAAK;EACL,KAPA,cAAc,SAAS,IACnB,cAAc,KAAK,KAAK,GACxB;EAMJ,MAAM,EAAE,WAAW,QAAQ,WAAW;EACtC,SAAS;EACV,CAAC;;;;;AAMJ,SAAgB,iCAAiC,SAE1B;AACrB,QAAO,IAAI,mBAAmB,QAAQ,sCAAsC;EAC1E,QAAQ;EACR,KAAK,SAAS,OAAO;EACrB,KAAK;EACL,SAAS;EACV,CAAC;;;;;AAMJ,SAAgB,sBACd,OACA,SAGoB;AACpB,QAAO,IAAI,mBAAmB,QAAQ,2BAA2B;EAC/D,QAAQ;EACR,KAAK,SAAS,OAAO,uBAAuB,MAAM;EAClD,KAAK;EACL,SAAS;EACV,CAAC;;;;;AAUJ,SAAgB,gBACd,SACA,SAIoB;AACpB,QAAO,IAAI,mBAAmB,QAAQ,oBAAoB;EACxD,QAAQ;EACR,KAAK,SAAS,OAAO;EACrB,KAAK,SAAS,OAAO;EACtB,CAAC"} |
| //#region src/control.d.ts | ||
| /** | ||
| * CLI error envelope for output formatting. | ||
| * This is the serialized form of a CliStructuredError. | ||
| */ | ||
| interface CliErrorEnvelope { | ||
| readonly ok: false; | ||
| readonly code: string; | ||
| readonly domain: string; | ||
| readonly severity: 'error' | 'warn' | 'info'; | ||
| readonly summary: string; | ||
| readonly why: string | undefined; | ||
| readonly fix: string | undefined; | ||
| readonly where: { | ||
| readonly path: string | undefined; | ||
| readonly line: number | undefined; | ||
| } | undefined; | ||
| readonly meta: Record<string, unknown> | undefined; | ||
| readonly docsUrl: string | undefined; | ||
| } | ||
| /** | ||
| * Minimal conflict data structure expected by CLI output. | ||
| */ | ||
| interface CliErrorConflict { | ||
| readonly kind: string; | ||
| readonly summary: string; | ||
| readonly why?: string; | ||
| } | ||
| /** | ||
| * Structured CLI error that contains all information needed for error envelopes. | ||
| * Call sites throw these errors with full context. | ||
| */ | ||
| declare class CliStructuredError extends Error { | ||
| readonly code: string; | ||
| readonly domain: 'CLI' | 'RUN' | 'MIG'; | ||
| readonly severity: 'error' | 'warn' | 'info'; | ||
| readonly why: string | undefined; | ||
| readonly fix: string | undefined; | ||
| readonly where: { | ||
| readonly path: string | undefined; | ||
| readonly line: number | undefined; | ||
| } | undefined; | ||
| readonly meta: Record<string, unknown> | undefined; | ||
| readonly docsUrl: string | undefined; | ||
| constructor(code: string, summary: string, options?: { | ||
| readonly domain?: 'CLI' | 'RUN' | 'MIG'; | ||
| readonly severity?: 'error' | 'warn' | 'info'; | ||
| readonly why?: string; | ||
| readonly fix?: string; | ||
| readonly where?: { | ||
| readonly path?: string; | ||
| readonly line?: number; | ||
| }; | ||
| readonly meta?: Record<string, unknown>; | ||
| readonly docsUrl?: string; | ||
| }); | ||
| /** | ||
| * Converts this error to a CLI error envelope for output formatting. | ||
| */ | ||
| toEnvelope(): CliErrorEnvelope; | ||
| /** | ||
| * Type guard to check if an error is a CliStructuredError. | ||
| * Uses duck-typing to work across module boundaries where instanceof may fail. | ||
| */ | ||
| static is(error: unknown): error is CliStructuredError; | ||
| } | ||
| /** | ||
| * Config file not found or missing. | ||
| */ | ||
| declare function errorConfigFileNotFound(configPath?: string, options?: { | ||
| readonly why?: string; | ||
| }): CliStructuredError; | ||
| /** | ||
| * Contract configuration missing from config. | ||
| */ | ||
| declare function errorContractConfigMissing(options?: { | ||
| readonly why?: string; | ||
| }): CliStructuredError; | ||
| /** | ||
| * Contract validation failed. | ||
| */ | ||
| declare function errorContractValidationFailed(reason: string, options?: { | ||
| readonly where?: { | ||
| readonly path?: string; | ||
| readonly line?: number; | ||
| }; | ||
| }): CliStructuredError; | ||
| /** | ||
| * File not found. | ||
| */ | ||
| declare function errorFileNotFound(filePath: string, options?: { | ||
| readonly why?: string; | ||
| readonly fix?: string; | ||
| readonly docsUrl?: string; | ||
| }): CliStructuredError; | ||
| /** | ||
| * Database connection is required but not provided. | ||
| */ | ||
| declare function errorDatabaseConnectionRequired(options?: { | ||
| readonly why?: string; | ||
| readonly commandName?: string; | ||
| readonly retryCommand?: string; | ||
| }): CliStructuredError; | ||
| /** | ||
| * Query runner factory is required but not provided in config. | ||
| */ | ||
| declare function errorQueryRunnerFactoryRequired(options?: { | ||
| readonly why?: string; | ||
| }): CliStructuredError; | ||
| /** | ||
| * Family verify.readMarker is required but not provided. | ||
| */ | ||
| declare function errorFamilyReadMarkerSqlRequired(options?: { | ||
| readonly why?: string; | ||
| }): CliStructuredError; | ||
| /** | ||
| * JSON output format not supported. | ||
| */ | ||
| declare function errorJsonFormatNotSupported(options: { | ||
| readonly command: string; | ||
| readonly format: string; | ||
| readonly supportedFormats: readonly string[]; | ||
| }): CliStructuredError; | ||
| /** | ||
| * Driver is required for DB-connected commands but not provided. | ||
| */ | ||
| declare function errorDriverRequired(options?: { | ||
| readonly why?: string; | ||
| }): CliStructuredError; | ||
| /** | ||
| * Contract requires extension packs that are not provided by config descriptors. | ||
| */ | ||
| declare function errorContractMissingExtensionPacks(options: { | ||
| readonly missingExtensionPacks: readonly string[]; | ||
| readonly providedComponentIds: readonly string[]; | ||
| }): CliStructuredError; | ||
| /** | ||
| * Migration planning failed due to conflicts. | ||
| */ | ||
| declare function errorMigrationPlanningFailed(options: { | ||
| readonly conflicts: readonly CliErrorConflict[]; | ||
| readonly why?: string; | ||
| }): CliStructuredError; | ||
| /** | ||
| * Target does not support migrations (missing createPlanner/createRunner). | ||
| */ | ||
| declare function errorTargetMigrationNotSupported(options?: { | ||
| readonly why?: string; | ||
| }): CliStructuredError; | ||
| /** | ||
| * Config validation error (missing required fields). | ||
| */ | ||
| declare function errorConfigValidation(field: string, options?: { | ||
| readonly why?: string; | ||
| }): CliStructuredError; | ||
| /** | ||
| * Generic unexpected error. | ||
| */ | ||
| declare function errorUnexpected(message: string, options?: { | ||
| readonly why?: string; | ||
| readonly fix?: string; | ||
| }): CliStructuredError; | ||
| //#endregion | ||
| export { errorUnexpected as _, errorConfigValidation as a, errorContractValidationFailed as c, errorFamilyReadMarkerSqlRequired as d, errorFileNotFound as f, errorTargetMigrationNotSupported as g, errorQueryRunnerFactoryRequired as h, errorConfigFileNotFound as i, errorDatabaseConnectionRequired as l, errorMigrationPlanningFailed as m, CliErrorEnvelope as n, errorContractConfigMissing as o, errorJsonFormatNotSupported as p, CliStructuredError as r, errorContractMissingExtensionPacks as s, CliErrorConflict as t, errorDriverRequired as u }; | ||
| //# sourceMappingURL=control-C16uWwh2.d.mts.map |
| {"version":3,"file":"control-C16uWwh2.d.mts","names":[],"sources":["../src/control.ts"],"sourcesContent":[],"mappings":";;AAIA;AAqBA;AAUA;AAYiB,UA3CA,gBAAA,CA2CA;EAYK,SAAA,EAAA,EAAA,KAAA;EAwBN,SAAA,IAAA,EAAA,MAAA;EAqBsB,SAAA,MAAA,EAAA,MAAA;EArEE,SAAA,QAAA,EAAA,OAAA,GAAA,MAAA,GAAA,MAAA;EAAK,SAAA,OAAA,EAAA,MAAA;EA0F7B,SAAA,GAAA,EAAA,MAAA,GAAA,SAAuB;EAkBvB,SAAA,GAAA,EAAA,MAAA,GAAA,SAA0B;EAc1B,SAAA,KAAA,EAAA;IAkBA,SAAA,IAAA,EAAA,MAAiB,GAAA,SAO9B;IAaa,SAAA,IAAA,EAAA,MAAA,GAAA,SAA+B;EAoB/B,CAAA,GAAA,SAAA;EAcA,SAAA,IAAA,EAnNC,MAmND,CAAA,MAAA,EAAA,OAAgC,CAAA,GAAA,SAE5C;EAYY,SAAA,OAAA,EAAA,MAAA,GAAA,SAA2B;AAoB3C;AAYA;AAuBA;AA2BA;AAcgB,UA1TC,gBAAA,CA0ToB;EAqBrB,SAAA,IAAA,EAAA,MAAe;;;;;;;;cArUlB,kBAAA,SAA2B,KAAA;;;;;;;;;;iBAYvB;;;;;;;;;;;oBAYK;;;;;;gBAwBN;;;;;sCAqBsB;;;;;iBAqBtB,uBAAA;;IAKb;;;;iBAaa,0BAAA;;IAEZ;;;;iBAYY,6BAAA;;;;;IAKb;;;;iBAaa,iBAAA;;;;IAOb;;;;iBAaa,+BAAA;;;;IAIZ;;;;iBAgBY,+BAAA;;IAEZ;;;;iBAYY,gCAAA;;IAEZ;;;;iBAYY,2BAAA;;;;IAIZ;;;;iBAgBY,mBAAA;;IAA0D;;;;iBAY1D,kCAAA;;;IAGZ;;;;iBAoBY,4BAAA;+BACe;;IAE3B;;;;iBAwBY,gCAAA;;IAEZ;;;;iBAYY,qBAAA;;IAKb;;;;iBAgBa,eAAA;;;IAMb"} |
| import { r as CliStructuredError } from "./control-C16uWwh2.mjs"; | ||
| //#region src/migration.d.ts | ||
| /** | ||
| * `migration.ts` was expected at the given package directory but could not be | ||
| * located. Thrown by `emitMigration` (and, as a belt-and-suspenders, by | ||
| * class-flow `emit` capabilities) when the file is missing. | ||
| */ | ||
| declare function errorMigrationFileMissing(dir: string): CliStructuredError; | ||
| /** | ||
| * The `migration.ts` at the given package directory does not default-export a | ||
| * valid migration shape. Two shapes are accepted: a `Migration` subclass, or a | ||
| * factory function returning an object with a `plan()` method. Thrown when the | ||
| * default export is missing, is not a constructor/function, does not extend | ||
| * `Migration`, or (for factory functions) returns a value without `plan()`. | ||
| */ | ||
| declare function errorMigrationInvalidDefaultExport(dir: string, actualExportDescription?: string): CliStructuredError; | ||
| /** | ||
| * A class-flow `Migration.plan()` returned a value that is not an array. Used | ||
| * by class-flow emit capabilities after instantiating the authored migration. | ||
| */ | ||
| declare function errorMigrationPlanNotArray(dir: string, actualValueDescription?: string): CliStructuredError; | ||
| //#endregion | ||
| export { errorMigrationFileMissing, errorMigrationInvalidDefaultExport, errorMigrationPlanNotArray }; | ||
| //# sourceMappingURL=migration.d.mts.map |
| {"version":3,"file":"migration.d.mts","names":[],"sources":["../src/migration.ts"],"sourcesContent":[],"mappings":";;;;;;AAgBA;AAgBA;AAsBA;iBAtCgB,yBAAA,eAAwC;;;;;;;;iBAgBxC,kCAAA,iDAGb;;;;;iBAmBa,0BAAA,gDAGb"} |
| import { t as CliStructuredError } from "./control-BHDp3kOD.mjs"; | ||
| //#region src/migration.ts | ||
| /** | ||
| * `migration.ts` was expected at the given package directory but could not be | ||
| * located. Thrown by `emitMigration` (and, as a belt-and-suspenders, by | ||
| * class-flow `emit` capabilities) when the file is missing. | ||
| */ | ||
| function errorMigrationFileMissing(dir) { | ||
| return new CliStructuredError("2002", "migration.ts not found", { | ||
| domain: "MIG", | ||
| why: `No migration.ts file was found at "${dir}"`, | ||
| fix: "Scaffold one with `prisma-next migration new` or `prisma-next migration plan`.", | ||
| meta: { dir } | ||
| }); | ||
| } | ||
| /** | ||
| * The `migration.ts` at the given package directory does not default-export a | ||
| * valid migration shape. Two shapes are accepted: a `Migration` subclass, or a | ||
| * factory function returning an object with a `plan()` method. Thrown when the | ||
| * default export is missing, is not a constructor/function, does not extend | ||
| * `Migration`, or (for factory functions) returns a value without `plan()`. | ||
| */ | ||
| function errorMigrationInvalidDefaultExport(dir, actualExportDescription) { | ||
| return new CliStructuredError("2003", "migration.ts default export is not a valid migration", { | ||
| domain: "MIG", | ||
| why: actualExportDescription !== void 0 ? `migration.ts at "${dir}" must default-export a Migration subclass or a factory function returning { plan() }; got ${actualExportDescription}` : `migration.ts at "${dir}" must default-export a Migration subclass or a factory function returning { plan() }.`, | ||
| fix: "Use `export default class extends Migration { ... }` or `export default () => ({ plan() { return [...] } })`.", | ||
| meta: { | ||
| dir, | ||
| ...actualExportDescription !== void 0 ? { actualExport: actualExportDescription } : {} | ||
| } | ||
| }); | ||
| } | ||
| /** | ||
| * A class-flow `Migration.plan()` returned a value that is not an array. Used | ||
| * by class-flow emit capabilities after instantiating the authored migration. | ||
| */ | ||
| function errorMigrationPlanNotArray(dir, actualValueDescription) { | ||
| return new CliStructuredError("2004", "Migration.plan() must return an array of operations", { | ||
| domain: "MIG", | ||
| why: actualValueDescription !== void 0 ? `Migration.plan() for migration.ts at "${dir}" returned ${actualValueDescription}; an array of operations is required.` : `Migration.plan() for migration.ts at "${dir}" did not return an array of operations.`, | ||
| fix: "Ensure your `plan()` method returns an array of operations; see the data-migrations authoring guide.", | ||
| meta: { | ||
| dir, | ||
| ...actualValueDescription !== void 0 ? { actualValue: actualValueDescription } : {} | ||
| } | ||
| }); | ||
| } | ||
| //#endregion | ||
| export { errorMigrationFileMissing, errorMigrationInvalidDefaultExport, errorMigrationPlanNotArray }; | ||
| //# sourceMappingURL=migration.mjs.map |
| {"version":3,"file":"migration.mjs","names":[],"sources":["../src/migration.ts"],"sourcesContent":["import { CliStructuredError } from './control';\n\n// ============================================================================\n// Migration Errors (PN-MIG-2000-2999)\n//\n// Errors raised by the migration subsystem (authoring, planning, emit).\n// Domain `MIG` distinguishes these from generic application runtime errors\n// (`RUN`) and from CLI argument/config errors (`CLI`). See\n// `docs/CLI Style Guide.md` for the canonical domain taxonomy.\n// ============================================================================\n\n/**\n * `migration.ts` was expected at the given package directory but could not be\n * located. Thrown by `emitMigration` (and, as a belt-and-suspenders, by\n * class-flow `emit` capabilities) when the file is missing.\n */\nexport function errorMigrationFileMissing(dir: string): CliStructuredError {\n return new CliStructuredError('2002', 'migration.ts not found', {\n domain: 'MIG',\n why: `No migration.ts file was found at \"${dir}\"`,\n fix: 'Scaffold one with `prisma-next migration new` or `prisma-next migration plan`.',\n meta: { dir },\n });\n}\n\n/**\n * The `migration.ts` at the given package directory does not default-export a\n * valid migration shape. Two shapes are accepted: a `Migration` subclass, or a\n * factory function returning an object with a `plan()` method. Thrown when the\n * default export is missing, is not a constructor/function, does not extend\n * `Migration`, or (for factory functions) returns a value without `plan()`.\n */\nexport function errorMigrationInvalidDefaultExport(\n dir: string,\n actualExportDescription?: string,\n): CliStructuredError {\n return new CliStructuredError('2003', 'migration.ts default export is not a valid migration', {\n domain: 'MIG',\n why:\n actualExportDescription !== undefined\n ? `migration.ts at \"${dir}\" must default-export a Migration subclass or a factory function returning { plan() }; got ${actualExportDescription}`\n : `migration.ts at \"${dir}\" must default-export a Migration subclass or a factory function returning { plan() }.`,\n fix: 'Use `export default class extends Migration { ... }` or `export default () => ({ plan() { return [...] } })`.',\n meta: {\n dir,\n ...(actualExportDescription !== undefined ? { actualExport: actualExportDescription } : {}),\n },\n });\n}\n\n/**\n * A class-flow `Migration.plan()` returned a value that is not an array. Used\n * by class-flow emit capabilities after instantiating the authored migration.\n */\nexport function errorMigrationPlanNotArray(\n dir: string,\n actualValueDescription?: string,\n): CliStructuredError {\n return new CliStructuredError('2004', 'Migration.plan() must return an array of operations', {\n domain: 'MIG',\n why:\n actualValueDescription !== undefined\n ? `Migration.plan() for migration.ts at \"${dir}\" returned ${actualValueDescription}; an array of operations is required.`\n : `Migration.plan() for migration.ts at \"${dir}\" did not return an array of operations.`,\n fix: 'Ensure your `plan()` method returns an array of operations; see the data-migrations authoring guide.',\n meta: {\n dir,\n ...(actualValueDescription !== undefined ? { actualValue: actualValueDescription } : {}),\n },\n });\n}\n"],"mappings":";;;;;;;;AAgBA,SAAgB,0BAA0B,KAAiC;AACzE,QAAO,IAAI,mBAAmB,QAAQ,0BAA0B;EAC9D,QAAQ;EACR,KAAK,sCAAsC,IAAI;EAC/C,KAAK;EACL,MAAM,EAAE,KAAK;EACd,CAAC;;;;;;;;;AAUJ,SAAgB,mCACd,KACA,yBACoB;AACpB,QAAO,IAAI,mBAAmB,QAAQ,wDAAwD;EAC5F,QAAQ;EACR,KACE,4BAA4B,SACxB,oBAAoB,IAAI,6FAA6F,4BACrH,oBAAoB,IAAI;EAC9B,KAAK;EACL,MAAM;GACJ;GACA,GAAI,4BAA4B,SAAY,EAAE,cAAc,yBAAyB,GAAG,EAAE;GAC3F;EACF,CAAC;;;;;;AAOJ,SAAgB,2BACd,KACA,wBACoB;AACpB,QAAO,IAAI,mBAAmB,QAAQ,uDAAuD;EAC3F,QAAQ;EACR,KACE,2BAA2B,SACvB,yCAAyC,IAAI,aAAa,uBAAuB,yCACjF,yCAAyC,IAAI;EACnD,KAAK;EACL,MAAM;GACJ;GACA,GAAI,2BAA2B,SAAY,EAAE,aAAa,wBAAwB,GAAG,EAAE;GACxF;EACF,CAAC"} |
| export { | ||
| errorMigrationFileMissing, | ||
| errorMigrationInvalidDefaultExport, | ||
| errorMigrationPlanNotArray, | ||
| } from '../migration'; |
| import { CliStructuredError } from './control'; | ||
| // ============================================================================ | ||
| // Migration Errors (PN-MIG-2000-2999) | ||
| // | ||
| // Errors raised by the migration subsystem (authoring, planning, emit). | ||
| // Domain `MIG` distinguishes these from generic application runtime errors | ||
| // (`RUN`) and from CLI argument/config errors (`CLI`). See | ||
| // `docs/CLI Style Guide.md` for the canonical domain taxonomy. | ||
| // ============================================================================ | ||
| /** | ||
| * `migration.ts` was expected at the given package directory but could not be | ||
| * located. Thrown by `emitMigration` (and, as a belt-and-suspenders, by | ||
| * class-flow `emit` capabilities) when the file is missing. | ||
| */ | ||
| export function errorMigrationFileMissing(dir: string): CliStructuredError { | ||
| return new CliStructuredError('2002', 'migration.ts not found', { | ||
| domain: 'MIG', | ||
| why: `No migration.ts file was found at "${dir}"`, | ||
| fix: 'Scaffold one with `prisma-next migration new` or `prisma-next migration plan`.', | ||
| meta: { dir }, | ||
| }); | ||
| } | ||
| /** | ||
| * The `migration.ts` at the given package directory does not default-export a | ||
| * valid migration shape. Two shapes are accepted: a `Migration` subclass, or a | ||
| * factory function returning an object with a `plan()` method. Thrown when the | ||
| * default export is missing, is not a constructor/function, does not extend | ||
| * `Migration`, or (for factory functions) returns a value without `plan()`. | ||
| */ | ||
| export function errorMigrationInvalidDefaultExport( | ||
| dir: string, | ||
| actualExportDescription?: string, | ||
| ): CliStructuredError { | ||
| return new CliStructuredError('2003', 'migration.ts default export is not a valid migration', { | ||
| domain: 'MIG', | ||
| why: | ||
| actualExportDescription !== undefined | ||
| ? `migration.ts at "${dir}" must default-export a Migration subclass or a factory function returning { plan() }; got ${actualExportDescription}` | ||
| : `migration.ts at "${dir}" must default-export a Migration subclass or a factory function returning { plan() }.`, | ||
| fix: 'Use `export default class extends Migration { ... }` or `export default () => ({ plan() { return [...] } })`.', | ||
| meta: { | ||
| dir, | ||
| ...(actualExportDescription !== undefined ? { actualExport: actualExportDescription } : {}), | ||
| }, | ||
| }); | ||
| } | ||
| /** | ||
| * A class-flow `Migration.plan()` returned a value that is not an array. Used | ||
| * by class-flow emit capabilities after instantiating the authored migration. | ||
| */ | ||
| export function errorMigrationPlanNotArray( | ||
| dir: string, | ||
| actualValueDescription?: string, | ||
| ): CliStructuredError { | ||
| return new CliStructuredError('2004', 'Migration.plan() must return an array of operations', { | ||
| domain: 'MIG', | ||
| why: | ||
| actualValueDescription !== undefined | ||
| ? `Migration.plan() for migration.ts at "${dir}" returned ${actualValueDescription}; an array of operations is required.` | ||
| : `Migration.plan() for migration.ts at "${dir}" did not return an array of operations.`, | ||
| fix: 'Ensure your `plan()` method returns an array of operations; see the data-migrations authoring guide.', | ||
| meta: { | ||
| dir, | ||
| ...(actualValueDescription !== undefined ? { actualValue: actualValueDescription } : {}), | ||
| }, | ||
| }); | ||
| } |
@@ -1,2 +0,2 @@ | ||
| import { _ as errorUnexpected, a as errorConfigValidation, c as errorContractValidationFailed, d as errorFamilyReadMarkerSqlRequired, f as errorFileNotFound, g as errorTargetMigrationNotSupported, h as errorQueryRunnerFactoryRequired, i as errorConfigFileNotFound, l as errorDatabaseConnectionRequired, m as errorMigrationPlanningFailed, n as CliErrorEnvelope, o as errorContractConfigMissing, p as errorJsonFormatNotSupported, r as CliStructuredError, s as errorContractMissingExtensionPacks, t as CliErrorConflict, u as errorDriverRequired } from "./control-DJG12d3Q.mjs"; | ||
| import { _ as errorUnexpected, a as errorConfigValidation, c as errorContractValidationFailed, d as errorFamilyReadMarkerSqlRequired, f as errorFileNotFound, g as errorTargetMigrationNotSupported, h as errorQueryRunnerFactoryRequired, i as errorConfigFileNotFound, l as errorDatabaseConnectionRequired, m as errorMigrationPlanningFailed, n as CliErrorEnvelope, o as errorContractConfigMissing, p as errorJsonFormatNotSupported, r as CliStructuredError, s as errorContractMissingExtensionPacks, t as CliErrorConflict, u as errorDriverRequired } from "./control-C16uWwh2.mjs"; | ||
| export { type CliErrorConflict, type CliErrorEnvelope, CliStructuredError, errorConfigFileNotFound, errorConfigValidation, errorContractConfigMissing, errorContractMissingExtensionPacks, errorContractValidationFailed, errorDatabaseConnectionRequired, errorDriverRequired, errorFamilyReadMarkerSqlRequired, errorFileNotFound, errorJsonFormatNotSupported, errorMigrationPlanningFailed, errorQueryRunnerFactoryRequired, errorTargetMigrationNotSupported, errorUnexpected }; |
+1
-1
@@ -1,3 +0,3 @@ | ||
| import { a as errorContractMissingExtensionPacks, c as errorDriverRequired, d as errorJsonFormatNotSupported, f as errorMigrationPlanningFailed, h as errorUnexpected, i as errorContractConfigMissing, l as errorFamilyReadMarkerSqlRequired, m as errorTargetMigrationNotSupported, n as errorConfigFileNotFound, o as errorContractValidationFailed, p as errorQueryRunnerFactoryRequired, r as errorConfigValidation, s as errorDatabaseConnectionRequired, t as CliStructuredError, u as errorFileNotFound } from "./control-Dl5V1Wc7.mjs"; | ||
| import { a as errorContractMissingExtensionPacks, c as errorDriverRequired, d as errorJsonFormatNotSupported, f as errorMigrationPlanningFailed, h as errorUnexpected, i as errorContractConfigMissing, l as errorFamilyReadMarkerSqlRequired, m as errorTargetMigrationNotSupported, n as errorConfigFileNotFound, o as errorContractValidationFailed, p as errorQueryRunnerFactoryRequired, r as errorConfigValidation, s as errorDatabaseConnectionRequired, t as CliStructuredError, u as errorFileNotFound } from "./control-BHDp3kOD.mjs"; | ||
| export { CliStructuredError, errorConfigFileNotFound, errorConfigValidation, errorContractConfigMissing, errorContractMissingExtensionPacks, errorContractValidationFailed, errorDatabaseConnectionRequired, errorDriverRequired, errorFamilyReadMarkerSqlRequired, errorFileNotFound, errorJsonFormatNotSupported, errorMigrationPlanningFailed, errorQueryRunnerFactoryRequired, errorTargetMigrationNotSupported, errorUnexpected }; |
@@ -1,2 +0,2 @@ | ||
| import { r as CliStructuredError } from "./control-DJG12d3Q.mjs"; | ||
| import { r as CliStructuredError } from "./control-C16uWwh2.mjs"; | ||
| import { SchemaIssue, VerifyDatabaseSchemaResult } from "@prisma-next/framework-components/control"; | ||
@@ -3,0 +3,0 @@ |
@@ -1,2 +0,2 @@ | ||
| import { t as CliStructuredError } from "./control-Dl5V1Wc7.mjs"; | ||
| import { t as CliStructuredError } from "./control-BHDp3kOD.mjs"; | ||
| import { ifDefined } from "@prisma-next/utils/defined"; | ||
@@ -3,0 +3,0 @@ |
+4
-3
| { | ||
| "name": "@prisma-next/errors", | ||
| "version": "0.4.0-dev.5", | ||
| "version": "0.4.0-dev.6", | ||
| "type": "module", | ||
@@ -8,4 +8,4 @@ "sideEffects": false, | ||
| "dependencies": { | ||
| "@prisma-next/framework-components": "0.4.0-dev.5", | ||
| "@prisma-next/utils": "0.4.0-dev.5" | ||
| "@prisma-next/utils": "0.4.0-dev.6", | ||
| "@prisma-next/framework-components": "0.4.0-dev.6" | ||
| }, | ||
@@ -29,2 +29,3 @@ "devDependencies": { | ||
| "./execution": "./dist/execution.mjs", | ||
| "./migration": "./dist/migration.mjs", | ||
| "./package.json": "./package.json" | ||
@@ -31,0 +32,0 @@ }, |
+5
-4
@@ -38,3 +38,3 @@ /** | ||
| readonly code: string; | ||
| readonly domain: 'CLI' | 'RUN'; | ||
| readonly domain: 'CLI' | 'RUN' | 'MIG'; | ||
| readonly severity: 'error' | 'warn' | 'info'; | ||
@@ -56,3 +56,3 @@ readonly why: string | undefined; | ||
| options?: { | ||
| readonly domain?: 'CLI' | 'RUN'; | ||
| readonly domain?: 'CLI' | 'RUN' | 'MIG'; | ||
| readonly severity?: 'error' | 'warn' | 'info'; | ||
@@ -87,3 +87,4 @@ readonly why?: string; | ||
| toEnvelope(): CliErrorEnvelope { | ||
| const codePrefix = this.domain === 'CLI' ? 'PN-CLI-' : 'PN-RUN-'; | ||
| const domainPrefixes = { CLI: 'PN-CLI-', RUN: 'PN-RUN-', MIG: 'PN-MIG-' } as const; | ||
| const codePrefix = domainPrefixes[this.domain]; | ||
| return { | ||
@@ -115,3 +116,3 @@ ok: false as const, | ||
| typeof candidate.code === 'string' && | ||
| (candidate.domain === 'CLI' || candidate.domain === 'RUN') && | ||
| (candidate.domain === 'CLI' || candidate.domain === 'RUN' || candidate.domain === 'MIG') && | ||
| typeof candidate.toEnvelope === 'function' | ||
@@ -118,0 +119,0 @@ ); |
| //#region src/control.d.ts | ||
| /** | ||
| * CLI error envelope for output formatting. | ||
| * This is the serialized form of a CliStructuredError. | ||
| */ | ||
| interface CliErrorEnvelope { | ||
| readonly ok: false; | ||
| readonly code: string; | ||
| readonly domain: string; | ||
| readonly severity: 'error' | 'warn' | 'info'; | ||
| readonly summary: string; | ||
| readonly why: string | undefined; | ||
| readonly fix: string | undefined; | ||
| readonly where: { | ||
| readonly path: string | undefined; | ||
| readonly line: number | undefined; | ||
| } | undefined; | ||
| readonly meta: Record<string, unknown> | undefined; | ||
| readonly docsUrl: string | undefined; | ||
| } | ||
| /** | ||
| * Minimal conflict data structure expected by CLI output. | ||
| */ | ||
| interface CliErrorConflict { | ||
| readonly kind: string; | ||
| readonly summary: string; | ||
| readonly why?: string; | ||
| } | ||
| /** | ||
| * Structured CLI error that contains all information needed for error envelopes. | ||
| * Call sites throw these errors with full context. | ||
| */ | ||
| declare class CliStructuredError extends Error { | ||
| readonly code: string; | ||
| readonly domain: 'CLI' | 'RUN'; | ||
| readonly severity: 'error' | 'warn' | 'info'; | ||
| readonly why: string | undefined; | ||
| readonly fix: string | undefined; | ||
| readonly where: { | ||
| readonly path: string | undefined; | ||
| readonly line: number | undefined; | ||
| } | undefined; | ||
| readonly meta: Record<string, unknown> | undefined; | ||
| readonly docsUrl: string | undefined; | ||
| constructor(code: string, summary: string, options?: { | ||
| readonly domain?: 'CLI' | 'RUN'; | ||
| readonly severity?: 'error' | 'warn' | 'info'; | ||
| readonly why?: string; | ||
| readonly fix?: string; | ||
| readonly where?: { | ||
| readonly path?: string; | ||
| readonly line?: number; | ||
| }; | ||
| readonly meta?: Record<string, unknown>; | ||
| readonly docsUrl?: string; | ||
| }); | ||
| /** | ||
| * Converts this error to a CLI error envelope for output formatting. | ||
| */ | ||
| toEnvelope(): CliErrorEnvelope; | ||
| /** | ||
| * Type guard to check if an error is a CliStructuredError. | ||
| * Uses duck-typing to work across module boundaries where instanceof may fail. | ||
| */ | ||
| static is(error: unknown): error is CliStructuredError; | ||
| } | ||
| /** | ||
| * Config file not found or missing. | ||
| */ | ||
| declare function errorConfigFileNotFound(configPath?: string, options?: { | ||
| readonly why?: string; | ||
| }): CliStructuredError; | ||
| /** | ||
| * Contract configuration missing from config. | ||
| */ | ||
| declare function errorContractConfigMissing(options?: { | ||
| readonly why?: string; | ||
| }): CliStructuredError; | ||
| /** | ||
| * Contract validation failed. | ||
| */ | ||
| declare function errorContractValidationFailed(reason: string, options?: { | ||
| readonly where?: { | ||
| readonly path?: string; | ||
| readonly line?: number; | ||
| }; | ||
| }): CliStructuredError; | ||
| /** | ||
| * File not found. | ||
| */ | ||
| declare function errorFileNotFound(filePath: string, options?: { | ||
| readonly why?: string; | ||
| readonly fix?: string; | ||
| readonly docsUrl?: string; | ||
| }): CliStructuredError; | ||
| /** | ||
| * Database connection is required but not provided. | ||
| */ | ||
| declare function errorDatabaseConnectionRequired(options?: { | ||
| readonly why?: string; | ||
| readonly commandName?: string; | ||
| readonly retryCommand?: string; | ||
| }): CliStructuredError; | ||
| /** | ||
| * Query runner factory is required but not provided in config. | ||
| */ | ||
| declare function errorQueryRunnerFactoryRequired(options?: { | ||
| readonly why?: string; | ||
| }): CliStructuredError; | ||
| /** | ||
| * Family verify.readMarker is required but not provided. | ||
| */ | ||
| declare function errorFamilyReadMarkerSqlRequired(options?: { | ||
| readonly why?: string; | ||
| }): CliStructuredError; | ||
| /** | ||
| * JSON output format not supported. | ||
| */ | ||
| declare function errorJsonFormatNotSupported(options: { | ||
| readonly command: string; | ||
| readonly format: string; | ||
| readonly supportedFormats: readonly string[]; | ||
| }): CliStructuredError; | ||
| /** | ||
| * Driver is required for DB-connected commands but not provided. | ||
| */ | ||
| declare function errorDriverRequired(options?: { | ||
| readonly why?: string; | ||
| }): CliStructuredError; | ||
| /** | ||
| * Contract requires extension packs that are not provided by config descriptors. | ||
| */ | ||
| declare function errorContractMissingExtensionPacks(options: { | ||
| readonly missingExtensionPacks: readonly string[]; | ||
| readonly providedComponentIds: readonly string[]; | ||
| }): CliStructuredError; | ||
| /** | ||
| * Migration planning failed due to conflicts. | ||
| */ | ||
| declare function errorMigrationPlanningFailed(options: { | ||
| readonly conflicts: readonly CliErrorConflict[]; | ||
| readonly why?: string; | ||
| }): CliStructuredError; | ||
| /** | ||
| * Target does not support migrations (missing createPlanner/createRunner). | ||
| */ | ||
| declare function errorTargetMigrationNotSupported(options?: { | ||
| readonly why?: string; | ||
| }): CliStructuredError; | ||
| /** | ||
| * Config validation error (missing required fields). | ||
| */ | ||
| declare function errorConfigValidation(field: string, options?: { | ||
| readonly why?: string; | ||
| }): CliStructuredError; | ||
| /** | ||
| * Generic unexpected error. | ||
| */ | ||
| declare function errorUnexpected(message: string, options?: { | ||
| readonly why?: string; | ||
| readonly fix?: string; | ||
| }): CliStructuredError; | ||
| //#endregion | ||
| export { errorUnexpected as _, errorConfigValidation as a, errorContractValidationFailed as c, errorFamilyReadMarkerSqlRequired as d, errorFileNotFound as f, errorTargetMigrationNotSupported as g, errorQueryRunnerFactoryRequired as h, errorConfigFileNotFound as i, errorDatabaseConnectionRequired as l, errorMigrationPlanningFailed as m, CliErrorEnvelope as n, errorContractConfigMissing as o, errorJsonFormatNotSupported as p, CliStructuredError as r, errorContractMissingExtensionPacks as s, CliErrorConflict as t, errorDriverRequired as u }; | ||
| //# sourceMappingURL=control-DJG12d3Q.d.mts.map |
| {"version":3,"file":"control-DJG12d3Q.d.mts","names":[],"sources":["../src/control.ts"],"sourcesContent":[],"mappings":";;AAIA;AAqBA;AAUA;AAYiB,UA3CA,gBAAA,CA2CA;EAYK,SAAA,EAAA,EAAA,KAAA;EAwBN,SAAA,IAAA,EAAA,MAAA;EAoBsB,SAAA,MAAA,EAAA,MAAA;EApEE,SAAA,QAAA,EAAA,OAAA,GAAA,MAAA,GAAA,MAAA;EAAK,SAAA,OAAA,EAAA,MAAA;EAyF7B,SAAA,GAAA,EAAA,MAAA,GAAA,SAAuB;EAkBvB,SAAA,GAAA,EAAA,MAAA,GAAA,SAA0B;EAc1B,SAAA,KAAA,EAAA;IAkBA,SAAA,IAAA,EAAA,MAAiB,GAAA,SAO9B;IAaa,SAAA,IAAA,EAAA,MAAA,GAAA,SAA+B;EAoB/B,CAAA,GAAA,SAAA;EAcA,SAAA,IAAA,EAlNC,MAkND,CAAA,MAAA,EAAA,OAAgC,CAAA,GAAA,SAE5C;EAYY,SAAA,OAAA,EAAA,MAAA,GAAA,SAA2B;AAoB3C;AAYA;AAuBA;AA2BA;AAcgB,UAzTC,gBAAA,CAyToB;EAqBrB,SAAA,IAAA,EAAA,MAAe;;;;;;;;cApUlB,kBAAA,SAA2B,KAAA;;;;;;;;;;iBAYvB;;;;;;;;;;;oBAYK;;;;;;gBAwBN;;;;;sCAoBsB;;;;;iBAqBtB,uBAAA;;IAKb;;;;iBAaa,0BAAA;;IAEZ;;;;iBAYY,6BAAA;;;;;IAKb;;;;iBAaa,iBAAA;;;;IAOb;;;;iBAaa,+BAAA;;;;IAIZ;;;;iBAgBY,+BAAA;;IAEZ;;;;iBAYY,gCAAA;;IAEZ;;;;iBAYY,2BAAA;;;;IAIZ;;;;iBAgBY,mBAAA;;IAA0D;;;;iBAY1D,kCAAA;;;IAGZ;;;;iBAoBY,4BAAA;+BACe;;IAE3B;;;;iBAwBY,gCAAA;;IAEZ;;;;iBAYY,qBAAA;;IAKb;;;;iBAgBa,eAAA;;;IAMb"} |
| //#region src/control.ts | ||
| /** | ||
| * Structured CLI error that contains all information needed for error envelopes. | ||
| * Call sites throw these errors with full context. | ||
| */ | ||
| var CliStructuredError = class extends Error { | ||
| code; | ||
| domain; | ||
| severity; | ||
| why; | ||
| fix; | ||
| where; | ||
| meta; | ||
| docsUrl; | ||
| constructor(code, summary, options) { | ||
| super(summary); | ||
| this.name = "CliStructuredError"; | ||
| this.code = code; | ||
| this.domain = options?.domain ?? "CLI"; | ||
| this.severity = options?.severity ?? "error"; | ||
| this.why = options?.why; | ||
| this.fix = options?.fix === options?.why ? void 0 : options?.fix; | ||
| this.where = options?.where ? { | ||
| path: options.where.path, | ||
| line: options.where.line | ||
| } : void 0; | ||
| this.meta = options?.meta; | ||
| this.docsUrl = options?.docsUrl; | ||
| } | ||
| /** | ||
| * Converts this error to a CLI error envelope for output formatting. | ||
| */ | ||
| toEnvelope() { | ||
| return { | ||
| ok: false, | ||
| code: `${this.domain === "CLI" ? "PN-CLI-" : "PN-RUN-"}${this.code}`, | ||
| domain: this.domain, | ||
| severity: this.severity, | ||
| summary: this.message, | ||
| why: this.why, | ||
| fix: this.fix, | ||
| where: this.where, | ||
| meta: this.meta, | ||
| docsUrl: this.docsUrl | ||
| }; | ||
| } | ||
| /** | ||
| * Type guard to check if an error is a CliStructuredError. | ||
| * Uses duck-typing to work across module boundaries where instanceof may fail. | ||
| */ | ||
| static is(error) { | ||
| if (!(error instanceof Error)) return false; | ||
| const candidate = error; | ||
| return candidate.name === "CliStructuredError" && typeof candidate.code === "string" && (candidate.domain === "CLI" || candidate.domain === "RUN") && typeof candidate.toEnvelope === "function"; | ||
| } | ||
| }; | ||
| /** | ||
| * Config file not found or missing. | ||
| */ | ||
| function errorConfigFileNotFound(configPath, options) { | ||
| return new CliStructuredError("4001", "Config file not found", { | ||
| domain: "CLI", | ||
| ...options?.why ? { why: options.why } : { why: "Config file not found" }, | ||
| fix: "Run 'prisma-next init' to create a config file", | ||
| docsUrl: "https://prisma-next.dev/docs/cli/config", | ||
| ...configPath ? { where: { path: configPath } } : {} | ||
| }); | ||
| } | ||
| /** | ||
| * Contract configuration missing from config. | ||
| */ | ||
| function errorContractConfigMissing(options) { | ||
| return new CliStructuredError("4002", "Contract configuration missing", { | ||
| domain: "CLI", | ||
| why: options?.why ?? "The contract configuration is required for emit", | ||
| fix: "Add contract configuration to your prisma-next.config.ts", | ||
| docsUrl: "https://prisma-next.dev/docs/cli/contract-emit" | ||
| }); | ||
| } | ||
| /** | ||
| * Contract validation failed. | ||
| */ | ||
| function errorContractValidationFailed(reason, options) { | ||
| return new CliStructuredError("4003", "Contract validation failed", { | ||
| domain: "CLI", | ||
| why: reason, | ||
| fix: "Re-run `prisma-next contract emit`, or fix the contract file and try again", | ||
| docsUrl: "https://prisma-next.dev/docs/contracts", | ||
| ...options?.where ? { where: options.where } : {} | ||
| }); | ||
| } | ||
| /** | ||
| * File not found. | ||
| */ | ||
| function errorFileNotFound(filePath, options) { | ||
| return new CliStructuredError("4004", "File not found", { | ||
| domain: "CLI", | ||
| why: options?.why ?? `File not found: ${filePath}`, | ||
| fix: options?.fix ?? "Check that the file path is correct", | ||
| where: { path: filePath }, | ||
| ...options?.docsUrl ? { docsUrl: options.docsUrl } : {} | ||
| }); | ||
| } | ||
| /** | ||
| * Database connection is required but not provided. | ||
| */ | ||
| function errorDatabaseConnectionRequired(options) { | ||
| const runHint = options?.retryCommand ? `Run \`${options.retryCommand}\`` : options?.commandName ? `Run \`prisma-next ${options.commandName} --db <url>\`` : "Provide `--db <url>`"; | ||
| return new CliStructuredError("4005", "Database connection is required", { | ||
| domain: "CLI", | ||
| why: options?.why ?? "Database connection is required for this command", | ||
| fix: `${runHint}, or set \`db: { connection: "postgres://…" }\` in prisma-next.config.ts` | ||
| }); | ||
| } | ||
| /** | ||
| * Query runner factory is required but not provided in config. | ||
| */ | ||
| function errorQueryRunnerFactoryRequired(options) { | ||
| return new CliStructuredError("4006", "Query runner factory is required", { | ||
| domain: "CLI", | ||
| why: options?.why ?? "Config.db.queryRunnerFactory is required for db verify", | ||
| fix: "Add db.queryRunnerFactory to prisma-next.config.ts", | ||
| docsUrl: "https://prisma-next.dev/docs/cli/db-verify" | ||
| }); | ||
| } | ||
| /** | ||
| * Family verify.readMarker is required but not provided. | ||
| */ | ||
| function errorFamilyReadMarkerSqlRequired(options) { | ||
| return new CliStructuredError("4007", "Family readMarker() is required", { | ||
| domain: "CLI", | ||
| why: options?.why ?? "Family verify.readMarker is required for db verify", | ||
| fix: "Ensure family.verify.readMarker() is exported by your family package", | ||
| docsUrl: "https://prisma-next.dev/docs/cli/db-verify" | ||
| }); | ||
| } | ||
| /** | ||
| * JSON output format not supported. | ||
| */ | ||
| function errorJsonFormatNotSupported(options) { | ||
| return new CliStructuredError("4008", "Unsupported JSON format", { | ||
| domain: "CLI", | ||
| why: `The ${options.command} command does not support --json ${options.format}`, | ||
| fix: `Use --json ${options.supportedFormats.join(" or ")}, or omit --json for human output`, | ||
| meta: { | ||
| command: options.command, | ||
| format: options.format, | ||
| supportedFormats: options.supportedFormats | ||
| } | ||
| }); | ||
| } | ||
| /** | ||
| * Driver is required for DB-connected commands but not provided. | ||
| */ | ||
| function errorDriverRequired(options) { | ||
| return new CliStructuredError("4010", "Driver is required for DB-connected commands", { | ||
| domain: "CLI", | ||
| why: options?.why ?? "Config.driver is required for DB-connected commands", | ||
| fix: "Add a control-plane driver to prisma-next.config.ts (e.g. import a driver descriptor and set `driver: postgresDriver`)", | ||
| docsUrl: "https://prisma-next.dev/docs/cli/config" | ||
| }); | ||
| } | ||
| /** | ||
| * Contract requires extension packs that are not provided by config descriptors. | ||
| */ | ||
| function errorContractMissingExtensionPacks(options) { | ||
| const missing = [...options.missingExtensionPacks].sort(); | ||
| return new CliStructuredError("4011", "Missing extension packs in config", { | ||
| domain: "CLI", | ||
| why: missing.length === 1 ? `Contract requires extension pack '${missing[0]}', but CLI config does not provide a matching descriptor.` : `Contract requires extension packs ${missing.map((p) => `'${p}'`).join(", ")}, but CLI config does not provide matching descriptors.`, | ||
| fix: "Add the missing extension descriptors to `extensions` in prisma-next.config.ts", | ||
| docsUrl: "https://prisma-next.dev/docs/cli/config", | ||
| meta: { | ||
| missingExtensionPacks: missing, | ||
| providedComponentIds: [...options.providedComponentIds].sort() | ||
| } | ||
| }); | ||
| } | ||
| /** | ||
| * Migration planning failed due to conflicts. | ||
| */ | ||
| function errorMigrationPlanningFailed(options) { | ||
| const conflictSummaries = options.conflicts.map((c) => c.summary); | ||
| const computedWhy = options.why ?? conflictSummaries.join("\n"); | ||
| const conflictFixes = options.conflicts.map((c) => c.why).filter((why) => typeof why === "string"); | ||
| return new CliStructuredError("4020", "Migration planning failed", { | ||
| domain: "CLI", | ||
| why: computedWhy, | ||
| fix: conflictFixes.length > 0 ? conflictFixes.join("\n") : "Use `db verify --schema-only` to inspect conflicts, or ensure the database is empty", | ||
| meta: { conflicts: options.conflicts }, | ||
| docsUrl: "https://prisma-next.dev/docs/cli/db-init" | ||
| }); | ||
| } | ||
| /** | ||
| * Target does not support migrations (missing createPlanner/createRunner). | ||
| */ | ||
| function errorTargetMigrationNotSupported(options) { | ||
| return new CliStructuredError("4021", "Target does not support migrations", { | ||
| domain: "CLI", | ||
| why: options?.why ?? "The configured target does not provide migration planner/runner", | ||
| fix: "Select a target that provides migrations (it must export `target.migrations` for db init)", | ||
| docsUrl: "https://prisma-next.dev/docs/cli/db-init" | ||
| }); | ||
| } | ||
| /** | ||
| * Config validation error (missing required fields). | ||
| */ | ||
| function errorConfigValidation(field, options) { | ||
| return new CliStructuredError("4009", "Config validation error", { | ||
| domain: "CLI", | ||
| why: options?.why ?? `Config must have a "${field}" field`, | ||
| fix: "Check your prisma-next.config.ts and ensure all required fields are provided", | ||
| docsUrl: "https://prisma-next.dev/docs/cli/config" | ||
| }); | ||
| } | ||
| /** | ||
| * Generic unexpected error. | ||
| */ | ||
| function errorUnexpected(message, options) { | ||
| return new CliStructuredError("4999", "Unexpected error", { | ||
| domain: "CLI", | ||
| why: options?.why ?? message, | ||
| fix: options?.fix ?? "Check the error message and try again" | ||
| }); | ||
| } | ||
| //#endregion | ||
| export { errorContractMissingExtensionPacks as a, errorDriverRequired as c, errorJsonFormatNotSupported as d, errorMigrationPlanningFailed as f, errorUnexpected as h, errorContractConfigMissing as i, errorFamilyReadMarkerSqlRequired as l, errorTargetMigrationNotSupported as m, errorConfigFileNotFound as n, errorContractValidationFailed as o, errorQueryRunnerFactoryRequired as p, errorConfigValidation as r, errorDatabaseConnectionRequired as s, CliStructuredError as t, errorFileNotFound as u }; | ||
| //# sourceMappingURL=control-Dl5V1Wc7.mjs.map |
| {"version":3,"file":"control-Dl5V1Wc7.mjs","names":[],"sources":["../src/control.ts"],"sourcesContent":["/**\n * CLI error envelope for output formatting.\n * This is the serialized form of a CliStructuredError.\n */\nexport interface CliErrorEnvelope {\n readonly ok: false;\n readonly code: string;\n readonly domain: string;\n readonly severity: 'error' | 'warn' | 'info';\n readonly summary: string;\n readonly why: string | undefined;\n readonly fix: string | undefined;\n readonly where:\n | {\n readonly path: string | undefined;\n readonly line: number | undefined;\n }\n | undefined;\n readonly meta: Record<string, unknown> | undefined;\n readonly docsUrl: string | undefined;\n}\n\n/**\n * Minimal conflict data structure expected by CLI output.\n */\nexport interface CliErrorConflict {\n readonly kind: string;\n readonly summary: string;\n readonly why?: string;\n}\n\n/**\n * Structured CLI error that contains all information needed for error envelopes.\n * Call sites throw these errors with full context.\n */\nexport class CliStructuredError extends Error {\n readonly code: string;\n readonly domain: 'CLI' | 'RUN';\n readonly severity: 'error' | 'warn' | 'info';\n readonly why: string | undefined;\n readonly fix: string | undefined;\n readonly where:\n | {\n readonly path: string | undefined;\n readonly line: number | undefined;\n }\n | undefined;\n readonly meta: Record<string, unknown> | undefined;\n readonly docsUrl: string | undefined;\n\n constructor(\n code: string,\n summary: string,\n options?: {\n readonly domain?: 'CLI' | 'RUN';\n readonly severity?: 'error' | 'warn' | 'info';\n readonly why?: string;\n readonly fix?: string;\n readonly where?: { readonly path?: string; readonly line?: number };\n readonly meta?: Record<string, unknown>;\n readonly docsUrl?: string;\n },\n ) {\n super(summary);\n this.name = 'CliStructuredError';\n this.code = code;\n this.domain = options?.domain ?? 'CLI';\n this.severity = options?.severity ?? 'error';\n this.why = options?.why;\n this.fix = options?.fix === options?.why ? undefined : options?.fix;\n this.where = options?.where\n ? {\n path: options.where.path,\n line: options.where.line,\n }\n : undefined;\n this.meta = options?.meta;\n this.docsUrl = options?.docsUrl;\n }\n\n /**\n * Converts this error to a CLI error envelope for output formatting.\n */\n toEnvelope(): CliErrorEnvelope {\n const codePrefix = this.domain === 'CLI' ? 'PN-CLI-' : 'PN-RUN-';\n return {\n ok: false as const,\n code: `${codePrefix}${this.code}`,\n domain: this.domain,\n severity: this.severity,\n summary: this.message,\n why: this.why,\n fix: this.fix,\n where: this.where,\n meta: this.meta,\n docsUrl: this.docsUrl,\n };\n }\n\n /**\n * Type guard to check if an error is a CliStructuredError.\n * Uses duck-typing to work across module boundaries where instanceof may fail.\n */\n static is(error: unknown): error is CliStructuredError {\n if (!(error instanceof Error)) {\n return false;\n }\n const candidate = error as CliStructuredError;\n return (\n candidate.name === 'CliStructuredError' &&\n typeof candidate.code === 'string' &&\n (candidate.domain === 'CLI' || candidate.domain === 'RUN') &&\n typeof candidate.toEnvelope === 'function'\n );\n }\n}\n\n// ============================================================================\n// Config Errors (PN-CLI-4001-4007)\n// ============================================================================\n\n/**\n * Config file not found or missing.\n */\nexport function errorConfigFileNotFound(\n configPath?: string,\n options?: {\n readonly why?: string;\n },\n): CliStructuredError {\n return new CliStructuredError('4001', 'Config file not found', {\n domain: 'CLI',\n ...(options?.why ? { why: options.why } : { why: 'Config file not found' }),\n fix: \"Run 'prisma-next init' to create a config file\",\n docsUrl: 'https://prisma-next.dev/docs/cli/config',\n ...(configPath ? { where: { path: configPath } } : {}),\n });\n}\n\n/**\n * Contract configuration missing from config.\n */\nexport function errorContractConfigMissing(options?: {\n readonly why?: string;\n}): CliStructuredError {\n return new CliStructuredError('4002', 'Contract configuration missing', {\n domain: 'CLI',\n why: options?.why ?? 'The contract configuration is required for emit',\n fix: 'Add contract configuration to your prisma-next.config.ts',\n docsUrl: 'https://prisma-next.dev/docs/cli/contract-emit',\n });\n}\n\n/**\n * Contract validation failed.\n */\nexport function errorContractValidationFailed(\n reason: string,\n options?: {\n readonly where?: { readonly path?: string; readonly line?: number };\n },\n): CliStructuredError {\n return new CliStructuredError('4003', 'Contract validation failed', {\n domain: 'CLI',\n why: reason,\n fix: 'Re-run `prisma-next contract emit`, or fix the contract file and try again',\n docsUrl: 'https://prisma-next.dev/docs/contracts',\n ...(options?.where ? { where: options.where } : {}),\n });\n}\n\n/**\n * File not found.\n */\nexport function errorFileNotFound(\n filePath: string,\n options?: {\n readonly why?: string;\n readonly fix?: string;\n readonly docsUrl?: string;\n },\n): CliStructuredError {\n return new CliStructuredError('4004', 'File not found', {\n domain: 'CLI',\n why: options?.why ?? `File not found: ${filePath}`,\n fix: options?.fix ?? 'Check that the file path is correct',\n where: { path: filePath },\n ...(options?.docsUrl ? { docsUrl: options.docsUrl } : {}),\n });\n}\n\n/**\n * Database connection is required but not provided.\n */\nexport function errorDatabaseConnectionRequired(options?: {\n readonly why?: string;\n readonly commandName?: string;\n readonly retryCommand?: string;\n}): CliStructuredError {\n const runHint = options?.retryCommand\n ? `Run \\`${options.retryCommand}\\``\n : options?.commandName\n ? `Run \\`prisma-next ${options.commandName} --db <url>\\``\n : 'Provide `--db <url>`';\n return new CliStructuredError('4005', 'Database connection is required', {\n domain: 'CLI',\n why: options?.why ?? 'Database connection is required for this command',\n fix: `${runHint}, or set \\`db: { connection: \"postgres://…\" }\\` in prisma-next.config.ts`,\n });\n}\n\n/**\n * Query runner factory is required but not provided in config.\n */\nexport function errorQueryRunnerFactoryRequired(options?: {\n readonly why?: string;\n}): CliStructuredError {\n return new CliStructuredError('4006', 'Query runner factory is required', {\n domain: 'CLI',\n why: options?.why ?? 'Config.db.queryRunnerFactory is required for db verify',\n fix: 'Add db.queryRunnerFactory to prisma-next.config.ts',\n docsUrl: 'https://prisma-next.dev/docs/cli/db-verify',\n });\n}\n\n/**\n * Family verify.readMarker is required but not provided.\n */\nexport function errorFamilyReadMarkerSqlRequired(options?: {\n readonly why?: string;\n}): CliStructuredError {\n return new CliStructuredError('4007', 'Family readMarker() is required', {\n domain: 'CLI',\n why: options?.why ?? 'Family verify.readMarker is required for db verify',\n fix: 'Ensure family.verify.readMarker() is exported by your family package',\n docsUrl: 'https://prisma-next.dev/docs/cli/db-verify',\n });\n}\n\n/**\n * JSON output format not supported.\n */\nexport function errorJsonFormatNotSupported(options: {\n readonly command: string;\n readonly format: string;\n readonly supportedFormats: readonly string[];\n}): CliStructuredError {\n return new CliStructuredError('4008', 'Unsupported JSON format', {\n domain: 'CLI',\n why: `The ${options.command} command does not support --json ${options.format}`,\n fix: `Use --json ${options.supportedFormats.join(' or ')}, or omit --json for human output`,\n meta: {\n command: options.command,\n format: options.format,\n supportedFormats: options.supportedFormats,\n },\n });\n}\n\n/**\n * Driver is required for DB-connected commands but not provided.\n */\nexport function errorDriverRequired(options?: { readonly why?: string }): CliStructuredError {\n return new CliStructuredError('4010', 'Driver is required for DB-connected commands', {\n domain: 'CLI',\n why: options?.why ?? 'Config.driver is required for DB-connected commands',\n fix: 'Add a control-plane driver to prisma-next.config.ts (e.g. import a driver descriptor and set `driver: postgresDriver`)',\n docsUrl: 'https://prisma-next.dev/docs/cli/config',\n });\n}\n\n/**\n * Contract requires extension packs that are not provided by config descriptors.\n */\nexport function errorContractMissingExtensionPacks(options: {\n readonly missingExtensionPacks: readonly string[];\n readonly providedComponentIds: readonly string[];\n}): CliStructuredError {\n const missing = [...options.missingExtensionPacks].sort();\n return new CliStructuredError('4011', 'Missing extension packs in config', {\n domain: 'CLI',\n why:\n missing.length === 1\n ? `Contract requires extension pack '${missing[0]}', but CLI config does not provide a matching descriptor.`\n : `Contract requires extension packs ${missing.map((p) => `'${p}'`).join(', ')}, but CLI config does not provide matching descriptors.`,\n fix: 'Add the missing extension descriptors to `extensions` in prisma-next.config.ts',\n docsUrl: 'https://prisma-next.dev/docs/cli/config',\n meta: {\n missingExtensionPacks: missing,\n providedComponentIds: [...options.providedComponentIds].sort(),\n },\n });\n}\n\n/**\n * Migration planning failed due to conflicts.\n */\nexport function errorMigrationPlanningFailed(options: {\n readonly conflicts: readonly CliErrorConflict[];\n readonly why?: string;\n}): CliStructuredError {\n const conflictSummaries = options.conflicts.map((c) => c.summary);\n const computedWhy = options.why ?? conflictSummaries.join('\\n');\n\n const conflictFixes = options.conflicts\n .map((c) => c.why)\n .filter((why): why is string => typeof why === 'string');\n const computedFix =\n conflictFixes.length > 0\n ? conflictFixes.join('\\n')\n : 'Use `db verify --schema-only` to inspect conflicts, or ensure the database is empty';\n\n return new CliStructuredError('4020', 'Migration planning failed', {\n domain: 'CLI',\n why: computedWhy,\n fix: computedFix,\n meta: { conflicts: options.conflicts },\n docsUrl: 'https://prisma-next.dev/docs/cli/db-init',\n });\n}\n\n/**\n * Target does not support migrations (missing createPlanner/createRunner).\n */\nexport function errorTargetMigrationNotSupported(options?: {\n readonly why?: string;\n}): CliStructuredError {\n return new CliStructuredError('4021', 'Target does not support migrations', {\n domain: 'CLI',\n why: options?.why ?? 'The configured target does not provide migration planner/runner',\n fix: 'Select a target that provides migrations (it must export `target.migrations` for db init)',\n docsUrl: 'https://prisma-next.dev/docs/cli/db-init',\n });\n}\n\n/**\n * Config validation error (missing required fields).\n */\nexport function errorConfigValidation(\n field: string,\n options?: {\n readonly why?: string;\n },\n): CliStructuredError {\n return new CliStructuredError('4009', 'Config validation error', {\n domain: 'CLI',\n why: options?.why ?? `Config must have a \"${field}\" field`,\n fix: 'Check your prisma-next.config.ts and ensure all required fields are provided',\n docsUrl: 'https://prisma-next.dev/docs/cli/config',\n });\n}\n\n// ============================================================================\n// Generic Error\n// ============================================================================\n\n/**\n * Generic unexpected error.\n */\nexport function errorUnexpected(\n message: string,\n options?: {\n readonly why?: string;\n readonly fix?: string;\n },\n): CliStructuredError {\n return new CliStructuredError('4999', 'Unexpected error', {\n domain: 'CLI',\n why: options?.why ?? message,\n fix: options?.fix ?? 'Check the error message and try again',\n });\n}\n"],"mappings":";;;;;AAmCA,IAAa,qBAAb,cAAwC,MAAM;CAC5C,AAAS;CACT,AA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