@zipbul/baker 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.
Files changed (66) hide show
  1. package/LICENSE +21 -0
  2. package/README.ko.md +448 -0
  3. package/README.md +448 -0
  4. package/dist/index-6pbm9cq6.js +15 -0
  5. package/dist/index-6pbm9cq6.js.map +17 -0
  6. package/dist/index-fww37qs9.js +5 -0
  7. package/dist/index-fww37qs9.js.map +20 -0
  8. package/dist/index-w36xamck.js +6 -0
  9. package/dist/index-w36xamck.js.map +10 -0
  10. package/dist/index.d.ts +9 -0
  11. package/dist/index.js +145 -0
  12. package/dist/index.js.map +18 -0
  13. package/dist/src/aot/array.d.ts +7 -0
  14. package/dist/src/aot/common.d.ts +15 -0
  15. package/dist/src/aot/date.d.ts +3 -0
  16. package/dist/src/aot/index.d.ts +9 -0
  17. package/dist/src/aot/index.js +5 -0
  18. package/dist/src/aot/index.js.map +18 -0
  19. package/dist/src/aot/locales.d.ts +5 -0
  20. package/dist/src/aot/number.d.ts +6 -0
  21. package/dist/src/aot/object.d.ts +6 -0
  22. package/dist/src/aot/string.d.ts +72 -0
  23. package/dist/src/aot/transform.d.ts +25 -0
  24. package/dist/src/aot/typechecker.d.ts +10 -0
  25. package/dist/src/collect.d.ts +12 -0
  26. package/dist/src/create-rule.d.ts +31 -0
  27. package/dist/src/decorators/array.d.ts +13 -0
  28. package/dist/src/decorators/common.d.ts +33 -0
  29. package/dist/src/decorators/date.d.ts +5 -0
  30. package/dist/src/decorators/index.d.ts +11 -0
  31. package/dist/src/decorators/index.js +5 -0
  32. package/dist/src/decorators/index.js.map +9 -0
  33. package/dist/src/decorators/locales.d.ts +9 -0
  34. package/dist/src/decorators/number.d.ts +11 -0
  35. package/dist/src/decorators/object.d.ts +9 -0
  36. package/dist/src/decorators/string.d.ts +72 -0
  37. package/dist/src/decorators/transform.d.ts +68 -0
  38. package/dist/src/decorators/typechecker.d.ts +18 -0
  39. package/dist/src/errors.d.ts +37 -0
  40. package/dist/src/functions/deserialize.d.ts +8 -0
  41. package/dist/src/functions/index.d.ts +2 -0
  42. package/dist/src/functions/serialize.d.ts +8 -0
  43. package/dist/src/interfaces.d.ts +47 -0
  44. package/dist/src/registry.d.ts +16 -0
  45. package/dist/src/rules/array.d.ts +7 -0
  46. package/dist/src/rules/common.d.ts +7 -0
  47. package/dist/src/rules/date.d.ts +3 -0
  48. package/dist/src/rules/index.d.ts +11 -0
  49. package/dist/src/rules/index.js +5 -0
  50. package/dist/src/rules/index.js.map +9 -0
  51. package/dist/src/rules/locales.d.ts +5 -0
  52. package/dist/src/rules/number.d.ts +6 -0
  53. package/dist/src/rules/object.d.ts +7 -0
  54. package/dist/src/rules/string.d.ts +145 -0
  55. package/dist/src/rules/typechecker.d.ts +14 -0
  56. package/dist/src/seal/circular-analyzer.d.ts +13 -0
  57. package/dist/src/seal/deserialize-builder.d.ts +5 -0
  58. package/dist/src/seal/expose-validator.d.ts +11 -0
  59. package/dist/src/seal/index.d.ts +5 -0
  60. package/dist/src/seal/seal.d.ts +27 -0
  61. package/dist/src/seal/serialize-builder.d.ts +7 -0
  62. package/dist/src/symbols.d.ts +8 -0
  63. package/dist/src/symbols.js +5 -0
  64. package/dist/src/symbols.js.map +9 -0
  65. package/dist/src/types.d.ts +119 -0
  66. package/package.json +83 -0
