@prisma-next/extension-arktype-json 0.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +91 -0
- package/dist/arktype-json-codec-BbiBmtTK.mjs +224 -0
- package/dist/arktype-json-codec-BbiBmtTK.mjs.map +1 -0
- package/dist/arktype-json-codec-yNv1hzBm.d.mts +92 -0
- package/dist/arktype-json-codec-yNv1hzBm.d.mts.map +1 -0
- package/dist/codec-types-CH37Yc0C.d.mts +27 -0
- package/dist/codec-types-CH37Yc0C.d.mts.map +1 -0
- package/dist/codec-types.d.mts +2 -0
- package/dist/codec-types.mjs +1 -0
- package/dist/codecs.d.mts +2 -0
- package/dist/codecs.mjs +3 -0
- package/dist/column-types.d.mts +2 -0
- package/dist/column-types.mjs +3 -0
- package/dist/control.d.mts +8 -0
- package/dist/control.d.mts.map +1 -0
- package/dist/control.mjs +24 -0
- package/dist/control.mjs.map +1 -0
- package/dist/pack-meta-DycetSQB.mjs +37 -0
- package/dist/pack-meta-DycetSQB.mjs.map +1 -0
- package/dist/pack.d.mts +40 -0
- package/dist/pack.d.mts.map +1 -0
- package/dist/pack.mjs +3 -0
- package/dist/runtime.d.mts +8 -0
- package/dist/runtime.d.mts.map +1 -0
- package/dist/runtime.mjs +42 -0
- package/dist/runtime.mjs.map +1 -0
- package/package.json +52 -0
- package/src/core/arktype-json-codec.ts +402 -0
- package/src/core/pack-meta.ts +63 -0
- package/src/exports/codec-types.ts +10 -0
- package/src/exports/codecs.ts +6 -0
- package/src/exports/column-types.ts +2 -0
- package/src/exports/control.ts +44 -0
- package/src/exports/pack.ts +1 -0
- package/src/exports/runtime.ts +43 -0
- package/src/types/codec-types.ts +24 -0
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Runtime-plane extension descriptor for arktype-json.
|
|
3
|
+
*
|
|
4
|
+
* Registers `arktypeJsonCodec` (the parameterized codec descriptor)
|
|
5
|
+
* through the SQL runtime's `parameterizedCodecs:` slot. Per Phase B of
|
|
6
|
+
* codec-registry-unification, the legacy `codecs:` slot returns an empty
|
|
7
|
+
* registry — the unified descriptor map subsumes the codec-id-keyed
|
|
8
|
+
* metadata reads that the legacy slot used to back, and the runtime
|
|
9
|
+
* dispatch (`forColumn`) materializes the per-instance codec from the
|
|
10
|
+
* descriptor's factory.
|
|
11
|
+
*
|
|
12
|
+
* Lives at the runtime-plane entrypoint so `src/core/**` stays free of
|
|
13
|
+
* runtime-plane imports (per `.cursor/rules/multi-plane-entrypoints.mdc`).
|
|
14
|
+
*/
|
|
15
|
+
|
|
16
|
+
import { createCodecRegistry } from '@prisma-next/sql-relational-core/ast';
|
|
17
|
+
import type { SqlRuntimeExtensionDescriptor } from '@prisma-next/sql-runtime';
|
|
18
|
+
import { arktypeJsonCodec } from '../core/arktype-json-codec';
|
|
19
|
+
import { arktypeJsonPackMeta } from '../core/pack-meta';
|
|
20
|
+
|
|
21
|
+
function createArktypeJsonCodecRegistry() {
|
|
22
|
+
// arktype-json ships only the parameterized descriptor; the legacy
|
|
23
|
+
// `codecs:` slot has nothing to register.
|
|
24
|
+
return createCodecRegistry();
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
export const arktypeJsonRuntimeDescriptor: SqlRuntimeExtensionDescriptor<'postgres'> = {
|
|
28
|
+
kind: 'extension' as const,
|
|
29
|
+
id: arktypeJsonPackMeta.id,
|
|
30
|
+
version: arktypeJsonPackMeta.version,
|
|
31
|
+
familyId: 'sql' as const,
|
|
32
|
+
targetId: 'postgres' as const,
|
|
33
|
+
codecs: createArktypeJsonCodecRegistry,
|
|
34
|
+
parameterizedCodecs: () => [arktypeJsonCodec],
|
|
35
|
+
create() {
|
|
36
|
+
return {
|
|
37
|
+
familyId: 'sql' as const,
|
|
38
|
+
targetId: 'postgres' as const,
|
|
39
|
+
};
|
|
40
|
+
},
|
|
41
|
+
};
|
|
42
|
+
|
|
43
|
+
export default arktypeJsonRuntimeDescriptor;
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Codec type definitions for the arktype-json extension.
|
|
3
|
+
*
|
|
4
|
+
* Type-only export consumed by emitted `contract.d.ts` to power
|
|
5
|
+
* `CodecTypes['arktype/json@1']['output']` lookups. The shape mirrors the
|
|
6
|
+
* codec the curried factory returns at runtime so the emit and no-emit
|
|
7
|
+
* paths stay structurally aligned.
|
|
8
|
+
*
|
|
9
|
+
* The output type is intentionally `unknown` — the precise inference is
|
|
10
|
+
* column-site-local (the no-emit `FieldOutputType` resolver reads the
|
|
11
|
+
* factory's return type from the column descriptor's `type` slot, which
|
|
12
|
+
* carries `(ctx) => Codec<…, S['infer']>`). The emit path renders the
|
|
13
|
+
* descriptor's `expression` as the column's TS type (per the descriptor's
|
|
14
|
+
* `renderOutputType`); the codec-id-keyed `CodecTypes` map is the
|
|
15
|
+
* fallback for sites without a column descriptor in scope.
|
|
16
|
+
*/
|
|
17
|
+
|
|
18
|
+
export type CodecTypes = {
|
|
19
|
+
readonly 'arktype/json@1': {
|
|
20
|
+
readonly input: unknown;
|
|
21
|
+
readonly output: unknown;
|
|
22
|
+
readonly traits: 'equality';
|
|
23
|
+
};
|
|
24
|
+
};
|