typia 13.0.0-dev.20260509 → 13.0.0-dev.20260511
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/executable/TypiaGenerateWizard2.mjs +28 -7
- package/lib/executable/TypiaGenerateWizard2.mjs.map +1 -1
- package/lib/executable/generate/ttsc.d.ts +1 -11
- package/lib/executable/generate/ttsc.js +1 -0
- package/lib/executable/generate/ttsc.js.map +1 -1
- package/lib/executable/generate/ttsc2.mjs +4 -0
- package/lib/executable/generate/ttsc2.mjs.map +1 -1
- package/lib/executable/typia.d.ts +1 -4
- package/lib/executable/typia.js +4 -36
- package/lib/executable/typia.js.map +1 -1
- package/lib/executable/typia2.mjs +5 -39
- package/lib/executable/typia2.mjs.map +1 -1
- package/native/adapter/adapter.go +3 -3
- package/native/adapter/cleanup.go +42 -0
- package/native/cmd/ttsc-typia/transform.go +1 -40
- package/native/go.mod +0 -4
- package/native/{shim/printer/shim.go → internal/printer/printer.go} +43 -63
- package/package.json +6 -6
- package/src/executable/typia.ts +1 -1
- package/native/go.work +0 -20
- package/native/go.work.sum +0 -11
- package/native/shim/printer/go.mod +0 -5
- package/native/third_party/ttsc/driver/host.go +0 -31
- package/native/third_party/ttsc/driver/program.go +0 -466
- package/native/third_party/ttsc/driver/rewrite.go +0 -341
- package/native/third_party/ttsc/go.mod +0 -48
- package/native/third_party/ttsc/go.sum +0 -22
- package/native/third_party/ttsc/shim/ast/extra-shim.json +0 -4
- package/native/third_party/ttsc/shim/ast/go.mod +0 -5
- package/native/third_party/ttsc/shim/ast/lint.go +0 -331
- package/native/third_party/ttsc/shim/ast/shim.go +0 -210
- package/native/third_party/ttsc/shim/bundled/extra-shim.json +0 -1
- package/native/third_party/ttsc/shim/bundled/go.mod +0 -5
- package/native/third_party/ttsc/shim/bundled/shim.go +0 -23
- package/native/third_party/ttsc/shim/checker/extra-shim.json +0 -31
- package/native/third_party/ttsc/shim/checker/go.mod +0 -5
- package/native/third_party/ttsc/shim/checker/shim.go +0 -166
- package/native/third_party/ttsc/shim/compiler/extra-shim.json +0 -4
- package/native/third_party/ttsc/shim/compiler/go.mod +0 -5
- package/native/third_party/ttsc/shim/compiler/shim.go +0 -65
- package/native/third_party/ttsc/shim/core/extra-shim.json +0 -4
- package/native/third_party/ttsc/shim/core/go.mod +0 -5
- package/native/third_party/ttsc/shim/core/shim.go +0 -29
- package/native/third_party/ttsc/shim/diagnosticwriter/go.mod +0 -5
- package/native/third_party/ttsc/shim/diagnosticwriter/lint.go +0 -137
- package/native/third_party/ttsc/shim/diagnosticwriter/shim.go +0 -29
- package/native/third_party/ttsc/shim/parser/extra-shim.json +0 -4
- package/native/third_party/ttsc/shim/parser/go.mod +0 -5
- package/native/third_party/ttsc/shim/parser/shim.go +0 -61
- package/native/third_party/ttsc/shim/scanner/extra-shim.json +0 -4
- package/native/third_party/ttsc/shim/scanner/go.mod +0 -5
- package/native/third_party/ttsc/shim/scanner/shim.go +0 -134
- package/native/third_party/ttsc/shim/tsoptions/extra-shim.json +0 -4
- package/native/third_party/ttsc/shim/tsoptions/go.mod +0 -5
- package/native/third_party/ttsc/shim/tsoptions/shim.go +0 -173
- package/native/third_party/ttsc/shim/tspath/extra-shim.json +0 -4
- package/native/third_party/ttsc/shim/tspath/go.mod +0 -5
- package/native/third_party/ttsc/shim/tspath/shim.go +0 -236
- package/native/third_party/ttsc/shim/vfs/cachedvfs/extra-shim.json +0 -4
- package/native/third_party/ttsc/shim/vfs/cachedvfs/go.mod +0 -5
- package/native/third_party/ttsc/shim/vfs/cachedvfs/shim.go +0 -12
- package/native/third_party/ttsc/shim/vfs/extra-shim.json +0 -4
- package/native/third_party/ttsc/shim/vfs/go.mod +0 -5
- package/native/third_party/ttsc/shim/vfs/osvfs/extra-shim.json +0 -4
- package/native/third_party/ttsc/shim/vfs/osvfs/go.mod +0 -5
- package/native/third_party/ttsc/shim/vfs/osvfs/shim.go +0 -13
- package/native/third_party/ttsc/shim/vfs/shim.go +0 -22
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { __exports as TypiaGenerateWizard$
|
|
1
|
+
import { __exports as TypiaGenerateWizard$2 } from '../_virtual/TypiaGenerateWizard.mjs';
|
|
2
2
|
import require$$0 from 'commander';
|
|
3
3
|
import require$$1 from 'fs';
|
|
4
4
|
import require$$2 from 'inquirer';
|
|
@@ -6,7 +6,22 @@ import require$$3 from 'module';
|
|
|
6
6
|
import require$$4 from 'path';
|
|
7
7
|
import require$$5 from 'ttsc';
|
|
8
8
|
|
|
9
|
-
|
|
9
|
+
function _mergeNamespaces(n, m) {
|
|
10
|
+
m.forEach(function (e) {
|
|
11
|
+
e && typeof e !== 'string' && !Array.isArray(e) && Object.keys(e).forEach(function (k) {
|
|
12
|
+
if (k !== 'default' && !(k in n)) {
|
|
13
|
+
var d = Object.getOwnPropertyDescriptor(e, k);
|
|
14
|
+
Object.defineProperty(n, k, d.get ? d : {
|
|
15
|
+
enumerable: true,
|
|
16
|
+
get: function () { return e[k]; }
|
|
17
|
+
});
|
|
18
|
+
}
|
|
19
|
+
});
|
|
20
|
+
});
|
|
21
|
+
return Object.freeze(n);
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
var __awaiter = (TypiaGenerateWizard$2 && TypiaGenerateWizard$2.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
10
25
|
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
11
26
|
return new (P || (P = Promise))(function (resolve, reject) {
|
|
12
27
|
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
@@ -15,11 +30,11 @@ var __awaiter = (TypiaGenerateWizard$1 && TypiaGenerateWizard$1.__awaiter) || fu
|
|
|
15
30
|
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
16
31
|
});
|
|
17
32
|
};
|
|
18
|
-
var __importDefault = (TypiaGenerateWizard$
|
|
33
|
+
var __importDefault = (TypiaGenerateWizard$2 && TypiaGenerateWizard$2.__importDefault) || function (mod) {
|
|
19
34
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
20
35
|
};
|
|
21
|
-
Object.defineProperty(TypiaGenerateWizard$
|
|
22
|
-
var TypiaGenerateWizard_2 = TypiaGenerateWizard$
|
|
36
|
+
Object.defineProperty(TypiaGenerateWizard$2, "__esModule", { value: true });
|
|
37
|
+
var TypiaGenerateWizard_2 = TypiaGenerateWizard$2.TypiaGenerateWizard = void 0;
|
|
23
38
|
const commander_1 = __importDefault(require$$0);
|
|
24
39
|
const fs_1 = __importDefault(require$$1);
|
|
25
40
|
const inquirer_1 = __importDefault(require$$2);
|
|
@@ -279,9 +294,15 @@ var TypiaGenerateWizard;
|
|
|
279
294
|
}
|
|
280
295
|
return String(error);
|
|
281
296
|
}
|
|
282
|
-
})(TypiaGenerateWizard || (TypiaGenerateWizard_2 = TypiaGenerateWizard$
|
|
297
|
+
})(TypiaGenerateWizard || (TypiaGenerateWizard_2 = TypiaGenerateWizard$2.TypiaGenerateWizard = TypiaGenerateWizard = {}));
|
|
283
298
|
const TS_PATTERN = /\.[cm]?tsx?$/;
|
|
284
299
|
const DTS_PATTERN = /\.d\.[cm]?tsx?$/;
|
|
285
300
|
|
|
286
|
-
|
|
301
|
+
var TypiaGenerateWizard$1 = /*#__PURE__*/_mergeNamespaces({
|
|
302
|
+
__proto__: null,
|
|
303
|
+
get TypiaGenerateWizard () { return TypiaGenerateWizard_2; },
|
|
304
|
+
default: TypiaGenerateWizard$2
|
|
305
|
+
}, [TypiaGenerateWizard$2]);
|
|
306
|
+
|
|
307
|
+
export { TypiaGenerateWizard$1 as T, TypiaGenerateWizard_2 as TypiaGenerateWizard, TypiaGenerateWizard$2 as default };
|
|
287
308
|
//# sourceMappingURL=TypiaGenerateWizard2.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TypiaGenerateWizard2.mjs","sources":["TypiaGenerateWizard.js"],"sourcesContent":["\"use strict\";\nvar __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\n return new (P || (P = Promise))(function (resolve, reject) {\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\n step((generator = generator.apply(thisArg, _arguments || [])).next());\n });\n};\nvar __importDefault = (this && this.__importDefault) || function (mod) {\n return (mod && mod.__esModule) ? mod : { \"default\": mod };\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.TypiaGenerateWizard = void 0;\nconst commander_1 = __importDefault(require(\"commander\"));\nconst fs_1 = __importDefault(require(\"fs\"));\nconst inquirer_1 = __importDefault(require(\"inquirer\"));\nconst module_1 = require(\"module\");\nconst path_1 = __importDefault(require(\"path\"));\nconst ttsc_1 = require(\"ttsc\");\nvar TypiaGenerateWizard;\n(function (TypiaGenerateWizard) {\n function generate() {\n return __awaiter(this, void 0, void 0, function* () {\n console.log(\"----------------------------------------\");\n console.log(\" Typia Generate Wizard\");\n console.log(\"----------------------------------------\");\n const options = yield parseArguments();\n yield build(options);\n });\n }\n TypiaGenerateWizard.generate = generate;\n function parseArguments() {\n return __awaiter(this, void 0, void 0, function* () {\n commander_1.default.program.option(\"--input [path]\", \"input directory\");\n commander_1.default.program.option(\"--output [directory]\", \"output directory\");\n commander_1.default.program.option(\"--project [project]\", \"tsconfig.json file location\");\n const questioned = { value: false };\n const prompt = inquirer_1.default.createPromptModule;\n const input = (name) => (message) => __awaiter(this, void 0, void 0, function* () {\n const result = yield prompt()({\n type: \"input\",\n name,\n message,\n default: \"\",\n });\n return result[name];\n });\n const select = (name) => (message) => (choices) => __awaiter(this, void 0, void 0, function* () {\n questioned.value = true;\n return (yield prompt()({\n type: \"list\",\n name: name,\n message: message,\n choices: choices,\n }))[name];\n });\n const configure = () => __awaiter(this, void 0, void 0, function* () {\n const files = yield (yield fs_1.default.promises.readdir(process.cwd())).filter((str) => str.substring(0, 8) === \"tsconfig\" &&\n str.substring(str.length - 5) === \".json\");\n if (files.length === 0)\n throw new URIError(`Unable to find \"tsconfig.json\" file.`);\n else if (files.length === 1)\n return files[0];\n return select(\"tsconfig\")(\"TS Config File\")(files);\n });\n return new Promise((resolve, reject) => {\n commander_1.default.program.action((options) => __awaiter(this, void 0, void 0, function* () {\n var _a, _b, _c;\n try {\n (_a = options.input) !== null && _a !== void 0 ? _a : (options.input = yield input(\"input\")(\"input directory\"));\n (_b = options.output) !== null && _b !== void 0 ? _b : (options.output = yield input(\"output\")(\"output directory\"));\n (_c = options.project) !== null && _c !== void 0 ? _c : (options.project = yield configure());\n if (questioned.value)\n console.log(\"\");\n resolve(options);\n }\n catch (exp) {\n reject(exp);\n }\n }));\n commander_1.default.program.parseAsync().catch(reject);\n });\n });\n }\n function build(location) {\n return __awaiter(this, void 0, void 0, function* () {\n location.input = path_1.default.resolve(location.input);\n location.output = path_1.default.resolve(location.output);\n location.project = path_1.default.resolve(location.project);\n if ((yield isDirectory(location.input)) === false) {\n throw new URIError(\"Error on TypiaGenerateWizard.generate(): input path is not a directory.\");\n }\n else if (fs_1.default.existsSync(location.output) === false) {\n yield fs_1.default.promises.mkdir(location.output, { recursive: true });\n }\n else if ((yield isDirectory(location.output)) === false) {\n const parent = path_1.default.join(location.output, \"..\");\n if ((yield isDirectory(parent)) === false) {\n throw new URIError(\"Error on TypiaGenerateWizard.generate(): output path is not a directory.\");\n }\n yield fs_1.default.promises.mkdir(location.output);\n }\n const files = [];\n yield gather({\n location,\n container: files,\n from: location.input,\n to: location.output,\n });\n const binary = resolveTsgoBinary();\n const cwd = path_1.default.dirname(location.project);\n const transformed = transformProject({\n binary,\n cwd,\n tsconfig: location.project,\n });\n for (const file of files) {\n const relative = path_1.default.relative(location.input, file);\n const target = path_1.default.join(location.output, relative);\n const output = transformed[projectKey(cwd, file)];\n if (output === undefined) {\n throw new URIError(`Error on TypiaGenerateWizard.generate(): no transformed output for ${file}`);\n }\n yield fs_1.default.promises.mkdir(path_1.default.dirname(target), { recursive: true });\n yield fs_1.default.promises.writeFile(target, formatOutput(output), \"utf8\");\n }\n });\n }\n function transformProject(props) {\n const result = new ttsc_1.TtscCompiler({\n binary: props.binary,\n cwd: props.cwd,\n tsconfig: props.tsconfig,\n }).transform();\n if (result.type === \"success\") {\n return result.typescript;\n }\n if (result.type === \"failure\") {\n throw new URIError(`Error on TypiaGenerateWizard.generate(): ${formatDiagnostics(result.diagnostics)}`);\n }\n throw new URIError(`Error on TypiaGenerateWizard.generate(): ${formatUnknownError(result.error)}`);\n }\n function resolveTsgoBinary() {\n const explicit = process.env.TTSC_TSGO_BINARY;\n if (explicit !== undefined && explicit.length !== 0) {\n if (path_1.default.isAbsolute(explicit) && fs_1.default.existsSync(explicit)) {\n return explicit;\n }\n throw new URIError(`Error on TypiaGenerateWizard.generate(): TTSC_TSGO_BINARY must be an existing absolute path: ${explicit}`);\n }\n const packageRoot = resolveTypiaPackageRoot();\n const manifest = resolveFromRoots(\"@typescript/native-preview/package.json\", [packageRoot, path_1.default.resolve(packageRoot, \"..\", \"..\")]);\n if (manifest === null) {\n throw new URIError(\"Error on TypiaGenerateWizard.generate(): unable to resolve @typescript/native-preview from the typia package or workspace root.\");\n }\n const platform = `@typescript/native-preview-${process.platform}-${process.arch}`;\n const platformManifest = (0, module_1.createRequire)(manifest).resolve(`${platform}/package.json`);\n const binary = path_1.default.join(path_1.default.dirname(platformManifest), \"lib\", process.platform === \"win32\" ? \"tsgo.exe\" : \"tsgo\");\n if (fs_1.default.existsSync(binary) === false) {\n throw new URIError(`Error on TypiaGenerateWizard.generate(): TypeScript-Go executable not found: ${binary}`);\n }\n return binary;\n }\n function resolveTypiaPackageRoot() {\n const current = path_1.default.resolve(__dirname);\n for (const directory of [\n path_1.default.resolve(current, \"..\", \"..\"),\n path_1.default.resolve(current, \"..\"),\n ]) {\n const file = path_1.default.join(directory, \"package.json\");\n if (fs_1.default.existsSync(file) === false) {\n continue;\n }\n try {\n const pack = JSON.parse(fs_1.default.readFileSync(file, \"utf8\"));\n if (pack.name === \"typia\") {\n return directory;\n }\n }\n catch (_a) {\n continue;\n }\n }\n const resolved = resolveFromRoots(\"typia/package.json\", [\n process.cwd(),\n current,\n ]);\n if (resolved === null) {\n throw new URIError(\"Error on TypiaGenerateWizard.generate(): unable to resolve typia package root.\");\n }\n return path_1.default.dirname(resolved);\n }\n function resolveFromRoots(request, roots) {\n for (const root of roots) {\n try {\n return require.resolve(request, { paths: [root] });\n }\n catch (_a) {\n continue;\n }\n }\n return null;\n }\n function isDirectory(current) {\n return __awaiter(this, void 0, void 0, function* () {\n const stat = yield fs_1.default.promises.stat(current);\n return stat.isDirectory();\n });\n }\n function gather(props) {\n return __awaiter(this, void 0, void 0, function* () {\n if (props.from === props.location.output)\n return;\n if (fs_1.default.existsSync(props.to) === false) {\n yield fs_1.default.promises.mkdir(props.to);\n }\n for (const file of yield fs_1.default.promises.readdir(props.from)) {\n const next = path_1.default.join(props.from, file);\n const stat = yield fs_1.default.promises.stat(next);\n if (stat.isDirectory()) {\n yield gather({\n location: props.location,\n container: props.container,\n from: next,\n to: path_1.default.join(props.to, file),\n });\n continue;\n }\n if (isSupportedExtension(file)) {\n props.container.push(next);\n }\n }\n });\n }\n function isSupportedExtension(filename) {\n return TS_PATTERN.test(filename) && !DTS_PATTERN.test(filename);\n }\n function formatOutput(output) {\n return output.startsWith(\"// @ts-nocheck\")\n ? output\n : `// @ts-nocheck\\n${output}`;\n }\n function projectKey(root, file) {\n return path_1.default.relative(root, file).replace(/\\\\/g, \"/\");\n }\n function formatDiagnostics(diagnostics) {\n return diagnostics.length === 0\n ? \"transformation failed\"\n : diagnostics\n .map((diag) => { var _a, _b; return [\n (_a = diag.file) !== null && _a !== void 0 ? _a : \"ttsc\",\n diag.line === undefined\n ? undefined\n : `${diag.line}:${(_b = diag.character) !== null && _b !== void 0 ? _b : 1}`,\n diag.messageText,\n ]\n .filter((part) => part !== undefined && part !== \"\")\n .join(\": \"); })\n .join(\"\\n\");\n }\n function formatUnknownError(error) {\n if (error instanceof Error) {\n return error.message;\n }\n if (typeof error === \"object\" &&\n error !== null &&\n \"message\" in error &&\n typeof error.message === \"string\") {\n return error.message;\n }\n return String(error);\n }\n})(TypiaGenerateWizard || (exports.TypiaGenerateWizard = TypiaGenerateWizard = {}));\nconst TS_PATTERN = /\\.[cm]?tsx?$/;\nconst DTS_PATTERN = /\\.d\\.[cm]?tsx?$/;\n//# sourceMappingURL=TypiaGenerateWizard.js.map"],"names":["this","TypiaGenerateWizard_1"],"mappings":";;;;;;;;AACA,IAAI,SAAS,GAAG,CAACA,qBAAI,IAAIA,qBAAI,CAAC,SAAS,KAAK,UAAU,OAAO,EAAE,UAAU,EAAE,CAAC,EAAE,SAAS,EAAE;AACzF,IAAI,SAAS,KAAK,CAAC,KAAK,EAAE,EAAE,OAAO,KAAK,YAAY,CAAC,GAAG,KAAK,GAAG,IAAI,CAAC,CAAC,UAAU,OAAO,EAAE,EAAE,OAAO,CAAC,KAAK,CAAC,CAAC,CAAA,CAAE,CAAC,CAAC,CAAA;AAC9G,IAAI,OAAO,KAAK,CAAC,KAAK,CAAC,GAAG,OAAO,CAAC,EAAE,UAAU,OAAO,EAAE,MAAM,EAAE;AAC/D,QAAQ,SAAS,SAAS,CAAC,KAAK,EAAE,EAAE,IAAI,EAAE,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,CAAA,CAAE,CAAC,OAAO,CAAC,EAAE,EAAE,MAAM,CAAC,CAAC,CAAC,CAAC,CAAA,CAAE,CAAA;AACjG,QAAQ,SAAS,QAAQ,CAAC,KAAK,EAAE,EAAE,IAAI,EAAE,IAAI,CAAC,SAAS,CAAC,OAAO,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,CAAA,CAAE,CAAC,OAAO,CAAC,EAAE,EAAE,MAAM,CAAC,CAAC,CAAC,CAAC,C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CAAC;AAChG,gBAAgB,IAAI,CAAC,WAAW;AAChC;AACA,iBAAiB,MAAM,CAAC,CAAC,IAAI,KAAK,IAAI,KAAK,SAAS,IAAI,IAAI,KAAK,EAAE;AACnE,iBAAiB,IAAI,CAAC,IAAI,CAAC,CAAC,CAAA,CAAE;AAC9B,iBAAiB,IAAI,CAAC,IAAI,CAAC;AAC3B,IAAA;AACA,IAAI,SAAS,kBAAkB,CAAC,KAAK,EAAE;AACvC,QAAQ,IAAI,KAAK,YAAY,KAAK,EAAE;AACpC,YAAY,OAAO,KAAK,CAAC,OAAO;AAChC,QAAA;AACA,QAAQ,IAAI,OAAO,KAAK,KAAK,QAAQ;AACrC,YAAY,KAAK,KAAK,IAAI;AAC1B,YAAY,SAAS,IAAI,KAAK;AAC9B,YAAY,OAAO,KAAK,CAAC,OAAO,KAAK,QAAQ,EAAE;AAC/C,YAAY,OAAO,KAAK,CAAC,OAAO;AAChC,QAAA;AACA,QAAQ,OAAO,MAAM,CAAC,KAAK,CAAC;AAC5B,IAAA;AACA,CAAC,EAAE,mBAAmB,KAAK,qBAAA,GAAAA,qBAAA,CAAA,mBAA2B,GAAG,mBAAmB,GAAG,EAAE,CAAC,CAAC;AACnF,MAAM,UAAU,GAAG,cAAc;AACjC,MAAM,WAAW,GAAG,iBAAiB;;;;"}
|
|
1
|
+
{"version":3,"file":"TypiaGenerateWizard2.mjs","sources":["TypiaGenerateWizard.js"],"sourcesContent":["\"use strict\";\nvar __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\n return new (P || (P = Promise))(function (resolve, reject) {\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\n step((generator = generator.apply(thisArg, _arguments || [])).next());\n });\n};\nvar __importDefault = (this && this.__importDefault) || function (mod) {\n return (mod && mod.__esModule) ? mod : { \"default\": mod };\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.TypiaGenerateWizard = void 0;\nconst commander_1 = __importDefault(require(\"commander\"));\nconst fs_1 = __importDefault(require(\"fs\"));\nconst inquirer_1 = __importDefault(require(\"inquirer\"));\nconst module_1 = require(\"module\");\nconst path_1 = __importDefault(require(\"path\"));\nconst ttsc_1 = require(\"ttsc\");\nvar TypiaGenerateWizard;\n(function (TypiaGenerateWizard) {\n function generate() {\n return __awaiter(this, void 0, void 0, function* () {\n console.log(\"----------------------------------------\");\n console.log(\" Typia Generate Wizard\");\n console.log(\"----------------------------------------\");\n const options = yield parseArguments();\n yield build(options);\n });\n }\n TypiaGenerateWizard.generate = generate;\n function parseArguments() {\n return __awaiter(this, void 0, void 0, function* () {\n commander_1.default.program.option(\"--input [path]\", \"input directory\");\n commander_1.default.program.option(\"--output [directory]\", \"output directory\");\n commander_1.default.program.option(\"--project [project]\", \"tsconfig.json file location\");\n const questioned = { value: false };\n const prompt = inquirer_1.default.createPromptModule;\n const input = (name) => (message) => __awaiter(this, void 0, void 0, function* () {\n const result = yield prompt()({\n type: \"input\",\n name,\n message,\n default: \"\",\n });\n return result[name];\n });\n const select = (name) => (message) => (choices) => __awaiter(this, void 0, void 0, function* () {\n questioned.value = true;\n return (yield prompt()({\n type: \"list\",\n name: name,\n message: message,\n choices: choices,\n }))[name];\n });\n const configure = () => __awaiter(this, void 0, void 0, function* () {\n const files = yield (yield fs_1.default.promises.readdir(process.cwd())).filter((str) => str.substring(0, 8) === \"tsconfig\" &&\n str.substring(str.length - 5) === \".json\");\n if (files.length === 0)\n throw new URIError(`Unable to find \"tsconfig.json\" file.`);\n else if (files.length === 1)\n return files[0];\n return select(\"tsconfig\")(\"TS Config File\")(files);\n });\n return new Promise((resolve, reject) => {\n commander_1.default.program.action((options) => __awaiter(this, void 0, void 0, function* () {\n var _a, _b, _c;\n try {\n (_a = options.input) !== null && _a !== void 0 ? _a : (options.input = yield input(\"input\")(\"input directory\"));\n (_b = options.output) !== null && _b !== void 0 ? _b : (options.output = yield input(\"output\")(\"output directory\"));\n (_c = options.project) !== null && _c !== void 0 ? _c : (options.project = yield configure());\n if (questioned.value)\n console.log(\"\");\n resolve(options);\n }\n catch (exp) {\n reject(exp);\n }\n }));\n commander_1.default.program.parseAsync().catch(reject);\n });\n });\n }\n function build(location) {\n return __awaiter(this, void 0, void 0, function* () {\n location.input = path_1.default.resolve(location.input);\n location.output = path_1.default.resolve(location.output);\n location.project = path_1.default.resolve(location.project);\n if ((yield isDirectory(location.input)) === false) {\n throw new URIError(\"Error on TypiaGenerateWizard.generate(): input path is not a directory.\");\n }\n else if (fs_1.default.existsSync(location.output) === false) {\n yield fs_1.default.promises.mkdir(location.output, { recursive: true });\n }\n else if ((yield isDirectory(location.output)) === false) {\n const parent = path_1.default.join(location.output, \"..\");\n if ((yield isDirectory(parent)) === false) {\n throw new URIError(\"Error on TypiaGenerateWizard.generate(): output path is not a directory.\");\n }\n yield fs_1.default.promises.mkdir(location.output);\n }\n const files = [];\n yield gather({\n location,\n container: files,\n from: location.input,\n to: location.output,\n });\n const binary = resolveTsgoBinary();\n const cwd = path_1.default.dirname(location.project);\n const transformed = transformProject({\n binary,\n cwd,\n tsconfig: location.project,\n });\n for (const file of files) {\n const relative = path_1.default.relative(location.input, file);\n const target = path_1.default.join(location.output, relative);\n const output = transformed[projectKey(cwd, file)];\n if (output === undefined) {\n throw new URIError(`Error on TypiaGenerateWizard.generate(): no transformed output for ${file}`);\n }\n yield fs_1.default.promises.mkdir(path_1.default.dirname(target), { recursive: true });\n yield fs_1.default.promises.writeFile(target, formatOutput(output), \"utf8\");\n }\n });\n }\n function transformProject(props) {\n const result = new ttsc_1.TtscCompiler({\n binary: props.binary,\n cwd: props.cwd,\n tsconfig: props.tsconfig,\n }).transform();\n if (result.type === \"success\") {\n return result.typescript;\n }\n if (result.type === \"failure\") {\n throw new URIError(`Error on TypiaGenerateWizard.generate(): ${formatDiagnostics(result.diagnostics)}`);\n }\n throw new URIError(`Error on TypiaGenerateWizard.generate(): ${formatUnknownError(result.error)}`);\n }\n function resolveTsgoBinary() {\n const explicit = process.env.TTSC_TSGO_BINARY;\n if (explicit !== undefined && explicit.length !== 0) {\n if (path_1.default.isAbsolute(explicit) && fs_1.default.existsSync(explicit)) {\n return explicit;\n }\n throw new URIError(`Error on TypiaGenerateWizard.generate(): TTSC_TSGO_BINARY must be an existing absolute path: ${explicit}`);\n }\n const packageRoot = resolveTypiaPackageRoot();\n const manifest = resolveFromRoots(\"@typescript/native-preview/package.json\", [packageRoot, path_1.default.resolve(packageRoot, \"..\", \"..\")]);\n if (manifest === null) {\n throw new URIError(\"Error on TypiaGenerateWizard.generate(): unable to resolve @typescript/native-preview from the typia package or workspace root.\");\n }\n const platform = `@typescript/native-preview-${process.platform}-${process.arch}`;\n const platformManifest = (0, module_1.createRequire)(manifest).resolve(`${platform}/package.json`);\n const binary = path_1.default.join(path_1.default.dirname(platformManifest), \"lib\", process.platform === \"win32\" ? \"tsgo.exe\" : \"tsgo\");\n if (fs_1.default.existsSync(binary) === false) {\n throw new URIError(`Error on TypiaGenerateWizard.generate(): TypeScript-Go executable not found: ${binary}`);\n }\n return binary;\n }\n function resolveTypiaPackageRoot() {\n const current = path_1.default.resolve(__dirname);\n for (const directory of [\n path_1.default.resolve(current, \"..\", \"..\"),\n path_1.default.resolve(current, \"..\"),\n ]) {\n const file = path_1.default.join(directory, \"package.json\");\n if (fs_1.default.existsSync(file) === false) {\n continue;\n }\n try {\n const pack = JSON.parse(fs_1.default.readFileSync(file, \"utf8\"));\n if (pack.name === \"typia\") {\n return directory;\n }\n }\n catch (_a) {\n continue;\n }\n }\n const resolved = resolveFromRoots(\"typia/package.json\", [\n process.cwd(),\n current,\n ]);\n if (resolved === null) {\n throw new URIError(\"Error on TypiaGenerateWizard.generate(): unable to resolve typia package root.\");\n }\n return path_1.default.dirname(resolved);\n }\n function resolveFromRoots(request, roots) {\n for (const root of roots) {\n try {\n return require.resolve(request, { paths: [root] });\n }\n catch (_a) {\n continue;\n }\n }\n return null;\n }\n function isDirectory(current) {\n return __awaiter(this, void 0, void 0, function* () {\n const stat = yield fs_1.default.promises.stat(current);\n return stat.isDirectory();\n });\n }\n function gather(props) {\n return __awaiter(this, void 0, void 0, function* () {\n if (props.from === props.location.output)\n return;\n if (fs_1.default.existsSync(props.to) === false) {\n yield fs_1.default.promises.mkdir(props.to);\n }\n for (const file of yield fs_1.default.promises.readdir(props.from)) {\n const next = path_1.default.join(props.from, file);\n const stat = yield fs_1.default.promises.stat(next);\n if (stat.isDirectory()) {\n yield gather({\n location: props.location,\n container: props.container,\n from: next,\n to: path_1.default.join(props.to, file),\n });\n continue;\n }\n if (isSupportedExtension(file)) {\n props.container.push(next);\n }\n }\n });\n }\n function isSupportedExtension(filename) {\n return TS_PATTERN.test(filename) && !DTS_PATTERN.test(filename);\n }\n function formatOutput(output) {\n return output.startsWith(\"// @ts-nocheck\")\n ? output\n : `// @ts-nocheck\\n${output}`;\n }\n function projectKey(root, file) {\n return path_1.default.relative(root, file).replace(/\\\\/g, \"/\");\n }\n function formatDiagnostics(diagnostics) {\n return diagnostics.length === 0\n ? \"transformation failed\"\n : diagnostics\n .map((diag) => { var _a, _b; return [\n (_a = diag.file) !== null && _a !== void 0 ? _a : \"ttsc\",\n diag.line === undefined\n ? undefined\n : `${diag.line}:${(_b = diag.character) !== null && _b !== void 0 ? _b : 1}`,\n diag.messageText,\n ]\n .filter((part) => part !== undefined && part !== \"\")\n .join(\": \"); })\n .join(\"\\n\");\n }\n function formatUnknownError(error) {\n if (error instanceof Error) {\n return error.message;\n }\n if (typeof error === \"object\" &&\n error !== null &&\n \"message\" in error &&\n typeof error.message === \"string\") {\n return error.message;\n }\n return String(error);\n }\n})(TypiaGenerateWizard || (exports.TypiaGenerateWizard = TypiaGenerateWizard = {}));\nconst TS_PATTERN = /\\.[cm]?tsx?$/;\nconst DTS_PATTERN =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vC,QAAQ,IAAI,KAAK,YAAY,KAAK,EAAE;AACpC,YAAY,OAAO,KAAK,CAAC,OAAO;AAChC,QAAA;AACA,QAAQ,IAAI,OAAO,KAAK,KAAK,QAAQ;AACrC,YAAY,KAAK,KAAK,IAAI;AAC1B,YAAY,SAAS,IAAI,KAAK;AAC9B,YAAY,OAAO,KAAK,CAAC,OAAO,KAAK,QAAQ,EAAE;AAC/C,YAAY,OAAO,KAAK,CAAC,OAAO;AAChC,QAAA;AACA,QAAQ,OAAO,MAAM,CAAC,KAAK,CAAC;AAC5B,IAAA;AACA,CAAC,EAAE,mBAAmB,KAAK,qBAAA,GAAAA,qBAAA,CAAA,mBAA2B,GAAG,mBAAmB,GAAG,EAAE,CAAC,CAAC;AACnF,MAAM,UAAU,GAAG,cAAc;AACjC,MAAM,WAAW,GAAG,iBAAiB;;;;;;;;;;"}
|
|
@@ -1,11 +1 @@
|
|
|
1
|
-
|
|
2
|
-
declare const fs: typeof import("node:fs");
|
|
3
|
-
declare const path: typeof import("node:path");
|
|
4
|
-
declare const packageRoot: string;
|
|
5
|
-
declare const nativeProject: string;
|
|
6
|
-
declare const nativeEntrypoint: string;
|
|
7
|
-
declare const command: string;
|
|
8
|
-
declare const invocationCwd: string;
|
|
9
|
-
declare const argv: string[];
|
|
10
|
-
declare const hasSourceEntrypoint: boolean;
|
|
11
|
-
declare function needsCwd(commandName: string): boolean;
|
|
1
|
+
export {};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ttsc.js","sourceRoot":"","sources":["../../../src/executable/generate/ttsc.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"ttsc.js","sourceRoot":"","sources":["../../../src/executable/generate/ttsc.ts"],"names":[],"mappings":";;;AAAA,MAAM,EAAE,SAAS,EAAE,GACjB,OAAO,CAAC,oBAAoB,CAAwC,CAAC;AACvE,MAAM,EAAE,GAAG,OAAO,CAAC,SAAS,CAA6B,CAAC;AAC1D,MAAM,IAAI,GAAG,OA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AAI,CAAC,SAAS,aAAa,EAAE,CAAC,CAAC;AACtC,CAAC;AAED,MAAM,mBAAmB,GAAG,EAAE,CAAC,UAAU,CAAC,gBAAgB,CAAC,CAAC;AAE5D,IAAI,CAAC,mBAAmB,EAAE,CAAC;IACzB,OAAO,CAAC,MAAM,CAAC,KAAK,CAClB,2GAA2G,CAC5G,CAAC;IACF,OAAO,CAAC,QAAQ,GAAG,CAAC,CAAC;AACvB,CAAC;KAAM,CAAC;IACN,MAAM,MAAM,GAAG,SAAS,CAAC,OAAO,EAAE,CAAC,KAAK,EAAE,kBAAkB,EAAE,GAAG,IAAI,CAAC,EAAE;QACtE,GAAG,EAAE,aAAa;QAClB,GAAG,EAAE,OAAO,CAAC,GAAG;QAChB,KAAK,EAAE,SAAS;QAChB,WAAW,EAAE,IAAI;KAClB,CAAC,CAAC;IACH,IAAI,MAAM,CAAC,KAAK,EAAE,CAAC;QACjB,OAAO,CAAC,MAAM,CAAC,KAAK,CAClB,mDAAmD,OAAO,KAAK,MAAM,CAAC,KAAK,CAAC,OAAO,IAAI,CACxF,CAAC;QACF,OAAO,CAAC,QAAQ,GAAG,CAAC,CAAC;IACvB,CAAC;SAAM,CAAC;QACN,OAAO,CAAC,QAAQ,SAAG,MAAM,CAAC,MAAM,mCAAI,CAAC,CAAC;IACxC,CAAC;AACH,CAAC;AAED,SAAS,QAAQ,CAAC,WAAmB;IACnC,OAAO,CACL,WAAW,KAAK,OAAO;QACvB,WAAW,KAAK,OAAO;QACvB,WAAW,KAAK,WAAW;QAC3B,WAAW,KAAK,IAAI;QACpB,WAAW,KAAK,WAAW,CAC5B,CAAC;AACJ,CAAC"}
|
|
@@ -1,8 +1,10 @@
|
|
|
1
|
+
import { __exports as ttsc } from '../../_virtual/ttsc.mjs';
|
|
1
2
|
import require$$0 from 'node:child_process';
|
|
2
3
|
import require$$1 from 'node:fs';
|
|
3
4
|
import require$$2 from 'node:path';
|
|
4
5
|
|
|
5
6
|
var _a, _b;
|
|
7
|
+
Object.defineProperty(ttsc, "__esModule", { value: true });
|
|
6
8
|
const { spawnSync } = require$$0;
|
|
7
9
|
const fs = require$$1;
|
|
8
10
|
const path = require$$2;
|
|
@@ -49,4 +51,6 @@ function needsCwd(commandName) {
|
|
|
49
51
|
commandName === "-p" ||
|
|
50
52
|
commandName === "--project");
|
|
51
53
|
}
|
|
54
|
+
|
|
55
|
+
export { ttsc as default };
|
|
52
56
|
//# sourceMappingURL=ttsc2.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ttsc2.mjs","sources":["ttsc.js"],"sourcesContent":["\"use strict\";\nvar _a, _b;\nconst { spawnSync } = require(\"node:child_process\");\nconst fs = require(\"node:fs\");\nconst path = require(\"node:path\");\nconst packageRoot = path.resolve(path.dirname(path.resolve((_a = process.argv[1]) !== null && _a !== void 0 ? _a : \"\")), \"..\", \"..\", \"..\");\nconst nativeProject = path.resolve(packageRoot, \"native\");\nconst nativeEntrypoint = path.resolve(nativeProject, \"cmd\", \"ttsc-typia\", \"main.go\");\nconst command = process.platform === \"win32\" ? \"go.exe\" : \"go\";\nconst invocationCwd = process.cwd();\nconst argv = [...process.argv.slice(2)];\nif (process.env.TYPIA_TTSC_TRANSFORM_OUTPUT === \"ts\" &&\n argv[0] === \"transform\" &&\n !argv.some((value) => value === \"--output\" || value.startsWith(\"--output=\"))) {\n argv.push(\"--output=ts\");\n}\nif (argv.length > 0 &&\n needsCwd(argv[0]) &&\n !argv.some((value) => value === \"--cwd\" || value.startsWith(\"--cwd=\"))) {\n argv.push(`--cwd=${invocationCwd}`);\n}\nconst hasSourceEntrypoint = fs.existsSync(nativeEntrypoint);\nif (!hasSourceEntrypoint) {\n process.stderr.write(\"ttsc-typia: backend source is missing. Expected native/cmd/ttsc-typia/main.go inside the typia package.\\n\");\n process.exitCode = 1;\n}\nelse {\n const result = spawnSync(command, [\"run\", \"./cmd/ttsc-typia\", ...argv], {\n cwd: nativeProject,\n env: process.env,\n stdio: \"inherit\",\n windowsHide: true,\n });\n if (result.error) {\n process.stderr.write(`ttsc-typia: failed to launch source backend via ${command}: ${result.error.message}\\n`);\n process.exitCode = 1;\n }\n else {\n process.exitCode = (_b = result.status) !== null && _b !== void 0 ? _b : 1;\n }\n}\nfunction needsCwd(commandName) {\n return (commandName === \"build\" ||\n commandName === \"check\" ||\n commandName === \"transform\" ||\n commandName === \"-p\" ||\n commandName === \"--project\");\n}\n//# sourceMappingURL=ttsc.js.map"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"ttsc2.mjs","sources":["ttsc.js"],"sourcesContent":["\"use strict\";\nvar _a, _b;\nObject.defineProperty(exports, \"__esModule\", { value: true });\nconst { spawnSync } = require(\"node:child_process\");\nconst fs = require(\"node:fs\");\nconst path = require(\"node:path\");\nconst packageRoot = path.resolve(path.dirname(path.resolve((_a = process.argv[1]) !== null && _a !== void 0 ? _a : \"\")), \"..\", \"..\", \"..\");\nconst nativeProject = path.resolve(packageRoot, \"native\");\nconst nativeEntrypoint = path.resolve(nativeProject, \"cmd\", \"ttsc-typia\", \"main.go\");\nconst command = process.platform === \"win32\" ? \"go.exe\" : \"go\";\nconst invocationCwd = process.cwd();\nconst argv = [...process.argv.slice(2)];\nif (process.env.TYPIA_TTSC_TRANSFORM_OUTPUT === \"ts\" &&\n argv[0] === \"transform\" &&\n !argv.some((value) => value === \"--output\" || value.startsWith(\"--output=\"))) {\n argv.push(\"--output=ts\");\n}\nif (argv.length > 0 &&\n needsCwd(argv[0]) &&\n !argv.some((value) => value === \"--cwd\" || value.startsWith(\"--cwd=\"))) {\n argv.push(`--cwd=${invocationCwd}`);\n}\nconst hasSourceEntrypoint = fs.existsSync(nativeEntrypoint);\nif (!hasSourceEntrypoint) {\n process.stderr.write(\"ttsc-typia: backend source is missing. Expected native/cmd/ttsc-typia/main.go inside the typia package.\\n\");\n process.exitCode = 1;\n}\nelse {\n const result = spawnSync(command, [\"run\", \"./cmd/ttsc-typia\", ...argv], {\n cwd: nativeProject,\n env: process.env,\n stdio: \"inherit\",\n windowsHide: true,\n });\n if (result.error) {\n process.stderr.write(`ttsc-typia: failed to launch source backend via ${command}: ${result.error.message}\\n`);\n process.exitCode = 1;\n }\n else {\n process.exitCode = (_b = result.status) !== null && _b !== void 0 ? _b : 1;\n }\n}\nfunction needsCwd(commandName) {\n return (commandName === \"build\" ||\n commandName === \"check\" ||\n commandName === \"transform\" ||\n commandName === \"-p\" ||\n commandName === \"--project\");\n}\n//# sourceMappingURL=ttsc.js.map"],"names":[],"mappings":";;;;;AACA,IAAI,EAAE,EAAE,EAAE;AACV,MAAM,CAAC,cAAc,CAAC,IAAO,EAAE,YAAY,EAAE,EAAE,KAAK,EAAE,IAAI,EAAE,CAAC;AAC7D,MAAM,EAAE,SAAS,EAAE,GAAG,UAA6B;AACnD,MAAM,EAAE,GAAG,UAAkB;AAC7B,MAAM,IAAI,GAAG,UAAoB;AACjC,MAAM,WAAW,GAAG,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC,EAAE,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,MAAM,IAAI,IAAI,EAAE,KAAK,MAAM,GAAG,EAAE,GAAG,EAAE,CAAC,CAAC,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,CAAC;AAC1I,MAAM,aAAa,GAAG,IAAI,CAAC,OAAO,CAAC,WAAW,EAAE,QAAQ,CAAC;AACzD,MAAM,gBAAgB,GAAG,IAAI,CAAC,OAAO,CAAC,aAAa,EAAE,KAAK,EAAE,YAAY,EAAE,SAAS,CAAC;AACpF,MAAM,OAAO,GAAG,OAAO,CAAC,QAAQ,KAAK,OAAO,GAAG,QAAQ,GAAG,IAAI;AAC9D,MAAM,aAAa,GAAG,OAAO,CAAC,GAAG,EAAE;AACnC,MAAM,IAAI,GAAG,CAAC,GAAG,OAAO,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC;AACvC,IAAI,OAAO,CAAC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,OAAO,CAAC,EAAE,CAAC,CAAC;AACrH,QAAQ,OAAO,CAAC,QAAQ,GAAG,CAAC;AAC5B,IAAA;AACA,SAAS;AACT,QAAQ,OAAO,CAAC,QAAQ,GAAG,CAAC,EAAE,GAAG,MAAM,CAAC,MAAM,MAAM,IAAI,IAAI,EAAE,KAAK,MAAM,GAAG,EAAE,GAAG,CAAC;AAClF,IAAA;AACA;AACA,SAAS,QAAQ,CAAC,WAAW,EAAE;AAC/B,IAAI,QAAQ,WAAW,KAAK,OAAO;AACnC,QAAQ,WAAW,KAAK,OAAO;AAC/B,QAAQ,WAAW,KAAK,WAAW;AACnC,QAAQ,WAAW,KAAK,IAAI;AAC5B,QAAQ,WAAW,KAAK,WAAW;AACnC;;;;"}
|
|
@@ -1,5 +1,2 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
|
|
3
|
-
declare const halt: (desc: string) => never;
|
|
4
|
-
declare const loadNativePreview: () => void;
|
|
5
|
-
declare const main: () => Promise<void>;
|
|
2
|
+
export {};
|
package/lib/executable/typia.js
CHANGED
|
@@ -1,38 +1,5 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
"use strict";
|
|
3
|
-
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
4
|
-
if (k2 === undefined) k2 = k;
|
|
5
|
-
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
6
|
-
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
7
|
-
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
8
|
-
}
|
|
9
|
-
Object.defineProperty(o, k2, desc);
|
|
10
|
-
}) : (function(o, m, k, k2) {
|
|
11
|
-
if (k2 === undefined) k2 = k;
|
|
12
|
-
o[k2] = m[k];
|
|
13
|
-
}));
|
|
14
|
-
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
15
|
-
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
16
|
-
}) : function(o, v) {
|
|
17
|
-
o["default"] = v;
|
|
18
|
-
});
|
|
19
|
-
var __importStar = (this && this.__importStar) || (function () {
|
|
20
|
-
var ownKeys = function(o) {
|
|
21
|
-
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
22
|
-
var ar = [];
|
|
23
|
-
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
24
|
-
return ar;
|
|
25
|
-
};
|
|
26
|
-
return ownKeys(o);
|
|
27
|
-
};
|
|
28
|
-
return function (mod) {
|
|
29
|
-
if (mod && mod.__esModule) return mod;
|
|
30
|
-
var result = {};
|
|
31
|
-
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
32
|
-
__setModuleDefault(result, mod);
|
|
33
|
-
return result;
|
|
34
|
-
};
|
|
35
|
-
})();
|
|
36
3
|
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
37
4
|
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
38
5
|
return new (P || (P = Promise))(function (resolve, reject) {
|
|
@@ -42,6 +9,7 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
42
9
|
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
43
10
|
});
|
|
44
11
|
};
|
|
12
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
45
13
|
const USAGE = `Wrong command has been detected. Use like below:
|
|
46
14
|
|
|
47
15
|
npx typia generate
|
|
@@ -72,8 +40,8 @@ const loadNativePreview = () => {
|
|
|
72
40
|
};
|
|
73
41
|
const main = () => __awaiter(void 0, void 0, void 0, function* () {
|
|
74
42
|
try {
|
|
75
|
-
yield
|
|
76
|
-
yield
|
|
43
|
+
yield import("inquirer");
|
|
44
|
+
yield import("commander");
|
|
77
45
|
}
|
|
78
46
|
catch (_a) {
|
|
79
47
|
halt(`typia has not been installed. Run "npm i typia" before.`);
|
|
@@ -81,7 +49,7 @@ const main = () => __awaiter(void 0, void 0, void 0, function* () {
|
|
|
81
49
|
const type = process.argv[2];
|
|
82
50
|
if (type === "generate") {
|
|
83
51
|
loadNativePreview();
|
|
84
|
-
const { TypiaGenerateWizard } = yield
|
|
52
|
+
const { TypiaGenerateWizard } = yield import("./TypiaGenerateWizard.js");
|
|
85
53
|
yield TypiaGenerateWizard.generate();
|
|
86
54
|
}
|
|
87
55
|
else
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"typia.js","sourceRoot":"","sources":["../../src/executable/typia.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"typia.js","sourceRoot":"","sources":["../../src/executable/typia.ts"],"names":[],"mappings":";;;;;;;;;;;;AACA,MAAM,KAAK,GAAG;;;;;;;CAOb,CAAC;AAEF,MAAM,IAAI,GAAG,CAAC,IAAY,EAAS,EAAE;IACnC,OAAO,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC;IACpB,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC;AACnB,CAAC,CAAC;AAEF,MAAM,iBAAiB,GAAG,GAAS,EAAE;IACnC,MAAM,SAAS,GAAwB;QACrC,GAAG,EAAE,CACH,OAAO,CAAC,OAAO,CAAC,yCAAyC,EAAE;YACzD,KAAK,EAAE,CAAC,OAAO,CAAC,GAAG,EAAE,CAAC;SACvB,CAAC;QACJ,GAAG,EAAE,CAAC,OAAO,CAAC,OAAO,CAAC,yCAAyC,CAAC;KACjE,CAAC;IACF,KAAK,MAAM,OAAO,IAAI,SAAS,EAAE,CAAC;QAChC,IAAI,CAAC;YACH,OAAO,EAAE,CAAC;YACV,OAAO;QACT,CAAC;mBAAO,CAAC,CAAA,CAAC;IACZ,CAAC;IACD,IAAI,CACF,sGAAsG,CACvG,CAAC;AACJ,CAAC,CAAC;AAEF,MAAM,IAAI,GAAG,GAAwB,EAAE;IACrC,IAAI,CAAC;QACH,MAAM,MAAM,CAAC,UAAU,CAAC,CAAC;QACzB,MAAM,MAAM,CAAC,WAAW,CAAC,CAAC;IAC5B,CAAC;eAAO,CAAC;QACP,IAAI,CAAC,yDAAyD,CAAC,CAAC;IAClE,CAAC;IAED,MAAM,IAAI,GAAuB,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;IACjD,IAAI,IAAI,KAAK,UAAU,EAAE,CAAC;QACxB,iBAAiB,EAAE,CAAC;QACpB,MAAM,EAAE,mBAAmB,EAAE,GAAG,MAAM,MAAM,CAAC,0BAA0B,CAAC,CAAC;QACzE,MAAM,mBAAmB,CAAC,QAAQ,EAAE,CAAC;IACvC,CAAC;;QAAM,IAAI,CAAC,KAAK,CAAC,CAAC;AACrB,CAAC,CAAA,CAAC;AACF,IAAI,EAAE,CAAC,KAAK,CAAC,CAAC,GAAG,EAAE,EAAE;IACnB,OAAO,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;IACnB,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC;AACnB,CAAC,CAAC,CAAC"}
|
|
@@ -1,40 +1,5 @@
|
|
|
1
1
|
import { __exports as typia } from '../_virtual/typia.mjs';
|
|
2
|
-
import './TypiaGenerateWizard2.mjs';
|
|
3
|
-
import { __exports as TypiaGenerateWizard } from '../_virtual/TypiaGenerateWizard.mjs';
|
|
4
2
|
|
|
5
|
-
var __createBinding = (typia && typia.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
6
|
-
if (k2 === undefined) k2 = k;
|
|
7
|
-
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
8
|
-
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
9
|
-
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
10
|
-
}
|
|
11
|
-
Object.defineProperty(o, k2, desc);
|
|
12
|
-
}) : (function(o, m, k, k2) {
|
|
13
|
-
if (k2 === undefined) k2 = k;
|
|
14
|
-
o[k2] = m[k];
|
|
15
|
-
}));
|
|
16
|
-
var __setModuleDefault = (typia && typia.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
17
|
-
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
18
|
-
}) : function(o, v) {
|
|
19
|
-
o["default"] = v;
|
|
20
|
-
});
|
|
21
|
-
var __importStar = (typia && typia.__importStar) || (function () {
|
|
22
|
-
var ownKeys = function(o) {
|
|
23
|
-
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
24
|
-
var ar = [];
|
|
25
|
-
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
26
|
-
return ar;
|
|
27
|
-
};
|
|
28
|
-
return ownKeys(o);
|
|
29
|
-
};
|
|
30
|
-
return function (mod) {
|
|
31
|
-
if (mod && mod.__esModule) return mod;
|
|
32
|
-
var result = {};
|
|
33
|
-
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
34
|
-
__setModuleDefault(result, mod);
|
|
35
|
-
return result;
|
|
36
|
-
};
|
|
37
|
-
})();
|
|
38
3
|
var __awaiter = (typia && typia.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
39
4
|
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
40
5
|
return new (P || (P = Promise))(function (resolve, reject) {
|
|
@@ -44,6 +9,7 @@ var __awaiter = (typia && typia.__awaiter) || function (thisArg, _arguments, P,
|
|
|
44
9
|
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
45
10
|
});
|
|
46
11
|
};
|
|
12
|
+
Object.defineProperty(typia, "__esModule", { value: true });
|
|
47
13
|
const USAGE = `Wrong command has been detected. Use like below:
|
|
48
14
|
|
|
49
15
|
npx typia generate
|
|
@@ -74,8 +40,8 @@ const loadNativePreview = () => {
|
|
|
74
40
|
};
|
|
75
41
|
const main = () => __awaiter(void 0, void 0, void 0, function* () {
|
|
76
42
|
try {
|
|
77
|
-
yield
|
|
78
|
-
yield
|
|
43
|
+
yield import('inquirer');
|
|
44
|
+
yield import('commander');
|
|
79
45
|
}
|
|
80
46
|
catch (_a) {
|
|
81
47
|
halt(`typia has not been installed. Run "npm i typia" before.`);
|
|
@@ -83,8 +49,8 @@ const main = () => __awaiter(void 0, void 0, void 0, function* () {
|
|
|
83
49
|
const type = process.argv[2];
|
|
84
50
|
if (type === "generate") {
|
|
85
51
|
loadNativePreview();
|
|
86
|
-
const { TypiaGenerateWizard
|
|
87
|
-
yield TypiaGenerateWizard
|
|
52
|
+
const { TypiaGenerateWizard } = yield import('./TypiaGenerateWizard2.mjs').then(function (n) { return n.T; });
|
|
53
|
+
yield TypiaGenerateWizard.generate();
|
|
88
54
|
}
|
|
89
55
|
else
|
|
90
56
|
halt(USAGE);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"typia2.mjs","sources":["typia.js"],"sourcesContent":["#!/usr/bin/env node\n\"use strict\";\nvar
|
|
1
|
+
{"version":3,"file":"typia2.mjs","sources":["typia.js"],"sourcesContent":["#!/usr/bin/env node\n\"use strict\";\nvar __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\n return new (P || (P = Promise))(function (resolve, reject) {\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\n step((generator = generator.apply(thisArg, _arguments || [])).next());\n });\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nconst USAGE = `Wrong command has been detected. Use like below:\n\n npx typia generate \n --input {directory} \\\\\n --output {directory}\n\n --npx typia generate --input src/templates --output src/functional\n`;\nconst halt = (desc) => {\n console.error(desc);\n process.exit(-1);\n};\nconst loadNativePreview = () => {\n const resolvers = [\n () => require.resolve(\"@typescript/native-preview/package.json\", {\n paths: [process.cwd()],\n }),\n () => require.resolve(\"@typescript/native-preview/package.json\"),\n ];\n for (const resolve of resolvers) {\n try {\n resolve();\n return;\n }\n catch (_a) { }\n }\n halt(`@typescript/native-preview has not been installed. Run \"npm i -D @typescript/native-preview\" before.`);\n};\nconst main = () => __awaiter(void 0, void 0, void 0, function* () {\n try {\n yield import(\"inquirer\");\n yield import(\"commander\");\n }\n catch (_a) {\n halt(`typia has not been installed. Run \"npm i typia\" before.`);\n }\n const type = process.argv[2];\n if (type === \"generate\") {\n loadNativePreview();\n const { TypiaGenerateWizard } = yield import(\"./TypiaGenerateWizard.js\");\n yield TypiaGenerateWizard.generate();\n }\n else\n halt(USAGE);\n});\nmain().catch((exp) => {\n console.error(exp);\n process.exit(-1);\n});\n//# sourceMappingURL=typia.js.map"],"names":["this"],"mappings":";;AAEA,IAAI,SAAS,GAAG,CAACA,KAAI,IAAIA,KAAI,CAAC,SAAS,KAAK,UAAU,OAAO,EAAE,UAAU,EAAE,CAAC,EAAE,SAAS,EAAE;AACzF,IAAI,SAAS,KAAK,CAAC,KAAK,EAAE,EAAE,OAAO,KAAK,YAAY,CAAC,GAAG,KAAK,GAAG,IAAI,CAAC,CAAC,UAAU,OAAO,EAAE,EAAE,OAAO,CAAC,KAAK,CAAC,CAAC,CAAA,CAAE,CAAC,CAAC,CAAA;AAC9G,IAAI,OAAO,KAAK,CAAC,KAAK,CAAC,GAAG,OAAO,CAAC,EAAE,UAAU,OAAO,EAAE,MAAM,EAAE;AAC/D,QAAQ,SAAS,SAAS,CAAC,KAAK,EAAE,EAAE,IAAI,EAAE,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,CAAA,CAAE,CAAC,OAAO,CAAC,EAAE,EAAE,MAAM,CAAC,CAAC,CAAC,CAAC,CAAA,CAAE,CAAA;AACjG,QAAQ,SAAS,QAAQ,CAAC,KAAK,EAAE,EAAE,IAAI,EAAE,IAAI,CAAC,SAAS,CAAC,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AA;AACA,IAAI,IAAI,CAAC,CAAC,oGAAoG,CAAC,CAAC;AAChH,CAAC;AACD,MAAM,IAAI,GAAG,MAAM,SAAS,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,aAAa;AAClE,IAAI,IAAI;AACR,QAAQ,MAAM,OAAO,UAAU,CAAC;AAChC,QAAQ,MAAM,OAAO,WAAW,CAAC;AACjC,IAAA;AACA,IAAI,OAAO,EAAE,EAAE;AACf,QAAQ,IAAI,CAAC,CAAC,uDAAuD,CAAC,CAAC;AACvE,IAAA;AACA,IAAI,MAAM,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC;AAChC,IAAI,IAAI,IAAI,KAAK,UAAU,EAAE;AAC7B,QAAQ,iBAAiB,EAAE;AAC3B,QAAQ,MAAM,EAAE,mBAAmB,EAAE,GAAG,MAAM,OAAO,4BAA0B,oCAAC;AAChF,QAAQ,MAAM,mBAAmB,CAAC,QAAQ,EAAE;AAC5C,IAAA;AACA;AACA,QAAQ,IAAI,CAAC,KAAK,CAAC;AACnB,CAAC,CAAC;AACF,IAAI,EAAE,CAAC,KAAK,CAAC,CAAC,GAAG,KAAK;AACtB,IAAI,OAAO,CAAC,KAAK,CAAC,GAAG,CAAC;AACtB,IAAI,OAAO,CAAC,IAAI,CAAC,EAAE,CAAC;AACpB,CAAC,CAAC;;;;"}
|
|
@@ -8,10 +8,10 @@ import (
|
|
|
8
8
|
"strings"
|
|
9
9
|
|
|
10
10
|
shimast "github.com/microsoft/typescript-go/shim/ast"
|
|
11
|
-
shimprinter "github.com/microsoft/typescript-go/shim/printer"
|
|
12
11
|
"github.com/samchon/ttsc/packages/ttsc/driver"
|
|
13
12
|
nativecontext "github.com/samchon/typia/packages/typia/native/core/context"
|
|
14
13
|
nativeprogrammers "github.com/samchon/typia/packages/typia/native/core/programmers"
|
|
14
|
+
nativeprinter "github.com/samchon/typia/packages/typia/native/internal/printer"
|
|
15
15
|
nativetransform "github.com/samchon/typia/packages/typia/native/transform"
|
|
16
16
|
)
|
|
17
17
|
|
|
@@ -87,13 +87,13 @@ func emitCallWithOptions(program *driver.Program, site CallSite, plugin PluginOp
|
|
|
87
87
|
return "", false, nil
|
|
88
88
|
}
|
|
89
89
|
if preserveTypes {
|
|
90
|
-
return cleanupPrintedExpression(
|
|
90
|
+
return cleanupPrintedExpression(nativeprinter.EmitPreservingTypesWithIdentifierSubstitutions(
|
|
91
91
|
node,
|
|
92
92
|
site.File,
|
|
93
93
|
nil,
|
|
94
94
|
)), true, nil
|
|
95
95
|
}
|
|
96
|
-
return cleanupPrintedExpression(
|
|
96
|
+
return cleanupPrintedExpression(nativeprinter.EmitWithIdentifierSubstitutions(
|
|
97
97
|
node,
|
|
98
98
|
site.File,
|
|
99
99
|
identifierSubstitutionsForEmit(program, site.File),
|
|
@@ -31,6 +31,48 @@ func CleanupTransformedText(text string) string {
|
|
|
31
31
|
return injectRuntimeImports(text)
|
|
32
32
|
}
|
|
33
33
|
|
|
34
|
+
func CleanupTypeScriptTransformText(text string) string {
|
|
35
|
+
text = CleanupTransformedText(text)
|
|
36
|
+
text = normalizeParenthesizedTypeAnnotations(text)
|
|
37
|
+
text = regexp.MustCompile(`(?m)^import type \{([^{}\n]+)\} from`).ReplaceAllStringFunc(text, func(line string) string {
|
|
38
|
+
return regexp.MustCompile(`^import type \{\s*([^{}\n]+?)\s*\} from`).ReplaceAllString(line, "import type { $1 } from")
|
|
39
|
+
})
|
|
40
|
+
text = regexp.MustCompile(`(?m)(^import [^\n]+;\n)\n+(const |let |var |export )`).ReplaceAllString(text, "$1$2")
|
|
41
|
+
text = strings.ReplaceAll(text, "=(() =>", "= (() =>")
|
|
42
|
+
text = strings.ReplaceAll(text, ": (any) =>", ": any =>")
|
|
43
|
+
text = strings.ReplaceAll(text, ": (boolean) =>", ": boolean =>")
|
|
44
|
+
text = regexp.MustCompile(`input is \(([A-Za-z_$][A-Za-z0-9_$.]*)\)`).ReplaceAllString(text, "input is $1")
|
|
45
|
+
text = strings.ReplaceAll(text, "return (success ? ", "return success ? ")
|
|
46
|
+
text = strings.ReplaceAll(text, "}) as any;", "} as any;")
|
|
47
|
+
text = strings.ReplaceAll(text, "(() => {\n const ", "(() => { const ")
|
|
48
|
+
text = strings.ReplaceAll(text, "(() => {\n let ", "(() => { let ")
|
|
49
|
+
text = strings.ReplaceAll(text, "(() => {\n return ", "(() => { return ")
|
|
50
|
+
text = strings.ReplaceAll(text, ";\n const ", "; const ")
|
|
51
|
+
text = strings.ReplaceAll(text, ";\n let ", "; let ")
|
|
52
|
+
text = strings.ReplaceAll(text, ";\n return ", "; return ")
|
|
53
|
+
text = strings.ReplaceAll(text, "\n };\n})()", "\n}; })()")
|
|
54
|
+
text = strings.ReplaceAll(text, "\n });\n})()", "\n}); })()")
|
|
55
|
+
text = strings.ReplaceAll(text, "\n }); let ", "\n}); let ")
|
|
56
|
+
text = strings.ReplaceAll(text, ";\n})()", "; })()")
|
|
57
|
+
text = strings.ReplaceAll(text, "\n ", "\n ")
|
|
58
|
+
text = regexp.MustCompile(`\n\n([A-Za-z_$][A-Za-z0-9_$]*\([^;\n]*\);?)`).ReplaceAllString(text, "\n$1")
|
|
59
|
+
trimmed := strings.TrimRight(text, " \t\r\n")
|
|
60
|
+
if strings.HasSuffix(trimmed, ")") && !strings.HasSuffix(trimmed, ";") {
|
|
61
|
+
return trimmed + ";\n"
|
|
62
|
+
}
|
|
63
|
+
if text != "" && !strings.HasSuffix(text, "\n") {
|
|
64
|
+
return text + "\n"
|
|
65
|
+
}
|
|
66
|
+
return text
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
func normalizeParenthesizedTypeAnnotations(text string) string {
|
|
70
|
+
typeAtom := `([A-Za-z_$][A-Za-z0-9_$.]*(<[^()\n;{}]*>)?)`
|
|
71
|
+
text = regexp.MustCompile(`: \(`+typeAtom+`\)(\s*=>)`).ReplaceAllString(text, ": $1$3")
|
|
72
|
+
text = regexp.MustCompile(`\| \((null|undefined)\)`).ReplaceAllString(text, "| $1")
|
|
73
|
+
return text
|
|
74
|
+
}
|
|
75
|
+
|
|
34
76
|
type unusedImportPattern struct {
|
|
35
77
|
regex *regexp.Regexp
|
|
36
78
|
alias func(string) string
|
|
@@ -7,7 +7,6 @@ import (
|
|
|
7
7
|
"fmt"
|
|
8
8
|
"os"
|
|
9
9
|
"path/filepath"
|
|
10
|
-
"regexp"
|
|
11
10
|
"sort"
|
|
12
11
|
"strings"
|
|
13
12
|
|
|
@@ -373,45 +372,7 @@ func applySourceRewrites(source string, rewrites []transformSourceRewrite) (stri
|
|
|
373
372
|
}
|
|
374
373
|
|
|
375
374
|
func cleanupTypeScriptTransformText(text string) string {
|
|
376
|
-
|
|
377
|
-
text = normalizeParenthesizedTypeAnnotations(text)
|
|
378
|
-
text = regexp.MustCompile(`(?m)^import type \{([^{}\n]+)\} from`).ReplaceAllStringFunc(text, func(line string) string {
|
|
379
|
-
return regexp.MustCompile(`^import type \{\s*([^{}\n]+?)\s*\} from`).ReplaceAllString(line, "import type { $1 } from")
|
|
380
|
-
})
|
|
381
|
-
text = regexp.MustCompile(`(?m)(^import [^\n]+;\n)\n+(const |let |var |export )`).ReplaceAllString(text, "$1$2")
|
|
382
|
-
text = strings.ReplaceAll(text, "=(() =>", "= (() =>")
|
|
383
|
-
text = strings.ReplaceAll(text, ": (any) =>", ": any =>")
|
|
384
|
-
text = strings.ReplaceAll(text, ": (boolean) =>", ": boolean =>")
|
|
385
|
-
text = regexp.MustCompile(`input is \(([A-Za-z_$][A-Za-z0-9_$.]*)\)`).ReplaceAllString(text, "input is $1")
|
|
386
|
-
text = strings.ReplaceAll(text, "return (success ? ", "return success ? ")
|
|
387
|
-
text = strings.ReplaceAll(text, "}) as any;", "} as any;")
|
|
388
|
-
text = strings.ReplaceAll(text, "(() => {\n const ", "(() => { const ")
|
|
389
|
-
text = strings.ReplaceAll(text, "(() => {\n let ", "(() => { let ")
|
|
390
|
-
text = strings.ReplaceAll(text, "(() => {\n return ", "(() => { return ")
|
|
391
|
-
text = strings.ReplaceAll(text, ";\n const ", "; const ")
|
|
392
|
-
text = strings.ReplaceAll(text, ";\n let ", "; let ")
|
|
393
|
-
text = strings.ReplaceAll(text, ";\n return ", "; return ")
|
|
394
|
-
text = strings.ReplaceAll(text, "\n };\n})()", "\n}; })()")
|
|
395
|
-
text = strings.ReplaceAll(text, "\n });\n})()", "\n}); })()")
|
|
396
|
-
text = strings.ReplaceAll(text, "\n }); let ", "\n}); let ")
|
|
397
|
-
text = strings.ReplaceAll(text, ";\n})()", "; })()")
|
|
398
|
-
text = strings.ReplaceAll(text, "\n ", "\n ")
|
|
399
|
-
text = regexp.MustCompile(`\n\n([A-Za-z_$][A-Za-z0-9_$]*\([^;\n]*\);?)`).ReplaceAllString(text, "\n$1")
|
|
400
|
-
trimmed := strings.TrimRight(text, " \t\r\n")
|
|
401
|
-
if strings.HasSuffix(trimmed, ")") && !strings.HasSuffix(trimmed, ";") {
|
|
402
|
-
return trimmed + ";\n"
|
|
403
|
-
}
|
|
404
|
-
if text != "" && !strings.HasSuffix(text, "\n") {
|
|
405
|
-
return text + "\n"
|
|
406
|
-
}
|
|
407
|
-
return text
|
|
408
|
-
}
|
|
409
|
-
|
|
410
|
-
func normalizeParenthesizedTypeAnnotations(text string) string {
|
|
411
|
-
typeAtom := `([A-Za-z_$][A-Za-z0-9_$.]*(<[^()\n;{}]*>)?)`
|
|
412
|
-
text = regexp.MustCompile(`: \(`+typeAtom+`\)(\s*=>)`).ReplaceAllString(text, ": $1$3")
|
|
413
|
-
text = regexp.MustCompile(`\| \((null|undefined)\)`).ReplaceAllString(text, "| $1")
|
|
414
|
-
return text
|
|
375
|
+
return typiaadapter.CleanupTypeScriptTransformText(text)
|
|
415
376
|
}
|
|
416
377
|
|
|
417
378
|
func sourceFileKey(cwd string, file string) string {
|
package/native/go.mod
CHANGED
|
@@ -2,10 +2,6 @@ module github.com/samchon/typia/packages/typia/native
|
|
|
2
2
|
|
|
3
3
|
go 1.26
|
|
4
4
|
|
|
5
|
-
replace github.com/microsoft/typescript-go/shim/printer => ./shim/printer
|
|
6
|
-
|
|
7
|
-
replace github.com/samchon/ttsc/packages/ttsc => ./third_party/ttsc
|
|
8
|
-
|
|
9
5
|
require (
|
|
10
6
|
github.com/microsoft/typescript-go/shim/ast v0.0.0
|
|
11
7
|
github.com/microsoft/typescript-go/shim/checker v0.0.0
|