@kunk/model 3.0.0

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.
@@ -0,0 +1,13 @@
1
+ $ tsdown
2
+ ℹ tsdown v0.20.3 powered by rolldown v1.0.0-rc.3
3
+ ℹ config file: /home/runner/work/kunk/kunk/packages/model/tsdown.config.ts (unrun)
4
+ ℹ entry: src/index.ts
5
+ ℹ tsconfig: ../../tsconfig.json
6
+ ℹ Build start
7
+ ℹ dist/index.mjs 0.92 kB │ gzip: 0.45 kB
8
+ ℹ dist/chunk-q_BqMMLn.mjs 0.21 kB │ gzip: 0.17 kB
9
+ ℹ dist/index.d.mts 1.36 kB │ gzip: 0.56 kB
10
+ ℹ 3 files, total: 2.48 kB
11
+ [PLUGIN_TIMINGS] Warning: Your build spent significant time in plugin `rolldown-plugin-dts:generate`. See https://rolldown.rs/options/checks#plugintimings for more details.
12
+
13
+ ✔ Build complete in 3883ms
package/CHANGELOG.md ADDED
@@ -0,0 +1,7 @@
1
+ # @kunk/model
2
+
3
+ ## 3.0.0
4
+
5
+ ### Major Changes
6
+
7
+ - version 2
@@ -0,0 +1 @@
1
+ var __defProp=Object.defineProperty,__exportAll=(e,t)=>{let n={};for(var r in e)__defProp(n,r,{get:e[r],enumerable:!0});return t||__defProp(n,Symbol.toStringTag,{value:`Module`}),n};export{__exportAll as t};
@@ -0,0 +1,31 @@
1
+ import z from "zod/v4";
2
+
3
+ //#region src/T.d.ts
4
+ declare namespace T_d_exports {
5
+ export { ModelError, any, array, boolean, codec, date, discriminatedUnion, _enum as enum, intersection, iso, literal, number, object, record, ref, string, toJSONSchema, tuple, union, uuid };
6
+ }
7
+ declare function ref<T extends readonly string[]>(...resource: T): z.ZodObject<{
8
+ resource: z.ZodEnum<{ [k_1 in T[number]]: k_1 } extends infer T_1 ? { [k in keyof T_1]: T_1[k] } : never>;
9
+ id: z.ZodString;
10
+ }, z.core.$strip>;
11
+ declare const object: typeof z.object;
12
+ declare const array: typeof z.array;
13
+ declare const uuid: typeof z.uuid;
14
+ declare const any: typeof z.any;
15
+ declare const record: typeof z.record;
16
+ declare const tuple: typeof z.tuple;
17
+ declare const union: typeof z.union;
18
+ declare const intersection: typeof z.intersection;
19
+ declare const literal: typeof z.literal;
20
+ declare const date: typeof z.date;
21
+ declare const iso: typeof z.iso;
22
+ declare const boolean: typeof z.boolean;
23
+ declare const number: typeof z.number;
24
+ declare const string: typeof z.string;
25
+ declare const codec: typeof z.codec;
26
+ declare const discriminatedUnion: typeof z.discriminatedUnion;
27
+ declare const toJSONSchema: typeof z.core.toJSONSchema;
28
+ declare const ModelError: z.core.$constructor<z.ZodError<unknown>, z.core.$ZodIssue[]>;
29
+ declare const _enum: typeof z.enum;
30
+ //#endregion
31
+ export { T_d_exports as T };
package/dist/index.mjs ADDED
@@ -0,0 +1 @@
1
+ import{t as __exportAll}from"./chunk-q_BqMMLn.mjs";import z from"zod/v4";var T_exports=__exportAll({ModelError:()=>ModelError,any:()=>any,array:()=>array,boolean:()=>boolean,codec:()=>codec,date:()=>date,discriminatedUnion:()=>discriminatedUnion,enum:()=>_enum,intersection:()=>intersection,iso:()=>iso,literal:()=>literal,number:()=>number,object:()=>object,record:()=>record,ref:()=>ref,string:()=>string,toJSONSchema:()=>toJSONSchema,tuple:()=>tuple,union:()=>union,uuid:()=>uuid});function ref(...e){return z.object({resource:z.enum(e),id:z.string()})}const object=z.object,array=z.array,uuid=z.uuid,any=z.any,record=z.record,tuple=z.tuple,union=z.union,intersection=z.intersection,literal=z.literal,date=z.date,iso=z.iso,boolean=z.boolean,number=z.number,string=z.string,codec=z.codec,discriminatedUnion=z.discriminatedUnion,toJSONSchema=z.toJSONSchema,ModelError=z.ZodError,_enum=z.enum;export{T_exports as T};
package/package.json ADDED
@@ -0,0 +1,17 @@
1
+ {
2
+ "name": "@kunk/model",
3
+ "version": "3.0.0",
4
+ "private": false,
5
+ "type": "module",
6
+ "main": "./src/index.ts",
7
+ "module": "./src/index.ts",
8
+ "scripts": {
9
+ "build": "tsdown"
10
+ },
11
+ "dependencies": {
12
+ "zod": "^4.3.6"
13
+ },
14
+ "publishConfig": {
15
+ "access": "public"
16
+ }
17
+ }
package/src/T.ts ADDED
@@ -0,0 +1,34 @@
1
+ import z from "zod/v4";
2
+
3
+ export function ref<T extends readonly string[]>(...resource: T) {
4
+ return z.object({
5
+ resource: z.enum(resource),
6
+ id: z.string()
7
+ })
8
+ }
9
+
10
+ export const object = z.object
11
+ export const array = z.array
12
+ export const uuid = z.uuid
13
+ export const any = z.any
14
+ export const record = z.record
15
+ export const tuple = z.tuple
16
+ export const union = z.union
17
+ export const intersection = z.intersection
18
+ export const literal = z.literal
19
+ export const date = z.date
20
+ export const iso = z.iso
21
+ export const boolean = z.boolean
22
+ export const number = z.number
23
+ export const string = z.string
24
+ export const codec = z.codec
25
+ export const discriminatedUnion = z.discriminatedUnion
26
+
27
+
28
+ export const toJSONSchema = z.toJSONSchema
29
+
30
+
31
+ export const ModelError = z.ZodError
32
+
33
+ const _enum = z.enum
34
+ export { _enum as enum }
package/src/index.ts ADDED
@@ -0,0 +1 @@
1
+ export * as T from "./T"
@@ -0,0 +1,15 @@
1
+ import { defineConfig } from 'tsdown'
2
+
3
+ export default defineConfig({
4
+ entry: [
5
+ './src/index.ts'
6
+ ],
7
+ external: [
8
+ "drizzle-orm",
9
+ "drizzle-sdk",
10
+ ],
11
+ dts: true,
12
+ minify: {
13
+ mangle: true,
14
+ }
15
+ })