Skip to content

Commit 1046cd5

Browse files
committed
ts.CompilerHost.jsDocParsingMode
Since TypeScript v5.3 update, TypeScript compiler no more analyzes `JsDocComment` as default to boost up compilation speed by not parsing the JS Doc Comments. Therefore, to parepare the future TypeScript v5.3 release, I've updated `@nestia/sdk` to configure the `jsDocParsingMode` to parse every comments manually. microsoft/TypeScript#55739
1 parent 4c64b36 commit 1046cd5

File tree

14 files changed

+57
-43
lines changed

14 files changed

+57
-43
lines changed

benchmark/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@
2525
"homepage": "https://nestia.io",
2626
"dependencies": {
2727
"@nestia/core": "^2.2.1-dev.20231012",
28-
"typia": "^5.2.5"
28+
"typia": "^5.2.6"
2929
},
3030
"devDependencies": {
3131
"@trivago/prettier-plugin-sort-imports": "^4.1.1",

build/index.js

Lines changed: 17 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -9,24 +9,25 @@ const execute = (command) => {
99
cp.execSync(command, { stdio: "inherit" });
1010
};
1111

12-
const main = () => fs.readdirSync(PACKAGES).forEach((lib) => {
13-
const location = `${PACKAGES}/${lib}`;
14-
if (fs.existsSync(`${location}/package.json`) === false)
15-
return;
12+
const main = () =>
13+
fs.readdirSync(PACKAGES).forEach((lib) => {
14+
const location = `${PACKAGES}/${lib}`;
15+
if (fs.existsSync(`${location}/package.json`) === false) return;
1616

17-
console.log("----------------------------------------");
18-
console.log(`@nestia/${lib}`);
19-
console.log("----------------------------------------");
20-
process.chdir(location);
17+
console.log("----------------------------------------");
18+
console.log(`@nestia/${lib}`);
19+
console.log("----------------------------------------");
20+
process.chdir(location);
2121

22-
fs.copyFileSync(README, "README.md");
22+
fs.copyFileSync(README, "README.md");
2323

24-
const test = !!JSON.parse(
25-
fs.readFileSync("package.json", { encoding: "utf-8" })
26-
).scripts?.test;
24+
const test = !!JSON.parse(
25+
fs.readFileSync("package.json", { encoding: "utf-8" }),
26+
).scripts?.test;
2727

28-
execute("npm install");
29-
execute("npm run build");
30-
if (test) execute("npm run test");
31-
});
28+
// @todo: REMOVE --FORCE KEYWORD AFTER TS 5.3 RELEASE
29+
execute("npm install --force");
30+
execute("npm run build");
31+
if (test) execute("npm run test");
32+
});
3233
main();

deploy/publish.js

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,9 @@ const setup = (tag) => (version) => (directory) => {
2727
tag === "tgz" &&
2828
fs.existsSync(`${directory}/node_modules/${key}`)
2929
)
30-
execute(directory)(`npm uninstall ${key}`);
30+
try {
31+
execute(directory)(`npm uninstall ${key}`);
32+
} catch {}
3133
record[key] =
3234
tag === "tgz"
3335
? path.resolve(
@@ -51,7 +53,7 @@ const setup = (tag) => (version) => (directory) => {
5153
// SETUP UPDATED DEPENDENCIES
5254
fs.writeFileSync(file, JSON.stringify(info, null, 2), "utf8");
5355
execute(directory)("npm cache clean --force");
54-
execute(directory)(`npm install`);
56+
execute(directory)(`npm install --force`); // @todo: REMOVE AFTER TS 5.3 RELEASE
5557
};
5658

5759
const deploy = (tag) => (version) => (name) => {

packages/core/package.json

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@nestia/core",
3-
"version": "2.3.5",
3+
"version": "2.3.7",
44
"description": "Super-fast validation decorators of NestJS",
55
"main": "lib/index.js",
66
"typings": "lib/index.d.ts",
@@ -34,7 +34,7 @@
3434
},
3535
"homepage": "https://nestia.io",
3636
"dependencies": {
37-
"@nestia/fetcher": "^2.3.5",
37+
"@nestia/fetcher": "^2.3.7",
3838
"@nestjs/common": ">=7.0.1",
3939
"@nestjs/core": ">=7.0.1",
4040
"@nestjs/platform-express": ">=7.0.1",
@@ -44,10 +44,10 @@
4444
"raw-body": ">=2.0.0",
4545
"reflect-metadata": ">=0.1.12",
4646
"rxjs": ">=6.0.0",
47-
"typia": "^5.2.5"
47+
"typia": "^5.2.6"
4848
},
4949
"peerDependencies": {
50-
"@nestia/fetcher": ">=2.3.5",
50+
"@nestia/fetcher": ">=2.3.7",
5151
"@nestjs/common": ">=7.0.1",
5252
"@nestjs/core": ">=7.0.1",
5353
"@nestjs/platform-express": ">=7.0.1",
@@ -56,7 +56,7 @@
5656
"reflect-metadata": ">=0.1.12",
5757
"rxjs": ">=6.0.0",
5858
"typescript": ">=4.8.0 <5.3.0",
59-
"typia": ">=5.2.5 <6.0.0"
59+
"typia": ">=5.2.6 <6.0.0"
6060
},
6161
"devDependencies": {
6262
"@trivago/prettier-plugin-sort-imports": "^4.0.0",

packages/e2e/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@
4040
"ts-node": "^10.9.1",
4141
"ts-patch": "^3.0.2",
4242
"typescript": "^5.2.2",
43-
"typia": "^5.2.5"
43+
"typia": "^5.2.6"
4444
},
4545
"dependencies": {
4646
"chalk": "^4.1.2",

packages/fetcher/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@nestia/fetcher",
3-
"version": "2.3.5",
3+
"version": "2.3.7",
44
"description": "Fetcher library of Nestia SDK",
55
"main": "lib/index.js",
66
"typings": "lib/index.d.ts",

packages/migrate/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@
4545
"typescript-transform-paths": "^3.4.6"
4646
},
4747
"dependencies": {
48-
"typia": "^5.2.5"
48+
"typia": "^5.2.6"
4949
},
5050
"files": [
5151
"lib",

packages/sdk/package.json

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@nestia/sdk",
3-
"version": "2.3.5",
3+
"version": "2.3.7",
44
"description": "Nestia SDK and Swagger generator",
55
"main": "lib/index.js",
66
"typings": "lib/index.d.ts",
@@ -35,7 +35,7 @@
3535
},
3636
"homepage": "https://nestia.io",
3737
"dependencies": {
38-
"@nestia/fetcher": "^2.3.5",
38+
"@nestia/fetcher": "^2.3.7",
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.5"
47+
"typia": "^5.2.6"
4848
},
4949
"peerDependencies": {
50-
"@nestia/fetcher": ">=2.3.5",
50+
"@nestia/fetcher": ">=2.3.7",
5151
"@nestjs/common": ">=7.0.1",
5252
"@nestjs/core": ">=7.0.1",
5353
"reflect-metadata": ">=0.1.12",
5454
"ts-node": ">=10.6.0",
5555
"typescript": ">=4.8.0 <5.3.0",
56-
"typia": ">=5.2.5 <6.0.0"
56+
"typia": ">=5.2.6 <6.0.0"
5757
},
5858
"devDependencies": {
5959
"@nestia/e2e": "^0.3.7",
@@ -74,7 +74,7 @@
7474
"rimraf": "^3.0.2",
7575
"ts-node": "^10.9.1",
7676
"ts-patch": "v3.0.2",
77-
"typescript": "^5.2.2",
77+
"typescript": "^5.3.0-beta",
7878
"typescript-transform-paths": "^3.4.4",
7979
"uuid": "^9.0.0"
8080
},

packages/sdk/src/NestiaSdkApplication.ts

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,9 @@ export class NestiaSdkApplication {
104104
checker: ts.TypeChecker,
105105
) => (config: Config) => (routes: IRoute[]) => Promise<void>,
106106
): Promise<void> {
107+
//----
107108
// ANALYZE REFLECTS
109+
//----
108110
const unique: WeakSet<any> = new WeakSet();
109111
const controllers: IController[] = [];
110112
const project: INestiaProject = {
@@ -150,11 +152,20 @@ export class NestiaSdkApplication {
150152
.reduce((a, b) => a + b, 0)}`,
151153
);
152154

155+
//----
153156
// ANALYZE TYPESCRIPT CODE
157+
//----
154158
console.log("Analyzing source codes");
159+
160+
// FOR TS 5.3+ CASE: https://github.com/microsoft/TypeScript/pull/55739
161+
const host: ts.CompilerHost = ts.createCompilerHost(
162+
this.compilerOptions,
163+
);
164+
host.jsDocParsingMode = 0;
155165
const program: ts.Program = ts.createProgram(
156166
controllers.map((c) => c.file),
157167
this.compilerOptions,
168+
host,
158169
);
159170
project.checker = program.getTypeChecker();
160171

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,6 @@
3434
},
3535
"dependencies": {
3636
"@nestia/fetcher": "file:../../../../../packages/fetcher/nestia-fetcher-0.0.0-dev.20991231.tgz",
37-
"typia": "^5.2.5"
37+
"typia": "^5.2.6"
3838
}
3939
}

0 commit comments

Comments
 (0)