Skip to content

Commit 7a53923

Browse files
authored
Merge pull request #696 from samchon/features/5.3
Adapt new cli command `npx typia patch`.
2 parents 3c037cf + fb24dc1 commit 7a53923

File tree

17 files changed

+100
-75
lines changed

17 files changed

+100
-75
lines changed

benchmark/package.json

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
"build": "rimraf bin && tsc",
88
"generate": "ts-node src/generate",
99
"start": "npm run build && node bin",
10-
"prepare": "ts-patch install"
10+
"prepare": "ts-patch install && typia patch"
1111
},
1212
"repository": {
1313
"type": "git",
@@ -24,8 +24,8 @@
2424
},
2525
"homepage": "https://nestia.io",
2626
"dependencies": {
27-
"@nestia/core": "^2.2.1-dev.20231012",
28-
"typia": "^5.2.6"
27+
"@nestia/core": "^2.4.0",
28+
"typia": "^5.3.0"
2929
},
3030
"devDependencies": {
3131
"@trivago/prettier-plugin-sort-imports": "^4.1.1",
@@ -47,6 +47,6 @@
4747
"ts-node": "^10.9.1",
4848
"ts-patch": "^3.0.2",
4949
"tstl": "^2.5.13",
50-
"typescript": "^5.2.2"
50+
"typescript": "^5.3.2"
5151
}
5252
}

packages/cli/package.json

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "nestia",
3-
"version": "5.0.3",
3+
"version": "5.1.0",
44
"description": "Nestia CLI tool",
55
"main": "bin/index.js",
66
"bin": {
@@ -37,14 +37,14 @@
3737
"inquirer": "^8.2.5"
3838
},
3939
"devDependencies": {
40-
"@nestia/core": "^2.3.4",
41-
"@nestia/sdk": "^2.3.4",
40+
"@nestia/core": "^2.4.0",
41+
"@nestia/sdk": "^2.4.0",
4242
"@trivago/prettier-plugin-sort-imports": "^4.1.1",
4343
"@types/inquirer": "^9.0.3",
4444
"@types/node": "^18.11.16",
4545
"prettier": "^2.8.7",
4646
"rimraf": "^3.0.2",
47-
"typescript": "^5.2.2"
47+
"typescript": "^5.3.2"
4848
},
4949
"files": [
5050
"bin",

packages/cli/src/NestiaSetupWizard.ts

Lines changed: 20 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ export namespace NestiaSetupWizard {
1818
// INSTALL TYPESCRIPT COMPILERS
1919
pack.install({ dev: true, modulo: "ts-patch", version: "latest" });
2020
pack.install({ dev: true, modulo: "ts-node", version: "latest" });
21-
pack.install({ dev: true, modulo: "typescript", version: "5.2.2" });
21+
pack.install({ dev: true, modulo: "typescript", version: "5.3.2" });
2222
args.project ??= (() => {
2323
const runner: string =
2424
pack.manager === "npm" ? "npx" : pack.manager;
@@ -34,10 +34,24 @@ export namespace NestiaSetupWizard {
3434
typeof data.scripts.prepare === "string" &&
3535
data.scripts.prepare.trim().length
3636
) {
37-
if (data.scripts.prepare.indexOf("ts-patch install") === -1)
37+
if (
38+
data.scripts.prepare.indexOf("ts-patch install") === -1 &&
39+
data.scripts.prepare.indexOf("typia patch") === -1
40+
)
41+
data.scripts.prepare =
42+
"ts-patch install && typia patch && " +
43+
data.scripts.prepare;
44+
else if (
45+
data.scripts.prepare.indexOf("ts-patch install") === -1
46+
)
3847
data.scripts.prepare =
3948
"ts-patch install && " + data.scripts.prepare;
40-
} else data.scripts.prepare = "ts-patch install";
49+
else if (data.scripts.prepare.indexOf("typia patch") === -1)
50+
data.scripts.prepare = data.scripts.prepare.replace(
51+
"ts-patch install",
52+
"ts-patch install && typia patch",
53+
);
54+
} else data.scripts.prepare = "ts-patch install && typia patch";
4155

4256
// FOR OLDER VERSIONS
4357
if (typeof data.scripts.postinstall === "string") {
@@ -50,13 +64,15 @@ export namespace NestiaSetupWizard {
5064
delete data.scripts.postinstall;
5165
}
5266
});
53-
CommandExecutor.run(`${pack.manager} run prepare`);
5467

5568
// INSTALL AND CONFIGURE NESTIA
5669
pack.install({ dev: false, modulo: "@nestia/core", version: "latest" });
5770
pack.install({ dev: true, modulo: "@nestia/e2e", version: "latest" });
5871
pack.install({ dev: true, modulo: "@nestia/sdk", version: "latest" });
5972
pack.install({ dev: true, modulo: "nestia", version: "latest" });
73+
pack.install({ dev: false, modulo: "typia" });
74+
6075
await PluginConfigurator.configure(args);
76+
CommandExecutor.run(`${pack.manager} run prepare`);
6177
}
6278
}

