@nestia/migrate 14.0.1 → 14.0.3
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/NestiaMigrateApplication.d.ts +111 -0
- package/lib/NestiaMigrateApplication.js +148 -9
- package/lib/NestiaMigrateApplication.js.map +1 -1
- package/lib/NestiaMigrateApplication.mjs +147 -5
- package/lib/_virtual/_rolldown/runtime.mjs +6 -1
- package/lib/analyzers/NestiaMigrateControllerAnalyzer.d.ts +45 -0
- package/lib/analyzers/NestiaMigrateControllerAnalyzer.js +59 -3
- package/lib/analyzers/NestiaMigrateControllerAnalyzer.js.map +1 -1
- package/lib/analyzers/NestiaMigrateControllerAnalyzer.mjs +9 -3
- package/lib/archivers/NestiaMigrateFileArchiver.d.ts +34 -0
- package/lib/archivers/NestiaMigrateFileArchiver.js +34 -0
- package/lib/archivers/NestiaMigrateFileArchiver.js.map +1 -1
- package/lib/bundles/NEST_TEMPLATE.js +1 -1
- package/lib/bundles/NEST_TEMPLATE.mjs +1 -1
- package/lib/bundles/SDK_TEMPLATE.js +1 -1
- package/lib/bundles/SDK_TEMPLATE.mjs +1 -1
- package/lib/executable/NestiaMigrateCommander.d.ts +39 -1
- package/lib/executable/NestiaMigrateCommander.js +42 -2
- package/lib/executable/NestiaMigrateCommander.js.map +1 -1
- package/lib/executable/NestiaMigrateCommander.mjs +5 -3
- package/lib/executable/NestiaMigrateInquirer.d.ts +32 -1
- package/lib/executable/NestiaMigrateInquirer.js +33 -10
- package/lib/executable/NestiaMigrateInquirer.js.map +1 -1
- package/lib/executable/NestiaMigrateInquirer.mjs +4 -3
- package/lib/executable/TemplateBundleCache.d.ts +23 -0
- package/lib/executable/TemplateBundleCache.js +60 -0
- package/lib/executable/TemplateBundleCache.js.map +1 -0
- package/lib/executable/TemplateBundleCache.mjs +39 -0
- package/lib/executable/TemplateBundleCache.mjs.map +1 -0
- package/lib/executable/bundle.d.ts +1 -0
- package/lib/executable/bundle.js +404 -0
- package/lib/executable/bundle.js.map +1 -0
- package/lib/executable/bundle.mjs +324 -0
- package/lib/executable/bundle.mjs.map +1 -0
- package/lib/factories/ExpressionFactory.d.ts +14 -0
- package/lib/factories/ExpressionFactory.js +14 -0
- package/lib/factories/ExpressionFactory.js.map +1 -1
- package/lib/factories/IdentifierFactory.d.ts +20 -0
- package/lib/factories/IdentifierFactory.js +20 -0
- package/lib/factories/IdentifierFactory.js.map +1 -1
- package/lib/factories/LiteralFactory.d.ts +18 -2
- package/lib/factories/LiteralFactory.js +18 -2
- package/lib/factories/LiteralFactory.js.map +1 -1
- package/lib/factories/StatementFactory.d.ts +26 -1
- package/lib/factories/StatementFactory.js +26 -1
- package/lib/factories/StatementFactory.js.map +1 -1
- package/lib/factories/SupportedStringFormats.d.ts +6 -0
- package/lib/factories/SupportedStringFormats.js +33 -0
- package/lib/factories/SupportedStringFormats.js.map +1 -0
- package/lib/factories/SupportedStringFormats.mjs +34 -0
- package/lib/factories/SupportedStringFormats.mjs.map +1 -0
- package/lib/factories/TypeFactory.d.ts +21 -0
- package/lib/factories/TypeFactory.js +13 -0
- package/lib/factories/TypeFactory.js.map +1 -1
- package/lib/factories/TypeLiteralFactory.d.ts +18 -0
- package/lib/factories/TypeLiteralFactory.js +18 -0
- package/lib/factories/TypeLiteralFactory.js.map +1 -1
- package/lib/internal/ts.d.ts +153 -0
- package/lib/internal/ts.js.map +1 -1
- package/lib/package.mjs +55 -0
- package/lib/package.mjs.map +1 -0
- package/lib/programmers/NestiaMigrateApiFileProgrammer.d.ts +31 -0
- package/lib/programmers/NestiaMigrateApiFileProgrammer.js +17 -0
- package/lib/programmers/NestiaMigrateApiFileProgrammer.js.map +1 -1
- package/lib/programmers/NestiaMigrateApiFunctionProgrammer.d.ts +40 -0
- package/lib/programmers/NestiaMigrateApiFunctionProgrammer.js +27 -0
- package/lib/programmers/NestiaMigrateApiFunctionProgrammer.js.map +1 -1
- package/lib/programmers/NestiaMigrateApiNamespaceProgrammer.d.ts +39 -0
- package/lib/programmers/NestiaMigrateApiNamespaceProgrammer.js +26 -0
- package/lib/programmers/NestiaMigrateApiNamespaceProgrammer.js.map +1 -1
- package/lib/programmers/NestiaMigrateApiProgrammer.d.ts +18 -0
- package/lib/programmers/NestiaMigrateApiProgrammer.js +18 -0
- package/lib/programmers/NestiaMigrateApiProgrammer.js.map +1 -1
- package/lib/programmers/NestiaMigrateApiProgrammer.mjs +1 -1
- package/lib/programmers/NestiaMigrateApiSimulationProgrammer.d.ts +40 -0
- package/lib/programmers/NestiaMigrateApiSimulationProgrammer.js +27 -0
- package/lib/programmers/NestiaMigrateApiSimulationProgrammer.js.map +1 -1
- package/lib/programmers/NestiaMigrateApiStartProgrammer.d.ts +17 -0
- package/lib/programmers/NestiaMigrateApiStartProgrammer.js +19 -8
- package/lib/programmers/NestiaMigrateApiStartProgrammer.js.map +1 -1
- package/lib/programmers/NestiaMigrateApiStartProgrammer.mjs +1 -6
- package/lib/programmers/NestiaMigrateDtoProgrammer.d.ts +30 -0
- package/lib/programmers/NestiaMigrateDtoProgrammer.js +17 -0
- package/lib/programmers/NestiaMigrateDtoProgrammer.js.map +1 -1
- package/lib/programmers/NestiaMigrateE2eFileProgrammer.d.ts +39 -0
- package/lib/programmers/NestiaMigrateE2eFileProgrammer.js +26 -0
- package/lib/programmers/NestiaMigrateE2eFileProgrammer.js.map +1 -1
- package/lib/programmers/NestiaMigrateE2eProgrammer.d.ts +16 -0
- package/lib/programmers/NestiaMigrateE2eProgrammer.js +16 -0
- package/lib/programmers/NestiaMigrateE2eProgrammer.js.map +1 -1
- package/lib/programmers/NestiaMigrateImportProgrammer.d.ts +75 -0
- package/lib/programmers/NestiaMigrateImportProgrammer.js +58 -3
- package/lib/programmers/NestiaMigrateImportProgrammer.js.map +1 -1
- package/lib/programmers/NestiaMigrateImportProgrammer.mjs +58 -3
- package/lib/programmers/NestiaMigrateNestControllerProgrammer.d.ts +28 -0
- package/lib/programmers/NestiaMigrateNestControllerProgrammer.js +16 -0
- package/lib/programmers/NestiaMigrateNestControllerProgrammer.js.map +1 -1
- package/lib/programmers/NestiaMigrateNestMethodProgrammer.d.ts +30 -0
- package/lib/programmers/NestiaMigrateNestMethodProgrammer.js +16 -0
- package/lib/programmers/NestiaMigrateNestMethodProgrammer.js.map +1 -1
- package/lib/programmers/NestiaMigrateNestModuleProgrammer.d.ts +16 -0
- package/lib/programmers/NestiaMigrateNestModuleProgrammer.js +16 -0
- package/lib/programmers/NestiaMigrateNestModuleProgrammer.js.map +1 -1
- package/lib/programmers/NestiaMigrateNestProgrammer.d.ts +17 -0
- package/lib/programmers/NestiaMigrateNestProgrammer.js +17 -0
- package/lib/programmers/NestiaMigrateNestProgrammer.js.map +1 -1
- package/lib/programmers/NestiaMigrateSchemaProgrammer.d.ts +16 -0
- package/lib/programmers/NestiaMigrateSchemaProgrammer.js +20 -5
- package/lib/programmers/NestiaMigrateSchemaProgrammer.js.map +1 -1
- package/lib/programmers/NestiaMigrateSchemaProgrammer.mjs +4 -4
- package/lib/structures/INestiaMigrateConfig.d.ts +21 -0
- package/lib/structures/INestiaMigrateContext.d.ts +15 -0
- package/lib/structures/INestiaMigrateController.d.ts +13 -0
- package/lib/structures/INestiaMigrateFile.d.ts +11 -0
- package/lib/utils/FilePrinter.d.ts +33 -0
- package/lib/utils/FilePrinter.js +33 -0
- package/lib/utils/FilePrinter.js.map +1 -1
- package/lib/utils/MapUtil.d.ts +17 -0
- package/lib/utils/MapUtil.js +19 -3
- package/lib/utils/MapUtil.js.map +1 -1
- package/lib/utils/MapUtil.mjs +1 -2
- package/lib/utils/PathTemplate.d.ts +23 -1
- package/lib/utils/PathTemplate.js +15 -1
- package/lib/utils/PathTemplate.js.map +1 -1
- package/lib/utils/RequestBody.d.ts +13 -0
- package/lib/utils/RequestBody.js +13 -0
- package/lib/utils/RequestBody.js.map +1 -1
- package/lib/utils/StringUtil.d.ts +55 -0
- package/lib/utils/StringUtil.js +93 -8
- package/lib/utils/StringUtil.js.map +1 -1
- package/lib/utils/StringUtil.mjs +30 -8
- package/lib/utils/SuccessStatus.d.ts +21 -1
- package/lib/utils/SuccessStatus.js +21 -1
- package/lib/utils/SuccessStatus.js.map +1 -1
- package/package.json +5 -4
- package/src/NestiaMigrateApplication.ts +151 -13
- package/src/analyzers/NestiaMigrateControllerAnalyzer.ts +59 -4
- package/src/archivers/NestiaMigrateFileArchiver.ts +34 -0
- package/src/bundles/NEST_TEMPLATE.ts +1 -1
- package/src/bundles/SDK_TEMPLATE.ts +1 -1
- package/src/executable/NestiaMigrateCommander.ts +44 -2
- package/src/executable/NestiaMigrateInquirer.ts +35 -3
- package/src/executable/TemplateBundleCache.ts +65 -0
- package/src/executable/{bundle.js → bundle.ts} +110 -43
- package/src/factories/ExpressionFactory.ts +14 -0
- package/src/factories/IdentifierFactory.ts +20 -0
- package/src/factories/LiteralFactory.ts +18 -2
- package/src/factories/StatementFactory.ts +26 -1
- package/src/factories/SupportedStringFormats.ts +29 -0
- package/src/factories/TypeFactory.ts +21 -0
- package/src/factories/TypeLiteralFactory.ts +18 -0
- package/src/internal/ts.ts +153 -0
- package/src/programmers/NestiaMigrateApiFileProgrammer.ts +35 -0
- package/src/programmers/NestiaMigrateApiFunctionProgrammer.ts +43 -0
- package/src/programmers/NestiaMigrateApiNamespaceProgrammer.ts +42 -0
- package/src/programmers/NestiaMigrateApiProgrammer.ts +18 -0
- package/src/programmers/NestiaMigrateApiSimulationProgrammer.ts +43 -0
- package/src/programmers/NestiaMigrateApiStartProgrammer.ts +19 -10
- package/src/programmers/NestiaMigrateDtoProgrammer.ts +33 -0
- package/src/programmers/NestiaMigrateE2eFileProgrammer.ts +42 -0
- package/src/programmers/NestiaMigrateE2eProgrammer.ts +16 -0
- package/src/programmers/NestiaMigrateImportProgrammer.ts +86 -5
- package/src/programmers/NestiaMigrateNestControllerProgrammer.ts +30 -0
- package/src/programmers/NestiaMigrateNestMethodProgrammer.ts +34 -0
- package/src/programmers/NestiaMigrateNestModuleProgrammer.ts +16 -0
- package/src/programmers/NestiaMigrateNestProgrammer.ts +17 -0
- package/src/programmers/NestiaMigrateSchemaProgrammer.ts +25 -8
- package/src/structures/INestiaMigrateConfig.ts +26 -0
- package/src/structures/INestiaMigrateContext.ts +17 -0
- package/src/structures/INestiaMigrateController.ts +16 -0
- package/src/structures/INestiaMigrateFile.ts +13 -0
- package/src/utils/FilePrinter.ts +33 -0
- package/src/utils/MapUtil.ts +18 -2
- package/src/utils/PathTemplate.ts +23 -1
- package/src/utils/RequestBody.ts +13 -0
- package/src/utils/StringUtil.ts +101 -9
- package/src/utils/SuccessStatus.ts +21 -1
- package/lib/factories/FormatCheatSheet.d.ts +0 -25
- package/lib/factories/FormatCheatSheet.js +0 -34
- package/lib/factories/FormatCheatSheet.js.map +0 -1
- package/lib/factories/FormatCheatSheet.mjs +0 -31
- package/lib/factories/FormatCheatSheet.mjs.map +0 -1
- package/src/factories/FormatCheatSheet.ts +0 -71
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.SUPPORTED_STRING_FORMATS = void 0;
|
|
4
|
+
/**
|
|
5
|
+
* The string formats of the OpenAPI document that the typia `Format` tag
|
|
6
|
+
* validates, so a schema carrying one of them is generated as a `Format` tag
|
|
7
|
+
* and a schema carrying any other format stays a plain `string`.
|
|
8
|
+
*/
|
|
9
|
+
exports.SUPPORTED_STRING_FORMATS = new Set([
|
|
10
|
+
"byte",
|
|
11
|
+
"password",
|
|
12
|
+
"regex",
|
|
13
|
+
"uuid",
|
|
14
|
+
"email",
|
|
15
|
+
"hostname",
|
|
16
|
+
"idn-email",
|
|
17
|
+
"idn-hostname",
|
|
18
|
+
"iri",
|
|
19
|
+
"iri-reference",
|
|
20
|
+
"ipv4",
|
|
21
|
+
"ipv6",
|
|
22
|
+
"uri",
|
|
23
|
+
"uri-reference",
|
|
24
|
+
"uri-template",
|
|
25
|
+
"url",
|
|
26
|
+
"date-time",
|
|
27
|
+
"date",
|
|
28
|
+
"time",
|
|
29
|
+
"duration",
|
|
30
|
+
"json-pointer",
|
|
31
|
+
"relative-json-pointer",
|
|
32
|
+
]);
|
|
33
|
+
//# sourceMappingURL=SupportedStringFormats.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"SupportedStringFormats.js","sourceRoot":"","sources":["../../src/factories/SupportedStringFormats.ts"],"names":[],"mappings":";;;AAAA;;;;GAIG;AACU,QAAA,wBAAwB,GAAwB,IAAI,GAAG,CAAC;IACnE,MAAM;IACN,UAAU;IACV,OAAO;IACP,MAAM;IACN,OAAO;IACP,UAAU;IACV,WAAW;IACX,cAAc;IACd,KAAK;IACL,eAAe;IACf,MAAM;IACN,MAAM;IACN,KAAK;IACL,eAAe;IACf,cAAc;IACd,KAAK;IACL,WAAW;IACX,MAAM;IACN,MAAM;IACN,UAAU;IACV,cAAc;IACd,uBAAuB;CACxB,CAAC,CAAC"}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
//#region src/factories/SupportedStringFormats.ts
|
|
2
|
+
/**
|
|
3
|
+
* The string formats of the OpenAPI document that the typia `Format` tag
|
|
4
|
+
* validates, so a schema carrying one of them is generated as a `Format` tag
|
|
5
|
+
* and a schema carrying any other format stays a plain `string`.
|
|
6
|
+
*/
|
|
7
|
+
const SUPPORTED_STRING_FORMATS = /* @__PURE__ */ new Set([
|
|
8
|
+
"byte",
|
|
9
|
+
"password",
|
|
10
|
+
"regex",
|
|
11
|
+
"uuid",
|
|
12
|
+
"email",
|
|
13
|
+
"hostname",
|
|
14
|
+
"idn-email",
|
|
15
|
+
"idn-hostname",
|
|
16
|
+
"iri",
|
|
17
|
+
"iri-reference",
|
|
18
|
+
"ipv4",
|
|
19
|
+
"ipv6",
|
|
20
|
+
"uri",
|
|
21
|
+
"uri-reference",
|
|
22
|
+
"uri-template",
|
|
23
|
+
"url",
|
|
24
|
+
"date-time",
|
|
25
|
+
"date",
|
|
26
|
+
"time",
|
|
27
|
+
"duration",
|
|
28
|
+
"json-pointer",
|
|
29
|
+
"relative-json-pointer"
|
|
30
|
+
]);
|
|
31
|
+
//#endregion
|
|
32
|
+
export { SUPPORTED_STRING_FORMATS };
|
|
33
|
+
|
|
34
|
+
//# sourceMappingURL=SupportedStringFormats.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"SupportedStringFormats.mjs","names":[],"sources":[],"mappings":""}
|
|
@@ -5,6 +5,11 @@ import { type KeywordTypeNode, SyntaxKind } from "@ttsc/factory";
|
|
|
5
5
|
* Wraps {@link factory.createKeywordTypeNode} with a name-based interface so
|
|
6
6
|
* generator code reads as `TypeFactory.keyword("any")` instead of selecting the
|
|
7
7
|
* `SyntaxKind.AnyKeyword` token by hand.
|
|
8
|
+
*
|
|
9
|
+
* @evidence contracts/common.md#principled-implementation The namespace maps the names of the nine keyword types to their syntax kinds.
|
|
10
|
+
* @evidence contracts/common.md#clear-and-simple-design One table, one type, and one function.
|
|
11
|
+
* @evidence contracts/common.md#prohibited-implementation-shortcuts It only builds nodes.
|
|
12
|
+
* @evidence contracts/common.md#meaningful-documentation The comment states its purpose.
|
|
8
13
|
*/
|
|
9
14
|
export declare namespace TypeFactory {
|
|
10
15
|
const KEYWORDS: {
|
|
@@ -18,7 +23,23 @@ export declare namespace TypeFactory {
|
|
|
18
23
|
readonly never: SyntaxKind.NeverKeyword;
|
|
19
24
|
readonly undefined: SyntaxKind.UndefinedKeyword;
|
|
20
25
|
};
|
|
26
|
+
/**
|
|
27
|
+
* The names of the supported keyword types.
|
|
28
|
+
*
|
|
29
|
+
* @evidence contracts/common.md#principled-implementation The type is the key set of the table that maps names to syntax kinds, so a new keyword is one table entry.
|
|
30
|
+
* @evidence contracts/common.md#clear-and-simple-design One derived type.
|
|
31
|
+
* @evidence contracts/common.md#prohibited-implementation-shortcuts It is a type and adds no runtime behavior.
|
|
32
|
+
* @evidence contracts/common.md#meaningful-documentation The comment names the set.
|
|
33
|
+
*/
|
|
21
34
|
export type Keyword = keyof typeof KEYWORDS;
|
|
35
|
+
/**
|
|
36
|
+
* Builds the keyword type node of a keyword name.
|
|
37
|
+
*
|
|
38
|
+
* @evidence contracts/common.md#principled-implementation The name is looked up in the table, so an unsupported name is a compile error.
|
|
39
|
+
* @evidence contracts/common.md#clear-and-simple-design One lookup.
|
|
40
|
+
* @evidence contracts/common.md#prohibited-implementation-shortcuts It follows the type grammar.
|
|
41
|
+
* @evidence contracts/common.md#meaningful-documentation The comment states its input.
|
|
42
|
+
*/
|
|
22
43
|
export const keyword: (type: Keyword) => KeywordTypeNode;
|
|
23
44
|
export {};
|
|
24
45
|
}
|
|
@@ -8,6 +8,11 @@ const factory_1 = require("@ttsc/factory");
|
|
|
8
8
|
* Wraps {@link factory.createKeywordTypeNode} with a name-based interface so
|
|
9
9
|
* generator code reads as `TypeFactory.keyword("any")` instead of selecting the
|
|
10
10
|
* `SyntaxKind.AnyKeyword` token by hand.
|
|
11
|
+
*
|
|
12
|
+
* @evidence contracts/common.md#principled-implementation The namespace maps the names of the nine keyword types to their syntax kinds.
|
|
13
|
+
* @evidence contracts/common.md#clear-and-simple-design One table, one type, and one function.
|
|
14
|
+
* @evidence contracts/common.md#prohibited-implementation-shortcuts It only builds nodes.
|
|
15
|
+
* @evidence contracts/common.md#meaningful-documentation The comment states its purpose.
|
|
11
16
|
*/
|
|
12
17
|
var TypeFactory;
|
|
13
18
|
(function (TypeFactory) {
|
|
@@ -22,6 +27,14 @@ var TypeFactory;
|
|
|
22
27
|
never: factory_1.SyntaxKind.NeverKeyword,
|
|
23
28
|
undefined: factory_1.SyntaxKind.UndefinedKeyword,
|
|
24
29
|
};
|
|
30
|
+
/**
|
|
31
|
+
* Builds the keyword type node of a keyword name.
|
|
32
|
+
*
|
|
33
|
+
* @evidence contracts/common.md#principled-implementation The name is looked up in the table, so an unsupported name is a compile error.
|
|
34
|
+
* @evidence contracts/common.md#clear-and-simple-design One lookup.
|
|
35
|
+
* @evidence contracts/common.md#prohibited-implementation-shortcuts It follows the type grammar.
|
|
36
|
+
* @evidence contracts/common.md#meaningful-documentation The comment states its input.
|
|
37
|
+
*/
|
|
25
38
|
TypeFactory.keyword = (type) => factory_1.factory.createKeywordTypeNode(KEYWORDS[type]);
|
|
26
39
|
})(TypeFactory || (exports.TypeFactory = TypeFactory = {}));
|
|
27
40
|
//# sourceMappingURL=TypeFactory.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TypeFactory.js","sourceRoot":"","sources":["../../src/factories/TypeFactory.ts"],"names":[],"mappings":";;;AAAA,2CAA0E;AAE1E
|
|
1
|
+
{"version":3,"file":"TypeFactory.js","sourceRoot":"","sources":["../../src/factories/TypeFactory.ts"],"names":[],"mappings":";;;AAAA,2CAA0E;AAE1E;;;;;;;;;;;GAWG;AACH,IAAiB,WAAW,CAiC3B;AAjCD,WAAiB,WAAW;IAC1B,MAAM,QAAQ,GAAG;QACf,IAAI,EAAE,oBAAU,CAAC,WAAW;QAC5B,GAAG,EAAE,oBAAU,CAAC,UAAU;QAC1B,OAAO,EAAE,oBAAU,CAAC,cAAc;QAClC,OAAO,EAAE,oBAAU,CAAC,cAAc;QAClC,MAAM,EAAE,oBAAU,CAAC,aAAa;QAChC,MAAM,EAAE,oBAAU,CAAC,aAAa;QAChC,MAAM,EAAE,oBAAU,CAAC,aAAa;QAChC,KAAK,EAAE,oBAAU,CAAC,YAAY;QAC9B,SAAS,EAAE,oBAAU,CAAC,gBAAgB;KAC9B,CAAC;IAYX;;;;;;;OAOG;IACU,mBAAO,GAAG,CAAC,IAAa,EAAmB,EAAE,CACxD,iBAAO,CAAC,qBAAqB,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC,CAAC;AAClD,CAAC,EAjCgB,WAAW,aAAX,WAAW,GAAX,WAAW,QAiC3B"}
|
|
@@ -1,4 +1,22 @@
|
|
|
1
1
|
import ts from "../internal/ts";
|
|
2
|
+
/**
|
|
3
|
+
* Builds type nodes from JavaScript values, so a value can be written as a
|
|
4
|
+
* literal type.
|
|
5
|
+
*
|
|
6
|
+
* @evidence contracts/common.md#principled-implementation The namespace maps booleans, numbers, strings, null, arrays as tuples, and objects as type literals, and anything else to `any`.
|
|
7
|
+
* @evidence contracts/common.md#clear-and-simple-design One entry function and small private builders per kind.
|
|
8
|
+
* @evidence contracts/common.md#prohibited-implementation-shortcuts The mapping is by type, with no value special-cased.
|
|
9
|
+
* @evidence contracts/common.md#meaningful-documentation The comment states its purpose.
|
|
10
|
+
*/
|
|
2
11
|
export declare namespace TypeLiteralFactory {
|
|
12
|
+
/**
|
|
13
|
+
* Builds the literal type of a value: a literal for a primitive, a tuple for
|
|
14
|
+
* an array, a type literal for an object, and `any` for other values.
|
|
15
|
+
*
|
|
16
|
+
* @evidence contracts/common.md#principled-implementation The value is dispatched by type, negative numbers use a prefix minus as expressions do, and object keys that are not identifiers are quoted.
|
|
17
|
+
* @evidence contracts/common.md#clear-and-simple-design One function with one branch per kind.
|
|
18
|
+
* @evidence contracts/common.md#prohibited-implementation-shortcuts The dispatch is general.
|
|
19
|
+
* @evidence contracts/common.md#meaningful-documentation The comment lists the mapping.
|
|
20
|
+
*/
|
|
3
21
|
const generate: (value: any) => ts.TypeNode;
|
|
4
22
|
}
|
|
@@ -3,8 +3,26 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.TypeLiteralFactory = void 0;
|
|
4
4
|
const factory_1 = require("@ttsc/factory");
|
|
5
5
|
const utils_1 = require("@typia/utils");
|
|
6
|
+
/**
|
|
7
|
+
* Builds type nodes from JavaScript values, so a value can be written as a
|
|
8
|
+
* literal type.
|
|
9
|
+
*
|
|
10
|
+
* @evidence contracts/common.md#principled-implementation The namespace maps booleans, numbers, strings, null, arrays as tuples, and objects as type literals, and anything else to `any`.
|
|
11
|
+
* @evidence contracts/common.md#clear-and-simple-design One entry function and small private builders per kind.
|
|
12
|
+
* @evidence contracts/common.md#prohibited-implementation-shortcuts The mapping is by type, with no value special-cased.
|
|
13
|
+
* @evidence contracts/common.md#meaningful-documentation The comment states its purpose.
|
|
14
|
+
*/
|
|
6
15
|
var TypeLiteralFactory;
|
|
7
16
|
(function (TypeLiteralFactory) {
|
|
17
|
+
/**
|
|
18
|
+
* Builds the literal type of a value: a literal for a primitive, a tuple for
|
|
19
|
+
* an array, a type literal for an object, and `any` for other values.
|
|
20
|
+
*
|
|
21
|
+
* @evidence contracts/common.md#principled-implementation The value is dispatched by type, negative numbers use a prefix minus as expressions do, and object keys that are not identifiers are quoted.
|
|
22
|
+
* @evidence contracts/common.md#clear-and-simple-design One function with one branch per kind.
|
|
23
|
+
* @evidence contracts/common.md#prohibited-implementation-shortcuts The dispatch is general.
|
|
24
|
+
* @evidence contracts/common.md#meaningful-documentation The comment lists the mapping.
|
|
25
|
+
*/
|
|
8
26
|
TypeLiteralFactory.generate = (value) => typeof value === "boolean"
|
|
9
27
|
? generateBoolean(value)
|
|
10
28
|
: typeof value === "number"
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TypeLiteralFactory.js","sourceRoot":"","sources":["../../src/factories/TypeLiteralFactory.ts"],"names":[],"mappings":";;;AAAA,2CAAoD;AACpD,wCAAgD;AAIhD,IAAiB,kBAAkB,
|
|
1
|
+
{"version":3,"file":"TypeLiteralFactory.js","sourceRoot":"","sources":["../../src/factories/TypeLiteralFactory.ts"],"names":[],"mappings":";;;AAAA,2CAAoD;AACpD,wCAAgD;AAIhD;;;;;;;;GAQG;AACH,IAAiB,kBAAkB,CA8DlC;AA9DD,WAAiB,kBAAkB;IACjC;;;;;;;;OAQG;IACU,2BAAQ,GAAG,CAAC,KAAU,EAAe,EAAE,CAClD,OAAO,KAAK,KAAK,SAAS;QACxB,CAAC,CAAC,eAAe,CAAC,KAAK,CAAC;QACxB,CAAC,CAAC,OAAO,KAAK,KAAK,QAAQ;YACzB,CAAC,CAAC,cAAc,CAAC,KAAK,CAAC;YACvB,CAAC,CAAC,OAAO,KAAK,KAAK,QAAQ;gBACzB,CAAC,CAAC,cAAc,CAAC,KAAK,CAAC;gBACvB,CAAC,CAAC,OAAO,KAAK,KAAK,QAAQ;oBACzB,CAAC,CAAC,KAAK,KAAK,IAAI;wBACd,CAAC,CAAC,YAAY,EAAE;wBAChB,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC;4BACpB,CAAC,CAAC,aAAa,CAAC,KAAK,CAAC;4BACtB,CAAC,CAAC,cAAc,CAAC,KAAK,CAAC;oBAC3B,CAAC,CAAC,iBAAO,CAAC,qBAAqB,CAAC,oBAAU,CAAC,UAAU,CAAC,CAAC;IAEjE,MAAM,cAAc,GAAG,CAAC,GAAW,EAAE,EAAE,CACrC,iBAAO,CAAC,qBAAqB,CAAC,iBAAO,CAAC,mBAAmB,CAAC,GAAG,CAAC,CAAC,CAAC;IAElE,MAAM,cAAc,GAAG,CAAC,GAAW,EAAE,EAAE,CACrC,iBAAO,CAAC,qBAAqB,CAC3B,GAAG,GAAG,CAAC;QACL,CAAC,CAAC,iBAAO,CAAC,2BAA2B,CACjC,oBAAU,CAAC,UAAU,EACrB,iBAAO,CAAC,oBAAoB,CAAC,CAAC,GAAG,CAAC,CACnC;QACH,CAAC,CAAC,iBAAO,CAAC,oBAAoB,CAAC,GAAG,CAAC,CACtC,CAAC;IAEJ,MAAM,eAAe,GAAG,CAAC,IAAa,EAAE,EAAE,CACxC,iBAAO,CAAC,qBAAqB,CAC3B,IAAI,CAAC,CAAC,CAAC,iBAAO,CAAC,UAAU,EAAE,CAAC,CAAC,CAAC,iBAAO,CAAC,WAAW,EAAE,CACpD,CAAC;IAEJ,MAAM,YAAY,GAAG,GAAG,EAAE,CACxB,iBAAO,CAAC,qBAAqB,CAAC,iBAAO,CAAC,UAAU,EAAE,CAAC,CAAC;IAEtD,MAAM,aAAa,GAAG,CAAC,KAAY,EAAE,EAAE,CACrC,iBAAO,CAAC,mBAAmB,CAAC,KAAK,CAAC,GAAG,CAAC,2BAAQ,CAAC,CAAC,CAAC;IAEnD,MAAM,cAAc,GAAG,CAAC,GAAW,EAAE,EAAE,CACrC,iBAAO,CAAC,qBAAqB,CAC3B,MAAM,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,GAAG,EAAE,KAAK,CAAC,EAAE,EAAE,CACvC,iBAAO,CAAC,uBAAuB,CAC7B,SAAS,EACT,wBAAgB,CAAC,QAAQ,CAAC,GAAG,CAAC;QAC5B,CAAC,CAAC,iBAAO,CAAC,gBAAgB,CAAC,GAAG,CAAC;QAC/B,CAAC,CAAC,iBAAO,CAAC,mBAAmB,CAAC,GAAG,CAAC,EACpC,SAAS,EACT,2BAAQ,CAAC,KAAK,CAAC,CAChB,CACF,CACF,CAAC;AACN,CAAC,EA9DgB,kBAAkB,aAAlB,kBAAkB,GAAlB,kBAAkB,QA8DlC"}
|
package/lib/internal/ts.d.ts
CHANGED
|
@@ -20,24 +20,177 @@ type _TypeNode = TypeNode;
|
|
|
20
20
|
type _TypeReferenceNode = TypeReferenceNode;
|
|
21
21
|
type _UnionTypeNode = UnionTypeNode;
|
|
22
22
|
type _VariableStatement = VariableStatement;
|
|
23
|
+
/**
|
|
24
|
+
* A compatibility stand-in for `import ts from "typescript"`: the one value the
|
|
25
|
+
* generators still call, and the node types under the names they use.
|
|
26
|
+
*
|
|
27
|
+
* @evidence contracts/common.md#principled-implementation The value is the union-type guard, and the namespace aliases map each used compiler type name to the matching node type of the factory package, so existing annotations keep their exact shapes.
|
|
28
|
+
* @evidence contracts/common.md#clear-and-simple-design One value and one declaration-only namespace of aliases.
|
|
29
|
+
* @evidence contracts/common.md#prohibited-implementation-shortcuts It avoids loading the compiler; the guard is implemented on the node kind, not on a patched compiler.
|
|
30
|
+
* @evidence contracts/common.md#meaningful-documentation The leading comment explains why the shim exists.
|
|
31
|
+
*/
|
|
23
32
|
declare namespace ts {
|
|
33
|
+
/**
|
|
34
|
+
* The `Node` node type under the name the generators use.
|
|
35
|
+
*
|
|
36
|
+
* @evidence contracts/common.md#principled-implementation The alias names the `Node` node type of the factory package.
|
|
37
|
+
* @evidence contracts/common.md#clear-and-simple-design One alias.
|
|
38
|
+
* @evidence contracts/common.md#prohibited-implementation-shortcuts It is a type and adds no runtime behavior.
|
|
39
|
+
* @evidence contracts/common.md#meaningful-documentation The alias is named after the compiler type it replaces, and the file comment explains the shim.
|
|
40
|
+
*/
|
|
24
41
|
type Node = _Node;
|
|
42
|
+
/**
|
|
43
|
+
* The `Block` node type under the name the generators use.
|
|
44
|
+
*
|
|
45
|
+
* @evidence contracts/common.md#principled-implementation The alias names the `Block` node type of the factory package.
|
|
46
|
+
* @evidence contracts/common.md#clear-and-simple-design One alias.
|
|
47
|
+
* @evidence contracts/common.md#prohibited-implementation-shortcuts It is a type and adds no runtime behavior.
|
|
48
|
+
* @evidence contracts/common.md#meaningful-documentation The alias is named after the compiler type it replaces, and the file comment explains the shim.
|
|
49
|
+
*/
|
|
25
50
|
type Block = _Block;
|
|
51
|
+
/**
|
|
52
|
+
* The `CallExpression` node type under the name the generators use.
|
|
53
|
+
*
|
|
54
|
+
* @evidence contracts/common.md#principled-implementation The alias names the `CallExpression` node type of the factory package.
|
|
55
|
+
* @evidence contracts/common.md#clear-and-simple-design One alias.
|
|
56
|
+
* @evidence contracts/common.md#prohibited-implementation-shortcuts It is a type and adds no runtime behavior.
|
|
57
|
+
* @evidence contracts/common.md#meaningful-documentation The alias is named after the compiler type it replaces, and the file comment explains the shim.
|
|
58
|
+
*/
|
|
26
59
|
type CallExpression = _CallExpression;
|
|
60
|
+
/**
|
|
61
|
+
* The `ConciseBody` node type under the name the generators use.
|
|
62
|
+
*
|
|
63
|
+
* @evidence contracts/common.md#principled-implementation A concise body is a block or an expression, the same union the compiler defines.
|
|
64
|
+
* @evidence contracts/common.md#clear-and-simple-design One alias.
|
|
65
|
+
* @evidence contracts/common.md#prohibited-implementation-shortcuts It is a type and adds no runtime behavior.
|
|
66
|
+
* @evidence contracts/common.md#meaningful-documentation The alias is named after the compiler type it replaces, and the file comment explains the shim.
|
|
67
|
+
*/
|
|
27
68
|
type ConciseBody = _Block | _Expression;
|
|
69
|
+
/**
|
|
70
|
+
* The `Decorator` node type under the name the generators use.
|
|
71
|
+
*
|
|
72
|
+
* @evidence contracts/common.md#principled-implementation The alias names the `Decorator` node type of the factory package.
|
|
73
|
+
* @evidence contracts/common.md#clear-and-simple-design One alias.
|
|
74
|
+
* @evidence contracts/common.md#prohibited-implementation-shortcuts It is a type and adds no runtime behavior.
|
|
75
|
+
* @evidence contracts/common.md#meaningful-documentation The alias is named after the compiler type it replaces, and the file comment explains the shim.
|
|
76
|
+
*/
|
|
28
77
|
type Decorator = _Decorator;
|
|
78
|
+
/**
|
|
79
|
+
* The `Expression` node type under the name the generators use.
|
|
80
|
+
*
|
|
81
|
+
* @evidence contracts/common.md#principled-implementation The alias names the `Expression` node type of the factory package.
|
|
82
|
+
* @evidence contracts/common.md#clear-and-simple-design One alias.
|
|
83
|
+
* @evidence contracts/common.md#prohibited-implementation-shortcuts It is a type and adds no runtime behavior.
|
|
84
|
+
* @evidence contracts/common.md#meaningful-documentation The alias is named after the compiler type it replaces, and the file comment explains the shim.
|
|
85
|
+
*/
|
|
29
86
|
type Expression = _Expression;
|
|
87
|
+
/**
|
|
88
|
+
* The `FunctionDeclaration` node type under the name the generators use.
|
|
89
|
+
*
|
|
90
|
+
* @evidence contracts/common.md#principled-implementation The alias names the `FunctionDeclaration` node type of the factory package.
|
|
91
|
+
* @evidence contracts/common.md#clear-and-simple-design One alias.
|
|
92
|
+
* @evidence contracts/common.md#prohibited-implementation-shortcuts It is a type and adds no runtime behavior.
|
|
93
|
+
* @evidence contracts/common.md#meaningful-documentation The alias is named after the compiler type it replaces, and the file comment explains the shim.
|
|
94
|
+
*/
|
|
30
95
|
type FunctionDeclaration = _FunctionDeclaration;
|
|
96
|
+
/**
|
|
97
|
+
* The `Identifier` node type under the name the generators use.
|
|
98
|
+
*
|
|
99
|
+
* @evidence contracts/common.md#principled-implementation The alias names the `Identifier` node type of the factory package.
|
|
100
|
+
* @evidence contracts/common.md#clear-and-simple-design One alias.
|
|
101
|
+
* @evidence contracts/common.md#prohibited-implementation-shortcuts It is a type and adds no runtime behavior.
|
|
102
|
+
* @evidence contracts/common.md#meaningful-documentation The alias is named after the compiler type it replaces, and the file comment explains the shim.
|
|
103
|
+
*/
|
|
31
104
|
type Identifier = _Identifier;
|
|
105
|
+
/**
|
|
106
|
+
* The `KeywordTypeNode` node type under the name the generators use.
|
|
107
|
+
*
|
|
108
|
+
* @evidence contracts/common.md#principled-implementation The alias names the `KeywordTypeNode` node type of the factory package.
|
|
109
|
+
* @evidence contracts/common.md#clear-and-simple-design One alias.
|
|
110
|
+
* @evidence contracts/common.md#prohibited-implementation-shortcuts It is a type and adds no runtime behavior.
|
|
111
|
+
* @evidence contracts/common.md#meaningful-documentation The alias is named after the compiler type it replaces, and the file comment explains the shim.
|
|
112
|
+
*/
|
|
32
113
|
type KeywordTypeNode = _KeywordTypeNode;
|
|
114
|
+
/**
|
|
115
|
+
* The `MethodDeclaration` node type under the name the generators use.
|
|
116
|
+
*
|
|
117
|
+
* @evidence contracts/common.md#principled-implementation The alias names the `MethodDeclaration` node type of the factory package.
|
|
118
|
+
* @evidence contracts/common.md#clear-and-simple-design One alias.
|
|
119
|
+
* @evidence contracts/common.md#prohibited-implementation-shortcuts It is a type and adds no runtime behavior.
|
|
120
|
+
* @evidence contracts/common.md#meaningful-documentation The alias is named after the compiler type it replaces, and the file comment explains the shim.
|
|
121
|
+
*/
|
|
33
122
|
type MethodDeclaration = _MethodDeclaration;
|
|
123
|
+
/**
|
|
124
|
+
* The `ModuleDeclaration` node type under the name the generators use.
|
|
125
|
+
*
|
|
126
|
+
* @evidence contracts/common.md#principled-implementation The alias names the `ModuleDeclaration` node type of the factory package.
|
|
127
|
+
* @evidence contracts/common.md#clear-and-simple-design One alias.
|
|
128
|
+
* @evidence contracts/common.md#prohibited-implementation-shortcuts It is a type and adds no runtime behavior.
|
|
129
|
+
* @evidence contracts/common.md#meaningful-documentation The alias is named after the compiler type it replaces, and the file comment explains the shim.
|
|
130
|
+
*/
|
|
34
131
|
type ModuleDeclaration = _ModuleDeclaration;
|
|
132
|
+
/**
|
|
133
|
+
* The `ParameterDeclaration` node type under the name the generators use.
|
|
134
|
+
*
|
|
135
|
+
* @evidence contracts/common.md#principled-implementation The alias names the `ParameterDeclaration` node type of the factory package.
|
|
136
|
+
* @evidence contracts/common.md#clear-and-simple-design One alias.
|
|
137
|
+
* @evidence contracts/common.md#prohibited-implementation-shortcuts It is a type and adds no runtime behavior.
|
|
138
|
+
* @evidence contracts/common.md#meaningful-documentation The alias is named after the compiler type it replaces, and the file comment explains the shim.
|
|
139
|
+
*/
|
|
35
140
|
type ParameterDeclaration = _ParameterDeclaration;
|
|
141
|
+
/**
|
|
142
|
+
* The `Statement` node type under the name the generators use.
|
|
143
|
+
*
|
|
144
|
+
* @evidence contracts/common.md#principled-implementation The alias names the `Statement` node type of the factory package.
|
|
145
|
+
* @evidence contracts/common.md#clear-and-simple-design One alias.
|
|
146
|
+
* @evidence contracts/common.md#prohibited-implementation-shortcuts It is a type and adds no runtime behavior.
|
|
147
|
+
* @evidence contracts/common.md#meaningful-documentation The alias is named after the compiler type it replaces, and the file comment explains the shim.
|
|
148
|
+
*/
|
|
36
149
|
type Statement = _Statement;
|
|
150
|
+
/**
|
|
151
|
+
* The `TypeAliasDeclaration` node type under the name the generators use.
|
|
152
|
+
*
|
|
153
|
+
* @evidence contracts/common.md#principled-implementation The alias names the `TypeAliasDeclaration` node type of the factory package.
|
|
154
|
+
* @evidence contracts/common.md#clear-and-simple-design One alias.
|
|
155
|
+
* @evidence contracts/common.md#prohibited-implementation-shortcuts It is a type and adds no runtime behavior.
|
|
156
|
+
* @evidence contracts/common.md#meaningful-documentation The alias is named after the compiler type it replaces, and the file comment explains the shim.
|
|
157
|
+
*/
|
|
37
158
|
type TypeAliasDeclaration = _TypeAliasDeclaration;
|
|
159
|
+
/**
|
|
160
|
+
* The `TypeNode` node type under the name the generators use.
|
|
161
|
+
*
|
|
162
|
+
* @evidence contracts/common.md#principled-implementation The alias names the `TypeNode` node type of the factory package.
|
|
163
|
+
* @evidence contracts/common.md#clear-and-simple-design One alias.
|
|
164
|
+
* @evidence contracts/common.md#prohibited-implementation-shortcuts It is a type and adds no runtime behavior.
|
|
165
|
+
* @evidence contracts/common.md#meaningful-documentation The alias is named after the compiler type it replaces, and the file comment explains the shim.
|
|
166
|
+
*/
|
|
38
167
|
type TypeNode = _TypeNode;
|
|
168
|
+
/**
|
|
169
|
+
* The `TypeReferenceNode` node type under the name the generators use.
|
|
170
|
+
*
|
|
171
|
+
* @evidence contracts/common.md#principled-implementation The alias names the `TypeReferenceNode` node type of the factory package.
|
|
172
|
+
* @evidence contracts/common.md#clear-and-simple-design One alias.
|
|
173
|
+
* @evidence contracts/common.md#prohibited-implementation-shortcuts It is a type and adds no runtime behavior.
|
|
174
|
+
* @evidence contracts/common.md#meaningful-documentation The alias is named after the compiler type it replaces, and the file comment explains the shim.
|
|
175
|
+
*/
|
|
39
176
|
type TypeReferenceNode = _TypeReferenceNode;
|
|
177
|
+
/**
|
|
178
|
+
* The `UnionTypeNode` node type under the name the generators use.
|
|
179
|
+
*
|
|
180
|
+
* @evidence contracts/common.md#principled-implementation The alias names the `UnionTypeNode` node type of the factory package.
|
|
181
|
+
* @evidence contracts/common.md#clear-and-simple-design One alias.
|
|
182
|
+
* @evidence contracts/common.md#prohibited-implementation-shortcuts It is a type and adds no runtime behavior.
|
|
183
|
+
* @evidence contracts/common.md#meaningful-documentation The alias is named after the compiler type it replaces, and the file comment explains the shim.
|
|
184
|
+
*/
|
|
40
185
|
type UnionTypeNode = _UnionTypeNode;
|
|
186
|
+
/**
|
|
187
|
+
* The `VariableStatement` node type under the name the generators use.
|
|
188
|
+
*
|
|
189
|
+
* @evidence contracts/common.md#principled-implementation The alias names the `VariableStatement` node type of the factory package.
|
|
190
|
+
* @evidence contracts/common.md#clear-and-simple-design One alias.
|
|
191
|
+
* @evidence contracts/common.md#prohibited-implementation-shortcuts It is a type and adds no runtime behavior.
|
|
192
|
+
* @evidence contracts/common.md#meaningful-documentation The alias is named after the compiler type it replaces, and the file comment explains the shim.
|
|
193
|
+
*/
|
|
41
194
|
type VariableStatement = _VariableStatement;
|
|
42
195
|
}
|
|
43
196
|
export default ts;
|
package/lib/internal/ts.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ts.js","sourceRoot":"","sources":["../../src/internal/ts.ts"],"names":[],"mappings":";;AA8BA,MAAM,EAAE,GAAY;IAClB,eAAe,EAAE,CAAC,IAAsB,EAAyB,EAAE,CACjE,CAAC,CAAC,IAAI,IAAI,IAAI,CAAC,IAAI,KAAK,eAAe;CAC1C,CAAC;
|
|
1
|
+
{"version":3,"file":"ts.js","sourceRoot":"","sources":["../../src/internal/ts.ts"],"names":[],"mappings":";;AA8BA,MAAM,EAAE,GAAY;IAClB,eAAe,EAAE,CAAC,IAAsB,EAAyB,EAAE,CACjE,CAAC,CAAC,IAAI,IAAI,IAAI,CAAC,IAAI,KAAK,eAAe;CAC1C,CAAC;kBAkMa,EAAE"}
|
package/lib/package.mjs
ADDED
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
import { __commonJSMin } from "./_virtual/_rolldown/runtime.mjs";
|
|
2
|
+
//#region ../../package.json
|
|
3
|
+
var require_package = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
4
|
+
module.exports = {
|
|
5
|
+
"private": true,
|
|
6
|
+
"name": "@nestia/station",
|
|
7
|
+
"version": "14.0.3",
|
|
8
|
+
"description": "Nestia station",
|
|
9
|
+
"scripts": {
|
|
10
|
+
"build": "pnpm --filter=./packages/* -r build",
|
|
11
|
+
"evidence": "pnpm --filter=./config --filter=./packages/* --filter=./tests/* -r --no-bail --workspace-concurrency=1 run evidence",
|
|
12
|
+
"evidence:tests": "pnpm --filter=./tests/* --fail-if-no-match -r --no-bail --workspace-concurrency=1 run evidence",
|
|
13
|
+
"format": "prettier --write \"packages/**/*.ts\" \"tests/**/*.ts\"",
|
|
14
|
+
"format:check": "prettier --check \"packages/**/*.ts\" \"tests/**/*.ts\"",
|
|
15
|
+
"test": "pnpm build && pnpm evidence && pnpm test:go && pnpm test:unit && pnpm test:e2e",
|
|
16
|
+
"package:prepare": "pnpm build && node deploy/copy-readme.cjs",
|
|
17
|
+
"package:latest": "pnpm package:prepare && pnpm --filter=./packages/* -r publish --tag latest",
|
|
18
|
+
"package:next": "pnpm package:prepare && pnpm --filter=./packages/* -r publish --tag next",
|
|
19
|
+
"package:rc": "pnpm package:prepare && pnpm --filter=./packages/* -r publish --tag rc",
|
|
20
|
+
"package:tgz": "pnpm package:prepare && node deploy/tarballs",
|
|
21
|
+
"release": "rimraf packages/migrate/assets && bumpp -r",
|
|
22
|
+
"test:unit": "pnpm --filter=./packages/* --filter=./tests/* -r --no-bail --if-present run test:unit",
|
|
23
|
+
"test:go": "ttsx --no-plugins --tsconfig config/tsconfig.json config/testing/CompilerEnvironment.ts",
|
|
24
|
+
"test:e2e": "pnpm --filter=@nestia/test-sdk --fail-if-no-match integration"
|
|
25
|
+
},
|
|
26
|
+
"repository": {
|
|
27
|
+
"type": "git",
|
|
28
|
+
"url": "https://github.com/samchon/nestia"
|
|
29
|
+
},
|
|
30
|
+
"author": "Jeongho Nam",
|
|
31
|
+
"license": "MIT",
|
|
32
|
+
"bugs": { "url": "https://github.com/samchon/nestia/issues" },
|
|
33
|
+
"homepage": "https://nestia.io",
|
|
34
|
+
"devDependencies": {
|
|
35
|
+
"@trivago/prettier-plugin-sort-imports": "catalog:typescript",
|
|
36
|
+
"@wrtnlabs/evidence": "catalog:samchon",
|
|
37
|
+
"@types/ts-expose-internals": "npm:ts-expose-internals@5.4.5",
|
|
38
|
+
"bumpp": "^10.4.1",
|
|
39
|
+
"cross-env": "catalog:utils",
|
|
40
|
+
"prettier": "catalog:typescript",
|
|
41
|
+
"prettier-plugin-jsdoc": "catalog:typescript",
|
|
42
|
+
"rimraf": "catalog:utils",
|
|
43
|
+
"sloc": "^0.3.0",
|
|
44
|
+
"ttsc": "catalog:typescript",
|
|
45
|
+
"typescript": "catalog:typescript",
|
|
46
|
+
"yaml": "catalog:utils"
|
|
47
|
+
},
|
|
48
|
+
"packageManager": "pnpm@10.6.4"
|
|
49
|
+
};
|
|
50
|
+
}));
|
|
51
|
+
//#endregion
|
|
52
|
+
export default require_package();
|
|
53
|
+
export { require_package };
|
|
54
|
+
|
|
55
|
+
//# sourceMappingURL=package.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"package.mjs","names":[],"sources":["../../../package.json"],"sourcesContent":[""],"mappings":""}
|
|
@@ -1,13 +1,44 @@
|
|
|
1
1
|
import { IHttpMigrateRoute, OpenApi } from "@typia/interface";
|
|
2
2
|
import ts from "../internal/ts";
|
|
3
3
|
import { INestiaMigrateConfig } from "../structures/INestiaMigrateConfig";
|
|
4
|
+
/**
|
|
5
|
+
* Generates one file of the functional API: the imports, the exports of the
|
|
6
|
+
* child namespaces, and the functions of the routes at this level.
|
|
7
|
+
*
|
|
8
|
+
* @evidence contracts/common.md#principled-implementation Each route contributes its function and its namespace, the imports are collected by one importer and emitted first, and each child namespace is re-exported, so a file is a complete module.
|
|
9
|
+
* @evidence contracts/common.md#clear-and-simple-design One function over the two per-route programmers and the importer.
|
|
10
|
+
* @evidence contracts/common.md#prohibited-implementation-shortcuts The output derives from the routes and the configuration.
|
|
11
|
+
* @evidence contracts/common.md#meaningful-documentation The comment states the file's content.
|
|
12
|
+
*/
|
|
4
13
|
export declare namespace NestiaMigrateApiFileProgrammer {
|
|
14
|
+
/**
|
|
15
|
+
* The input of one API file: the configuration, the components, the namespace
|
|
16
|
+
* path, the routes, and the child namespaces.
|
|
17
|
+
*
|
|
18
|
+
* @evidence contracts/common.md#principled-implementation The record holds exactly what a file needs, so files can be generated independently.
|
|
19
|
+
* @evidence contracts/common.md#clear-and-simple-design A flat record.
|
|
20
|
+
* @evidence contracts/common.md#prohibited-implementation-shortcuts It is a type and adds no runtime behavior.
|
|
21
|
+
* @evidence contracts/common.md#meaningful-documentation The comment lists the fields.
|
|
22
|
+
*/
|
|
5
23
|
interface IProps {
|
|
24
|
+
/** Calling convention and optional generated features for this operation. */
|
|
6
25
|
config: INestiaMigrateConfig;
|
|
26
|
+
/** Component schemas used to resolve DTO references. */
|
|
7
27
|
components: OpenApi.IComponents;
|
|
28
|
+
/** Accessor prefix locating this functional API index. */
|
|
8
29
|
namespace: string[];
|
|
30
|
+
/** Operations whose functions belong directly to this index. */
|
|
9
31
|
routes: IHttpMigrateRoute[];
|
|
32
|
+
/** Immediate child namespace names re-exported by this index. */
|
|
10
33
|
children: Set<string>;
|
|
11
34
|
}
|
|
35
|
+
/**
|
|
36
|
+
* Returns the statements of one API file.
|
|
37
|
+
*
|
|
38
|
+
* @evidence contracts/common.md#principled-implementation The relative path to the structures directory is derived from the namespace depth, so imports resolve from every level.
|
|
39
|
+
* @evidence contracts/common.md#clear-and-simple-design One function.
|
|
40
|
+
* @evidence contracts/common.md#prohibited-implementation-shortcuts The depth is computed, not hardcoded.
|
|
41
|
+
* @evidence contracts/common.md#meaningful-documentation The comment states its result.
|
|
42
|
+
*/
|
|
12
43
|
const write: (props: IProps) => ts.Statement[];
|
|
13
44
|
}
|
|
@@ -6,8 +6,25 @@ const FilePrinter_1 = require("../utils/FilePrinter");
|
|
|
6
6
|
const NestiaMigrateApiFunctionProgrammer_1 = require("./NestiaMigrateApiFunctionProgrammer");
|
|
7
7
|
const NestiaMigrateApiNamespaceProgrammer_1 = require("./NestiaMigrateApiNamespaceProgrammer");
|
|
8
8
|
const NestiaMigrateImportProgrammer_1 = require("./NestiaMigrateImportProgrammer");
|
|
9
|
+
/**
|
|
10
|
+
* Generates one file of the functional API: the imports, the exports of the
|
|
11
|
+
* child namespaces, and the functions of the routes at this level.
|
|
12
|
+
*
|
|
13
|
+
* @evidence contracts/common.md#principled-implementation Each route contributes its function and its namespace, the imports are collected by one importer and emitted first, and each child namespace is re-exported, so a file is a complete module.
|
|
14
|
+
* @evidence contracts/common.md#clear-and-simple-design One function over the two per-route programmers and the importer.
|
|
15
|
+
* @evidence contracts/common.md#prohibited-implementation-shortcuts The output derives from the routes and the configuration.
|
|
16
|
+
* @evidence contracts/common.md#meaningful-documentation The comment states the file's content.
|
|
17
|
+
*/
|
|
9
18
|
var NestiaMigrateApiFileProgrammer;
|
|
10
19
|
(function (NestiaMigrateApiFileProgrammer) {
|
|
20
|
+
/**
|
|
21
|
+
* Returns the statements of one API file.
|
|
22
|
+
*
|
|
23
|
+
* @evidence contracts/common.md#principled-implementation The relative path to the structures directory is derived from the namespace depth, so imports resolve from every level.
|
|
24
|
+
* @evidence contracts/common.md#clear-and-simple-design One function.
|
|
25
|
+
* @evidence contracts/common.md#prohibited-implementation-shortcuts The depth is computed, not hardcoded.
|
|
26
|
+
* @evidence contracts/common.md#meaningful-documentation The comment states its result.
|
|
27
|
+
*/
|
|
11
28
|
NestiaMigrateApiFileProgrammer.write = (props) => {
|
|
12
29
|
const importer = new NestiaMigrateImportProgrammer_1.NestiaMigrateImportProgrammer();
|
|
13
30
|
const statements = props.routes
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"NestiaMigrateApiFileProgrammer.js","sourceRoot":"","sources":["../../src/programmers/NestiaMigrateApiFileProgrammer.ts"],"names":[],"mappings":";;;AAAA,2CAAwC;AAKxC,sDAAmD;AACnD,6FAA0F;AAC1F,+FAA4F;AAC5F,mFAAgF;AAEhF,IAAiB,8BAA8B,
|
|
1
|
+
{"version":3,"file":"NestiaMigrateApiFileProgrammer.js","sourceRoot":"","sources":["../../src/programmers/NestiaMigrateApiFileProgrammer.ts"],"names":[],"mappings":";;;AAAA,2CAAwC;AAKxC,sDAAmD;AACnD,6FAA0F;AAC1F,+FAA4F;AAC5F,mFAAgF;AAEhF;;;;;;;;GAQG;AACH,IAAiB,8BAA8B,CAsE9C;AAtED,WAAiB,8BAA8B;IA2B7C;;;;;;;OAOG;IACU,oCAAK,GAAG,CAAC,KAAa,EAAkB,EAAE;QACrD,MAAM,QAAQ,GACZ,IAAI,6DAA6B,EAAE,CAAC;QACtC,MAAM,UAAU,GAAmB,KAAK,CAAC,MAAM;aAC5C,GAAG,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC;YACd,yBAAW,CAAC,OAAO,EAAE;YACrB,uEAAkC,CAAC,KAAK,CAAC;gBACvC,MAAM,EAAE,KAAK,CAAC,MAAM;gBACpB,UAAU,EAAE,KAAK,CAAC,UAAU;gBAC5B,QAAQ;gBACR,KAAK;aACN,CAAC;YACF,yEAAmC,CAAC,KAAK,CAAC;gBACxC,MAAM,EAAE,KAAK,CAAC,MAAM;gBACpB,UAAU,EAAE,KAAK,CAAC,UAAU;gBAC5B,QAAQ;gBACR,KAAK;aACN,CAAC;SACH,CAAC;aACD,IAAI,EAAE,CAAC;QACV,OAAO;YACL,GAAG,QAAQ,CAAC,YAAY,CACtB,CAAC,GAAG,EAAE,EAAE,CAAC,MAAM,KAAK,CAAC,MAAM,CAAC,KAAK,CAAC,SAAS,CAAC,MAAM,CAAC,cAAc,GAAG,EAAE,CACvE;YACD,GAAG,CAAC,GAAG,KAAK,CAAC,QAAQ,CAAC,CAAC,GAAG,CAAC,CAAC,KAAK,EAAE,EAAE,CACnC,iBAAO,CAAC,uBAAuB,CAC7B,SAAS,EACT,KAAK,EACL,iBAAO,CAAC,qBAAqB,CAAC,iBAAO,CAAC,gBAAgB,CAAC,KAAK,CAAC,CAAC,EAC9D,iBAAO,CAAC,mBAAmB,CAAC,KAAK,KAAK,QAAQ,CAAC,CAChD,CACF;YACD,GAAG,UAAU;SACd,CAAC;IACJ,CAAC,CAAC;AACJ,CAAC,EAtEgB,8BAA8B,aAA9B,8BAA8B,GAA9B,8BAA8B,QAsE9C"}
|
|
@@ -2,13 +2,53 @@ import { IHttpMigrateRoute, OpenApi } from "@typia/interface";
|
|
|
2
2
|
import ts from "../internal/ts";
|
|
3
3
|
import { INestiaMigrateConfig } from "../structures/INestiaMigrateConfig";
|
|
4
4
|
import { NestiaMigrateImportProgrammer } from "./NestiaMigrateImportProgrammer";
|
|
5
|
+
/**
|
|
6
|
+
* Generates the function of one route in the SDK.
|
|
7
|
+
*
|
|
8
|
+
* @evidence contracts/common.md#principled-implementation The function has the connection parameter, the path, query, header, and body parameters in positional or keyword form, and its body calls the plain or the encrypted fetcher, or the simulator when the connection asks for it, and copies response headers when the description asks.
|
|
9
|
+
* @evidence contracts/common.md#clear-and-simple-design One entry function, one public parameter builder shared with the simulation programmer, and private helpers for the body and the header directives.
|
|
10
|
+
* @evidence contracts/common.md#prohibited-implementation-shortcuts The output derives from the route and the configuration, and the header directives are read from the documented tags.
|
|
11
|
+
* @evidence contracts/common.md#meaningful-documentation The comment states what is generated.
|
|
12
|
+
*/
|
|
5
13
|
export declare namespace NestiaMigrateApiFunctionProgrammer {
|
|
14
|
+
/**
|
|
15
|
+
* The input of one function: the configuration, the components, the importer,
|
|
16
|
+
* and the route.
|
|
17
|
+
*
|
|
18
|
+
* @evidence contracts/common.md#principled-implementation The record holds exactly what the function generation needs.
|
|
19
|
+
* @evidence contracts/common.md#clear-and-simple-design A flat record.
|
|
20
|
+
* @evidence contracts/common.md#prohibited-implementation-shortcuts It is a type and adds no runtime behavior.
|
|
21
|
+
* @evidence contracts/common.md#meaningful-documentation The comment lists the fields.
|
|
22
|
+
*/
|
|
6
23
|
interface IContext {
|
|
24
|
+
/** Calling convention and optional generated features for this operation. */
|
|
7
25
|
config: INestiaMigrateConfig;
|
|
26
|
+
/** Component schemas used to resolve DTO references. */
|
|
8
27
|
components: OpenApi.IComponents;
|
|
28
|
+
/** File-local import collector shared with the surrounding file writer. */
|
|
9
29
|
importer: NestiaMigrateImportProgrammer;
|
|
30
|
+
/** Analyzed operation, with the accessor chosen for this generation. */
|
|
10
31
|
route: IHttpMigrateRoute;
|
|
11
32
|
}
|
|
33
|
+
/**
|
|
34
|
+
* Returns the exported async function declaration of the route, with its
|
|
35
|
+
* description.
|
|
36
|
+
*
|
|
37
|
+
* @evidence contracts/common.md#principled-implementation The function name is the last accessor segment, the return type is the namespace's response type or void, and the description comes from the route comment with the path, the accessor, and the author tag.
|
|
38
|
+
* @evidence contracts/common.md#clear-and-simple-design One expression over the private parts.
|
|
39
|
+
* @evidence contracts/common.md#prohibited-implementation-shortcuts The names come from the accessor.
|
|
40
|
+
* @evidence contracts/common.md#meaningful-documentation The comment states the result.
|
|
41
|
+
*/
|
|
12
42
|
const write: (ctx: IContext) => ts.FunctionDeclaration;
|
|
43
|
+
/**
|
|
44
|
+
* Returns the parameters of the function: the connection first, then either
|
|
45
|
+
* one `props` parameter in keyword mode or the path, query, and body
|
|
46
|
+
* parameters in positional mode.
|
|
47
|
+
*
|
|
48
|
+
* @evidence contracts/common.md#principled-implementation The connection type carries the route's header type when it has one, keyword mode adds `props` only when there is something to pass, and an optional body is marked optional.
|
|
49
|
+
* @evidence contracts/common.md#clear-and-simple-design One function with the two modes as two returns.
|
|
50
|
+
* @evidence contracts/common.md#prohibited-implementation-shortcuts The shape follows the configuration.
|
|
51
|
+
* @evidence contracts/common.md#meaningful-documentation The comment states the two modes.
|
|
52
|
+
*/
|
|
13
53
|
const writeParameterDeclarations: (ctx: IContext, connectionName?: string) => ts.ParameterDeclaration[];
|
|
14
54
|
}
|
|
@@ -9,8 +9,25 @@ const FilePrinter_1 = require("../utils/FilePrinter");
|
|
|
9
9
|
const RequestBody_1 = require("../utils/RequestBody");
|
|
10
10
|
const SuccessStatus_1 = require("../utils/SuccessStatus");
|
|
11
11
|
const NestiaMigrateSchemaProgrammer_1 = require("./NestiaMigrateSchemaProgrammer");
|
|
12
|
+
/**
|
|
13
|
+
* Generates the function of one route in the SDK.
|
|
14
|
+
*
|
|
15
|
+
* @evidence contracts/common.md#principled-implementation The function has the connection parameter, the path, query, header, and body parameters in positional or keyword form, and its body calls the plain or the encrypted fetcher, or the simulator when the connection asks for it, and copies response headers when the description asks.
|
|
16
|
+
* @evidence contracts/common.md#clear-and-simple-design One entry function, one public parameter builder shared with the simulation programmer, and private helpers for the body and the header directives.
|
|
17
|
+
* @evidence contracts/common.md#prohibited-implementation-shortcuts The output derives from the route and the configuration, and the header directives are read from the documented tags.
|
|
18
|
+
* @evidence contracts/common.md#meaningful-documentation The comment states what is generated.
|
|
19
|
+
*/
|
|
12
20
|
var NestiaMigrateApiFunctionProgrammer;
|
|
13
21
|
(function (NestiaMigrateApiFunctionProgrammer) {
|
|
22
|
+
/**
|
|
23
|
+
* Returns the exported async function declaration of the route, with its
|
|
24
|
+
* description.
|
|
25
|
+
*
|
|
26
|
+
* @evidence contracts/common.md#principled-implementation The function name is the last accessor segment, the return type is the namespace's response type or void, and the description comes from the route comment with the path, the accessor, and the author tag.
|
|
27
|
+
* @evidence contracts/common.md#clear-and-simple-design One expression over the private parts.
|
|
28
|
+
* @evidence contracts/common.md#prohibited-implementation-shortcuts The names come from the accessor.
|
|
29
|
+
* @evidence contracts/common.md#meaningful-documentation The comment states the result.
|
|
30
|
+
*/
|
|
14
31
|
NestiaMigrateApiFunctionProgrammer.write = (ctx) => FilePrinter_1.FilePrinter.description(factory_1.factory.createFunctionDeclaration([
|
|
15
32
|
factory_1.factory.createModifier(factory_1.SyntaxKind.ExportKeyword),
|
|
16
33
|
factory_1.factory.createModifier(factory_1.SyntaxKind.AsyncKeyword),
|
|
@@ -19,6 +36,16 @@ var NestiaMigrateApiFunctionProgrammer;
|
|
|
19
36
|
? "void"
|
|
20
37
|
: `${ctx.route.accessor.at(-1)}.Response`),
|
|
21
38
|
]), factory_1.factory.createBlock(writeBody(ctx), true)), writeDescription(ctx.config, ctx.route));
|
|
39
|
+
/**
|
|
40
|
+
* Returns the parameters of the function: the connection first, then either
|
|
41
|
+
* one `props` parameter in keyword mode or the path, query, and body
|
|
42
|
+
* parameters in positional mode.
|
|
43
|
+
*
|
|
44
|
+
* @evidence contracts/common.md#principled-implementation The connection type carries the route's header type when it has one, keyword mode adds `props` only when there is something to pass, and an optional body is marked optional.
|
|
45
|
+
* @evidence contracts/common.md#clear-and-simple-design One function with the two modes as two returns.
|
|
46
|
+
* @evidence contracts/common.md#prohibited-implementation-shortcuts The shape follows the configuration.
|
|
47
|
+
* @evidence contracts/common.md#meaningful-documentation The comment states the two modes.
|
|
48
|
+
*/
|
|
22
49
|
NestiaMigrateApiFunctionProgrammer.writeParameterDeclarations = (ctx, connectionName) => {
|
|
23
50
|
const connection = IdentifierFactory_1.IdentifierFactory.parameter(connectionName !== null && connectionName !== void 0 ? connectionName : "connection", factory_1.factory.createTypeReferenceNode(ctx.importer.external({
|
|
24
51
|
type: "instance",
|