@nestia/migrate 14.0.2 → 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.
Files changed (32) hide show
  1. package/lib/_virtual/_rolldown/runtime.mjs +6 -1
  2. package/lib/bundles/NEST_TEMPLATE.js +1 -1
  3. package/lib/bundles/NEST_TEMPLATE.mjs +1 -1
  4. package/lib/bundles/SDK_TEMPLATE.js +1 -1
  5. package/lib/bundles/SDK_TEMPLATE.mjs +1 -1
  6. package/lib/executable/NestiaMigrateCommander.d.ts +4 -2
  7. package/lib/executable/NestiaMigrateCommander.js +5 -3
  8. package/lib/executable/NestiaMigrateCommander.js.map +1 -1
  9. package/lib/executable/NestiaMigrateCommander.mjs +2 -2
  10. package/lib/executable/NestiaMigrateInquirer.d.ts +6 -4
  11. package/lib/executable/NestiaMigrateInquirer.js +16 -13
  12. package/lib/executable/NestiaMigrateInquirer.js.map +1 -1
  13. package/lib/executable/NestiaMigrateInquirer.mjs +4 -3
  14. package/lib/executable/TemplateBundleCache.d.ts +23 -0
  15. package/lib/executable/TemplateBundleCache.js +60 -0
  16. package/lib/executable/TemplateBundleCache.js.map +1 -0
  17. package/lib/executable/TemplateBundleCache.mjs +39 -0
  18. package/lib/executable/TemplateBundleCache.mjs.map +1 -0
  19. package/lib/executable/bundle.d.ts +1 -0
  20. package/lib/executable/bundle.js +404 -0
  21. package/lib/executable/bundle.js.map +1 -0
  22. package/lib/executable/bundle.mjs +324 -0
  23. package/lib/executable/bundle.mjs.map +1 -0
  24. package/lib/package.mjs +55 -0
  25. package/lib/package.mjs.map +1 -0
  26. package/package.json +3 -3
  27. package/src/bundles/NEST_TEMPLATE.ts +1 -1
  28. package/src/bundles/SDK_TEMPLATE.ts +1 -1
  29. package/src/executable/NestiaMigrateCommander.ts +5 -3
  30. package/src/executable/NestiaMigrateInquirer.ts +9 -6
  31. package/src/executable/TemplateBundleCache.ts +65 -0
  32. package/src/executable/{bundle.js → bundle.ts} +110 -43
@@ -1,5 +1,6 @@
1
1
  //#region \0rolldown/runtime.js
2
2
  var __defProp = Object.defineProperty;
