@nestia/migrate 0.7.12 → 0.8.0-dev.20240217

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 (31) hide show
  1. package/lib/MigrateApplication.d.ts +6 -2
  2. package/lib/MigrateApplication.js +13 -5
  3. package/lib/MigrateApplication.js.map +1 -1
  4. package/lib/bundles/NEST_TEMPLATE.js +3 -3
  5. package/lib/bundles/NEST_TEMPLATE.js.map +1 -1
  6. package/lib/bundles/SDK_TEMPLATE.js +38 -3
  7. package/lib/bundles/SDK_TEMPLATE.js.map +1 -1
  8. package/lib/executable/bundle.js +1 -0
  9. package/lib/executable/bundle.js.map +1 -1
  10. package/lib/internal/MigrateCommander.js +1 -3
  11. package/lib/internal/MigrateCommander.js.map +1 -1
  12. package/lib/internal/MigrateInquirer.d.ts +2 -1
  13. package/lib/internal/MigrateInquirer.js +7 -0
  14. package/lib/internal/MigrateInquirer.js.map +1 -1
  15. package/lib/programmers/MigrateE2eFileProgrammer.d.ts +7 -0
  16. package/lib/programmers/MigrateE2eFileProgrammer.js +45 -0
  17. package/lib/programmers/MigrateE2eFileProgrammer.js.map +1 -0
  18. package/lib/programmers/MigrateE2eProgrammer.d.ts +5 -0
  19. package/lib/programmers/MigrateE2eProgrammer.js +27 -0
  20. package/lib/programmers/MigrateE2eProgrammer.js.map +1 -0
  21. package/lib/structures/IMigrateProgram.d.ts +2 -0
  22. package/package.json +71 -70
  23. package/src/MigrateApplication.ts +17 -5
  24. package/src/bundles/NEST_TEMPLATE.ts +3 -3
  25. package/src/bundles/SDK_TEMPLATE.ts +38 -3
  26. package/src/executable/bundle.ts +1 -0
  27. package/src/internal/MigrateCommander.ts +1 -3
  28. package/src/internal/MigrateInquirer.ts +8 -1
  29. package/src/programmers/MigrateE2eFileProgrammer.ts +117 -0
  30. package/src/programmers/MigrateE2eProgrammer.ts +35 -0
  31. package/src/structures/IMigrateProgram.ts +2 -0
@@ -4,12 +4,16 @@ import { ISwagger } from "./structures/ISwagger";
4
4
  export declare class MigrateApplication {
5
5
  readonly swagger: ISwagger;
6
6
  constructor(swagger: ISwagger);
7
- nest(simulate: boolean): MigrateApplication.IOutput;
8
- sdk(simulate: boolean): MigrateApplication.IOutput;
7
+ nest(config: MigrateApplication.IConfig): MigrateApplication.IOutput;
8
+ sdk(config: MigrateApplication.IConfig): MigrateApplication.IOutput;
9
9
  }
10
10
  export declare namespace MigrateApplication {
11
11
  interface IOutput {
12
12
  program: IMigrateProgram;
13
13
  files: IMigrateFile[];
14
14
  }
15
+ interface IConfig {
16
+ simulate: boolean;
17
+ e2e: boolean;
18
+ }
15
19
  }
@@ -9,6 +9,7 @@ const MigrateAnalyzer_1 = require("./analyzers/MigrateAnalyzer");
9
9
  const NEST_TEMPLATE_1 = require("./bundles/NEST_TEMPLATE");
10
10
  const SDK_TEMPLATE_1 = require("./bundles/SDK_TEMPLATE");
11
11
  const MigrateApiProgrammer_1 = require("./programmers/MigrateApiProgrammer");
12
+ const MigrateE2eProgrammer_1 = require("./programmers/MigrateE2eProgrammer");
12
13
  const MigrateNestProgrammer_1 = require("./programmers/MigrateNestProgrammer");
13
14
  class MigrateApplication {
14
15
  constructor(swagger) {
@@ -1455,12 +1456,13 @@ class MigrateApplication {
1455
1456
  return input;
1456
1457
  })(swagger);
1457
1458
  }
