@prisma/orm-framework 0.17.0-dev.5 → 0.17.0-dev.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{codec-BgOWqkHY.mjs → codec-D6TctTla.mjs} +4 -7
- package/dist/codec-D6TctTla.mjs.map +1 -0
- package/dist/{codec-CA00Ry1D.d.mts → codec-LWTqo1GG.d.mts} +2 -6
- package/dist/{codec-CA00Ry1D.d.mts.map → codec-LWTqo1GG.d.mts.map} +1 -1
- package/dist/components.d.mts +3 -3
- package/dist/components.mjs +1 -1
- package/dist/components__codec.d.mts +1 -1
- package/dist/components__codec.mjs +1 -1
- package/dist/components__control.d.mts +2 -2
- package/dist/config-types-DzIlP4Ue.d.mts +1 -0
- package/dist/{config-types-W-87vhZ4-C9EfSelV.d.mts → config-types-W-87vhZ4-xE_-BXZD.d.mts} +3 -3
- package/dist/{config-types-W-87vhZ4-C9EfSelV.d.mts.map → config-types-W-87vhZ4-xE_-BXZD.d.mts.map} +1 -1
- package/dist/{config-validation-BIXlAfDp.d.mts → config-validation-B9uJhjX7.d.mts} +2 -2
- package/dist/{config-validation-BIXlAfDp.d.mts.map → config-validation-B9uJhjX7.d.mts.map} +1 -1
- package/dist/config.d.mts +3 -3
- package/dist/config__config-types.d.mts +2 -2
- package/dist/config__config-validation.d.mts +1 -1
- package/dist/contract-authoring.d.mts +1 -1
- package/dist/{control-BqePKqXl.d.mts → control-DavL9i47.d.mts} +2 -2
- package/dist/{control-BqePKqXl.d.mts.map → control-DavL9i47.d.mts.map} +1 -1
- package/dist/dist-DFakQfiQ.mjs +252 -0
- package/dist/dist-DFakQfiQ.mjs.map +1 -0
- package/dist/errors.d.mts +1 -1
- package/dist/errors__execution.d.mts +1 -1
- package/dist/{execution-NHK7O49Q.d.mts → execution-4sAWQx8X.d.mts} +2 -2
- package/dist/{execution-NHK7O49Q.d.mts.map → execution-4sAWQx8X.d.mts.map} +1 -1
- package/dist/ids.d.mts +1 -1
- package/dist/{index-GY2oGH9L.d.mts → index-CDk9yEbw.d.mts} +17 -2
- package/dist/{index-GY2oGH9L.d.mts.map → index-CDk9yEbw.d.mts.map} +1 -1
- package/dist/psl-parser.d.mts +1 -1
- package/dist/psl-parser__interpret.d.mts +2 -2
- package/dist/psl-printer.d.mts +1 -1
- package/dist/ts-render.d.mts +2 -2
- package/dist/ts-render.mjs +2 -240
- package/package.json +15 -15
- package/dist/codec-BgOWqkHY.mjs.map +0 -1
- package/dist/config-types-Dp4Ed57Y.d.mts +0 -1
- package/dist/ts-render.mjs.map +0 -1
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { r as voidParamsSchema } from "./codec-types-DcNvNeY1-BO6kUiH0.mjs";
|
|
2
|
+
import { i as tsStringLiteral } from "./dist-DFakQfiQ.mjs";
|
|
2
3
|
//#region ../../../1-framework/1-core/framework-components/dist/codec.mjs
|
|
3
4
|
/**
|
|
4
5
|
* Abstract base class for concrete codec implementations.
|
|
@@ -44,23 +45,19 @@ function column(codecFactory, codecId, typeParams, nativeType) {
|
|
|
44
45
|
};
|
|
45
46
|
}
|
|
46
47
|
/**
|
|
47
|
-
* Renders a codec-encoded value as a TypeScript literal (e.g. `
|
|
48
|
+
* Renders a codec-encoded value as a TypeScript literal (e.g. `"low"`, `1`, `true`), or `undefined`
|
|
48
49
|
* when the value isn't literal-expressible (objects, arrays, null).
|
|
49
50
|
*
|
|
50
51
|
* Valid **only for identity codecs** whose `encodeJson` output equals their decoded output type
|
|
51
52
|
* (text, int, float, bool). A non-identity codec (e.g. one that encodes to an int but decodes to a
|
|
52
53
|
* string literal) must NOT use this: it has to `decodeJson` first, then render, in its own
|
|
53
54
|
* `renderValueLiteral`.
|
|
54
|
-
*
|
|
55
|
-
* String values are fully escaped for a single-quoted `.d.ts` literal: backslash, single quote, and
|
|
56
|
-
* every character a raw single-quoted TS literal cannot contain — newline, carriage return, and the
|
|
57
|
-
* U+2028/U+2029 line/paragraph separators (which JS also treats as line terminators).
|
|
58
55
|
*/
|
|
59
56
|
function renderTsLiteral(value) {
|
|
60
|
-
if (typeof value === "string") return
|
|
57
|
+
if (typeof value === "string") return tsStringLiteral(value);
|
|
61
58
|
if (typeof value === "number" || typeof value === "boolean") return String(value);
|
|
62
59
|
}
|
|
63
60
|
//#endregion
|
|
64
61
|
export { renderTsLiteral as i, CodecImpl as n, column as r, CodecDescriptorImpl as t };
|
|
65
62
|
|
|
66
|
-
//# sourceMappingURL=codec-
|
|
63
|
+
//# sourceMappingURL=codec-D6TctTla.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"codec-D6TctTla.mjs","names":[],"sources":["../../../../1-framework/1-core/framework-components/dist/codec.mjs"],"sourcesContent":["import { r as voidParamsSchema, t as emptyCodecLookup } from \"./codec-types-DcNvNeY1.mjs\";\nimport { i as validateCodecTypeParams, n as materializeCodec, r as resolveCodecDescriptorOrThrow, t as CONTRACT_CODEC_DESCRIPTOR_MISSING } from \"./resolve-codec-BZF8TZh_.mjs\";\nimport { tsStringLiteral } from \"@internal/ts-render\";\n//#region src/shared/codec.ts\n/**\n* Abstract base class for concrete codec implementations.\n*\n* Codec authors extend this class with their typed `Id`, `TTraits`, `TWire`, `TInput` and override all four abstract conversion methods: `encode`, `decode`, `encodeJson`, and `decodeJson`. The runtime instance carries only its `id` (proxied through the descriptor so alias subclasses inherit the descriptor's id automatically) and the conversion methods — static metadata lives on the {@link CodecDescriptor}.\n*/\nvar CodecImpl = class {\n\tdescriptor;\n\t/**\n\t* Variance-erased descriptor reference. Concrete codec subclasses receive the typed descriptor in their own constructors and forward it via `super(descriptor)`; the variance erasure lives at this base because the abstract surface can't carry the concrete `TParams`.\n\t*/\n\tconstructor(descriptor) {\n\t\tthis.descriptor = descriptor;\n\t}\n\tget id() {\n\t\treturn this.descriptor.codecId;\n\t}\n};\n//#endregion\n//#region src/shared/codec-descriptor.ts\n/**\n* Abstract base class for concrete codec descriptors.\n*\n* Codec authors extend this class with their typed `TParams` and declare `codecId`, `traits`, `targetTypes`, `paramsSchema`, the curried `factory(params)`, and (optionally) `renderOutputType`.\n*\n* Implements the {@link CodecDescriptor} interface so a concrete subclass instance is directly usable wherever the framework expects a `CodecDescriptor<P>`.\n*/\nvar CodecDescriptorImpl = class {\n\t/** Boolean derived from `paramsSchema`: `true` whenever the schema is not the singleton `voidParamsSchema`. */\n\tget isParameterized() {\n\t\treturn this.paramsSchema !== voidParamsSchema;\n\t}\n};\n//#endregion\n//#region src/shared/column-spec.ts\n/**\n* Trivial column packager. Per-codec helpers call this directly with the result of `descriptor.factory(params)` — direct method invocation binds the descriptor's method-level generic at the call site and the literal flows through `R`.\n*\n* `nativeType` is the column's database-native type spelling — the value the postgres adapter's migration planner, the SQL renderer's cast policy, and the emitted contract's column `nativeType` slot read. Per-codec helpers pass the literal native-type string for their codec (e.g. `'text'`, `'int4'`, `'character varying'`); for codecs whose native-type spelling depends on parameters (none today; reserved for future shapes), the helper computes the rendered string before calling `column`. The framework does not derive the value from `codecId` — that mapping is target-specific and lives at the helper.\n*/\nfunction column(codecFactory, codecId, typeParams, nativeType) {\n\treturn {\n\t\tcodecFactory,\n\t\tcodecId,\n\t\ttypeParams,\n\t\tnativeType\n\t};\n}\n//#endregion\n//#region src/shared/render-ts-literal.ts\n/**\n* Renders a codec-encoded value as a TypeScript literal (e.g. `\"low\"`, `1`, `true`), or `undefined`\n* when the value isn't literal-expressible (objects, arrays, null).\n*\n* Valid **only for identity codecs** whose `encodeJson` output equals their decoded output type\n* (text, int, float, bool). A non-identity codec (e.g. one that encodes to an int but decodes to a\n* string literal) must NOT use this: it has to `decodeJson` first, then render, in its own\n* `renderValueLiteral`.\n*/\nfunction renderTsLiteral(value) {\n\tif (typeof value === \"string\") return tsStringLiteral(value);\n\tif (typeof value === \"number\" || typeof value === \"boolean\") return String(value);\n}\n//#endregion\nexport { CONTRACT_CODEC_DESCRIPTOR_MISSING, CodecDescriptorImpl, CodecImpl, column, emptyCodecLookup, materializeCodec, renderTsLiteral, resolveCodecDescriptorOrThrow, validateCodecTypeParams, voidParamsSchema };\n\n//# sourceMappingURL=codec.mjs.map"],"mappings":";;;;;;;;AASA,IAAI,YAAY,MAAM;CACrB;;;;CAIA,YAAY,YAAY;EACvB,KAAK,aAAa;CACnB;CACA,IAAI,KAAK;EACR,OAAO,KAAK,WAAW;CACxB;AACD;;;;;;;;AAUA,IAAI,sBAAsB,MAAM;;CAE/B,IAAI,kBAAkB;EACrB,OAAO,KAAK,iBAAiB;CAC9B;AACD;;;;;;AAQA,SAAS,OAAO,cAAc,SAAS,YAAY,YAAY;CAC9D,OAAO;EACN;EACA;EACA;EACA;CACD;AACD;;;;;;;;;;AAYA,SAAS,gBAAgB,OAAO;CAC/B,IAAI,OAAO,UAAU,UAAU,OAAO,gBAAgB,KAAK;CAC3D,IAAI,OAAO,UAAU,YAAY,OAAO,UAAU,WAAW,OAAO,OAAO,KAAK;AACjF"}
|
|
@@ -69,17 +69,13 @@ type ColumnHelperParams<D extends CodecDescriptor<any>> = Parameters<D['factory'
|
|
|
69
69
|
//#endregion
|
|
70
70
|
//#region src/shared/render-ts-literal.d.ts
|
|
71
71
|
/**
|
|
72
|
-
* Renders a codec-encoded value as a TypeScript literal (e.g. `
|
|
72
|
+
* Renders a codec-encoded value as a TypeScript literal (e.g. `"low"`, `1`, `true`), or `undefined`
|
|
73
73
|
* when the value isn't literal-expressible (objects, arrays, null).
|
|
74
74
|
*
|
|
75
75
|
* Valid **only for identity codecs** whose `encodeJson` output equals their decoded output type
|
|
76
76
|
* (text, int, float, bool). A non-identity codec (e.g. one that encodes to an int but decodes to a
|
|
77
77
|
* string literal) must NOT use this: it has to `decodeJson` first, then render, in its own
|
|
78
78
|
* `renderValueLiteral`.
|
|
79
|
-
*
|
|
80
|
-
* String values are fully escaped for a single-quoted `.d.ts` literal: backslash, single quote, and
|
|
81
|
-
* every character a raw single-quoted TS literal cannot contain — newline, carriage return, and the
|
|
82
|
-
* U+2028/U+2029 line/paragraph separators (which JS also treats as line terminators).
|
|
83
79
|
*/
|
|
84
80
|
declare function renderTsLiteral(value: JsonValue): string | undefined;
|
|
85
81
|
//#endregion
|
|
@@ -113,4 +109,4 @@ declare function validateCodecTypeParams(descriptor: AnyCodecDescriptor, ref: Co
|
|
|
113
109
|
declare function materializeCodec(descriptor: AnyCodecDescriptor, ref: CodecRef, ctx: CodecInstanceContext): Codec;
|
|
114
110
|
//#endregion
|
|
115
111
|
export { ColumnTypeDescriptor as a, renderTsLiteral as c, ColumnSpec as i, resolveCodecDescriptorOrThrow as l, ColumnHelperFor as n, column as o, ColumnHelperForStrict as r, materializeCodec as s, CONTRACT_CODEC_DESCRIPTOR_MISSING as t, validateCodecTypeParams as u };
|
|
116
|
-
//# sourceMappingURL=codec-
|
|
112
|
+
//# sourceMappingURL=codec-LWTqo1GG.d.mts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"codec-
|
|
1
|
+
{"version":3,"file":"codec-LWTqo1GG.d.mts","names":[],"sources":["../../../../1-framework/1-core/framework-components/dist/codec.d.mts"],"mappings":";;;;;;;;;;;KAUK,qBAAqB;WACf,SAAS;WACT;WACA,aAAa;WACb;;;;;;;;;WASA,WAAW;WACX,YAAY;;;;;;;;;KASlB;WACM;WACA;WACA;;;;;;;UAOD,WAAW,GAAG,UAAU,6CAA6C;WACpE,eAAe,KAAK,yBAAyB;WAC7C,YAAY;;;;;;;iBAON,OAAO,GAAG,UAAU,qCAAqC,eAAe,KAAK,yBAAyB,GAAG,iBAAiB,YAAY,GAAG,qBAAqB,WAAW,GAAG;;;;;;KAMxL,gBAAgB,UAAU,4BAA4B,gBAAgB,oBAAoB,mBAAmB;;;;KAI7G,sBAAsB,UAAU,4BAA4B,gBAAgB,WAAW,WAAW,WAAW,gBAAgB,mBAAmB;;;;KAIhJ,mBAAmB,UAAU,wBAAwB,WAAW,yBAAyB,0BAA0B,WAAW;;;;;;;;;;;;iBAYlH,gBAAgB,OAAO;;;cAG1B;;;;;;;iBAOG,8BAA8B,gBAAgB,oBAAoB,gCAAgC,KAAK,UAAU,iFAAiF;;;;;;;;;iBASlM,wBAAwB,YAAY,oBAAoB,KAAK;;;;;;;;;;iBAU7D,iBAAiB,YAAY,oBAAoB,KAAK,UAAU,KAAK,uBAAuB"}
|
package/dist/components.d.mts
CHANGED
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
import { a as CodecDescriptorImpl, c as CodecLookup, d as CodecTrait, f as emptyCodecLookup, i as CodecDescriptor, l as CodecRef, n as Codec, o as CodecImpl, p as voidParamsSchema, r as CodecCallContext, s as CodecInstanceContext, t as AnyCodecDescriptor, u as CodecRegistry } from "./codec-types-720XoDZ0-Br-QaYK3.mjs";
|
|
2
2
|
import { $ as hasRegisteredFieldNamespace, A as PslBlockParam, B as PslExtensionBlockParamList, C as AuthoringTemplateValue, D as AuthoringWarning, E as AuthoringTypeNamespace, F as PslDiagnosticCode, G as PslPosition, H as PslExtensionBlockParamRef, I as PslExtensionBlock, J as assertNoCrossRegistryCollisions, K as PslSpan, L as PslExtensionBlockAttribute, M as PslBlockParamOption, N as PslBlockParamRef, O as AuthoringWarningSink, P as PslBlockParamValue, Q as flushAuthoringWarnings, R as PslExtensionBlockAttributeArg, S as AuthoringStorageTypeTemplate, T as AuthoringTypeConstructorEntityRef, U as PslExtensionBlockParamScalarValue, V as PslExtensionBlockParamOption, W as PslExtensionBlockParamValue, X as classifyEnumMemberType, Y as assertResolvableTypeConstructorTemplates, Z as collectScalarTypeConstructors, _ as AuthoringModelAttributeLoweringOutput, a as AuthoringDiagnosticSink, at as isAuthoringFieldPresetDescriptor, b as AuthoringPslBlockDescriptorNamespace, c as AuthoringEntityTypeFactoryOutput, ct as isAuthoringTypeConstructorDescriptor, d as AuthoringFieldNamespace, dt as resolveEnumCodecId, et as instantiateAuthoringEntityType, f as AuthoringFieldPresetDescriptor, ft as validateAuthoringHelperArguments, g as AuthoringModelAttributeDescriptorNamespace, h as AuthoringModelAttributeDescriptor, i as AuthoringContributions, it as isAuthoringEntityTypeDescriptor, j as PslBlockParamList, k as ContributedPslDiagnosticCode, l as AuthoringEntityTypeNamespace, lt as mergeAuthoringNamespaces, m as AuthoringModelAttributeContext, n as AuthoringArgumentDescriptor, nt as instantiateAuthoringTypeConstructor, o as AuthoringEntityContext, ot as isAuthoringModelAttributeDescriptor, p as AuthoringFieldPresetOutput, q as ScalarTypeConstructorOutput, r as AuthoringColumnDefaultTemplate, rt as isAuthoringArgRef, s as AuthoringEntityTypeDescriptor, st as isAuthoringPslBlockDescriptor, t as AuthoringArgRef, tt as instantiateAuthoringFieldPreset, u as AuthoringEntityTypeTemplateOutput, ut as resolveAuthoringTemplateValue, v as AuthoringOption, w as AuthoringTypeConstructorDescriptor, x as AuthoringSelectRef, y as AuthoringPslBlockDescriptor, z as PslExtensionBlockParamBare } from "./framework-authoring--R1ZGWs1-C5F11Vhx.mjs";
|
|
3
3
|
import "./authoring-ljy8m56O.mjs";
|
|
4
|
-
import { a as ColumnTypeDescriptor, c as renderTsLiteral, i as ColumnSpec, l as resolveCodecDescriptorOrThrow, n as ColumnHelperFor, o as column, r as ColumnHelperForStrict, s as materializeCodec, t as CONTRACT_CODEC_DESCRIPTOR_MISSING, u as validateCodecTypeParams } from "./codec-
|
|
4
|
+
import { a as ColumnTypeDescriptor, c as renderTsLiteral, i as ColumnSpec, l as resolveCodecDescriptorOrThrow, n as ColumnHelperFor, o as column, r as ColumnHelperForStrict, s as materializeCodec, t as CONTRACT_CODEC_DESCRIPTOR_MISSING, u as validateCodecTypeParams } from "./codec-LWTqo1GG.mjs";
|
|
5
5
|
import { a as NamedAggregateOutput, c as TypesImportSpec, d as isAggregateDescriptor, f as isAnyInputAggregateDescriptor, i as AnyInputAggregateDescriptor, l as ValueInputAggregateDescriptor, n as AggregateInputMatch, o as NoInputAggregateDescriptor, p as isNoInputAggregateDescriptor, r as AggregateOutputCodec, s as SelfAggregateOutput, t as AggregateDescriptor, u as aggregateDescriptorKey } from "./types-import-spec-B4hKOPE9-BwQGG38j.mjs";
|
|
6
6
|
import { n as mergeCapabilityMatrices, t as CapabilityMatrix } from "./capabilities-Cupq4-1--C71ORI3N.mjs";
|
|
7
7
|
import { A as TargetPackRef, C as MutationDefaultGeneratorDescriptor, D as TargetBoundComponentDescriptor, E as SourceSpan, M as checkContractComponentRequirements, O as TargetDescriptor, S as LoweredDefaultValue, T as SourceDiagnostic, _ as ExtensionPackRef, a as ComponentMetadata, b as FamilyPackRef, c as ControlMutationDefaultEntry, d as DefaultFunctionLoweringContext, f as DriverDescriptor, g as ExtensionInstance, h as ExtensionDescriptor, i as ComponentDescriptor, j as TypedDefaultFunctionCall, k as TargetInstance, l as ControlMutationDefaultRegistry, m as DriverPackRef, n as AdapterInstance, o as ContractComponentRequirementsCheckInput, p as DriverInstance, r as AdapterPackRef, s as ContractComponentRequirementsCheckResult, t as AdapterDescriptor, u as ControlMutationDefaults, v as FamilyDescriptor, w as PackRefBase, x as LoweredDefaultResult, y as FamilyInstance } from "./framework-components-BQ_fYHtC-Co52pfO-.mjs";
|
|
8
8
|
import { a as SettledAggregateOverloads, i as SettledAggregateOperation, n as AggregateOverloadAmbiguity, o as settleAggregateOverloads, r as AggregateOverloadDuplicate, t as AggregateCodecTraits } from "./components-D7bixOE0.mjs";
|
|
9
9
|
import { a as keepInternalSpecifiers, i as ValidationContext, n as GenerateContractTypesOptions, o as resolveRequirementSpecifiers, r as ImportSpecifierResolver, t as EmissionSpi } from "./emission-types-6jLF1pS8-BZlRi3Ma.mjs";
|
|
10
10
|
import { A as makePslNamespace, C as PslReferentialAction, D as UNSPECIFIED_PSL_NAMESPACE_ID, E as PslUniqueConstraint, M as namespacePslExtensionBlocks, O as flatPslCompositeTypes, S as PslNamespaceEntry, T as PslTypesBlock, _ as PslIndexConstraint, a as PslAttributeArgument, b as PslNamedTypeDeclaration, c as PslAttributeTarget, d as PslDefaultLiteralValue, f as PslDefaultValue, g as PslFieldAttribute, h as PslField, i as PslAttribute, j as makePslNamespaceEntries, k as flatPslModels, l as PslCompositeType, m as PslDocumentAst, n as ParsePslDocumentInput, o as PslAttributeNamedArgument, p as PslDiagnostic, r as ParsePslDocumentResult, s as PslAttributePositionalArgument, t as BUILTIN_PSL_KIND_KEYS, u as PslDefaultFunctionValue, v as PslModel, w as PslTypeConstructorCall, x as PslNamespace, y as PslModelAttribute } from "./psl-ast-C4IAv2T_-CO0jh_VK.mjs";
|
|
11
|
-
import { t as ImportRequirement } from "./index-
|
|
12
|
-
import { $ as SchemaDiffIssue, A as MigrationPlan, At as diffSchemas, B as MigrationRunnerFailure, Bt as hasSchemaView, C as ExpectationFailureReason, Ct as assembleAuthoringContributions, D as MigrationOperationClass, Dt as contractSnapshotJsonSpecifier, E as MigrationMetadata, Et as buildExtensionLoadOrder, F as MigrationPlannerFailureResult, Ft as extractQueryOperationTypeImports, G as MigrationScaffoldContext, H as MigrationRunnerPerSpaceSuccessValue, Ht as orderIssuesByDependencies, I as MigrationPlannerResult, It as hasMigrations, J as OperationPreview, K as OpFactoryCall, L as MigrationPlannerSuccessResult, Lt as hasOperationPreview, M as MigrationPlanWithAuthoringSurface, Mt as extractCodecLookup, N as MigrationPlanner, Nt as extractCodecTypeImports, O as MigrationOperationPolicy, Ot as contractSnapshotTypesSpecifier, P as MigrationPlannerConflict, Pt as extractComponentIds, Q as SchemaDiff, R as MigrationRunner, Rt as hasPslContractInfer, S as EmitContractResult, St as VerifyDatabaseSchemaResult, T as MigratableTargetDescriptor, Tt as assertUniqueCodecOwner, U as MigrationRunnerResult, Ut as storageHashHex, V as MigrationRunnerPerSpaceOptions, Vt as issueOutcome, W as MigrationRunnerSuccessValue, X as OperationPreviewStatement, Y as OperationPreviewCapable, Z as PslContractInferCapable, _ as ControlTargetInstance, _t as VERIFY_CODE_TARGET_MISMATCH, a as ContractSpace, at as SchemaTreeNodeOptions, b as DiffSubjectGranularity, bt as VerifierOutcome, c as ControlAdapterInstance, ct as SchemaVerifyOptions, d as ControlExtensionDescriptor, dt as SchemaViewNodeKind, et as SchemaEntityCoordinate, f as ControlExtensionInstance, ft as SignDatabaseResult, g as ControlTargetDescriptor, gt as VERIFY_CODE_SCHEMA_FAILURE, h as ControlStack, ht as VERIFY_CODE_MARKER_MISSING, i as ContractSerializer, it as SchemaTreeNode, j as MigrationPlanOperation, jt as dispositionForCategory, k as MigrationPackage, kt as createControlStack, l as ControlDriverDescriptor, lt as SchemaVerifyResult, m as ControlFamilyInstance, mt as VERIFY_CODE_HASH_MISMATCH, n as AssembledAuthoringContributions, nt as SchemaOwnership, o as ContractSpaceHeadRef, ot as SchemaTreeVisitor, p as ControlFamilyDescriptor, pt as TargetMigrationsCapability, q as OperationContext, r as CONTRACT_SNAPSHOTS_DIRNAME, rt as SchemaSubjectClassifierCapable, s as ControlAdapterDescriptor, st as SchemaVerifier, t as APP_SPACE_ID, tt as SchemaNodeRef, u as ControlDriverInstance, ut as SchemaViewCapable, v as CoreSchemaView, vt as VerificationStatus, w as IntrospectSchemaResult, wt as assembleControlMutationDefaults, x as DiffableNode, xt as VerifyDatabaseResult, y as CreateControlStackInput, yt as VerifierIssueCategory, z as MigrationRunnerExecutionChecks, zt as hasSchemaSubjectClassifier } from "./control-
|
|
11
|
+
import { t as ImportRequirement } from "./index-CDk9yEbw.mjs";
|
|
12
|
+
import { $ as SchemaDiffIssue, A as MigrationPlan, At as diffSchemas, B as MigrationRunnerFailure, Bt as hasSchemaView, C as ExpectationFailureReason, Ct as assembleAuthoringContributions, D as MigrationOperationClass, Dt as contractSnapshotJsonSpecifier, E as MigrationMetadata, Et as buildExtensionLoadOrder, F as MigrationPlannerFailureResult, Ft as extractQueryOperationTypeImports, G as MigrationScaffoldContext, H as MigrationRunnerPerSpaceSuccessValue, Ht as orderIssuesByDependencies, I as MigrationPlannerResult, It as hasMigrations, J as OperationPreview, K as OpFactoryCall, L as MigrationPlannerSuccessResult, Lt as hasOperationPreview, M as MigrationPlanWithAuthoringSurface, Mt as extractCodecLookup, N as MigrationPlanner, Nt as extractCodecTypeImports, O as MigrationOperationPolicy, Ot as contractSnapshotTypesSpecifier, P as MigrationPlannerConflict, Pt as extractComponentIds, Q as SchemaDiff, R as MigrationRunner, Rt as hasPslContractInfer, S as EmitContractResult, St as VerifyDatabaseSchemaResult, T as MigratableTargetDescriptor, Tt as assertUniqueCodecOwner, U as MigrationRunnerResult, Ut as storageHashHex, V as MigrationRunnerPerSpaceOptions, Vt as issueOutcome, W as MigrationRunnerSuccessValue, X as OperationPreviewStatement, Y as OperationPreviewCapable, Z as PslContractInferCapable, _ as ControlTargetInstance, _t as VERIFY_CODE_TARGET_MISMATCH, a as ContractSpace, at as SchemaTreeNodeOptions, b as DiffSubjectGranularity, bt as VerifierOutcome, c as ControlAdapterInstance, ct as SchemaVerifyOptions, d as ControlExtensionDescriptor, dt as SchemaViewNodeKind, et as SchemaEntityCoordinate, f as ControlExtensionInstance, ft as SignDatabaseResult, g as ControlTargetDescriptor, gt as VERIFY_CODE_SCHEMA_FAILURE, h as ControlStack, ht as VERIFY_CODE_MARKER_MISSING, i as ContractSerializer, it as SchemaTreeNode, j as MigrationPlanOperation, jt as dispositionForCategory, k as MigrationPackage, kt as createControlStack, l as ControlDriverDescriptor, lt as SchemaVerifyResult, m as ControlFamilyInstance, mt as VERIFY_CODE_HASH_MISMATCH, n as AssembledAuthoringContributions, nt as SchemaOwnership, o as ContractSpaceHeadRef, ot as SchemaTreeVisitor, p as ControlFamilyDescriptor, pt as TargetMigrationsCapability, q as OperationContext, r as CONTRACT_SNAPSHOTS_DIRNAME, rt as SchemaSubjectClassifierCapable, s as ControlAdapterDescriptor, st as SchemaVerifier, t as APP_SPACE_ID, tt as SchemaNodeRef, u as ControlDriverInstance, ut as SchemaViewCapable, v as CoreSchemaView, vt as VerificationStatus, w as IntrospectSchemaResult, wt as assembleControlMutationDefaults, x as DiffableNode, xt as VerifyDatabaseResult, y as CreateControlStackInput, yt as VerifierIssueCategory, z as MigrationRunnerExecutionChecks, zt as hasSchemaSubjectClassifier } from "./control-DavL9i47.mjs";
|
|
13
13
|
import "./emission-PUUc-DK4.mjs";
|
|
14
14
|
import { a as RuntimeDriverDescriptor, c as RuntimeExtensionInstance, d as RuntimeTargetDescriptor, f as RuntimeTargetInstance, h as instantiateExecutionStack, i as RuntimeAdapterInstance, l as RuntimeFamilyDescriptor, m as createExecutionStack, n as ExecutionStackInstance, o as RuntimeDriverInstance, p as assertRuntimeContractRequirementsSatisfied, r as RuntimeAdapterDescriptor, s as RuntimeExtensionDescriptor, t as ExecutionStack, u as RuntimeFamilyInstance } from "./execution-BZIwXeq-.mjs";
|
|
15
15
|
import { t as isPlainRecord } from "./is-plain-record-C9BWiqcw.mjs";
|
package/dist/components.mjs
CHANGED
|
@@ -3,7 +3,7 @@ import { n as runtimeError, t as isRuntimeError } from "./runtime-error-BA9d7XjZ
|
|
|
3
3
|
import { _ as mergeAuthoringNamespaces, a as collectScalarTypeConstructors, b as validateAuthoringHelperArguments, c as instantiateAuthoringEntityType, d as isAuthoringArgRef, f as isAuthoringEntityTypeDescriptor, g as isAuthoringTypeConstructorDescriptor, h as isAuthoringPslBlockDescriptor, l as instantiateAuthoringFieldPreset, m as isAuthoringModelAttributeDescriptor, n as assertResolvableTypeConstructorTemplates, o as flushAuthoringWarnings, p as isAuthoringFieldPresetDescriptor, r as classifyEnumMemberType, s as hasRegisteredFieldNamespace, t as assertNoCrossRegistryCollisions, u as instantiateAuthoringTypeConstructor, v as resolveAuthoringTemplateValue, y as resolveEnumCodecId } from "./framework-authoring-CDEvlouU-mlMWSksD.mjs";
|
|
4
4
|
import { r as voidParamsSchema, t as emptyCodecLookup } from "./codec-types-DcNvNeY1-BO6kUiH0.mjs";
|
|
5
5
|
import { i as validateCodecTypeParams, n as materializeCodec, r as resolveCodecDescriptorOrThrow, t as CONTRACT_CODEC_DESCRIPTOR_MISSING } from "./resolve-codec-BZF8TZh_-D-xORT9Q.mjs";
|
|
6
|
-
import { i as renderTsLiteral, n as CodecImpl, r as column, t as CodecDescriptorImpl } from "./codec-
|
|
6
|
+
import { i as renderTsLiteral, n as CodecImpl, r as column, t as CodecDescriptorImpl } from "./codec-D6TctTla.mjs";
|
|
7
7
|
import { a as mergeCapabilityMatrices, i as isNoInputAggregateDescriptor, n as isAggregateDescriptor, r as isAnyInputAggregateDescriptor, t as aggregateDescriptorKey } from "./capabilities-D_lE1L0x-x4Dq0wCx.mjs";
|
|
8
8
|
import { t as checkContractComponentRequirements } from "./framework-components-D6j4Y5K7-RW9H184y.mjs";
|
|
9
9
|
import { t as settleAggregateOverloads } from "./components-ifbUGzY-.mjs";
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import { a as CodecDescriptorImpl, c as CodecLookup, d as CodecTrait, f as emptyCodecLookup, i as CodecDescriptor, l as CodecRef, n as Codec, o as CodecImpl, p as voidParamsSchema, r as CodecCallContext, s as CodecInstanceContext, t as AnyCodecDescriptor, u as CodecRegistry } from "./codec-types-720XoDZ0-Br-QaYK3.mjs";
|
|
2
|
-
import { a as ColumnTypeDescriptor, c as renderTsLiteral, i as ColumnSpec, l as resolveCodecDescriptorOrThrow, n as ColumnHelperFor, o as column, r as ColumnHelperForStrict, s as materializeCodec, t as CONTRACT_CODEC_DESCRIPTOR_MISSING, u as validateCodecTypeParams } from "./codec-
|
|
2
|
+
import { a as ColumnTypeDescriptor, c as renderTsLiteral, i as ColumnSpec, l as resolveCodecDescriptorOrThrow, n as ColumnHelperFor, o as column, r as ColumnHelperForStrict, s as materializeCodec, t as CONTRACT_CODEC_DESCRIPTOR_MISSING, u as validateCodecTypeParams } from "./codec-LWTqo1GG.mjs";
|
|
3
3
|
export { type AnyCodecDescriptor, CONTRACT_CODEC_DESCRIPTOR_MISSING, type Codec, type CodecCallContext, type CodecDescriptor, CodecDescriptorImpl, CodecImpl, type CodecInstanceContext, type CodecLookup, type CodecRef, type CodecRegistry, type CodecTrait, type ColumnHelperFor, type ColumnHelperForStrict, type ColumnSpec, type ColumnTypeDescriptor, column, emptyCodecLookup, materializeCodec, renderTsLiteral, resolveCodecDescriptorOrThrow, validateCodecTypeParams, voidParamsSchema };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import { r as voidParamsSchema, t as emptyCodecLookup } from "./codec-types-DcNvNeY1-BO6kUiH0.mjs";
|
|
2
2
|
import { i as validateCodecTypeParams, n as materializeCodec, r as resolveCodecDescriptorOrThrow, t as CONTRACT_CODEC_DESCRIPTOR_MISSING } from "./resolve-codec-BZF8TZh_-D-xORT9Q.mjs";
|
|
3
|
-
import { i as renderTsLiteral, n as CodecImpl, r as column, t as CodecDescriptorImpl } from "./codec-
|
|
3
|
+
import { i as renderTsLiteral, n as CodecImpl, r as column, t as CodecDescriptorImpl } from "./codec-D6TctTla.mjs";
|
|
4
4
|
export { CONTRACT_CODEC_DESCRIPTOR_MISSING, CodecDescriptorImpl, CodecImpl, column, emptyCodecLookup, materializeCodec, renderTsLiteral, resolveCodecDescriptorOrThrow, validateCodecTypeParams, voidParamsSchema };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import { C as MutationDefaultGeneratorDescriptor, E as SourceSpan, S as LoweredDefaultValue, T as SourceDiagnostic, c as ControlMutationDefaultEntry, d as DefaultFunctionLoweringContext, j as TypedDefaultFunctionCall, l as ControlMutationDefaultRegistry, u as ControlMutationDefaults, x as LoweredDefaultResult } from "./framework-components-BQ_fYHtC-Co52pfO-.mjs";
|
|
2
|
-
import { t as ImportRequirement } from "./index-
|
|
3
|
-
import { $ as SchemaDiffIssue, A as MigrationPlan, At as diffSchemas, B as MigrationRunnerFailure, Bt as hasSchemaView, C as ExpectationFailureReason, Ct as assembleAuthoringContributions, D as MigrationOperationClass, Dt as contractSnapshotJsonSpecifier, E as MigrationMetadata, Et as buildExtensionLoadOrder, F as MigrationPlannerFailureResult, Ft as extractQueryOperationTypeImports, G as MigrationScaffoldContext, H as MigrationRunnerPerSpaceSuccessValue, Ht as orderIssuesByDependencies, I as MigrationPlannerResult, It as hasMigrations, J as OperationPreview, K as OpFactoryCall, L as MigrationPlannerSuccessResult, Lt as hasOperationPreview, M as MigrationPlanWithAuthoringSurface, Mt as extractCodecLookup, N as MigrationPlanner, Nt as extractCodecTypeImports, O as MigrationOperationPolicy, Ot as contractSnapshotTypesSpecifier, P as MigrationPlannerConflict, Pt as extractComponentIds, Q as SchemaDiff, R as MigrationRunner, Rt as hasPslContractInfer, S as EmitContractResult, St as VerifyDatabaseSchemaResult, T as MigratableTargetDescriptor, Tt as assertUniqueCodecOwner, U as MigrationRunnerResult, Ut as storageHashHex, V as MigrationRunnerPerSpaceOptions, Vt as issueOutcome, W as MigrationRunnerSuccessValue, X as OperationPreviewStatement, Y as OperationPreviewCapable, Z as PslContractInferCapable, _ as ControlTargetInstance, _t as VERIFY_CODE_TARGET_MISMATCH, a as ContractSpace, at as SchemaTreeNodeOptions, b as DiffSubjectGranularity, bt as VerifierOutcome, c as ControlAdapterInstance, ct as SchemaVerifyOptions, d as ControlExtensionDescriptor, dt as SchemaViewNodeKind, et as SchemaEntityCoordinate, f as ControlExtensionInstance, ft as SignDatabaseResult, g as ControlTargetDescriptor, gt as VERIFY_CODE_SCHEMA_FAILURE, h as ControlStack, ht as VERIFY_CODE_MARKER_MISSING, i as ContractSerializer, it as SchemaTreeNode, j as MigrationPlanOperation, jt as dispositionForCategory, k as MigrationPackage, kt as createControlStack, l as ControlDriverDescriptor, lt as SchemaVerifyResult, m as ControlFamilyInstance, mt as VERIFY_CODE_HASH_MISMATCH, n as AssembledAuthoringContributions, nt as SchemaOwnership, o as ContractSpaceHeadRef, ot as SchemaTreeVisitor, p as ControlFamilyDescriptor, pt as TargetMigrationsCapability, q as OperationContext, r as CONTRACT_SNAPSHOTS_DIRNAME, rt as SchemaSubjectClassifierCapable, s as ControlAdapterDescriptor, st as SchemaVerifier, t as APP_SPACE_ID, tt as SchemaNodeRef, u as ControlDriverInstance, ut as SchemaViewCapable, v as CoreSchemaView, vt as VerificationStatus, w as IntrospectSchemaResult, wt as assembleControlMutationDefaults, x as DiffableNode, xt as VerifyDatabaseResult, y as CreateControlStackInput, yt as VerifierIssueCategory, z as MigrationRunnerExecutionChecks, zt as hasSchemaSubjectClassifier } from "./control-
|
|
2
|
+
import { t as ImportRequirement } from "./index-CDk9yEbw.mjs";
|
|
3
|
+
import { $ as SchemaDiffIssue, A as MigrationPlan, At as diffSchemas, B as MigrationRunnerFailure, Bt as hasSchemaView, C as ExpectationFailureReason, Ct as assembleAuthoringContributions, D as MigrationOperationClass, Dt as contractSnapshotJsonSpecifier, E as MigrationMetadata, Et as buildExtensionLoadOrder, F as MigrationPlannerFailureResult, Ft as extractQueryOperationTypeImports, G as MigrationScaffoldContext, H as MigrationRunnerPerSpaceSuccessValue, Ht as orderIssuesByDependencies, I as MigrationPlannerResult, It as hasMigrations, J as OperationPreview, K as OpFactoryCall, L as MigrationPlannerSuccessResult, Lt as hasOperationPreview, M as MigrationPlanWithAuthoringSurface, Mt as extractCodecLookup, N as MigrationPlanner, Nt as extractCodecTypeImports, O as MigrationOperationPolicy, Ot as contractSnapshotTypesSpecifier, P as MigrationPlannerConflict, Pt as extractComponentIds, Q as SchemaDiff, R as MigrationRunner, Rt as hasPslContractInfer, S as EmitContractResult, St as VerifyDatabaseSchemaResult, T as MigratableTargetDescriptor, Tt as assertUniqueCodecOwner, U as MigrationRunnerResult, Ut as storageHashHex, V as MigrationRunnerPerSpaceOptions, Vt as issueOutcome, W as MigrationRunnerSuccessValue, X as OperationPreviewStatement, Y as OperationPreviewCapable, Z as PslContractInferCapable, _ as ControlTargetInstance, _t as VERIFY_CODE_TARGET_MISMATCH, a as ContractSpace, at as SchemaTreeNodeOptions, b as DiffSubjectGranularity, bt as VerifierOutcome, c as ControlAdapterInstance, ct as SchemaVerifyOptions, d as ControlExtensionDescriptor, dt as SchemaViewNodeKind, et as SchemaEntityCoordinate, f as ControlExtensionInstance, ft as SignDatabaseResult, g as ControlTargetDescriptor, gt as VERIFY_CODE_SCHEMA_FAILURE, h as ControlStack, ht as VERIFY_CODE_MARKER_MISSING, i as ContractSerializer, it as SchemaTreeNode, j as MigrationPlanOperation, jt as dispositionForCategory, k as MigrationPackage, kt as createControlStack, l as ControlDriverDescriptor, lt as SchemaVerifyResult, m as ControlFamilyInstance, mt as VERIFY_CODE_HASH_MISMATCH, n as AssembledAuthoringContributions, nt as SchemaOwnership, o as ContractSpaceHeadRef, ot as SchemaTreeVisitor, p as ControlFamilyDescriptor, pt as TargetMigrationsCapability, q as OperationContext, r as CONTRACT_SNAPSHOTS_DIRNAME, rt as SchemaSubjectClassifierCapable, s as ControlAdapterDescriptor, st as SchemaVerifier, t as APP_SPACE_ID, tt as SchemaNodeRef, u as ControlDriverInstance, ut as SchemaViewCapable, v as CoreSchemaView, vt as VerificationStatus, w as IntrospectSchemaResult, wt as assembleControlMutationDefaults, x as DiffableNode, xt as VerifyDatabaseResult, y as CreateControlStackInput, yt as VerifierIssueCategory, z as MigrationRunnerExecutionChecks, zt as hasSchemaSubjectClassifier } from "./control-DavL9i47.mjs";
|
|
4
4
|
export { APP_SPACE_ID, type AssembledAuthoringContributions, CONTRACT_SNAPSHOTS_DIRNAME, type ContractSerializer, type ContractSpace, type ContractSpaceHeadRef, type ControlAdapterDescriptor, type ControlAdapterInstance, type ControlDriverDescriptor, type ControlDriverInstance, type ControlExtensionDescriptor, type ControlExtensionInstance, type ControlFamilyDescriptor, type ControlFamilyInstance, type ControlMutationDefaultEntry, type ControlMutationDefaultRegistry, type ControlMutationDefaults, type ControlStack, type ControlTargetDescriptor, type ControlTargetInstance, type CoreSchemaView, type CreateControlStackInput, type DefaultFunctionLoweringContext, type DiffSubjectGranularity, type DiffableNode, type EmitContractResult, type ExpectationFailureReason, type ImportRequirement, type IntrospectSchemaResult, type LoweredDefaultResult, type LoweredDefaultValue, type MigratableTargetDescriptor, type MigrationMetadata, type MigrationOperationClass, type MigrationOperationPolicy, type MigrationPackage, type MigrationPlan, type MigrationPlanOperation, type MigrationPlanWithAuthoringSurface, type MigrationPlanner, type MigrationPlannerConflict, type MigrationPlannerFailureResult, type MigrationPlannerResult, type MigrationPlannerSuccessResult, type MigrationRunner, type MigrationRunnerExecutionChecks, type MigrationRunnerFailure, type MigrationRunnerPerSpaceOptions, type MigrationRunnerPerSpaceSuccessValue, type MigrationRunnerResult, type MigrationRunnerSuccessValue, type MigrationScaffoldContext, type MutationDefaultGeneratorDescriptor, type OpFactoryCall, type OperationContext, type OperationPreview, type OperationPreviewCapable, type OperationPreviewStatement, type PslContractInferCapable, SchemaDiff, type SchemaDiffIssue, type SchemaEntityCoordinate, type SchemaNodeRef, type SchemaOwnership, type SchemaSubjectClassifierCapable, SchemaTreeNode, type SchemaTreeNodeOptions, type SchemaTreeVisitor, type SchemaVerifier, type SchemaVerifyOptions, type SchemaVerifyResult, type SchemaViewCapable, type SchemaViewNodeKind, type SignDatabaseResult, type SourceDiagnostic, type SourceSpan, type TargetMigrationsCapability, type TypedDefaultFunctionCall, VERIFY_CODE_HASH_MISMATCH, VERIFY_CODE_MARKER_MISSING, VERIFY_CODE_SCHEMA_FAILURE, VERIFY_CODE_TARGET_MISMATCH, type VerificationStatus, type VerifierIssueCategory, type VerifierOutcome, type VerifyDatabaseResult, type VerifyDatabaseSchemaResult, assembleAuthoringContributions, assembleControlMutationDefaults, assertUniqueCodecOwner, buildExtensionLoadOrder, contractSnapshotJsonSpecifier, contractSnapshotTypesSpecifier, createControlStack, diffSchemas, dispositionForCategory, extractCodecLookup, extractCodecTypeImports, extractComponentIds, extractQueryOperationTypeImports, hasMigrations, hasOperationPreview, hasPslContractInfer, hasSchemaSubjectClassifier, hasSchemaView, issueOutcome, orderIssuesByDependencies, storageHashHex };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import "./config-types-W-87vhZ4-xE_-BXZD.mjs";
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { t as Contract } from "./contract-types-CkdMH7F7-9EHXSwbH.mjs";
|
|
2
2
|
import { c as CodecLookup } from "./codec-types-720XoDZ0-Br-QaYK3.mjs";
|
|
3
|
-
import "./codec-
|
|
3
|
+
import "./codec-LWTqo1GG.mjs";
|
|
4
4
|
import { t as CapabilityMatrix } from "./capabilities-Cupq4-1--C71ORI3N.mjs";
|
|
5
5
|
import { u as ControlMutationDefaults } from "./framework-components-BQ_fYHtC-Co52pfO-.mjs";
|
|
6
6
|
import "./components-D7bixOE0.mjs";
|
|
7
7
|
import { r as Result } from "./result-Bpupv5vO.mjs";
|
|
8
|
-
import { d as ControlExtensionDescriptor, g as ControlTargetDescriptor, l as ControlDriverDescriptor, n as AssembledAuthoringContributions, p as ControlFamilyDescriptor, s as ControlAdapterDescriptor, u as ControlDriverInstance } from "./control-
|
|
8
|
+
import { d as ControlExtensionDescriptor, g as ControlTargetDescriptor, l as ControlDriverDescriptor, n as AssembledAuthoringContributions, p as ControlFamilyDescriptor, s as ControlAdapterDescriptor, u as ControlDriverInstance } from "./control-DavL9i47.mjs";
|
|
9
9
|
//#region ../../../1-framework/1-core/config/dist/config-types-W-87vhZ4.d.mts
|
|
10
10
|
//#region src/contract-source-types.d.ts
|
|
11
11
|
interface ContractSourceDiagnosticPosition {
|
|
@@ -159,4 +159,4 @@ interface PrismaNextConfig<TFamilyId extends string = string, TTargetId extends
|
|
|
159
159
|
declare function defineConfig<TFamilyId extends string = string, TTargetId extends string = string>(config: PrismaNextConfig<TFamilyId, TTargetId>): PrismaNextConfig<TFamilyId, TTargetId>;
|
|
160
160
|
//#endregion
|
|
161
161
|
export { normalizeContractConfig as _, ContractSourceDiagnosticSpan as a, ContractSourceProvider as c, FormatterConfig as d, OpaqueContractSourceProvider as f, defineConfig as g, TypeScriptContractSourceProvider as h, ContractSourceDiagnosticPosition as i, ContractSourceProviderBase as l, PslContractSourceProvider as m, ContractSourceContext as n, ContractSourceDiagnostics as o, PrismaNextConfig as p, ContractSourceDiagnostic as r, ContractSourceFormat as s, ContractConfig as t, DEFAULT_CONTRACT_SOURCE_DIR as u };
|
|
162
|
-
//# sourceMappingURL=config-types-W-87vhZ4-
|
|
162
|
+
//# sourceMappingURL=config-types-W-87vhZ4-xE_-BXZD.d.mts.map
|
package/dist/{config-types-W-87vhZ4-C9EfSelV.d.mts.map → config-types-W-87vhZ4-xE_-BXZD.d.mts.map}
RENAMED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"config-types-W-87vhZ4-
|
|
1
|
+
{"version":3,"file":"config-types-W-87vhZ4-xE_-BXZD.d.mts","names":[],"sources":["../../../../1-framework/1-core/config/dist/config-types-W-87vhZ4.d.mts"],"mappings":";;;;;;;;;;UAMU;WACC;WACA;WACA;;UAED;WACC,OAAO;WACP,KAAK;;UAEN;WACC;WACA;WACA;WACA,OAAO;;;;;;WAMP,OAAO,SAAS;;UAEjB;WACC;WACA,sBAAsB;WACtB,OAAO;;UAER;WACC;;WAEA,4BAA4B,oBAAoB;WAChD,wBAAwB;WACxB,aAAa;WACb,yBAAyB;WACzB;WACA,cAAc;;;KAGpB;UACK;WACC;WACA,OAAO,SAAS,0BAA0B,QAAQ,OAAO,UAAU;;UAEpE,kCAAkC;WACjC;;UAED,yCAAyC;WACxC;;;;;;;;UAQD,qCAAqC;WACpC;;KAEN,yBAAyB,4BAA4B,mCAAmC;;;;;;UAMnF;;;;;WAKC,QAAQ;;;;;;;WAOR;;UAED;WACC;WACA;;;;;;;cAOG;iBACG,wBAAwB,UAAU,iBAAiB;WACzD;;;;;;;;;;UAUD,iBAAiB,mCAAmC,mCAAmC;WACtF,QAAQ,wBAAwB;WAChC,QAAQ,wBAAwB,WAAW;WAC3C,SAAS,yBAAyB,WAAW;WAC7C,sBAAsB,2BAA2B,WAAW;;;;;;;WAO5D,SAAS,wBAAwB,WAAW,WAAW,sBAAsB,WAAW,YAAY;;;;;WAKpG;;;;;;aAME,aAAa;;;;;;WAMf,WAAW;;;;WAIX;;aAEE;;WAEF,YAAY;;;;;;;;;;;;;;iBAcN,aAAa,mCAAmC,mCAAmC,QAAQ,iBAAiB,WAAW,aAAa,iBAAiB,WAAW"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { p as PrismaNextConfig } from "./config-types-W-87vhZ4-
|
|
1
|
+
import { p as PrismaNextConfig } from "./config-types-W-87vhZ4-xE_-BXZD.mjs";
|
|
2
2
|
//#region ../../../1-framework/1-core/config/dist/config-validation.d.mts
|
|
3
3
|
//#region src/config-validation.d.ts
|
|
4
4
|
/**
|
|
@@ -11,4 +11,4 @@ import { p as PrismaNextConfig } from "./config-types-W-87vhZ4-C9EfSelV.mjs";
|
|
|
11
11
|
declare function validateConfig(config: unknown): asserts config is PrismaNextConfig;
|
|
12
12
|
//#endregion
|
|
13
13
|
export { validateConfig as t };
|
|
14
|
-
//# sourceMappingURL=config-validation-
|
|
14
|
+
//# sourceMappingURL=config-validation-B9uJhjX7.d.mts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"config-validation-
|
|
1
|
+
{"version":3,"file":"config-validation-B9uJhjX7.d.mts","names":[],"sources":["../../../../1-framework/1-core/config/dist/config-validation.d.mts"],"mappings":";;;;;;;;;;iBASiB,eAAe,0BAA0B,UAAU"}
|
package/dist/config.d.mts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { _ as normalizeContractConfig, a as ContractSourceDiagnosticSpan, c as ContractSourceProvider, d as FormatterConfig, f as OpaqueContractSourceProvider, g as defineConfig, h as TypeScriptContractSourceProvider, i as ContractSourceDiagnosticPosition, l as ContractSourceProviderBase, m as PslContractSourceProvider, n as ContractSourceContext, o as ContractSourceDiagnostics, p as PrismaNextConfig, r as ContractSourceDiagnostic, s as ContractSourceFormat, t as ContractConfig, u as DEFAULT_CONTRACT_SOURCE_DIR } from "./config-types-W-87vhZ4-
|
|
2
|
-
import "./config-types-
|
|
3
|
-
import { t as validateConfig } from "./config-validation-
|
|
1
|
+
import { _ as normalizeContractConfig, a as ContractSourceDiagnosticSpan, c as ContractSourceProvider, d as FormatterConfig, f as OpaqueContractSourceProvider, g as defineConfig, h as TypeScriptContractSourceProvider, i as ContractSourceDiagnosticPosition, l as ContractSourceProviderBase, m as PslContractSourceProvider, n as ContractSourceContext, o as ContractSourceDiagnostics, p as PrismaNextConfig, r as ContractSourceDiagnostic, s as ContractSourceFormat, t as ContractConfig, u as DEFAULT_CONTRACT_SOURCE_DIR } from "./config-types-W-87vhZ4-xE_-BXZD.mjs";
|
|
2
|
+
import "./config-types-DzIlP4Ue.mjs";
|
|
3
|
+
import { t as validateConfig } from "./config-validation-B9uJhjX7.mjs";
|
|
4
4
|
export { type ContractConfig, type ContractSourceContext, type ContractSourceDiagnostic, type ContractSourceDiagnosticPosition, type ContractSourceDiagnosticSpan, type ContractSourceDiagnostics, type ContractSourceFormat, type ContractSourceProvider, type ContractSourceProviderBase, DEFAULT_CONTRACT_SOURCE_DIR, type FormatterConfig, type OpaqueContractSourceProvider, type PrismaNextConfig, type PslContractSourceProvider, type TypeScriptContractSourceProvider, defineConfig, normalizeContractConfig, validateConfig };
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import { _ as normalizeContractConfig, a as ContractSourceDiagnosticSpan, c as ContractSourceProvider, d as FormatterConfig, f as OpaqueContractSourceProvider, g as defineConfig, h as TypeScriptContractSourceProvider, i as ContractSourceDiagnosticPosition, l as ContractSourceProviderBase, m as PslContractSourceProvider, n as ContractSourceContext, o as ContractSourceDiagnostics, p as PrismaNextConfig, r as ContractSourceDiagnostic, s as ContractSourceFormat, t as ContractConfig, u as DEFAULT_CONTRACT_SOURCE_DIR } from "./config-types-W-87vhZ4-
|
|
2
|
-
import "./config-types-
|
|
1
|
+
import { _ as normalizeContractConfig, a as ContractSourceDiagnosticSpan, c as ContractSourceProvider, d as FormatterConfig, f as OpaqueContractSourceProvider, g as defineConfig, h as TypeScriptContractSourceProvider, i as ContractSourceDiagnosticPosition, l as ContractSourceProviderBase, m as PslContractSourceProvider, n as ContractSourceContext, o as ContractSourceDiagnostics, p as PrismaNextConfig, r as ContractSourceDiagnostic, s as ContractSourceFormat, t as ContractConfig, u as DEFAULT_CONTRACT_SOURCE_DIR } from "./config-types-W-87vhZ4-xE_-BXZD.mjs";
|
|
2
|
+
import "./config-types-DzIlP4Ue.mjs";
|
|
3
3
|
export { type ContractConfig, type ContractSourceContext, type ContractSourceDiagnostic, type ContractSourceDiagnosticPosition, type ContractSourceDiagnosticSpan, type ContractSourceDiagnostics, type ContractSourceFormat, type ContractSourceProvider, type ContractSourceProviderBase, DEFAULT_CONTRACT_SOURCE_DIR, type FormatterConfig, type OpaqueContractSourceProvider, type PrismaNextConfig, type PslContractSourceProvider, type TypeScriptContractSourceProvider, defineConfig, normalizeContractConfig };
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { t as validateConfig } from "./config-validation-
|
|
1
|
+
import { t as validateConfig } from "./config-validation-B9uJhjX7.mjs";
|
|
2
2
|
export { validateConfig };
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { l as AuthoringEntityTypeNamespace, o as AuthoringEntityContext, s as AuthoringEntityTypeDescriptor } from "./framework-authoring--R1ZGWs1-C5F11Vhx.mjs";
|
|
2
2
|
import "./authoring-ljy8m56O.mjs";
|
|
3
|
-
import { a as ColumnTypeDescriptor } from "./codec-
|
|
3
|
+
import { a as ColumnTypeDescriptor } from "./codec-LWTqo1GG.mjs";
|
|
4
4
|
//#region ../../../1-framework/2-authoring/contract/dist/index.d.mts
|
|
5
5
|
//#region src/capability-registry.d.ts
|
|
6
6
|
type CapabilityMatrix = Readonly<Record<string, Readonly<Record<string, boolean>>>>;
|
|
@@ -7,7 +7,7 @@ import { t as CapabilityMatrix } from "./capabilities-Cupq4-1--C71ORI3N.mjs";
|
|
|
7
7
|
import { D as TargetBoundComponentDescriptor, O as TargetDescriptor, a as ComponentMetadata, f as DriverDescriptor, g as ExtensionInstance, h as ExtensionDescriptor, k as TargetInstance, n as AdapterInstance, p as DriverInstance, t as AdapterDescriptor, u as ControlMutationDefaults, v as FamilyDescriptor, y as FamilyInstance } from "./framework-components-BQ_fYHtC-Co52pfO-.mjs";
|
|
8
8
|
import { r as ImportSpecifierResolver, t as EmissionSpi } from "./emission-types-6jLF1pS8-BZlRi3Ma.mjs";
|
|
9
9
|
import { m as PslDocumentAst } from "./psl-ast-C4IAv2T_-CO0jh_VK.mjs";
|
|
10
|
-
import { t as ImportRequirement } from "./index-
|
|
10
|
+
import { t as ImportRequirement } from "./index-CDk9yEbw.mjs";
|
|
11
11
|
import { n as JsonObject } from "./json-Dkqr3say.mjs";
|
|
12
12
|
import { i as StorageSort, n as PreserveEmptyPredicate } from "./canonicalization-DFpB09nP-4OdB2nsy.mjs";
|
|
13
13
|
import { r as Result } from "./result-Bpupv5vO.mjs";
|
|
@@ -1384,4 +1384,4 @@ type VerifierIssueCategory = 'declaredMissing' | 'declaredIncompatible' | 'value
|
|
|
1384
1384
|
declare function dispositionForCategory(controlPolicy: ControlPolicy, category: VerifierIssueCategory): VerifierOutcome;
|
|
1385
1385
|
//#endregion
|
|
1386
1386
|
export { SchemaDiffIssue as $, MigrationPlan as A, diffSchemas as At, MigrationRunnerFailure as B, hasSchemaView as Bt, ExpectationFailureReason as C, assembleAuthoringContributions as Ct, MigrationOperationClass as D, contractSnapshotJsonSpecifier as Dt, MigrationMetadata as E, buildExtensionLoadOrder as Et, MigrationPlannerFailureResult as F, extractQueryOperationTypeImports as Ft, MigrationScaffoldContext as G, MigrationRunnerPerSpaceSuccessValue as H, orderIssuesByDependencies as Ht, MigrationPlannerResult as I, hasMigrations as It, OperationPreview as J, OpFactoryCall as K, MigrationPlannerSuccessResult as L, hasOperationPreview as Lt, MigrationPlanWithAuthoringSurface as M, extractCodecLookup as Mt, MigrationPlanner as N, extractCodecTypeImports as Nt, MigrationOperationPolicy as O, contractSnapshotTypesSpecifier as Ot, MigrationPlannerConflict as P, extractComponentIds as Pt, SchemaDiff as Q, MigrationRunner as R, hasPslContractInfer as Rt, EmitContractResult as S, VerifyDatabaseSchemaResult as St, MigratableTargetDescriptor as T, assertUniqueCodecOwner as Tt, MigrationRunnerResult as U, storageHashHex as Ut, MigrationRunnerPerSpaceOptions as V, issueOutcome as Vt, MigrationRunnerSuccessValue as W, OperationPreviewStatement as X, OperationPreviewCapable as Y, PslContractInferCapable as Z, ControlTargetInstance as _, VERIFY_CODE_TARGET_MISMATCH as _t, ContractSpace as a, SchemaTreeNodeOptions as at, DiffSubjectGranularity as b, VerifierOutcome as bt, ControlAdapterInstance as c, SchemaVerifyOptions as ct, ControlExtensionDescriptor as d, SchemaViewNodeKind as dt, SchemaEntityCoordinate as et, ControlExtensionInstance as f, SignDatabaseResult as ft, ControlTargetDescriptor as g, VERIFY_CODE_SCHEMA_FAILURE as gt, ControlStack as h, VERIFY_CODE_MARKER_MISSING as ht, ContractSerializer as i, SchemaTreeNode as it, MigrationPlanOperation as j, dispositionForCategory as jt, MigrationPackage as k, createControlStack as kt, ControlDriverDescriptor as l, SchemaVerifyResult as lt, ControlFamilyInstance as m, VERIFY_CODE_HASH_MISMATCH as mt, AssembledAuthoringContributions as n, SchemaOwnership as nt, ContractSpaceHeadRef as o, SchemaTreeVisitor as ot, ControlFamilyDescriptor as p, TargetMigrationsCapability as pt, OperationContext as q, CONTRACT_SNAPSHOTS_DIRNAME as r, SchemaSubjectClassifierCapable as rt, ControlAdapterDescriptor as s, SchemaVerifier as st, APP_SPACE_ID as t, SchemaNodeRef as tt, ControlDriverInstance as u, SchemaViewCapable as ut, CoreSchemaView as v, VerificationStatus as vt, IntrospectSchemaResult as w, assembleControlMutationDefaults as wt, DiffableNode as x, VerifyDatabaseResult as xt, CreateControlStackInput as y, VerifierIssueCategory as yt, MigrationRunnerExecutionChecks as z, hasSchemaSubjectClassifier as zt };
|
|
1387
|
-
//# sourceMappingURL=control-
|
|
1387
|
+
//# sourceMappingURL=control-DavL9i47.d.mts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"control-
|
|
1
|
+
{"version":3,"file":"control-DavL9i47.d.mts","names":[],"sources":["../../../../1-framework/1-core/framework-components/dist/control.d.mts"],"mappings":";;;;;;;;;;;;;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WU9Kjt.mjs";
|
|
2
|
+
import { t as InternalError } from "./internal-error-BIc-ehme-ouBQPoEL.mjs";
|
|
3
|
+
//#region ../../../1-framework/1-core/ts-render/dist/index.mjs
|
|
4
|
+
/**
|
|
5
|
+
* Renders a string as a TypeScript source-text literal.
|
|
6
|
+
*
|
|
7
|
+
* `JSON.stringify` already escapes quotes, backslashes, and control characters
|
|
8
|
+
* exactly as TypeScript needs; it leaves U+2028/U+2029 unescaped, which legacy
|
|
9
|
+
* parsers treat as line terminators, so those are escaped explicitly.
|
|
10
|
+
*
|
|
11
|
+
* Used for both value literals (`jsonToTsSource`) and type-level literals /
|
|
12
|
+
* property keys (the contract emitter), so a physical name that a store admits
|
|
13
|
+
* as a quoted identifier but TypeScript does not admit bare renders the same
|
|
14
|
+
* way everywhere.
|
|
15
|
+
*/
|
|
16
|
+
function tsStringLiteral(value) {
|
|
17
|
+
return JSON.stringify(value).replace(/\u2028/g, "\\u2028").replace(/\u2029/g, "\\u2029");
|
|
18
|
+
}
|
|
19
|
+
/**
|
|
20
|
+
* Pure JSON-to-TypeScript-source printer.
|
|
21
|
+
*
|
|
22
|
+
* This module is the second stage of the codec → TS pipeline:
|
|
23
|
+
*
|
|
24
|
+
* jsValue → codec.encodeJson → JsonValue → jsonToTsSource → TS source text
|
|
25
|
+
*
|
|
26
|
+
* Stage 1 (`codec.encodeJson`) is a codec responsibility — date serialization,
|
|
27
|
+
* opaque domain types (vector, bigint, uuid), JSON canonicalization. Stage 2
|
|
28
|
+
* (this module) is a pure JSON-to-TS printer that must never grow type-specific
|
|
29
|
+
* branches.
|
|
30
|
+
*
|
|
31
|
+
* To render a non-JSON JS value (Date, Vector, BigInt, Buffer, …), encode it
|
|
32
|
+
* through the relevant codec's `encodeJson` first. Adding special cases to
|
|
33
|
+
* this file is not the answer — that's what codecs are for.
|
|
34
|
+
*/
|
|
35
|
+
/**
|
|
36
|
+
* Render a JSON-compatible value as a TypeScript source-text literal.
|
|
37
|
+
*
|
|
38
|
+
* Accepts `unknown` for ergonomics with structural types (e.g. `ColumnSpec`,
|
|
39
|
+
* `ForeignKeySpec`) whose fields are all JSON-compatible but whose interfaces
|
|
40
|
+
* lack the index signature TypeScript requires for `JsonObject` assignability.
|
|
41
|
+
* Non-JSON values (Date, Symbol, Function, etc.) throw at runtime.
|
|
42
|
+
*/
|
|
43
|
+
function jsonToTsSource(value) {
|
|
44
|
+
if (value === void 0) return "undefined";
|
|
45
|
+
if (value === null) return "null";
|
|
46
|
+
if (typeof value === "string") return tsStringLiteral(value);
|
|
47
|
+
if (typeof value === "number" || typeof value === "boolean") return String(value);
|
|
48
|
+
if (Array.isArray(value)) {
|
|
49
|
+
if (value.length === 0) return "[]";
|
|
50
|
+
const items = value.map((v) => jsonToTsSource(v));
|
|
51
|
+
const singleLine = `[${items.join(", ")}]`;
|
|
52
|
+
if (singleLine.length <= 80) return singleLine;
|
|
53
|
+
return `[\n${items.map((i) => ` ${i}`).join(",\n")},\n]`;
|
|
54
|
+
}
|
|
55
|
+
if (typeof value === "object") {
|
|
56
|
+
const entries = Object.entries(value).filter(([, v]) => v !== void 0);
|
|
57
|
+
if (entries.length === 0) return "{}";
|
|
58
|
+
const items = entries.map(([k, v]) => `${renderKey(k)}: ${jsonToTsSource(v)}`);
|
|
59
|
+
const singleLine = `{ ${items.join(", ")} }`;
|
|
60
|
+
if (singleLine.length <= 80) return singleLine;
|
|
61
|
+
return `{\n${items.map((i) => ` ${i}`).join(",\n")},\n}`;
|
|
62
|
+
}
|
|
63
|
+
throw new InternalError(`jsonToTsSource: unsupported value type "${typeof value}"`);
|
|
64
|
+
}
|
|
65
|
+
function renderKey(key) {
|
|
66
|
+
if (key === "__proto__") return tsStringLiteral(key);
|
|
67
|
+
return /^[a-zA-Z_$][a-zA-Z0-9_$]*$/.test(key) ? key : tsStringLiteral(key);
|
|
68
|
+
}
|
|
69
|
+
function contractError(code, message, options) {
|
|
70
|
+
return structuredError(code, message, options);
|
|
71
|
+
}
|
|
72
|
+
/**
|
|
73
|
+
* Render an aggregated `import` block from a flat list of
|
|
74
|
+
* `ImportRequirement`s. Each target's migration renderer collects
|
|
75
|
+
* requirements polymorphically from its call nodes and pipes them here.
|
|
76
|
+
*
|
|
77
|
+
* The emitter invariants:
|
|
78
|
+
*
|
|
79
|
+
* - **Usually one line per module specifier.** Named imports are aggregated
|
|
80
|
+
* and emitted sorted; a single default symbol is combined onto the same
|
|
81
|
+
* line when attributes agree (`import def, { a, b } from "m";`). Aliased
|
|
82
|
+
* symbols render `symbol as alias`. When every symbol for a module is
|
|
83
|
+
* `typeOnly`, the statement collapses to `import type { … }`; a module
|
|
84
|
+
* mixing value and type symbols prefixes the type-only ones
|
|
85
|
+
* (`import { type T, v }`). Exceptions that split into multiple lines: a
|
|
86
|
+
* fully type-only statement with both a default and one or more named
|
|
87
|
+
* bindings (`import type D from "m";` then `import type { N } from "m";`,
|
|
88
|
+
* because TypeScript rejects `import type D, { N } from "m"` — TS1363),
|
|
89
|
+
* and multiple distinct default symbols (see below).
|
|
90
|
+
* - **Multiple distinct default symbols per module are allowed.** JS permits
|
|
91
|
+
* re-importing the same specifier under different default-binding names
|
|
92
|
+
* (`import a from 'm'; import b from 'm';`), so each distinct default
|
|
93
|
+
* symbol renders its own `import` line, sorted alphabetically; a repeated
|
|
94
|
+
* requirement for the same symbol still collapses into one binding,
|
|
95
|
+
* merging `typeOnly` by AND.
|
|
96
|
+
* - **Attribute unanimity per module.** All requirements for the same
|
|
97
|
+
* module specifier must carry the same (or no) `attributes` map.
|
|
98
|
+
* Divergent attribute maps throw — they can't collapse to one line
|
|
99
|
+
* and there's no user-resolvable recovery at this layer.
|
|
100
|
+
* - **Distinct (symbol, alias) pairs are distinct bindings.** TypeScript
|
|
101
|
+
* permits importing the same export under multiple local names, so
|
|
102
|
+
* `{ A }` + `{ A as B }` renders as `import { A, A as B } from "m"` and
|
|
103
|
+
* `{ A as B }` + `{ A as C }` renders as `import { A as B, A as C } from "m"`.
|
|
104
|
+
* Truly identical `(symbol, alias)` pairs still collapse to one binding,
|
|
105
|
+
* merging `typeOnly` by AND.
|
|
106
|
+
* - **Deterministic ordering.** Modules are emitted sorted by specifier;
|
|
107
|
+
* within a module, named bindings are emitted sorted by `(symbol, alias)`
|
|
108
|
+
* using JavaScript code-unit comparison, with the un-aliased form (no
|
|
109
|
+
* alias) treated as alias `""` so it sorts before any aliased form of the
|
|
110
|
+
* same symbol.
|
|
111
|
+
*
|
|
112
|
+
* Returns a string containing one or more import lines per module (see the
|
|
113
|
+
* splitting exceptions above), joined by `\n` (no trailing newline). An
|
|
114
|
+
* empty requirement list returns `""`.
|
|
115
|
+
*/
|
|
116
|
+
function renderImports(requirements) {
|
|
117
|
+
return [...aggregateByModule(requirements).entries()].sort(([a], [b]) => a.localeCompare(b)).map(([moduleSpecifier, group]) => renderModuleImport(moduleSpecifier, group)).join("\n");
|
|
118
|
+
}
|
|
119
|
+
function aggregateByModule(requirements) {
|
|
120
|
+
const byModule = /* @__PURE__ */ new Map();
|
|
121
|
+
for (const req of requirements) {
|
|
122
|
+
let group = byModule.get(req.moduleSpecifier);
|
|
123
|
+
if (!group) {
|
|
124
|
+
group = {
|
|
125
|
+
named: /* @__PURE__ */ new Map(),
|
|
126
|
+
defaults: /* @__PURE__ */ new Map(),
|
|
127
|
+
attributes: null,
|
|
128
|
+
attributesSet: false
|
|
129
|
+
};
|
|
130
|
+
byModule.set(req.moduleSpecifier, group);
|
|
131
|
+
}
|
|
132
|
+
mergeRequirementIntoGroup(req, group);
|
|
133
|
+
}
|
|
134
|
+
return byModule;
|
|
135
|
+
}
|
|
136
|
+
function mergeRequirementIntoGroup(req, group) {
|
|
137
|
+
const kind = req.kind ?? "named";
|
|
138
|
+
const typeOnly = req.typeOnly === true;
|
|
139
|
+
if (kind === "default") {
|
|
140
|
+
const existingTypeOnly = group.defaults.get(req.symbol);
|
|
141
|
+
group.defaults.set(req.symbol, existingTypeOnly === void 0 ? typeOnly : existingTypeOnly && typeOnly);
|
|
142
|
+
} else {
|
|
143
|
+
const alias = req.alias && req.alias !== req.symbol ? req.alias : null;
|
|
144
|
+
const key = namedBindingKey(req.symbol, alias);
|
|
145
|
+
const existing = group.named.get(key);
|
|
146
|
+
if (existing) existing.typeOnly = existing.typeOnly && typeOnly;
|
|
147
|
+
else group.named.set(key, {
|
|
148
|
+
symbol: req.symbol,
|
|
149
|
+
alias,
|
|
150
|
+
typeOnly
|
|
151
|
+
});
|
|
152
|
+
}
|
|
153
|
+
mergeAttributes(req, group);
|
|
154
|
+
}
|
|
155
|
+
function mergeAttributes(req, group) {
|
|
156
|
+
const incoming = req.attributes ?? null;
|
|
157
|
+
if (!group.attributesSet) {
|
|
158
|
+
group.attributes = incoming;
|
|
159
|
+
group.attributesSet = true;
|
|
160
|
+
return;
|
|
161
|
+
}
|
|
162
|
+
if (!attributesEqual(group.attributes, incoming)) throw contractError("CONTRACT.PACK_CONTRIBUTION_INVALID", `Conflicting import attributes for module "${req.moduleSpecifier}": ${stringifyAttributes(group.attributes)} vs ${stringifyAttributes(incoming)}.`, { meta: { moduleSpecifier: req.moduleSpecifier } });
|
|
163
|
+
}
|
|
164
|
+
function attributesEqual(a, b) {
|
|
165
|
+
if (a === b) return true;
|
|
166
|
+
if (a === null || b === null) return false;
|
|
167
|
+
const aKeys = Object.keys(a).sort();
|
|
168
|
+
const bKeys = Object.keys(b).sort();
|
|
169
|
+
if (aKeys.length !== bKeys.length) return false;
|
|
170
|
+
for (let i = 0; i < aKeys.length; i++) {
|
|
171
|
+
const key = aKeys[i];
|
|
172
|
+
if (key !== bKeys[i]) return false;
|
|
173
|
+
if (a[key] !== b[key]) return false;
|
|
174
|
+
}
|
|
175
|
+
return true;
|
|
176
|
+
}
|
|
177
|
+
function stringifyAttributes(attrs) {
|
|
178
|
+
if (attrs === null) return "(none)";
|
|
179
|
+
return `{ ${Object.entries(attrs).sort(([a], [b]) => a.localeCompare(b)).map(([k, v]) => `${k}: ${JSON.stringify(v)}`).join(", ")} }`;
|
|
180
|
+
}
|
|
181
|
+
function renderModuleImport(moduleSpecifier, group) {
|
|
182
|
+
const attrs = buildAttributesClause(group.attributes);
|
|
183
|
+
const defaultEntries = [...group.defaults.entries()].sort(([a], [b]) => a.localeCompare(b));
|
|
184
|
+
const hasNamed = group.named.size > 0;
|
|
185
|
+
if (defaultEntries.length > 1) {
|
|
186
|
+
const defaultLines = defaultEntries.map(([symbol, typeOnly]) => `import ${typeOnly ? "type " : ""}${symbol} from '${moduleSpecifier}'${attrs};`);
|
|
187
|
+
if (!hasNamed) return defaultLines.join("\n");
|
|
188
|
+
return [...defaultLines, renderNamedOnlyStatement(moduleSpecifier, group, attrs)].join("\n");
|
|
189
|
+
}
|
|
190
|
+
const defaultEntry = defaultEntries[0];
|
|
191
|
+
const hasDefault = defaultEntry !== void 0;
|
|
192
|
+
const [defaultSymbol, defaultTypeOnly] = defaultEntry ?? [null, true];
|
|
193
|
+
const typeOnlyStatement = isStatementTypeOnly(hasDefault, defaultTypeOnly, group);
|
|
194
|
+
if (typeOnlyStatement && hasDefault && hasNamed) return `${`import type ${defaultSymbol} from '${moduleSpecifier}'${attrs};`}\n${`import type { ${renderNamedBindingsList(group, true)} } from '${moduleSpecifier}'${attrs};`}`;
|
|
195
|
+
return `${typeOnlyStatement ? "import type" : "import"} ${buildImportClause(defaultSymbol, group, typeOnlyStatement)} from '${moduleSpecifier}'${attrs};`;
|
|
196
|
+
}
|
|
197
|
+
function renderNamedOnlyStatement(moduleSpecifier, group, attrs) {
|
|
198
|
+
const typeOnlyStatement = [...group.named.values()].every((binding) => binding.typeOnly);
|
|
199
|
+
return `${typeOnlyStatement ? "import type" : "import"} { ${renderNamedBindingsList(group, typeOnlyStatement)} } from '${moduleSpecifier}'${attrs};`;
|
|
200
|
+
}
|
|
201
|
+
function isStatementTypeOnly(hasDefault, defaultTypeOnly, group) {
|
|
202
|
+
const hasNamed = group.named.size > 0;
|
|
203
|
+
if (!hasDefault && !hasNamed) return false;
|
|
204
|
+
if (hasDefault && !defaultTypeOnly) return false;
|
|
205
|
+
for (const binding of group.named.values()) if (!binding.typeOnly) return false;
|
|
206
|
+
return true;
|
|
207
|
+
}
|
|
208
|
+
function buildImportClause(defaultSymbol, group, statementTypeOnly) {
|
|
209
|
+
const hasNamed = group.named.size > 0;
|
|
210
|
+
const hasDefault = defaultSymbol !== null;
|
|
211
|
+
const namedClause = hasNamed ? renderNamedBindingsList(group, statementTypeOnly) : "";
|
|
212
|
+
if (hasDefault && hasNamed) return `${defaultSymbol}, { ${namedClause} }`;
|
|
213
|
+
if (hasDefault) return defaultSymbol;
|
|
214
|
+
return `{ ${namedClause} }`;
|
|
215
|
+
}
|
|
216
|
+
function renderNamedBindingsList(group, statementTypeOnly) {
|
|
217
|
+
return [...group.named.values()].sort(compareNamedBindings).map((binding) => renderNamedBinding(binding, statementTypeOnly)).join(", ");
|
|
218
|
+
}
|
|
219
|
+
function compareNamedBindings(a, b) {
|
|
220
|
+
if (a.symbol !== b.symbol) return a.symbol < b.symbol ? -1 : 1;
|
|
221
|
+
const aAlias = a.alias ?? "";
|
|
222
|
+
const bAlias = b.alias ?? "";
|
|
223
|
+
if (aAlias === bAlias) return 0;
|
|
224
|
+
return aAlias < bAlias ? -1 : 1;
|
|
225
|
+
}
|
|
226
|
+
function namedBindingKey(symbol, alias) {
|
|
227
|
+
return `${symbol}\x00${alias ?? ""}`;
|
|
228
|
+
}
|
|
229
|
+
function renderNamedBinding(binding, statementTypeOnly) {
|
|
230
|
+
const prefix = !statementTypeOnly && binding.typeOnly ? "type " : "";
|
|
231
|
+
const aliasClause = binding.alias !== null ? ` as ${binding.alias}` : "";
|
|
232
|
+
return `${prefix}${binding.symbol}${aliasClause}`;
|
|
233
|
+
}
|
|
234
|
+
function buildAttributesClause(attrs) {
|
|
235
|
+
if (attrs === null) return "";
|
|
236
|
+
const entries = Object.entries(attrs).sort(([a], [b]) => a.localeCompare(b)).map(([k, v]) => `${k}: ${JSON.stringify(v)}`);
|
|
237
|
+
if (entries.length === 0) return "";
|
|
238
|
+
return ` with { ${entries.join(", ")} }`;
|
|
239
|
+
}
|
|
240
|
+
/**
|
|
241
|
+
* Abstract base class for any IR node that can be emitted as a TypeScript
|
|
242
|
+
* expression and declare its own import requirements.
|
|
243
|
+
*
|
|
244
|
+
* A top-level renderer walks an array of these polymorphically, concatenates
|
|
245
|
+
* `renderTypeScript()` results, and aggregates `importRequirements()` into a
|
|
246
|
+
* deduplicated import block.
|
|
247
|
+
*/
|
|
248
|
+
var TsExpression = class {};
|
|
249
|
+
//#endregion
|
|
250
|
+
export { tsStringLiteral as i, jsonToTsSource as n, renderImports as r, TsExpression as t };
|
|
251
|
+
|
|
252
|
+
//# sourceMappingURL=dist-DFakQfiQ.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"dist-DFakQfiQ.mjs","names":[],"sources":["../../../../1-framework/1-core/ts-render/dist/index.mjs"],"sourcesContent":["import { InternalError } from \"@internal/utils/internal-error\";\nimport { structuredError } from \"@internal/utils/structured-error\";\n//#region src/ts-string-literal.ts\n/**\n* Renders a string as a TypeScript source-text literal.\n*\n* `JSON.stringify` already escapes quotes, backslashes, and control characters\n* exactly as TypeScript needs; it leaves U+2028/U+2029 unescaped, which legacy\n* parsers treat as line terminators, so those are escaped explicitly.\n*\n* Used for both value literals (`jsonToTsSource`) and type-level literals /\n* property keys (the contract emitter), so a physical name that a store admits\n* as a quoted identifier but TypeScript does not admit bare renders the same\n* way everywhere.\n*/\nfunction tsStringLiteral(value) {\n\treturn JSON.stringify(value).replace(/\\u2028/g, \"\\\\u2028\").replace(/\\u2029/g, \"\\\\u2029\");\n}\n//#endregion\n//#region src/json-to-ts-source.ts\n/**\n* Pure JSON-to-TypeScript-source printer.\n*\n* This module is the second stage of the codec → TS pipeline:\n*\n* jsValue → codec.encodeJson → JsonValue → jsonToTsSource → TS source text\n*\n* Stage 1 (`codec.encodeJson`) is a codec responsibility — date serialization,\n* opaque domain types (vector, bigint, uuid), JSON canonicalization. Stage 2\n* (this module) is a pure JSON-to-TS printer that must never grow type-specific\n* branches.\n*\n* To render a non-JSON JS value (Date, Vector, BigInt, Buffer, …), encode it\n* through the relevant codec's `encodeJson` first. Adding special cases to\n* this file is not the answer — that's what codecs are for.\n*/\n/**\n* Render a JSON-compatible value as a TypeScript source-text literal.\n*\n* Accepts `unknown` for ergonomics with structural types (e.g. `ColumnSpec`,\n* `ForeignKeySpec`) whose fields are all JSON-compatible but whose interfaces\n* lack the index signature TypeScript requires for `JsonObject` assignability.\n* Non-JSON values (Date, Symbol, Function, etc.) throw at runtime.\n*/\nfunction jsonToTsSource(value) {\n\tif (value === void 0) return \"undefined\";\n\tif (value === null) return \"null\";\n\tif (typeof value === \"string\") return tsStringLiteral(value);\n\tif (typeof value === \"number\" || typeof value === \"boolean\") return String(value);\n\tif (Array.isArray(value)) {\n\t\tif (value.length === 0) return \"[]\";\n\t\tconst items = value.map((v) => jsonToTsSource(v));\n\t\tconst singleLine = `[${items.join(\", \")}]`;\n\t\tif (singleLine.length <= 80) return singleLine;\n\t\treturn `[\\n${items.map((i) => ` ${i}`).join(\",\\n\")},\\n]`;\n\t}\n\tif (typeof value === \"object\") {\n\t\tconst entries = Object.entries(value).filter(([, v]) => v !== void 0);\n\t\tif (entries.length === 0) return \"{}\";\n\t\tconst items = entries.map(([k, v]) => `${renderKey(k)}: ${jsonToTsSource(v)}`);\n\t\tconst singleLine = `{ ${items.join(\", \")} }`;\n\t\tif (singleLine.length <= 80) return singleLine;\n\t\treturn `{\\n${items.map((i) => ` ${i}`).join(\",\\n\")},\\n}`;\n\t}\n\tthrow new InternalError(`jsonToTsSource: unsupported value type \"${typeof value}\"`);\n}\nfunction renderKey(key) {\n\tif (key === \"__proto__\") return tsStringLiteral(key);\n\treturn /^[a-zA-Z_$][a-zA-Z0-9_$]*$/.test(key) ? key : tsStringLiteral(key);\n}\n//#endregion\n//#region src/contract-errors.ts\nfunction contractError(code, message, options) {\n\treturn structuredError(code, message, options);\n}\n//#endregion\n//#region src/render-imports.ts\n/**\n* Render an aggregated `import` block from a flat list of\n* `ImportRequirement`s. Each target's migration renderer collects\n* requirements polymorphically from its call nodes and pipes them here.\n*\n* The emitter invariants:\n*\n* - **Usually one line per module specifier.** Named imports are aggregated\n* and emitted sorted; a single default symbol is combined onto the same\n* line when attributes agree (`import def, { a, b } from \"m\";`). Aliased\n* symbols render `symbol as alias`. When every symbol for a module is\n* `typeOnly`, the statement collapses to `import type { … }`; a module\n* mixing value and type symbols prefixes the type-only ones\n* (`import { type T, v }`). Exceptions that split into multiple lines: a\n* fully type-only statement with both a default and one or more named\n* bindings (`import type D from \"m\";` then `import type { N } from \"m\";`,\n* because TypeScript rejects `import type D, { N } from \"m\"` — TS1363),\n* and multiple distinct default symbols (see below).\n* - **Multiple distinct default symbols per module are allowed.** JS permits\n* re-importing the same specifier under different default-binding names\n* (`import a from 'm'; import b from 'm';`), so each distinct default\n* symbol renders its own `import` line, sorted alphabetically; a repeated\n* requirement for the same symbol still collapses into one binding,\n* merging `typeOnly` by AND.\n* - **Attribute unanimity per module.** All requirements for the same\n* module specifier must carry the same (or no) `attributes` map.\n* Divergent attribute maps throw — they can't collapse to one line\n* and there's no user-resolvable recovery at this layer.\n* - **Distinct (symbol, alias) pairs are distinct bindings.** TypeScript\n* permits importing the same export under multiple local names, so\n* `{ A }` + `{ A as B }` renders as `import { A, A as B } from \"m\"` and\n* `{ A as B }` + `{ A as C }` renders as `import { A as B, A as C } from \"m\"`.\n* Truly identical `(symbol, alias)` pairs still collapse to one binding,\n* merging `typeOnly` by AND.\n* - **Deterministic ordering.** Modules are emitted sorted by specifier;\n* within a module, named bindings are emitted sorted by `(symbol, alias)`\n* using JavaScript code-unit comparison, with the un-aliased form (no\n* alias) treated as alias `\"\"` so it sorts before any aliased form of the\n* same symbol.\n*\n* Returns a string containing one or more import lines per module (see the\n* splitting exceptions above), joined by `\\n` (no trailing newline). An\n* empty requirement list returns `\"\"`.\n*/\nfunction renderImports(requirements) {\n\treturn [...aggregateByModule(requirements).entries()].sort(([a], [b]) => a.localeCompare(b)).map(([moduleSpecifier, group]) => renderModuleImport(moduleSpecifier, group)).join(\"\\n\");\n}\nfunction aggregateByModule(requirements) {\n\tconst byModule = /* @__PURE__ */ new Map();\n\tfor (const req of requirements) {\n\t\tlet group = byModule.get(req.moduleSpecifier);\n\t\tif (!group) {\n\t\t\tgroup = {\n\t\t\t\tnamed: /* @__PURE__ */ new Map(),\n\t\t\t\tdefaults: /* @__PURE__ */ new Map(),\n\t\t\t\tattributes: null,\n\t\t\t\tattributesSet: false\n\t\t\t};\n\t\t\tbyModule.set(req.moduleSpecifier, group);\n\t\t}\n\t\tmergeRequirementIntoGroup(req, group);\n\t}\n\treturn byModule;\n}\nfunction mergeRequirementIntoGroup(req, group) {\n\tconst kind = req.kind ?? \"named\";\n\tconst typeOnly = req.typeOnly === true;\n\tif (kind === \"default\") {\n\t\tconst existingTypeOnly = group.defaults.get(req.symbol);\n\t\tgroup.defaults.set(req.symbol, existingTypeOnly === void 0 ? typeOnly : existingTypeOnly && typeOnly);\n\t} else {\n\t\tconst alias = req.alias && req.alias !== req.symbol ? req.alias : null;\n\t\tconst key = namedBindingKey(req.symbol, alias);\n\t\tconst existing = group.named.get(key);\n\t\tif (existing) existing.typeOnly = existing.typeOnly && typeOnly;\n\t\telse group.named.set(key, {\n\t\t\tsymbol: req.symbol,\n\t\t\talias,\n\t\t\ttypeOnly\n\t\t});\n\t}\n\tmergeAttributes(req, group);\n}\nfunction mergeAttributes(req, group) {\n\tconst incoming = req.attributes ?? null;\n\tif (!group.attributesSet) {\n\t\tgroup.attributes = incoming;\n\t\tgroup.attributesSet = true;\n\t\treturn;\n\t}\n\tif (!attributesEqual(group.attributes, incoming)) throw contractError(\"CONTRACT.PACK_CONTRIBUTION_INVALID\", `Conflicting import attributes for module \"${req.moduleSpecifier}\": ${stringifyAttributes(group.attributes)} vs ${stringifyAttributes(incoming)}.`, { meta: { moduleSpecifier: req.moduleSpecifier } });\n}\nfunction attributesEqual(a, b) {\n\tif (a === b) return true;\n\tif (a === null || b === null) return false;\n\tconst aKeys = Object.keys(a).sort();\n\tconst bKeys = Object.keys(b).sort();\n\tif (aKeys.length !== bKeys.length) return false;\n\tfor (let i = 0; i < aKeys.length; i++) {\n\t\tconst key = aKeys[i];\n\t\tif (key !== bKeys[i]) return false;\n\t\tif (a[key] !== b[key]) return false;\n\t}\n\treturn true;\n}\nfunction stringifyAttributes(attrs) {\n\tif (attrs === null) return \"(none)\";\n\treturn `{ ${Object.entries(attrs).sort(([a], [b]) => a.localeCompare(b)).map(([k, v]) => `${k}: ${JSON.stringify(v)}`).join(\", \")} }`;\n}\nfunction renderModuleImport(moduleSpecifier, group) {\n\tconst attrs = buildAttributesClause(group.attributes);\n\tconst defaultEntries = [...group.defaults.entries()].sort(([a], [b]) => a.localeCompare(b));\n\tconst hasNamed = group.named.size > 0;\n\tif (defaultEntries.length > 1) {\n\t\tconst defaultLines = defaultEntries.map(([symbol, typeOnly]) => `import ${typeOnly ? \"type \" : \"\"}${symbol} from '${moduleSpecifier}'${attrs};`);\n\t\tif (!hasNamed) return defaultLines.join(\"\\n\");\n\t\treturn [...defaultLines, renderNamedOnlyStatement(moduleSpecifier, group, attrs)].join(\"\\n\");\n\t}\n\tconst defaultEntry = defaultEntries[0];\n\tconst hasDefault = defaultEntry !== void 0;\n\tconst [defaultSymbol, defaultTypeOnly] = defaultEntry ?? [null, true];\n\tconst typeOnlyStatement = isStatementTypeOnly(hasDefault, defaultTypeOnly, group);\n\tif (typeOnlyStatement && hasDefault && hasNamed) return `${`import type ${defaultSymbol} from '${moduleSpecifier}'${attrs};`}\\n${`import type { ${renderNamedBindingsList(group, true)} } from '${moduleSpecifier}'${attrs};`}`;\n\treturn `${typeOnlyStatement ? \"import type\" : \"import\"} ${buildImportClause(defaultSymbol, group, typeOnlyStatement)} from '${moduleSpecifier}'${attrs};`;\n}\nfunction renderNamedOnlyStatement(moduleSpecifier, group, attrs) {\n\tconst typeOnlyStatement = [...group.named.values()].every((binding) => binding.typeOnly);\n\treturn `${typeOnlyStatement ? \"import type\" : \"import\"} { ${renderNamedBindingsList(group, typeOnlyStatement)} } from '${moduleSpecifier}'${attrs};`;\n}\nfunction isStatementTypeOnly(hasDefault, defaultTypeOnly, group) {\n\tconst hasNamed = group.named.size > 0;\n\tif (!hasDefault && !hasNamed) return false;\n\tif (hasDefault && !defaultTypeOnly) return false;\n\tfor (const binding of group.named.values()) if (!binding.typeOnly) return false;\n\treturn true;\n}\nfunction buildImportClause(defaultSymbol, group, statementTypeOnly) {\n\tconst hasNamed = group.named.size > 0;\n\tconst hasDefault = defaultSymbol !== null;\n\tconst namedClause = hasNamed ? renderNamedBindingsList(group, statementTypeOnly) : \"\";\n\tif (hasDefault && hasNamed) return `${defaultSymbol}, { ${namedClause} }`;\n\tif (hasDefault) return defaultSymbol;\n\treturn `{ ${namedClause} }`;\n}\nfunction renderNamedBindingsList(group, statementTypeOnly) {\n\treturn [...group.named.values()].sort(compareNamedBindings).map((binding) => renderNamedBinding(binding, statementTypeOnly)).join(\", \");\n}\nfunction compareNamedBindings(a, b) {\n\tif (a.symbol !== b.symbol) return a.symbol < b.symbol ? -1 : 1;\n\tconst aAlias = a.alias ?? \"\";\n\tconst bAlias = b.alias ?? \"\";\n\tif (aAlias === bAlias) return 0;\n\treturn aAlias < bAlias ? -1 : 1;\n}\nfunction namedBindingKey(symbol, alias) {\n\treturn `${symbol}\\x00${alias ?? \"\"}`;\n}\nfunction renderNamedBinding(binding, statementTypeOnly) {\n\tconst prefix = !statementTypeOnly && binding.typeOnly ? \"type \" : \"\";\n\tconst aliasClause = binding.alias !== null ? ` as ${binding.alias}` : \"\";\n\treturn `${prefix}${binding.symbol}${aliasClause}`;\n}\nfunction buildAttributesClause(attrs) {\n\tif (attrs === null) return \"\";\n\tconst entries = Object.entries(attrs).sort(([a], [b]) => a.localeCompare(b)).map(([k, v]) => `${k}: ${JSON.stringify(v)}`);\n\tif (entries.length === 0) return \"\";\n\treturn ` with { ${entries.join(\", \")} }`;\n}\n//#endregion\n//#region src/ts-expression.ts\n/**\n* Abstract base class for any IR node that can be emitted as a TypeScript\n* expression and declare its own import requirements.\n*\n* A top-level renderer walks an array of these polymorphically, concatenates\n* `renderTypeScript()` results, and aggregates `importRequirements()` into a\n* deduplicated import block.\n*/\nvar TsExpression = class {};\n//#endregion\nexport { TsExpression, jsonToTsSource, renderImports, tsStringLiteral };\n\n//# sourceMappingURL=index.mjs.map"],"mappings":";;;;;;;;;;;;;;;AAeA,SAAS,gBAAgB,OAAO;CAC/B,OAAO,KAAK,UAAU,KAAK,CAAC,CAAC,QAAQ,WAAW,SAAS,CAAC,CAAC,QAAQ,WAAW,SAAS;AACxF;;;;;;;;;;;;;;;;;;;;;;;;;AA2BA,SAAS,eAAe,OAAO;CAC9B,IAAI,UAAU,KAAK,GAAG,OAAO;CAC7B,IAAI,UAAU,MAAM,OAAO;CAC3B,IAAI,OAAO,UAAU,UAAU,OAAO,gBAAgB,KAAK;CAC3D,IAAI,OAAO,UAAU,YAAY,OAAO,UAAU,WAAW,OAAO,OAAO,KAAK;CAChF,IAAI,MAAM,QAAQ,KAAK,GAAG;EACzB,IAAI,MAAM,WAAW,GAAG,OAAO;EAC/B,MAAM,QAAQ,MAAM,KAAK,MAAM,eAAe,CAAC,CAAC;EAChD,MAAM,aAAa,IAAI,MAAM,KAAK,IAAI,EAAE;EACxC,IAAI,WAAW,UAAU,IAAI,OAAO;EACpC,OAAO,MAAM,MAAM,KAAK,MAAM,KAAK,GAAG,CAAC,CAAC,KAAK,KAAK,EAAE;CACrD;CACA,IAAI,OAAO,UAAU,UAAU;EAC9B,MAAM,UAAU,OAAO,QAAQ,KAAK,CAAC,CAAC,QAAQ,GAAG,OAAO,MAAM,KAAK,CAAC;EACpE,IAAI,QAAQ,WAAW,GAAG,OAAO;EACjC,MAAM,QAAQ,QAAQ,KAAK,CAAC,GAAG,OAAO,GAAG,UAAU,CAAC,EAAE,IAAI,eAAe,CAAC,GA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ACvC,OAAO,GAAG,OAAO,MAAM,SAAS;AACjC;AACA,SAAS,mBAAmB,SAAS,mBAAmB;CACvD,MAAM,SAAS,CAAC,qBAAqB,QAAQ,WAAW,UAAU;CAClE,MAAM,cAAc,QAAQ,UAAU,OAAO,OAAO,QAAQ,UAAU;CACtE,OAAO,GAAG,SAAS,QAAQ,SAAS;AACrC;AACA,SAAS,sBAAsB,OAAO;CACrC,IAAI,UAAU,MAAM,OAAO;CAC3B,MAAM,UAAU,OAAO,QAAQ,KAAK,CAAC,CAAC,MAAM,CAAC,IAAI,CAAC,OAAO,EAAE,cAAc,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,GAAG,OAAO,GAAG,EAAE,IAAI,KAAK,UAAU,CAAC,GAAG;CACzH,IAAI,QAAQ,WAAW,GAAG,OAAO;CACjC,OAAO,WAAW,QAAQ,KAAK,IAAI,EAAE;AACtC;;;;;;;;;AAWA,IAAI,eAAe,MAAM,CAAC"}
|
package/dist/errors.d.mts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import { S as errorUnexpected, _ as errorMigrationCliUnknownFlag, a as errorConfigValidation, b as errorQueryRunnerFactoryRequired, c as errorContractValidationFailed, d as errorEnumCodecNotInPackStack, f as errorFamilyReadMarkerSqlRequired, g as errorMigrationCliInvalidConfigArg, h as errorJsonFormatNotSupported, i as errorConfigFileNotFound, l as errorDatabaseConnectionRequired, m as errorInvalidOutputFormat, n as CliErrorEnvelope, o as errorContractConfigMissing, p as errorFileNotFound, r as CliStructuredError, s as errorContractMissingExtensions, t as CliErrorConflict, u as errorDriverRequired, v as errorMigrationPlanningFailed, x as errorTargetMigrationNotSupported, y as errorOutputFormatMutex } from "./control-B87KWI_K-C_R8WfEr.mjs";
|
|
2
|
-
import { a as errorMarkerReadFailed, c as errorRunnerFailed, d as errorTargetMismatch, f as parseMarkerRowSafely, i as errorMarkerMissing, l as errorRuntime, m as withMarkerReadErrorHandling, n as errorDestructiveChanges, o as errorMarkerRequired, p as rethrowMarkerReadError, r as errorHashMismatch, s as errorMarkerRowCorrupt, t as ERROR_CODE_DESTRUCTIVE_CHANGES, u as errorSchemaVerificationFailed } from "./execution-
|
|
2
|
+
import { a as errorMarkerReadFailed, c as errorRunnerFailed, d as errorTargetMismatch, f as parseMarkerRowSafely, i as errorMarkerMissing, l as errorRuntime, m as withMarkerReadErrorHandling, n as errorDestructiveChanges, o as errorMarkerRequired, p as rethrowMarkerReadError, r as errorHashMismatch, s as errorMarkerRowCorrupt, t as ERROR_CODE_DESTRUCTIVE_CHANGES, u as errorSchemaVerificationFailed } from "./execution-4sAWQx8X.mjs";
|
|
3
3
|
import { a as errorMigrationTargetMismatch, i as errorMigrationPlanNotArray, n as errorMigrationFileMissing, o as errorUnfilledPlaceholder, r as errorMigrationInvalidDefaultExport, s as placeholder, t as errorDataTransformContractMismatch } from "./migration-DKbDzBwy.mjs";
|
|
4
4
|
export { type CliErrorConflict, type CliErrorEnvelope, CliStructuredError, ERROR_CODE_DESTRUCTIVE_CHANGES, errorConfigFileNotFound, errorConfigValidation, errorContractConfigMissing, errorContractMissingExtensions, errorContractValidationFailed, errorDataTransformContractMismatch, errorDatabaseConnectionRequired, errorDestructiveChanges, errorDriverRequired, errorEnumCodecNotInPackStack, errorFamilyReadMarkerSqlRequired, errorFileNotFound, errorHashMismatch, errorInvalidOutputFormat, errorJsonFormatNotSupported, errorMarkerMissing, errorMarkerReadFailed, errorMarkerRequired, errorMarkerRowCorrupt, errorMigrationCliInvalidConfigArg, errorMigrationCliUnknownFlag, errorMigrationFileMissing, errorMigrationInvalidDefaultExport, errorMigrationPlanNotArray, errorMigrationPlanningFailed, errorMigrationTargetMismatch, errorOutputFormatMutex, errorQueryRunnerFactoryRequired, errorRunnerFailed, errorRuntime, errorSchemaVerificationFailed, errorTargetMigrationNotSupported, errorTargetMismatch, errorUnexpected, errorUnfilledPlaceholder, parseMarkerRowSafely, placeholder, rethrowMarkerReadError, withMarkerReadErrorHandling };
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { a as errorMarkerReadFailed, c as errorRunnerFailed, d as errorTargetMismatch, f as parseMarkerRowSafely, i as errorMarkerMissing, l as errorRuntime, m as withMarkerReadErrorHandling, n as errorDestructiveChanges, o as errorMarkerRequired, p as rethrowMarkerReadError, r as errorHashMismatch, s as errorMarkerRowCorrupt, t as ERROR_CODE_DESTRUCTIVE_CHANGES, u as errorSchemaVerificationFailed } from "./execution-
|
|
1
|
+
import { a as errorMarkerReadFailed, c as errorRunnerFailed, d as errorTargetMismatch, f as parseMarkerRowSafely, i as errorMarkerMissing, l as errorRuntime, m as withMarkerReadErrorHandling, n as errorDestructiveChanges, o as errorMarkerRequired, p as rethrowMarkerReadError, r as errorHashMismatch, s as errorMarkerRowCorrupt, t as ERROR_CODE_DESTRUCTIVE_CHANGES, u as errorSchemaVerificationFailed } from "./execution-4sAWQx8X.mjs";
|
|
2
2
|
export { ERROR_CODE_DESTRUCTIVE_CHANGES, errorDestructiveChanges, errorHashMismatch, errorMarkerMissing, errorMarkerReadFailed, errorMarkerRequired, errorMarkerRowCorrupt, errorRunnerFailed, errorRuntime, errorSchemaVerificationFailed, errorTargetMismatch, parseMarkerRowSafely, rethrowMarkerReadError, withMarkerReadErrorHandling };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { $ as SchemaDiffIssue, St as VerifyDatabaseSchemaResult } from "./control-
|
|
1
|
+
import { $ as SchemaDiffIssue, St as VerifyDatabaseSchemaResult } from "./control-DavL9i47.mjs";
|
|
2
2
|
import { r as CliStructuredError } from "./control-B87KWI_K-C_R8WfEr.mjs";
|
|
3
3
|
//#region ../../../1-framework/1-core/errors/dist/execution.d.mts
|
|
4
4
|
//#region src/execution.d.ts
|
|
@@ -95,4 +95,4 @@ declare function errorRuntime(summary: string, options?: {
|
|
|
95
95
|
}): CliStructuredError;
|
|
96
96
|
//#endregion
|
|
97
97
|
export { errorMarkerReadFailed as a, errorRunnerFailed as c, errorTargetMismatch as d, parseMarkerRowSafely as f, errorMarkerMissing as i, errorRuntime as l, withMarkerReadErrorHandling as m, errorDestructiveChanges as n, errorMarkerRequired as o, rethrowMarkerReadError as p, errorHashMismatch as r, errorMarkerRowCorrupt as s, ERROR_CODE_DESTRUCTIVE_CHANGES as t, errorSchemaVerificationFailed as u };
|
|
98
|
-
//# sourceMappingURL=execution-
|
|
98
|
+
//# sourceMappingURL=execution-4sAWQx8X.d.mts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"execution-
|
|
1
|
+
{"version":3,"file":"execution-4sAWQx8X.d.mts","names":[],"sources":["../../../../1-framework/1-core/errors/dist/execution.d.mts"],"mappings":";;;;;;;iBAMiB,mBAAmB;WACzB;IACP;;;;iBAIa,kBAAkB;WACxB;WACA;WACA;IACP;;;;iBAIa,oBAAoB,kBAAkB,gBAAgB;WAC5D;IACP;;;;iBAIa,sBAAsB;WAC5B;WACA;WACA;IACP;;;;iBAIa,sBAAsB;WAC5B;WACA;WACA;IACP;iBACa,uBAAuB,cAAc;WAC3C;WACA;;iBAEM,4BAA4B,GAAG,iBAAiB,QAAQ,IAAI;WAClE;WACA;IACP,QAAQ;iBACK,qBAAqB,GAAG,cAAc,QAAQ,mBAAmB,GAAG;WAC1E;WACA;IACP;;;;;iBAKa,oBAAoB;WAC1B;WACA;IACP;;;;;iBAKa,8BAA8B;WACpC;WACA,oBAAoB;WACpB,kBAAkB;IACzB;;;;iBAIa,kBAAkB,iBAAiB;WACzC;WACA;WACA,OAAO;IACd;;cAEU;;;;iBAIG,wBAAwB,iBAAiB;WAC/C;WACA;WACA,OAAO;IACd;;;;iBAIa,aAAa,iBAAiB;WACpC;WACA;WACA,OAAO;IACd"}
|
package/dist/ids.d.mts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { N as ExecutionMutationDefaultValue } from "./domain-envelope-D6Wn9AmZ-BqZKTT9U.mjs";
|
|
2
|
-
import { a as ColumnTypeDescriptor } from "./codec-
|
|
2
|
+
import { a as ColumnTypeDescriptor } from "./codec-LWTqo1GG.mjs";
|
|
3
3
|
import { cuid2 as cuid2$1 } from "uniku/cuid2";
|
|
4
4
|
import { ksuid as ksuid$1 } from "uniku/ksuid";
|
|
5
5
|
import { nanoid as nanoid$1 } from "uniku/nanoid";
|
|
@@ -116,5 +116,20 @@ declare abstract class TsExpression {
|
|
|
116
116
|
*/
|
|
117
117
|
declare function renderImports(requirements: readonly ImportRequirement[]): string;
|
|
118
118
|
//#endregion
|
|
119
|
-
|
|
120
|
-
|
|
119
|
+
//#region src/ts-string-literal.d.ts
|
|
120
|
+
/**
|
|
121
|
+
* Renders a string as a TypeScript source-text literal.
|
|
122
|
+
*
|
|
123
|
+
* `JSON.stringify` already escapes quotes, backslashes, and control characters
|
|
124
|
+
* exactly as TypeScript needs; it leaves U+2028/U+2029 unescaped, which legacy
|
|
125
|
+
* parsers treat as line terminators, so those are escaped explicitly.
|
|
126
|
+
*
|
|
127
|
+
* Used for both value literals (`jsonToTsSource`) and type-level literals /
|
|
128
|
+
* property keys (the contract emitter), so a physical name that a store admits
|
|
129
|
+
* as a quoted identifier but TypeScript does not admit bare renders the same
|
|
130
|
+
* way everywhere.
|
|
131
|
+
*/
|
|
132
|
+
declare function tsStringLiteral(value: string): string;
|
|
133
|
+
//#endregion
|
|
134
|
+
export { jsonToTsSource as a, TsExpression as i, JsonObject as n, renderImports as o, JsonValue as r, tsStringLiteral as s, ImportRequirement as t };
|
|
135
|
+
//# sourceMappingURL=index-CDk9yEbw.d.mts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index-
|
|
1
|
+
{"version":3,"file":"index-CDk9yEbw.d.mts","names":[],"sources":["../../../../1-framework/1-core/ts-render/dist/index.d.mts"],"mappings":";;;;;;;;;;;;;;;;;;KAiBK,wDAAwD,cAAc;KACtE;YACO,cAAc;;;;;;;;;;iBAUT,eAAe;;;;;;;;;;;;;;;;;;;;UAoBtB;WACC;WACA;WACA;WACA,aAAa,SAAS;WACtB;WACA;;;;;;;;;;uBAUY;WACZ;WACA,+BAA+B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBAgDzB,cAAc,uBAAuB;;;;;;;;;;;;;;;iBAerC,gBAAgB"}
|
package/dist/psl-parser.d.mts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { c as CodecLookup } from "./codec-types-720XoDZ0-Br-QaYK3.mjs";
|
|
2
2
|
import { B as PslExtensionBlockParamList, F as PslDiagnosticCode, G as PslPosition, H as PslExtensionBlockParamRef, I as PslExtensionBlock, K as PslSpan, L as PslExtensionBlockAttribute, R as PslExtensionBlockAttributeArg, U as PslExtensionBlockParamScalarValue, V as PslExtensionBlockParamOption, W as PslExtensionBlockParamValue, b as AuthoringPslBlockDescriptorNamespace, y as AuthoringPslBlockDescriptor, z as PslExtensionBlockParamBare } from "./framework-authoring--R1ZGWs1-C5F11Vhx.mjs";
|
|
3
3
|
import "./authoring-ljy8m56O.mjs";
|
|
4
|
-
import "./codec-
|
|
4
|
+
import "./codec-LWTqo1GG.mjs";
|
|
5
5
|
import { M as namespacePslExtensionBlocks, T as PslTypesBlock, a as PslAttributeArgument, b as PslNamedTypeDeclaration, c as PslAttributeTarget, d as PslDefaultLiteralValue, f as PslDefaultValue, g as PslFieldAttribute, h as PslField, i as PslAttribute, k as flatPslModels, l as PslCompositeType, m as PslDocumentAst, o as PslAttributeNamedArgument, p as PslDiagnostic, s as PslAttributePositionalArgument, u as PslDefaultFunctionValue, v as PslModel, w as PslTypeConstructorCall, x as PslNamespace, y as PslModelAttribute } from "./psl-ast-C4IAv2T_-CO0jh_VK.mjs";
|
|
6
6
|
import { r as Result } from "./result-Bpupv5vO.mjs";
|
|
7
7
|
import "./psl-ast-DAMpjVOP.mjs";
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { t as Contract } from "./contract-types-CkdMH7F7-9EHXSwbH.mjs";
|
|
2
2
|
import { r as Result } from "./result-Bpupv5vO.mjs";
|
|
3
|
-
import { c as ContractSourceProvider, m as PslContractSourceProvider, n as ContractSourceContext, o as ContractSourceDiagnostics, r as ContractSourceDiagnostic } from "./config-types-W-87vhZ4-
|
|
4
|
-
import "./config-types-
|
|
3
|
+
import { c as ContractSourceProvider, m as PslContractSourceProvider, n as ContractSourceContext, o as ContractSourceDiagnostics, r as ContractSourceDiagnostic } from "./config-types-W-87vhZ4-xE_-BXZD.mjs";
|
|
4
|
+
import "./config-types-DzIlP4Ue.mjs";
|
|
5
5
|
import { I as SourceFile, d as DocumentAst } from "./parse-0ZJjj_2N-CGZMQABI.mjs";
|
|
6
6
|
import { f as SymbolTable } from "./symbol-table-CZ7EVCTL-CqkpG3a_.mjs";
|
|
7
7
|
//#region ../../../1-framework/2-authoring/psl-parser/dist/interpret.d.mts
|
package/dist/psl-printer.d.mts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { c as CodecLookup } from "./codec-types-720XoDZ0-Br-QaYK3.mjs";
|
|
2
2
|
import { b as AuthoringPslBlockDescriptorNamespace } from "./framework-authoring--R1ZGWs1-C5F11Vhx.mjs";
|
|
3
3
|
import "./authoring-ljy8m56O.mjs";
|
|
4
|
-
import "./codec-
|
|
4
|
+
import "./codec-LWTqo1GG.mjs";
|
|
5
5
|
import { m as PslDocumentAst } from "./psl-ast-C4IAv2T_-CO0jh_VK.mjs";
|
|
6
6
|
import "./psl-ast-DAMpjVOP.mjs";
|
|
7
7
|
//#region ../../../1-framework/2-authoring/psl-printer/dist/index.d.mts
|
package/dist/ts-render.d.mts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { a as jsonToTsSource, i as TsExpression, n as JsonObject, o as renderImports, r as JsonValue, t as ImportRequirement } from "./index-
|
|
2
|
-
export { type ImportRequirement, type JsonObject, type JsonValue, TsExpression, jsonToTsSource, renderImports };
|
|
1
|
+
import { a as jsonToTsSource, i as TsExpression, n as JsonObject, o as renderImports, r as JsonValue, s as tsStringLiteral, t as ImportRequirement } from "./index-CDk9yEbw.mjs";
|
|
2
|
+
export { type ImportRequirement, type JsonObject, type JsonValue, TsExpression, jsonToTsSource, renderImports, tsStringLiteral };
|
package/dist/ts-render.mjs
CHANGED
|
@@ -1,240 +1,2 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
//#region ../../../1-framework/1-core/ts-render/dist/index.mjs
|
|
4
|
-
/**
|
|
5
|
-
* Pure JSON-to-TypeScript-source printer.
|
|
6
|
-
*
|
|
7
|
-
* This module is the second stage of the codec → TS pipeline:
|
|
8
|
-
*
|
|
9
|
-
* jsValue → codec.encodeJson → JsonValue → jsonToTsSource → TS source text
|
|
10
|
-
*
|
|
11
|
-
* Stage 1 (`codec.encodeJson`) is a codec responsibility — date serialization,
|
|
12
|
-
* opaque domain types (vector, bigint, uuid), JSON canonicalization. Stage 2
|
|
13
|
-
* (this module) is a pure JSON-to-TS printer that must never grow type-specific
|
|
14
|
-
* branches.
|
|
15
|
-
*
|
|
16
|
-
* To render a non-JSON JS value (Date, Vector, BigInt, Buffer, …), encode it
|
|
17
|
-
* through the relevant codec's `encodeJson` first. Adding special cases to
|
|
18
|
-
* this file is not the answer — that's what codecs are for.
|
|
19
|
-
*/
|
|
20
|
-
/**
|
|
21
|
-
* Render a JSON-compatible value as a TypeScript source-text literal.
|
|
22
|
-
*
|
|
23
|
-
* Accepts `unknown` for ergonomics with structural types (e.g. `ColumnSpec`,
|
|
24
|
-
* `ForeignKeySpec`) whose fields are all JSON-compatible but whose interfaces
|
|
25
|
-
* lack the index signature TypeScript requires for `JsonObject` assignability.
|
|
26
|
-
* Non-JSON values (Date, Symbol, Function, etc.) throw at runtime.
|
|
27
|
-
*/
|
|
28
|
-
function jsonToTsSource(value) {
|
|
29
|
-
if (value === void 0) return "undefined";
|
|
30
|
-
if (value === null) return "null";
|
|
31
|
-
if (typeof value === "string") return stringifyLiteral(value);
|
|
32
|
-
if (typeof value === "number" || typeof value === "boolean") return String(value);
|
|
33
|
-
if (Array.isArray(value)) {
|
|
34
|
-
if (value.length === 0) return "[]";
|
|
35
|
-
const items = value.map((v) => jsonToTsSource(v));
|
|
36
|
-
const singleLine = `[${items.join(", ")}]`;
|
|
37
|
-
if (singleLine.length <= 80) return singleLine;
|
|
38
|
-
return `[\n${items.map((i) => ` ${i}`).join(",\n")},\n]`;
|
|
39
|
-
}
|
|
40
|
-
if (typeof value === "object") {
|
|
41
|
-
const entries = Object.entries(value).filter(([, v]) => v !== void 0);
|
|
42
|
-
if (entries.length === 0) return "{}";
|
|
43
|
-
const items = entries.map(([k, v]) => `${renderKey(k)}: ${jsonToTsSource(v)}`);
|
|
44
|
-
const singleLine = `{ ${items.join(", ")} }`;
|
|
45
|
-
if (singleLine.length <= 80) return singleLine;
|
|
46
|
-
return `{\n${items.map((i) => ` ${i}`).join(",\n")},\n}`;
|
|
47
|
-
}
|
|
48
|
-
throw new InternalError(`jsonToTsSource: unsupported value type "${typeof value}"`);
|
|
49
|
-
}
|
|
50
|
-
function renderKey(key) {
|
|
51
|
-
if (key === "__proto__") return stringifyLiteral(key);
|
|
52
|
-
return /^[a-zA-Z_$][a-zA-Z0-9_$]*$/.test(key) ? key : stringifyLiteral(key);
|
|
53
|
-
}
|
|
54
|
-
function stringifyLiteral(value) {
|
|
55
|
-
return JSON.stringify(value).replace(/\u2028/g, "\\u2028").replace(/\u2029/g, "\\u2029");
|
|
56
|
-
}
|
|
57
|
-
function contractError(code, message, options) {
|
|
58
|
-
return structuredError(code, message, options);
|
|
59
|
-
}
|
|
60
|
-
/**
|
|
61
|
-
* Render an aggregated `import` block from a flat list of
|
|
62
|
-
* `ImportRequirement`s. Each target's migration renderer collects
|
|
63
|
-
* requirements polymorphically from its call nodes and pipes them here.
|
|
64
|
-
*
|
|
65
|
-
* The emitter invariants:
|
|
66
|
-
*
|
|
67
|
-
* - **Usually one line per module specifier.** Named imports are aggregated
|
|
68
|
-
* and emitted sorted; a single default symbol is combined onto the same
|
|
69
|
-
* line when attributes agree (`import def, { a, b } from "m";`). Aliased
|
|
70
|
-
* symbols render `symbol as alias`. When every symbol for a module is
|
|
71
|
-
* `typeOnly`, the statement collapses to `import type { … }`; a module
|
|
72
|
-
* mixing value and type symbols prefixes the type-only ones
|
|
73
|
-
* (`import { type T, v }`). Exceptions that split into multiple lines: a
|
|
74
|
-
* fully type-only statement with both a default and one or more named
|
|
75
|
-
* bindings (`import type D from "m";` then `import type { N } from "m";`,
|
|
76
|
-
* because TypeScript rejects `import type D, { N } from "m"` — TS1363),
|
|
77
|
-
* and multiple distinct default symbols (see below).
|
|
78
|
-
* - **Multiple distinct default symbols per module are allowed.** JS permits
|
|
79
|
-
* re-importing the same specifier under different default-binding names
|
|
80
|
-
* (`import a from 'm'; import b from 'm';`), so each distinct default
|
|
81
|
-
* symbol renders its own `import` line, sorted alphabetically; a repeated
|
|
82
|
-
* requirement for the same symbol still collapses into one binding,
|
|
83
|
-
* merging `typeOnly` by AND.
|
|
84
|
-
* - **Attribute unanimity per module.** All requirements for the same
|
|
85
|
-
* module specifier must carry the same (or no) `attributes` map.
|
|
86
|
-
* Divergent attribute maps throw — they can't collapse to one line
|
|
87
|
-
* and there's no user-resolvable recovery at this layer.
|
|
88
|
-
* - **Distinct (symbol, alias) pairs are distinct bindings.** TypeScript
|
|
89
|
-
* permits importing the same export under multiple local names, so
|
|
90
|
-
* `{ A }` + `{ A as B }` renders as `import { A, A as B } from "m"` and
|
|
91
|
-
* `{ A as B }` + `{ A as C }` renders as `import { A as B, A as C } from "m"`.
|
|
92
|
-
* Truly identical `(symbol, alias)` pairs still collapse to one binding,
|
|
93
|
-
* merging `typeOnly` by AND.
|
|
94
|
-
* - **Deterministic ordering.** Modules are emitted sorted by specifier;
|
|
95
|
-
* within a module, named bindings are emitted sorted by `(symbol, alias)`
|
|
96
|
-
* using JavaScript code-unit comparison, with the un-aliased form (no
|
|
97
|
-
* alias) treated as alias `""` so it sorts before any aliased form of the
|
|
98
|
-
* same symbol.
|
|
99
|
-
*
|
|
100
|
-
* Returns a string containing one or more import lines per module (see the
|
|
101
|
-
* splitting exceptions above), joined by `\n` (no trailing newline). An
|
|
102
|
-
* empty requirement list returns `""`.
|
|
103
|
-
*/
|
|
104
|
-
function renderImports(requirements) {
|
|
105
|
-
return [...aggregateByModule(requirements).entries()].sort(([a], [b]) => a.localeCompare(b)).map(([moduleSpecifier, group]) => renderModuleImport(moduleSpecifier, group)).join("\n");
|
|
106
|
-
}
|
|
107
|
-
function aggregateByModule(requirements) {
|
|
108
|
-
const byModule = /* @__PURE__ */ new Map();
|
|
109
|
-
for (const req of requirements) {
|
|
110
|
-
let group = byModule.get(req.moduleSpecifier);
|
|
111
|
-
if (!group) {
|
|
112
|
-
group = {
|
|
113
|
-
named: /* @__PURE__ */ new Map(),
|
|
114
|
-
defaults: /* @__PURE__ */ new Map(),
|
|
115
|
-
attributes: null,
|
|
116
|
-
attributesSet: false
|
|
117
|
-
};
|
|
118
|
-
byModule.set(req.moduleSpecifier, group);
|
|
119
|
-
}
|
|
120
|
-
mergeRequirementIntoGroup(req, group);
|
|
121
|
-
}
|
|
122
|
-
return byModule;
|
|
123
|
-
}
|
|
124
|
-
function mergeRequirementIntoGroup(req, group) {
|
|
125
|
-
const kind = req.kind ?? "named";
|
|
126
|
-
const typeOnly = req.typeOnly === true;
|
|
127
|
-
if (kind === "default") {
|
|
128
|
-
const existingTypeOnly = group.defaults.get(req.symbol);
|
|
129
|
-
group.defaults.set(req.symbol, existingTypeOnly === void 0 ? typeOnly : existingTypeOnly && typeOnly);
|
|
130
|
-
} else {
|
|
131
|
-
const alias = req.alias && req.alias !== req.symbol ? req.alias : null;
|
|
132
|
-
const key = namedBindingKey(req.symbol, alias);
|
|
133
|
-
const existing = group.named.get(key);
|
|
134
|
-
if (existing) existing.typeOnly = existing.typeOnly && typeOnly;
|
|
135
|
-
else group.named.set(key, {
|
|
136
|
-
symbol: req.symbol,
|
|
137
|
-
alias,
|
|
138
|
-
typeOnly
|
|
139
|
-
});
|
|
140
|
-
}
|
|
141
|
-
mergeAttributes(req, group);
|
|
142
|
-
}
|
|
143
|
-
function mergeAttributes(req, group) {
|
|
144
|
-
const incoming = req.attributes ?? null;
|
|
145
|
-
if (!group.attributesSet) {
|
|
146
|
-
group.attributes = incoming;
|
|
147
|
-
group.attributesSet = true;
|
|
148
|
-
return;
|
|
149
|
-
}
|
|
150
|
-
if (!attributesEqual(group.attributes, incoming)) throw contractError("CONTRACT.PACK_CONTRIBUTION_INVALID", `Conflicting import attributes for module "${req.moduleSpecifier}": ${stringifyAttributes(group.attributes)} vs ${stringifyAttributes(incoming)}.`, { meta: { moduleSpecifier: req.moduleSpecifier } });
|
|
151
|
-
}
|
|
152
|
-
function attributesEqual(a, b) {
|
|
153
|
-
if (a === b) return true;
|
|
154
|
-
if (a === null || b === null) return false;
|
|
155
|
-
const aKeys = Object.keys(a).sort();
|
|
156
|
-
const bKeys = Object.keys(b).sort();
|
|
157
|
-
if (aKeys.length !== bKeys.length) return false;
|
|
158
|
-
for (let i = 0; i < aKeys.length; i++) {
|
|
159
|
-
const key = aKeys[i];
|
|
160
|
-
if (key !== bKeys[i]) return false;
|
|
161
|
-
if (a[key] !== b[key]) return false;
|
|
162
|
-
}
|
|
163
|
-
return true;
|
|
164
|
-
}
|
|
165
|
-
function stringifyAttributes(attrs) {
|
|
166
|
-
if (attrs === null) return "(none)";
|
|
167
|
-
return `{ ${Object.entries(attrs).sort(([a], [b]) => a.localeCompare(b)).map(([k, v]) => `${k}: ${JSON.stringify(v)}`).join(", ")} }`;
|
|
168
|
-
}
|
|
169
|
-
function renderModuleImport(moduleSpecifier, group) {
|
|
170
|
-
const attrs = buildAttributesClause(group.attributes);
|
|
171
|
-
const defaultEntries = [...group.defaults.entries()].sort(([a], [b]) => a.localeCompare(b));
|
|
172
|
-
const hasNamed = group.named.size > 0;
|
|
173
|
-
if (defaultEntries.length > 1) {
|
|
174
|
-
const defaultLines = defaultEntries.map(([symbol, typeOnly]) => `import ${typeOnly ? "type " : ""}${symbol} from '${moduleSpecifier}'${attrs};`);
|
|
175
|
-
if (!hasNamed) return defaultLines.join("\n");
|
|
176
|
-
return [...defaultLines, renderNamedOnlyStatement(moduleSpecifier, group, attrs)].join("\n");
|
|
177
|
-
}
|
|
178
|
-
const defaultEntry = defaultEntries[0];
|
|
179
|
-
const hasDefault = defaultEntry !== void 0;
|
|
180
|
-
const [defaultSymbol, defaultTypeOnly] = defaultEntry ?? [null, true];
|
|
181
|
-
const typeOnlyStatement = isStatementTypeOnly(hasDefault, defaultTypeOnly, group);
|
|
182
|
-
if (typeOnlyStatement && hasDefault && hasNamed) return `${`import type ${defaultSymbol} from '${moduleSpecifier}'${attrs};`}\n${`import type { ${renderNamedBindingsList(group, true)} } from '${moduleSpecifier}'${attrs};`}`;
|
|
183
|
-
return `${typeOnlyStatement ? "import type" : "import"} ${buildImportClause(defaultSymbol, group, typeOnlyStatement)} from '${moduleSpecifier}'${attrs};`;
|
|
184
|
-
}
|
|
185
|
-
function renderNamedOnlyStatement(moduleSpecifier, group, attrs) {
|
|
186
|
-
const typeOnlyStatement = [...group.named.values()].every((binding) => binding.typeOnly);
|
|
187
|
-
return `${typeOnlyStatement ? "import type" : "import"} { ${renderNamedBindingsList(group, typeOnlyStatement)} } from '${moduleSpecifier}'${attrs};`;
|
|
188
|
-
}
|
|
189
|
-
function isStatementTypeOnly(hasDefault, defaultTypeOnly, group) {
|
|
190
|
-
const hasNamed = group.named.size > 0;
|
|
191
|
-
if (!hasDefault && !hasNamed) return false;
|
|
192
|
-
if (hasDefault && !defaultTypeOnly) return false;
|
|
193
|
-
for (const binding of group.named.values()) if (!binding.typeOnly) return false;
|
|
194
|
-
return true;
|
|
195
|
-
}
|
|
196
|
-
function buildImportClause(defaultSymbol, group, statementTypeOnly) {
|
|
197
|
-
const hasNamed = group.named.size > 0;
|
|
198
|
-
const hasDefault = defaultSymbol !== null;
|
|
199
|
-
const namedClause = hasNamed ? renderNamedBindingsList(group, statementTypeOnly) : "";
|
|
200
|
-
if (hasDefault && hasNamed) return `${defaultSymbol}, { ${namedClause} }`;
|
|
201
|
-
if (hasDefault) return defaultSymbol;
|
|
202
|
-
return `{ ${namedClause} }`;
|
|
203
|
-
}
|
|
204
|
-
function renderNamedBindingsList(group, statementTypeOnly) {
|
|
205
|
-
return [...group.named.values()].sort(compareNamedBindings).map((binding) => renderNamedBinding(binding, statementTypeOnly)).join(", ");
|
|
206
|
-
}
|
|
207
|
-
function compareNamedBindings(a, b) {
|
|
208
|
-
if (a.symbol !== b.symbol) return a.symbol < b.symbol ? -1 : 1;
|
|
209
|
-
const aAlias = a.alias ?? "";
|
|
210
|
-
const bAlias = b.alias ?? "";
|
|
211
|
-
if (aAlias === bAlias) return 0;
|
|
212
|
-
return aAlias < bAlias ? -1 : 1;
|
|
213
|
-
}
|
|
214
|
-
function namedBindingKey(symbol, alias) {
|
|
215
|
-
return `${symbol}\x00${alias ?? ""}`;
|
|
216
|
-
}
|
|
217
|
-
function renderNamedBinding(binding, statementTypeOnly) {
|
|
218
|
-
const prefix = !statementTypeOnly && binding.typeOnly ? "type " : "";
|
|
219
|
-
const aliasClause = binding.alias !== null ? ` as ${binding.alias}` : "";
|
|
220
|
-
return `${prefix}${binding.symbol}${aliasClause}`;
|
|
221
|
-
}
|
|
222
|
-
function buildAttributesClause(attrs) {
|
|
223
|
-
if (attrs === null) return "";
|
|
224
|
-
const entries = Object.entries(attrs).sort(([a], [b]) => a.localeCompare(b)).map(([k, v]) => `${k}: ${JSON.stringify(v)}`);
|
|
225
|
-
if (entries.length === 0) return "";
|
|
226
|
-
return ` with { ${entries.join(", ")} }`;
|
|
227
|
-
}
|
|
228
|
-
/**
|
|
229
|
-
* Abstract base class for any IR node that can be emitted as a TypeScript
|
|
230
|
-
* expression and declare its own import requirements.
|
|
231
|
-
*
|
|
232
|
-
* A top-level renderer walks an array of these polymorphically, concatenates
|
|
233
|
-
* `renderTypeScript()` results, and aggregates `importRequirements()` into a
|
|
234
|
-
* deduplicated import block.
|
|
235
|
-
*/
|
|
236
|
-
var TsExpression = class {};
|
|
237
|
-
//#endregion
|
|
238
|
-
export { TsExpression, jsonToTsSource, renderImports };
|
|
239
|
-
|
|
240
|
-
//# sourceMappingURL=ts-render.mjs.map
|
|
1
|
+
import { i as tsStringLiteral, n as jsonToTsSource, r as renderImports, t as TsExpression } from "./dist-DFakQfiQ.mjs";
|
|
2
|
+
export { TsExpression, jsonToTsSource, renderImports, tsStringLiteral };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@prisma/orm-framework",
|
|
3
|
-
"version": "0.17.0-dev.
|
|
3
|
+
"version": "0.17.0-dev.6",
|
|
4
4
|
"license": "Apache-2.0",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"sideEffects": false,
|
|
@@ -15,20 +15,20 @@
|
|
|
15
15
|
"uniku": "^0.4.3"
|
|
16
16
|
},
|
|
17
17
|
"devDependencies": {
|
|
18
|
-
"@internal/config": "0.17.0-dev.
|
|
19
|
-
"@internal/contract": "0.17.0-dev.
|
|
20
|
-
"@internal/contract-authoring": "0.17.0-dev.
|
|
21
|
-
"@internal/errors": "0.17.0-dev.
|
|
22
|
-
"@internal/framework-components": "0.17.0-dev.
|
|
23
|
-
"@internal/ids": "0.17.0-dev.
|
|
24
|
-
"@internal/operations": "0.17.0-dev.
|
|
25
|
-
"@internal/psl-parser": "0.17.0-dev.
|
|
26
|
-
"@internal/psl-printer": "0.17.0-dev.
|
|
27
|
-
"@internal/ts-render": "0.17.0-dev.
|
|
28
|
-
"@repo/tsconfig": "0.17.0-dev.
|
|
29
|
-
"@internal/publish-surface": "0.17.0-dev.
|
|
30
|
-
"@repo/tsdown": "0.17.0-dev.
|
|
31
|
-
"@internal/utils": "0.17.0-dev.
|
|
18
|
+
"@internal/config": "0.17.0-dev.6",
|
|
19
|
+
"@internal/contract": "0.17.0-dev.6",
|
|
20
|
+
"@internal/contract-authoring": "0.17.0-dev.6",
|
|
21
|
+
"@internal/errors": "0.17.0-dev.6",
|
|
22
|
+
"@internal/framework-components": "0.17.0-dev.6",
|
|
23
|
+
"@internal/ids": "0.17.0-dev.6",
|
|
24
|
+
"@internal/operations": "0.17.0-dev.6",
|
|
25
|
+
"@internal/psl-parser": "0.17.0-dev.6",
|
|
26
|
+
"@internal/psl-printer": "0.17.0-dev.6",
|
|
27
|
+
"@internal/ts-render": "0.17.0-dev.6",
|
|
28
|
+
"@repo/tsconfig": "0.17.0-dev.6",
|
|
29
|
+
"@internal/publish-surface": "0.17.0-dev.6",
|
|
30
|
+
"@repo/tsdown": "0.17.0-dev.6",
|
|
31
|
+
"@internal/utils": "0.17.0-dev.6",
|
|
32
32
|
"tsdown": "0.22.14",
|
|
33
33
|
"typescript": "5.9.3",
|
|
34
34
|
"vitest": "4.1.10"
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"codec-BgOWqkHY.mjs","names":[],"sources":["../../../../1-framework/1-core/framework-components/dist/codec.mjs"],"sourcesContent":["import { r as voidParamsSchema, t as emptyCodecLookup } from \"./codec-types-DcNvNeY1.mjs\";\nimport { i as validateCodecTypeParams, n as materializeCodec, r as resolveCodecDescriptorOrThrow, t as CONTRACT_CODEC_DESCRIPTOR_MISSING } from \"./resolve-codec-BZF8TZh_.mjs\";\n//#region src/shared/codec.ts\n/**\n* Abstract base class for concrete codec implementations.\n*\n* Codec authors extend this class with their typed `Id`, `TTraits`, `TWire`, `TInput` and override all four abstract conversion methods: `encode`, `decode`, `encodeJson`, and `decodeJson`. The runtime instance carries only its `id` (proxied through the descriptor so alias subclasses inherit the descriptor's id automatically) and the conversion methods — static metadata lives on the {@link CodecDescriptor}.\n*/\nvar CodecImpl = class {\n\tdescriptor;\n\t/**\n\t* Variance-erased descriptor reference. Concrete codec subclasses receive the typed descriptor in their own constructors and forward it via `super(descriptor)`; the variance erasure lives at this base because the abstract surface can't carry the concrete `TParams`.\n\t*/\n\tconstructor(descriptor) {\n\t\tthis.descriptor = descriptor;\n\t}\n\tget id() {\n\t\treturn this.descriptor.codecId;\n\t}\n};\n//#endregion\n//#region src/shared/codec-descriptor.ts\n/**\n* Abstract base class for concrete codec descriptors.\n*\n* Codec authors extend this class with their typed `TParams` and declare `codecId`, `traits`, `targetTypes`, `paramsSchema`, the curried `factory(params)`, and (optionally) `renderOutputType`.\n*\n* Implements the {@link CodecDescriptor} interface so a concrete subclass instance is directly usable wherever the framework expects a `CodecDescriptor<P>`.\n*/\nvar CodecDescriptorImpl = class {\n\t/** Boolean derived from `paramsSchema`: `true` whenever the schema is not the singleton `voidParamsSchema`. */\n\tget isParameterized() {\n\t\treturn this.paramsSchema !== voidParamsSchema;\n\t}\n};\n//#endregion\n//#region src/shared/column-spec.ts\n/**\n* Trivial column packager. Per-codec helpers call this directly with the result of `descriptor.factory(params)` — direct method invocation binds the descriptor's method-level generic at the call site and the literal flows through `R`.\n*\n* `nativeType` is the column's database-native type spelling — the value the postgres adapter's migration planner, the SQL renderer's cast policy, and the emitted contract's column `nativeType` slot read. Per-codec helpers pass the literal native-type string for their codec (e.g. `'text'`, `'int4'`, `'character varying'`); for codecs whose native-type spelling depends on parameters (none today; reserved for future shapes), the helper computes the rendered string before calling `column`. The framework does not derive the value from `codecId` — that mapping is target-specific and lives at the helper.\n*/\nfunction column(codecFactory, codecId, typeParams, nativeType) {\n\treturn {\n\t\tcodecFactory,\n\t\tcodecId,\n\t\ttypeParams,\n\t\tnativeType\n\t};\n}\n//#endregion\n//#region src/shared/render-ts-literal.ts\n/**\n* Renders a codec-encoded value as a TypeScript literal (e.g. `'low'`, `1`, `true`), or `undefined`\n* when the value isn't literal-expressible (objects, arrays, null).\n*\n* Valid **only for identity codecs** whose `encodeJson` output equals their decoded output type\n* (text, int, float, bool). A non-identity codec (e.g. one that encodes to an int but decodes to a\n* string literal) must NOT use this: it has to `decodeJson` first, then render, in its own\n* `renderValueLiteral`.\n*\n* String values are fully escaped for a single-quoted `.d.ts` literal: backslash, single quote, and\n* every character a raw single-quoted TS literal cannot contain — newline, carriage return, and the\n* U+2028/U+2029 line/paragraph separators (which JS also treats as line terminators).\n*/\nfunction renderTsLiteral(value) {\n\tif (typeof value === \"string\") return `'${value.replace(/\\\\/g, \"\\\\\\\\\").replace(/'/g, \"\\\\'\").replace(/\\n/g, \"\\\\n\").replace(/\\r/g, \"\\\\r\").replace(/\\u2028/g, \"\\\\u2028\").replace(/\\u2029/g, \"\\\\u2029\")}'`;\n\tif (typeof value === \"number\" || typeof value === \"boolean\") return String(value);\n}\n//#endregion\nexport { CONTRACT_CODEC_DESCRIPTOR_MISSING, CodecDescriptorImpl, CodecImpl, column, emptyCodecLookup, materializeCodec, renderTsLiteral, resolveCodecDescriptorOrThrow, validateCodecTypeParams, voidParamsSchema };\n\n//# sourceMappingURL=codec.mjs.map"],"mappings":";;;;;;;AAQA,IAAI,YAAY,MAAM;CACrB;;;;CAIA,YAAY,YAAY;EACvB,KAAK,aAAa;CACnB;CACA,IAAI,KAAK;EACR,OAAO,KAAK,WAAW;CACxB;AACD;;;;;;;;AAUA,IAAI,sBAAsB,MAAM;;CAE/B,IAAI,kBAAkB;EACrB,OAAO,KAAK,iBAAiB;CAC9B;AACD;;;;;;AAQA,SAAS,OAAO,cAAc,SAAS,YAAY,YAAY;CAC9D,OAAO;EACN;EACA;EACA;EACA;CACD;AACD;;;;;;;;;;;;;;AAgBA,SAAS,gBAAgB,OAAO;CAC/B,IAAI,OAAO,UAAU,UAAU,OAAO,IAAI,MAAM,QAAQ,OAAO,MAAM,CAAC,CAAC,QAAQ,MAAM,KAAK,CAAC,CAAC,QAAQ,OAAO,KAAK,CAAC,CAAC,QAAQ,OAAO,KAAK,CAAC,CAAC,QAAQ,WAAW,SAAS,CAAC,CAAC,QAAQ,WAAW,SAAS,EAAE;CACpM,IAAI,OAAO,UAAU,YAAY,OAAO,UAAU,WAAW,OAAO,OAAO,KAAK;AACjF"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import "./config-types-W-87vhZ4-C9EfSelV.mjs";
|
package/dist/ts-render.mjs.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"ts-render.mjs","names":[],"sources":["../../../../1-framework/1-core/ts-render/dist/index.mjs"],"sourcesContent":["import { InternalError } from \"@internal/utils/internal-error\";\nimport { structuredError } from \"@internal/utils/structured-error\";\n//#region src/json-to-ts-source.ts\n/**\n* Pure JSON-to-TypeScript-source printer.\n*\n* This module is the second stage of the codec → TS pipeline:\n*\n* jsValue → codec.encodeJson → JsonValue → jsonToTsSource → TS source text\n*\n* Stage 1 (`codec.encodeJson`) is a codec responsibility — date serialization,\n* opaque domain types (vector, bigint, uuid), JSON canonicalization. Stage 2\n* (this module) is a pure JSON-to-TS printer that must never grow type-specific\n* branches.\n*\n* To render a non-JSON JS value (Date, Vector, BigInt, Buffer, …), encode it\n* through the relevant codec's `encodeJson` first. Adding special cases to\n* this file is not the answer — that's what codecs are for.\n*/\n/**\n* Render a JSON-compatible value as a TypeScript source-text literal.\n*\n* Accepts `unknown` for ergonomics with structural types (e.g. `ColumnSpec`,\n* `ForeignKeySpec`) whose fields are all JSON-compatible but whose interfaces\n* lack the index signature TypeScript requires for `JsonObject` assignability.\n* Non-JSON values (Date, Symbol, Function, etc.) throw at runtime.\n*/\nfunction jsonToTsSource(value) {\n\tif (value === void 0) return \"undefined\";\n\tif (value === null) return \"null\";\n\tif (typeof value === \"string\") return stringifyLiteral(value);\n\tif (typeof value === \"number\" || typeof value === \"boolean\") return String(value);\n\tif (Array.isArray(value)) {\n\t\tif (value.length === 0) return \"[]\";\n\t\tconst items = value.map((v) => jsonToTsSource(v));\n\t\tconst singleLine = `[${items.join(\", \")}]`;\n\t\tif (singleLine.length <= 80) return singleLine;\n\t\treturn `[\\n${items.map((i) => ` ${i}`).join(\",\\n\")},\\n]`;\n\t}\n\tif (typeof value === \"object\") {\n\t\tconst entries = Object.entries(value).filter(([, v]) => v !== void 0);\n\t\tif (entries.length === 0) return \"{}\";\n\t\tconst items = entries.map(([k, v]) => `${renderKey(k)}: ${jsonToTsSource(v)}`);\n\t\tconst singleLine = `{ ${items.join(\", \")} }`;\n\t\tif (singleLine.length <= 80) return singleLine;\n\t\treturn `{\\n${items.map((i) => ` ${i}`).join(\",\\n\")},\\n}`;\n\t}\n\tthrow new InternalError(`jsonToTsSource: unsupported value type \"${typeof value}\"`);\n}\nfunction renderKey(key) {\n\tif (key === \"__proto__\") return stringifyLiteral(key);\n\treturn /^[a-zA-Z_$][a-zA-Z0-9_$]*$/.test(key) ? key : stringifyLiteral(key);\n}\nfunction stringifyLiteral(value) {\n\treturn JSON.stringify(value).replace(/\\u2028/g, \"\\\\u2028\").replace(/\\u2029/g, \"\\\\u2029\");\n}\n//#endregion\n//#region src/contract-errors.ts\nfunction contractError(code, message, options) {\n\treturn structuredError(code, message, options);\n}\n//#endregion\n//#region src/render-imports.ts\n/**\n* Render an aggregated `import` block from a flat list of\n* `ImportRequirement`s. Each target's migration renderer collects\n* requirements polymorphically from its call nodes and pipes them here.\n*\n* The emitter invariants:\n*\n* - **Usually one line per module specifier.** Named imports are aggregated\n* and emitted sorted; a single default symbol is combined onto the same\n* line when attributes agree (`import def, { a, b } from \"m\";`). Aliased\n* symbols render `symbol as alias`. When every symbol for a module is\n* `typeOnly`, the statement collapses to `import type { … }`; a module\n* mixing value and type symbols prefixes the type-only ones\n* (`import { type T, v }`). Exceptions that split into multiple lines: a\n* fully type-only statement with both a default and one or more named\n* bindings (`import type D from \"m\";` then `import type { N } from \"m\";`,\n* because TypeScript rejects `import type D, { N } from \"m\"` — TS1363),\n* and multiple distinct default symbols (see below).\n* - **Multiple distinct default symbols per module are allowed.** JS permits\n* re-importing the same specifier under different default-binding names\n* (`import a from 'm'; import b from 'm';`), so each distinct default\n* symbol renders its own `import` line, sorted alphabetically; a repeated\n* requirement for the same symbol still collapses into one binding,\n* merging `typeOnly` by AND.\n* - **Attribute unanimity per module.** All requirements for the same\n* module specifier must carry the same (or no) `attributes` map.\n* Divergent attribute maps throw — they can't collapse to one line\n* and there's no user-resolvable recovery at this layer.\n* - **Distinct (symbol, alias) pairs are distinct bindings.** TypeScript\n* permits importing the same export under multiple local names, so\n* `{ A }` + `{ A as B }` renders as `import { A, A as B } from \"m\"` and\n* `{ A as B }` + `{ A as C }` renders as `import { A as B, A as C } from \"m\"`.\n* Truly identical `(symbol, alias)` pairs still collapse to one binding,\n* merging `typeOnly` by AND.\n* - **Deterministic ordering.** Modules are emitted sorted by specifier;\n* within a module, named bindings are emitted sorted by `(symbol, alias)`\n* using JavaScript code-unit comparison, with the un-aliased form (no\n* alias) treated as alias `\"\"` so it sorts before any aliased form of the\n* same symbol.\n*\n* Returns a string containing one or more import lines per module (see the\n* splitting exceptions above), joined by `\\n` (no trailing newline). An\n* empty requirement list returns `\"\"`.\n*/\nfunction renderImports(requirements) {\n\treturn [...aggregateByModule(requirements).entries()].sort(([a], [b]) => a.localeCompare(b)).map(([moduleSpecifier, group]) => renderModuleImport(moduleSpecifier, group)).join(\"\\n\");\n}\nfunction aggregateByModule(requirements) {\n\tconst byModule = /* @__PURE__ */ new Map();\n\tfor (const req of requirements) {\n\t\tlet group = byModule.get(req.moduleSpecifier);\n\t\tif (!group) {\n\t\t\tgroup = {\n\t\t\t\tnamed: /* @__PURE__ */ new Map(),\n\t\t\t\tdefaults: /* @__PURE__ */ new Map(),\n\t\t\t\tattributes: null,\n\t\t\t\tattributesSet: false\n\t\t\t};\n\t\t\tbyModule.set(req.moduleSpecifier, group);\n\t\t}\n\t\tmergeRequirementIntoGroup(req, group);\n\t}\n\treturn byModule;\n}\nfunction mergeRequirementIntoGroup(req, group) {\n\tconst kind = req.kind ?? \"named\";\n\tconst typeOnly = req.typeOnly === true;\n\tif (kind === \"default\") {\n\t\tconst existingTypeOnly = group.defaults.get(req.symbol);\n\t\tgroup.defaults.set(req.symbol, existingTypeOnly === void 0 ? typeOnly : existingTypeOnly && typeOnly);\n\t} else {\n\t\tconst alias = req.alias && req.alias !== req.symbol ? req.alias : null;\n\t\tconst key = namedBindingKey(req.symbol, alias);\n\t\tconst existing = group.named.get(key);\n\t\tif (existing) existing.typeOnly = existing.typeOnly && typeOnly;\n\t\telse group.named.set(key, {\n\t\t\tsymbol: req.symbol,\n\t\t\talias,\n\t\t\ttypeOnly\n\t\t});\n\t}\n\tmergeAttributes(req, group);\n}\nfunction mergeAttributes(req, group) {\n\tconst incoming = req.attributes ?? null;\n\tif (!group.attributesSet) {\n\t\tgroup.attributes = incoming;\n\t\tgroup.attributesSet = true;\n\t\treturn;\n\t}\n\tif (!attributesEqual(group.attributes, incoming)) throw contractError(\"CONTRACT.PACK_CONTRIBUTION_INVALID\", `Conflicting import attributes for module \"${req.moduleSpecifier}\": ${stringifyAttributes(group.attributes)} vs ${stringifyAttributes(incoming)}.`, { meta: { moduleSpecifier: req.moduleSpecifier } });\n}\nfunction attributesEqual(a, b) {\n\tif (a === b) return true;\n\tif (a === null || b === null) return false;\n\tconst aKeys = Object.keys(a).sort();\n\tconst bKeys = Object.keys(b).sort();\n\tif (aKeys.length !== bKeys.length) return false;\n\tfor (let i = 0; i < aKeys.length; i++) {\n\t\tconst key = aKeys[i];\n\t\tif (key !== bKeys[i]) return false;\n\t\tif (a[key] !== b[key]) return false;\n\t}\n\treturn true;\n}\nfunction stringifyAttributes(attrs) {\n\tif (attrs === null) return \"(none)\";\n\treturn `{ ${Object.entries(attrs).sort(([a], [b]) => a.localeCompare(b)).map(([k, v]) => `${k}: ${JSON.stringify(v)}`).join(\", \")} }`;\n}\nfunction renderModuleImport(moduleSpecifier, group) {\n\tconst attrs = buildAttributesClause(group.attributes);\n\tconst defaultEntries = [...group.defaults.entries()].sort(([a], [b]) => a.localeCompare(b));\n\tconst hasNamed = group.named.size > 0;\n\tif (defaultEntries.length > 1) {\n\t\tconst defaultLines = defaultEntries.map(([symbol, typeOnly]) => `import ${typeOnly ? \"type \" : \"\"}${symbol} from '${moduleSpecifier}'${attrs};`);\n\t\tif (!hasNamed) return defaultLines.join(\"\\n\");\n\t\treturn [...defaultLines, renderNamedOnlyStatement(moduleSpecifier, group, attrs)].join(\"\\n\");\n\t}\n\tconst defaultEntry = defaultEntries[0];\n\tconst hasDefault = defaultEntry !== void 0;\n\tconst [defaultSymbol, defaultTypeOnly] = defaultEntry ?? [null, true];\n\tconst typeOnlyStatement = isStatementTypeOnly(hasDefault, defaultTypeOnly, group);\n\tif (typeOnlyStatement && hasDefault && hasNamed) return `${`import type ${defaultSymbol} from '${moduleSpecifier}'${attrs};`}\\n${`import type { ${renderNamedBindingsList(group, true)} } from '${moduleSpecifier}'${attrs};`}`;\n\treturn `${typeOnlyStatement ? \"import type\" : \"import\"} ${buildImportClause(defaultSymbol, group, typeOnlyStatement)} from '${moduleSpecifier}'${attrs};`;\n}\nfunction renderNamedOnlyStatement(moduleSpecifier, group, attrs) {\n\tconst typeOnlyStatement = [...group.named.values()].every((binding) => binding.typeOnly);\n\treturn `${typeOnlyStatement ? \"import type\" : \"import\"} { ${renderNamedBindingsList(group, typeOnlyStatement)} } from '${moduleSpecifier}'${attrs};`;\n}\nfunction isStatementTypeOnly(hasDefault, defaultTypeOnly, group) {\n\tconst hasNamed = group.named.size > 0;\n\tif (!hasDefault && !hasNamed) return false;\n\tif (hasDefault && !defaultTypeOnly) return false;\n\tfor (const binding of group.named.values()) if (!binding.typeOnly) return false;\n\treturn true;\n}\nfunction buildImportClause(defaultSymbol, group, statementTypeOnly) {\n\tconst hasNamed = group.named.size > 0;\n\tconst hasDefault = defaultSymbol !== null;\n\tconst namedClause = hasNamed ? renderNamedBindingsList(group, statementTypeOnly) : \"\";\n\tif (hasDefault && hasNamed) return `${defaultSymbol}, { ${namedClause} }`;\n\tif (hasDefault) return defaultSymbol;\n\treturn `{ ${namedClause} }`;\n}\nfunction renderNamedBindingsList(group, statementTypeOnly) {\n\treturn [...group.named.values()].sort(compareNamedBindings).map((binding) => renderNamedBinding(binding, statementTypeOnly)).join(\", \");\n}\nfunction compareNamedBindings(a, b) {\n\tif (a.symbol !== b.symbol) return a.symbol < b.symbol ? -1 : 1;\n\tconst aAlias = a.alias ?? \"\";\n\tconst bAlias = b.alias ?? \"\";\n\tif (aAlias === bAlias) return 0;\n\treturn aAlias < bAlias ? -1 : 1;\n}\nfunction namedBindingKey(symbol, alias) {\n\treturn `${symbol}\\x00${alias ?? \"\"}`;\n}\nfunction renderNamedBinding(binding, statementTypeOnly) {\n\tconst prefix = !statementTypeOnly && binding.typeOnly ? \"type \" : \"\";\n\tconst aliasClause = binding.alias !== null ? ` as ${binding.alias}` : \"\";\n\treturn `${prefix}${binding.symbol}${aliasClause}`;\n}\nfunction buildAttributesClause(attrs) {\n\tif (attrs === null) return \"\";\n\tconst entries = Object.entries(attrs).sort(([a], [b]) => a.localeCompare(b)).map(([k, v]) => `${k}: ${JSON.stringify(v)}`);\n\tif (entries.length === 0) return \"\";\n\treturn ` with { ${entries.join(\", \")} }`;\n}\n//#endregion\n//#region src/ts-expression.ts\n/**\n* Abstract base class for any IR node that can be emitted as a TypeScript\n* expression and declare its own import requirements.\n*\n* A top-level renderer walks an array of these polymorphically, concatenates\n* `renderTypeScript()` results, and aggregates `importRequirements()` into a\n* deduplicated import block.\n*/\nvar TsExpression = class {};\n//#endregion\nexport { TsExpression, jsonToTsSource, renderImports };\n\n//# sourceMappingURL=index.mjs.map"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;AA2BA,SAAS,eAAe,OAAO;CAC9B,IAAI,UAAU,KAAK,GAAG,OAAO;CAC7B,IAAI,UAAU,MAAM,OAAO;CAC3B,IAAI,OAAO,UAAU,UAAU,OAAO,iBAAiB,KAAK;CAC5D,IAAI,OAAO,UAAU,YAAY,OAAO,UAAU,WAAW,OAAO,OAAO,KAAK;CAChF,IAAI,MAAM,QAAQ,KAAK,GAAG;EACzB,IAAI,MAAM,WAAW,GAAG,OAAO;EAC/B,MAAM,QAAQ,MAAM,KAAK,MAAM,eAAe,CAAC,CAAC;EAChD,MAAM,aAAa,IAAI,MAAM,KAAK,IAAI,EAAE;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