Skip to content

Commit b9352b2

Browse files
authored
Bump TypeScript to 5.4.5, Fix CI build errors (#1299)
Related to #1287 TypeScript 5.4.5 (well, technically 5.2) gives us the [Disposable](https://www.typescriptlang.org/docs/handbook/release-notes/typescript-5-2.html) interface for cleaning up resources. Also includes the changes from [CI: Fix intermittent docs build failures](#1307): Building the documentation page often fails. This PR is an exploration to fix it. It: * Patches the typedoc library in `node_modules` as otherwise it won't work with TypeScript 5.4 🙈 * Removes non-essential TypeDoc plugins (link API reference to MDN, cross-link Typedoc modules) * Copies the `rollup.d.ts` files to `dist` instead of moving them. TypeDoc, apparently, expects to find them in their original location: ``` error TS6053: File '/home/runner/work/wordpress-playground/wordpress-playground/packages/php-wasm/web/src/rollup.d.ts' not found. The file is in the program because: Root file specified for compilation ```
1 parent 3ffc8a1 commit b9352b2

File tree

9 files changed

+13
-82
lines changed

9 files changed

+13
-82
lines changed

package-lock.json

Lines changed: 4 additions & 64 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,6 @@
7676
"@docusaurus/plugin-ideal-image": "^2.4.1",
7777
"@docusaurus/preset-classic": "2.4.1",
7878
"@docusaurus/theme-live-codeblock": "^2.4.1",
79-
"@knodes/typedoc-plugin-pages": "0.23.1",
8079
"@mdx-js/react": "^1.6.22",
8180
"@nx/cypress": "16.9.0",
8281
"@nx/devkit": "16.9.0",
@@ -161,9 +160,7 @@
161160
"ts-node": "10.9.1",
162161
"tslib": "^2.3.0",
163162
"typedoc": "0.23.27",
164-
"typedoc-plugin-mdn-links": "3.0.3",
165-
"typedoc-plugin-resolve-crossmodule-references": "0.3.3",
166-
"typescript": "5.1.6",
163+
"typescript": "5.4.5",
167164
"vite": "4.5.0",
168165
"vite-plugin-dts": "3.6.3",
169166
"vite-plugin-eslint": "^1.8.1",
@@ -180,7 +177,7 @@
180177
"rollup": "^3.2.0",
181178
"react": "^18.2.0",
182179
"react-dom": "^18.2.0",
183-
"typescript": "5.1.6",
180+
"typescript": "5.4.5",
184181
"typedoc": "0.23.27"
185182
},
186183
"workspaces": [

packages/docs/site/docusaurus.config.js

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -203,13 +203,6 @@ function getDocusaurusPluginTypedocApiConfig() {
203203
options.entryPoints = packages.map((entry) =>
204204
path.join(projectRoot, entry)
205205
);
206-
options.plugin = [
207-
'typedoc-plugin-resolve-crossmodule-references',
208-
// This plugin somehow doesn't work with docusaurus-plugin-typedoc-api.
209-
// @TODO: Fix it
210-
'typedoc-plugin-mdn-links',
211-
];
212-
213206
return old.call(this, options);
214207
};
215208

packages/docs/site/project.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,8 @@
1313
"executor": "nx:run-commands",
1414
"options": {
1515
"commands": [
16-
"cd ../../../; npx typedoc --plugin typedoc-plugin-mdn-links --plugin typedoc-plugin-resolve-crossmodule-references --json packages/docs/site/src/model.json",
16+
"sed -i 's/namedDeclarations\\[i\\]\\./namedDeclarations[i]?./g' ../../../node_modules/typedoc/dist/lib/converter/types.js ",
17+
"cd ../../../; npx typedoc --json packages/docs/site/src/model.json",
1718
"docusaurus build --out-dir ../../../dist/docs/build"
1819
],
1920
"parallel": false,

packages/php-wasm/node/project.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@
3535
"npx dts-bundle-generator -o packages/php-wasm/node/src/rollup.d.ts -- packages/php-wasm/node/src/index.ts",
3636
"rimraf dist/packages/php-wasm/node/lib/*.d.ts",
3737
"rimraf dist/packages/php-wasm/node/*.d.ts",
38-
"mv packages/php-wasm/node/src/rollup.d.ts dist/packages/php-wasm/node/index.d.ts"
38+
"cp packages/php-wasm/node/src/rollup.d.ts dist/packages/php-wasm/node/index.d.ts"
3939
],
4040
"parallel": false
4141
},

packages/php-wasm/web/project.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@
4141
"npx dts-bundle-generator -o packages/php-wasm/web/src/rollup.d.ts -- packages/php-wasm/web/src/index.ts",
4242
"rimraf dist/packages/php-wasm/web/lib/*.d.ts",
4343
"rimraf dist/packages/php-wasm/web/*.d.ts",
44-
"mv packages/php-wasm/web/src/rollup.d.ts dist/packages/php-wasm/web/index.d.ts"
44+
"cp packages/php-wasm/web/src/rollup.d.ts dist/packages/php-wasm/web/index.d.ts"
4545
],
4646
"parallel": false
4747
},

packages/playground/blueprints/project.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@
3030
"npx dts-bundle-generator -o packages/playground/blueprints/src/rollup.d.ts -- packages/playground/blueprints/src/index.ts",
3131
"rimraf dist/packages/playground/blueprints/lib/*.d.ts",
3232
"rimraf dist/packages/playground/blueprints/*.d.ts",
33-
"mv packages/playground/blueprints/src/rollup.d.ts dist/packages/playground/blueprints/index.d.ts"
33+
"cp packages/playground/blueprints/src/rollup.d.ts dist/packages/playground/blueprints/index.d.ts"
3434
],
3535
"parallel": false
3636
},

packages/playground/client/project.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
"npx dts-bundle-generator -o packages/playground/client/src/rollup.d.ts -- packages/playground/client/src/index.ts",
1616
"rimraf dist/packages/playground/client/lib/*.d.ts",
1717
"rimraf dist/packages/playground/client/*.d.ts",
18-
"mv packages/playground/client/src/rollup.d.ts dist/packages/playground/client/index.d.ts"
18+
"cp packages/playground/client/src/rollup.d.ts dist/packages/playground/client/index.d.ts"
1919
],
2020
"parallel": false
2121
},

tsconfig.base.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
"jsx": "react",
1414
"target": "ES2021",
1515
"module": "esnext",
16-
"lib": ["ES2022", "dom"],
16+
"lib": ["ES2022", "esnext.disposable", "dom"],
1717
"skipLibCheck": true,
1818
"skipDefaultLibCheck": true,
1919
"baseUrl": ".",

0 commit comments

Comments
 (0)