typia 12.0.0-dev.20260307-2 → 12.0.0-dev.20260310

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 (155) hide show
  1. package/lib/executable/setup/PluginConfigurator.js +3 -3
  2. package/lib/executable/setup/PluginConfigurator.mjs +3 -3
  3. package/lib/executable/setup/PluginConfigurator.mjs.map +1 -1
  4. package/lib/executable/typia.js +15 -15
  5. package/lib/executable/typia.mjs +15 -15
  6. package/lib/internal/_coerceLlmArguments.d.ts +2 -0
  7. package/lib/internal/_coerceLlmArguments.js +7 -0
  8. package/lib/internal/_coerceLlmArguments.js.map +1 -0
  9. package/lib/internal/_coerceLlmArguments.mjs +6 -0
  10. package/lib/internal/_coerceLlmArguments.mjs.map +1 -0
  11. package/lib/internal/_llmApplicationFinalize.js +1 -1
  12. package/lib/internal/_llmApplicationFinalize.js.map +1 -1
  13. package/lib/internal/_llmApplicationFinalize.mjs +1 -0
  14. package/lib/internal/_llmApplicationFinalize.mjs.map +1 -1
  15. package/lib/internal/_parseLlmArguments.d.ts +2 -0
  16. package/lib/internal/_parseLlmArguments.js +7 -0
  17. package/lib/internal/_parseLlmArguments.js.map +1 -0
  18. package/lib/internal/_parseLlmArguments.mjs +6 -0
  19. package/lib/internal/_parseLlmArguments.mjs.map +1 -0
  20. package/lib/llm.d.ts +154 -1
  21. package/lib/llm.js +20 -0
  22. package/lib/llm.js.map +1 -1
  23. package/lib/llm.mjs +17 -1
  24. package/lib/llm.mjs.map +1 -1
  25. package/lib/re-exports.d.ts +1 -1
  26. package/lib/re-exports.js.map +1 -1
  27. package/package.json +5 -5
  28. package/src/TypeGuardError.ts +145 -145
  29. package/src/executable/TypiaGenerateWizard.ts +82 -82
  30. package/src/executable/TypiaPatchWizard.ts +45 -45
  31. package/src/executable/TypiaSetupWizard.ts +171 -171
  32. package/src/executable/setup/ArgumentParser.ts +42 -42
  33. package/src/executable/setup/CommandExecutor.ts +8 -8
  34. package/src/executable/setup/FileRetriever.ts +19 -19
  35. package/src/executable/setup/PackageManager.ts +87 -87
  36. package/src/executable/setup/PluginConfigurator.ts +74 -74
  37. package/src/executable/typia.ts +55 -55
  38. package/src/functional.ts +600 -600
  39. package/src/http.ts +843 -843
  40. package/src/index.ts +4 -4
  41. package/src/internal/_IProtobufWriter.ts +18 -18
  42. package/src/internal/_ProtobufReader.ts +187 -187
  43. package/src/internal/_ProtobufSizer.ts +137 -137
  44. package/src/internal/_ProtobufWriter.ts +135 -135
  45. package/src/internal/_accessExpressionAsString.ts +46 -46
  46. package/src/internal/_assertGuard.ts +13 -13
  47. package/src/internal/_coerceLlmArguments.ts +7 -0
  48. package/src/internal/_createStandardSchema.ts +133 -133
  49. package/src/internal/_functionalTypeGuardErrorFactory.ts +4 -4
  50. package/src/internal/_httpFormDataReadArray.ts +4 -4
  51. package/src/internal/_httpFormDataReadBigint.ts +18 -18
  52. package/src/internal/_httpFormDataReadBlob.ts +10 -10
  53. package/src/internal/_httpFormDataReadBoolean.ts +16 -16
  54. package/src/internal/_httpFormDataReadFile.ts +10 -10
  55. package/src/internal/_httpFormDataReadNumber.ts +15 -15
  56. package/src/internal/_httpFormDataReadString.ts +10 -10
  57. package/src/internal/_httpHeaderReadBigint.ts +10 -10
  58. package/src/internal/_httpHeaderReadBoolean.ts +8 -8
  59. package/src/internal/_httpHeaderReadNumber.ts +7 -7
  60. package/src/internal/_httpParameterReadBigint.ts +10 -10
  61. package/src/internal/_httpParameterReadBoolean.ts +8 -8
  62. package/src/internal/_httpParameterReadNumber.ts +7 -7
  63. package/src/internal/_httpParameterReadString.ts +2 -2
  64. package/src/internal/_httpQueryParseURLSearchParams.ts +12 -12
  65. package/src/internal/_httpQueryReadArray.ts +4 -4
  66. package/src/internal/_httpQueryReadBigint.ts +12 -12
  67. package/src/internal/_httpQueryReadBoolean.ts +14 -14
  68. package/src/internal/_httpQueryReadNumber.ts +9 -9
  69. package/src/internal/_httpQueryReadString.ts +4 -4
  70. package/src/internal/_isBetween.ts +2 -2
  71. package/src/internal/_isBigintString.ts +8 -8
  72. package/src/internal/_isFormatByte.ts +7 -7
  73. package/src/internal/_isFormatDate.ts +3 -3
  74. package/src/internal/_isFormatDateTime.ts +4 -4
  75. package/src/internal/_isFormatDuration.ts +4 -4
  76. package/src/internal/_isFormatEmail.ts +4 -4
  77. package/src/internal/_isFormatHostname.ts +4 -4
  78. package/src/internal/_isFormatIdnEmail.ts +4 -4
  79. package/src/internal/_isFormatIdnHostname.ts +4 -4
  80. package/src/internal/_isFormatIpv4.ts +4 -4
  81. package/src/internal/_isFormatIpv6.ts +4 -4
  82. package/src/internal/_isFormatIri.ts +3 -3
  83. package/src/internal/_isFormatIriReference.ts +4 -4
  84. package/src/internal/_isFormatJsonPointer.ts +3 -3
  85. package/src/internal/_isFormatPassword.ts +1 -1
  86. package/src/internal/_isFormatRegex.ts +8 -8
  87. package/src/internal/_isFormatRelativeJsonPointer.ts +4 -4
  88. package/src/internal/_isFormatTime.ts +4 -4
  89. package/src/internal/_isFormatUri.ts +6 -6
  90. package/src/internal/_isFormatUriReference.ts +5 -5
  91. package/src/internal/_isFormatUriTemplate.ts +4 -4
  92. package/src/internal/_isFormatUrl.ts +4 -4
  93. package/src/internal/_isFormatUuid.ts +3 -3
  94. package/src/internal/_isTypeFloat.ts +5 -5
  95. package/src/internal/_isTypeInt32.ts +5 -5
  96. package/src/internal/_isTypeInt64.ts +5 -5
  97. package/src/internal/_isTypeUint32.ts +5 -5
  98. package/src/internal/_isTypeUint64.ts +5 -5
  99. package/src/internal/_isUniqueItems.ts +159 -159
  100. package/src/internal/_jsonStringifyNumber.ts +12 -12
  101. package/src/internal/_jsonStringifyRest.ts +3 -3
  102. package/src/internal/_jsonStringifyString.ts +42 -42
  103. package/src/internal/_jsonStringifyTail.ts +2 -2
  104. package/src/internal/_llmApplicationFinalize.ts +24 -23
  105. package/src/internal/_miscCloneAny.ts +46 -46
  106. package/src/internal/_notationAny.ts +37 -37
  107. package/src/internal/_notationCamel.ts +13 -13
  108. package/src/internal/_notationPascal.ts +8 -8
  109. package/src/internal/_notationSnake.ts +43 -43
  110. package/src/internal/_parseLlmArguments.ts +7 -0
  111. package/src/internal/_randomArray.ts +21 -21
  112. package/src/internal/_randomBigint.ts +6 -6
  113. package/src/internal/_randomBoolean.ts +1 -1
  114. package/src/internal/_randomFormatByte.ts +3 -3
  115. package/src/internal/_randomFormatDate.ts +18 -18
  116. package/src/internal/_randomFormatDatetime.ts +16 -16
  117. package/src/internal/_randomFormatDuration.ts +27 -27
  118. package/src/internal/_randomFormatEmail.ts +11 -11
  119. package/src/internal/_randomFormatHostname.ts +6 -6
  120. package/src/internal/_randomFormatIdnEmail.ts +3 -3
  121. package/src/internal/_randomFormatIdnHostname.ts +3 -3
  122. package/src/internal/_randomFormatIpv4.ts +11 -11
  123. package/src/internal/_randomFormatIpv6.ts +11 -11
  124. package/src/internal/_randomFormatIri.ts +3 -3
  125. package/src/internal/_randomFormatIriReference.ts +3 -3
  126. package/src/internal/_randomFormatJsonPointer.ts +7 -7
  127. package/src/internal/_randomFormatPassword.ts +8 -8
  128. package/src/internal/_randomFormatRegex.ts +4 -4
  129. package/src/internal/_randomFormatRelativeJsonPointer.ts +8 -8
  130. package/src/internal/_randomFormatTime.ts +14 -14
  131. package/src/internal/_randomFormatUri.ts +3 -3
  132. package/src/internal/_randomFormatUriReference.ts +3 -3
  133. package/src/internal/_randomFormatUriTemplate.ts +3 -3
  134. package/src/internal/_randomFormatUrl.ts +11 -11
  135. package/src/internal/_randomFormatUuid.ts +6 -6
  136. package/src/internal/_randomInteger.ts +53 -53
  137. package/src/internal/_randomNumber.ts +80 -80
  138. package/src/internal/_randomPattern.ts +10 -10
  139. package/src/internal/_randomPick.ts +9 -9
  140. package/src/internal/_randomString.ts +24 -24
  141. package/src/internal/_throwTypeGuardError.ts +5 -5
  142. package/src/internal/_validateReport.ts +21 -21
  143. package/src/internal/private/__notationCapitalize.ts +2 -2
  144. package/src/internal/private/__notationUnsnake.ts +24 -24
  145. package/src/json.ts +553 -553
  146. package/src/llm.ts +408 -211
  147. package/src/misc.ts +448 -448
  148. package/src/module.ts +811 -811
  149. package/src/notations.ts +624 -624
  150. package/src/programmers/TypiaProgrammer.ts +8 -8
  151. package/src/protobuf.ts +499 -499
  152. package/src/re-exports.ts +33 -32
  153. package/src/reflect.ts +75 -75
  154. package/src/transform.ts +5 -5
  155. package/src/transformers/NoTransformConfigurationError.ts +16 -16
