typia 14.0.0 → 14.0.2
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/lib/internal/_createStandardSchema.d.ts +1 -2
- package/lib/internal/_createStandardSchema.js.map +1 -1
- package/lib/internal/_createStandardSchema.mjs.map +1 -1
- package/lib/module.d.ts +1 -2
- package/lib/module.js.map +1 -1
- package/lib/module.mjs.map +1 -1
- package/lib/re-exports.d.ts +1 -1
- package/lib/re-exports.js.map +1 -1
- package/lib/transformers/NoTransformConfigurationError.js +19 -4
- package/lib/transformers/NoTransformConfigurationError.js.map +1 -1
- package/lib/transformers/NoTransformConfigurationError.mjs +12 -6
- package/lib/transformers/NoTransformConfigurationError.mjs.map +1 -1
- package/native/cmd/ttsc-typia/create_assert_error_factory_arity_test.go +5 -2
- package/native/cmd/ttsc-typia/dependency_collector_virtual_scheme_test.go +52 -0
- package/native/cmd/ttsc-typia/json_schema_nonsensible_intersection_diagnostic_test.go +80 -0
- package/native/cmd/ttsc-typia/project_dependencies_callee_argument_transform_test.go +177 -0
- package/native/cmd/ttsc-typia/project_dependencies_callee_barrel_transform_test.go +115 -0
- package/native/cmd/ttsc-typia/project_dependencies_callee_inference_transform_test.go +285 -0
- package/native/cmd/ttsc-typia/project_dependencies_callee_shape_transform_test.go +117 -0
- package/native/cmd/ttsc-typia/project_dependencies_callee_untransformed_barrel_transform_test.go +121 -0
- package/native/cmd/ttsc-typia/project_dependencies_complete_diagnostic_transform_test.go +116 -0
- package/native/cmd/ttsc-typia/project_dependencies_complete_envelope_transform_test.go +115 -0
- package/native/cmd/ttsc-typia/project_dependencies_complete_inferred_type_transform_test.go +127 -0
- package/native/cmd/ttsc-typia/project_dependencies_complete_replaced_library_transform_test.go +153 -0
- package/native/cmd/ttsc-typia/project_dependencies_complete_untouched_reprint_transform_test.go +155 -0
- package/native/cmd/ttsc-typia/project_dependencies_computed_key_transform_test.go +218 -0
- package/native/cmd/ttsc-typia/project_dependencies_custom_lib_name_transform_test.go +6 -5
- package/native/cmd/ttsc-typia/project_dependencies_enum_member_value_transform_test.go +131 -0
- package/native/cmd/ttsc-typia/project_dependencies_inferred_declaration_transform_test.go +159 -0
- package/native/cmd/ttsc-typia/project_dependencies_jsdoc_typedef_transform_test.go +134 -0
- package/native/cmd/ttsc-typia/project_dependencies_named_tuple_member_transform_test.go +123 -0
- package/native/cmd/ttsc-typia/project_dependencies_qualified_barrel_transform_test.go +141 -0
- package/native/cmd/ttsc-typia/project_dependencies_type_parameter_default_transform_test.go +127 -0
- package/native/cmd/ttsc-typia/transform.go +193 -19
- package/native/core/schemas/metadata/MetadataDependency.go +613 -30
- package/native/transform/CallExpressionTransformer.go +16 -1
- package/package.json +4 -5
- package/src/internal/_createStandardSchema.ts +1 -2
- package/src/module.ts +6 -2
- package/src/re-exports.ts +13 -0
- package/src/transformers/NoTransformConfigurationError.ts +19 -4
|
@@ -48,6 +48,13 @@ func (callExpressionTransformerNamespace) Transform(props CallExpressionTransfor
|
|
|
48
48
|
if props.Expression == nil {
|
|
49
49
|
return nil
|
|
50
50
|
}
|
|
51
|
+
// Report what SELECTS this callee before asking what it resolved to (project
|
|
52
|
+
// transform mode only; a no-op otherwise). Typia-ness is decided by the file
|
|
53
|
+
// that declares the resolved signature, so the modules an import or re-export
|
|
54
|
+
// chain traverses decide whether this call is rewritten -- and the report has
|
|
55
|
+
// to happen for a rejected call too, because that is the one an edit to one
|
|
56
|
+
// of those modules turns into a generated validator.
|
|
57
|
+
schemametadata.MetadataDependency_touchCallee(props.Context.Checker, props.Expression.Expression)
|
|
51
58
|
signature := props.Context.Checker.GetResolvedSignature(props.Expression.AsNode())
|
|
52
59
|
if signature == nil {
|
|
53
60
|
return props.Expression.AsNode()
|
|
@@ -94,10 +101,18 @@ func (callExpressionTransformerNamespace) TransformKnown(props CallExpressionTra
|
|
|
94
101
|
// intrinsic (`typia.validate<Id>()` with `type Id = string` elsewhere) leaves
|
|
95
102
|
// no symbol on the resolved type, so the call site's own syntax is the only
|
|
96
103
|
// anchor that registers such an alias' declaring file.
|
|
97
|
-
|
|
104
|
+
//
|
|
105
|
+
// A call that writes no type argument takes its validated type from the value
|
|
106
|
+
// argument instead, and no walk bounds where that type was decided: contextual
|
|
107
|
+
// typing can put the deciding annotation in a file the resolved type never
|
|
108
|
+
// names. Report it as unbounded, which costs the file its completeness
|
|
109
|
+
// declaration rather than vouching for a list that cannot cover it.
|
|
110
|
+
if props.Expression.TypeArguments != nil && len(props.Expression.TypeArguments.Nodes) != 0 {
|
|
98
111
|
for _, argument := range props.Expression.TypeArguments.Nodes {
|
|
99
112
|
schemametadata.MetadataDependency_touchTypeNode(props.Context.Checker, argument)
|
|
100
113
|
}
|
|
114
|
+
} else {
|
|
115
|
+
schemametadata.MetadataDependency_unbounded(props.Context.Checker)
|
|
101
116
|
}
|
|
102
117
|
// Keep the full callee expression (e.g. `typia.assertEquals`) as the modulo,
|
|
103
118
|
// mirroring the TypeScript transformer. Programmers render it into the
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "typia",
|
|
3
|
-
"version": "14.0.
|
|
3
|
+
"version": "14.0.2",
|
|
4
4
|
"description": "Superfast runtime validators with only one line",
|
|
5
5
|
"main": "lib/index.js",
|
|
6
6
|
"exports": {
|
|
@@ -42,10 +42,9 @@
|
|
|
42
42
|
},
|
|
43
43
|
"homepage": "https://typia.io",
|
|
44
44
|
"dependencies": {
|
|
45
|
-
"@standard-schema/spec": "^1.0.0",
|
|
46
45
|
"randexp": "^0.5.3",
|
|
47
|
-
"@typia/interface": "^14.0.
|
|
48
|
-
"@typia/utils": "^14.0.
|
|
46
|
+
"@typia/interface": "^14.0.2",
|
|
47
|
+
"@typia/utils": "^14.0.2"
|
|
49
48
|
},
|
|
50
49
|
"peerDependencies": {
|
|
51
50
|
"ttsc": ">=0.19.2"
|
|
@@ -59,7 +58,7 @@
|
|
|
59
58
|
"@types/node": "^25.3.0",
|
|
60
59
|
"rimraf": "^6.1.2",
|
|
61
60
|
"rolldown": "^1.1.5",
|
|
62
|
-
"ttsc": "^0.
|
|
61
|
+
"ttsc": "^0.28.1",
|
|
63
62
|
"typescript": "^7.0.2"
|
|
64
63
|
},
|
|
65
64
|
"sideEffects": false,
|
package/src/module.ts
CHANGED
|
@@ -1,5 +1,9 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
1
|
+
import {
|
|
2
|
+
IRandomGenerator,
|
|
3
|
+
IValidation,
|
|
4
|
+
Resolved,
|
|
5
|
+
StandardSchemaV1,
|
|
6
|
+
} from "@typia/interface";
|
|
3
7
|
|
|
4
8
|
import { TypeGuardError } from "./TypeGuardError";
|
|
5
9
|
import { NoTransformConfigurationError } from "./transformers/NoTransformConfigurationError";
|
package/src/re-exports.ts
CHANGED
|
@@ -1,11 +1,23 @@
|
|
|
1
|
+
// Every type a public `typia.*` signature exposes must be re-exported here.
|
|
2
|
+
//
|
|
3
|
+
// A consumer compiling with `declaration: true` may only name an inferred type
|
|
4
|
+
// through a module specifier it can resolve itself, and typia's dependencies
|
|
5
|
+
// are not among them under an isolated `node_modules` layout such as pnpm's:
|
|
6
|
+
// they sit beside typia, not above the consumer. Without the re-export that
|
|
7
|
+
// emit has nothing portable to write, so TypeScript reports TS2742 (TS2883
|
|
8
|
+
// since TypeScript 7); with it, the emit writes `typia.<Name>`.
|
|
9
|
+
//
|
|
10
|
+
// `experiments/declaration` is the guard. See samchon/typia#2359.
|
|
1
11
|
export type {
|
|
2
12
|
// validate
|
|
3
13
|
AssertionGuard,
|
|
4
14
|
IJsonParseResult,
|
|
5
15
|
IValidation,
|
|
6
16
|
IRandomGenerator,
|
|
17
|
+
StandardSchemaV1,
|
|
7
18
|
// json
|
|
8
19
|
OpenApi,
|
|
20
|
+
IJsonSchemaApplication,
|
|
9
21
|
IJsonSchemaCollection,
|
|
10
22
|
IJsonSchemaUnit,
|
|
11
23
|
// llm
|
|
@@ -22,6 +34,7 @@ export type {
|
|
|
22
34
|
IMetadataTypeTag,
|
|
23
35
|
IJsDocTagInfo,
|
|
24
36
|
// typings
|
|
37
|
+
Atomic,
|
|
25
38
|
Classifiable,
|
|
26
39
|
ClassifyResult,
|
|
27
40
|
Primitive,
|
|
@@ -4,13 +4,28 @@ export function NoTransformConfigurationError(name: string): never {
|
|
|
4
4
|
[
|
|
5
5
|
`Error on typia.${name}(): no transform has been configured.`,
|
|
6
6
|
"",
|
|
7
|
-
|
|
7
|
+
[
|
|
8
|
+
"Build the project with `ttsc` (not stock `tsc`), run TypeScript",
|
|
9
|
+
"with `ttsx`, or configure `@ttsc/unplugin` for a bundler.",
|
|
10
|
+
"These toolchains discover typia's native transform automatically.",
|
|
11
|
+
].join(" "),
|
|
12
|
+
"",
|
|
13
|
+
[
|
|
14
|
+
"If `ttsc` is missing, install it with",
|
|
15
|
+
"`npm i -D ttsc typescript`.",
|
|
16
|
+
].join(" "),
|
|
8
17
|
"",
|
|
9
18
|
[
|
|
10
|
-
"If
|
|
11
|
-
"
|
|
12
|
-
"is wrong with your code.",
|
|
19
|
+
"If setup is already complete, run `npx ttsc --noEmit` to",
|
|
20
|
+
"surface the underlying TypeScript or typia transform error.",
|
|
13
21
|
].join(" "),
|
|
22
|
+
"",
|
|
23
|
+
[
|
|
24
|
+
"Stock `tsc`, `ts-node`, `tsx`, Babel, and SWC do not load",
|
|
25
|
+
"typia's transform on their own.",
|
|
26
|
+
].join(" "),
|
|
27
|
+
"",
|
|
28
|
+
"See https://typia.io/docs/setup for setup and bundler instructions.",
|
|
14
29
|
].join("\n"),
|
|
15
30
|
);
|
|
16
31
|
}
|