3
+ var __commonJSMin = (cb, mod) => () => (mod || (cb((mod = { exports: {} }).exports, mod), cb = null), mod.exports);
3
4
  var __exportAll = (all, no_symbols) => {
4
5
  let target = {};
5
6
  for (var name in all) __defProp(target, name, {
@@ -9,5 +10,9 @@ var __exportAll = (all, no_symbols) => {
9
10
  if (!no_symbols) __defProp(target, Symbol.toStringTag, { value: "Module" });
10
11
  return target;
11
12
  };
13
+ var __require = /* @__PURE__ */ ((x) => typeof require !== "undefined" ? require : typeof Proxy !== "undefined" ? new Proxy(x, { get: (a, b) => (typeof require !== "undefined" ? require : a)[b] }) : x)(function(x) {
14
+ if (typeof require !== "undefined") return require.apply(this, arguments);
15
+ throw Error("Calling `require` for \"" + x + "\" in an environment that doesn't expose the `require` function. See https://rolldown.rs/in-depth/bundling-cjs#require-external-modules for more details.");
16
+ });
12
17
  //#endregion
13
- export { __exportAll };
18
+ export { __commonJSMin, __exportAll, __require };
@@ -52,7 +52,7 @@ exports.NEST_TEMPLATE = {
52
52
  "packages/backend/test/webpack.ts": "import { DynamicExecutor } from \"@nestia/e2e\";\nimport cp from \"node:child_process\";\nimport { sleep_for } from \"tstl\";\n\nimport { MyConfiguration } from \"../src/MyConfiguration\";\nimport { MyGlobal } from \"../src/MyGlobal\";\nimport { TestAutomation } from \"./helpers/TestAutomation\";\nimport { TestAutomationStdio } from \"./helpers/TestAutomationStdio\";\n\nconst wait = async (): Promise<void> => {\n while (true)\n try {\n await fetch(`http://localhost:${MyConfiguration.API_PORT()}/dsafdsafsd`);\n return;\n } catch (exp) {\n await sleep_for(100);\n }\n};\n\nconst main = async (): Promise<void> => {\n MyGlobal.testing = true;\n\n const report: DynamicExecutor.IReport = await TestAutomation.execute({\n open: async () => {\n const backend: cp.ChildProcess = cp.fork(\n `${MyConfiguration.ROOT}/dist/server.js`,\n {\n cwd: `${MyConfiguration.ROOT}/dist`,\n },\n );\n await wait();\n return backend;\n },\n close: async (backend) => {\n backend.kill();\n },\n options: await TestAutomationStdio.getOptions(),\n onComplete: TestAutomationStdio.onComplete,\n });\n TestAutomationStdio.report(report);\n};\nmain().catch((exp: unknown) => {\n console.log(exp);\n process.exit(-1);\n});\n",
53
53
  "packages/backend/tsconfig.json": "{\n \"extends\": \"../../config/tsconfig.json\",\n \"compilerOptions\": {\n \"outDir\": \"lib\",\n \"rootDir\": \"src\",\n \"experimentalDecorators\": true,\n \"emitDecoratorMetadata\": true\n },\n \"include\": [\"src\"]\n}\n",
54
54
  "packages/backend/webpack.config.js": "const path = require(\"path\");\n\nconst CopyWebpackPlugin = require(\"copy-webpack-plugin\");\nconst WriteFilePlugin = require(\"write-file-webpack-plugin\");\nconst { IgnorePlugin } = require(\"webpack\");\n\nconst lazyImports = [\n \"@modelcontextprotocol/sdk\",\n \"@fastify/static\",\n \"@fastify/view\",\n \"@nestjs/microservices\",\n \"@nestjs/websockets\",\n \"class-transformer\",\n \"class-validator\",\n];\n\n// @reference https://tech-blog.s-yoshiki.com/entry/297\nmodule.exports = {\n // CUSTOMIZE HERE\n entry: {\n server: \"./lib/executable/server.js\",\n },\n output: {\n path: path.join(__dirname, \"dist\"),\n filename: \"[name].js\",\n },\n optimization: {\n minimize: true,\n },\n\n // JUST KEEP THEM\n mode: \"production\",\n target: \"node\",\n plugins: [\n new CopyWebpackPlugin({\n patterns: [\n {\n from: \".env\",\n to: \"[name][ext]\",\n },\n ],\n }),\n new WriteFilePlugin(),\n new IgnorePlugin({\n checkResource: (resource) => {\n if (lazyImports.some((modulo) => resource.startsWith(modulo))) {\n try {\n require.resolve(resource);\n } catch (err) {\n return true;\n }\n }\n return false;\n },\n }),\n ],\n};\n",
55
- "pnpm-workspace.yaml": "packages:\n - \"config\"\n - \"packages/*\"\ncatalogs:\n samchon:\n \"@nestia/benchmark\": ^14.0.2\n \"@nestia/core\": ^14.0.2\n \"@nestia/e2e\": ^14.0.2\n \"@nestia/fetcher\": ^14.0.2\n \"@nestia/sdk\": ^14.0.2\n nestia: ^14.0.2\n tgrid: ^1.2.1\n tstl: ^3.0.0\n typia: 15.0.0\n rolldown:\n rolldown: ^1.1.5\n utils:\n rimraf: ^6.1.3\n uuid: ^13.0.0\n typescript:\n \"@ttsc/lint\": ^0.18.2\n \"@ttsc/paths\": ^0.18.2\n \"@ttsc/unplugin\": ^0.28.1\n ttsc: ^0.28.1\n typescript: ^7.0.2\n",
55
+ "pnpm-workspace.yaml": "packages:\n - \"config\"\n - \"packages/*\"\ncatalogs:\n samchon:\n \"@nestia/benchmark\": ^14.0.3\n \"@nestia/core\": ^14.0.3\n \"@nestia/e2e\": ^14.0.3\n \"@nestia/fetcher\": ^14.0.3\n \"@nestia/sdk\": ^14.0.3\n nestia: ^14.0.3\n tgrid: ^1.2.1\n tstl: ^3.0.0\n typia: 15.0.0\n rolldown:\n rolldown: ^1.1.5\n utils:\n rimraf: ^6.1.3\n uuid: ^13.0.0\n typescript:\n \"@ttsc/lint\": ^0.18.2\n \"@ttsc/paths\": ^0.18.2\n \"@ttsc/unplugin\": ^0.28.1\n ttsc: ^0.28.1\n typescript: ^7.0.2\n",
56
56
  "typos.toml": "[default]\nlocale = 'en-us'\nextend-ignore-re = [\n \"(?Rm)^.*(<!--|#|//)\\\\s*spellchecker:disable-line(-->|\\n)?$\",\n \"(?s)(<!--|#|//)\\\\s*spellchecker:off\\\\s*(-->|\\n).*?(<!--|#|//)\\\\s*spellchecker:on\",\n]\n\n[default.extend-words]\nJeongho = \"Jeongho\"\nNam = \"Nam\"\ntypia = \"typia\"\n\n[files]\nextend-exclude = [\"*.json\"]"
57
57
  };
58
58
  //# sourceMappingURL=NEST_TEMPLATE.js.map
@@ -50,7 +50,7 @@ const NEST_TEMPLATE = {
50
50
  "packages/backend/test/webpack.ts": "import { DynamicExecutor } from \"@nestia/e2e\";\nimport cp from \"node:child_process\";\nimport { sleep_for } from \"tstl\";\n\nimport { MyConfiguration } from \"../src/MyConfiguration\";\nimport { MyGlobal } from \"../src/MyGlobal\";\nimport { TestAutomation } from \"./helpers/TestAutomation\";\nimport { TestAutomationStdio } from \"./helpers/TestAutomationStdio\";\n\nconst wait = async (): Promise<void> => {\n while (true)\n try {\n await fetch(`http://localhost:${MyConfiguration.API_PORT()}/dsafdsafsd`);\n return;\n } catch (exp) {\n await sleep_for(100);\n }\n};\n\nconst main = async (): Promise<void> => {\n MyGlobal.testing = true;\n\n const report: DynamicExecutor.IReport = await TestAutomation.execute({\n open: async () => {\n const backend: cp.ChildProcess = cp.fork(\n `${MyConfiguration.ROOT}/dist/server.js`,\n {\n cwd: `${MyConfiguration.ROOT}/dist`,\n },\n );\n await wait();\n return backend;\n },\n close: async (backend) => {\n backend.kill();\n },\n options: await TestAutomationStdio.getOptions(),\n onComplete: TestAutomationStdio.onComplete,\n });\n TestAutomationStdio.report(report);\n};\nmain().catch((exp: unknown) => {\n console.log(exp);\n process.exit(-1);\n});\n",
51
51
  "packages/backend/tsconfig.json": "{\n \"extends\": \"../../config/tsconfig.json\",\n \"compilerOptions\": {\n \"outDir\": \"lib\",\n \"rootDir\": \"src\",\n \"experimentalDecorators\": true,\n \"emitDecoratorMetadata\": true\n },\n \"include\": [\"src\"]\n}\n",
52
52
  "packages/backend/webpack.config.js": "const path = require(\"path\");\n\nconst CopyWebpackPlugin = require(\"copy-webpack-plugin\");\nconst WriteFilePlugin = require(\"write-file-webpack-plugin\");\nconst { IgnorePlugin } = require(\"webpack\");\n\nconst lazyImports = [\n \"@modelcontextprotocol/sdk\",\n \"@fastify/static\",\n \"@fastify/view\",\n \"@nestjs/microservices\",\n \"@nestjs/websockets\",\n \"class-transformer\",\n \"class-validator\",\n];\n\n// @reference https://tech-blog.s-yoshiki.com/entry/297\nmodule.exports = {\n // CUSTOMIZE HERE\n entry: {\n server: \"./lib/executable/server.js\",\n },\n output: {\n path: path.join(__dirname, \"dist\"),\n filename: \"[name].js\",\n },\n optimization: {\n minimize: true,\n },\n\n // JUST KEEP THEM\n mode: \"production\",\n target: \"node\",\n plugins: [\n new CopyWebpackPlugin({\n patterns: [\n {\n from: \".env\",\n to: \"[name][ext]\",\n },\n ],\n }),\n new WriteFilePlugin(),\n new IgnorePlugin({\n checkResource: (resource) => {\n if (lazyImports.some((modulo) => resource.startsWith(modulo))) {\n try {\n require.resolve(resource);\n } catch (err) {\n return true;\n }\n }\n return false;\n },\n }),\n ],\n};\n",
53
- "pnpm-workspace.yaml": "packages:\n - \"config\"\n - \"packages/*\"\ncatalogs:\n samchon:\n \"@nestia/benchmark\": ^14.0.2\n \"@nestia/core\": ^14.0.2\n \"@nestia/e2e\": ^14.0.2\n \"@nestia/fetcher\": ^14.0.2\n \"@nestia/sdk\": ^14.0.2\n nestia: ^14.0.2\n tgrid: ^1.2.1\n tstl: ^3.0.0\n typia: 15.0.0\n rolldown:\n rolldown: ^1.1.5\n utils:\n rimraf: ^6.1.3\n uuid: ^13.0.0\n typescript:\n \"@ttsc/lint\": ^0.18.2\n \"@ttsc/paths\": ^0.18.2\n \"@ttsc/unplugin\": ^0.28.1\n ttsc: ^0.28.1\n typescript: ^7.0.2\n",
53
+ "pnpm-workspace.yaml": "packages:\n - \"config\"\n - \"packages/*\"\ncatalogs:\n samchon:\n \"@nestia/benchmark\": ^14.0.3\n \"@nestia/core\": ^14.0.3\n \"@nestia/e2e\": ^14.0.3\n \"@nestia/fetcher\": ^14.0.3\n \"@nestia/sdk\": ^14.0.3\n nestia: ^14.0.3\n tgrid: ^1.2.1\n tstl: ^3.0.0\n typia: 15.0.0\n rolldown:\n rolldown: ^1.1.5\n utils:\n rimraf: ^6.1.3\n uuid: ^13.0.0\n typescript:\n \"@ttsc/lint\": ^0.18.2\n \"@ttsc/paths\": ^0.18.2\n \"@ttsc/unplugin\": ^0.28.1\n ttsc: ^0.28.1\n typescript: ^7.0.2\n",
54
54
  "typos.toml": "[default]\nlocale = 'en-us'\nextend-ignore-re = [\n \"(?Rm)^.*(<!--|#|//)\\\\s*spellchecker:disable-line(-->|\\n)?$\",\n \"(?s)(<!--|#|//)\\\\s*spellchecker:off\\\\s*(-->|\\n).*?(<!--|#|//)\\\\s*spellchecker:on\",\n]\n\n[default.extend-words]\nJeongho = \"Jeongho\"\nNam = \"Nam\"\ntypia = \"typia\"\n\n[files]\nextend-exclude = [\"*.json\"]"
55
55
  };
56
56
  //#endregion
@@ -8,7 +8,7 @@ exports.SDK_TEMPLATE = {
8
8
  "LICENSE": "MIT License\n\nCopyright (c) 2024 Jeongho Nam\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all\ncopies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\nSOFTWARE.\n",
9
9
  "README.md": "# Software Development Kit\nThis is a SDK library generated by [`@nestia/migrate`](https://nestia.io/docs/migrate) or [`@nestia/editor`](https://nestia.io/docs/editor).\n\nWith this SDK library, you can easily and safely interact with backend server.\n\nJust import and call some API functions like gif image below:\n\n![nestia-sdk-demo](https://user-images.githubusercontent.com/13158709/215004990-368c589d-7101-404e-b81b-fbc936382f05.gif)\n\n> Left is server code, and right is client code utilizing the SDK\n\n\n\n\n## How to Test\n```bash\npnpm install\npnpm run start # run only \"test/start.ts\" file\npnpm run test # everything under the \"test/features\" directory\npnpm run test:simulate # \"test/features\" with mockup simulation mode\n```\n\nIf you run `pnpm run start` command, only [test/start.ts](test/start.ts) file would be executed.\n\nOtherwise you run `pnpm run test` command instead, run everything in the [test/features](test/features) directory.\n\nFor reference, the [test/features](test/features) directory and E2E test functions (for each API endpoints) would be automatically composed only when you've configured the \"E2E test function generation mode\" of the `@nestia/migrate` (or `@nestia/editor`).\n\n```bash\npnpm dlx @nestia/migrate\n? Migration mode (Use arrow keys):\n NestJS\n > SDK\n? Swagger file location: assets/input/clickhouse.json\n? Output directory path: assets/output/clickhouse-sdk-manual\n? Mokup Simulator: true\n? E2E Test Functions: true\n```\n\n\n\n\n## Deploy\n```bash\npnpm install\npnpm run deploy\n```\n\nJust run `pnpm run deploy` command, then your SDK library would be published.\n\nBy the way, the initial package name of this template repository is `@ORGANIZATION/PROJECT-api`. I think it would better to change the word to your own organization and project name. If you're utilizing `VsCode`, you can do it through `Edit > Replace in Files` (*Ctrl + Shift + H*) feature.\n\n-----------\n\n> ## What [`Nestia`](https://nestia.io) is:\n> ![Nestia Logo](https://nestia.io/logo.png)\n> \n> [![GitHub license](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/samchon/nestia/blob/master/LICENSE)\n> [![npm version](https://img.shields.io/npm/v/@nestia/core.svg)](https://www.npmjs.com/package/@nestia/core)\n> [![Downloads](https://img.shields.io/npm/dm/@nestia/core.svg)](https://www.npmjs.com/package/@nestia/core)\n> [![Build Status](https://github.com/samchon/nestia/workflows/build/badge.svg)](https://github.com/samchon/nestia/actions?query=workflow%3Abuild)\n> [![Guide Documents](https://img.shields.io/badge/guide-documents-forestgreen)](https://nestia.io/docs/)\n> \n> Nestia is a set of helper libraries for NestJS, supporting below features:\n> \n> - `@nestia/core`: Super-fast decorators\n> - `@nestia/sdk`:\n> - Swagger generator evolved than ever\n> - SDK library generator for clients\n> - Mockup Simulator for client applications\n> - Automatic E2E test functions generator\n> - `@nestia/migrate`: Migration from Swagger to NestJS\n> - `@nestia/editor`: Online TypeScript Swagger Editor\n> - `nestia`: Just CLI (command line interface) tool\n> \n>> **Note**\n>> \n>> - **Only one line** required, with pure TypeScript type\n>> - Enhance performance **30x** up\n>> - Runtime validator is **20,000x faster** than `class-validator`\n>> - JSON serialization is **200x faster** than `class-transformer`\n>> - Software Development Kit\n>> - SDK is a collection of `fetch` functions with type definitions like [tRPC](https://> trpc.io/)\n>> - Mockup simulator means embedded backend simulator in SDK\n>> - similar with [msw](https://mswjs.io/), but fully automated\n",
10
10
  "hello.js": "function print(command, description) {\n return console.log(`\\x1b[1m${command}\\x1b[2m: ${description}\\x1b[0m`);\n}\n\nconsole.log(\"-----------------------------------------\");\nconsole.log(\"\\x1b[7mGenerated by \\x1b[2m@nestia/editor\\x1b[0m\");\nconsole.log(\"\");\nconsole.log(\" - \\x1b[36mhttps://nestia.io/docs/editor\\x1b[0m\");\nconsole.log(\" - \\x1b[36mhttps://github.com/samchon/nestia\\x1b[0m\");\nconsole.log(\"-----------------------------------------\");\n\nprint(\"pnpm run start\", \"Run only test/start.ts\");\nprint(\"pnpm run test\", \"Run every test/features/**/*.ts files\");\nprint(\"pnpm run test:simulate\", \"Test with mockup simulator\");\n",
11
- "package.json": "{\n \"name\": \"@ORGANIZATION/PROJECT-api\",\n \"version\": \"0.1.0\",\n \"description\": \"SDK library generated by Nestia\",\n \"main\": \"src/index.ts\",\n \"exports\": {\n \".\": \"./src/index.ts\",\n \"./lib/*\": \"./src/*.ts\",\n \"./package.json\": \"./package.json\"\n },\n \"publishConfig\": {\n \"main\": \"lib/index.mjs\",\n \"module\": \"lib/index.mjs\",\n \"types\": \"lib/index.d.ts\",\n \"exports\": {\n \".\": {\n \"types\": \"./lib/index.d.ts\",\n \"import\": \"./lib/index.mjs\",\n \"default\": \"./lib/index.js\"\n },\n \"./lib/*\": {\n \"types\": \"./lib/*.d.ts\",\n \"import\": \"./lib/*.mjs\",\n \"default\": \"./lib/*.js\"\n },\n \"./package.json\": \"./package.json\"\n }\n },\n \"scripts\": {\n \"build\": \"rimraf lib && ttsc && rolldown -c\",\n \"build:test\": \"rimraf bin && ttsc --project test/tsconfig.json\",\n \"deploy\": \"pnpm run build && pnpm publish\",\n \"dev\": \"pnpm run build:test --watch\",\n \"hello\": \"node hello\",\n \"start\": \"ttsx test/start.ts\",\n \"swagger\": \"ttsx test/swagger.ts\",\n \"test\": \"ttsx test/index.ts\",\n \"test:simulate\": \"ttsx test/index.ts --simulate true\"\n },\n \"repository\": {\n \"type\": \"git\",\n \"url\": \"https://github.com/samchon/nestia\"\n },\n \"author\": \"Jeongho Nam\",\n \"license\": \"MIT\",\n \"bugs\": {\n \"url\": \"https://github.com/samchon/nestia/issues\"\n },\n \"homepage\": \"https://nestia.io\",\n \"files\": [\n \"lib\",\n \"swagger.json\",\n \"package.json\",\n \"README.md\"\n ],\n \"dependencies\": {\n \"@nestia/fetcher\": \"^14.0.2\",\n \"tgrid\": \"^1.2.1\",\n \"typia\": \"15.0.0\"\n },\n \"devDependencies\": {\n \"@nestia/e2e\": \"^14.0.2\",\n \"@ttsc/unplugin\": \"^0.28.1\",\n \"@types/express\": \"^4.17.21\",\n \"@types/swagger-ui-express\": \"^4.1.6\",\n \"chalk\": \"4.1.2\",\n \"express\": \"^4.19.2\",\n \"rimraf\": \"^5.0.5\",\n \"rolldown\": \"^1.1.5\",\n \"swagger-ui-express\": \"^5.0.0\",\n \"tinyglobby\": \"^0.2.17\",\n \"ttsc\": \"^0.28.1\",\n \"typescript\": \"^7.0.2\",\n \"@nestia/core\": \"^14.0.2\"\n },\n \"packageManager\": \"pnpm@10.19.0\"\n}",
11
+ "package.json": "{\n \"name\": \"@ORGANIZATION/PROJECT-api\",\n \"version\": \"0.1.0\",\n \"description\": \"SDK library generated by Nestia\",\n \"main\": \"src/index.ts\",\n \"exports\": {\n \".\": \"./src/index.ts\",\n \"./lib/*\": \"./src/*.ts\",\n \"./package.json\": \"./package.json\"\n },\n \"publishConfig\": {\n \"main\": \"lib/index.mjs\",\n \"module\": \"lib/index.mjs\",\n \"types\": \"lib/index.d.ts\",\n \"exports\": {\n \".\": {\n \"types\": \"./lib/index.d.ts\",\n \"import\": \"./lib/index.mjs\",\n \"default\": \"./lib/index.js\"\n },\n \"./lib/*\": {\n \"types\": \"./lib/*.d.ts\",\n \"import\": \"./lib/*.mjs\",\n \"default\": \"./lib/*.js\"\n },\n \"./package.json\": \"./package.json\"\n }\n },\n \"scripts\": {\n \"build\": \"rimraf lib && ttsc && rolldown -c\",\n \"build:test\": \"rimraf bin && ttsc --project test/tsconfig.json\",\n \"deploy\": \"pnpm run build && pnpm publish\",\n \"dev\": \"pnpm run build:test --watch\",\n \"hello\": \"node hello\",\n \"start\": \"ttsx test/start.ts\",\n \"swagger\": \"ttsx test/swagger.ts\",\n \"test\": \"ttsx test/index.ts\",\n \"test:simulate\": \"ttsx test/index.ts --simulate true\"\n },\n \"repository\": {\n \"type\": \"git\",\n \"url\": \"https://github.com/samchon/nestia\"\n },\n \"author\": \"Jeongho Nam\",\n \"license\": \"MIT\",\n \"bugs\": {\n \"url\": \"https://github.com/samchon/nestia/issues\"\n },\n \"homepage\": \"https://nestia.io\",\n \"files\": [\n \"lib\",\n \"swagger.json\",\n \"package.json\",\n \"README.md\"\n ],\n \"dependencies\": {\n \"@nestia/fetcher\": \"^14.0.3\",\n \"tgrid\": \"^1.2.1\",\n \"typia\": \"15.0.0\"\n },\n \"devDependencies\": {\n \"@nestia/e2e\": \"^14.0.3\",\n \"@ttsc/unplugin\": \"^0.28.1\",\n \"@types/express\": \"^4.17.21\",\n \"@types/swagger-ui-express\": \"^4.1.6\",\n \"chalk\": \"4.1.2\",\n \"express\": \"^4.19.2\",\n \"rimraf\": \"^5.0.5\",\n \"rolldown\": \"^1.1.5\",\n \"swagger-ui-express\": \"^5.0.0\",\n \"tinyglobby\": \"^0.2.17\",\n \"ttsc\": \"^0.28.1\",\n \"typescript\": \"^7.0.2\",\n \"@nestia/core\": \"^14.0.3\"\n },\n \"packageManager\": \"pnpm@10.19.0\"\n}",
12
12
  "rolldown.config.mjs": "import ttsc from \"@ttsc/unplugin/rolldown\";\nimport path from \"node:path\";\nimport { globSync } from \"tinyglobby\";\n\nexport default {\n input: globSync(\"./src/**/*.ts\"),\n external: (id) => !id.startsWith(\".\") && !path.isAbsolute(id),\n output: {\n dir: \"./lib\",\n format: \"esm\",\n sourcemap: true,\n entryFileNames: \"[name].mjs\",\n preserveModules: true,\n preserveModulesRoot: \"src\",\n },\n plugins: [ttsc()],\n};\n",
13
13
  "src/HttpError.ts": "export { HttpError } from \"@nestia/fetcher\";\n",
14
14
  "src/IConnection.ts": "export type { IConnection } from \"@nestia/fetcher\";\n",
@@ -6,7 +6,7 @@ const SDK_TEMPLATE = {
6
6
  "LICENSE": "MIT License\n\nCopyright (c) 2024 Jeongho Nam\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all\ncopies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\nSOFTWARE.\n",
7
7
  "README.md": "# Software Development Kit\nThis is a SDK library generated by [`@nestia/migrate`](https://nestia.io/docs/migrate) or [`@nestia/editor`](https://nestia.io/docs/editor).\n\nWith this SDK library, you can easily and safely interact with backend server.\n\nJust import and call some API functions like gif image below:\n\n![nestia-sdk-demo](https://user-images.githubusercontent.com/13158709/215004990-368c589d-7101-404e-b81b-fbc936382f05.gif)\n\n> Left is server code, and right is client code utilizing the SDK\n\n\n\n\n## How to Test\n```bash\npnpm install\npnpm run start # run only \"test/start.ts\" file\npnpm run test # everything under the \"test/features\" directory\npnpm run test:simulate # \"test/features\" with mockup simulation mode\n```\n\nIf you run `pnpm run start` command, only [test/start.ts](test/start.ts) file would be executed.\n\nOtherwise you run `pnpm run test` command instead, run everything in the [test/features](test/features) directory.\n\nFor reference, the [test/features](test/features) directory and E2E test functions (for each API endpoints) would be automatically composed only when you've configured the \"E2E test function generation mode\" of the `@nestia/migrate` (or `@nestia/editor`).\n\n```bash\npnpm dlx @nestia/migrate\n? Migration mode (Use arrow keys):\n NestJS\n > SDK\n? Swagger file location: assets/input/clickhouse.json\n? Output directory path: assets/output/clickhouse-sdk-manual\n? Mokup Simulator: true\n? E2E Test Functions: true\n```\n\n\n\n\n## Deploy\n```bash\npnpm install\npnpm run deploy\n```\n\nJust run `pnpm run deploy` command, then your SDK library would be published.\n\nBy the way, the initial package name of this template repository is `@ORGANIZATION/PROJECT-api`. I think it would better to change the word to your own organization and project name. If you're utilizing `VsCode`, you can do it through `Edit > Replace in Files` (*Ctrl + Shift + H*) feature.\n\n-----------\n\n> ## What [`Nestia`](https://nestia.io) is:\n> ![Nestia Logo](https://nestia.io/logo.png)\n> \n> [![GitHub license](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/samchon/nestia/blob/master/LICENSE)\n> [![npm version](https://img.shields.io/npm/v/@nestia/core.svg)](https://www.npmjs.com/package/@nestia/core)\n> [![Downloads](https://img.shields.io/npm/dm/@nestia/core.svg)](https://www.npmjs.com/package/@nestia/core)\n> [![Build Status](https://github.com/samchon/nestia/workflows/build/badge.svg)](https://github.com/samchon/nestia/actions?query=workflow%3Abuild)\n> [![Guide Documents](https://img.shields.io/badge/guide-documents-forestgreen)](https://nestia.io/docs/)\n> \n> Nestia is a set of helper libraries for NestJS, supporting below features:\n> \n> - `@nestia/core`: Super-fast decorators\n> - `@nestia/sdk`:\n> - Swagger generator evolved than ever\n> - SDK library generator for clients\n> - Mockup Simulator for client applications\n> - Automatic E2E test functions generator\n> - `@nestia/migrate`: Migration from Swagger to NestJS\n> - `@nestia/editor`: Online TypeScript Swagger Editor\n> - `nestia`: Just CLI (command line interface) tool\n> \n>> **Note**\n>> \n>> - **Only one line** required, with pure TypeScript type\n>> - Enhance performance **30x** up\n>> - Runtime validator is **20,000x faster** than `class-validator`\n>> - JSON serialization is **200x faster** than `class-transformer`\n>> - Software Development Kit\n>> - SDK is a collection of `fetch` functions with type definitions like [tRPC](https://> trpc.io/)\n>> - Mockup simulator means embedded backend simulator in SDK\n>> - similar with [msw](https://mswjs.io/), but fully automated\n",
8
8
  "hello.js": "function print(command, description) {\n return console.log(`\\x1b[1m${command}\\x1b[2m: ${description}\\x1b[0m`);\n}\n\nconsole.log(\"-----------------------------------------\");\nconsole.log(\"\\x1b[7mGenerated by \\x1b[2m@nestia/editor\\x1b[0m\");\nconsole.log(\"\");\nconsole.log(\" - \\x1b[36mhttps://nestia.io/docs/editor\\x1b[0m\");\nconsole.log(\" - \\x1b[36mhttps://github.com/samchon/nestia\\x1b[0m\");\nconsole.log(\"-----------------------------------------\");\n\nprint(\"pnpm run start\", \"Run only test/start.ts\");\nprint(\"pnpm run test\", \"Run every test/features/**/*.ts files\");\nprint(\"pnpm run test:simulate\", \"Test with mockup simulator\");\n",
9
- "package.json": "{\n \"name\": \"@ORGANIZATION/PROJECT-api\",\n \"version\": \"0.1.0\",\n \"description\": \"SDK library generated by Nestia\",\n \"main\": \"src/index.ts\",\n \"exports\": {\n \".\": \"./src/index.ts\",\n \"./lib/*\": \"./src/*.ts\",\n \"./package.json\": \"./package.json\"\n },\n \"publishConfig\": {\n \"main\": \"lib/index.mjs\",\n \"module\": \"lib/index.mjs\",\n \"types\": \"lib/index.d.ts\",\n \"exports\": {\n \".\": {\n \"types\": \"./lib/index.d.ts\",\n \"import\": \"./lib/index.mjs\",\n \"default\": \"./lib/index.js\"\n },\n \"./lib/*\": {\n \"types\": \"./lib/*.d.ts\",\n \"import\": \"./lib/*.mjs\",\n \"default\": \"./lib/*.js\"\n },\n \"./package.json\": \"./package.json\"\n }\n },\n \"scripts\": {\n \"build\": \"rimraf lib && ttsc && rolldown -c\",\n \"build:test\": \"rimraf bin && ttsc --project test/tsconfig.json\",\n \"deploy\": \"pnpm run build && pnpm publish\",\n \"dev\": \"pnpm run build:test --watch\",\n \"hello\": \"node hello\",\n \"start\": \"ttsx test/start.ts\",\n \"swagger\": \"ttsx test/swagger.ts\",\n \"test\": \"ttsx test/index.ts\",\n \"test:simulate\": \"ttsx test/index.ts --simulate true\"\n },\n \"repository\": {\n \"type\": \"git\",\n \"url\": \"https://github.com/samchon/nestia\"\n },\n \"author\": \"Jeongho Nam\",\n \"license\": \"MIT\",\n \"bugs\": {\n \"url\": \"https://github.com/samchon/nestia/issues\"\n },\n \"homepage\": \"https://nestia.io\",\n \"files\": [\n \"lib\",\n \"swagger.json\",\n \"package.json\",\n \"README.md\"\n ],\n \"dependencies\": {\n \"@nestia/fetcher\": \"^14.0.2\",\n \"tgrid\": \"^1.2.1\",\n \"typia\": \"15.0.0\"\n },\n \"devDependencies\": {\n \"@nestia/e2e\": \"^14.0.2\",\n \"@ttsc/unplugin\": \"^0.28.1\",\n \"@types/express\": \"^4.17.21\",\n \"@types/swagger-ui-express\": \"^4.1.6\",\n \"chalk\": \"4.1.2\",\n \"express\": \"^4.19.2\",\n \"rimraf\": \"^5.0.5\",\n \"rolldown\": \"^1.1.5\",\n \"swagger-ui-express\": \"^5.0.0\",\n \"tinyglobby\": \"^0.2.17\",\n \"ttsc\": \"^0.28.1\",\n \"typescript\": \"^7.0.2\",\n \"@nestia/core\": \"^14.0.2\"\n },\n \"packageManager\": \"pnpm@10.19.0\"\n}",
9
+ "package.json": "{\n \"name\": \"@ORGANIZATION/PROJECT-api\",\n \"version\": \"0.1.0\",\n \"description\": \"SDK library generated by Nestia\",\n \"main\": \"src/index.ts\",\n \"exports\": {\n \".\": \"./src/index.ts\",\n \"./lib/*\": \"./src/*.ts\",\n \"./package.json\": \"./package.json\"\n },\n \"publishConfig\": {\n \"main\": \"lib/index.mjs\",\n \"module\": \"lib/index.mjs\",\n \"types\": \"lib/index.d.ts\",\n \"exports\": {\n \".\": {\n \"types\": \"./lib/index.d.ts\",\n \"import\": \"./lib/index.mjs\",\n \"default\": \"./lib/index.js\"\n },\n \"./lib/*\": {\n \"types\": \"./lib/*.d.ts\",\n \"import\": \"./lib/*.mjs\",\n \"default\": \"./lib/*.js\"\n },\n \"./package.json\": \"./package.json\"\n }\n },\n \"scripts\": {\n \"build\": \"rimraf lib && ttsc && rolldown -c\",\n \"build:test\": \"rimraf bin && ttsc --project test/tsconfig.json\",\n \"deploy\": \"pnpm run build && pnpm publish\",\n \"dev\": \"pnpm run build:test --watch\",\n \"hello\": \"node hello\",\n \"start\": \"ttsx test/start.ts\",\n \"swagger\": \"ttsx test/swagger.ts\",\n \"test\": \"ttsx test/index.ts\",\n \"test:simulate\": \"ttsx test/index.ts --simulate true\"\n },\n \"repository\": {\n \"type\": \"git\",\n \"url\": \"https://github.com/samchon/nestia\"\n },\n \"author\": \"Jeongho Nam\",\n \"license\": \"MIT\",\n \"bugs\": {\n \"url\": \"https://github.com/samchon/nestia/issues\"\n },\n \"homepage\": \"https://nestia.io\",\n \"files\": [\n \"lib\",\n \"swagger.json\",\n \"package.json\",\n \"README.md\"\n ],\n \"dependencies\": {\n \"@nestia/fetcher\": \"^14.0.3\",\n \"tgrid\": \"^1.2.1\",\n \"typia\": \"15.0.0\"\n },\n \"devDependencies\": {\n \"@nestia/e2e\": \"^14.0.3\",\n \"@ttsc/unplugin\": \"^0.28.1\",\n \"@types/express\": \"^4.17.21\",\n \"@types/swagger-ui-express\": \"^4.1.6\",\n \"chalk\": \"4.1.2\",\n \"express\": \"^4.19.2\",\n \"rimraf\": \"^5.0.5\",\n \"rolldown\": \"^1.1.5\",\n \"swagger-ui-express\": \"^5.0.0\",\n \"tinyglobby\": \"^0.2.17\",\n \"ttsc\": \"^0.28.1\",\n \"typescript\": \"^7.0.2\",\n \"@nestia/core\": \"^14.0.3\"\n },\n \"packageManager\": \"pnpm@10.19.0\"\n}",
10
10
  "rolldown.config.mjs": "import ttsc from \"@ttsc/unplugin/rolldown\";\nimport path from \"node:path\";\nimport { globSync } from \"tinyglobby\";\n\nexport default {\n input: globSync(\"./src/**/*.ts\"),\n external: (id) => !id.startsWith(\".\") && !path.isAbsolute(id),\n output: {\n dir: \"./lib\",\n format: \"esm\",\n sourcemap: true,\n entryFileNames: \"[name].mjs\",\n preserveModules: true,\n preserveModulesRoot: \"src\",\n },\n plugins: [ttsc()],\n};\n",
11
11
  "src/HttpError.ts": "export { HttpError } from \"@nestia/fetcher\";\n",
12
12
  "src/IConnection.ts": "export type { IConnection } from \"@nestia/fetcher\";\n",
@@ -24,7 +24,9 @@ export declare namespace NestiaMigrateCommander {
24
24
  *
25
25
  * It stops with an error when the output directory exists, when its parent
26
26
  * does not exist or is not a directory, when the input cannot be read or
27
- * fetched, or when the document is invalid.
27
+ * fetched, or when the document is invalid. Explicit arguments follow Node's
28
+ * executable/script/flags layout; omitting them reads the current process
29
+ * arguments.
28
30
  *
29
31
  * Creation and writing use `fs.promises` through the injected archiver, so
30
32
  * the volume decides case policy and permissions, and the checks that precede
@@ -35,5 +37,5 @@ export declare namespace NestiaMigrateCommander {
35
37
  * @evidence contracts/common.md#prohibited-implementation-shortcuts The checks apply to every input, and a formatting failure keeps the original text.
36
38
  * @evidence contracts/common.md#meaningful-documentation The comment states the conditions under which it stops.
37
39
  */
38
- const main: () => Promise<void>;
40
+ const main: (argv?: string[]) => Promise<void>;
39
41
  }
@@ -81,7 +81,9 @@ var NestiaMigrateCommander;
81
81
  *
82
82
  * It stops with an error when the output directory exists, when its parent
83
83
  * does not exist or is not a directory, when the input cannot be read or
84
- * fetched, or when the document is invalid.
84
+ * fetched, or when the document is invalid. Explicit arguments follow Node's
85
+ * executable/script/flags layout; omitting them reads the current process
86
+ * arguments.
85
87
  *
86
88
  * Creation and writing use `fs.promises` through the injected archiver, so
87
89
  * the volume decides case policy and permissions, and the checks that precede
@@ -92,9 +94,9 @@ var NestiaMigrateCommander;
92
94
  * @evidence contracts/common.md#prohibited-implementation-shortcuts The checks apply to every input, and a formatting failure keeps the original text.
93
95
  * @evidence contracts/common.md#meaningful-documentation The comment states the conditions under which it stops.
94
96
  */
95
- NestiaMigrateCommander.main = () => __awaiter(this, void 0, void 0, function* () {
97
+ NestiaMigrateCommander.main = (argv) => __awaiter(this, void 0, void 0, function* () {
96
98
  const resolve = (str) => str ? path_1.default.resolve(str).split("\\").join("/") : undefined;
97
- const options = yield NestiaMigrateInquirer_1.NestiaMigrateInquirer.parse();
99
+ const options = yield NestiaMigrateInquirer_1.NestiaMigrateInquirer.parse(argv);
98
100
  // VALIDATE OUTPUT DIRECTORY
99
101
  const parent = resolve(options.output + "/..");
100
102
  if (fs_1.default.existsSync(options.output))
@@ -1 +1 @@
1
- {"version":3,"file":"NestiaMigrateCommander.js","sourceRoot":"","sources":["../../src/executable/NestiaMigrateCommander.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,MAAY,wBAAwB,kEAA8C;AAOlF,4CAAoB;AACpB,gDAAwB;AACxB,uCAAkC;AAClC,MAAY,mBAAmB,kDAA8B;AAG7D,0EAAuE;AACvE,sFAAmF;AACnF,mEAAgE;AAEhE;;;;;;;;;;;;;;;;;;GAkBG;AACH,IAAiB,sBAAsB,CA4HtC;AA5HD,WAAiB,sBAAsB;IACrC;;;;;;;;;;;;;;;;OAgBG;IACU,2BAAI,GAAG,GAAwB,EAAE;QAC5C,MAAM,OAAO,GAAG,CAAC,GAAu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
9
9
  //#region src/executable/NestiaMigrateCommander.ts
10
10
  let NestiaMigrateCommander;
11
11
  (function(_NestiaMigrateCommander) {
12
- _NestiaMigrateCommander.main = async () => {
12
+ _NestiaMigrateCommander.main = async (argv) => {
13
13
  const resolve = (str) => str ? path.resolve(str).split("\\").join("/") : void 0;
14
- const options = await NestiaMigrateInquirer.parse();
14
+ const options = await NestiaMigrateInquirer.parse(argv);
15
15
  const parent = resolve(options.output + "/..");
16
16
  if (fs.existsSync(options.output)) halt("Response directory already exists.");
17
17
  else if (fs.existsSync(parent) === false) halt("Response directory's parent directory does not exist.");
@@ -30,12 +30,14 @@ export declare namespace NestiaMigrateInquirer {
30
30
  * Parses the flags and asks for the missing options.
31
31
  *
32
32
  * A boolean flag given without a value is `true`, and one given a value is
33
- * true only for the text `true`.
33
+ * true only for the text `true`. Each invocation owns its parser; explicit
34
+ * arguments use Node's executable/script/flags layout and default to the
35
+ * current process arguments.
34
36
  *
35
- * @evidence contracts/common.md#principled-implementation Commander parses the flags, the action asks a prompt for each undefined option, and boolean flags are normalized by one rule, so the result has every field set.
36
- * @evidence contracts/common.md#clear-and-simple-design One function that wires the parser and the prompts around one action.
37
+ * @evidence contracts/common.md#principled-implementation A fresh Commander parser interprets the supplied Node-style arguments, the action asks a prompt for each undefined option, and boolean flags are normalized by one rule, so the result has every field set without retaining another invocation's options.
38
+ * @evidence contracts/common.md#clear-and-simple-design One invocation owns the parser and prompt action; the optional argument vector defaults to the ordinary process input.
37
39
  * @evidence contracts/common.md#prohibited-implementation-shortcuts It asks only for what is missing.
38
40
  * @evidence contracts/common.md#meaningful-documentation The comment states the boolean flag rule.
39
41
  */
40
- const parse: () => Promise<IOutput>;
42
+ const parse: (argv?: string[]) => Promise<IOutput>;
41
43
  }
@@ -27,26 +27,29 @@ var NestiaMigrateInquirer;
27
27
  * Parses the flags and asks for the missing options.
28
28
  *
29
29
  * A boolean flag given without a value is `true`, and one given a value is
30
- * true only for the text `true`.
30
+ * true only for the text `true`. Each invocation owns its parser; explicit
31
+ * arguments use Node's executable/script/flags layout and default to the
32
+ * current process arguments.
31
33
  *
32
- * @evidence contracts/common.md#principled-implementation Commander parses the flags, the action asks a prompt for each undefined option, and boolean flags are normalized by one rule, so the result has every field set.
33
- * @evidence contracts/common.md#clear-and-simple-design One function that wires the parser and the prompts around one action.
34
+ * @evidence contracts/common.md#principled-implementation A fresh Commander parser interprets the supplied Node-style arguments, the action asks a prompt for each undefined option, and boolean flags are normalized by one rule, so the result has every field set without retaining another invocation's options.
35
+ * @evidence contracts/common.md#clear-and-simple-design One invocation owns the parser and prompt action; the optional argument vector defaults to the ordinary process input.
34
36
  * @evidence contracts/common.md#prohibited-implementation-shortcuts It asks only for what is missing.
35
37
  * @evidence contracts/common.md#meaningful-documentation The comment states the boolean flag rule.
36
38
  */
37
- NestiaMigrateInquirer.parse = () => __awaiter(this, void 0, void 0, function* () {
39
+ NestiaMigrateInquirer.parse = (argv) => __awaiter(this, void 0, void 0, function* () {
40
+ const program = new commander_1.Command();
38
41
  // PREPARE ASSETS
39
- commander_1.program.option("--mode [nest/sdk]", "migration mode");
40
- commander_1.program.option("--input [swagger.json]", "location of target swagger.json file");
41
- commander_1.program.option("--output [directory]", "output directory path");
42
- commander_1.program.option("--keyword [boolean]", "Keyword parameter mode");
43
- commander_1.program.option("--simulate [boolean]", "Mockup simulator");
44
- commander_1.program.option("--e2e [boolean]", "Generate E2E tests");
45
- commander_1.program.option("--package [name]", "Package name");
42
+ program.option("--mode [nest/sdk]", "migration mode");
43
+ program.option("--input [swagger.json]", "location of target swagger.json file");
44
+ program.option("--output [directory]", "output directory path");
45
+ program.option("--keyword [boolean]", "Keyword parameter mode");
46
+ program.option("--simulate [boolean]", "Mockup simulator");
47
+ program.option("--e2e [boolean]", "Generate E2E tests");
48
+ program.option("--package [name]", "Package name");
46
49
  // INTERNAL PROCEDURES
47
50
  const questioned = { value: false };
48
51
  const action = (closure) => new Promise((resolve, reject) => {
49
- commander_1.program.action((options) => __awaiter(this, void 0, void 0, function* () {
52
+ program.action((options) => __awaiter(this, void 0, void 0, function* () {
50
53
  try {
51
54
  resolve(yield closure(options));
52
55
  }
@@ -54,7 +57,7 @@ var NestiaMigrateInquirer;
54
57
  reject(exp);
55
58
  }
56
59
  }));
57
- commander_1.program.parseAsync().catch(reject);
60
+ program.parseAsync(argv).catch(reject);
58
61
  });
59
62
  const select = (name) => (message) => (choices, filter) => __awaiter(this, void 0, void 0, function* () {
60
63
  questioned.value = true;
@@ -1 +1 @@
1
- {"version":3,"file":"NestiaMigrateInquirer.js","sourceRoot":"","sources":["../../src/executable/NestiaMigrateInquirer.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,yCAAoC;AACpC,uCAA8C;AAE9C;;;;;;;;GAQG;AACH,IAAiB,qBAAqB,CA4GrC;AA5GD,WAAiB,qBAAqB;IAoBpC;;;;;;;;;;OAUG;IACU,2BAAK,GAAG,GAA2B,EAAE;QAChD,iBAAiB;QACjB,mBAAO,CAAC,MAAM,CAAC,mBAAmB,EAAE,gBAAgB,CAAC,CAAC;QACtD,mBAAO,CAAC,MAAM,CACZ,wBAAwB,EACxB,sCAAsC,CACvC,CAAC;QACF,mBAAO,CAAC,MAAM,CAAC,sBAAsB,EAAE,uBAAuB,CAAC,CAAC;QAChE,mBAAO,CAAC,MAAM,CAAC,qBAAqB,EAAE,wBAAwB,CAAC,CAAC;QAChE,mBAAO,CAAC,MAAM,CAAC,sBAAsB,EAAE,kBAAkB,CAAC,CAAC;QAC3D,mBAAO,CAAC,MAAM,CAAC,iBAAiB,EAAE,oBAAoB,CAAC,CAAC;QACxD,mBAAO,CAAC,MAAM,CAAC,kBAAkB,EAAE,cAAc,CAAC,CAAC;QAEnD,sBAAsB;QACtB,MAAM,UAAU,GAAG,EAAE,KAAK,EAAE,KAAK,EAAE,CAAC;QACpC,MAAM,MAAM,GAAG,CAAC,OAAwD,EAAE,EAAE,CAC1E,IAAI,OAAO,CAAU,CAAC,OAAO,EAAE,MAAM,EAAE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,CAAA,CAAC;AACJ,CAAC,EA/GgB,qBAAqB,aAArB,qBAAqB,GAArB,qBAAqB,QA+GrC"}
@@ -1,9 +1,10 @@
1
- import { program } from "commander";
1
+ import { Command } from "commander";
2
2
  import { createPromptModule } from "inquirer";
3
3
  //#region src/executable/NestiaMigrateInquirer.ts
4
4
  let NestiaMigrateInquirer;
5
5
  (function(_NestiaMigrateInquirer) {
6
- _NestiaMigrateInquirer.parse = async () => {
6
+ _NestiaMigrateInquirer.parse = async (argv) => {
7
+ const program = new Command();
7
8
  program.option("--mode [nest/sdk]", "migration mode");
8
9
  program.option("--input [swagger.json]", "location of target swagger.json file");
9
10
  program.option("--output [directory]", "output directory path");
@@ -20,7 +21,7 @@ let NestiaMigrateInquirer;
20
21
  reject(exp);
21
22
  }
22
23
  });
23
- program.parseAsync().catch(reject);
24
+ program.parseAsync(argv).catch(reject);
24
25
  });
25
26
  const select = (name) => (message) => async (choices, filter) => {
26
27
  questioned.value = true;
@@ -0,0 +1,23 @@
1
+ /**
2
+ * Reuses a complete template generation only while its inputs and outputs
3
+ * match.
4
+ *
5
+ * The caller owns the generated paths and cold generation. This module owns the
6
+ * validity manifest; failed generation never publishes a new manifest.
7
+ * Concurrent generation of the same output paths is not supported.
8
+ *
9
+ * @evidence contracts/common.md#principled-implementation Input identity includes the cache implementation and caller-supplied generator inputs. Reuse requires every expected output's current SHA-256 to match the manifest; a missing, changed or partial generation cannot authorize reuse.
10
+ * @evidence contracts/common.md#clear-and-simple-design One operation checks a manifest, delegates cold generation and publishes its successful output digests. The caller retains template-specific fetching and stamping rules.
11
+ * @evidence contracts/common.md#prohibited-implementation-shortcuts Generated contents are never replaced by expected answers. Invalid metadata is treated as a cache miss and failed generation remains a rejection.
12
+ * @evidence contracts/common.md#meaningful-documentation Documents manifest ownership, failed publication and the existing single-writer premise.
13
+ * @evidence contracts/performance.md#efficient-algorithms A hit hashes each output once, with time proportional to input/output bytes and one manifest rather than scanning template trees or fetching Git history.
14
+ * @evidence contracts/performance.md#reuse-equivalent-work The cache implementation, caller inputs and current output digests jointly establish reuse validity; changed inputs, edited outputs and missing files invalidate it.
15
+ * @evidence contracts/performance.md#bound-retention-and-release-resources Each output set owns one replaceable manifest, not per-run history. Synchronous reads and awaited writes close their file handles. The caller must serialize writers to the same paths.
16
+ * @evidence contracts/portability.md#os-neutral-implementation Node fs consumes caller-owned native paths; identity hashes bytes and never assumes timestamp resolution, case folding or path separators.
17
+ */
18
+ export declare const run: ({ inputs, outputs, stampFile, generate, }: {
19
+ inputs: readonly unknown[];
20
+ outputs: readonly string[];
21
+ stampFile: string;
22
+ generate: () => Promise<void>;
23
+ }) => Promise<boolean>;
@@ -0,0 +1,60 @@
1
+ "use strict";
2
+ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
3
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
4
+ return new (P || (P = Promise))(function (resolve, reject) {
5
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
6
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
7
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
8
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
9
+ });
10
+ };
11
+ var __importDefault = (this && this.__importDefault) || function (mod) {
12
+ return (mod && mod.__esModule) ? mod : { "default": mod };
13
+ };
14
+ Object.defineProperty(exports, "__esModule", { value: true });
15
+ exports.run = void 0;
16
+ const node_crypto_1 = __importDefault(require("node:crypto"));
17
+ const node_fs_1 = __importDefault(require("node:fs"));
18
+ /**
19
+ * Reuses a complete template generation only while its inputs and outputs
20
+ * match.
21
+ *
22
+ * The caller owns the generated paths and cold generation. This module owns the
23
+ * validity manifest; failed generation never publishes a new manifest.
24
+ * Concurrent generation of the same output paths is not supported.
25
+ *
26
+ * @evidence contracts/common.md#principled-implementation Input identity includes the cache implementation and caller-supplied generator inputs. Reuse requires every expected output's current SHA-256 to match the manifest; a missing, changed or partial generation cannot authorize reuse.
27
+ * @evidence contracts/common.md#clear-and-simple-design One operation checks a manifest, delegates cold generation and publishes its successful output digests. The caller retains template-specific fetching and stamping rules.
28
+ * @evidence contracts/common.md#prohibited-implementation-shortcuts Generated contents are never replaced by expected answers. Invalid metadata is treated as a cache miss and failed generation remains a rejection.
29
+ * @evidence contracts/common.md#meaningful-documentation Documents manifest ownership, failed publication and the existing single-writer premise.
30
+ * @evidence contracts/performance.md#efficient-algorithms A hit hashes each output once, with time proportional to input/output bytes and one manifest rather than scanning template trees or fetching Git history.
31
+ * @evidence contracts/performance.md#reuse-equivalent-work The cache implementation, caller inputs and current output digests jointly establish reuse validity; changed inputs, edited outputs and missing files invalidate it.
32
+ * @evidence contracts/performance.md#bound-retention-and-release-resources Each output set owns one replaceable manifest, not per-run history. Synchronous reads and awaited writes close their file handles. The caller must serialize writers to the same paths.
33
+ * @evidence contracts/portability.md#os-neutral-implementation Node fs consumes caller-owned native paths; identity hashes bytes and never assumes timestamp resolution, case folding or path separators.
34
+ */
35
+ const run = (_a) => __awaiter(void 0, [_a], void 0, function* ({ inputs, outputs, stampFile, generate, }) {
36
+ const digest = (content) => node_crypto_1.default.createHash("sha256").update(content).digest("hex");
37
+ const input = digest(JSON.stringify([node_fs_1.default.readFileSync(__filename, "utf8"), inputs]));
38
+ let stamp;
39
+ if (node_fs_1.default.existsSync(stampFile)) {
40
+ try {
41
+ stamp = JSON.parse(node_fs_1.default.readFileSync(stampFile, "utf8"));
42
+ }
43
+ catch (_b) {
44
+ // Invalid or interrupted metadata cannot authorize reuse.
45
+ }
46
+ }
47
+ if (outputs.length !== 0 &&
48
+ (stamp === null || stamp === void 0 ? void 0 : stamp.input) === input &&
49
+ outputs.every((file, index) => { var _a; return node_fs_1.default.existsSync(file) &&
50
+ ((_a = stamp.outputs) === null || _a === void 0 ? void 0 : _a[index]) === digest(node_fs_1.default.readFileSync(file)); }))
51
+ return true;
52
+ yield generate();
53
+ yield node_fs_1.default.promises.writeFile(stampFile, JSON.stringify({
54
+ input,
55
+ outputs: outputs.map((file) => digest(node_fs_1.default.readFileSync(file))),
56
+ }), "utf8");
57
+ return false;
58
+ });
59
+ exports.run = run;
60
+ //# sourceMappingURL=TemplateBundleCache.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"TemplateBundleCache.js","sourceRoot":"","sources":["../../src/executable/TemplateBundleCache.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA,8DAAiC;AACjC,sDAAyB;AAEzB;;;;;;;;;;;;;;;;GAgBG;AACI,MAAM,GAAG,GAAG,KAUE,EAAE,4CAVG,EACxB,MAAM,EACN,OAAO,EACP,SAAS,EACT,QAAQ,GAMT;IACC,MAAM,MAAM,GAAG,CAAC,OAAwB,EAAU,EAAE,CAClD,qBAAM,CAAC,UAAU,CAAC,QAAQ,CAAC,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC;IAC5D,MAAM,KAAK,GAAG,MAAM,CAClB,IAAI,CAAC,SAAS,CAAC,CAAC,iBAAE,CAAC,YAAY,CAAC,UAAU,EAAE,MAAM,CAAC,EAAE,MAAM,CAAC,CAAC,CAC9D,CAAC;IACF,IAAI,KAAyD,CAAC;IAC9D,IAAI,iBAAE,CAAC,UAAU,CAAC,SAAS,CAAC,EAAE,CAAC;QAC7B,IAAI,CAAC;YACH,KAAK,GAAG,IAAI,CAAC,KAAK,CAAC,iBAAE,CAAC,YAAY,CAAC,SAAS,EAAE,MAAM,CAAC,CAAC,CAAC;QACzD,CAAC;mBAAO,CAAC;YACP,0DAA0D;QAC5D,CAAC;IACH,CAAC;IACD,IACE,OAAO,CAAC,MAAM,KAAK,CAAC;QACpB,CAAA,KAAK,aAAL,KAAK,uBAAL,KAAK,CAAE,KAAK,MAAK,KAAK;QACtB,OAAO,CAAC,KAAK,CACX,CAAC,IAAI,EAAE,KAAK,EAAE,EAAE,kBACd,iBAAE,CAAC,UAAU,CAAC,IAAI,CAAC;YACnB,CAAA,MAAA,KAAK,CAAC,OAAO,0CAAG,KAAK,CAAC,MAAK,MAAM,CAAC,iBAAE,CAAC,YAAY,CAAC,IAAI,CAAC,CAAC,GAAA,CAC3D;QAED,OAAO,IAAI,CAAC;IACd,MAAM,QAAQ,EAAE,CAAC;IACjB,MAAM,iBAAE,CAAC,QAAQ,CAAC,SAAS,CACzB,SAAS,EACT,IAAI,CAAC,SAAS,CAAC;QACb,KAAK;QACL,OAAO,EAAE,OAAO,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,MAAM,CAAC,iBAAE,CAAC,YAAY,CAAC,IAAI,CAAC,CAAC,CAAC;KAC9D,CAAC,EACF,MAAM,CACP,CAAC;IACF,OAAO,KAAK,CAAC;AACf,CAAC,CAAA,CAAC;AA5CW,QAAA,GAAG,GAAH,GAAG,CA4Cd"}
@@ -0,0 +1,39 @@
1
+ import crypto from "node:crypto";
2
+ import fs from "node:fs";
3
+ //#region src/executable/TemplateBundleCache.ts
4
+ /**
5
+ * Reuses a complete template generation only while its inputs and outputs
6
+ * match.
7
+ *
8
+ * The caller owns the generated paths and cold generation. This module owns the
9
+ * validity manifest; failed generation never publishes a new manifest.
10
+ * Concurrent generation of the same output paths is not supported.
11
+ *
12
+ * @evidence contracts/common.md#principled-implementation Input identity includes the cache implementation and caller-supplied generator inputs. Reuse requires every expected output's current SHA-256 to match the manifest; a missing, changed or partial generation cannot authorize reuse.
13
+ * @evidence contracts/common.md#clear-and-simple-design One operation checks a manifest, delegates cold generation and publishes its successful output digests. The caller retains template-specific fetching and stamping rules.
14
+ * @evidence contracts/common.md#prohibited-implementation-shortcuts Generated contents are never replaced by expected answers. Invalid metadata is treated as a cache miss and failed generation remains a rejection.
15
+ * @evidence contracts/common.md#meaningful-documentation Documents manifest ownership, failed publication and the existing single-writer premise.
16
+ * @evidence contracts/performance.md#efficient-algorithms A hit hashes each output once, with time proportional to input/output bytes and one manifest rather than scanning template trees or fetching Git history.
17
+ * @evidence contracts/performance.md#reuse-equivalent-work The cache implementation, caller inputs and current output digests jointly establish reuse validity; changed inputs, edited outputs and missing files invalidate it.
18
+ * @evidence contracts/performance.md#bound-retention-and-release-resources Each output set owns one replaceable manifest, not per-run history. Synchronous reads and awaited writes close their file handles. The caller must serialize writers to the same paths.
19
+ * @evidence contracts/portability.md#os-neutral-implementation Node fs consumes caller-owned native paths; identity hashes bytes and never assumes timestamp resolution, case folding or path separators.
20
+ */
21
+ const run = async ({ inputs, outputs, stampFile, generate }) => {
22
+ const digest = (content) => crypto.createHash("sha256").update(content).digest("hex");
23
+ const input = digest(JSON.stringify([fs.readFileSync(__filename, "utf8"), inputs]));
24
+ let stamp;
25
+ if (fs.existsSync(stampFile)) try {
26
+ stamp = JSON.parse(fs.readFileSync(stampFile, "utf8"));
27
+ } catch {}
28
+ if (outputs.length !== 0 && stamp?.input === input && outputs.every((file, index) => fs.existsSync(file) && stamp.outputs?.[index] === digest(fs.readFileSync(file)))) return true;
29
+ await generate();
30
+ await fs.promises.writeFile(stampFile, JSON.stringify({
31
+ input,
32
+ outputs: outputs.map((file) => digest(fs.readFileSync(file)))
33
+ }), "utf8");
34
+ return false;
35
+ };
36
+ //#endregion
37
+ export { run };
38
+
39
+ //# sourceMappingURL=TemplateBundleCache.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"TemplateBundleCache.mjs","names":[],"sources":[],"mappings":""}
@@ -0,0 +1 @@
1
+ export {};