packages/cli/src/internal/PackageManager.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ export class PackageManager {
3838
public install(props: {
3939
dev: boolean;
4040
modulo: string;
41-
version: `latest` | `${number}.${number}.${number}`;
41+
version?: `latest` | `next` | `${number}.${number}.${number}`;
4242
}): boolean {
4343
const middle: string =
4444
this.manager === "yarn"

packages/core/package.json

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@nestia/core",
3-
"version": "2.3.12",
3+
"version": "2.4.0",
44
"description": "Super-fast validation decorators of NestJS",
55
"main": "lib/index.js",
66
"typings": "lib/index.d.ts",
@@ -12,7 +12,7 @@
1212
"package:latest": "npm run build && npm publish --access public",
1313
"package:next": "npm run package:latest -- --tag next",
1414
"prettier": "prettier ./**/*.ts --write",
15-
"prepare": "ts-patch install"
15+
"prepare": "ts-patch install && typia patch"
1616
},
1717
"repository": {
1818
"type": "git",
@@ -34,7 +34,7 @@
3434
},
3535
"homepage": "https://nestia.io",
3636
"dependencies": {
37-
"@nestia/fetcher": "^2.3.12",
37+
"@nestia/fetcher": "^2.4.0",
3838
"@nestjs/common": ">=7.0.1",
3939
"@nestjs/core": ">=7.0.1",
4040
"@nestjs/platform-express": ">=7.0.1",
@@ -44,19 +44,19 @@
4444
"raw-body": ">=2.0.0",
4545
"reflect-metadata": ">=0.1.12",
4646
"rxjs": ">=6.0.0",
47-
"typia": "^5.2.6"
47+
"typia": "^5.3.0"
4848
},
4949
"peerDependencies": {
50-
"@nestia/fetcher": ">=2.3.12",
50+
"@nestia/fetcher": ">=2.4.0",
5151
"@nestjs/common": ">=7.0.1",
5252
"@nestjs/core": ">=7.0.1",
5353
"@nestjs/platform-express": ">=7.0.1",
5454
"@nestjs/platform-fastify": ">=7.0.1",
5555
"raw-body": ">=2.0.0",
5656
"reflect-metadata": ">=0.1.12",
5757
"rxjs": ">=6.0.0",
58-
"typescript": ">=4.8.0 <5.3.0",
59-
"typia": ">=5.2.6 <6.0.0"
58+
"typescript": ">=4.8.0 <5.4.0",
59+
"typia": ">=5.3.0 <6.0.0"
6060
},
6161
"devDependencies": {
6262
"@trivago/prettier-plugin-sort-imports": "^4.0.0",
@@ -76,7 +76,7 @@
7676
"ts-node": "^10.9.1",
7777
"ts-patch": "^3.0.2",
7878
"tstl": "^2.5.13",
79-
"typescript": "^5.2.2",
79+
"typescript": "^5.3.2",
8080
"typescript-transform-paths": "^3.4.6"
8181
},
8282
"files": [

packages/e2e/package.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
"dev": "npm run build -- --watch",
99
"eslint": "eslint src",
1010
"prettier": "prettier --write ./src/**/*.ts",
11-
"prepare": "ts-patch install",
11+
"prepare": "ts-patch install && typia patch",
1212
"test": "node lib/test"
1313
},
1414
"repository": {
@@ -39,8 +39,8 @@
3939
"rimraf": "^4.1.2",
4040
"ts-node": "^10.9.1",
4141
"ts-patch": "^3.0.2",
42-
"typescript": "^5.2.2",
43-
"typia": "^5.2.6"
42+
"typescript": "^5.3.2",
43+
"typia": "^5.3.0"
4444
},
4545
"dependencies": {
4646
"chalk": "^4.1.2",

packages/fetcher/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@nestia/fetcher",
3-
"version": "2.3.12",
3+
"version": "2.4.0",
44
"description": "Fetcher library of Nestia SDK",
55
"main": "lib/index.js",
66
"typings": "lib/index.d.ts",
@@ -32,7 +32,7 @@
3232
"@typescript-eslint/parser": "^5.46.1",
3333
"prettier": "^2.8.1",
3434
"rimraf": "^3.0.2",
35-
"typescript": "^5.2.2"
35+
"typescript": "^5.3.2"
3636
},
3737
"peerDependencies": {
3838
"typescript": ">= 4.8.0"

packages/migrate/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,11 +44,11 @@
4444
"ts-node": "^10.9.1",
4545
"ts-patch": "^3.0.2",
4646
"tstl": "^2.5.13",
47-
"typescript": "^5.2.2",
47+
"typescript": "^5.3.2",
4848
"typescript-transform-paths": "^3.4.6"
4949
},
5050
"dependencies": {
51-
"typia": "^5.2.6"
51+
"typia": "^5.3.0"
5252
},
5353
"files": [
5454
"lib",

packages/sdk/package.json

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@nestia/sdk",
3-
"version": "2.3.12",
3+
"version": "2.4.0",
44
"description": "Nestia SDK and Swagger generator",
55
"main": "lib/index.js",
66
"typings": "lib/index.d.ts",
@@ -13,7 +13,7 @@
1313
"eslint": "eslint ./**/*.ts",
1414
"package:latest": "npm run build && npm publish --access public",
1515
"package:next": "npm run package:latest -- --tag next",
16-
"prepare": "ts-patch install",
16+
"prepare": "ts-patch install && typia patch",
1717
"prettier": "prettier --write ./**/*.ts"
1818
},
1919
"repository": {
@@ -35,7 +35,7 @@
3535
},
3636
"homepage": "https://nestia.io",
3737
"dependencies": {
38-
"@nestia/fetcher": "^2.3.12",
38+
"@nestia/fetcher": "^2.4.0",
3939
"cli": "^1.0.1",
4040
"get-function-location": "^2.0.0",
4141
"glob": "^7.2.0",
@@ -44,16 +44,16 @@
4444
"tsconfck": "^2.0.1",
4545
"tsconfig-paths": "^4.1.1",
4646
"tstl": "^2.5.13",
47-
"typia": "^5.2.6"
47+
"typia": "^5.3.0"
4848
},
4949
"peerDependencies": {
50-
"@nestia/fetcher": ">=2.3.12",
50+
"@nestia/fetcher": ">=2.4.0",
5151
"@nestjs/common": ">=7.0.1",
5252
"@nestjs/core": ">=7.0.1",
5353
"reflect-metadata": ">=0.1.12",
5454
"ts-node": ">=10.6.0",
55-
"typescript": ">=4.8.0 <5.3.0",
56-
"typia": ">=5.2.6 <6.0.0"
55+
"typescript": ">=4.8.0 <5.4.0",
56+
"typia": ">=5.3.0 <6.0.0"
5757
},
5858
"devDependencies": {
5959
"@nestia/e2e": "^0.3.7",

test/features/distribute-assert/packages/api/package.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
"build:sdk": "rimraf ../../src/api/functional && cd ../.. && npx nestia sdk && cd packages/api",
1010
"compile": "rimraf lib && tsc",
1111
"deploy": "npm run build && npm publish",
12-
"prepare": "ts-patch install"
12+
"prepare": "ts-patch install && typia patch"
1313
},
1414
"repository": {
1515
"type": "git",
@@ -30,10 +30,10 @@
3030
"rimraf": "^5.0.5",
3131
"ts-node": "^10.9.1",
3232
"ts-patch": "^3.0.2",
33-
"typescript": "^5.2.2"
33+
"typescript": "^5.3.2"
3434
},
3535
"dependencies": {
3636
"@nestia/fetcher": "file:../../../../../packages/fetcher/nestia-fetcher-0.0.0-dev.20991231.tgz",
37-
"typia": "^5.2.6"
37+
"typia": "^5.3.0"
3838
}
3939
}

0 commit comments

Comments
 (0)