1458
- nest(simulate) {
1459
+ nest(config) {
1459
1460
  const program = MigrateAnalyzer_1.MigrateAnalyzer.analyze({
1460
1461
  mode: "nest",
1461
- simulate,
1462
1462
  swagger: this.swagger,
1463
1463
  dictionary: new Map(),
1464
+ simulate: config.simulate,
1465
+ e2e: config.e2e,
1464
1466
  });
1465
1467
  return {
1466
1468
  program,
@@ -1468,19 +1470,25 @@ class MigrateApplication {
1468
1470
  ...NEST_TEMPLATE_1.NEST_TEMPLATE,
1469
1471
  ...MigrateNestProgrammer_1.MigrateNestProgrammer.write(program),
1470
1472
  ...MigrateApiProgrammer_1.MigrateApiProgrammer.write(program),
1473
+ ...(config.e2e ? MigrateE2eProgrammer_1.MigrateE2eProgrammer.write(program) : []),
1471
1474
  ],
1472
1475
  };
1473
1476
  }
1474
- sdk(simulate) {
1477
+ sdk(config) {
1475
1478
  const program = MigrateAnalyzer_1.MigrateAnalyzer.analyze({
1476
1479
  mode: "sdk",
1477
- simulate,
1478
1480
  swagger: this.swagger,
1479
1481
  dictionary: new Map(),
1482
+ simulate: config.simulate,
1483
+ e2e: config.e2e,
1480
1484
  });
1481
1485
  return {
1482
1486
  program,
1483
- files: [...SDK_TEMPLATE_1.SDK_TEMPLATE, ...MigrateApiProgrammer_1.MigrateApiProgrammer.write(program)],
1487
+ files: [
1488
+ ...SDK_TEMPLATE_1.SDK_TEMPLATE,
1489
+ ...MigrateApiProgrammer_1.MigrateApiProgrammer.write(program),
1490
+ ...(config.e2e ? MigrateE2eProgrammer_1.MigrateE2eProgrammer.write(program) : []),
1491
+ ],
1484
1492
  };
1485
1493
  }
1486
1494
  }
@@ -1 +1 @@
1
- {"version":3,"file":"MigrateApplication.js","sourceRoot":"","sources":["../src/MigrateApplication.ts"],"names":[],"mappings":";;;;;;AAAA,kDAA0B;AAE1B,iEAA8D;AAC9D,2DAAwD;AACxD,yDAAsD;AAEtD,6EAA0E;AAC1E,+EAA4E;AAI5E,MAAa,kBAAkB;IAG7B,YAAmB,OAAiB;QAClC,IAAI,CAAC,OAAO;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;mCAAG,eAAK,CAAC,MAAM;kCAAZ,eAAK,CAAC,MAAM;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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I,EAAE,KAAK;YACX,OAAO,EAAE,IAAI,CAAC,OAAO;YACrB,UAAU,EAAE,IAAI,GAAG,EAAE;YACrB,QAAQ,EAAE,MAAM,CAAC,QAAQ;YACzB,GAAG,EAAE,MAAM,CAAC,GAAG;SAChB,CAAC,CAAC;QACH,OAAO;YACL,OAAO;YACP,KAAK,EAAE;gBACL,GAAG,2BAAY;gBACf,GAAG,2CAAoB,CAAC,KAAK,CAAC,OAAO,CAAC;gBACtC,GAAG,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC,CAAC,2CAAoB,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC;aAC3D;SACF,CAAC;IACJ,CAAC;CACF;AA3CD,gDA2CC"}
@@ -45,12 +45,12 @@ exports.NEST_TEMPLATE = [
45
45
  {
46
46
  "location": "",
47
47
  "file": "nestia.config.ts",
48
- "content": "// nestia configuration file\r\nimport type sdk from \"@nestia/sdk\";\r\nimport { NestFactory } from \"@nestjs/core\";\r\n\r\nimport { MyModule } from \"./src/MyModule\";\r\n\r\nconst NESTIA_CONFIG: sdk.INestiaConfig = {\r\n input: () => NestFactory.create(MyModule),\r\n output: \"src/api\",\r\n swagger: {\r\n output: \"packages/api/swagger.json\",\r\n servers: [\r\n {\r\n url: \"http://localhost:37001\",\r\n description: \"Local Server\",\r\n },\r\n ],\r\n },\r\n distribute: \"packages/api\",\r\n simulate: true,\r\n e2e: \"test\",\r\n};\r\nexport default NESTIA_CONFIG;\r\n"
48
+ "content": "// nestia configuration file\r\nimport type sdk from \"@nestia/sdk\";\r\nimport { NestFactory } from \"@nestjs/core\";\r\n\r\nimport { MyModule } from \"./src/MyModule\";\r\n\r\nconst NESTIA_CONFIG: sdk.INestiaConfig = {\r\n input: () => NestFactory.create(MyModule),\r\n output: \"src/api\",\r\n swagger: {\r\n output: \"packages/api/swagger.json\",\r\n servers: [\r\n {\r\n url: \"http://localhost:37001\",\r\n description: \"Local Server\",\r\n },\r\n ],\r\n beautify: true,\r\n },\r\n distribute: \"packages/api\",\r\n primitive: false,\r\n simulate: true,\r\n};\r\nexport default NESTIA_CONFIG;\r\n"
49
49
  },
50
50
  {
51
51
  "location": "",
52
52
  "file": "package.json",
53
- "content": "{\r\n \"private\": true,\r\n \"name\": \"@ORGANIZATION/PROJECT\",\r\n \"version\": \"0.1.0\",\r\n \"description\": \"Starter kit of Nestia\",\r\n \"main\": \"lib/index.js\",\r\n \"scripts\": {\r\n \"test\": \"node bin/test\",\r\n \"test:webpack\": \"npm run webpack && node bin/test/webpack.js\",\r\n \"------------------------BUILDS------------------------\": \"\",\r\n \"build\": \"npm run build:sdk && npm run build:main && npm run build:test\",\r\n \"build:api\": \"rimraf packages/api/lib && npm run build:sdk && tsc -p packages/api/tsconfig.json\",\r\n \"build:main\": \"rimraf lib && tsc\",\r\n \"build:sdk\": \"rimraf src/api/functional && nestia sdk\",\r\n \"build:swagger\": \"npx nestia swagger\",\r\n \"build:test\": \"rimraf bin && tsc -p test/tsconfig.json\",\r\n \"dev\": \"npm run build:test -- --watch\",\r\n \"eslint\": \"eslint src && eslint test\",\r\n \"eslint:fix\": \"eslint --fix src && eslint --fix test\",\r\n \"prepare\": \"ts-patch install && typia patch\",\r\n \"prettier\": \"prettier src --write && prettier test --write\",\r\n \"------------------------WEBPACK------------------------\": \"\",\r\n \"webpack\": \"rimraf dist && webpack\",\r\n \"webpack:start\": \"cd dist && node dist/server\",\r\n \"------------------------DEPLOYS------------------------\": \"\",\r\n \"package:api\": \"npm run build:swagger && npm run build:api && cd packages/api && npm publish\",\r\n \"start\": \"node lib/executable/server\",\r\n \"start:swagger\": \"ts-node src/executable/swagger.ts\"\r\n },\r\n \"repository\": {\r\n \"type\": \"git\",\r\n \"url\": \"https://github.com/samchon/nestia-start\"\r\n },\r\n \"keywords\": [\r\n \"nestia\",\r\n \"template\",\r\n \"boilerplate\"\r\n ],\r\n \"author\": \"AUTHOR\",\r\n \"license\": \"MIT\",\r\n \"bugs\": {\r\n \"url\": \"https://github.com/samchon/nestia-start/issues\"\r\n },\r\n \"homepage\": \"https://github.com/samchon/nestia-start#readme\",\r\n \"devDependencies\": {\r\n \"@nestia/e2e\": \"^0.4.1\",\r\n \"@nestia/sdk\": \"^2.5.6\",\r\n \"@trivago/prettier-plugin-sort-imports\": \"^4.3.0\",\r\n \"@types/cli\": \"^0.11.21\",\r\n \"@types/express\": \"^4.17.21\",\r\n \"@types/inquirer\": \"^8.2.5\",\r\n \"@types/node\": \"^18.11.0\",\r\n \"@types/uuid\": \"^8.3.4\",\r\n \"@typescript-eslint/eslint-plugin\": \"^6.19.1\",\r\n \"@typescript-eslint/parser\": \"^6.19.1\",\r\n \"chalk\": \"^4.1.0\",\r\n \"cli\": \"^1.0.1\",\r\n \"copy-webpack-plugin\": \"^11.0.0\",\r\n \"eslint-plugin-deprecation\": \"^2.0.0\",\r\n \"express\": \"^4.18.2\",\r\n \"nestia\": \"^5.2.2\",\r\n \"prettier\": \"^3.2.4\",\r\n \"prettier-plugin-prisma\": \"^5.0.0\",\r\n \"rimraf\": \"^3.0.2\",\r\n \"source-map-support\": \"^0.5.21\",\r\n \"swagger-ui-express\": \"^5.0.0\",\r\n \"ts-loader\": \"^9.5.1\",\r\n \"ts-node\": \"^10.9.1\",\r\n \"ts-patch\": \"^3.0.2\",\r\n \"typescript\": \"^5.3.2\",\r\n \"typescript-transform-paths\": \"^3.4.6\",\r\n \"webpack\": \"^5.89.0\",\r\n \"webpack-cli\": \"^5.1.4\",\r\n \"write-file-webpack-plugin\": \"^4.5.1\"\r\n },\r\n \"dependencies\": {\r\n \"@nestia/core\": \"^2.5.6\",\r\n \"@nestia/fetcher\": \"^2.5.6\",\r\n \"@nestjs/common\": \"^10.3.3\",\r\n \"@nestjs/core\": \"^10.3.3\",\r\n \"@nestjs/platform-express\": \"^10.3.3\",\r\n \"commander\": \"10.0.0\",\r\n \"dotenv\": \"^16.3.1\",\r\n \"dotenv-expand\": \"^10.0.0\",\r\n \"inquirer\": \"8.2.5\",\r\n \"serialize-error\": \"^4.1.0\",\r\n \"tstl\": \"^2.5.13\",\r\n \"typia\": \"^5.4.8\",\r\n \"uuid\": \"^9.0.0\"\r\n },\r\n \"stackblitz\": {\r\n \"startCommand\": \"npm run prepare && npm run build:test && npm run test\"\r\n }\r\n}"
53
+ "content": "{\r\n \"private\": true,\r\n \"name\": \"@ORGANIZATION/PROJECT\",\r\n \"version\": \"0.1.0\",\r\n \"description\": \"Starter kit of Nestia\",\r\n \"main\": \"lib/index.js\",\r\n \"scripts\": {\r\n \"test\": \"node bin/test\",\r\n \"test:webpack\": \"npm run webpack && node bin/test/webpack.js\",\r\n \"------------------------BUILDS------------------------\": \"\",\r\n \"build\": \"npm run build:sdk && npm run build:main && npm run build:test\",\r\n \"build:api\": \"rimraf packages/api/lib && npm run build:sdk && tsc -p packages/api/tsconfig.json\",\r\n \"build:main\": \"rimraf lib && tsc\",\r\n \"build:sdk\": \"rimraf src/api/functional && nestia sdk\",\r\n \"build:swagger\": \"npx nestia swagger\",\r\n \"build:test\": \"rimraf bin && tsc -p test/tsconfig.json\",\r\n \"dev\": \"npm run build:test -- --watch\",\r\n \"eslint\": \"eslint src && eslint test\",\r\n \"eslint:fix\": \"eslint --fix src && eslint --fix test\",\r\n \"prepare\": \"ts-patch install && typia patch\",\r\n \"prettier\": \"prettier src --write && prettier test --write\",\r\n \"------------------------WEBPACK------------------------\": \"\",\r\n \"webpack\": \"rimraf dist && webpack\",\r\n \"webpack:start\": \"cd dist && node dist/server\",\r\n \"------------------------DEPLOYS------------------------\": \"\",\r\n \"package:api\": \"npm run build:swagger && npm run build:api && cd packages/api && npm publish\",\r\n \"start\": \"node lib/executable/server\",\r\n \"start:swagger\": \"ts-node src/executable/swagger.ts\"\r\n },\r\n \"repository\": {\r\n \"type\": \"git\",\r\n \"url\": \"https://github.com/samchon/nestia-start\"\r\n },\r\n \"keywords\": [\r\n \"nestia\",\r\n \"template\",\r\n \"boilerplate\"\r\n ],\r\n \"author\": \"AUTHOR\",\r\n \"license\": \"MIT\",\r\n \"bugs\": {\r\n \"url\": \"https://github.com/samchon/nestia-start/issues\"\r\n },\r\n \"homepage\": \"https://github.com/samchon/nestia-start#readme\",\r\n \"devDependencies\": {\r\n \"@nestia/e2e\": \"^0.4.1\",\r\n \"@nestia/sdk\": \"^2.5.8\",\r\n \"@trivago/prettier-plugin-sort-imports\": \"^4.3.0\",\r\n \"@types/cli\": \"^0.11.21\",\r\n \"@types/express\": \"^4.17.21\",\r\n \"@types/inquirer\": \"^8.2.5\",\r\n \"@types/node\": \"^18.11.0\",\r\n \"@types/uuid\": \"^8.3.4\",\r\n \"@typescript-eslint/eslint-plugin\": \"^6.19.1\",\r\n \"@typescript-eslint/parser\": \"^6.19.1\",\r\n \"chalk\": \"^4.1.0\",\r\n \"cli\": \"^1.0.1\",\r\n \"copy-webpack-plugin\": \"^11.0.0\",\r\n \"eslint-plugin-deprecation\": \"^2.0.0\",\r\n \"express\": \"^4.18.2\",\r\n \"nestia\": \"^5.2.2\",\r\n \"prettier\": \"^3.2.4\",\r\n \"prettier-plugin-prisma\": \"^5.0.0\",\r\n \"rimraf\": \"^3.0.2\",\r\n \"source-map-support\": \"^0.5.21\",\r\n \"swagger-ui-express\": \"^5.0.0\",\r\n \"ts-loader\": \"^9.5.1\",\r\n \"ts-node\": \"^10.9.1\",\r\n \"ts-patch\": \"^3.0.2\",\r\n \"typescript\": \"^5.3.2\",\r\n \"typescript-transform-paths\": \"^3.4.6\",\r\n \"webpack\": \"^5.89.0\",\r\n \"webpack-cli\": \"^5.1.4\",\r\n \"write-file-webpack-plugin\": \"^4.5.1\"\r\n },\r\n \"dependencies\": {\r\n \"@nestia/core\": \"^2.5.8\",\r\n \"@nestia/fetcher\": \"^2.5.8\",\r\n \"@nestjs/common\": \"^10.3.3\",\r\n \"@nestjs/core\": \"^10.3.3\",\r\n \"@nestjs/platform-express\": \"^10.3.3\",\r\n \"commander\": \"10.0.0\",\r\n \"dotenv\": \"^16.3.1\",\r\n \"dotenv-expand\": \"^10.0.0\",\r\n \"inquirer\": \"8.2.5\",\r\n \"serialize-error\": \"^4.1.0\",\r\n \"tstl\": \"^2.5.13\",\r\n \"typia\": \"^5.4.9\",\r\n \"uuid\": \"^9.0.0\"\r\n },\r\n \"stackblitz\": {\r\n \"startCommand\": \"npm run prepare && npm run build:test && npm run test\"\r\n }\r\n}"
54
54
  },
55
55
  {
56
56
  "location": "packages/api",
@@ -65,7 +65,7 @@ exports.NEST_TEMPLATE = [
65
65
  {
66
66
  "location": "packages/api",
67
67
  "file": "package.json",
68
- "content": "{\r\n \"name\": \"@ORGANIZATION/PROJECT-api\",\r\n \"version\": \"0.1.0\",\r\n \"description\": \"SDK library generated by Nestia\",\r\n \"main\": \"lib/index.js\",\r\n \"typings\": \"lib/index.d.ts\",\r\n \"scripts\": {\r\n \"build\": \"npm run build:sdk && npm run compile\",\r\n \"build:sdk\": \"rimraf ../../src/api/functional && cd ../.. && npx nestia sdk && cd packages/api\",\r\n \"compile\": \"rimraf lib && tsc\",\r\n \"deploy\": \"npm run build && npm publish\",\r\n \"prepare\": \"ts-patch install && typia patch\"\r\n },\r\n \"repository\": {\r\n \"type\": \"git\",\r\n \"url\": \"https://github.com/samchon/nestia\"\r\n },\r\n \"author\": \"Jeongho Nam\",\r\n \"license\": \"MIT\",\r\n \"bugs\": {\r\n \"url\": \"https://github.com/samchon/nestia/issues\"\r\n },\r\n \"homepage\": \"https://nestia.io\",\r\n \"files\": [\r\n \"lib\",\r\n \"swagger.json\",\r\n \"package.json\",\r\n \"README.md\"\r\n ],\r\n \"devDependencies\": {\r\n \"rimraf\": \"^5.0.5\",\r\n \"ts-node\": \"^10.9.2\",\r\n \"ts-patch\": \"^3.1.2\",\r\n \"typescript\": \"^5.3.3\"\r\n },\r\n \"dependencies\": {\r\n \"@nestia/fetcher\": \"^2.5.6\",\r\n \"typia\": \"^5.4.8\"\r\n }\r\n}"
68
+ "content": "{\r\n \"name\": \"@ORGANIZATION/PROJECT-api\",\r\n \"version\": \"0.1.0\",\r\n \"description\": \"SDK library generated by Nestia\",\r\n \"main\": \"lib/index.js\",\r\n \"typings\": \"lib/index.d.ts\",\r\n \"scripts\": {\r\n \"build\": \"npm run build:sdk && npm run compile\",\r\n \"build:sdk\": \"rimraf ../../src/api/functional && cd ../.. && npx nestia sdk && cd packages/api\",\r\n \"compile\": \"rimraf lib && tsc\",\r\n \"deploy\": \"npm run build && npm publish\",\r\n \"prepare\": \"ts-patch install && typia patch\"\r\n },\r\n \"repository\": {\r\n \"type\": \"git\",\r\n \"url\": \"https://github.com/samchon/nestia\"\r\n },\r\n \"author\": \"Jeongho Nam\",\r\n \"license\": \"MIT\",\r\n \"bugs\": {\r\n \"url\": \"https://github.com/samchon/nestia/issues\"\r\n },\r\n \"homepage\": \"https://nestia.io\",\r\n \"files\": [\r\n \"lib\",\r\n \"swagger.json\",\r\n \"package.json\",\r\n \"README.md\"\r\n ],\r\n \"devDependencies\": {\r\n \"rimraf\": \"^5.0.5\",\r\n \"ts-node\": \"^10.9.2\",\r\n \"ts-patch\": \"^3.1.2\",\r\n \"typescript\": \"^5.3.3\"\r\n },\r\n \"dependencies\": {\r\n \"@nestia/fetcher\": \"^2.5.8\",\r\n \"typia\": \"^5.4.9\"\r\n }\r\n}"
69
69
  },
70
70
  {
71
71
  "location": "packages/api",
@@ -1 +1 @@
1
- {"version":3,"file":"NEST_TEMPLATE.js","sourceRoot":"","sources":["../../src/bundles/NEST_TEMPLATE.ts"],"names":[],"mappings":";;;AAAa,QAAA,aAAa,GAAG;IAC3B;QACE,UAAU,EAAE,EAAE;QACd,MAAM,EAAE,MAAM;QACd,SAAS,EAAE,+CAA+C;KAC3D;IACD;QACE,UAAU,EAAE,EAAE;QACd,MAAM,EAAE,eAAe;QACvB,SAAS,EAAE,m1BAAm1B;KAC/1B;IACD;QACE,UAAU,EAAE,mBAAmB;QAC/B,MAAM,EAAE,WAAW;QACnB,SAAS,EAAE,0zBAA0zB;KACt0B;IACD;QACE,UA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,UAAU,EAAE,WAAW;QACvB,MAAM,EAAE,YAAY;QACpB,SAAS,EAAE,kVAAkV;KAC9V;IACD;QACE,UAAU,EAAE,cAAc;QAC1B,MAAM,EAAE,mBAAmB;QAC3B,SAAS,EAAE,gtEAAgtE;KAC5tE;IACD;QACE,UAAU,EAAE,MAAM;QAClB,MAAM,EAAE,UAAU;QAClB,SAAS,EAAE,64FAA64F;KACz5F;IACD;QACE,UAAU,EAAE,MAAM;QAClB,MAAM,EAAE,eAAe;QACvB,SAAS,EAAE,yJAAyJ;KACrK;IACD;QACE,UAAU,EAAE,MAAM;QAClB,MAAM,EAAE,YAAY;QACpB,SAAS,EAAE,80CAA80C;KAC11C;IACD;QACE,UAAU,EAAE,EAAE;QACd,MAAM,EAAE,eAAe;QACvB,SAAS,EAAE,y8XAAy8X;KACr9X;IACD;QACE,UAAU,EAAE,EAAE;QACd,MAAM,EAAE,mBAAmB;QAC3B,SAAS,EAAE,g1DAAg1D;KAC51D;CACF,CAAA"}
1
+ {"version":3,"file":"NEST_TEMPLATE.js","sourceRoot":"","sources":["../../src/bundles/NEST_TEMPLATE.ts"],"names":[],"mappings":";;;AAAa,QAAA,aAAa,GAAG;IAC3B;QACE,UAAU,EAAE,EAAE;QACd,MAAM,EAAE,MAAM;QACd,SAAS,EAAE,+CAA+C;KAC3D;IACD;QACE,UAAU,EAAE,EAAE;QACd,MAAM,EAAE,eAAe;QACvB,SAAS,EAAE,m1BAAm1B;KAC/1B;IACD;QACE,UAAU,EAAE,mBAAmB;QAC/B,MAAM,EAAE,WAAW;QACnB,SAAS,EAAE,0zBAA0zB;KACt0B;IACD;QACE,UAAU,EAAE,EAAE;QACd,MAAM,EAAE,YAAY;QACpB,SAAS,EAAE,iHAAiH;KAC7H;IACD;QACE,UAAU,EAAE,EAAE;QACd,MAAM,EAAE,iBAAiB;QACzB,SAAS,EAAE,iIAAiI;KAC7I;IACD;QACE,UAAU,EAAE,SAAS;QACrB,MAAM,EAAE,aAAa;QACrB,SAA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QAClB,SAAS,EAAE,64FAA64F;KACz5F;IACD;QACE,UAAU,EAAE,MAAM;QAClB,MAAM,EAAE,eAAe;QACvB,SAAS,EAAE,yJAAyJ;KACrK;IACD;QACE,UAAU,EAAE,MAAM;QAClB,MAAM,EAAE,YAAY;QACpB,SAAS,EAAE,80CAA80C;KAC11C;IACD;QACE,UAAU,EAAE,EAAE;QACd,MAAM,EAAE,eAAe;QACvB,SAAS,EAAE,y8XAAy8X;KACr9X;IACD;QACE,UAAU,EAAE,EAAE;QACd,MAAM,EAAE,mBAAmB;QAC3B,SAAS,EAAE,g1DAAg1D;KAC51D;CACF,CAAA"}
@@ -5,7 +5,17 @@ exports.SDK_TEMPLATE = [
5
5
  {
6
6
  "location": "",
7
7
  "file": ".gitignore",
8
- "content": ".git/\r\nlib/\r\nnode_modules/\r\n\r\npackage-lock.json\r\npnpm-lock.yaml"
8
+ "content": ".git/\r\nbin/\r\nlib/\r\nnode_modules/\r\n\r\npackage-lock.json\r\npnpm-lock.yaml"
9
+ },
10
+ {
11
+ "location": ".vscode",
12
+ "file": "launch.json",
13
+ "content": "{\r\n // Use IntelliSense to learn about possible Node.js debug attributes.\r\n // Hover to view descriptions of existing attributes.\r\n // For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387\r\n \"version\": \"0.2.0\",\r\n \"configurations\": [\r\n {\r\n \"type\": \"node\",\r\n \"request\": \"launch\",\r\n \"name\": \"JavaScript Test using SourceMap\",\r\n \"program\": \"${workspaceRoot}/test/index.ts\",\r\n \"cwd\": \"${workspaceRoot}\",\r\n \"args\": [\r\n //----\r\n // You can run specific test functions\r\n //----\r\n // \"--include\", \"something\",\r\n // \"--exclude\", \"nothing\",\r\n ],\r\n \"outFiles\": [\"${workspaceRoot}/bin/**/*.js\"],\r\n }\r\n ]\r\n}"
14
+ },
15
+ {
16
+ "location": ".vscode",
17
+ "file": "settings.json",
18
+ "content": "{\r\n \"editor.tabSize\": 2,\r\n \"editor.formatOnSave\": true,\r\n \"[javascript][typescript]\": {\r\n \"editor.defaultFormatter\": \"esbenp.prettier-vscode\",\r\n \"editor.codeActionsOnSave\": {\r\n \"source.fixAll.eslint\": \"explicit\"\r\n },\r\n },\r\n}"
9
19
  },
10
20
  {
11
21
  "location": "",
@@ -15,7 +25,12 @@ exports.SDK_TEMPLATE = [
15
25
  {
16
26
  "location": "",
17
27
  "file": "package.json",
18
- "content": "{\r\n \"name\": \"@ORGANIZATION/PROJECT-api\",\r\n \"version\": \"0.1.0\",\r\n \"description\": \"SDK library generated by Nestia\",\r\n \"main\": \"lib/index.js\",\r\n \"typings\": \"lib/index.d.ts\",\r\n \"scripts\": {\r\n \"build\": \"rimraf lib && tsc\",\r\n \"prepare\": \"ts-patch install && typia patch\"\r\n },\r\n \"repository\": {\r\n \"type\": \"git\",\r\n \"url\": \"https://github.com/samchon/nestia\"\r\n },\r\n \"author\": \"Jeongho Nam\",\r\n \"license\": \"MIT\",\r\n \"bugs\": {\r\n \"url\": \"https://github.com/samchon/nestia/issues\"\r\n },\r\n \"homepage\": \"https://nestia.io\",\r\n \"files\": [\r\n \"lib\",\r\n \"swagger.json\",\r\n \"package.json\",\r\n \"README.md\"\r\n ],\r\n \"devDependencies\": {\r\n \"rimraf\": \"^5.0.5\",\r\n \"ts-node\": \"^10.9.2\",\r\n \"ts-patch\": \"^3.1.2\",\r\n \"typescript\": \"^5.3.3\"\r\n },\r\n \"dependencies\": {\r\n \"@nestia/fetcher\": \"^2.5.6\",\r\n \"typia\": \"^5.4.8\"\r\n }\r\n}"
28
+ "content": "{\r\n \"name\": \"@ORGANIZATION/PROJECT-api\",\r\n \"version\": \"0.1.0\",\r\n \"description\": \"SDK library generated by Nestia\",\r\n \"main\": \"lib/index.js\",\r\n \"typings\": \"lib/index.d.ts\",\r\n \"scripts\": {\r\n \"build\": \"rimraf lib && tsc\",\r\n \"build:test\": \"rimraf bin && tsc --project test/tsconfig.json\",\r\n \"dev\": \"npm run build:test -- --watch\",\r\n \"prepare\": \"ts-patch install && typia patch\",\r\n \"test\": \"npx ts-node test/index.ts\"\r\n },\r\n \"repository\": {\r\n \"type\": \"git\",\r\n \"url\": \"https://github.com/samchon/nestia\"\r\n },\r\n \"author\": \"Jeongho Nam\",\r\n \"license\": \"MIT\",\r\n \"bugs\": {\r\n \"url\": \"https://github.com/samchon/nestia/issues\"\r\n },\r\n \"homepage\": \"https://nestia.io\",\r\n \"files\": [\r\n \"lib\",\r\n \"swagger.json\",\r\n \"package.json\",\r\n \"README.md\"\r\n ],\r\n \"devDependencies\": {\r\n \"@nestia/e2e\": \"^0.4.1\",\r\n \"@types/inquirer\": \"8.2.5\",\r\n \"commander\": \"^10.0.0\",\r\n \"inquirer\": \"8.2.5\",\r\n \"prettier\": \"^3.2.5\",\r\n \"rimraf\": \"^5.0.5\",\r\n \"ts-node\": \"^10.9.2\",\r\n \"ts-patch\": \"^3.1.2\",\r\n \"typescript\": \"^5.3.3\",\r\n \"typescript-transform-paths\": \"^3.4.6\"\r\n },\r\n \"dependencies\": {\r\n \"@nestia/fetcher\": \"^2.5.8\",\r\n \"typia\": \"^5.4.9\"\r\n },\r\n \"stackblitz\": {\r\n \"startCommand\": \"npm install && npm run test\"\r\n }\r\n}"
29
+ },
30
+ {
31
+ "location": "",
32
+ "file": "prettier.config.js",
33
+ "content": "module.exports = {\r\n // DEFAULT CONFIGURATIONS\r\n parser: \"typescript\",\r\n printWidth: 80,\r\n semi: true,\r\n tabWidth: 2,\r\n trailingComma: \"all\",\r\n};\r\n"
19
34
  },
20
35
  {
21
36
  "location": "",
@@ -47,10 +62,30 @@ exports.SDK_TEMPLATE = [
47
62
  "file": "Primitive.ts",
48
63
  "content": "export type { Primitive } from \"@nestia/fetcher\";\r\n"
49
64
  },
65
+ {
66
+ "location": "test",
67
+ "file": "index.ts",
68
+ "content": "import { DynamicExecutor } from \"@nestia/e2e\";\r\nimport { ArgumentParser } from \"./utils/ArgumentParser\";\r\nimport { TestGlobal } from \"./TestGlobal\";\r\n\r\ninterface IOptions {\r\n simulate: boolean;\r\n include?: string[];\r\n exclude?: string[];\r\n trace: boolean;\r\n}\r\n\r\nconst getOptions = () =>\r\n ArgumentParser.parse<IOptions>(async (command, prompt, action) => {\r\n command.option(\"--simulate <boolean>\", \"Mockup Simultator\");\r\n command.option(\"--include <string...>\", \"include feature files\");\r\n command.option(\"--exclude <string...>\", \"exclude feature files\");\r\n command.option(\"--trace <boolean>\", \"trace detailed errors\");\r\n\r\n return action(async (options) => {\r\n if (typeof options.simulate === \"string\")\r\n options.simulate = options.simulate === \"true\";\r\n options.simulate ??= await prompt.boolean(\"simulate\")(\"Mockup Simulator\");\r\n options.trace = options.trace !== (\"false\" as any);\r\n return options as IOptions;\r\n });\r\n });\r\n\r\nconst main = async (): Promise<void> => {\r\n // DO TEST\r\n const options: IOptions = await getOptions();\r\n const report: DynamicExecutor.IReport = await DynamicExecutor.validate({\r\n prefix: \"test\",\r\n parameters: () => [\r\n {\r\n ...TestGlobal.connection(),\r\n simulate: options.simulate,\r\n },\r\n ],\r\n filter: (func) =>\r\n (!options.include?.length ||\r\n (options.include ?? []).some((str) => func.includes(str))) &&\r\n (!options.exclude?.length ||\r\n (options.exclude ?? []).every((str) => !func.includes(str))),\r\n extension: __filename.substring(__filename.length - 2),\r\n })(__dirname + \"/features\");\r\n\r\n // REPORT EXCEPTIONS\r\n const exceptions: Error[] = report.executions\r\n .filter((exec) => exec.error !== null)\r\n .map((exec) => exec.error!);\r\n if (exceptions.length === 0) {\r\n console.log(\"Success\");\r\n console.log(\"Elapsed time\", report.time.toLocaleString(), `ms`);\r\n } else {\r\n if (options.trace !== false) for (const exp of exceptions) console.log(exp);\r\n console.log(\"Failed\");\r\n console.log(\"Elapsed time\", report.time.toLocaleString(), `ms`);\r\n }\r\n\r\n // TERMINATE\r\n if (exceptions.length) process.exit(-1);\r\n else process.exit(0);\r\n};\r\nmain().catch((exp) => {\r\n console.log(exp);\r\n process.exit(-1);\r\n});\r\n"
69
+ },
70
+ {
71
+ "location": "test",
72
+ "file": "TestGlobal.ts",
73
+ "content": "import api from \"@ORGANIZATION/PROJECT-api\";\r\n\r\nexport namespace TestGlobal {\r\n export const connection = (): api.IConnection => ({\r\n host: `http://127.0.0.1:37001`,\r\n });\r\n}\r\n"
74
+ },
75
+ {
76
+ "location": "test",
77
+ "file": "tsconfig.json",
78
+ "content": "{\r\n \"extends\": \"../tsconfig.json\",\r\n \"compilerOptions\": {\r\n \"outDir\": \"../bin\",\r\n \"paths\": {\r\n \"@ORGANIZATION/PROJECT-api\": [\"../src\"],\r\n \"@ORGANIZATION/PROJECT-api/lib/*\": [\"../src/*\"],\r\n },\r\n \"plugins\": [\r\n { \"transform\": \"typia/lib/transform\" },\r\n { \"transform\": \"typescript-transform-paths\" },\r\n ],\r\n },\r\n \"include\": [\r\n \".\", \r\n \"../src\",\r\n ],\r\n}"
79
+ },
80
+ {
81
+ "location": "test/utils",
82
+ "file": "ArgumentParser.ts",
83
+ "content": "import commander from \"commander\";\r\nimport * as inquirer from \"inquirer\";\r\n\r\nexport namespace ArgumentParser {\r\n export type Inquiry<T> = (\r\n command: commander.Command,\r\n prompt: (opt?: inquirer.StreamOptions) => inquirer.PromptModule,\r\n action: (closure: (options: Partial<T>) => Promise<T>) => Promise<T>,\r\n ) => Promise<T>;\r\n\r\n export interface Prompt {\r\n select: (\r\n name: string,\r\n ) => (\r\n message: string,\r\n ) => <Choice extends string>(choices: Choice[]) => Promise<Choice>;\r\n boolean: (name: string) => (message: string) => Promise<boolean>;\r\n }\r\n\r\n export const parse = async <T>(\r\n inquiry: (\r\n command: commander.Command,\r\n prompt: Prompt,\r\n action: (closure: (options: Partial<T>) => Promise<T>) => Promise<T>,\r\n ) => Promise<T>,\r\n ): Promise<T> => {\r\n // TAKE OPTIONS\r\n const action = (closure: (options: Partial<T>) => Promise<T>) =>\r\n new Promise<T>((resolve, reject) => {\r\n commander.program.action(async (options) => {\r\n try {\r\n resolve(await closure(options));\r\n } catch (exp) {\r\n reject(exp);\r\n }\r\n });\r\n commander.program.parseAsync().catch(reject);\r\n });\r\n\r\n const select =\r\n (name: string) =>\r\n (message: string) =>\r\n async <Choice extends string>(choices: Choice[]): Promise<Choice> =>\r\n (\r\n await inquirer.createPromptModule()({\r\n type: \"list\",\r\n name,\r\n message,\r\n choices,\r\n })\r\n )[name];\r\n const boolean = (name: string) => async (message: string) =>\r\n (\r\n await inquirer.createPromptModule()({\r\n type: \"confirm\",\r\n name,\r\n message,\r\n })\r\n )[name] as boolean;\r\n\r\n const output: T | Error = await (async () => {\r\n try {\r\n return await inquiry(commander.program, { select, boolean }, action);\r\n } catch (error) {\r\n return error as Error;\r\n }\r\n })();\r\n\r\n // RETURNS\r\n if (output instanceof Error) throw output;\r\n return output;\r\n };\r\n}\r\n"
84
+ },
50
85
  {
51
86
  "location": "",
52
87
  "file": "tsconfig.json",
53
- "content": "{\r\n \"compilerOptions\": {\r\n /* Visit https://aka.ms/tsconfig to read more about this file */\r\n /* Projects */\r\n // \"incremental\": true, /* Save .tsbuildinfo files to allow for incremental compilation of projects. */\r\n // \"composite\": true, /* Enable constraints that allow a TypeScript project to be used with project references. */\r\n // \"tsBuildInfoFile\": \"./.tsbuildinfo\", /* Specify the path to .tsbuildinfo incremental compilation file. */\r\n // \"disableSourceOfProjectReferenceRedirect\": true, /* Disable preferring source files instead of declaration files when referencing composite projects. */\r\n // \"disableSolutionSearching\": true, /* Opt a project out of multi-project reference checking when editing. */\r\n // \"disableReferencedProjectLoad\": true, /* Reduce the number of projects loaded automatically by TypeScript. */\r\n /* Language and Environment */\r\n \"target\": \"ES5\", /* Set the JavaScript language version for emitted JavaScript and include compatible library declarations. */\r\n \"lib\": [\r\n \"DOM\",\r\n \"ES2015\"\r\n ], /* Specify a set of bundled library declaration files that describe the target runtime environment. */// \"jsx\": \"preserve\", /* Specify what JSX code is generated. */\r\n // \"experimentalDecorators\": true, /* Enable experimental support for TC39 stage 2 draft decorators. */\r\n // \"emitDecoratorMetadata\": true, /* Emit design-type metadata for decorated declarations in source files. */\r\n // \"jsxFactory\": \"\", /* Specify the JSX factory function used when targeting React JSX emit, e.g. 'React.createElement' or 'h'. */\r\n // \"jsxFragmentFactory\": \"\", /* Specify the JSX Fragment reference used for fragments when targeting React JSX emit e.g. 'React.Fragment' or 'Fragment'. */\r\n // \"jsxImportSource\": \"\", /* Specify module specifier used to import the JSX factory functions when using 'jsx: react-jsx*'. */\r\n // \"reactNamespace\": \"\", /* Specify the object invoked for 'createElement'. This only applies when targeting 'react' JSX emit. */\r\n // \"noLib\": true, /* Disable including any library files, including the default lib.d.ts. */\r\n // \"useDefineForClassFields\": true, /* Emit ECMAScript-standard-compliant class fields. */\r\n // \"moduleDetection\": \"auto\", /* Control what method is used to detect module-format JS files. */\r\n /* Modules */\r\n \"module\": \"commonjs\", /* Specify what module code is generated. */// \"rootDir\": \"./\", /* Specify the root folder within your source files. */\r\n // \"moduleResolution\": \"node\", /* Specify how TypeScript looks up a file from a given module specifier. */\r\n // \"baseUrl\": \"./\", /* Specify the base directory to resolve non-relative module names. */\r\n // \"paths\": {}, /* Specify a set of entries that re-map imports to additional lookup locations. */\r\n // \"rootDirs\": [], /* Allow multiple folders to be treated as one when resolving modules. */\r\n // \"typeRoots\": [], /* Specify multiple folders that act like './node_modules/@types'. */\r\n // \"types\": [], /* Specify type package names to be included without being referenced in a source file. */\r\n // \"allowUmdGlobalAccess\": true, /* Allow accessing UMD globals from modules. */\r\n // \"moduleSuffixes\": [], /* List of file name suffixes to search when resolving a module. */\r\n // \"resolveJsonModule\": true, /* Enable importing .json files. */\r\n // \"noResolve\": true, /* Disallow 'import's, 'require's or '<reference>'s from expanding the number of files TypeScript should add to a project. */\r\n /* JavaScript Support */\r\n // \"allowJs\": true, /* Allow JavaScript files to be a part of your program. Use the 'checkJS' option to get errors from these files. */\r\n // \"checkJs\": true, /* Enable error reporting in type-checked JavaScript files. */\r\n // \"maxNodeModuleJsDepth\": 1, /* Specify the maximum folder depth used for checking JavaScript files from 'node_modules'. Only applicable with 'allowJs'. */\r\n /* Emit */\r\n \"declaration\": true, /* Generate .d.ts files from TypeScript and JavaScript files in your project. */// \"declarationMap\": true, /* Create sourcemaps for d.ts files. */\r\n // \"emitDeclarationOnly\": true, /* Only output d.ts files and not JavaScript files. */\r\n \"sourceMap\": true, /* Create source map files for emitted JavaScript files. */// \"outFile\": \"./\", /* Specify a file that bundles all outputs into one JavaScript file. If 'declaration' is true, also designates a file that bundles all .d.ts output. */\r\n \"outDir\": \"./lib\", /* Specify an output folder for all emitted files. */// \"removeComments\": true, /* Disable emitting comments. */\r\n // \"noEmit\": true, /* Disable emitting files from a compilation. */\r\n // \"importHelpers\": true, /* Allow importing helper functions from tslib once per project, instead of including them per-file. */\r\n // \"importsNotUsedAsValues\": \"remove\", /* Specify emit/checking behavior for imports that are only used for types. */\r\n \"downlevelIteration\": true, /* Emit more compliant, but verbose and less performant JavaScript for iteration. */// \"sourceRoot\": \"\", /* Specify the root path for debuggers to find the reference source code. */\r\n // \"mapRoot\": \"\", /* Specify the location where debugger should locate map files instead of generated locations. */\r\n // \"inlineSourceMap\": true, /* Include sourcemap files inside the emitted JavaScript. */\r\n // \"inlineSources\": true, /* Include source code in the sourcemaps inside the emitted JavaScript. */\r\n // \"emitBOM\": true, /* Emit a UTF-8 Byte Order Mark (BOM) in the beginning of output files. */\r\n \"newLine\": \"lf\", /* Set the newline character for emitting files. */// \"stripInternal\": true, /* Disable emitting declarations that have '@internal' in their JSDoc comments. */\r\n // \"noEmitHelpers\": true, /* Disable generating custom helper functions like '__extends' in compiled output. */\r\n // \"noEmitOnError\": true, /* Disable emitting files if any type checking errors are reported. */\r\n // \"preserveConstEnums\": true, /* Disable erasing 'const enum' declarations in generated code. */\r\n // \"declarationDir\": \"./\", /* Specify the output directory for generated declaration files. */\r\n // \"preserveValueImports\": true, /* Preserve unused imported values in the JavaScript output that would otherwise be removed. */\r\n /* Interop Constraints */\r\n // \"isolatedModules\": true, /* Ensure that each file can be safely transpiled without relying on other imports. */\r\n // \"allowSyntheticDefaultImports\": true, /* Allow 'import x from y' when a module doesn't have a default export. */\r\n \"esModuleInterop\": true, /* Emit additional JavaScript to ease support for importing CommonJS modules. This enables 'allowSyntheticDefaultImports' for type compatibility. */// \"preserveSymlinks\": true, /* Disable resolving symlinks to their realpath. This correlates to the same flag in node. */\r\n \"forceConsistentCasingInFileNames\": true, /* Ensure that casing is correct in imports. *//* Type Checking */\r\n \"strict\": true, /* Enable all strict type-checking options. */// \"noImplicitAny\": true, /* Enable error reporting for expressions and declarations with an implied 'any' type. */\r\n // \"strictNullChecks\": true, /* When type checking, take into account 'null' and 'undefined'. */\r\n // \"strictFunctionTypes\": true, /* When assigning functions, check to ensure parameters and the return values are subtype-compatible. */\r\n // \"strictBindCallApply\": true, /* Check that the arguments for 'bind', 'call', and 'apply' methods match the original function. */\r\n // \"strictPropertyInitialization\": true, /* Check for class properties that are declared but not set in the constructor. */\r\n // \"noImplicitThis\": true, /* Enable error reporting when 'this' is given the type 'any'. */\r\n // \"useUnknownInCatchVariables\": true, /* Default catch clause variables as 'unknown' instead of 'any'. */\r\n // \"alwaysStrict\": true, /* Ensure 'use strict' is always emitted. */\r\n // \"noUnusedLocals\": true, /* Enable error reporting when local variables aren't read. */\r\n // \"noUnusedParameters\": true, /* Raise an error when a function parameter isn't read. */\r\n // \"exactOptionalPropertyTypes\": true, /* Interpret optional property types as written, rather than adding 'undefined'. */\r\n // \"noImplicitReturns\": true, /* Enable error reporting for codepaths that do not explicitly return in a function. */\r\n // \"noFallthroughCasesInSwitch\": true, /* Enable error reporting for fallthrough cases in switch statements. */\r\n // \"noUncheckedIndexedAccess\": true, /* Add 'undefined' to a type when accessed using an index. */\r\n // \"noImplicitOverride\": true, /* Ensure overriding members in derived classes are marked with an override modifier. */\r\n // \"noPropertyAccessFromIndexSignature\": true, /* Enforces using indexed accessors for keys declared using an indexed type. */\r\n // \"allowUnusedLabels\": true, /* Disable error reporting for unused labels. */\r\n // \"allowUnreachableCode\": true, /* Disable error reporting for unreachable code. */\r\n /* Completeness */\r\n // \"skipDefaultLibCheck\": true, /* Skip type checking .d.ts files that are included with TypeScript. */\r\n \"skipLibCheck\": true, /* Skip type checking all .d.ts files. */\r\n \"plugins\": [\r\n {\r\n \"transform\": \"typia/lib/transform\"\r\n }\r\n ]\r\n }\r\n}"
88
+ "content": "{\r\n \"compilerOptions\": {\r\n /* Visit https://aka.ms/tsconfig to read more about this file */\r\n /* Projects */\r\n // \"incremental\": true, /* Save .tsbuildinfo files to allow for incremental compilation of projects. */\r\n // \"composite\": true, /* Enable constraints that allow a TypeScript project to be used with project references. */\r\n // \"tsBuildInfoFile\": \"./.tsbuildinfo\", /* Specify the path to .tsbuildinfo incremental compilation file. */\r\n // \"disableSourceOfProjectReferenceRedirect\": true, /* Disable preferring source files instead of declaration files when referencing composite projects. */\r\n // \"disableSolutionSearching\": true, /* Opt a project out of multi-project reference checking when editing. */\r\n // \"disableReferencedProjectLoad\": true, /* Reduce the number of projects loaded automatically by TypeScript. */\r\n /* Language and Environment */\r\n \"target\": \"ES5\", /* Set the JavaScript language version for emitted JavaScript and include compatible library declarations. */\r\n \"lib\": [\r\n \"DOM\",\r\n \"ES2015\"\r\n ], /* Specify a set of bundled library declaration files that describe the target runtime environment. */// \"jsx\": \"preserve\", /* Specify what JSX code is generated. */\r\n // \"experimentalDecorators\": true, /* Enable experimental support for TC39 stage 2 draft decorators. */\r\n // \"emitDecoratorMetadata\": true, /* Emit design-type metadata for decorated declarations in source files. */\r\n // \"jsxFactory\": \"\", /* Specify the JSX factory function used when targeting React JSX emit, e.g. 'React.createElement' or 'h'. */\r\n // \"jsxFragmentFactory\": \"\", /* Specify the JSX Fragment reference used for fragments when targeting React JSX emit e.g. 'React.Fragment' or 'Fragment'. */\r\n // \"jsxImportSource\": \"\", /* Specify module specifier used to import the JSX factory functions when using 'jsx: react-jsx*'. */\r\n // \"reactNamespace\": \"\", /* Specify the object invoked for 'createElement'. This only applies when targeting 'react' JSX emit. */\r\n // \"noLib\": true, /* Disable including any library files, including the default lib.d.ts. */\r\n // \"useDefineForClassFields\": true, /* Emit ECMAScript-standard-compliant class fields. */\r\n // \"moduleDetection\": \"auto\", /* Control what method is used to detect module-format JS files. */\r\n /* Modules */\r\n \"module\": \"commonjs\", /* Specify what module code is generated. */// \"rootDir\": \"./\", /* Specify the root folder within your source files. */\r\n // \"moduleResolution\": \"node\", /* Specify how TypeScript looks up a file from a given module specifier. */\r\n // \"baseUrl\": \"./\", /* Specify the base directory to resolve non-relative module names. */\r\n // \"paths\": {}, /* Specify a set of entries that re-map imports to additional lookup locations. */\r\n // \"rootDirs\": [], /* Allow multiple folders to be treated as one when resolving modules. */\r\n // \"typeRoots\": [], /* Specify multiple folders that act like './node_modules/@types'. */\r\n // \"types\": [], /* Specify type package names to be included without being referenced in a source file. */\r\n // \"allowUmdGlobalAccess\": true, /* Allow accessing UMD globals from modules. */\r\n // \"moduleSuffixes\": [], /* List of file name suffixes to search when resolving a module. */\r\n // \"resolveJsonModule\": true, /* Enable importing .json files. */\r\n // \"noResolve\": true, /* Disallow 'import's, 'require's or '<reference>'s from expanding the number of files TypeScript should add to a project. */\r\n /* JavaScript Support */\r\n // \"allowJs\": true, /* Allow JavaScript files to be a part of your program. Use the 'checkJS' option to get errors from these files. */\r\n // \"checkJs\": true, /* Enable error reporting in type-checked JavaScript files. */\r\n // \"maxNodeModuleJsDepth\": 1, /* Specify the maximum folder depth used for checking JavaScript files from 'node_modules'. Only applicable with 'allowJs'. */\r\n /* Emit */\r\n \"declaration\": true, /* Generate .d.ts files from TypeScript and JavaScript files in your project. */// \"declarationMap\": true, /* Create sourcemaps for d.ts files. */\r\n // \"emitDeclarationOnly\": true, /* Only output d.ts files and not JavaScript files. */\r\n \"sourceMap\": true, /* Create source map files for emitted JavaScript files. */// \"outFile\": \"./\", /* Specify a file that bundles all outputs into one JavaScript file. If 'declaration' is true, also designates a file that bundles all .d.ts output. */\r\n \"outDir\": \"./lib\", /* Specify an output folder for all emitted files. */// \"removeComments\": true, /* Disable emitting comments. */\r\n // \"noEmit\": true, /* Disable emitting files from a compilation. */\r\n // \"importHelpers\": true, /* Allow importing helper functions from tslib once per project, instead of including them per-file. */\r\n // \"importsNotUsedAsValues\": \"remove\", /* Specify emit/checking behavior for imports that are only used for types. */\r\n \"downlevelIteration\": true, /* Emit more compliant, but verbose and less performant JavaScript for iteration. */// \"sourceRoot\": \"\", /* Specify the root path for debuggers to find the reference source code. */\r\n // \"mapRoot\": \"\", /* Specify the location where debugger should locate map files instead of generated locations. */\r\n // \"inlineSourceMap\": true, /* Include sourcemap files inside the emitted JavaScript. */\r\n // \"inlineSources\": true, /* Include source code in the sourcemaps inside the emitted JavaScript. */\r\n // \"emitBOM\": true, /* Emit a UTF-8 Byte Order Mark (BOM) in the beginning of output files. */\r\n \"newLine\": \"lf\", /* Set the newline character for emitting files. */// \"stripInternal\": true, /* Disable emitting declarations that have '@internal' in their JSDoc comments. */\r\n // \"noEmitHelpers\": true, /* Disable generating custom helper functions like '__extends' in compiled output. */\r\n // \"noEmitOnError\": true, /* Disable emitting files if any type checking errors are reported. */\r\n // \"preserveConstEnums\": true, /* Disable erasing 'const enum' declarations in generated code. */\r\n // \"declarationDir\": \"./\", /* Specify the output directory for generated declaration files. */\r\n // \"preserveValueImports\": true, /* Preserve unused imported values in the JavaScript output that would otherwise be removed. */\r\n /* Interop Constraints */\r\n // \"isolatedModules\": true, /* Ensure that each file can be safely transpiled without relying on other imports. */\r\n // \"allowSyntheticDefaultImports\": true, /* Allow 'import x from y' when a module doesn't have a default export. */\r\n \"esModuleInterop\": true, /* Emit additional JavaScript to ease support for importing CommonJS modules. This enables 'allowSyntheticDefaultImports' for type compatibility. */// \"preserveSymlinks\": true, /* Disable resolving symlinks to their realpath. This correlates to the same flag in node. */\r\n \"forceConsistentCasingInFileNames\": true, /* Ensure that casing is correct in imports. *//* Type Checking */\r\n \"strict\": true, /* Enable all strict type-checking options. */// \"noImplicitAny\": true, /* Enable error reporting for expressions and declarations with an implied 'any' type. */\r\n // \"strictNullChecks\": true, /* When type checking, take into account 'null' and 'undefined'. */\r\n // \"strictFunctionTypes\": true, /* When assigning functions, check to ensure parameters and the return values are subtype-compatible. */\r\n // \"strictBindCallApply\": true, /* Check that the arguments for 'bind', 'call', and 'apply' methods match the original function. */\r\n // \"strictPropertyInitialization\": true, /* Check for class properties that are declared but not set in the constructor. */\r\n // \"noImplicitThis\": true, /* Enable error reporting when 'this' is given the type 'any'. */\r\n // \"useUnknownInCatchVariables\": true, /* Default catch clause variables as 'unknown' instead of 'any'. */\r\n // \"alwaysStrict\": true, /* Ensure 'use strict' is always emitted. */\r\n // \"noUnusedLocals\": true, /* Enable error reporting when local variables aren't read. */\r\n // \"noUnusedParameters\": true, /* Raise an error when a function parameter isn't read. */\r\n // \"exactOptionalPropertyTypes\": true, /* Interpret optional property types as written, rather than adding 'undefined'. */\r\n // \"noImplicitReturns\": true, /* Enable error reporting for codepaths that do not explicitly return in a function. */\r\n // \"noFallthroughCasesInSwitch\": true, /* Enable error reporting for fallthrough cases in switch statements. */\r\n // \"noUncheckedIndexedAccess\": true, /* Add 'undefined' to a type when accessed using an index. */\r\n // \"noImplicitOverride\": true, /* Ensure overriding members in derived classes are marked with an override modifier. */\r\n // \"noPropertyAccessFromIndexSignature\": true, /* Enforces using indexed accessors for keys declared using an indexed type. */\r\n // \"allowUnusedLabels\": true, /* Disable error reporting for unused labels. */\r\n // \"allowUnreachableCode\": true, /* Disable error reporting for unreachable code. */\r\n /* Completeness */\r\n // \"skipDefaultLibCheck\": true, /* Skip type checking .d.ts files that are included with TypeScript. */\r\n \"skipLibCheck\": true, /* Skip type checking all .d.ts files. */\r\n \"plugins\": [\r\n {\r\n \"transform\": \"typia/lib/transform\"\r\n }\r\n ]\r\n },\r\n \"include\": [\"src\"],\r\n}"
54
89
  }
55
90
  ];
56
91
  //# sourceMappingURL=SDK_TEMPLATE.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"SDK_TEMPLATE.js","sourceRoot":"","sources":["../../src/bundles/SDK_TEMPLATE.ts"],"names":[],"mappings":";;;AAAa,QAAA,YAAY,GAAG;IAC1B;QACE,UAAU,EAAE,EAAE;QACd,MAAM,EAAE,YAAY;QACpB,SAAS,EAAE,2EAA2E;KACvF;IACD;QACE,UAAU,EAAE,EAAE;QACd,MAAM,EAAE,SAAS;QACjB,SAAS,EAAE,inCAAinC;KAC7nC;IACD;QACE,UAAU,EAAE,EAAE;QACd,MAAM,EAAE,cAAc;QACtB,SAAS,EAAE,2/BAA2/B;KACvgC;IACD;QACE,UAAU,EAAE,EAAE;QACd,MAAM,EAAE,WAAW;QACnB,SAAS,EAAE,mmEAAmmE;KAC/mE;IACD;QACE,UAAU,EAAE,KAAK;QACjB,MAAM,EAAE,cAAc;QACtB,SAAS,EAAE,oDAAoD;KAChE;IACD;QACE,UAAU,EAAE,KAAK;QACjB,MAAM,EAAE,gBAAgB;QACxB,SAAS,EAAE,2DAA2D;KACvE;IACD;QACE,UAAU,EAAE,KAAK;QACjB,MAAM,EAAE,UAAU;QAClB,SAAS,EAAE,kGAAkG;KAC9G;IACD;QACE,UAAU,EAAE,KAAK;QACjB,MAAM,EAAE,WAAW;QACnB,SAAS,EAAE,kIAAkI;KAC9I;IACD;QACE,UAAU,EAAE,KAAK;QACjB,MAAM,EAAE,cAAc;QACtB,SAAS,EAAE,yDAAyD;KACrE;IACD;QACE,UAAU,EAAE,EAAE;QACd,MAAM,EAAE,eAAe;QACvB,SAAS,EAAE,6sWAA6sW;KACztW;CACF,CAAA"}
1
+ {"version":3,"file":"SDK_TEMPLATE.js","sourceRoot":"","sources":["../../src/bundles/SDK_TEMPLATE.ts"],"names":[],"mappings":";;;AAAa,QAAA,YAAY,GAAG;IAC1B;QACE,UAAU,EAAE,EAAE;QACd,MAAM,EAAE,YAAY;QACpB,SAAS,EAAE,mFAAmF;KAC/F;IACD;QACE,UAAU,EAAE,SAAS;QACrB,MAAM,EAAE,aAAa;QACrB,SAAS,EAAE,oxBAAoxB;KAChyB;IACD;QACE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AM,EAAE,eAAe;QACvB,SAAS,EAAE,2uWAA2uW;KACvvW;CACF,CAAA"}
@@ -95,6 +95,7 @@ const main = () => __awaiter(void 0, void 0, void 0, function* () {
95
95
  ".github/workflows/build.yml",
96
96
  "src/functional",
97
97
  "src/structures",
98
+ "test/features",
98
99
  ],
99
100
  });
100
101
  });
@@ -1 +1 @@
1
- {"version":3,"file":"bundle.js","sourceRoot":"","sources":["../../src/executable/bundle.ts"],"names":[],"mappings":";;;;;;;;;;;;;;AAAA,kEAA+B;AAC/B,4CAAoB;AAIpB,MAAM,IAAI,GAAW,GAAG,SAAS,QAAQ,CAAC;AAC1C,MAAM,MAAM,GAAW,GAAG,IAAI,SAAS,CAAC;AAExC,MAAM,MAAM,GAAG,CAAO,KAIrB,EAAiB,EAAE;IAClB,MAAM,IAAI,GAAW,GAAG,SAAS,QAAQ,CAAC;IAC1C,MAAM,MAAM,GAAW,GAAG,IAAI,SAAS,CAAC;IACxC,MAAM,QAAQ,GAAW,GAAG,MAAM,IAAI,KAAK,CAAC,IAAI,EAAE,CAAC;IAEnD,MAAM,KAAK,GAAG,GAAS,EAAE;;QACvB,mBAAmB;QACnB,IAAI,YAAE,CAAC,UAAU,CAAC,QAAQ,CAAC;YACzB,MAAM,YAAE,CAAC,QAAQ,CAAC,EAAE,CAAC,QAAQ,EAAE,EAAE,SAAS,EAAE,IAAI,EAAE,CAAC,CAAC;;YAEpD,IAAI,CAAC;gBACH,MAAM,YAAE,CAAC,QAAQ,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC;YAClC,CAAC;YAAC,WAAM,CAAC,CAAA,CAAC;QAEZ,uBAAE,CAAC,QAAQ,CACT,wCAAwC,KAAK,CAAC,UAAU,IAAI,KAAK,CAAC,IAAI,EAAE,EACxE;YACE,GAAG,EAAE,MAAM;SACZ,CACF,CAAC;QAEF,0BAA0B;QAC1B,KAAK,MAAM,QAAQ,IAAI,MAAA,KAAK,CAAC,UAAU,mCAAI,EAAE;YAC3C,MAAM,YA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AAC;YACH,MAAM,YAAE,CAAC,QAAQ,CAAC,KAAK,CAAC,GAAG,IAAI,cAAc,CAAC,CAAC;QACjD,CAAC;QAAC,WAAM,CAAC,CAAA,CAAC;QACV,MAAM,YAAE,CAAC,QAAQ,CAAC,SAAS,CACzB,GAAG,IAAI,gBAAgB,IAAI,KAAK,EAChC,OAAO,EACP,MAAM,CACP,CAAC;IACJ,CAAC,CAAA,CAAC;IAEF,MAAM,UAAU,GAAmB,EAAE,CAAC;IACtC,MAAM,KAAK,EAAE,CAAC;IACd,MAAM,OAAO,CAAC,UAAU,CAAC,CAAC,QAAQ,CAAC,CAAC;IACpC,MAAM,OAAO,CAAC,UAAU,CAAC,CAAC;AAC5B,CAAC,CAAA,CAAC;AAEF,MAAM,IAAI,GAAG,GAAwB,EAAE;IACrC,MAAM,MAAM,CAAC;QACX,IAAI,EAAE,MAAM;QACZ,UAAU,EAAE,cAAc;QAC1B,UAAU,EAAE;YACV,MAAM;YACN,wBAAwB;YACxB,oBAAoB;YACpB,iBAAiB;YACjB,iBAAiB;YACjB,eAAe;YACf,eAAe;SAChB;KACF,CAAC,CAAC;IACH,MAAM,MAAM,CAAC;QACX,IAAI,EAAE,KAAK;QACX,UAAU,EAAE,qBAAqB;QACjC,UAAU,EAAE;YACV,MAAM;YACN,wBAAwB;YACxB,6BAA6B;YAC7B,gBAAgB;YAChB,gBAAgB;YAChB,eAAe;SAChB;KACF,CAAC,CAAC;AACL,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"}
@@ -44,9 +44,7 @@ var MigrateCommander;
44
44
  return swagger;
45
45
  })();
46
46
  const app = new module_1.MigrateApplication(swagger);
47
- const { files } = options.mode === "nest"
48
- ? app.nest(options.simulate)
49
- : app.sdk(options.simulate);
47
+ const { files } = options.mode === "nest" ? app.nest(options) : app.sdk(options);
50
48
  yield MigrateFileArchiver_1.MigrateFileArchiver.archive({
51
49
  mkdir: fs_1.default.promises.mkdir,
52
50
  writeFile: (file, content) => __awaiter(this, void 0, void 0, function* () { return fs_1.default.promises.writeFile(file, yield beautify(content), "utf-8"); }),
@@ -1 +1 @@
1
- {"version":3,"file":"MigrateCommander.js","sourceRoot":"","sources":["../../src/internal/MigrateCommander.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA,4CAAoB;AACpB,gDAAwB;AACxB,uCAAkC;AAElC,0EAAuE;AACvE,sCAA+C;AAE/C,uDAAoD;AAEpD,IAAiB,gBAAgB,CAoDhC;AApDD,WAAiB,gBAAgB;IAClB,qBAAI,GAAG,GAAwB,EAAE;QAC5C,MAAM,OAAO,GAAG,CAAC,GAAuB,EAAE,EAAE,CAC1C,GAAG,CAAC,CAAC,CAAC,cAAI,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC;QAC5D,MAAM,OAAO,GAA4B,MAAM,iCAAe,CAAC,KAAK,EAAE,CAAC;QAEvE,4BAA4B;QAC5B,MAAM,MAAM,GAAW,OAAO,CAAC,OAAO,CAAC,MAAM,GAAG,KAAK,CAAE,CAAC;QACxD,IAAI,YAAE,CAAC,UAAU,CAAC,OAAO,CAAC,MAAM,CAAC;YAAE,IAAI,CAAC,iCAAiC,CAAC,CAAC;aACtE,IAAI,YAAE,CAAC,UAAU,CAAC,MAAM,CAAC,KAAK,KAAK;YACtC,IAAI,CAAC,qDAAqD,CAAC,CAAC;aACzD,IAAI,YAAE,CAAC,QAAQ,CAAC,MAAM,CAAC,CAAC,WAAW,EAAE,KAAK,KAAK;YAClD,IAAI,CAAC,+CAA+C,CAAC,CAAC;QAExD,eAAe;QACf,MAAM,OAAO,GAAa,CAAC,GA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,CAAC;IAEF,MAAM,QAAQ,GAAG,CAAO,MAAc,EAAmB,EAAE;QACzD,IAAI,CAAC;YACH,OAAO,MAAM,IAAA,iBAAM,EAAC,MAAM,EAAE;gBAC1B,MAAM,EAAE,YAAY;aACrB,CAAC,CAAC;QACL,CAAC;QAAC,WAAM,CAAC;YACP,OAAO,MAAM,CAAC;QAChB,CAAC;IACH,CAAC,CAAA,CAAC;IAEF,MAAM,IAAI,GAAG,CAAC,IAAY,EAAS,EAAE;QACnC,OAAO,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC;QACpB,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC;IACnB,CAAC,CAAC;AACJ,CAAC,EAlDgB,gBAAgB,gCAAhB,gBAAgB,QAkDhC"}
@@ -1,9 +1,10 @@
1
1
  export declare namespace MigrateInquirer {
2
2
  interface IOutput {
3
3
  mode: "nest" | "sdk";
4
- simulate: boolean;
5
4
  input: string;
6
5
  output: string;
6
+ simulate: boolean;
7
+ e2e: boolean;
7
8
  }
8
9
  const parse: () => Promise<IOutput>;
9
10
  }
@@ -23,6 +23,7 @@ var MigrateInquirer;
23
23
  commander_1.default.program.option("--input [swagger.json]", "location of target swagger.json file");
24
24
  commander_1.default.program.option("--output [directory]", "output directory path");
25
25
  commander_1.default.program.option("--simulate", "Mockup simulator");
26
+ commander_1.default.program.option("--e2e [boolean]", "Generate E2E tests");
26
27
  // INTERNAL PROCEDURES
27
28
  const questioned = { value: false };
28
29
  const action = (closure) => new Promise((resolve, reject) => {
@@ -65,6 +66,12 @@ var MigrateInquirer;
65
66
  partial.simulate =
66
67
  (yield select("simulate")("Mokup Simulator")(["true", "false"])) ===
67
68
  "true";
69
+ if (partial.e2e)
70
+ partial.e2e = partial.e2e === "true";
71
+ else
72
+ partial.e2e =
73
+ (yield select("e2e")("Generate E2E tests")(["true", "false"])) ===
74
+ "true";
68
75
  return partial;
69
76
  }));
70
77
  });
@@ -1 +1 @@
1
- {"version":3,"file":"Migrate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;YAChE,MAAA,OAAO,CAAC,MAAM,oCAAd,OAAO,CAAC,MAAM,GAAK,MAAM,KAAK,CAAC,QAAQ,CAAC,CAAC,uBAAuB,CAAC,EAAC;YAClE,IAAI,OAAO,CAAC,QAAQ;gBAClB,OAAO,CAAC,QAAQ,GAAI,OAAO,CAAC,QAAgB,KAAK,MAAM,CAAC;;gBAExD,OAAO,CAAC,QAAQ;oBACd,CAAC,MAAM,MAAM,CAAC,UAAU,CAAC,CAAC,iBAAiB,CAAC,CAAC,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC,CAAC;wBAChE,MAAM,CAAC;YACX,IAAI,OAAO,CAAC,GAAG;gBAAE,OAAO,CAAC,GAAG,GAAI,OAAO,CAAC,GAAW,KAAK,MAAM,CAAC;;gBAE7D,OAAO,CAAC,GAAG;oBACT,CAAC,MAAM,MAAM,CAAC,KAAK,CAAC,CAAC,oBAAoB,CAAC,CAAC,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC,CAAC;wBAC9D,MAAM,CAAC;YACX,OAAO,OAAkB,CAAC;QAC5B,CAAC,CAAA,CAAC,CAAC;IACL,CAAC,CAAA,CAAC;AACJ,CAAC,EAlFgB,eAAe,+BAAf,eAAe,QAkF/B"}
@@ -0,0 +1,7 @@
1
+ import ts from "typescript";
2
+ import { ISwaggerComponents } from "../module";
3
+ import { IMigrateRoute } from "../structures/IMigrateRoute";
4
+ import { MigrateImportProgrammer } from "./MigrateImportProgrammer";
5
+ export declare namespace MigrateE2eFunctionProgrammer {
6
+ const write: (components: ISwaggerComponents) => (importer: MigrateImportProgrammer) => (route: IMigrateRoute) => ts.FunctionDeclaration;
7
+ }
@@ -0,0 +1,45 @@
1
+ "use strict";
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ exports.MigrateE2eFunctionProgrammer = void 0;
7
+ const typescript_1 = __importDefault(require("typescript"));
8
+ const IdentifierFactory_1 = require("typia/lib/factories/IdentifierFactory");
9
+ const MigrateSchemaProgrammer_1 = require("./MigrateSchemaProgrammer");
10
+ var MigrateE2eFunctionProgrammer;
11
+ (function (MigrateE2eFunctionProgrammer) {
12
+ MigrateE2eFunctionProgrammer.write = (components) => (importer) => (route) => typescript_1.default.factory.createFunctionDeclaration([
13
+ typescript_1.default.factory.createModifier(typescript_1.default.SyntaxKind.ExportKeyword),
14
+ typescript_1.default.factory.createModifier(typescript_1.default.SyntaxKind.AsyncKeyword),
15
+ ], undefined, ["test", "api", ...route.accessor].join("_"), undefined, [
16
+ IdentifierFactory_1.IdentifierFactory.parameter("connection", typescript_1.default.factory.createTypeReferenceNode(typescript_1.default.factory.createQualifiedName(typescript_1.default.factory.createIdentifier(importer.external({
17
+ type: "default",
18
+ library: "@ORGANIZATION/PROJECT-api",
19
+ name: "api",
20
+ })), typescript_1.default.factory.createIdentifier("IConnection")))),
21
+ ], undefined, typescript_1.default.factory.createBlock(writeBody(components)(importer)(route), true));
22
+ const writeBody = (components) => (importer) => (route) => [
23
+ typescript_1.default.factory.createVariableStatement([], typescript_1.default.factory.createVariableDeclarationList([
24
+ typescript_1.default.factory.createVariableDeclaration("output", undefined, route.success
25
+ ? MigrateSchemaProgrammer_1.MigrateSchemaProgrammer.write(components)(importer)(route.success.schema)
26
+ : undefined, typescript_1.default.factory.createAwaitExpression(writeCallExpressionn(components)(importer)(route))),
27
+ ], typescript_1.default.NodeFlags.Const)),
28
+ typescript_1.default.factory.createExpressionStatement(typescript_1.default.factory.createCallExpression(typescript_1.default.factory.createPropertyAccessExpression(typescript_1.default.factory.createIdentifier(importer.external({
29
+ type: "default",
30
+ library: "typia",
31
+ name: "typia",
32
+ })), "assert"), undefined, [typescript_1.default.factory.createIdentifier("output")])),
33
+ ];
34
+ const writeCallExpressionn = (components) => (importer) => (route) => typescript_1.default.factory.createCallExpression(typescript_1.default.factory.createPropertyAccessExpression(typescript_1.default.factory.createIdentifier("api.functional"), typescript_1.default.factory.createIdentifier(route.accessor.join("."))), undefined, [
35
+ typescript_1.default.factory.createIdentifier("connection"),
36
+ ...[...route.parameters, route.query, route.body]
37
+ .filter((p) => !!p)
38
+ .map((p) => typescript_1.default.factory.createCallExpression(typescript_1.default.factory.createPropertyAccessExpression(typescript_1.default.factory.createIdentifier(importer.external({
39
+ type: "default",
40
+ library: "typia",
41
+ name: "typia",
42
+ })), "random"), [MigrateSchemaProgrammer_1.MigrateSchemaProgrammer.write(components)(importer)(p.schema)], undefined)),
43
+ ]);
44
+ })(MigrateE2eFunctionProgrammer || (exports.MigrateE2eFunctionProgrammer = MigrateE2eFunctionProgrammer = {}));
45
+ //# sourceMappingURL=MigrateE2eFileProgrammer.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"MigrateE2eFileProgrammer.js","sourceRoot":"","sources":["../../src/programmers/MigrateE2eFileProgrammer.ts"],"names":[],"mappings":";;;;;;AAAA,4DAA4B;AAC5B,6EAA0E;AAK1E,uEAAoE;AAEpE,IAAiB,4BAA4B,CA4G5C;AA5GD,WAAiB,4BAA4B;IAC9B,kCAAK,GAChB,CAAC,UAA8B,EAAE,EAAE,CACnC,CAAC,QAAiC,EAAE,EAAE,CACtC,CAAC,KAAoB,EAA0B,EAAE,CAC/C,oBAAE,CAAC,OAAO,CAAC,yBAAyB,CAClC;QACE,oBAAE,CAAC,OAAO,CAAC,cAAc,CAAC,oBAAE,CAAC,UAAU,CAAC,aAAa,CAAC;QACtD,oBAAE,CAAC,OAAO,CAAC,cAAc,CAAC,oBAAE,CAAC,UAAU,CAAC,YAAY,CAAC;KACtD,EACD,SAAS,EACT,CAAC,MAAM,EAAE,KAAK,EAAE,GAAG,KAAK,CAAC,QAAQ,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,EAC5C,SAAS,EACT;QACE,qCAAiB,CAAC,SAAS,CACzB,YAAY,EACZ,oBAAE,CAAC,OAAO,CAAC,uBAAuB,CAChC,oBAAE,CAAC,OAAO,CAA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AC,EA5GgB,4BAA4B,4CAA5B,4BAA4B,QA4G5C"}
@@ -0,0 +1,5 @@
1
+ import { IMigrateProgram } from "../module";
2
+ import { IMigrateFile } from "../structures/IMigrateFile";
3
+ export declare namespace MigrateE2eProgrammer {
4
+ const write: (program: IMigrateProgram) => IMigrateFile[];
5
+ }
@@ -0,0 +1,27 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.MigrateE2eProgrammer = void 0;
4
+ const FilePrinter_1 = require("../utils/FilePrinter");
5
+ const MigrateE2eFileProgrammer_1 = require("./MigrateE2eFileProgrammer");
6
+ const MigrateImportProgrammer_1 = require("./MigrateImportProgrammer");
7
+ var MigrateE2eProgrammer;
8
+ (function (MigrateE2eProgrammer) {
9
+ MigrateE2eProgrammer.write = (program) => program.controllers
10
+ .map((c) => c.routes.map(writeFile(program.swagger.components)))
11
+ .flat();
12
+ const writeFile = (components) => (route) => {
13
+ const importer = new MigrateImportProgrammer_1.MigrateImportProgrammer();
14
+ const func = MigrateE2eFileProgrammer_1.MigrateE2eFunctionProgrammer.write(components)(importer)(route);
15
+ const statements = [
16
+ ...importer.toStatements((name) => `@ORGANIZATION/PROJECT-api/lib/structures/${name}`),
17
+ FilePrinter_1.FilePrinter.newLine(),
18
+ func,
19
+ ];
20
+ return {
21
+ location: `test/features/api`,
22
+ file: `${["test", "api", ...route.accessor].join("_")}.ts`,
23
+ content: FilePrinter_1.FilePrinter.write({ statements }),
24
+ };
25
+ };
26
+ })(MigrateE2eProgrammer || (exports.MigrateE2eProgrammer = MigrateE2eProgrammer = {}));
27
+ //# sourceMappingURL=MigrateE2eProgrammer.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"MigrateE2eProgrammer.js","sourceRoot":"","sources":["../../src/programmers/MigrateE2eProgrammer.ts"],"names":[],"mappings":";;;AAKA,sDAAmD;AACnD,yEAA0E;AAC1E,uEAAoE;AAEpE,IAAiB,oBAAoB,CAyBpC;AAzBD,WAAiB,oBAAoB;IACtB,0BAAK,GAAG,CAAC,OAAwB,EAAkB,EAAE,CAChE,OAAO,CAAC,WAAW;SAChB,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,MAAM,CAAC,GAAG,CAAC,SAAS,CAAC,OAAO,CAAC,OAAO,CAAC,UAAU,CAAC,CAAC,CAAC;SAC/D,IAAI,EAAE,CAAC;IAEZ,MAAM,SAAS,GACb,CAAC,UAA8B,EAAE,EAAE,CACnC,CAAC,KAAoB,EAAgB,EAAE;QACrC,MAAM,QAAQ,GAA4B,IAAI,iDAAuB,EAAE,CAAC;QACxE,MAAM,IAAI,GACR,uDAA4B,CAAC,KAAK,CAAC,UAAU,CAAC,CAAC,QAAQ,CAAC,CAAC,KAAK,CAAC,CAAC;QAClE,MAAM,UAAU,GAAmB;YACjC,GAAG,QAAQ,CAAC,YAAY,CACtB,CAAC,IAAI,EAAE,EAAE,CAAC,4CAA4C,IAAI,EAAE,CAC7D;YACD,yBAAW,CAAC,OAAO,EAAE;YACrB,IAAI;SACL,CAAC;QACF,OAAO;YACL,QAAQ,EAAE,mBAAmB;YAC7B,IAAI,EAAE,GAAG,CAAC,MAAM,EAAE,KAAK,EAAE,GAAG,KAAK,CAAC,QAAQ,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,KAAK;YAC1D,OAAO,EAAE,yBAAW,CAAC,KAAK,CAAC,EAAE,UAAU,EAAE,CAAC;SAC3C,CAAC;IACJ,CAAC,CAAC;AACN,CAAC,EAzBgB,oBAAoB,oCAApB,oBAAoB,QAyBpC"}
@@ -14,11 +14,13 @@ export declare namespace IMigrateProgram {
14
14
  interface IProps {
15
15
  mode: "nest" | "sdk";
16
16
  simulate: boolean;
17
+ e2e: boolean;
17
18
  swagger: ISwagger;
18
19
  dictionary: Dictionary;
19
20
  }
20
21
  interface IConfig {
21
22
  mode: "nest" | "sdk";
22
23
  simulate: boolean;
24
+ e2e: boolean;
23
25
  }
24
26
  }
package/package.json CHANGED
@@ -1,70 +1,71 @@
1
- {
2
- "name": "@nestia/migrate",
3
- "version": "0.7.12",
4
- "description": "Migration program from swagger to NestJS",
5
- "main": "lib/index.js",
6
- "typings": "lib/index.d.ts",
7
- "bin": {
8
- "@nestia/migrate": "lib/executable/migrate.js"
9
- },
10
- "scripts": {
11
- "build": "rimraf lib && tsc",
12
- "bundle": "ts-node src/executable/bundle.ts",
13
- "dev": "npm run build -- --watch",
14
- "prepare": "ts-patch install && typia patch && npm run bundle",
15
- "test": "node lib/test"
16
- },
17
- "repository": {
18
- "type": "git",
19
- "url": "https://github.com/samchon/nestia"
20
- },
21
- "keywords": [
22
- "migration",
23
- "swagger",
24
- "NestJS",
25
- "nestia"
26
- ],
27
- "author": "Jeongho Nam",
28
- "license": "MIT",
29
- "bugs": {
30
- "url": "https://github.com/samchon/nestia/issues"
31
- },
32
- "homepage": "https://nestia.io",
33
- "devDependencies": {
34
- "@nestia/core": "2.5.6",
35
- "@nestia/fetcher": "2.5.6",
36
- "@nestjs/common": "^10.3.3",
37
- "@nestjs/core": "^10.3.3",
38
- "@nestjs/platform-express": "^10.3.3",
39
- "@nestjs/platform-fastify": "^10.3.3",
40
- "@trivago/prettier-plugin-sort-imports": "^4.3.0",
41
- "@types/express": "^4.17.21",
42
- "@types/inquirer": "^9.0.7",
43
- "@types/node": "^20.3.3",
44
- "dotenv": "^16.3.1",
45
- "dotenv-expand": "^10.0.0",
46
- "rimraf": "^5.0.1",
47
- "serialize-error": "^4.1.0",
48
- "source-map-support": "^0.5.21",
49
- "ts-node": "^10.9.1",
50
- "ts-patch": "^3.1.0",
51
- "tstl": "^2.5.13",
52
- "typescript-transform-paths": "^3.4.6"
53
- },
54
- "dependencies": {
55
- "commander": "10.0.0",
56
- "inquirer": "8.2.5",
57
- "prettier": "^3.2.5",
58
- "typescript": "^5.3.3",
59
- "typia": "^5.4.8"
60
- },
61
- "files": [
62
- "lib",
63
- "src",
64
- "!lib/test",
65
- "!src/test",
66
- "package.json",
67
- "README.md",
68
- "LICENSE"
69
- ]
70
- }
1
+ {
2
+ "name": "@nestia/migrate",
3
+ "version": "0.8.0-dev.20240217",
4
+ "description": "Migration program from swagger to NestJS",
5
+ "main": "lib/index.js",
6
+ "typings": "lib/index.d.ts",
7
+ "bin": {
8
+ "@nestia/migrate": "lib/executable/migrate.js"
9
+ },
10
+ "scripts": {
11
+ "build": "rimraf lib && tsc",
12
+ "bundle": "ts-node src/executable/bundle.ts",
13
+ "dev": "npm run build -- --watch",
14
+ "prepare": "ts-patch install && typia patch && npm run bundle",
15
+ "test": "node lib/test"
16
+ },
17
+ "repository": {
18
+ "type": "git",
19
+ "url": "https://github.com/samchon/nestia"
20
+ },
21
+ "keywords": [
22
+ "migration",
23
+ "swagger",
24
+ "NestJS",
25
+ "nestia"
26
+ ],
27
+ "author": "Jeongho Nam",
28
+ "license": "MIT",
29
+ "bugs": {
30
+ "url": "https://github.com/samchon/nestia/issues"
31
+ },
32
+ "homepage": "https://nestia.io",
33
+ "devDependencies": {
34
+ "@nestia/core": "^2.5.8",
35
+ "@nestia/e2e": "^0.4.1",
36
+ "@nestia/fetcher": "^2.5.8",
37
+ "@nestjs/common": "^10.3.3",
38
+ "@nestjs/core": "^10.3.3",
39
+ "@nestjs/platform-express": "^10.3.3",
40
+ "@nestjs/platform-fastify": "^10.3.3",
41
+ "@trivago/prettier-plugin-sort-imports": "^4.3.0",
42
+ "@types/express": "^4.17.21",
43
+ "@types/inquirer": "^9.0.7",
44
+ "@types/node": "^20.3.3",
45
+ "dotenv": "^16.3.1",
46
+ "dotenv-expand": "^10.0.0",
47
+ "rimraf": "^5.0.1",
48
+ "serialize-error": "^4.1.0",
49
+ "source-map-support": "^0.5.21",
50
+ "ts-node": "^10.9.1",
51
+ "ts-patch": "^3.1.0",
52
+ "tstl": "^2.5.13",
53
+ "typescript-transform-paths": "^3.4.6"
54
+ },
55
+ "dependencies": {
56
+ "commander": "10.0.0",
57
+ "inquirer": "8.2.5",
58
+ "prettier": "^3.2.5",
59
+ "typescript": "^5.3.3",
60
+ "typia": "^5.4.9"
61
+ },
62
+ "files": [
63
+ "lib",
64
+ "src",
65
+ "!lib/test",
66
+ "!src/test",
67
+ "package.json",
68
+ "README.md",
69
+ "LICENSE"
70
+ ]
71
+ }
@@ -5,6 +5,7 @@ import { NEST_TEMPLATE } from "./bundles/NEST_TEMPLATE";
5
5
  import { SDK_TEMPLATE } from "./bundles/SDK_TEMPLATE";
6
6
  import { IMigrateProgram } from "./module";
7
7
  import { MigrateApiProgrammer } from "./programmers/MigrateApiProgrammer";
8
+ import { MigrateE2eProgrammer } from "./programmers/MigrateE2eProgrammer";
8
9
  import { MigrateNestProgrammer } from "./programmers/MigrateNestProgrammer";
9
10
  import { IMigrateFile } from "./structures/IMigrateFile";
10
11
  import { ISwagger } from "./structures/ISwagger";
@@ -16,12 +17,13 @@ export class MigrateApplication {
16
17
  this.swagger = typia.assert(swagger);
17
18
  }
18
19
 
19
- public nest(simulate: boolean): MigrateApplication.IOutput {
20
+ public nest(config: MigrateApplication.IConfig): MigrateApplication.IOutput {
20
21
  const program: IMigrateProgram = MigrateAnalyzer.analyze({
21
22
  mode: "nest",
22
- simulate,
23
23
  swagger: this.swagger,
24
24
  dictionary: new Map(),
25
+ simulate: config.simulate,
26
+ e2e: config.e2e,
25
27
  });
26
28
  return {
27
29
  program,
@@ -29,20 +31,26 @@ export class MigrateApplication {
29
31
  ...NEST_TEMPLATE,
30
32
  ...MigrateNestProgrammer.write(program),
31
33
  ...MigrateApiProgrammer.write(program),
34
+ ...(config.e2e ? MigrateE2eProgrammer.write(program) : []),
32
35
  ],
33
36
  };
34
37
  }
35
38
 
36
- public sdk(simulate: boolean): MigrateApplication.IOutput {
39
+ public sdk(config: MigrateApplication.IConfig): MigrateApplication.IOutput {
37
40
  const program: IMigrateProgram = MigrateAnalyzer.analyze({
38
41
  mode: "sdk",
39
- simulate,
40
42
  swagger: this.swagger,
41
43
  dictionary: new Map(),
44
+ simulate: config.simulate,
45
+ e2e: config.e2e,
42
46
  });
43
47
  return {
44
48
  program,
45
- files: [...SDK_TEMPLATE, ...MigrateApiProgrammer.write(program)],
49
+ files: [
50
+ ...SDK_TEMPLATE,
51
+ ...MigrateApiProgrammer.write(program),
52
+ ...(config.e2e ? MigrateE2eProgrammer.write(program) : []),
53
+ ],
46
54
  };
47
55
  }
48
56
  }
@@ -51,4 +59,8 @@ export namespace MigrateApplication {
51
59
  program: IMigrateProgram;
52
60
  files: IMigrateFile[];
53
61
  }
62
+ export interface IConfig {
63
+ simulate: boolean;
64
+ e2e: boolean;
65
+ }
54
66
  }
@@ -42,12 +42,12 @@ export const NEST_TEMPLATE = [
42
42
  {
43
43
  "location": "",
44
44
  "file": "nestia.config.ts",
45
- "content": "// nestia configuration file\r\nimport type sdk from \"@nestia/sdk\";\r\nimport { NestFactory } from \"@nestjs/core\";\r\n\r\nimport { MyModule } from \"./src/MyModule\";\r\n\r\nconst NESTIA_CONFIG: sdk.INestiaConfig = {\r\n input: () => NestFactory.create(MyModule),\r\n output: \"src/api\",\r\n swagger: {\r\n output: \"packages/api/swagger.json\",\r\n servers: [\r\n {\r\n url: \"http://localhost:37001\",\r\n description: \"Local Server\",\r\n },\r\n ],\r\n },\r\n distribute: \"packages/api\",\r\n simulate: true,\r\n e2e: \"test\",\r\n};\r\nexport default NESTIA_CONFIG;\r\n"
45
+ "content": "// nestia configuration file\r\nimport type sdk from \"@nestia/sdk\";\r\nimport { NestFactory } from \"@nestjs/core\";\r\n\r\nimport { MyModule } from \"./src/MyModule\";\r\n\r\nconst NESTIA_CONFIG: sdk.INestiaConfig = {\r\n input: () => NestFactory.create(MyModule),\r\n output: \"src/api\",\r\n swagger: {\r\n output: \"packages/api/swagger.json\",\r\n servers: [\r\n {\r\n url: \"http://localhost:37001\",\r\n description: \"Local Server\",\r\n },\r\n ],\r\n beautify: true,\r\n },\r\n distribute: \"packages/api\",\r\n primitive: false,\r\n simulate: true,\r\n};\r\nexport default NESTIA_CONFIG;\r\n"
46
46
  },
47
47
  {
48
48
  "location": "",
49
49
  "file": "package.json",
50
- "content": "{\r\n \"private\": true,\r\n \"name\": \"@ORGANIZATION/PROJECT\",\r\n \"version\": \"0.1.0\",\r\n \"description\": \"Starter kit of Nestia\",\r\n \"main\": \"lib/index.js\",\r\n \"scripts\": {\r\n \"test\": \"node bin/test\",\r\n \"test:webpack\": \"npm run webpack && node bin/test/webpack.js\",\r\n \"------------------------BUILDS------------------------\": \"\",\r\n \"build\": \"npm run build:sdk && npm run build:main && npm run build:test\",\r\n \"build:api\": \"rimraf packages/api/lib && npm run build:sdk && tsc -p packages/api/tsconfig.json\",\r\n \"build:main\": \"rimraf lib && tsc\",\r\n \"build:sdk\": \"rimraf src/api/functional && nestia sdk\",\r\n \"build:swagger\": \"npx nestia swagger\",\r\n \"build:test\": \"rimraf bin && tsc -p test/tsconfig.json\",\r\n \"dev\": \"npm run build:test -- --watch\",\r\n \"eslint\": \"eslint src && eslint test\",\r\n \"eslint:fix\": \"eslint --fix src && eslint --fix test\",\r\n \"prepare\": \"ts-patch install && typia patch\",\r\n \"prettier\": \"prettier src --write && prettier test --write\",\r\n \"------------------------WEBPACK------------------------\": \"\",\r\n \"webpack\": \"rimraf dist && webpack\",\r\n \"webpack:start\": \"cd dist && node dist/server\",\r\n \"------------------------DEPLOYS------------------------\": \"\",\r\n \"package:api\": \"npm run build:swagger && npm run build:api && cd packages/api && npm publish\",\r\n \"start\": \"node lib/executable/server\",\r\n \"start:swagger\": \"ts-node src/executable/swagger.ts\"\r\n },\r\n \"repository\": {\r\n \"type\": \"git\",\r\n \"url\": \"https://github.com/samchon/nestia-start\"\r\n },\r\n \"keywords\": [\r\n \"nestia\",\r\n \"template\",\r\n \"boilerplate\"\r\n ],\r\n \"author\": \"AUTHOR\",\r\n \"license\": \"MIT\",\r\n \"bugs\": {\r\n \"url\": \"https://github.com/samchon/nestia-start/issues\"\r\n },\r\n \"homepage\": \"https://github.com/samchon/nestia-start#readme\",\r\n \"devDependencies\": {\r\n \"@nestia/e2e\": \"^0.4.1\",\r\n \"@nestia/sdk\": \"^2.5.6\",\r\n \"@trivago/prettier-plugin-sort-imports\": \"^4.3.0\",\r\n \"@types/cli\": \"^0.11.21\",\r\n \"@types/express\": \"^4.17.21\",\r\n \"@types/inquirer\": \"^8.2.5\",\r\n \"@types/node\": \"^18.11.0\",\r\n \"@types/uuid\": \"^8.3.4\",\r\n \"@typescript-eslint/eslint-plugin\": \"^6.19.1\",\r\n \"@typescript-eslint/parser\": \"^6.19.1\",\r\n \"chalk\": \"^4.1.0\",\r\n \"cli\": \"^1.0.1\",\r\n \"copy-webpack-plugin\": \"^11.0.0\",\r\n \"eslint-plugin-deprecation\": \"^2.0.0\",\r\n \"express\": \"^4.18.2\",\r\n \"nestia\": \"^5.2.2\",\r\n \"prettier\": \"^3.2.4\",\r\n \"prettier-plugin-prisma\": \"^5.0.0\",\r\n \"rimraf\": \"^3.0.2\",\r\n \"source-map-support\": \"^0.5.21\",\r\n \"swagger-ui-express\": \"^5.0.0\",\r\n \"ts-loader\": \"^9.5.1\",\r\n \"ts-node\": \"^10.9.1\",\r\n \"ts-patch\": \"^3.0.2\",\r\n \"typescript\": \"^5.3.2\",\r\n \"typescript-transform-paths\": \"^3.4.6\",\r\n \"webpack\": \"^5.89.0\",\r\n \"webpack-cli\": \"^5.1.4\",\r\n \"write-file-webpack-plugin\": \"^4.5.1\"\r\n },\r\n \"dependencies\": {\r\n \"@nestia/core\": \"^2.5.6\",\r\n \"@nestia/fetcher\": \"^2.5.6\",\r\n \"@nestjs/common\": \"^10.3.3\",\r\n \"@nestjs/core\": \"^10.3.3\",\r\n \"@nestjs/platform-express\": \"^10.3.3\",\r\n \"commander\": \"10.0.0\",\r\n \"dotenv\": \"^16.3.1\",\r\n \"dotenv-expand\": \"^10.0.0\",\r\n \"inquirer\": \"8.2.5\",\r\n \"serialize-error\": \"^4.1.0\",\r\n \"tstl\": \"^2.5.13\",\r\n \"typia\": \"^5.4.8\",\r\n \"uuid\": \"^9.0.0\"\r\n },\r\n \"stackblitz\": {\r\n \"startCommand\": \"npm run prepare && npm run build:test && npm run test\"\r\n }\r\n}"
50
+ "content": "{\r\n \"private\": true,\r\n \"name\": \"@ORGANIZATION/PROJECT\",\r\n \"version\": \"0.1.0\",\r\n \"description\": \"Starter kit of Nestia\",\r\n \"main\": \"lib/index.js\",\r\n \"scripts\": {\r\n \"test\": \"node bin/test\",\r\n \"test:webpack\": \"npm run webpack && node bin/test/webpack.js\",\r\n \"------------------------BUILDS------------------------\": \"\",\r\n \"build\": \"npm run build:sdk && npm run build:main && npm run build:test\",\r\n \"build:api\": \"rimraf packages/api/lib && npm run build:sdk && tsc -p packages/api/tsconfig.json\",\r\n \"build:main\": \"rimraf lib && tsc\",\r\n \"build:sdk\": \"rimraf src/api/functional && nestia sdk\",\r\n \"build:swagger\": \"npx nestia swagger\",\r\n \"build:test\": \"rimraf bin && tsc -p test/tsconfig.json\",\r\n \"dev\": \"npm run build:test -- --watch\",\r\n \"eslint\": \"eslint src && eslint test\",\r\n \"eslint:fix\": \"eslint --fix src && eslint --fix test\",\r\n \"prepare\": \"ts-patch install && typia patch\",\r\n \"prettier\": \"prettier src --write && prettier test --write\",\r\n \"------------------------WEBPACK------------------------\": \"\",\r\n \"webpack\": \"rimraf dist && webpack\",\r\n \"webpack:start\": \"cd dist && node dist/server\",\r\n \"------------------------DEPLOYS------------------------\": \"\",\r\n \"package:api\": \"npm run build:swagger && npm run build:api && cd packages/api && npm publish\",\r\n \"start\": \"node lib/executable/server\",\r\n \"start:swagger\": \"ts-node src/executable/swagger.ts\"\r\n },\r\n \"repository\": {\r\n \"type\": \"git\",\r\n \"url\": \"https://github.com/samchon/nestia-start\"\r\n },\r\n \"keywords\": [\r\n \"nestia\",\r\n \"template\",\r\n \"boilerplate\"\r\n ],\r\n \"author\": \"AUTHOR\",\r\n \"license\": \"MIT\",\r\n \"bugs\": {\r\n \"url\": \"https://github.com/samchon/nestia-start/issues\"\r\n },\r\n \"homepage\": \"https://github.com/samchon/nestia-start#readme\",\r\n \"devDependencies\": {\r\n \"@nestia/e2e\": \"^0.4.1\",\r\n \"@nestia/sdk\": \"^2.5.8\",\r\n \"@trivago/prettier-plugin-sort-imports\": \"^4.3.0\",\r\n \"@types/cli\": \"^0.11.21\",\r\n \"@types/express\": \"^4.17.21\",\r\n \"@types/inquirer\": \"^8.2.5\",\r\n \"@types/node\": \"^18.11.0\",\r\n \"@types/uuid\": \"^8.3.4\",\r\n \"@typescript-eslint/eslint-plugin\": \"^6.19.1\",\r\n \"@typescript-eslint/parser\": \"^6.19.1\",\r\n \"chalk\": \"^4.1.0\",\r\n \"cli\": \"^1.0.1\",\r\n \"copy-webpack-plugin\": \"^11.0.0\",\r\n \"eslint-plugin-deprecation\": \"^2.0.0\",\r\n \"express\": \"^4.18.2\",\r\n \"nestia\": \"^5.2.2\",\r\n \"prettier\": \"^3.2.4\",\r\n \"prettier-plugin-prisma\": \"^5.0.0\",\r\n \"rimraf\": \"^3.0.2\",\r\n \"source-map-support\": \"^0.5.21\",\r\n \"swagger-ui-express\": \"^5.0.0\",\r\n \"ts-loader\": \"^9.5.1\",\r\n \"ts-node\": \"^10.9.1\",\r\n \"ts-patch\": \"^3.0.2\",\r\n \"typescript\": \"^5.3.2\",\r\n \"typescript-transform-paths\": \"^3.4.6\",\r\n \"webpack\": \"^5.89.0\",\r\n \"webpack-cli\": \"^5.1.4\",\r\n \"write-file-webpack-plugin\": \"^4.5.1\"\r\n },\r\n \"dependencies\": {\r\n \"@nestia/core\": \"^2.5.8\",\r\n \"@nestia/fetcher\": \"^2.5.8\",\r\n \"@nestjs/common\": \"^10.3.3\",\r\n \"@nestjs/core\": \"^10.3.3\",\r\n \"@nestjs/platform-express\": \"^10.3.3\",\r\n \"commander\": \"10.0.0\",\r\n \"dotenv\": \"^16.3.1\",\r\n \"dotenv-expand\": \"^10.0.0\",\r\n \"inquirer\": \"8.2.5\",\r\n \"serialize-error\": \"^4.1.0\",\r\n \"tstl\": \"^2.5.13\",\r\n \"typia\": \"^5.4.9\",\r\n \"uuid\": \"^9.0.0\"\r\n },\r\n \"stackblitz\": {\r\n \"startCommand\": \"npm run prepare && npm run build:test && npm run test\"\r\n }\r\n}"
51
51
  },
52
52
  {
53
53
  "location": "packages/api",
@@ -62,7 +62,7 @@ export const NEST_TEMPLATE = [
62
62
  {
63
63
  "location": "packages/api",
64
64
  "file": "package.json",
65
- "content": "{\r\n \"name\": \"@ORGANIZATION/PROJECT-api\",\r\n \"version\": \"0.1.0\",\r\n \"description\": \"SDK library generated by Nestia\",\r\n \"main\": \"lib/index.js\",\r\n \"typings\": \"lib/index.d.ts\",\r\n \"scripts\": {\r\n \"build\": \"npm run build:sdk && npm run compile\",\r\n \"build:sdk\": \"rimraf ../../src/api/functional && cd ../.. && npx nestia sdk && cd packages/api\",\r\n \"compile\": \"rimraf lib && tsc\",\r\n \"deploy\": \"npm run build && npm publish\",\r\n \"prepare\": \"ts-patch install && typia patch\"\r\n },\r\n \"repository\": {\r\n \"type\": \"git\",\r\n \"url\": \"https://github.com/samchon/nestia\"\r\n },\r\n \"author\": \"Jeongho Nam\",\r\n \"license\": \"MIT\",\r\n \"bugs\": {\r\n \"url\": \"https://github.com/samchon/nestia/issues\"\r\n },\r\n \"homepage\": \"https://nestia.io\",\r\n \"files\": [\r\n \"lib\",\r\n \"swagger.json\",\r\n \"package.json\",\r\n \"README.md\"\r\n ],\r\n \"devDependencies\": {\r\n \"rimraf\": \"^5.0.5\",\r\n \"ts-node\": \"^10.9.2\",\r\n \"ts-patch\": \"^3.1.2\",\r\n \"typescript\": \"^5.3.3\"\r\n },\r\n \"dependencies\": {\r\n \"@nestia/fetcher\": \"^2.5.6\",\r\n \"typia\": \"^5.4.8\"\r\n }\r\n}"
65
+ "content": "{\r\n \"name\": \"@ORGANIZATION/PROJECT-api\",\r\n \"version\": \"0.1.0\",\r\n \"description\": \"SDK library generated by Nestia\",\r\n \"main\": \"lib/index.js\",\r\n \"typings\": \"lib/index.d.ts\",\r\n \"scripts\": {\r\n \"build\": \"npm run build:sdk && npm run compile\",\r\n \"build:sdk\": \"rimraf ../../src/api/functional && cd ../.. && npx nestia sdk && cd packages/api\",\r\n \"compile\": \"rimraf lib && tsc\",\r\n \"deploy\": \"npm run build && npm publish\",\r\n \"prepare\": \"ts-patch install && typia patch\"\r\n },\r\n \"repository\": {\r\n \"type\": \"git\",\r\n \"url\": \"https://github.com/samchon/nestia\"\r\n },\r\n \"author\": \"Jeongho Nam\",\r\n \"license\": \"MIT\",\r\n \"bugs\": {\r\n \"url\": \"https://github.com/samchon/nestia/issues\"\r\n },\r\n \"homepage\": \"https://nestia.io\",\r\n \"files\": [\r\n \"lib\",\r\n \"swagger.json\",\r\n \"package.json\",\r\n \"README.md\"\r\n ],\r\n \"devDependencies\": {\r\n \"rimraf\": \"^5.0.5\",\r\n \"ts-node\": \"^10.9.2\",\r\n \"ts-patch\": \"^3.1.2\",\r\n \"typescript\": \"^5.3.3\"\r\n },\r\n \"dependencies\": {\r\n \"@nestia/fetcher\": \"^2.5.8\",\r\n \"typia\": \"^5.4.9\"\r\n }\r\n}"
66
66
  },
67
67
  {
68
68
  "location": "packages/api",
@@ -2,7 +2,17 @@ export const SDK_TEMPLATE = [
2
2
  {
3
3
  "location": "",
4
4
  "file": ".gitignore",
5
- "content": ".git/\r\nlib/\r\nnode_modules/\r\n\r\npackage-lock.json\r\npnpm-lock.yaml"
5
+ "content": ".git/\r\nbin/\r\nlib/\r\nnode_modules/\r\n\r\npackage-lock.json\r\npnpm-lock.yaml"
6
+ },
7
+ {
8
+ "location": ".vscode",
9
+ "file": "launch.json",
10
+ "content": "{\r\n // Use IntelliSense to learn about possible Node.js debug attributes.\r\n // Hover to view descriptions of existing attributes.\r\n // For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387\r\n \"version\": \"0.2.0\",\r\n \"configurations\": [\r\n {\r\n \"type\": \"node\",\r\n \"request\": \"launch\",\r\n \"name\": \"JavaScript Test using SourceMap\",\r\n \"program\": \"${workspaceRoot}/test/index.ts\",\r\n \"cwd\": \"${workspaceRoot}\",\r\n \"args\": [\r\n //----\r\n // You can run specific test functions\r\n //----\r\n // \"--include\", \"something\",\r\n // \"--exclude\", \"nothing\",\r\n ],\r\n \"outFiles\": [\"${workspaceRoot}/bin/**/*.js\"],\r\n }\r\n ]\r\n}"
11
+ },
12
+ {
13
+ "location": ".vscode",
14
+ "file": "settings.json",
15
+ "content": "{\r\n \"editor.tabSize\": 2,\r\n \"editor.formatOnSave\": true,\r\n \"[javascript][typescript]\": {\r\n \"editor.defaultFormatter\": \"esbenp.prettier-vscode\",\r\n \"editor.codeActionsOnSave\": {\r\n \"source.fixAll.eslint\": \"explicit\"\r\n },\r\n },\r\n}"
6
16
  },
7
17
  {
8
18
  "location": "",
@@ -12,7 +22,12 @@ export const SDK_TEMPLATE = [
12
22
  {
13
23
  "location": "",
14
24
  "file": "package.json",
15
- "content": "{\r\n \"name\": \"@ORGANIZATION/PROJECT-api\",\r\n \"version\": \"0.1.0\",\r\n \"description\": \"SDK library generated by Nestia\",\r\n \"main\": \"lib/index.js\",\r\n \"typings\": \"lib/index.d.ts\",\r\n \"scripts\": {\r\n \"build\": \"rimraf lib && tsc\",\r\n \"prepare\": \"ts-patch install && typia patch\"\r\n },\r\n \"repository\": {\r\n \"type\": \"git\",\r\n \"url\": \"https://github.com/samchon/nestia\"\r\n },\r\n \"author\": \"Jeongho Nam\",\r\n \"license\": \"MIT\",\r\n \"bugs\": {\r\n \"url\": \"https://github.com/samchon/nestia/issues\"\r\n },\r\n \"homepage\": \"https://nestia.io\",\r\n \"files\": [\r\n \"lib\",\r\n \"swagger.json\",\r\n \"package.json\",\r\n \"README.md\"\r\n ],\r\n \"devDependencies\": {\r\n \"rimraf\": \"^5.0.5\",\r\n \"ts-node\": \"^10.9.2\",\r\n \"ts-patch\": \"^3.1.2\",\r\n \"typescript\": \"^5.3.3\"\r\n },\r\n \"dependencies\": {\r\n \"@nestia/fetcher\": \"^2.5.6\",\r\n \"typia\": \"^5.4.8\"\r\n }\r\n}"
25
+ "content": "{\r\n \"name\": \"@ORGANIZATION/PROJECT-api\",\r\n \"version\": \"0.1.0\",\r\n \"description\": \"SDK library generated by Nestia\",\r\n \"main\": \"lib/index.js\",\r\n \"typings\": \"lib/index.d.ts\",\r\n \"scripts\": {\r\n \"build\": \"rimraf lib && tsc\",\r\n \"build:test\": \"rimraf bin && tsc --project test/tsconfig.json\",\r\n \"dev\": \"npm run build:test -- --watch\",\r\n \"prepare\": \"ts-patch install && typia patch\",\r\n \"test\": \"npx ts-node test/index.ts\"\r\n },\r\n \"repository\": {\r\n \"type\": \"git\",\r\n \"url\": \"https://github.com/samchon/nestia\"\r\n },\r\n \"author\": \"Jeongho Nam\",\r\n \"license\": \"MIT\",\r\n \"bugs\": {\r\n \"url\": \"https://github.com/samchon/nestia/issues\"\r\n },\r\n \"homepage\": \"https://nestia.io\",\r\n \"files\": [\r\n \"lib\",\r\n \"swagger.json\",\r\n \"package.json\",\r\n \"README.md\"\r\n ],\r\n \"devDependencies\": {\r\n \"@nestia/e2e\": \"^0.4.1\",\r\n \"@types/inquirer\": \"8.2.5\",\r\n \"commander\": \"^10.0.0\",\r\n \"inquirer\": \"8.2.5\",\r\n \"prettier\": \"^3.2.5\",\r\n \"rimraf\": \"^5.0.5\",\r\n \"ts-node\": \"^10.9.2\",\r\n \"ts-patch\": \"^3.1.2\",\r\n \"typescript\": \"^5.3.3\",\r\n \"typescript-transform-paths\": \"^3.4.6\"\r\n },\r\n \"dependencies\": {\r\n \"@nestia/fetcher\": \"^2.5.8\",\r\n \"typia\": \"^5.4.9\"\r\n },\r\n \"stackblitz\": {\r\n \"startCommand\": \"npm install && npm run test\"\r\n }\r\n}"
26
+ },
27
+ {
28
+ "location": "",
29
+ "file": "prettier.config.js",
30
+ "content": "module.exports = {\r\n // DEFAULT CONFIGURATIONS\r\n parser: \"typescript\",\r\n printWidth: 80,\r\n semi: true,\r\n tabWidth: 2,\r\n trailingComma: \"all\",\r\n};\r\n"
16
31
  },
17
32
  {
18
33
  "location": "",
@@ -44,9 +59,29 @@ export const SDK_TEMPLATE = [
44
59
  "file": "Primitive.ts",
45
60
  "content": "export type { Primitive } from \"@nestia/fetcher\";\r\n"
46
61
  },
62
+ {
63
+ "location": "test",
64
+ "file": "index.ts",
65
+ "content": "import { DynamicExecutor } from \"@nestia/e2e\";\r\nimport { ArgumentParser } from \"./utils/ArgumentParser\";\r\nimport { TestGlobal } from \"./TestGlobal\";\r\n\r\ninterface IOptions {\r\n simulate: boolean;\r\n include?: string[];\r\n exclude?: string[];\r\n trace: boolean;\r\n}\r\n\r\nconst getOptions = () =>\r\n ArgumentParser.parse<IOptions>(async (command, prompt, action) => {\r\n command.option(\"--simulate <boolean>\", \"Mockup Simultator\");\r\n command.option(\"--include <string...>\", \"include feature files\");\r\n command.option(\"--exclude <string...>\", \"exclude feature files\");\r\n command.option(\"--trace <boolean>\", \"trace detailed errors\");\r\n\r\n return action(async (options) => {\r\n if (typeof options.simulate === \"string\")\r\n options.simulate = options.simulate === \"true\";\r\n options.simulate ??= await prompt.boolean(\"simulate\")(\"Mockup Simulator\");\r\n options.trace = options.trace !== (\"false\" as any);\r\n return options as IOptions;\r\n });\r\n });\r\n\r\nconst main = async (): Promise<void> => {\r\n // DO TEST\r\n const options: IOptions = await getOptions();\r\n const report: DynamicExecutor.IReport = await DynamicExecutor.validate({\r\n prefix: \"test\",\r\n parameters: () => [\r\n {\r\n ...TestGlobal.connection(),\r\n simulate: options.simulate,\r\n },\r\n ],\r\n filter: (func) =>\r\n (!options.include?.length ||\r\n (options.include ?? []).some((str) => func.includes(str))) &&\r\n (!options.exclude?.length ||\r\n (options.exclude ?? []).every((str) => !func.includes(str))),\r\n extension: __filename.substring(__filename.length - 2),\r\n })(__dirname + \"/features\");\r\n\r\n // REPORT EXCEPTIONS\r\n const exceptions: Error[] = report.executions\r\n .filter((exec) => exec.error !== null)\r\n .map((exec) => exec.error!);\r\n if (exceptions.length === 0) {\r\n console.log(\"Success\");\r\n console.log(\"Elapsed time\", report.time.toLocaleString(), `ms`);\r\n } else {\r\n if (options.trace !== false) for (const exp of exceptions) console.log(exp);\r\n console.log(\"Failed\");\r\n console.log(\"Elapsed time\", report.time.toLocaleString(), `ms`);\r\n }\r\n\r\n // TERMINATE\r\n if (exceptions.length) process.exit(-1);\r\n else process.exit(0);\r\n};\r\nmain().catch((exp) => {\r\n console.log(exp);\r\n process.exit(-1);\r\n});\r\n"
66
+ },
67
+ {
68
+ "location": "test",
69
+ "file": "TestGlobal.ts",
70
+ "content": "import api from \"@ORGANIZATION/PROJECT-api\";\r\n\r\nexport namespace TestGlobal {\r\n export const connection = (): api.IConnection => ({\r\n host: `http://127.0.0.1:37001`,\r\n });\r\n}\r\n"
71
+ },
72
+ {
73
+ "location": "test",
74
+ "file": "tsconfig.json",
75
+ "content": "{\r\n \"extends\": \"../tsconfig.json\",\r\n \"compilerOptions\": {\r\n \"outDir\": \"../bin\",\r\n \"paths\": {\r\n \"@ORGANIZATION/PROJECT-api\": [\"../src\"],\r\n \"@ORGANIZATION/PROJECT-api/lib/*\": [\"../src/*\"],\r\n },\r\n \"plugins\": [\r\n { \"transform\": \"typia/lib/transform\" },\r\n { \"transform\": \"typescript-transform-paths\" },\r\n ],\r\n },\r\n \"include\": [\r\n \".\", \r\n \"../src\",\r\n ],\r\n}"
76
+ },
77
+ {
78
+ "location": "test/utils",
79
+ "file": "ArgumentParser.ts",
80
+ "content": "import commander from \"commander\";\r\nimport * as inquirer from \"inquirer\";\r\n\r\nexport namespace ArgumentParser {\r\n export type Inquiry<T> = (\r\n command: commander.Command,\r\n prompt: (opt?: inquirer.StreamOptions) => inquirer.PromptModule,\r\n action: (closure: (options: Partial<T>) => Promise<T>) => Promise<T>,\r\n ) => Promise<T>;\r\n\r\n export interface Prompt {\r\n select: (\r\n name: string,\r\n ) => (\r\n message: string,\r\n ) => <Choice extends string>(choices: Choice[]) => Promise<Choice>;\r\n boolean: (name: string) => (message: string) => Promise<boolean>;\r\n }\r\n\r\n export const parse = async <T>(\r\n inquiry: (\r\n command: commander.Command,\r\n prompt: Prompt,\r\n action: (closure: (options: Partial<T>) => Promise<T>) => Promise<T>,\r\n ) => Promise<T>,\r\n ): Promise<T> => {\r\n // TAKE OPTIONS\r\n const action = (closure: (options: Partial<T>) => Promise<T>) =>\r\n new Promise<T>((resolve, reject) => {\r\n commander.program.action(async (options) => {\r\n try {\r\n resolve(await closure(options));\r\n } catch (exp) {\r\n reject(exp);\r\n }\r\n });\r\n commander.program.parseAsync().catch(reject);\r\n });\r\n\r\n const select =\r\n (name: string) =>\r\n (message: string) =>\r\n async <Choice extends string>(choices: Choice[]): Promise<Choice> =>\r\n (\r\n await inquirer.createPromptModule()({\r\n type: \"list\",\r\n name,\r\n message,\r\n choices,\r\n })\r\n )[name];\r\n const boolean = (name: string) => async (message: string) =>\r\n (\r\n await inquirer.createPromptModule()({\r\n type: \"confirm\",\r\n name,\r\n message,\r\n })\r\n )[name] as boolean;\r\n\r\n const output: T | Error = await (async () => {\r\n try {\r\n return await inquiry(commander.program, { select, boolean }, action);\r\n } catch (error) {\r\n return error as Error;\r\n }\r\n })();\r\n\r\n // RETURNS\r\n if (output instanceof Error) throw output;\r\n return output;\r\n };\r\n}\r\n"
81
+ },
47
82
  {
48
83
  "location": "",
49
84
  "file": "tsconfig.json",
50
- "content": "{\r\n \"compilerOptions\": {\r\n /* Visit https://aka.ms/tsconfig to read more about this file */\r\n /* Projects */\r\n // \"incremental\": true, /* Save .tsbuildinfo files to allow for incremental compilation of projects. */\r\n // \"composite\": true, /* Enable constraints that allow a TypeScript project to be used with project references. */\r\n // \"tsBuildInfoFile\": \"./.tsbuildinfo\", /* Specify the path to .tsbuildinfo incremental compilation file. */\r\n // \"disableSourceOfProjectReferenceRedirect\": true, /* Disable preferring source files instead of declaration files when referencing composite projects. */\r\n // \"disableSolutionSearching\": true, /* Opt a project out of multi-project reference checking when editing. */\r\n // \"disableReferencedProjectLoad\": true, /* Reduce the number of projects loaded automatically by TypeScript. */\r\n /* Language and Environment */\r\n \"target\": \"ES5\", /* Set the JavaScript language version for emitted JavaScript and include compatible library declarations. */\r\n \"lib\": [\r\n \"DOM\",\r\n \"ES2015\"\r\n ], /* Specify a set of bundled library declaration files that describe the target runtime environment. */// \"jsx\": \"preserve\", /* Specify what JSX code is generated. */\r\n // \"experimentalDecorators\": true, /* Enable experimental support for TC39 stage 2 draft decorators. */\r\n // \"emitDecoratorMetadata\": true, /* Emit design-type metadata for decorated declarations in source files. */\r\n // \"jsxFactory\": \"\", /* Specify the JSX factory function used when targeting React JSX emit, e.g. 'React.createElement' or 'h'. */\r\n // \"jsxFragmentFactory\": \"\", /* Specify the JSX Fragment reference used for fragments when targeting React JSX emit e.g. 'React.Fragment' or 'Fragment'. */\r\n // \"jsxImportSource\": \"\", /* Specify module specifier used to import the JSX factory functions when using 'jsx: react-jsx*'. */\r\n // \"reactNamespace\": \"\", /* Specify the object invoked for 'createElement'. This only applies when targeting 'react' JSX emit. */\r\n // \"noLib\": true, /* Disable including any library files, including the default lib.d.ts. */\r\n // \"useDefineForClassFields\": true, /* Emit ECMAScript-standard-compliant class fields. */\r\n // \"moduleDetection\": \"auto\", /* Control what method is used to detect module-format JS files. */\r\n /* Modules */\r\n \"module\": \"commonjs\", /* Specify what module code is generated. */// \"rootDir\": \"./\", /* Specify the root folder within your source files. */\r\n // \"moduleResolution\": \"node\", /* Specify how TypeScript looks up a file from a given module specifier. */\r\n // \"baseUrl\": \"./\", /* Specify the base directory to resolve non-relative module names. */\r\n // \"paths\": {}, /* Specify a set of entries that re-map imports to additional lookup locations. */\r\n // \"rootDirs\": [], /* Allow multiple folders to be treated as one when resolving modules. */\r\n // \"typeRoots\": [], /* Specify multiple folders that act like './node_modules/@types'. */\r\n // \"types\": [], /* Specify type package names to be included without being referenced in a source file. */\r\n // \"allowUmdGlobalAccess\": true, /* Allow accessing UMD globals from modules. */\r\n // \"moduleSuffixes\": [], /* List of file name suffixes to search when resolving a module. */\r\n // \"resolveJsonModule\": true, /* Enable importing .json files. */\r\n // \"noResolve\": true, /* Disallow 'import's, 'require's or '<reference>'s from expanding the number of files TypeScript should add to a project. */\r\n /* JavaScript Support */\r\n // \"allowJs\": true, /* Allow JavaScript files to be a part of your program. Use the 'checkJS' option to get errors from these files. */\r\n // \"checkJs\": true, /* Enable error reporting in type-checked JavaScript files. */\r\n // \"maxNodeModuleJsDepth\": 1, /* Specify the maximum folder depth used for checking JavaScript files from 'node_modules'. Only applicable with 'allowJs'. */\r\n /* Emit */\r\n \"declaration\": true, /* Generate .d.ts files from TypeScript and JavaScript files in your project. */// \"declarationMap\": true, /* Create sourcemaps for d.ts files. */\r\n // \"emitDeclarationOnly\": true, /* Only output d.ts files and not JavaScript files. */\r\n \"sourceMap\": true, /* Create source map files for emitted JavaScript files. */// \"outFile\": \"./\", /* Specify a file that bundles all outputs into one JavaScript file. If 'declaration' is true, also designates a file that bundles all .d.ts output. */\r\n \"outDir\": \"./lib\", /* Specify an output folder for all emitted files. */// \"removeComments\": true, /* Disable emitting comments. */\r\n // \"noEmit\": true, /* Disable emitting files from a compilation. */\r\n // \"importHelpers\": true, /* Allow importing helper functions from tslib once per project, instead of including them per-file. */\r\n // \"importsNotUsedAsValues\": \"remove\", /* Specify emit/checking behavior for imports that are only used for types. */\r\n \"downlevelIteration\": true, /* Emit more compliant, but verbose and less performant JavaScript for iteration. */// \"sourceRoot\": \"\", /* Specify the root path for debuggers to find the reference source code. */\r\n // \"mapRoot\": \"\", /* Specify the location where debugger should locate map files instead of generated locations. */\r\n // \"inlineSourceMap\": true, /* Include sourcemap files inside the emitted JavaScript. */\r\n // \"inlineSources\": true, /* Include source code in the sourcemaps inside the emitted JavaScript. */\r\n // \"emitBOM\": true, /* Emit a UTF-8 Byte Order Mark (BOM) in the beginning of output files. */\r\n \"newLine\": \"lf\", /* Set the newline character for emitting files. */// \"stripInternal\": true, /* Disable emitting declarations that have '@internal' in their JSDoc comments. */\r\n // \"noEmitHelpers\": true, /* Disable generating custom helper functions like '__extends' in compiled output. */\r\n // \"noEmitOnError\": true, /* Disable emitting files if any type checking errors are reported. */\r\n // \"preserveConstEnums\": true, /* Disable erasing 'const enum' declarations in generated code. */\r\n // \"declarationDir\": \"./\", /* Specify the output directory for generated declaration files. */\r\n // \"preserveValueImports\": true, /* Preserve unused imported values in the JavaScript output that would otherwise be removed. */\r\n /* Interop Constraints */\r\n // \"isolatedModules\": true, /* Ensure that each file can be safely transpiled without relying on other imports. */\r\n // \"allowSyntheticDefaultImports\": true, /* Allow 'import x from y' when a module doesn't have a default export. */\r\n \"esModuleInterop\": true, /* Emit additional JavaScript to ease support for importing CommonJS modules. This enables 'allowSyntheticDefaultImports' for type compatibility. */// \"preserveSymlinks\": true, /* Disable resolving symlinks to their realpath. This correlates to the same flag in node. */\r\n \"forceConsistentCasingInFileNames\": true, /* Ensure that casing is correct in imports. *//* Type Checking */\r\n \"strict\": true, /* Enable all strict type-checking options. */// \"noImplicitAny\": true, /* Enable error reporting for expressions and declarations with an implied 'any' type. */\r\n // \"strictNullChecks\": true, /* When type checking, take into account 'null' and 'undefined'. */\r\n // \"strictFunctionTypes\": true, /* When assigning functions, check to ensure parameters and the return values are subtype-compatible. */\r\n // \"strictBindCallApply\": true, /* Check that the arguments for 'bind', 'call', and 'apply' methods match the original function. */\r\n // \"strictPropertyInitialization\": true, /* Check for class properties that are declared but not set in the constructor. */\r\n // \"noImplicitThis\": true, /* Enable error reporting when 'this' is given the type 'any'. */\r\n // \"useUnknownInCatchVariables\": true, /* Default catch clause variables as 'unknown' instead of 'any'. */\r\n // \"alwaysStrict\": true, /* Ensure 'use strict' is always emitted. */\r\n // \"noUnusedLocals\": true, /* Enable error reporting when local variables aren't read. */\r\n // \"noUnusedParameters\": true, /* Raise an error when a function parameter isn't read. */\r\n // \"exactOptionalPropertyTypes\": true, /* Interpret optional property types as written, rather than adding 'undefined'. */\r\n // \"noImplicitReturns\": true, /* Enable error reporting for codepaths that do not explicitly return in a function. */\r\n // \"noFallthroughCasesInSwitch\": true, /* Enable error reporting for fallthrough cases in switch statements. */\r\n // \"noUncheckedIndexedAccess\": true, /* Add 'undefined' to a type when accessed using an index. */\r\n // \"noImplicitOverride\": true, /* Ensure overriding members in derived classes are marked with an override modifier. */\r\n // \"noPropertyAccessFromIndexSignature\": true, /* Enforces using indexed accessors for keys declared using an indexed type. */\r\n // \"allowUnusedLabels\": true, /* Disable error reporting for unused labels. */\r\n // \"allowUnreachableCode\": true, /* Disable error reporting for unreachable code. */\r\n /* Completeness */\r\n // \"skipDefaultLibCheck\": true, /* Skip type checking .d.ts files that are included with TypeScript. */\r\n \"skipLibCheck\": true, /* Skip type checking all .d.ts files. */\r\n \"plugins\": [\r\n {\r\n \"transform\": \"typia/lib/transform\"\r\n }\r\n ]\r\n }\r\n}"
85
+ "content": "{\r\n \"compilerOptions\": {\r\n /* Visit https://aka.ms/tsconfig to read more about this file */\r\n /* Projects */\r\n // \"incremental\": true, /* Save .tsbuildinfo files to allow for incremental compilation of projects. */\r\n // \"composite\": true, /* Enable constraints that allow a TypeScript project to be used with project references. */\r\n // \"tsBuildInfoFile\": \"./.tsbuildinfo\", /* Specify the path to .tsbuildinfo incremental compilation file. */\r\n // \"disableSourceOfProjectReferenceRedirect\": true, /* Disable preferring source files instead of declaration files when referencing composite projects. */\r\n // \"disableSolutionSearching\": true, /* Opt a project out of multi-project reference checking when editing. */\r\n // \"disableReferencedProjectLoad\": true, /* Reduce the number of projects loaded automatically by TypeScript. */\r\n /* Language and Environment */\r\n \"target\": \"ES5\", /* Set the JavaScript language version for emitted JavaScript and include compatible library declarations. */\r\n \"lib\": [\r\n \"DOM\",\r\n \"ES2015\"\r\n ], /* Specify a set of bundled library declaration files that describe the target runtime environment. */// \"jsx\": \"preserve\", /* Specify what JSX code is generated. */\r\n // \"experimentalDecorators\": true, /* Enable experimental support for TC39 stage 2 draft decorators. */\r\n // \"emitDecoratorMetadata\": true, /* Emit design-type metadata for decorated declarations in source files. */\r\n // \"jsxFactory\": \"\", /* Specify the JSX factory function used when targeting React JSX emit, e.g. 'React.createElement' or 'h'. */\r\n // \"jsxFragmentFactory\": \"\", /* Specify the JSX Fragment reference used for fragments when targeting React JSX emit e.g. 'React.Fragment' or 'Fragment'. */\r\n // \"jsxImportSource\": \"\", /* Specify module specifier used to import the JSX factory functions when using 'jsx: react-jsx*'. */\r\n // \"reactNamespace\": \"\", /* Specify the object invoked for 'createElement'. This only applies when targeting 'react' JSX emit. */\r\n // \"noLib\": true, /* Disable including any library files, including the default lib.d.ts. */\r\n // \"useDefineForClassFields\": true, /* Emit ECMAScript-standard-compliant class fields. */\r\n // \"moduleDetection\": \"auto\", /* Control what method is used to detect module-format JS files. */\r\n /* Modules */\r\n \"module\": \"commonjs\", /* Specify what module code is generated. */// \"rootDir\": \"./\", /* Specify the root folder within your source files. */\r\n // \"moduleResolution\": \"node\", /* Specify how TypeScript looks up a file from a given module specifier. */\r\n // \"baseUrl\": \"./\", /* Specify the base directory to resolve non-relative module names. */\r\n // \"paths\": {}, /* Specify a set of entries that re-map imports to additional lookup locations. */\r\n // \"rootDirs\": [], /* Allow multiple folders to be treated as one when resolving modules. */\r\n // \"typeRoots\": [], /* Specify multiple folders that act like './node_modules/@types'. */\r\n // \"types\": [], /* Specify type package names to be included without being referenced in a source file. */\r\n // \"allowUmdGlobalAccess\": true, /* Allow accessing UMD globals from modules. */\r\n // \"moduleSuffixes\": [], /* List of file name suffixes to search when resolving a module. */\r\n // \"resolveJsonModule\": true, /* Enable importing .json files. */\r\n // \"noResolve\": true, /* Disallow 'import's, 'require's or '<reference>'s from expanding the number of files TypeScript should add to a project. */\r\n /* JavaScript Support */\r\n // \"allowJs\": true, /* Allow JavaScript files to be a part of your program. Use the 'checkJS' option to get errors from these files. */\r\n // \"checkJs\": true, /* Enable error reporting in type-checked JavaScript files. */\r\n // \"maxNodeModuleJsDepth\": 1, /* Specify the maximum folder depth used for checking JavaScript files from 'node_modules'. Only applicable with 'allowJs'. */\r\n /* Emit */\r\n \"declaration\": true, /* Generate .d.ts files from TypeScript and JavaScript files in your project. */// \"declarationMap\": true, /* Create sourcemaps for d.ts files. */\r\n // \"emitDeclarationOnly\": true, /* Only output d.ts files and not JavaScript files. */\r\n \"sourceMap\": true, /* Create source map files for emitted JavaScript files. */// \"outFile\": \"./\", /* Specify a file that bundles all outputs into one JavaScript file. If 'declaration' is true, also designates a file that bundles all .d.ts output. */\r\n \"outDir\": \"./lib\", /* Specify an output folder for all emitted files. */// \"removeComments\": true, /* Disable emitting comments. */\r\n // \"noEmit\": true, /* Disable emitting files from a compilation. */\r\n // \"importHelpers\": true, /* Allow importing helper functions from tslib once per project, instead of including them per-file. */\r\n // \"importsNotUsedAsValues\": \"remove\", /* Specify emit/checking behavior for imports that are only used for types. */\r\n \"downlevelIteration\": true, /* Emit more compliant, but verbose and less performant JavaScript for iteration. */// \"sourceRoot\": \"\", /* Specify the root path for debuggers to find the reference source code. */\r\n // \"mapRoot\": \"\", /* Specify the location where debugger should locate map files instead of generated locations. */\r\n // \"inlineSourceMap\": true, /* Include sourcemap files inside the emitted JavaScript. */\r\n // \"inlineSources\": true, /* Include source code in the sourcemaps inside the emitted JavaScript. */\r\n // \"emitBOM\": true, /* Emit a UTF-8 Byte Order Mark (BOM) in the beginning of output files. */\r\n \"newLine\": \"lf\", /* Set the newline character for emitting files. */// \"stripInternal\": true, /* Disable emitting declarations that have '@internal' in their JSDoc comments. */\r\n // \"noEmitHelpers\": true, /* Disable generating custom helper functions like '__extends' in compiled output. */\r\n // \"noEmitOnError\": true, /* Disable emitting files if any type checking errors are reported. */\r\n // \"preserveConstEnums\": true, /* Disable erasing 'const enum' declarations in generated code. */\r\n // \"declarationDir\": \"./\", /* Specify the output directory for generated declaration files. */\r\n // \"preserveValueImports\": true, /* Preserve unused imported values in the JavaScript output that would otherwise be removed. */\r\n /* Interop Constraints */\r\n // \"isolatedModules\": true, /* Ensure that each file can be safely transpiled without relying on other imports. */\r\n // \"allowSyntheticDefaultImports\": true, /* Allow 'import x from y' when a module doesn't have a default export. */\r\n \"esModuleInterop\": true, /* Emit additional JavaScript to ease support for importing CommonJS modules. This enables 'allowSyntheticDefaultImports' for type compatibility. */// \"preserveSymlinks\": true, /* Disable resolving symlinks to their realpath. This correlates to the same flag in node. */\r\n \"forceConsistentCasingInFileNames\": true, /* Ensure that casing is correct in imports. *//* Type Checking */\r\n \"strict\": true, /* Enable all strict type-checking options. */// \"noImplicitAny\": true, /* Enable error reporting for expressions and declarations with an implied 'any' type. */\r\n // \"strictNullChecks\": true, /* When type checking, take into account 'null' and 'undefined'. */\r\n // \"strictFunctionTypes\": true, /* When assigning functions, check to ensure parameters and the return values are subtype-compatible. */\r\n // \"strictBindCallApply\": true, /* Check that the arguments for 'bind', 'call', and 'apply' methods match the original function. */\r\n // \"strictPropertyInitialization\": true, /* Check for class properties that are declared but not set in the constructor. */\r\n // \"noImplicitThis\": true, /* Enable error reporting when 'this' is given the type 'any'. */\r\n // \"useUnknownInCatchVariables\": true, /* Default catch clause variables as 'unknown' instead of 'any'. */\r\n // \"alwaysStrict\": true, /* Ensure 'use strict' is always emitted. */\r\n // \"noUnusedLocals\": true, /* Enable error reporting when local variables aren't read. */\r\n // \"noUnusedParameters\": true, /* Raise an error when a function parameter isn't read. */\r\n // \"exactOptionalPropertyTypes\": true, /* Interpret optional property types as written, rather than adding 'undefined'. */\r\n // \"noImplicitReturns\": true, /* Enable error reporting for codepaths that do not explicitly return in a function. */\r\n // \"noFallthroughCasesInSwitch\": true, /* Enable error reporting for fallthrough cases in switch statements. */\r\n // \"noUncheckedIndexedAccess\": true, /* Add 'undefined' to a type when accessed using an index. */\r\n // \"noImplicitOverride\": true, /* Ensure overriding members in derived classes are marked with an override modifier. */\r\n // \"noPropertyAccessFromIndexSignature\": true, /* Enforces using indexed accessors for keys declared using an indexed type. */\r\n // \"allowUnusedLabels\": true, /* Disable error reporting for unused labels. */\r\n // \"allowUnreachableCode\": true, /* Disable error reporting for unreachable code. */\r\n /* Completeness */\r\n // \"skipDefaultLibCheck\": true, /* Skip type checking .d.ts files that are included with TypeScript. */\r\n \"skipLibCheck\": true, /* Skip type checking all .d.ts files. */\r\n \"plugins\": [\r\n {\r\n \"transform\": \"typia/lib/transform\"\r\n }\r\n ]\r\n },\r\n \"include\": [\"src\"],\r\n}"
51
86
  }
52
87
  ]
@@ -100,6 +100,7 @@ const main = async (): Promise<void> => {
100
100
  ".github/workflows/build.yml",
101
101
  "src/functional",
102
102
  "src/structures",
103
+ "test/features",
103
104
  ],
104
105
  });
105
106
  };
@@ -35,9 +35,7 @@ export namespace MigrateCommander {
35
35
 
36
36
  const app: MigrateApplication = new MigrateApplication(swagger);
37
37
  const { files } =
38
- options.mode === "nest"
39
- ? app.nest(options.simulate)
40
- : app.sdk(options.simulate);
38
+ options.mode === "nest" ? app.nest(options) : app.sdk(options);
41
39
  await MigrateFileArchiver.archive({
42
40
  mkdir: fs.promises.mkdir,
43
41
  writeFile: async (file, content) =>
@@ -4,9 +4,10 @@ import inquirer from "inquirer";
4
4
  export namespace MigrateInquirer {
5
5
  export interface IOutput {
6
6
  mode: "nest" | "sdk";
7
- simulate: boolean;
8
7
  input: string;
9
8
  output: string;
9
+ simulate: boolean;
10
+ e2e: boolean;
10
11
  }
11
12
 
12
13
  export const parse = async (): Promise<IOutput> => {
@@ -18,6 +19,7 @@ export namespace MigrateInquirer {
18
19
  );
19
20
  commander.program.option("--output [directory]", "output directory path");
20
21
  commander.program.option("--simulate", "Mockup simulator");
22
+ commander.program.option("--e2e [boolean]", "Generate E2E tests");
21
23
 
22
24
  // INTERNAL PROCEDURES
23
25
  const questioned = { value: false };
@@ -73,6 +75,11 @@ export namespace MigrateInquirer {
73
75
  partial.simulate =
74
76
  (await select("simulate")("Mokup Simulator")(["true", "false"])) ===
75
77
  "true";
78
+ if (partial.e2e) partial.e2e = (partial.e2e as any) === "true";
79
+ else
80
+ partial.e2e =
81
+ (await select("e2e")("Generate E2E tests")(["true", "false"])) ===
82
+ "true";
76
83
  return partial as IOutput;
77
84
  });
78
85
  };
@@ -0,0 +1,117 @@
1
+ import ts from "typescript";
2
+ import { IdentifierFactory } from "typia/lib/factories/IdentifierFactory";
3
+
4
+ import { ISwaggerComponents } from "../module";
5
+ import { IMigrateRoute } from "../structures/IMigrateRoute";
6
+ import { MigrateImportProgrammer } from "./MigrateImportProgrammer";
7
+ import { MigrateSchemaProgrammer } from "./MigrateSchemaProgrammer";
8
+
9
+ export namespace MigrateE2eFunctionProgrammer {
10
+ export const write =
11
+ (components: ISwaggerComponents) =>
12
+ (importer: MigrateImportProgrammer) =>
13
+ (route: IMigrateRoute): ts.FunctionDeclaration =>
14
+ ts.factory.createFunctionDeclaration(
15
+ [
16
+ ts.factory.createModifier(ts.SyntaxKind.ExportKeyword),
17
+ ts.factory.createModifier(ts.SyntaxKind.AsyncKeyword),
18
+ ],
19
+ undefined,
20
+ ["test", "api", ...route.accessor].join("_"),
21
+ undefined,
22
+ [
23
+ IdentifierFactory.parameter(
24
+ "connection",
25
+ ts.factory.createTypeReferenceNode(
26
+ ts.factory.createQualifiedName(
27
+ ts.factory.createIdentifier(
28
+ importer.external({
29
+ type: "default",
30
+ library: "@ORGANIZATION/PROJECT-api",
31
+ name: "api",
32
+ }),
33
+ ),
34
+ ts.factory.createIdentifier("IConnection"),
35
+ ),
36
+ ),
37
+ ),
38
+ ],
39
+ undefined,
40
+ ts.factory.createBlock(writeBody(components)(importer)(route), true),
41
+ );
42
+
43
+ const writeBody =
44
+ (components: ISwaggerComponents) =>
45
+ (importer: MigrateImportProgrammer) =>
46
+ (route: IMigrateRoute): ts.Statement[] => [
47
+ ts.factory.createVariableStatement(
48
+ [],
49
+ ts.factory.createVariableDeclarationList(
50
+ [
51
+ ts.factory.createVariableDeclaration(
52
+ "output",
53
+ undefined,
54
+ route.success
55
+ ? MigrateSchemaProgrammer.write(components)(importer)(
56
+ route.success.schema,
57
+ )
58
+ : undefined,
59
+ ts.factory.createAwaitExpression(
60
+ writeCallExpressionn(components)(importer)(route),
61
+ ),
62
+ ),
63
+ ],
64
+ ts.NodeFlags.Const,
65
+ ),
66
+ ),
67
+ ts.factory.createExpressionStatement(
68
+ ts.factory.createCallExpression(
69
+ ts.factory.createPropertyAccessExpression(
70
+ ts.factory.createIdentifier(
71
+ importer.external({
72
+ type: "default",
73
+ library: "typia",
74
+ name: "typia",
75
+ }),
76
+ ),
77
+ "assert",
78
+ ),
79
+ undefined,
80
+ [ts.factory.createIdentifier("output")],
81
+ ),
82
+ ),
83
+ ];
84
+
85
+ const writeCallExpressionn =
86
+ (components: ISwaggerComponents) =>
87
+ (importer: MigrateImportProgrammer) =>
88
+ (route: IMigrateRoute): ts.CallExpression =>
89
+ ts.factory.createCallExpression(
90
+ ts.factory.createPropertyAccessExpression(
91
+ ts.factory.createIdentifier("api.functional"),
92
+ ts.factory.createIdentifier(route.accessor.join(".")),
93
+ ),
94
+ undefined,
95
+ [
96
+ ts.factory.createIdentifier("connection"),
97
+ ...[...route.parameters, route.query!, route.body!]
98
+ .filter((p) => !!p)
99
+ .map((p) =>
100
+ ts.factory.createCallExpression(
101
+ ts.factory.createPropertyAccessExpression(
102
+ ts.factory.createIdentifier(
103
+ importer.external({
104
+ type: "default",
105
+ library: "typia",
106
+ name: "typia",
107
+ }),
108
+ ),
109
+ "random",
110
+ ),
111
+ [MigrateSchemaProgrammer.write(components)(importer)(p.schema)],
112
+ undefined,
113
+ ),
114
+ ),
115
+ ],
116
+ );
117
+ }
@@ -0,0 +1,35 @@
1
+ import ts from "typescript";
2
+
3
+ import { IMigrateProgram, ISwaggerComponents } from "../module";
4
+ import { IMigrateFile } from "../structures/IMigrateFile";
5
+ import { IMigrateRoute } from "../structures/IMigrateRoute";
6
+ import { FilePrinter } from "../utils/FilePrinter";
7
+ import { MigrateE2eFunctionProgrammer } from "./MigrateE2eFileProgrammer";
8
+ import { MigrateImportProgrammer } from "./MigrateImportProgrammer";
9
+
10
+ export namespace MigrateE2eProgrammer {
11
+ export const write = (program: IMigrateProgram): IMigrateFile[] =>
12
+ program.controllers
13
+ .map((c) => c.routes.map(writeFile(program.swagger.components)))
14
+ .flat();
15
+
16
+ const writeFile =
17
+ (components: ISwaggerComponents) =>
18
+ (route: IMigrateRoute): IMigrateFile => {
19
+ const importer: MigrateImportProgrammer = new MigrateImportProgrammer();
20
+ const func: ts.FunctionDeclaration =
21
+ MigrateE2eFunctionProgrammer.write(components)(importer)(route);
22
+ const statements: ts.Statement[] = [
23
+ ...importer.toStatements(
24
+ (name) => `@ORGANIZATION/PROJECT-api/lib/structures/${name}`,
25
+ ),
26
+ FilePrinter.newLine(),
27
+ func,
28
+ ];
29
+ return {
30
+ location: `test/features/api`,
31
+ file: `${["test", "api", ...route.accessor].join("_")}.ts`,
32
+ content: FilePrinter.write({ statements }),
33
+ };
34
+ };
35
+ }
@@ -15,11 +15,13 @@ export namespace IMigrateProgram {
15
15
  export interface IProps {
16
16
  mode: "nest" | "sdk";
17
17
  simulate: boolean;
18
+ e2e: boolean;
18
19
  swagger: ISwagger;
19
20
  dictionary: Dictionary;
20
21
  }
21
22
  export interface IConfig {
22
23
  mode: "nest" | "sdk";
23
24
  simulate: boolean;
25
+ e2e: boolean;
24
26
  }
25
27
  }