@prisma-next/target-sqlite 0.13.0-dev.14 → 0.13.0-dev.16
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/control.mjs +11 -13
- package/dist/control.mjs.map +1 -1
- package/dist/migration.d.mts +1 -1
- package/dist/migration.mjs +2 -2
- package/dist/{op-factory-call-Cc-rDnXB.mjs → op-factory-call-BX69rHxs.mjs} +11 -6
- package/dist/op-factory-call-BX69rHxs.mjs.map +1 -0
- package/dist/op-factory-call.d.mts +3 -3
- package/dist/op-factory-call.d.mts.map +1 -1
- package/dist/op-factory-call.mjs +1 -1
- package/dist/{planner-D-scZdGe.mjs → planner-iYg56pzJ.mjs} +12 -6
- package/dist/planner-iYg56pzJ.mjs.map +1 -0
- package/dist/{planner-produced-sqlite-migration-DcrsKVHA.d.mts → planner-produced-sqlite-migration-BWpnDmhM.d.mts} +5 -5
- package/dist/planner-produced-sqlite-migration-BWpnDmhM.d.mts.map +1 -0
- package/dist/{planner-produced-sqlite-migration-WsWCQb58.mjs → planner-produced-sqlite-migration-DwQSUgSk.mjs} +6 -4
- package/dist/planner-produced-sqlite-migration-DwQSUgSk.mjs.map +1 -0
- package/dist/planner-produced-sqlite-migration.d.mts +1 -1
- package/dist/planner-produced-sqlite-migration.mjs +1 -1
- package/dist/planner.d.mts +4 -4
- package/dist/planner.d.mts.map +1 -1
- package/dist/planner.mjs +1 -1
- package/dist/render-ops-BDW2tUeR.mjs +22 -0
- package/dist/render-ops-BDW2tUeR.mjs.map +1 -0
- package/dist/render-ops.d.mts +2 -2
- package/dist/render-ops.d.mts.map +1 -1
- package/dist/render-ops.mjs +1 -1
- package/dist/{sqlite-migration-CteI6Mrg.mjs → sqlite-migration-CCYnBXZp.mjs} +2 -2
- package/dist/{sqlite-migration-CteI6Mrg.mjs.map → sqlite-migration-CCYnBXZp.mjs.map} +1 -1
- package/dist/{sqlite-migration-znjM-dc_.d.mts → sqlite-migration-CJrASAxf.d.mts} +2 -2
- package/dist/sqlite-migration-CJrASAxf.d.mts.map +1 -0
- package/package.json +18 -18
- package/src/core/migrations/issue-planner.ts +36 -4
- package/src/core/migrations/op-factory-call.ts +13 -6
- package/src/core/migrations/planner-ddl-builders.ts +1 -1
- package/src/core/migrations/planner-produced-sqlite-migration.ts +7 -5
- package/src/core/migrations/planner.ts +6 -4
- package/src/core/migrations/render-ops.ts +36 -16
- package/src/core/migrations/runner.ts +16 -12
- package/src/core/migrations/sqlite-migration.ts +1 -1
- package/dist/op-factory-call-Cc-rDnXB.mjs.map +0 -1
- package/dist/planner-D-scZdGe.mjs.map +0 -1
- package/dist/planner-produced-sqlite-migration-DcrsKVHA.d.mts.map +0 -1
- package/dist/planner-produced-sqlite-migration-WsWCQb58.mjs.map +0 -1
- package/dist/render-ops-D2IuTDVc.mjs +0 -9
- package/dist/render-ops-D2IuTDVc.mjs.map +0 -1
- package/dist/sqlite-migration-znjM-dc_.d.mts.map +0 -1
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"planner-produced-sqlite-migration-WsWCQb58.mjs","names":["#calls","#meta","#destination","#spaceId","#lowerer"],"sources":["../src/core/migrations/render-typescript.ts","../src/core/migrations/planner-produced-sqlite-migration.ts"],"sourcesContent":["/**\n * Polymorphic TypeScript emitter for the SQLite migration IR. Mirrors the\n * Postgres `render-typescript.ts` — different base-class + factory module\n * specifier, same overall shape.\n */\n\nimport type { OpFactoryCall } from '@prisma-next/framework-components/control';\nimport { detectScaffoldRuntime, shebangLineFor } from '@prisma-next/migration-tools/migration-ts';\nimport { type ImportRequirement, renderImports } from '@prisma-next/ts-render';\n\nexport interface RenderMigrationMeta {\n readonly from: string | null;\n readonly to: string;\n}\n\n/**\n * Always-present base imports for the rendered scaffold. Both come from\n * `@prisma-next/sqlite/migration` so an authored SQLite\n * `migration.ts` only needs a single dependency for its base class and\n * its CLI entrypoint. Mirrors Postgres's `BASE_IMPORTS`.\n *\n * - `Migration` — the facade re-export fixes the `SqlMigration`\n * generic to `SqlitePlanTargetDetails` and the abstract `targetId` to\n * `'sqlite'`.\n * - `MigrationCLI` — the migration-file CLI entrypoint, re-exported from\n * `@prisma-next/cli/migration-cli`. Loads `prisma-next.config.ts`,\n * assembles a `ControlStack`, and instantiates the migration class.\n */\nconst BASE_IMPORTS: readonly ImportRequirement[] = [\n { moduleSpecifier: '@prisma-next/sqlite/migration', symbol: 'Migration' },\n { moduleSpecifier: '@prisma-next/sqlite/migration', symbol: 'MigrationCLI' },\n];\n\nexport function renderCallsToTypeScript(\n calls: ReadonlyArray<OpFactoryCall>,\n meta: RenderMigrationMeta,\n): string {\n const imports = buildImports(calls);\n const operationsBody = calls.map((c) => c.renderTypeScript()).join(',\\n');\n\n return [\n shebangLineFor(detectScaffoldRuntime()),\n imports,\n '',\n 'export default class M extends Migration {',\n buildDescribeMethod(meta),\n ' override get operations() {',\n ' return [',\n indent(operationsBody, 6),\n ' ];',\n ' }',\n '}',\n '',\n 'MigrationCLI.run(import.meta.url, M);',\n '',\n ].join('\\n');\n}\n\nfunction buildImports(calls: ReadonlyArray<OpFactoryCall>): string {\n const requirements: ImportRequirement[] = [...BASE_IMPORTS];\n for (const call of calls) {\n for (const req of call.importRequirements()) {\n requirements.push(req);\n }\n }\n return renderImports(requirements);\n}\n\nfunction buildDescribeMethod(meta: RenderMigrationMeta): string {\n const lines: string[] = [];\n lines.push(' override describe() {');\n lines.push(' return {');\n lines.push(` from: ${JSON.stringify(meta.from)},`);\n lines.push(` to: ${JSON.stringify(meta.to)},`);\n lines.push(' };');\n lines.push(' }');\n lines.push('');\n return lines.join('\\n');\n}\n\nfunction indent(text: string, spaces: number): string {\n const pad = ' '.repeat(spaces);\n return text\n .split('\\n')\n .map((line) => (line.trim() ? `${pad}${line}` : line))\n .join('\\n');\n}\n","import type { SqlMigrationPlanOperation } from '@prisma-next/family-sql/control';\nimport type { Lowerer } from '@prisma-next/family-sql/control-adapter';\nimport type {\n MigrationPlanWithAuthoringSurface,\n OpFactoryCall,\n} from '@prisma-next/framework-components/control';\nimport type { MigrationMeta } from '@prisma-next/migration-tools/migration';\nimport type { SqlitePlanTargetDetails } from './planner-target-details';\nimport { renderOps } from './render-ops';\nimport { renderCallsToTypeScript } from './render-typescript';\nimport { SqliteMigration } from './sqlite-migration';\n\ntype Op = SqlMigrationPlanOperation<SqlitePlanTargetDetails>;\n\nexport interface SqliteMigrationDestinationInfo {\n readonly storageHash: string;\n readonly profileHash?: string;\n}\n\nexport class TypeScriptRenderableSqliteMigration\n extends SqliteMigration\n implements MigrationPlanWithAuthoringSurface\n{\n readonly #calls: readonly OpFactoryCall[];\n readonly #meta: MigrationMeta;\n readonly #destination: SqliteMigrationDestinationInfo;\n readonly #spaceId: string;\n readonly #lowerer: Lowerer | undefined;\n\n constructor(\n calls: readonly OpFactoryCall[],\n meta: MigrationMeta,\n spaceId: string,\n destination?: SqliteMigrationDestinationInfo,\n lowerer?: Lowerer,\n ) {\n super();\n this.#calls = calls;\n this.#meta = meta;\n this.#spaceId = spaceId;\n this.#destination = destination ?? { storageHash: meta.to };\n this.#lowerer = lowerer;\n }\n\n override get operations(): readonly Op[] {\n return renderOps(this.#calls, this.#lowerer);\n }\n\n override describe(): MigrationMeta {\n return this.#meta;\n }\n\n override get destination(): SqliteMigrationDestinationInfo {\n return this.#destination;\n }\n\n /**\n * Contract space this planner-produced plan applies to. Threaded\n * from {@link SqlMigrationPlannerPlanOptions.spaceId} so the runner\n * keys the marker row by the right space when executing the plan.\n */\n get spaceId(): string {\n return this.#spaceId;\n }\n\n renderTypeScript(): string {\n return renderCallsToTypeScript(this.#calls, {\n from: this.#meta.from,\n to: this.#meta.to,\n });\n }\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;AA4BA,MAAM,eAA6C,CACjD;CAAE,iBAAiB;CAAiC,QAAQ;AAAY,GACxE;CAAE,iBAAiB;CAAiC,QAAQ;AAAe,CAC7E;AAEA,SAAgB,wBACd,OACA,MACQ;CACR,MAAM,UAAU,aAAa,K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AO,UAAU,KAAKJ,QAAQ,KAAKI,QAAQ;CAC7C;CAEA,WAAmC;EACjC,OAAO,KAAKH;CACd;CAEA,IAAa,cAA8C;EACzD,OAAO,KAAKC;CACd;;;;;;CAOA,IAAI,UAAkB;EACpB,OAAO,KAAKC;CACd;CAEA,mBAA2B;EACzB,OAAO,wBAAwB,KAAKH,QAAQ;GAC1C,MAAM,KAAKC,MAAM;GACjB,IAAI,KAAKA,MAAM;EACjB,CAAC;CACH;AACF"}
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import { blindCast } from "@prisma-next/utils/casts";
|
|
2
|
-
//#region src/core/migrations/render-ops.ts
|
|
3
|
-
function renderOps(calls, lowerer) {
|
|
4
|
-
return calls.map((c) => blindCast(c).toOp(lowerer));
|
|
5
|
-
}
|
|
6
|
-
//#endregion
|
|
7
|
-
export { renderOps as t };
|
|
8
|
-
|
|
9
|
-
//# sourceMappingURL=render-ops-D2IuTDVc.mjs.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"render-ops-D2IuTDVc.mjs","names":[],"sources":["../src/core/migrations/render-ops.ts"],"sourcesContent":["import type { SqlMigrationPlanOperation } from '@prisma-next/family-sql/control';\nimport type { Lowerer } from '@prisma-next/family-sql/control-adapter';\nimport type { OpFactoryCall } from '@prisma-next/framework-components/control';\nimport { blindCast } from '@prisma-next/utils/casts';\nimport type { SqlitePlanTargetDetails } from './planner-target-details';\n\ntype Op = SqlMigrationPlanOperation<SqlitePlanTargetDetails>;\n\nexport function renderOps(calls: readonly OpFactoryCall[], lowerer?: Lowerer): Op[] {\n // Each call's `toOp()` is typed as the framework `MigrationPlanOperation`;\n // every concrete Call class on the sqlite planner path produces an op\n // whose `target.details` is `SqlitePlanTargetDetails`-shaped (or whose\n // `target.details` is absent, which is structurally compatible). The\n // narrowing cast happens at this single integration boundary instead of\n // poisoning every caller's type.\n return calls.map(\n (c) =>\n blindCast<\n { toOp(lowerer?: Lowerer): ReturnType<OpFactoryCall['toOp']> },\n 'SQLite OpFactoryCall.toOp accepts an optional Lowerer; the framework interface omits it because not all targets need a lowerer — the SQLite target overrides with this extended signature'\n >(c).toOp(lowerer) as Op,\n );\n}\n"],"mappings":";;AAQA,SAAgB,UAAU,OAAiC,SAAyB;CAOlF,OAAO,MAAM,KACV,MACC,UAGE,CAAC,CAAC,CAAC,KAAK,OAAO,CACrB;AACF"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"sqlite-migration-znjM-dc_.d.mts","names":[],"sources":["../src/core/migrations/sqlite-migration.ts"],"mappings":";;;;;;;;;;AAuBA;;;;;;;;;;;uBAAsB,eAAA,SAAwB,SAAA,CAAa,uBAAA;EAAA,SAChD,QAAA;EADmC;;;;;;EAAA,mBASzB,cAAA,EAAgB,iBAAA;cAEvB,KAAA,GAAQ,YAAA;EAeV;;;;;EAAA,UAAA,WAAA,CAAY,OAAA;IAAA,SACX,KAAA;IAAA,SACA,WAAA;IAAA,SACA,OAAA,WAAkB,SAAA;IAAA,SAClB,WAAA,YAAuB,kBAAA;EAAA,IAC9B,yBAAA,CAA0B,uBAAA;AAAA"}
|