@@ -0,0 +1,9 @@
1
+ {
2
+ "version": 3,
3
+ "sources": [],
4
+ "sourcesContent": [
5
+ ],
6
+ "mappings": "",
7
+ "debugId": "94F6EB707B64F4EC64756E2164756E21",
8
+ "names": []
9
+ }
@@ -0,0 +1,5 @@
1
+ import type { EmittableRule } from '../types';
2
+ export declare function isMobilePhone(locale: string): EmittableRule;
3
+ export declare function isPostalCode(locale: string): EmittableRule;
4
+ export declare function isIdentityCard(locale: string): EmittableRule;
5
+ export declare function isPassportNumber(locale: string): EmittableRule;
@@ -0,0 +1,6 @@
1
+ import type { EmittableRule } from '../types';
2
+ export declare function min(n: number): EmittableRule;
3
+ export declare function max(n: number): EmittableRule;
4
+ export declare const isPositive: EmittableRule;
5
+ export declare const isNegative: EmittableRule;
6
+ export declare function isDivisibleBy(n: number): EmittableRule;
@@ -0,0 +1,7 @@
1
+ import type { EmittableRule } from '../types';
2
+ export interface IsNotEmptyObjectOptions {
3
+ /** null/undefined 값을 가진 키를 무시할지 여부 (기본: false → 무시하지 않음) */
4
+ nullable?: boolean;
5
+ }
6
+ export declare function isNotEmptyObject(options?: IsNotEmptyObjectOptions): EmittableRule;
7
+ export declare function isInstance(targetType: new (...args: any[]) => any): EmittableRule;
@@ -0,0 +1,145 @@
1
+ import type { EmittableRule } from '../types';
2
+ export declare function minLength(min: number): EmittableRule;
3
+ export declare function maxLength(max: number): EmittableRule;
4
+ export declare function length(minLen: number, maxLen: number): EmittableRule;
5
+ export declare function contains(seed: string): EmittableRule;
6
+ export declare function notContains(seed: string): EmittableRule;
7
+ export declare function matches(pattern: string | RegExp, modifiers?: string): EmittableRule;
8
+ export declare const isLowercase: EmittableRule;
9
+ export declare const isUppercase: EmittableRule;
10
+ export declare const isAscii: EmittableRule;
11
+ export declare const isAlpha: EmittableRule;
12
+ export declare const isAlphanumeric: EmittableRule;
13
+ export declare const isBooleanString: EmittableRule;
14
+ export interface IsNumberStringOptions {
15
+ no_symbols?: boolean;
16
+ }
17
+ export declare function isNumberString(options?: IsNumberStringOptions): EmittableRule;
18
+ export interface IsDecimalOptions {
19
+ decimal_digits?: string;
20
+ force_decimal?: boolean;
21
+ locale?: string;
22
+ }
23
+ export declare function isDecimal(options?: IsDecimalOptions): EmittableRule;
24
+ export declare const isFullWidth: EmittableRule;
25
+ export declare const isHalfWidth: EmittableRule;
26
+ export declare const isVariableWidth: EmittableRule;
27
+ export declare const isMultibyte: EmittableRule;
28
+ export declare const isSurrogatePair: EmittableRule;
29
+ export declare const isHexadecimal: EmittableRule;
30
+ export declare const isOctal: EmittableRule;
31
+ export interface IsEmailOptions {
32
+ allow_display_name?: boolean;
33
+ allow_utf8_local_part?: boolean;
34
+ require_tld?: boolean;
35
+ }
36
+ export declare function isEmail(_options?: IsEmailOptions): EmittableRule;
37
+ export interface IsURLOptions {
38
+ protocols?: string[];
39
+ require_tld?: boolean;
40
+ require_protocol?: boolean;
41
+ allow_underscores?: boolean;
42
+ allow_trailing_dot?: boolean;
43
+ allow_protocol_relative_urls?: boolean;
44
+ }
45
+ export declare function isURL(options?: IsURLOptions): EmittableRule;
46
+ export declare function isUUID(version?: 1 | 2 | 3 | 4 | 5 | 'all'): EmittableRule;
47
+ export declare function isIP(version?: 4 | 6): EmittableRule;
48
+ export declare const isHexColor: EmittableRule;
49
+ export declare function isRgbColor(includePercentValues?: boolean): EmittableRule;
50
+ export declare const isHSL: EmittableRule;
51
+ export interface IsMACAddressOptions {
52
+ no_separators?: boolean;
53
+ }
54
+ export declare function isMACAddress(options?: IsMACAddressOptions): EmittableRule;
55
+ export declare function isISBN(version?: 10 | 13): EmittableRule;
56
+ export declare const isISIN: EmittableRule;
57
+ export interface IsISO8601Options {
58
+ strict?: boolean;
59
+ }
60
+ export declare function isISO8601(options?: IsISO8601Options): EmittableRule;
61
+ export declare const isISRC: EmittableRule;
62
+ export interface IsISSNOptions {
63
+ case_sensitive?: boolean;
64
+ requireHyphen?: boolean;
65
+ }
66
+ export declare function isISSN(options?: IsISSNOptions): EmittableRule;
67
+ export declare const isJWT: EmittableRule;
68
+ export interface IsLatLongOptions {
69
+ checkDMS?: boolean;
70
+ }
71
+ export declare function isLatLong(options?: IsLatLongOptions): EmittableRule;
72
+ export declare const isLocale: EmittableRule;
73
+ export declare const isDataURI: EmittableRule;
74
+ export interface IsFQDNOptions {
75
+ require_tld?: boolean;
76
+ allow_underscores?: boolean;
77
+ allow_trailing_dot?: boolean;
78
+ }
79
+ export declare function isFQDN(options?: IsFQDNOptions): EmittableRule;
80
+ export declare const isPort: EmittableRule;
81
+ export declare const isEAN: EmittableRule;
82
+ export declare const isISO31661Alpha2: EmittableRule;
83
+ export declare const isISO31661Alpha3: EmittableRule;
84
+ export declare const isBIC: EmittableRule;
85
+ export declare const isFirebasePushId: EmittableRule;
86
+ export declare const isSemVer: EmittableRule;
87
+ export declare const isMongoId: EmittableRule;
88
+ export declare const isJSON: EmittableRule;
89
+ export interface IsBase32Options {
90
+ crockford?: boolean;
91
+ }
92
+ export declare function isBase32(options?: IsBase32Options): EmittableRule;
93
+ export declare const isBase58: EmittableRule;
94
+ export interface IsBase64Options {
95
+ urlSafe?: boolean;
96
+ }
97
+ export declare function isBase64(options?: IsBase64Options): EmittableRule;
98
+ export interface IsDateStringOptions {
99
+ strictMode?: boolean;
100
+ }
101
+ export declare function isDateString(options?: IsDateStringOptions): EmittableRule;
102
+ export declare const isMimeType: EmittableRule;
103
+ export interface IsCurrencyOptions {
104
+ symbol?: string;
105
+ require_symbol?: boolean;
106
+ allow_space_after_symbol?: boolean;
107
+ symbol_after_digits?: boolean;
108
+ allow_negatives?: boolean;
109
+ parens_for_negatives?: boolean;
110
+ negative_sign_before_digits?: boolean;
111
+ negative_sign_after_digits?: boolean;
112
+ allow_negative_sign_placeholder?: boolean;
113
+ thousands_separator?: string;
114
+ decimal_separator?: string;
115
+ allow_decimal?: boolean;
116
+ require_decimal?: boolean;
117
+ digits_after_decimal?: number[];
118
+ allow_space_after_digits?: boolean;
119
+ }
120
+ export declare function isCurrency(options?: IsCurrencyOptions): EmittableRule;
121
+ export declare const isMagnetURI: EmittableRule;
122
+ export declare const isCreditCard: EmittableRule;
123
+ export interface IsIBANOptions {
124
+ allowSpaces?: boolean;
125
+ }
126
+ export declare function isIBAN(options?: IsIBANOptions): EmittableRule;
127
+ export declare function isByteLength(min: number, max?: number): EmittableRule;
128
+ export declare function isHash(algorithm: string): EmittableRule;
129
+ export declare const isRFC3339: EmittableRule;
130
+ export declare const isMilitaryTime: EmittableRule;
131
+ export declare const isLatitude: EmittableRule;
132
+ export declare const isLongitude: EmittableRule;
133
+ export declare const isEthereumAddress: EmittableRule;
134
+ export declare const isBtcAddress: EmittableRule;
135
+ export declare const isISO4217CurrencyCode: EmittableRule;
136
+ export declare const isPhoneNumber: EmittableRule;
137
+ export interface IsStrongPasswordOptions {
138
+ minLength?: number;
139
+ minLowercase?: number;
140
+ minUppercase?: number;
141
+ minNumbers?: number;
142
+ minSymbols?: number;
143
+ }
144
+ export declare function isStrongPassword(options?: IsStrongPasswordOptions): EmittableRule;
145
+ export declare function isTaxId(locale: string): EmittableRule;
@@ -0,0 +1,14 @@
1
+ import type { EmittableRule } from '../types';
2
+ export declare const isString: EmittableRule;
3
+ export interface IsNumberOptions {
4
+ allowNaN?: boolean;
5
+ allowInfinity?: boolean;
6
+ maxDecimalPlaces?: number;
7
+ }
8
+ export declare function isNumber(options?: IsNumberOptions): EmittableRule;
9
+ export declare const isBoolean: EmittableRule;
10
+ export declare const isDate: EmittableRule;
11
+ export declare function isEnum(entity: object): EmittableRule;
12
+ export declare const isInt: EmittableRule;
13
+ export declare const isArray: EmittableRule;
14
+ export declare const isObject: EmittableRule;
@@ -0,0 +1,13 @@
1
+ import type { RawClassMeta } from '../types';
2
+ import type { SealOptions } from '../interfaces';
3
+ /**
4
+ * 순환 참조 정적 분석 (§4.6)
5
+ *
6
+ * - enableCircularCheck: true → 항상 true
7
+ * - enableCircularCheck: false → 항상 false
8
+ * - 'auto' (기본) → @Type 참조 그래프를 DFS로 탐색해 순환 감지
9
+ *
10
+ * 순환 없는 flat DTO → false (WeakSet 오버헤드 0)
11
+ * 순환 있는 DTO → true (WeakSet 자동 삽입)
12
+ */
13
+ export declare function analyzeCircular(Class: Function, _merged: RawClassMeta, options?: SealOptions): boolean;
@@ -0,0 +1,5 @@
1
+ import { err as _resultErr } from '@zipbul/result';
2
+ import type { RawClassMeta } from '../types';
3
+ import type { SealOptions, RuntimeOptions } from '../interfaces';
4
+ import type { BakerError } from '../errors';
5
+ export declare function buildDeserializeCode<T>(Class: Function, merged: RawClassMeta, options: SealOptions | undefined, needsCircularCheck: boolean, isAsync: boolean): (input: unknown, opts?: RuntimeOptions) => (T | ReturnType<typeof _resultErr<BakerError[]>>) | Promise<T | ReturnType<typeof _resultErr<BakerError[]>>>;
@@ -0,0 +1,11 @@
1
+ import type { RawClassMeta } from '../types';
2
+ /**
3
+ * @Expose 스택 정적 검증 (§4.1, §3.3)
4
+ *
5
+ * 검사 ①: 동일 @Expose 항목에 deserializeOnly: true + serializeOnly: true → 양쪽 방향 모두 제외
6
+ * 검사 ②: 같은 방향에 2개 이상 @Expose가 있고 groups가 겹치면 SealError
7
+ * - 둘 다 groups=[] (ungrouped) → 겹침
8
+ * - 둘 다 non-empty groups이며 교집합 존재 → 겹침
9
+ * - 하나는 ungrouped, 다른 하나는 grouped → 겹치지 않음 (다른 적용 범위)
10
+ */
11
+ export declare function validateExposeStacks(merged: RawClassMeta, className?: string): void;
@@ -0,0 +1,5 @@
1
+ export { seal, _resetForTesting, mergeInheritance } from './seal';
2
+ export { buildDeserializeCode } from './deserialize-builder';
3
+ export { buildSerializeCode } from './serialize-builder';
4
+ export { analyzeCircular } from './circular-analyzer';
5
+ export { validateExposeStacks } from './expose-validator';
@@ -0,0 +1,27 @@
1
+ import type { RawClassMeta } from '../types';
2
+ import type { SealOptions } from '../interfaces';
3
+ /**
4
+ * 전역 레지스트리에 등록된 **모든** DTO를 봉인한다.
5
+ * - 2회 호출 시: SealError throw
6
+ * - 순환 참조 DTO는 placeholder 패턴으로 안전하게 처리
7
+ */
8
+ export declare function seal(options?: SealOptions): void;
9
+ /**
10
+ * @internal 테스트 전용 — testing.ts의 unseal()에서 호출
11
+ */
12
+ export declare function _resetForTesting(): void;
13
+ /**
14
+ * Class의 prototype chain을 따라 RAW 메타데이터를 child-first로 병합한다.
15
+ *
16
+ * 병합 규칙:
17
+ * - validation: union merge (부모+자식 모두 적용, 중복 rule 제거)
18
+ * - transform: 자식 우선, 자식에 없으면 부모 계승
19
+ * - expose: 자식 우선, 자식에 없으면 부모 계승
20
+ * - exclude: 자식 우선, 자식에 없으면 부모 계승
21
+ * - type: 자식 우선, 자식에 없으면 부모 계승
22
+ * - flags: 자식 우선, 자식에 없는 각 플래그만 부모에서 보충
23
+ */
24
+ export declare function mergeInheritance(Class: Function): RawClassMeta;
25
+ export declare const __testing__: {
26
+ mergeInheritance: typeof mergeInheritance;
27
+ };
@@ -0,0 +1,7 @@
1
+ import type { RawClassMeta } from '../types';
2
+ import type { SealOptions, RuntimeOptions } from '../interfaces';
3
+ /**
4
+ * serialize executor 코드 생성.
5
+ * 무검증 전제 — 항상 Record<string, unknown> 반환 (§4.3).
6
+ */
7
+ export declare function buildSerializeCode<T>(Class: Function, merged: RawClassMeta, options: SealOptions | undefined, isAsync: boolean): (instance: T, opts?: RuntimeOptions) => Record<string, unknown> | Promise<Record<string, unknown>>;
@@ -0,0 +1,8 @@
1
+ /**
2
+ * 2개의 Symbol — 외부 저장소 0, 글로벌 오염 0
3
+ * Symbol.for 사용: AOT 코드와 런타임 코드가 동일 Symbol을 공유할 수 있도록 global registry 사용
4
+ */
5
+ /** Tier 1 수집 메타데이터 (데코레이터가 Class에 저장) */
6
+ export declare const RAW: unique symbol;
7
+ /** Tier 2 봉인 결과 (seal()이 Class에 저장하는 dual executor) */
8
+ export declare const SEALED: unique symbol;
@@ -0,0 +1,5 @@
1
+ // @bun
2
+ import{$c as b,_c as a}from"../index-w36xamck.js";export{b as SEALED,a as RAW};
3
+
4
+ //# debugId=A547314686A0198964756E2164756E21
5
+ //# sourceMappingURL=symbols.js.map
@@ -0,0 +1,9 @@
1
+ {
2
+ "version": 3,
3
+ "sources": [],
4
+ "sourcesContent": [
5
+ ],
6
+ "mappings": "",
7
+ "debugId": "A547314686A0198964756E2164756E21",
8
+ "names": []
9
+ }
@@ -0,0 +1,119 @@
1
+ export interface EmitContext {
2
+ /** RegExp 참조 배열에 등록, 인덱스 반환 */
3
+ addRegex(re: RegExp): number;
4
+ /** 참조 배열에 등록, 인덱스 반환 — 함수, 배열, Set, 원시값 등 */
5
+ addRef(value: unknown): number;
6
+ /** SealedExecutors 객체 참조 배열에 등록 — 중첩 @Type DTO용 */
7
+ addExecutor(executor: SealedExecutors<unknown>): number;
8
+ /** 에러 코드로 실패 처리 코드 문자열 생성 — path는 builder가 바인딩 */
9
+ fail(code: string): string;
10
+ /** 에러 수집 모드 여부 (= !stopAtFirstError) */
11
+ collectErrors: boolean;
12
+ }
13
+ export interface EmittableRule {
14
+ (value: unknown): boolean | Promise<boolean>;
15
+ emit(varName: string, ctx: EmitContext): string;
16
+ readonly ruleName: string;
17
+ /**
18
+ * builder가 typeof 가드 삽입 여부를 판단하는 메타.
19
+ * 해당 타입을 전제하는 rule만 설정 (예: isEmail → 'string').
20
+ * @IsString 자체는 undefined (자체 typeof 포함).
21
+ */
22
+ readonly requiresType?: 'string' | 'number';
23
+ /** async validate 함수 사용 시 true — deserialize-builder가 await 코드를 생성 */
24
+ readonly isAsync?: boolean;
25
+ }
26
+ /** 사용자 정의 메시지 콜백 인자 */
27
+ export interface MessageArgs {
28
+ property: string;
29
+ value: unknown;
30
+ constraints: unknown[];
31
+ }
32
+ export interface RuleDef {
33
+ rule: EmittableRule;
34
+ each?: boolean;
35
+ groups?: string[];
36
+ /** 검증 실패 시 BakerError.message에 포함할 값 */
37
+ message?: string | ((args: MessageArgs) => string);
38
+ /** 검증 실패 시 BakerError.context에 포함할 임의 값 */
39
+ context?: unknown;
40
+ }
41
+ /** @Transform 콜백 시그니처 */
42
+ export type TransformFunction = (params: TransformParams) => unknown;
43
+ export interface TransformParams {
44
+ value: unknown;
45
+ key: string;
46
+ /** deserialize: input 원본 객체, serialize: class 인스턴스 */
47
+ obj: Record<string, unknown>;
48
+ type: 'deserialize' | 'serialize';
49
+ }
50
+ export interface TransformDef {
51
+ fn: TransformFunction;
52
+ options?: {
53
+ groups?: string[];
54
+ deserializeOnly?: boolean;
55
+ serializeOnly?: boolean;
56
+ };
57
+ }
58
+ export interface ExposeDef {
59
+ name?: string;
60
+ groups?: string[];
61
+ deserializeOnly?: boolean;
62
+ serializeOnly?: boolean;
63
+ }
64
+ export interface ExcludeDef {
65
+ deserializeOnly?: boolean;
66
+ serializeOnly?: boolean;
67
+ }
68
+ export interface TypeDef {
69
+ fn: () => new (...args: any[]) => any;
70
+ discriminator?: {
71
+ property: string;
72
+ subTypes: {
73
+ value: Function;
74
+ name: string;
75
+ }[];
76
+ };
77
+ keepDiscriminatorProperty?: boolean;
78
+ }
79
+ export interface PropertyFlags {
80
+ /** @IsOptional() — undefined/null 시 validation 전체 skip */
81
+ isOptional?: boolean;
82
+ /** @IsDefined() — null/undefined 불허. isOptional과 동시 시 IsDefined 우선 */
83
+ isDefined?: boolean;
84
+ /** @ValidateIf(cond) — false 시 필드 전체 검증 skip */
85
+ validateIf?: (obj: any) => boolean;
86
+ /** @ValidateNested() — 중첩 DTO 재귀 검증 트리거. @Type과 함께 사용 */
87
+ validateNested?: boolean;
88
+ /** @ValidateNested({ each: true }) — 배열 원소별 중첩 DTO 검증 */
89
+ validateNestedEach?: boolean;
90
+ }
91
+ export interface RawPropertyMeta {
92
+ validation: RuleDef[];
93
+ transform: TransformDef[];
94
+ expose: ExposeDef[];
95
+ exclude: ExcludeDef | null;
96
+ type: TypeDef | null;
97
+ flags: PropertyFlags;
98
+ }
99
+ export interface RawClassMeta {
100
+ [propertyKey: string]: RawPropertyMeta;
101
+ }
102
+ import type { RuntimeOptions } from './interfaces';
103
+ import type { BakerError } from './errors';
104
+ export interface SealedExecutors<T> {
105
+ /** 내부 executor — Result 패턴. deserialize()가 감싸서 throw로 변환 */
106
+ _deserialize(input: unknown, options?: RuntimeOptions): (T | import('@zipbul/result').Err<BakerError[]>) | Promise<T | import('@zipbul/result').Err<BakerError[]>>;
107
+ /** 내부 executor — 항상 성공. serialize는 무검증 전제 */
108
+ _serialize(instance: T, options?: RuntimeOptions): Record<string, unknown> | Promise<Record<string, unknown>>;
109
+ /** deserialize 방향에 async 규칙/transform/nested가 있으면 true */
110
+ _isAsync: boolean;
111
+ /** serialize 방향에 async transform/nested가 있으면 true */
112
+ _isSerializeAsync: boolean;
113
+ /** debug: true 시 생성된 executor 소스코드 저장 */
114
+ _source?: {
115
+ deserialize: string;
116
+ serialize: string;
117
+ };
118
+ }
119
+ export type { ValidationOptions } from './interfaces';
package/package.json ADDED
@@ -0,0 +1,83 @@
1
+ {
2
+ "name": "@zipbul/baker",
3
+ "version": "0.0.1",
4
+ "description": "Decorator-based validate + transform with inline code generation. class-validator DX, AOT-level performance, zero reflect-metadata.",
5
+ "license": "MIT",
6
+ "author": "Junhyung Park (https://github.com/parkrevil)",
7
+ "repository": {
8
+ "type": "git",
9
+ "url": "https://github.com/zipbul/baker.git"
10
+ },
11
+ "bugs": "https://github.com/zipbul/baker/issues",
12
+ "homepage": "https://github.com/zipbul/baker#readme",
13
+ "keywords": [
14
+ "validation",
15
+ "transform",
16
+ "decorator",
17
+ "dto",
18
+ "class-validator",
19
+ "class-transformer",
20
+ "serialize",
21
+ "deserialize",
22
+ "code-generation",
23
+ "bun",
24
+ "zipbul"
25
+ ],
26
+ "engines": {
27
+ "bun": ">=1.0.0"
28
+ },
29
+ "type": "module",
30
+ "sideEffects": false,
31
+ "main": "./dist/index.js",
32
+ "types": "./dist/index.d.ts",
33
+ "module": "./dist/index.js",
34
+ "exports": {
35
+ ".": {
36
+ "import": "./dist/index.js",
37
+ "types": "./dist/index.d.ts"
38
+ },
39
+ "./decorators": {
40
+ "import": "./dist/src/decorators/index.js",
41
+ "types": "./dist/src/decorators/index.d.ts"
42
+ },
43
+ "./aot": {
44
+ "import": "./dist/src/aot/index.js",
45
+ "types": "./dist/src/aot/index.d.ts"
46
+ },
47
+ "./rules": {
48
+ "import": "./dist/src/rules/index.js",
49
+ "types": "./dist/src/rules/index.d.ts"
50
+ },
51
+ "./symbols": {
52
+ "import": "./dist/src/symbols.js",
53
+ "types": "./dist/src/symbols.d.ts"
54
+ }
55
+ },
56
+ "files": [
57
+ "dist",
58
+ "README.md"
59
+ ],
60
+ "publishConfig": {
61
+ "access": "public"
62
+ },
63
+ "dependencies": {
64
+ "@zipbul/result": "^0.0.3"
65
+ },
66
+ "scripts": {
67
+ "build": "bun build index.ts src/decorators/index.ts src/aot/index.ts src/rules/index.ts src/symbols.ts --outdir dist --target bun --format esm --splitting --packages external --sourcemap=linked --root . --production && tsc -p tsconfig.build.json",
68
+ "typecheck": "tsc --noEmit",
69
+ "test": "bun test",
70
+ "test:coverage": "bun test --coverage",
71
+ "changeset": "changeset",
72
+ "version-packages": "changeset version",
73
+ "release": "changeset publish",
74
+ "prepare": "husky"
75
+ },
76
+ "devDependencies": {
77
+ "@changesets/cli": "^2.29.8",
78
+ "@commitlint/cli": "^20.4.2",
79
+ "@commitlint/config-conventional": "^20.4.2",
80
+ "@types/bun": "^1.3.9",
81
+ "husky": "^9.1.7"
82
+ }
83
+ }