@@ -1,145 +1,145 @@
1
- /**
2
- * Error thrown when type assertion fails.
3
- *
4
- * Thrown by {@link assert}, {@link assertGuard}, and other assert-family
5
- * functions when input doesn't match expected type `T`. Contains detailed
6
- * information about the first assertion failure:
7
- *
8
- * - `method`: Which typia function threw (e.g., `"typia.assert"`)
9
- * - `path`: Property path where error occurred (e.g., `"input.user.age"`)
10
- * - `expected`: Expected type string (e.g., `"number & ExclusiveMinimum<19>"`)
11
- * - `value`: Actual value that failed validation
12
- *
13
- * @template T Expected type (for type safety)
14
- */
15
- export class TypeGuardError<T = any> extends Error {
16
- /**
17
- * Name of the typia method that threw this error.
18
- *
19
- * E.g., `"typia.assert"`, `"typia.assertEquals"`, `"typia.assertGuard"`.
20
- */
21
- public readonly method: string;
22
-
23
- /**
24
- * Property path where assertion failed.
25
- *
26
- * Uses dot notation for nested properties. `undefined` if error occurred at
27
- * root level.
28
- *
29
- * E.g., `"input.age"`, `"input.profile.email"`, `"input[0].name"`.
30
- */
31
- public readonly path: string | undefined;
32
-
33
- /**
34
- * String representation of expected type.
35
- *
36
- * E.g., `"string"`, `"number & ExclusiveMinimum<19>"`, `"{ name: string; age:
37
- * number }"`.
38
- */
39
- public readonly expected: string;
40
-
41
- /**
42
- * Actual value that failed assertion.
43
- *
44
- * The raw value at the error path, useful for debugging.
45
- */
46
- public readonly value: unknown;
47
-
48
- /**
49
- * Optional human-readable error description.
50
- *
51
- * Primarily for AI agent libraries or custom validation scenarios needing
52
- * additional context. Standard assertions rely on `path`, `expected`, and
53
- * `value` for error reporting.
54
- */
55
- public readonly description?: string | undefined;
56
-
57
- /**
58
- * Phantom property for TypeScript type safety.
59
- *
60
- * Not used at runtime—exists only to preserve generic type `T` in the type
61
- * system. Always `undefined`.
62
- *
63
- * @internal
64
- */
65
- protected readonly fake_expected_typed_value_?: T | undefined;
66
-
67
- /**
68
- * Creates a new TypeGuardError instance.
69
- *
70
- * @param props Error properties
71
- */
72
- public constructor(props: TypeGuardError.IProps) {
73
- // MESSAGE CONSTRUCTION
74
- // Use custom message if provided, otherwise generate default format
75
- super(
76
- props.message ||
77
- `Error on ${props.method}(): invalid type${
78
- props.path ? ` on ${props.path}` : ""
79
- }, expect to be ${props.expected}`,
80
- );
81
-
82
- // INHERITANCE POLYFILL
83
- // Set up prototype for compatibility across different JavaScript environments
84
- const proto = new.target.prototype;
85
- if (Object.setPrototypeOf) Object.setPrototypeOf(this, proto);
86
- else (this as any).__proto__ = proto;
87
-
88
- // ASSIGN MEMBERS
89
- this.method = props.method;
90
- this.path = props.path;
91
- this.expected = props.expected;
92
- this.value = props.value;
93
- if (props.description || props.value === undefined)
94
- this.description =
95
- props.description ??
96
- [
97
- "The value at this path is `undefined`.",
98
- "",
99
- `Please fill the \`${props.expected}\` typed value next time.`,
100
- ].join("\n");
101
- }
102
- }
103
-
104
- export namespace TypeGuardError {
105
- /** Properties for constructing a TypeGuardError. */
106
- export interface IProps {
107
- /**
108
- * Name of the typia method that threw the error.
109
- *
110
- * E.g., `"typia.assert"`, `"typia.assertEquals"`.
111
- */
112
- method: string;
113
-
114
- /**
115
- * Property path where assertion failed (optional).
116
- *
117
- * E.g., `"input.age"`, `"input.profile.email"`.
118
- */
119
- path?: undefined | string;
120
-
121
- /**
122
- * String representation of expected type.
123
- *
124
- * E.g., `"string"`, `"number & ExclusiveMinimum<19>"`.
125
- */
126
- expected: string;
127
-
128
- /** Actual value that failed assertion. */
129
- value: unknown;
130
-
131
- /**
132
- * Optional human-readable error description.
133
- *
134
- * For AI agent libraries or custom validation needing additional context.
135
- */
136
- description?: string;
137
-
138
- /**
139
- * Custom error message (optional).
140
- *
141
- * If not provided, a default message is generated from other properties.
142
- */
143
- message?: undefined | string;
144
- }
145
- }
1
+ /**
2
+ * Error thrown when type assertion fails.
3
+ *
4
+ * Thrown by {@link assert}, {@link assertGuard}, and other assert-family
5
+ * functions when input doesn't match expected type `T`. Contains detailed
6
+ * information about the first assertion failure:
7
+ *
8
+ * - `method`: Which typia function threw (e.g., `"typia.assert"`)
9
+ * - `path`: Property path where error occurred (e.g., `"input.user.age"`)
10
+ * - `expected`: Expected type string (e.g., `"number & ExclusiveMinimum<19>"`)
11
+ * - `value`: Actual value that failed validation
12
+ *
13
+ * @template T Expected type (for type safety)
14
+ */
15
+ export class TypeGuardError<T = any> extends Error {
16
+ /**
17
+ * Name of the typia method that threw this error.
18
+ *
19
+ * E.g., `"typia.assert"`, `"typia.assertEquals"`, `"typia.assertGuard"`.
20
+ */
21
+ public readonly method: string;
22
+
23
+ /**
24
+ * Property path where assertion failed.
25
+ *
26
+ * Uses dot notation for nested properties. `undefined` if error occurred at
27
+ * root level.
28
+ *
29
+ * E.g., `"input.age"`, `"input.profile.email"`, `"input[0].name"`.
30
+ */
31
+ public readonly path: string | undefined;
32
+
33
+ /**
34
+ * String representation of expected type.
35
+ *
36
+ * E.g., `"string"`, `"number & ExclusiveMinimum<19>"`, `"{ name: string; age:
37
+ * number }"`.
38
+ */
39
+ public readonly expected: string;
40
+
41
+ /**
42
+ * Actual value that failed assertion.
43
+ *
44
+ * The raw value at the error path, useful for debugging.
45
+ */
46
+ public readonly value: unknown;
47
+
48
+ /**
49
+ * Optional human-readable error description.
50
+ *
51
+ * Primarily for AI agent libraries or custom validation scenarios needing
52
+ * additional context. Standard assertions rely on `path`, `expected`, and
53
+ * `value` for error reporting.
54
+ */
55
+ public readonly description?: string | undefined;
56
+
57
+ /**
58
+ * Phantom property for TypeScript type safety.
59
+ *
60
+ * Not used at runtime—exists only to preserve generic type `T` in the type
61
+ * system. Always `undefined`.
62
+ *
63
+ * @internal
64
+ */
65
+ protected readonly fake_expected_typed_value_?: T | undefined;
66
+
67
+ /**
68
+ * Creates a new TypeGuardError instance.
69
+ *
70
+ * @param props Error properties
71
+ */
72
+ public constructor(props: TypeGuardError.IProps) {
73
+ // MESSAGE CONSTRUCTION
74
+ // Use custom message if provided, otherwise generate default format
75
+ super(
76
+ props.message ||
77
+ `Error on ${props.method}(): invalid type${
78
+ props.path ? ` on ${props.path}` : ""
79
+ }, expect to be ${props.expected}`,
80
+ );
81
+
82
+ // INHERITANCE POLYFILL
83
+ // Set up prototype for compatibility across different JavaScript environments
84
+ const proto = new.target.prototype;
85
+ if (Object.setPrototypeOf) Object.setPrototypeOf(this, proto);
86
+ else (this as any).__proto__ = proto;
87
+
88
+ // ASSIGN MEMBERS
89
+ this.method = props.method;
90
+ this.path = props.path;
91
+ this.expected = props.expected;
92
+ this.value = props.value;
93
+ if (props.description || props.value === undefined)
94
+ this.description =
95
+ props.description ??
96
+ [
97
+ "The value at this path is `undefined`.",
98
+ "",
99
+ `Please fill the \`${props.expected}\` typed value next time.`,
100
+ ].join("\n");
101
+ }
102
+ }
103
+
104
+ export namespace TypeGuardError {
105
+ /** Properties for constructing a TypeGuardError. */
106
+ export interface IProps {
107
+ /**
108
+ * Name of the typia method that threw the error.
109
+ *
110
+ * E.g., `"typia.assert"`, `"typia.assertEquals"`.
111
+ */
112
+ method: string;
113
+
114
+ /**
115
+ * Property path where assertion failed (optional).
116
+ *
117
+ * E.g., `"input.age"`, `"input.profile.email"`.
118
+ */
119
+ path?: undefined | string;
120
+
121
+ /**
122
+ * String representation of expected type.
123
+ *
124
+ * E.g., `"string"`, `"number & ExclusiveMinimum<19>"`.
125
+ */
126
+ expected: string;
127
+
128
+ /** Actual value that failed assertion. */
129
+ value: unknown;
130
+
131
+ /**
132
+ * Optional human-readable error description.
133
+ *
134
+ * For AI agent libraries or custom validation needing additional context.
135
+ */
136
+ description?: string;
137
+
138
+ /**
139
+ * Custom error message (optional).
140
+ *
141
+ * If not provided, a default message is generated from other properties.
142
+ */
143
+ message?: undefined | string;
144
+ }
145
+ }
@@ -1,82 +1,82 @@
1
- import { TypiaGenerator } from "@typia/transform";
2
- import fs from "fs";
3
-
4
- import { ArgumentParser } from "./setup/ArgumentParser";
5
- import { PackageManager } from "./setup/PackageManager";
6
-
7
- export namespace TypiaGenerateWizard {
8
- export async function generate(): Promise<void> {
9
- console.log("----------------------------------------");
10
- console.log(" Typia Generate Wizard");
11
- console.log("----------------------------------------");
12
-
13
- // LOAD PACKAGE.JSON INFO
14
- const pack: PackageManager = await PackageManager.mount();
15
- const options: IArguments = await ArgumentParser.parse(pack, inquiry);
16
- await TypiaGenerator.build(options);
17
- }
18
-
19
- const inquiry: ArgumentParser.Inquiry<IArguments> = async (
20
- _pack,
21
- command,
22
- prompt,
23
- action,
24
- ) => {
25
- // PREPARE ASSETS
26
- command.option("--input [path]", "input directory");
27
- command.option("--output [directory]", "output directory");
28
- command.option("--project [project]", "tsconfig.json file location");
29
-
30
- const questioned = { value: false };
31
-
32
- const input = (name: string) => async (message: string) => {
33
- const result = await prompt()({
34
- type: "input",
35
- name,
36
- message,
37
- default: "",
38
- });
39
- return result[name] as string;
40
- };
41
- const select =
42
- (name: string) =>
43
- (message: string) =>
44
- async <Choice extends string>(choices: Choice[]): Promise<Choice> => {
45
- questioned.value = true;
46
- return (
47
- await prompt()({
48
- type: "list",
49
- name: name,
50
- message: message,
51
- choices: choices,
52
- })
53
- )[name];
54
- };
55
- const configure = async (): Promise<string> => {
56
- const files: string[] = await (
57
- await fs.promises.readdir(process.cwd())
58
- ).filter(
59
- (str) =>
60
- str.substring(0, 8) === "tsconfig" &&
61
- str.substring(str.length - 5) === ".json",
62
- );
63
- if (files.length === 0)
64
- throw new URIError(`Unable to find "tsconfig.json" file.`);
65
- else if (files.length === 1) return files[0]!;
66
- return select("tsconfig")("TS Config File")(files);
67
- };
68
-
69
- return action(async (options) => {
70
- options.input ??= await input("input")("input directory");
71
- options.output ??= await input("output")("output directory");
72
- options.project ??= await configure();
73
- return options as IArguments;
74
- });
75
- };
76
-
77
- export interface IArguments {
78
- input: string;
79
- output: string;
80
- project: string;
81
- }
82
- }
1
+ import { TypiaGenerator } from "@typia/transform";
2
+ import fs from "fs";
3
+
4
+ import { ArgumentParser } from "./setup/ArgumentParser";
5
+ import { PackageManager } from "./setup/PackageManager";
6
+
7
+ export namespace TypiaGenerateWizard {
8
+ export async function generate(): Promise<void> {
9
+ console.log("----------------------------------------");
10
+ console.log(" Typia Generate Wizard");
11
+ console.log("----------------------------------------");
12
+
13
+ // LOAD PACKAGE.JSON INFO
14
+ const pack: PackageManager = await PackageManager.mount();
15
+ const options: IArguments = await ArgumentParser.parse(pack, inquiry);
16
+ await TypiaGenerator.build(options);
17
+ }
18
+
19
+ const inquiry: ArgumentParser.Inquiry<IArguments> = async (
20
+ _pack,
21
+ command,
22
+ prompt,
23
+ action,
24
+ ) => {
25
+ // PREPARE ASSETS
26
+ command.option("--input [path]", "input directory");
27
+ command.option("--output [directory]", "output directory");
28
+ command.option("--project [project]", "tsconfig.json file location");
29
+
30
+ const questioned = { value: false };
31
+
32
+ const input = (name: string) => async (message: string) => {
33
+ const result = await prompt()({
34
+ type: "input",
35
+ name,
36
+ message,
37
+ default: "",
38
+ });
39
+ return result[name] as string;
40
+ };
41
+ const select =
42
+ (name: string) =>
43
+ (message: string) =>
44
+ async <Choice extends string>(choices: Choice[]): Promise<Choice> => {
45
+ questioned.value = true;
46
+ return (
47
+ await prompt()({
48
+ type: "list",
49
+ name: name,
50
+ message: message,
51
+ choices: choices,
52
+ })
53
+ )[name];
54
+ };
55
+ const configure = async (): Promise<string> => {
56
+ const files: string[] = await (
57
+ await fs.promises.readdir(process.cwd())
58
+ ).filter(
59
+ (str) =>
60
+ str.substring(0, 8) === "tsconfig" &&
61
+ str.substring(str.length - 5) === ".json",
62
+ );
63
+ if (files.length === 0)
64
+ throw new URIError(`Unable to find "tsconfig.json" file.`);
65
+ else if (files.length === 1) return files[0]!;
66
+ return select("tsconfig")("TS Config File")(files);
67
+ };
68
+
69
+ return action(async (options) => {
70
+ options.input ??= await input("input")("input directory");
71
+ options.output ??= await input("output")("output directory");
72
+ options.project ??= await configure();
73
+ return options as IArguments;
74
+ });
75
+ };
76
+
77
+ export interface IArguments {
78
+ input: string;
79
+ output: string;
80
+ project: string;
81
+ }
82
+ }
@@ -1,45 +1,45 @@
1
- import fs from "fs";
2
-
3
- export namespace TypiaPatchWizard {
4
- export const main = async (): Promise<void> => {
5
- console.log("----------------------------------------");
6
- console.log(" Typia Setup Wizard");
7
- console.log("----------------------------------------");
8
- console.log(
9
- [
10
- `Since TypeScript v5.3 update, "tsc" no more parses JSDoc comments.`,
11
- ``,
12
- `Therefore, "typia" revives the JSDoc parsing feature by patching "tsc".`,
13
- ``,
14
- `This is a temporary feature of "typia", and it would be removed when "ts-patch" being updated.`,
15
- ].join("\n"),
16
- );
17
-
18
- await patch();
19
- };
20
-
21
- export const patch = async (): Promise<void> => {
22
- for (const file of ["tsc.js", "_tsc.js"])
23
- try {
24
- const location: string = require.resolve(`typescript/lib/${file}`);
25
- const content: string = await fs.promises.readFile(location, "utf8");
26
- if (content.indexOf(FROM_WITH_COMMENT) !== -1)
27
- await fs.promises.writeFile(
28
- location,
29
- content.replace(FROM_WITH_COMMENT, TO_WITH_COMMENT),
30
- "utf8",
31
- );
32
- else if (content.indexOf(FROM_ONLY) !== -1)
33
- await fs.promises.writeFile(
34
- location,
35
- content.replace(FROM_ONLY, TO_ONLY),
36
- "utf8",
37
- );
38
- } catch {}
39
- };
40
- }
41
-
42
- const FROM_WITH_COMMENT = `var defaultJSDocParsingMode = 2 /* ParseForTypeErrors */`;
43
- const TO_WITH_COMMENT = `var defaultJSDocParsingMode = 0 /* ParseAll */`;
44
- const FROM_ONLY = `var defaultJSDocParsingMode = 2`;
45
- const TO_ONLY = `var defaultJSDocParsingMode = 0`;
1
+ import fs from "fs";
2
+
3
+ export namespace TypiaPatchWizard {
4
+ export const main = async (): Promise<void> => {
5
+ console.log("----------------------------------------");
6
+ console.log(" Typia Setup Wizard");
7
+ console.log("----------------------------------------");
8
+ console.log(
9
+ [
10
+ `Since TypeScript v5.3 update, "tsc" no more parses JSDoc comments.`,
11
+ ``,
12
+ `Therefore, "typia" revives the JSDoc parsing feature by patching "tsc".`,
13
+ ``,
14
+ `This is a temporary feature of "typia", and it would be removed when "ts-patch" being updated.`,
15
+ ].join("\n"),
16
+ );
17
+
18
+ await patch();
19
+ };
20
+
21
+ export const patch = async (): Promise<void> => {
22
+ for (const file of ["tsc.js", "_tsc.js"])
23
+ try {
24
+ const location: string = require.resolve(`typescript/lib/${file}`);
25
+ const content: string = await fs.promises.readFile(location, "utf8");
26
+ if (content.indexOf(FROM_WITH_COMMENT) !== -1)
27
+ await fs.promises.writeFile(
28
+ location,
29
+ content.replace(FROM_WITH_COMMENT, TO_WITH_COMMENT),
30
+ "utf8",
31
+ );
32
+ else if (content.indexOf(FROM_ONLY) !== -1)
33
+ await fs.promises.writeFile(
34
+ location,
35
+ content.replace(FROM_ONLY, TO_ONLY),
36
+ "utf8",
37
+ );
38
+ } catch {}
39
+ };
40
+ }
41
+
42
+ const FROM_WITH_COMMENT = `var defaultJSDocParsingMode = 2 /* ParseForTypeErrors */`;
43
+ const TO_WITH_COMMENT = `var defaultJSDocParsingMode = 0 /* ParseAll */`;
44
+ const FROM_ONLY = `var defaultJSDocParsingMode = 2`;
45
+ const TO_ONLY = `var defaultJSDocParsingMode = 0`;