diff --git a/package.json b/package.json index 166054c..aff924c 100644 --- a/package.json +++ b/package.json @@ -75,7 +75,7 @@ "ts-node": "^10.9.1", "ts-patch": "3.0.0", "tsconfig-paths": "^4.2.0", - "typescript": "^5.0.4" + "typescript": "^5.3.2" }, "directories": { "resources": "./dist/resources" diff --git a/projects/core/src/patch/patch-module.ts b/projects/core/src/patch/patch-module.ts index 7d16890..ec24142 100644 --- a/projects/core/src/patch/patch-module.ts +++ b/projects/core/src/patch/patch-module.ts @@ -96,6 +96,25 @@ export function patchModule(tsModule: TsModule, skipDts: boolean = false): { js: printableFooters.push(`tsp.${execTscCmd}();`); } + /* Patch defaultJSDocParsingMode */ + if ( + tsModule.moduleName === "tsc.js" && + ((tsModule.majorVer === 5 && tsModule.minorVer >= 3) || + tsModule.majorVer > 5) + ) { + const tscSection = source.body.find((s) => + s.sourceText.includes(JS_DOC_MODE_FROM), + ); + if (tscSection) { + tscSection.updateSourceText( + tscSection.sourceText.replace( + JS_DOC_MODE_FROM, + JS_DOC_MODE_TO, + ), + ); + } + } + /* Print the module */ const printedJs = printModule(); @@ -194,4 +213,7 @@ export function patchModule(tsModule: TsModule, skipDts: boolean = false): { js: } } +const JS_DOC_MODE_FROM = `var defaultJSDocParsingMode = 2 /* ParseForTypeErrors */`; +const JS_DOC_MODE_TO = `var defaultJSDocParsingMode = 0 /* ParseAll */`; + // endregion diff --git a/yarn.lock b/yarn.lock index 4beef0d..854f1d6 100644 --- a/yarn.lock +++ b/yarn.lock @@ -3137,10 +3137,10 @@ typedarray@^0.0.6: resolved "https://registry.yarnpkg.com/typedarray/-/typedarray-0.0.6.tgz#867ac74e3864187b1d3d47d996a78ec5c8830777" integrity sha512-/aCDEGatGvZ2BIk+HmLf4ifCJFwvKFNb9/JeZPMulfgFracn9QFcAf5GO8B/mweUjSoblS5In0cWhqpfs/5PQA== -typescript@^5.0.4: - version "5.1.6" - resolved "https://registry.yarnpkg.com/typescript/-/typescript-5.1.6.tgz#02f8ac202b6dad2c0dd5e0913745b47a37998274" - integrity sha512-zaWCozRZ6DLEWAWFrVDz1H6FVXzUSfTy5FUMWsQlU8Ym5JP9eO4xkTIROFCQvhQf61z6O/G6ugw3SgAnvvm+HA== +typescript@^5.3.2: + version "5.3.2" + resolved "https://registry.yarnpkg.com/typescript/-/typescript-5.3.2.tgz#00d1c7c1c46928c5845c1ee8d0cc2791031d4c43" + integrity sha512-6l+RyNy7oAHDfxC4FzSJcz9vnjTKxrLpDG5M2Vu4SHRVNg6xzqZp6LYSR9zjqQTu8DU/f5xwxUdADOkbrIX2gQ== uglify-js@^3.1.4: version "3.17.4"