Skip to content

Commit

Permalink
Merge pull request #283 from samchon/features/long
Browse files Browse the repository at this point in the history
Fix #282 - too long type name
  • Loading branch information
samchon authored Mar 16, 2023
2 parents 6d5433d + 91f8556 commit e6310b9
Show file tree
Hide file tree
Showing 9 changed files with 46 additions and 26 deletions.
8 changes: 4 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "nestia",
"version": "4.0.9",
"version": "4.0.10",
"description": "Nestia CLI",
"main": "bin/index.js",
"bin": {
Expand Down Expand Up @@ -29,15 +29,15 @@
},
"homepage": "https://github.com/samchon/nestia",
"devDependencies": {
"@nestia/core": "^1.0.6",
"@nestia/sdk": "^1.0.1",
"@nestia/core": "^1.0.17",
"@nestia/sdk": "^1.0.16",
"@types/inquirer": "^9.0.3",
"@types/node": "^18.11.16",
"commander": "^10.0.0",
"comment-json": "^4.2.3",
"inquirer": "^8.2.5",
"rimraf": "^3.0.2",
"typescript": "^4.9.4"
"typescript": "^4.9.5"
},
"files": [
"bin",
Expand Down
6 changes: 3 additions & 3 deletions packages/core/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@nestia/core",
"version": "1.0.16",
"version": "1.0.17",
"description": "Super-fast validation decorators of NestJS",
"main": "lib/index.js",
"typings": "lib/index.d.ts",
Expand Down Expand Up @@ -63,10 +63,10 @@
"raw-body": "*",
"reflect-metadata": "*",
"rxjs": "*",
"typia": "^3.6.5"
"typia": "^3.6.8"
},
"peerDependencies": {
"typescript": ">= 4.5.2"
"typescript": ">= 4.5.2 && < 5.0.0"
},
"files": [
"README.md",
Expand Down
2 changes: 1 addition & 1 deletion packages/core/src/executable/core.ts
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ async function setup(): Promise<void> {
const args: ArgumentParser.IArguments = await ArgumentParser.parse(pack);

// INSTALL TYPESCRIPT
pack.install({ dev: true, modulo: "typescript" });
pack.install({ dev: true, modulo: "typescript", version: "4.9.5" });
args.project ??= (() => {
CommandExecutor.run("npx tsc --init", false);
return (args.project = "tsconfig.json");
Expand Down
22 changes: 16 additions & 6 deletions packages/core/src/executable/internal/ArgumentParser.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@ import type CommanderModule from "commander";
import fs from "fs";
import type * as InquirerModule from "inquirer";
import path from "path";
import { FileRetriever } from "./FileRetriever";

import { FileRetriever } from "./FileRetriever";
import { PackageManager } from "./PackageManager";

export namespace ArgumentParser {
Expand Down Expand Up @@ -97,11 +97,21 @@ export namespace ArgumentParser {
const configure = async () => {
const fileList: string[] = await (
await fs.promises.readdir(process.cwd())
).filter(
(str) =>
str.substring(0, 8) === "tsconfig" &&
str.substring(str.length - 5) === ".json",
);
)
.filter(
(str) =>
str.substring(0, 8) === "tsconfig" &&
str.substring(str.length - 5) === ".json",
)
.sort((x, y) =>
x === "tsconfig.json"
? -1
: y === "tsconfig.json"
? 1
: x < y
? -1
: 1,
);
if (fileList.length === 0) {
if (process.cwd() !== pack.directory)
throw new Error(`Unable to find "tsconfig.json" file.`);
Expand Down
2 changes: 1 addition & 1 deletion packages/core/src/transformers/MethodTransformer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ function get_name(symbol: ts.Symbol): string {
function explore_name(name: string, decl: ts.Node): string {
return ts.isModuleBlock(decl)
? explore_name(
`${decl.parent.name.getText()}.${name}`,
`${decl.parent.name.getFullText().trim()}.${name}`,
decl.parent.parent,
)
: name;
Expand Down
8 changes: 4 additions & 4 deletions packages/sdk/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@nestia/sdk",
"version": "1.0.15",
"version": "1.0.16",
"description": "Nestia SDK and Swagger generator",
"main": "lib/index.js",
"typings": "lib/index.d.ts",
Expand Down Expand Up @@ -33,7 +33,7 @@
},
"homepage": "https://github.com/samchon/nestia",
"devDependencies": {
"@nestia/core": "^1.0.15",
"@nestia/core": "^1.0.17",
"@nestia/fetcher": "^1.0.1",
"@trivago/prettier-plugin-sort-imports": "^4.0.0",
"@types/cli": "^0.11.21",
Expand All @@ -49,7 +49,7 @@
"rimraf": "^3.0.2",
"ts-node": "^10.9.1",
"ttypescript": "^1.5.15",
"typescript": "^4.9.4",
"typescript": "^4.9.5",
"typescript-transform-paths": "^3.4.4",
"uuid": "^9.0.0"
},
Expand All @@ -61,7 +61,7 @@
"tsconfck": "^2.0.1",
"tsconfig-paths": "^4.1.1",
"tstl": "^2.5.13",
"typia": "^3.6.7"
"typia": "^3.6.8"
},
"files": [
"assets",
Expand Down
2 changes: 1 addition & 1 deletion packages/sdk/src/analyses/ImportAnalyzer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,7 @@ export namespace ImportAnalyzer {
function explore_name(name: string, decl: ts.Node): string {
return ts.isModuleBlock(decl)
? explore_name(
`${decl.parent.name.getText()}.${name}`,
`${decl.parent.name.getFullText().trim()}.${name}`,
decl.parent.parent,
)
: name;
Expand Down
2 changes: 1 addition & 1 deletion src/NestiaSetupWizard.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ export namespace NestiaSetupWizard {
);

// INSTALL TYPESCRIPT
pack.install({ dev: true, modulo: "typescript" });
pack.install({ dev: true, modulo: "typescript", version: "4.9.5" });
args.project ??= (() => {
CommandExecutor.run("npx tsc --init", false);
return (args.project = "tsconfig.json");
Expand Down
20 changes: 15 additions & 5 deletions src/internal/ArgumentParser.ts
Original file line number Diff line number Diff line change
Expand Up @@ -97,11 +97,21 @@ export namespace ArgumentParser {
const configure = async () => {
const fileList: string[] = await (
await fs.promises.readdir(process.cwd())
).filter(
(str) =>
str.substring(0, 8) === "tsconfig" &&
str.substring(str.length - 5) === ".json",
);
)
.filter(
(str) =>
str.substring(0, 8) === "tsconfig" &&
str.substring(str.length - 5) === ".json",
)
.sort((x, y) =>
x === "tsconfig.json"
? -1
: y === "tsconfig.json"
? 1
: x < y
? -1
: 1,
);
if (fileList.length === 0) {
if (process.cwd() !== pack.directory)
throw new Error(`Unable to find "tsconfig.json" file.`);
Expand Down

0 comments on commit e6310b9

Please sign in to comment.