@prisma-next/cli 0.5.0-dev.11 → 0.5.0-dev.13
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +37 -3
- package/dist/cli.mjs +7 -14
- package/dist/cli.mjs.map +1 -1
- package/dist/{client-faKQqcix.mjs → client-enZIahga.mjs} +5 -5
- package/dist/{client-faKQqcix.mjs.map → client-enZIahga.mjs.map} +1 -1
- package/dist/commands/contract-emit.d.mts.map +1 -1
- package/dist/commands/contract-emit.mjs +2 -7
- package/dist/commands/contract-infer.mjs +2 -8
- package/dist/commands/db-init.mjs +7 -8
- package/dist/commands/db-init.mjs.map +1 -1
- package/dist/commands/db-schema.mjs +5 -8
- package/dist/commands/db-schema.mjs.map +1 -1
- package/dist/commands/db-sign.mjs +6 -7
- package/dist/commands/db-sign.mjs.map +1 -1
- package/dist/commands/db-update.mjs +7 -8
- package/dist/commands/db-update.mjs.map +1 -1
- package/dist/commands/db-verify.mjs +8 -9
- package/dist/commands/db-verify.mjs.map +1 -1
- package/dist/commands/migration-apply.mjs +6 -7
- package/dist/commands/migration-apply.mjs.map +1 -1
- package/dist/commands/migration-new.mjs +6 -6
- package/dist/commands/migration-plan.mjs +7 -7
- package/dist/commands/migration-ref.d.mts +1 -1
- package/dist/commands/migration-ref.mjs +3 -3
- package/dist/commands/migration-show.d.mts +1 -1
- package/dist/commands/migration-show.mjs +5 -5
- package/dist/commands/migration-status.mjs +2 -7
- package/dist/{config-loader-C25b63rJ.mjs → config-loader-ih8ViDb_.mjs} +2 -2
- package/dist/config-loader-ih8ViDb_.mjs.map +1 -0
- package/dist/config-loader.mjs +1 -1
- package/dist/contract-emit-DWtGQYCD.mjs +150 -0
- package/dist/contract-emit-DWtGQYCD.mjs.map +1 -0
- package/dist/contract-emit-LjzCoicC.mjs +4 -0
- package/dist/contract-emit-RZBWzkop.mjs +329 -0
- package/dist/contract-emit-RZBWzkop.mjs.map +1 -0
- package/dist/{contract-enrichment-CAOELa-H.mjs → contract-enrichment-4Ptgw3Pe.mjs} +1 -1
- package/dist/{contract-enrichment-CAOELa-H.mjs.map → contract-enrichment-4Ptgw3Pe.mjs.map} +1 -1
- package/dist/{contract-infer-BgnsSkGp.mjs → contract-infer-BjzkcwQt.mjs} +5 -5
- package/dist/{contract-infer-BgnsSkGp.mjs.map → contract-infer-BjzkcwQt.mjs.map} +1 -1
- package/dist/exports/control-api.d.mts +41 -16
- package/dist/exports/control-api.d.mts.map +1 -1
- package/dist/exports/control-api.mjs +5 -7
- package/dist/exports/index.mjs +3 -8
- package/dist/exports/index.mjs.map +1 -1
- package/dist/exports/init-output.mjs +1 -1
- package/dist/{extract-operation-statements-DsFfxXVZ.mjs → extract-operation-statements-CU-Pp4-N.mjs} +2 -2
- package/dist/{extract-operation-statements-DsFfxXVZ.mjs.map → extract-operation-statements-CU-Pp4-N.mjs.map} +1 -1
- package/dist/{extract-sql-ddl-D9UbZDyz.mjs → extract-sql-ddl-Bm0Mm0IT.mjs} +1 -1
- package/dist/{extract-sql-ddl-D9UbZDyz.mjs.map → extract-sql-ddl-Bm0Mm0IT.mjs.map} +1 -1
- package/dist/{framework-components-C6el-5x_.mjs → framework-components-Bgcre3Z6.mjs} +1 -1
- package/dist/{framework-components-C6el-5x_.mjs.map → framework-components-Bgcre3Z6.mjs.map} +1 -1
- package/dist/{init-jf33mNQ6.mjs → init-BKgjxw6r.mjs} +5 -5
- package/dist/{init-jf33mNQ6.mjs.map → init-BKgjxw6r.mjs.map} +1 -1
- package/dist/{inspect-live-schema-yCu0JT0I.mjs → inspect-live-schema-QklSDLt_.mjs} +5 -5
- package/dist/{inspect-live-schema-yCu0JT0I.mjs.map → inspect-live-schema-QklSDLt_.mjs.map} +1 -1
- package/dist/migration-cli.mjs +2 -2
- package/dist/{migration-command-scaffold-B8HAEGhQ.mjs → migration-command-scaffold-BfloSWPZ.mjs} +6 -6
- package/dist/{migration-command-scaffold-B8HAEGhQ.mjs.map → migration-command-scaffold-BfloSWPZ.mjs.map} +1 -1
- package/dist/{migration-status-8QUxCJHE.mjs → migration-status-C5VYA5r9.mjs} +7 -7
- package/dist/{migration-status-8QUxCJHE.mjs.map → migration-status-C5VYA5r9.mjs.map} +1 -1
- package/dist/{migrations-CKRMAKka.mjs → migrations-CSaDHNpB.mjs} +2 -2
- package/dist/{migrations-CKRMAKka.mjs.map → migrations-CSaDHNpB.mjs.map} +1 -1
- package/dist/{output-BpcQrnnq.mjs → output-BiO7kt87.mjs} +1 -1
- package/dist/{output-BpcQrnnq.mjs.map → output-BiO7kt87.mjs.map} +1 -1
- package/dist/{progress-adapter-DvQWB1nK.mjs → progress-adapter-DgRGldpT.mjs} +1 -1
- package/dist/{progress-adapter-DvQWB1nK.mjs.map → progress-adapter-DgRGldpT.mjs.map} +1 -1
- package/dist/{result-handler-CuhZ3kNu.mjs → result-handler-BmVh8AeV.mjs} +4 -4
- package/dist/{result-handler-CuhZ3kNu.mjs.map → result-handler-BmVh8AeV.mjs.map} +1 -1
- package/dist/{terminal-ui-C3ZLwQxK.mjs → terminal-ui-u2YgKghu.mjs} +1 -1
- package/dist/{terminal-ui-C3ZLwQxK.mjs.map → terminal-ui-u2YgKghu.mjs.map} +1 -1
- package/dist/{verify-Bkycc-Tf.mjs → verify-BumcH6Ry.mjs} +2 -2
- package/dist/{verify-Bkycc-Tf.mjs.map → verify-BumcH6Ry.mjs.map} +1 -1
- package/package.json +16 -16
- package/src/commands/contract-emit.ts +67 -163
- package/src/config-path-validation.ts +0 -1
- package/src/control-api/operations/contract-emit.ts +198 -115
- package/src/control-api/types.ts +22 -3
- package/src/exports/control-api.ts +2 -1
- package/src/utils/emit-queue.ts +26 -0
- package/src/utils/publish-contract-artifact-pair.ts +134 -0
- package/dist/config-loader-C25b63rJ.mjs.map +0 -1
- package/dist/contract-emit-B9wkchud.mjs +0 -6
- package/dist/contract-emit-Cf3fjDL6.mjs +0 -195
- package/dist/contract-emit-Cf3fjDL6.mjs.map +0 -1
- package/dist/contract-emit-PeB96eHy.mjs +0 -122
- package/dist/contract-emit-PeB96eHy.mjs.map +0 -1
- package/dist/validate-contract-deps-B_Cs29TL.mjs +0 -37
- package/dist/validate-contract-deps-B_Cs29TL.mjs.map +0 -1
- /package/dist/{cli-errors-D2NPMaxW.d.mts → cli-errors-BJLUczXT.d.mts} +0 -0
|
@@ -1,17 +1,17 @@
|
|
|
1
|
-
import { t as loadConfig } from "../config-loader-
|
|
1
|
+
import { t as loadConfig } from "../config-loader-ih8ViDb_.mjs";
|
|
2
2
|
import { _ as errorUnexpected, h as errorTargetMigrationNotSupported, m as errorRuntime, t as CliStructuredError, v as mapMigrationToolsError } from "../cli-errors-By1iVE3z.mjs";
|
|
3
|
-
import { t as assertFrameworkComponentsCompatible } from "../framework-components-
|
|
4
|
-
import { t as TerminalUI } from "../terminal-ui-
|
|
5
|
-
import { _ as formatStyledHeader, c as resolveMigrationPaths, d as setCommandExamples, m as parseGlobalFlags, n as addGlobalOptions, r as getTargetMigrations, s as resolveContractPath, t as handleResult, u as setCommandDescriptions } from "../result-handler-
|
|
3
|
+
import { t as assertFrameworkComponentsCompatible } from "../framework-components-Bgcre3Z6.mjs";
|
|
4
|
+
import { t as TerminalUI } from "../terminal-ui-u2YgKghu.mjs";
|
|
5
|
+
import { _ as formatStyledHeader, c as resolveMigrationPaths, d as setCommandExamples, m as parseGlobalFlags, n as addGlobalOptions, r as getTargetMigrations, s as resolveContractPath, t as handleResult, u as setCommandDescriptions } from "../result-handler-BmVh8AeV.mjs";
|
|
6
6
|
import { Command } from "commander";
|
|
7
|
-
import { readFileSync } from "node:fs";
|
|
8
7
|
import { getEmittedArtifactPaths } from "@prisma-next/emitter";
|
|
9
8
|
import { notOk, ok } from "@prisma-next/utils/result";
|
|
10
9
|
import { join, relative } from "pathe";
|
|
11
10
|
import { createControlStack } from "@prisma-next/framework-components/control";
|
|
12
|
-
import { EMPTY_CONTRACT_HASH } from "@prisma-next/migration-tools/constants";
|
|
13
11
|
import { copyFilesWithRename, formatMigrationDirName, readMigrationsDir, writeMigrationPackage } from "@prisma-next/migration-tools/io";
|
|
14
12
|
import { findLatestMigration, reconstructGraph } from "@prisma-next/migration-tools/migration-graph";
|
|
13
|
+
import { readFileSync } from "node:fs";
|
|
14
|
+
import { EMPTY_CONTRACT_HASH } from "@prisma-next/migration-tools/constants";
|
|
15
15
|
import { MigrationToolsError } from "@prisma-next/migration-tools/errors";
|
|
16
16
|
import { computeMigrationHash } from "@prisma-next/migration-tools/hash";
|
|
17
17
|
import { writeMigrationTs } from "@prisma-next/migration-tools/migration-ts";
|
|
@@ -1,18 +1,18 @@
|
|
|
1
|
-
import { t as loadConfig } from "../config-loader-
|
|
1
|
+
import { t as loadConfig } from "../config-loader-ih8ViDb_.mjs";
|
|
2
2
|
import { _ as errorUnexpected, a as errorContractValidationFailed, f as errorMigrationPlanningFailed, h as errorTargetMigrationNotSupported, l as errorFileNotFound, m as errorRuntime, t as CliStructuredError, v as mapMigrationToolsError } from "../cli-errors-By1iVE3z.mjs";
|
|
3
|
-
import { t as assertFrameworkComponentsCompatible } from "../framework-components-
|
|
4
|
-
import { t as
|
|
5
|
-
import { t as
|
|
6
|
-
import {
|
|
3
|
+
import { t as assertFrameworkComponentsCompatible } from "../framework-components-Bgcre3Z6.mjs";
|
|
4
|
+
import { t as TerminalUI } from "../terminal-ui-u2YgKghu.mjs";
|
|
5
|
+
import { _ as formatStyledHeader, c as resolveMigrationPaths, d as setCommandExamples, i as loadMigrationPackages, m as parseGlobalFlags, n as addGlobalOptions, r as getTargetMigrations, s as resolveContractPath, t as handleResult, u as setCommandDescriptions } from "../result-handler-BmVh8AeV.mjs";
|
|
6
|
+
import { t as extractSqlDdl } from "../extract-sql-ddl-Bm0Mm0IT.mjs";
|
|
7
7
|
import { Command } from "commander";
|
|
8
8
|
import { getEmittedArtifactPaths } from "@prisma-next/emitter";
|
|
9
9
|
import { notOk, ok } from "@prisma-next/utils/result";
|
|
10
10
|
import { join, relative } from "pathe";
|
|
11
|
-
import { createControlStack } from "@prisma-next/framework-components/control";
|
|
12
|
-
import { EMPTY_CONTRACT_HASH } from "@prisma-next/migration-tools/constants";
|
|
13
11
|
import { readFile } from "node:fs/promises";
|
|
12
|
+
import { createControlStack } from "@prisma-next/framework-components/control";
|
|
14
13
|
import { copyFilesWithRename, formatMigrationDirName, writeMigrationPackage } from "@prisma-next/migration-tools/io";
|
|
15
14
|
import { findLatestMigration } from "@prisma-next/migration-tools/migration-graph";
|
|
15
|
+
import { EMPTY_CONTRACT_HASH } from "@prisma-next/migration-tools/constants";
|
|
16
16
|
import { MigrationToolsError } from "@prisma-next/migration-tools/errors";
|
|
17
17
|
import { computeMigrationHash } from "@prisma-next/migration-tools/hash";
|
|
18
18
|
import { writeMigrationTs } from "@prisma-next/migration-tools/migration-ts";
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { t as CliStructuredError } from "../cli-errors-
|
|
1
|
+
import { t as CliStructuredError } from "../cli-errors-BJLUczXT.mjs";
|
|
2
2
|
import { Command } from "commander";
|
|
3
3
|
import { Result } from "@prisma-next/utils/result";
|
|
4
4
|
import { RefEntry } from "@prisma-next/migration-tools/refs";
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { t as loadConfig } from "../config-loader-
|
|
1
|
+
import { t as loadConfig } from "../config-loader-ih8ViDb_.mjs";
|
|
2
2
|
import { _ as errorUnexpected, m as errorRuntime, t as CliStructuredError, v as mapMigrationToolsError } from "../cli-errors-By1iVE3z.mjs";
|
|
3
|
-
import { t as TerminalUI } from "../terminal-ui-
|
|
4
|
-
import { c as resolveMigrationPaths, h as formatCommandHelp, m as parseGlobalFlags, n as addGlobalOptions, t as handleResult, u as setCommandDescriptions } from "../result-handler-
|
|
3
|
+
import { t as TerminalUI } from "../terminal-ui-u2YgKghu.mjs";
|
|
4
|
+
import { c as resolveMigrationPaths, h as formatCommandHelp, m as parseGlobalFlags, n as addGlobalOptions, t as handleResult, u as setCommandDescriptions } from "../result-handler-BmVh8AeV.mjs";
|
|
5
5
|
import { Command } from "commander";
|
|
6
6
|
import { notOk, ok } from "@prisma-next/utils/result";
|
|
7
7
|
import { MigrationToolsError } from "@prisma-next/migration-tools/errors";
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { t as CliStructuredError } from "../cli-errors-
|
|
1
|
+
import { t as CliStructuredError } from "../cli-errors-BJLUczXT.mjs";
|
|
2
2
|
import { Command } from "commander";
|
|
3
3
|
import { Result } from "@prisma-next/utils/result";
|
|
4
4
|
import { MigrationPackage } from "@prisma-next/migration-tools/package";
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { t as loadConfig } from "../config-loader-
|
|
1
|
+
import { t as loadConfig } from "../config-loader-ih8ViDb_.mjs";
|
|
2
2
|
import { _ as errorUnexpected, m as errorRuntime, v as mapMigrationToolsError } from "../cli-errors-By1iVE3z.mjs";
|
|
3
|
-
import { t as
|
|
4
|
-
import { t as
|
|
5
|
-
import {
|
|
6
|
-
import { a as formatMigrationShowOutput } from "../migrations-
|
|
3
|
+
import { t as TerminalUI } from "../terminal-ui-u2YgKghu.mjs";
|
|
4
|
+
import { _ as formatStyledHeader, d as setCommandExamples, m as parseGlobalFlags, n as addGlobalOptions, t as handleResult, u as setCommandDescriptions } from "../result-handler-BmVh8AeV.mjs";
|
|
5
|
+
import { t as extractOperationStatements } from "../extract-operation-statements-CU-Pp4-N.mjs";
|
|
6
|
+
import { a as formatMigrationShowOutput } from "../migrations-CSaDHNpB.mjs";
|
|
7
7
|
import { Command } from "commander";
|
|
8
8
|
import { notOk, ok } from "@prisma-next/utils/result";
|
|
9
9
|
import { relative, resolve } from "pathe";
|
|
@@ -1,9 +1,4 @@
|
|
|
1
|
-
import "../config-loader-
|
|
2
|
-
import "../
|
|
3
|
-
import "../framework-components-C6el-5x_.mjs";
|
|
4
|
-
import "../client-faKQqcix.mjs";
|
|
5
|
-
import "../terminal-ui-C3ZLwQxK.mjs";
|
|
6
|
-
import "../result-handler-CuhZ3kNu.mjs";
|
|
7
|
-
import { n as deriveEdgeStatuses, t as createMigrationStatusCommand } from "../migration-status-8QUxCJHE.mjs";
|
|
1
|
+
import "../config-loader-ih8ViDb_.mjs";
|
|
2
|
+
import { n as deriveEdgeStatuses, t as createMigrationStatusCommand } from "../migration-status-C5VYA5r9.mjs";
|
|
8
3
|
|
|
9
4
|
export { createMigrationStatusCommand, deriveEdgeStatuses };
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { getEmittedArtifactPaths } from "@prisma-next/emitter";
|
|
2
2
|
import { errorConfigFileNotFound, errorConfigValidation, errorUnexpected } from "@prisma-next/errors/control";
|
|
3
|
+
import { ifDefined } from "@prisma-next/utils/defined";
|
|
3
4
|
import { dirname, resolve } from "pathe";
|
|
4
5
|
import { ConfigValidationError, validateConfig } from "@prisma-next/config/config-validation";
|
|
5
|
-
import { ifDefined } from "@prisma-next/utils/defined";
|
|
6
6
|
import { loadConfig } from "c12";
|
|
7
7
|
import { normalizeContractConfig } from "@prisma-next/config/config-types";
|
|
8
8
|
|
|
@@ -87,4 +87,4 @@ async function loadConfig$1(configPath) {
|
|
|
87
87
|
|
|
88
88
|
//#endregion
|
|
89
89
|
export { loadConfig$1 as t };
|
|
90
|
-
//# sourceMappingURL=config-loader-
|
|
90
|
+
//# sourceMappingURL=config-loader-ih8ViDb_.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"config-loader-ih8ViDb_.mjs","names":["emittedArtifactPaths: ReturnType<typeof getEmittedArtifactPaths>","loadConfigC12","loadConfig"],"sources":["../src/config-path-validation.ts","../src/config-loader.ts"],"sourcesContent":["import {\n type ContractSourceProvider,\n normalizeContractConfig,\n type PrismaNextConfig,\n} from '@prisma-next/config/config-types';\nimport { ConfigValidationError } from '@prisma-next/config/config-validation';\nimport { getEmittedArtifactPaths } from '@prisma-next/emitter';\nimport { resolve } from 'pathe';\n\nfunction throwValidation(field: string, why: string): never {\n throw new ConfigValidationError(field, why);\n}\n\nfunction finalizeContractSource(\n source: ContractSourceProvider,\n configDir: string,\n): ContractSourceProvider {\n const resolvedInputs = source.inputs?.map((input) => resolve(configDir, input));\n if (resolvedInputs === undefined) {\n return source;\n }\n\n return {\n ...source,\n inputs: resolvedInputs,\n };\n}\n\nfunction validateNoOutputsAreInputs(\n inputs: readonly string[] | undefined,\n output: string | undefined,\n): void {\n if (inputs === undefined || output === undefined) {\n return;\n }\n\n let emittedArtifactPaths: ReturnType<typeof getEmittedArtifactPaths>;\n try {\n emittedArtifactPaths = getEmittedArtifactPaths(output);\n } catch (error) {\n throwValidation('contract.output', error instanceof Error ? error.message : String(error));\n }\n\n const emittedPaths = new Set([emittedArtifactPaths.jsonPath, emittedArtifactPaths.dtsPath]);\n\n for (const input of inputs) {\n if (emittedPaths.has(input)) {\n throwValidation(\n 'contract.source.inputs[]',\n 'Config.contract.source.inputs must not include emitted artifact paths derived from contract.output',\n );\n }\n }\n}\n\nexport function finalizeConfig(config: PrismaNextConfig, configDir: string): PrismaNextConfig {\n if (!config.contract) {\n return config;\n }\n const contract = normalizeContractConfig(config.contract);\n const source = finalizeContractSource(contract.source, configDir);\n const output = resolve(configDir, contract.output);\n\n validateNoOutputsAreInputs(source.inputs, output);\n\n return {\n ...config,\n contract: {\n ...contract,\n source,\n output,\n },\n };\n}\n","import type { PrismaNextConfig } from '@prisma-next/config/config-types';\nimport { ConfigValidationError, validateConfig } from '@prisma-next/config/config-validation';\nimport {\n errorConfigFileNotFound,\n errorConfigValidation,\n errorUnexpected,\n} from '@prisma-next/errors/control';\nimport { ifDefined } from '@prisma-next/utils/defined';\nimport { loadConfig as loadConfigC12 } from 'c12';\nimport { dirname, resolve } from 'pathe';\nimport { finalizeConfig } from './config-path-validation';\n\nasync function loadValidatedConfig(configPath?: string): Promise<PrismaNextConfig> {\n const cwd = process.cwd();\n const resolvedConfigPath = configPath ? resolve(cwd, configPath) : undefined;\n const configCwd = resolvedConfigPath ? dirname(resolvedConfigPath) : cwd;\n\n const result = await loadConfigC12<PrismaNextConfig>({\n name: 'prisma-next',\n ...ifDefined('configFile', resolvedConfigPath),\n cwd: configCwd,\n });\n\n // When a specific config file was requested, verify it was actually loaded\n // (c12 falls back to searching by name if the specified file doesn't exist)\n if (resolvedConfigPath && result.configFile !== resolvedConfigPath) {\n throw errorConfigFileNotFound(resolvedConfigPath);\n }\n\n // Check if config is missing or empty (c12 may return empty object when file doesn't exist)\n if (!result.config || Object.keys(result.config).length === 0) {\n // Use c12's configFile if available, otherwise use explicit configPath, otherwise omit path\n const displayPath = result.configFile || resolvedConfigPath || configPath;\n throw errorConfigFileNotFound(displayPath);\n }\n\n // Validate config structure\n validateConfig(result.config);\n\n const loadedConfigDir = result.configFile ? dirname(result.configFile) : configCwd;\n return finalizeConfig(result.config, loadedConfigDir);\n}\n\n/**\n * Loads the Prisma Next config from a TypeScript file.\n * Supports both default export and named export.\n * Uses c12 to automatically handle TypeScript compilation and config file discovery.\n *\n * @param configPath - Optional path to config file. Defaults to `./prisma-next.config.ts` in current directory.\n * @returns The loaded config object.\n * @throws Error if config file doesn't exist or is invalid.\n */\nexport async function loadConfig(configPath?: string): Promise<PrismaNextConfig> {\n try {\n return await loadValidatedConfig(configPath);\n } catch (error) {\n if (error instanceof ConfigValidationError) {\n throw errorConfigValidation(error.field, {\n why: error.why,\n });\n }\n\n // Re-throw structured errors as-is\n if (\n error instanceof Error &&\n 'code' in error &&\n typeof (error as { code: string }).code === 'string'\n ) {\n throw error;\n }\n\n if (error instanceof Error) {\n // Check for file not found errors\n if (\n error.message.includes('not found') ||\n error.message.includes('Cannot find') ||\n error.message.includes('ENOENT')\n ) {\n // Use resolved path if available, otherwise use original configPath\n const displayPath = configPath ? resolve(process.cwd(), configPath) : undefined;\n throw errorConfigFileNotFound(displayPath, {\n why: error.message,\n });\n }\n // For other errors, wrap in unexpected error\n throw errorUnexpected(error.message, {\n why: `Failed to load config: ${error.message}`,\n });\n }\n throw errorUnexpected(String(error));\n }\n}\n"],"mappings":";;;;;;;;;AAS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,CAAC,OAAO,UAAU,OAAO,KAAK,OAAO,OAAO,CAAC,WAAW,EAG1D,OAAM,wBADc,OAAO,cAAc,sBAAsB,WACrB;AAI5C,gBAAe,OAAO,OAAO;CAE7B,MAAM,kBAAkB,OAAO,aAAa,QAAQ,OAAO,WAAW,GAAG;AACzE,QAAO,eAAe,OAAO,QAAQ,gBAAgB;;;;;;;;;;;AAYvD,eAAsBC,aAAW,YAAgD;AAC/E,KAAI;AACF,SAAO,MAAM,oBAAoB,WAAW;UACrC,OAAO;AACd,MAAI,iBAAiB,sBACnB,OAAM,sBAAsB,MAAM,OAAO,EACvC,KAAK,MAAM,KACZ,CAAC;AAIJ,MACE,iBAAiB,SACjB,UAAU,SACV,OAAQ,MAA2B,SAAS,SAE5C,OAAM;AAGR,MAAI,iBAAiB,OAAO;AAE1B,OACE,MAAM,QAAQ,SAAS,YAAY,IACnC,MAAM,QAAQ,SAAS,cAAc,IACrC,MAAM,QAAQ,SAAS,SAAS,CAIhC,OAAM,wBADc,aAAa,QAAQ,QAAQ,KAAK,EAAE,WAAW,GAAG,QAC3B,EACzC,KAAK,MAAM,SACZ,CAAC;AAGJ,SAAM,gBAAgB,MAAM,SAAS,EACnC,KAAK,0BAA0B,MAAM,WACtC,CAAC;;AAEJ,QAAM,gBAAgB,OAAO,MAAM,CAAC"}
|
package/dist/config-loader.mjs
CHANGED
|
@@ -0,0 +1,150 @@
|
|
|
1
|
+
import { t as loadConfig } from "./config-loader-ih8ViDb_.mjs";
|
|
2
|
+
import { _ as errorUnexpected$1, t as CliStructuredError$1 } from "./cli-errors-By1iVE3z.mjs";
|
|
3
|
+
import { t as executeContractEmit } from "./contract-emit-RZBWzkop.mjs";
|
|
4
|
+
import { s as isVerbose, t as TerminalUI } from "./terminal-ui-u2YgKghu.mjs";
|
|
5
|
+
import { _ as formatStyledHeader, d as setCommandExamples, m as parseGlobalFlags, n as addGlobalOptions, t as handleResult, u as setCommandDescriptions, v as formatSuccessMessage } from "./result-handler-BmVh8AeV.mjs";
|
|
6
|
+
import { t as createProgressAdapter } from "./progress-adapter-DgRGldpT.mjs";
|
|
7
|
+
import { Command } from "commander";
|
|
8
|
+
import { getEmittedArtifactPaths } from "@prisma-next/emitter";
|
|
9
|
+
import { errorContractConfigMissing } from "@prisma-next/errors/control";
|
|
10
|
+
import { ifDefined } from "@prisma-next/utils/defined";
|
|
11
|
+
import { notOk, ok } from "@prisma-next/utils/result";
|
|
12
|
+
import { dirname, relative, resolve } from "pathe";
|
|
13
|
+
|
|
14
|
+
//#region src/utils/formatters/emit.ts
|
|
15
|
+
/**
|
|
16
|
+
* Formats human-readable output for contract emit.
|
|
17
|
+
*/
|
|
18
|
+
function formatEmitOutput(result, flags) {
|
|
19
|
+
if (flags.quiet) return "";
|
|
20
|
+
const lines = [];
|
|
21
|
+
const jsonPath = relative(process.cwd(), result.files.json);
|
|
22
|
+
const dtsPath = relative(process.cwd(), result.files.dts);
|
|
23
|
+
lines.push(`✔ Emitted contract.json → ${jsonPath}`);
|
|
24
|
+
lines.push(`✔ Emitted contract.d.ts → ${dtsPath}`);
|
|
25
|
+
lines.push(` storageHash: ${result.storageHash}`);
|
|
26
|
+
if (result.executionHash) lines.push(` executionHash: ${result.executionHash}`);
|
|
27
|
+
if (result.profileHash) lines.push(` profileHash: ${result.profileHash}`);
|
|
28
|
+
if (isVerbose(flags, 1)) lines.push(` Total time: ${result.timings.total}ms`);
|
|
29
|
+
return lines.join("\n");
|
|
30
|
+
}
|
|
31
|
+
/**
|
|
32
|
+
* Formats JSON output for contract emit.
|
|
33
|
+
*/
|
|
34
|
+
function formatEmitJson(result) {
|
|
35
|
+
const output = {
|
|
36
|
+
ok: true,
|
|
37
|
+
storageHash: result.storageHash,
|
|
38
|
+
...ifDefined("executionHash", result.executionHash),
|
|
39
|
+
...result.profileHash ? { profileHash: result.profileHash } : {},
|
|
40
|
+
outDir: result.outDir,
|
|
41
|
+
files: result.files,
|
|
42
|
+
timings: result.timings
|
|
43
|
+
};
|
|
44
|
+
return JSON.stringify(output, null, 2);
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
//#endregion
|
|
48
|
+
//#region src/commands/contract-emit.ts
|
|
49
|
+
/**
|
|
50
|
+
* Pre-load the config just to compute display paths for the styled header. The
|
|
51
|
+
* actual emit work goes through `executeContractEmit`, which loads the config
|
|
52
|
+
* itself; the redundant load here is bounded and lets the header render before
|
|
53
|
+
* the emit spans start.
|
|
54
|
+
*/
|
|
55
|
+
async function resolveHeaderPaths(configOption) {
|
|
56
|
+
const displayConfigPath = configOption ? relative(process.cwd(), resolve(configOption)) : "prisma-next.config.ts";
|
|
57
|
+
let config;
|
|
58
|
+
try {
|
|
59
|
+
config = await loadConfig(configOption);
|
|
60
|
+
} catch (error) {
|
|
61
|
+
if (error instanceof CliStructuredError$1) return notOk(error);
|
|
62
|
+
return notOk(errorUnexpected$1(error instanceof Error ? error.message : String(error), { why: "Failed to load config" }));
|
|
63
|
+
}
|
|
64
|
+
if (!config.contract?.output) return notOk(errorContractConfigMissing({ why: "Config.contract.output is required for emit. Define it in your config: contract: { source: ..., output: ... }" }));
|
|
65
|
+
try {
|
|
66
|
+
const { jsonPath: outputJsonPath, dtsPath: outputDtsPath } = getEmittedArtifactPaths(config.contract.output);
|
|
67
|
+
return ok({
|
|
68
|
+
displayConfigPath,
|
|
69
|
+
outputJsonPath,
|
|
70
|
+
outputDtsPath
|
|
71
|
+
});
|
|
72
|
+
} catch (error) {
|
|
73
|
+
return notOk(errorContractConfigMissing({ why: error instanceof Error ? error.message : String(error) }));
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
async function executeContractEmitCommand(options, flags, ui, startTime) {
|
|
77
|
+
const headerPathsResult = await resolveHeaderPaths(options.config);
|
|
78
|
+
if (!headerPathsResult.ok) return headerPathsResult;
|
|
79
|
+
const { displayConfigPath, outputJsonPath, outputDtsPath } = headerPathsResult.value;
|
|
80
|
+
if (!flags.json && !flags.quiet) ui.stderr(formatStyledHeader({
|
|
81
|
+
command: "contract emit",
|
|
82
|
+
description: "Emit your contract artifacts",
|
|
83
|
+
url: "https://pris.ly/contract-emit",
|
|
84
|
+
details: [
|
|
85
|
+
{
|
|
86
|
+
label: "config",
|
|
87
|
+
value: displayConfigPath
|
|
88
|
+
},
|
|
89
|
+
{
|
|
90
|
+
label: "contract",
|
|
91
|
+
value: relative(process.cwd(), outputJsonPath)
|
|
92
|
+
},
|
|
93
|
+
{
|
|
94
|
+
label: "types",
|
|
95
|
+
value: relative(process.cwd(), outputDtsPath)
|
|
96
|
+
}
|
|
97
|
+
],
|
|
98
|
+
flags
|
|
99
|
+
}));
|
|
100
|
+
const onProgress = createProgressAdapter({
|
|
101
|
+
ui,
|
|
102
|
+
flags
|
|
103
|
+
});
|
|
104
|
+
const configPath = options.config ? resolve(options.config) : "prisma-next.config.ts";
|
|
105
|
+
let result;
|
|
106
|
+
try {
|
|
107
|
+
result = await executeContractEmit({
|
|
108
|
+
configPath,
|
|
109
|
+
onProgress
|
|
110
|
+
});
|
|
111
|
+
} catch (error) {
|
|
112
|
+
if (CliStructuredError$1.is(error)) return notOk(error);
|
|
113
|
+
return notOk(errorUnexpected$1("Unexpected error during contract emit", { why: error instanceof Error ? error.message : String(error) }));
|
|
114
|
+
}
|
|
115
|
+
if (result.validationWarning) ui.warn(result.validationWarning);
|
|
116
|
+
return ok({
|
|
117
|
+
storageHash: result.storageHash,
|
|
118
|
+
...ifDefined("executionHash", result.executionHash),
|
|
119
|
+
profileHash: result.profileHash,
|
|
120
|
+
outDir: dirname(result.files.json),
|
|
121
|
+
files: result.files,
|
|
122
|
+
timings: { total: Date.now() - startTime }
|
|
123
|
+
});
|
|
124
|
+
}
|
|
125
|
+
function createContractEmitCommand() {
|
|
126
|
+
const command = new Command("emit");
|
|
127
|
+
setCommandDescriptions(command, "Emit your contract artifacts", "Reads your contract source (TypeScript or Prisma schema) and emits contract.json and\ncontract.d.ts. The contract.json contains the canonical contract structure, and\ncontract.d.ts provides TypeScript types for type-safe query building.");
|
|
128
|
+
setCommandExamples(command, ["prisma-next contract emit", "prisma-next contract emit --config ./custom-config.ts"]);
|
|
129
|
+
addGlobalOptions(command).option("--config <path>", "Path to prisma-next.config.ts").action(async (options) => {
|
|
130
|
+
const flags = parseGlobalFlags(options);
|
|
131
|
+
const ui = new TerminalUI({
|
|
132
|
+
color: flags.color,
|
|
133
|
+
interactive: flags.interactive
|
|
134
|
+
});
|
|
135
|
+
const exitCode = handleResult(await executeContractEmitCommand(options, flags, ui, Date.now()), flags, ui, (emitResult) => {
|
|
136
|
+
if (flags.json) ui.output(formatEmitJson(emitResult));
|
|
137
|
+
else {
|
|
138
|
+
const output = formatEmitOutput(emitResult, flags);
|
|
139
|
+
if (output) ui.log(output);
|
|
140
|
+
if (!flags.quiet) ui.success(formatSuccessMessage(flags));
|
|
141
|
+
}
|
|
142
|
+
});
|
|
143
|
+
process.exit(exitCode);
|
|
144
|
+
});
|
|
145
|
+
return command;
|
|
146
|
+
}
|
|
147
|
+
|
|
148
|
+
//#endregion
|
|
149
|
+
export { createContractEmitCommand as t };
|
|
150
|
+
//# sourceMappingURL=contract-emit-DWtGQYCD.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"contract-emit-DWtGQYCD.mjs","names":["lines: string[]","config: Awaited<ReturnType<typeof loadConfig>>","CliStructuredError","errorUnexpected","result: ContractEmitResult"],"sources":["../src/utils/formatters/emit.ts","../src/commands/contract-emit.ts"],"sourcesContent":["import { ifDefined } from '@prisma-next/utils/defined';\nimport { relative } from 'pathe';\n\nimport type { GlobalFlags } from '../global-flags';\nimport { isVerbose } from './helpers';\n\n// EmitContractResult type for CLI output formatting (includes file paths)\nexport interface EmitContractResult {\n readonly storageHash: string;\n readonly executionHash?: string;\n readonly profileHash: string;\n readonly outDir: string;\n readonly files: {\n readonly json: string;\n readonly dts: string;\n };\n readonly timings: {\n readonly total: number;\n };\n}\n\n/**\n * Formats human-readable output for contract emit.\n */\nexport function formatEmitOutput(result: EmitContractResult, flags: GlobalFlags): string {\n if (flags.quiet) {\n return '';\n }\n\n const lines: string[] = [];\n\n // Convert absolute paths to relative paths from cwd\n const jsonPath = relative(process.cwd(), result.files.json);\n const dtsPath = relative(process.cwd(), result.files.dts);\n\n lines.push(`✔ Emitted contract.json → ${jsonPath}`);\n lines.push(`✔ Emitted contract.d.ts → ${dtsPath}`);\n lines.push(` storageHash: ${result.storageHash}`);\n if (result.executionHash) {\n lines.push(` executionHash: ${result.executionHash}`);\n }\n if (result.profileHash) {\n lines.push(` profileHash: ${result.profileHash}`);\n }\n if (isVerbose(flags, 1)) {\n lines.push(` Total time: ${result.timings.total}ms`);\n }\n\n return lines.join('\\n');\n}\n\n/**\n * Formats JSON output for contract emit.\n */\nexport function formatEmitJson(result: EmitContractResult): string {\n const output = {\n ok: true,\n storageHash: result.storageHash,\n ...ifDefined('executionHash', result.executionHash),\n ...(result.profileHash ? { profileHash: result.profileHash } : {}),\n outDir: result.outDir,\n files: result.files,\n timings: result.timings,\n };\n\n return JSON.stringify(output, null, 2);\n}\n","import { getEmittedArtifactPaths } from '@prisma-next/emitter';\nimport { errorContractConfigMissing } from '@prisma-next/errors/control';\nimport { ifDefined } from '@prisma-next/utils/defined';\nimport { notOk, ok, type Result } from '@prisma-next/utils/result';\nimport { Command } from 'commander';\nimport { dirname, relative, resolve } from 'pathe';\nimport { loadConfig } from '../config-loader';\nimport { executeContractEmit } from '../control-api/operations/contract-emit';\nimport type { ContractEmitResult } from '../control-api/types';\nimport { CliStructuredError, errorUnexpected } from '../utils/cli-errors';\nimport {\n addGlobalOptions,\n setCommandDescriptions,\n setCommandExamples,\n} from '../utils/command-helpers';\nimport {\n type EmitContractResult,\n formatEmitJson,\n formatEmitOutput,\n} from '../utils/formatters/emit';\nimport { formatStyledHeader, formatSuccessMessage } from '../utils/formatters/styled';\nimport type { CommonCommandOptions } from '../utils/global-flags';\nimport { type GlobalFlags, parseGlobalFlags } from '../utils/global-flags';\nimport { createProgressAdapter } from '../utils/progress-adapter';\nimport { handleResult } from '../utils/result-handler';\nimport { TerminalUI } from '../utils/terminal-ui';\n\ninterface ContractEmitOptions extends CommonCommandOptions {\n readonly config?: string;\n}\n\ninterface HeaderPaths {\n readonly displayConfigPath: string;\n readonly outputJsonPath: string;\n readonly outputDtsPath: string;\n}\n\n/**\n * Pre-load the config just to compute display paths for the styled header. The\n * actual emit work goes through `executeContractEmit`, which loads the config\n * itself; the redundant load here is bounded and lets the header render before\n * the emit spans start.\n */\nasync function resolveHeaderPaths(\n configOption: string | undefined,\n): Promise<Result<HeaderPaths, CliStructuredError>> {\n const displayConfigPath = configOption\n ? relative(process.cwd(), resolve(configOption))\n : 'prisma-next.config.ts';\n\n let config: Awaited<ReturnType<typeof loadConfig>>;\n try {\n config = await loadConfig(configOption);\n } catch (error) {\n if (error instanceof CliStructuredError) {\n return notOk(error);\n }\n return notOk(\n errorUnexpected(error instanceof Error ? error.message : String(error), {\n why: 'Failed to load config',\n }),\n );\n }\n\n if (!config.contract?.output) {\n return notOk(\n errorContractConfigMissing({\n why: 'Config.contract.output is required for emit. Define it in your config: contract: { source: ..., output: ... }',\n }),\n );\n }\n\n try {\n const { jsonPath: outputJsonPath, dtsPath: outputDtsPath } = getEmittedArtifactPaths(\n config.contract.output,\n );\n return ok({ displayConfigPath, outputJsonPath, outputDtsPath });\n } catch (error) {\n return notOk(\n errorContractConfigMissing({\n why: error instanceof Error ? error.message : String(error),\n }),\n );\n }\n}\n\nasync function executeContractEmitCommand(\n options: ContractEmitOptions,\n flags: GlobalFlags,\n ui: TerminalUI,\n startTime: number,\n): Promise<Result<EmitContractResult, CliStructuredError>> {\n const headerPathsResult = await resolveHeaderPaths(options.config);\n if (!headerPathsResult.ok) {\n return headerPathsResult;\n }\n const { displayConfigPath, outputJsonPath, outputDtsPath } = headerPathsResult.value;\n\n if (!flags.json && !flags.quiet) {\n ui.stderr(\n formatStyledHeader({\n command: 'contract emit',\n description: 'Emit your contract artifacts',\n url: 'https://pris.ly/contract-emit',\n details: [\n { label: 'config', value: displayConfigPath },\n { label: 'contract', value: relative(process.cwd(), outputJsonPath) },\n { label: 'types', value: relative(process.cwd(), outputDtsPath) },\n ],\n flags,\n }),\n );\n }\n\n const onProgress = createProgressAdapter({ ui, flags });\n const configPath = options.config ? resolve(options.config) : 'prisma-next.config.ts';\n\n let result: ContractEmitResult;\n try {\n result = await executeContractEmit({ configPath, onProgress });\n } catch (error) {\n if (CliStructuredError.is(error)) {\n return notOk(error);\n }\n return notOk(\n errorUnexpected('Unexpected error during contract emit', {\n why: error instanceof Error ? error.message : String(error),\n }),\n );\n }\n\n if (result.validationWarning) {\n ui.warn(result.validationWarning);\n }\n\n return ok({\n storageHash: result.storageHash,\n ...ifDefined('executionHash', result.executionHash),\n profileHash: result.profileHash,\n outDir: dirname(result.files.json),\n files: result.files,\n timings: { total: Date.now() - startTime },\n });\n}\n\nexport function createContractEmitCommand(): Command {\n const command = new Command('emit');\n setCommandDescriptions(\n command,\n 'Emit your contract artifacts',\n 'Reads your contract source (TypeScript or Prisma schema) and emits contract.json and\\n' +\n 'contract.d.ts. The contract.json contains the canonical contract structure, and\\n' +\n 'contract.d.ts provides TypeScript types for type-safe query building.',\n );\n setCommandExamples(command, [\n 'prisma-next contract emit',\n 'prisma-next contract emit --config ./custom-config.ts',\n ]);\n addGlobalOptions(command)\n .option('--config <path>', 'Path to prisma-next.config.ts')\n .action(async (options: ContractEmitOptions) => {\n const flags = parseGlobalFlags(options);\n const ui = new TerminalUI({ color: flags.color, interactive: flags.interactive });\n const startTime = Date.now();\n\n const result = await executeContractEmitCommand(options, flags, ui, startTime);\n\n const exitCode = handleResult(result, flags, ui, (emitResult) => {\n if (flags.json) {\n ui.output(formatEmitJson(emitResult));\n } else {\n const output = formatEmitOutput(emitResult, flags);\n if (output) {\n ui.log(output);\n }\n if (!flags.quiet) {\n ui.success(formatSuccessMessage(flags));\n }\n }\n });\n process.exit(exitCode);\n });\n\n return command;\n}\n"],"mappings":";;;;;;;;;;;;;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