From c724f144e77deb456d83a8f29aa93828b48662ef Mon Sep 17 00:00:00 2001 From: bbassie <17990055+bbassie@users.noreply.github.com> Date: Thu, 29 Oct 2026 00:16:59 +0000 Subject: [PATCH 1/4] Drop TypeDoc The generated API docs were never published or built in CI, and typedoc's peer range stops at TypeScript 6.0. TSDoc comments stay. Co-Authored-By: Claude Opus 5.5 --- .gitignore | 3 --- docs/contributing.md | 1 - docs/decisions.md | 5 +++++ package.json | 2 -- typedoc.json | 13 ------------- 5 files changed, 5 insertions(+), 19 deletions(-) delete mode 100644 typedoc.json diff --git a/.gitignore b/.gitignore index 5f99e160..682add85 100644 --- a/.gitignore +++ b/.gitignore @@ -23,9 +23,6 @@ coverage build/Release dist/ -# Autogenerated docs output -/docs/api - node_modules /factorio* diff --git a/docs/contributing.md b/docs/contributing.md index f099db99..3e8462f1 100644 --- a/docs/contributing.md +++ b/docs/contributing.md @@ -135,7 +135,6 @@ Keep in mind if you're working on external plugins the `--dev-plugin` option is | `pnpm watch` | TypeScript compilation as files change; restart affected Node processes afterward. | | `pnpm -r run prepare` | Compiled packages, generated validators, and production web bundles. | | `pnpm build-mod` | Factorio mod archives in root `dist/`. | -| `pnpm docs` | Generated API documentation. | `pnpm build` alone does not regenerate the standalone validator or web bundles. After changing `packages/lib/src/data/messages_core.ts`, run `pnpm -r run prepare` to compile the schema and regenerate its validator. diff --git a/docs/decisions.md b/docs/decisions.md index 8e06617a..5aaadf2e 100644 --- a/docs/decisions.md +++ b/docs/decisions.md @@ -91,6 +91,11 @@ Therefore, we decided to use TSDoc comments for this purpose as it is well inter Our specific implementation is TypeDoc because it is lightweight it and can output TSDoc comments as html. API Extractor was also considered but not selected. +🧾 29th October 2026 | [Github PR #1147](https://github.com/clusterio/clusterio/pull/1147) + +We dropped TypeDoc as the generated docs were never published and it does not support TypeScript 7. +TSDoc comments are still used for editor hover text. + ## Code Style (General) diff --git a/package.json b/package.json index 845eaa79..b8c32482 100644 --- a/package.json +++ b/package.json @@ -18,7 +18,6 @@ "lint": "oxlint packages plugins test", "lint-fix": "oxlint --fix packages plugins test", "clean": "node ./clean.js", - "docs": "typedoc", "bundle-dependencies": "bundle-dependencies" }, "c8": { @@ -51,7 +50,6 @@ "jsonwebtoken": "catalog:", "mocha": "^11.8.0", "oxlint": "^1.88.0", - "typedoc": "^0.28.20", "typescript": "catalog:", "yargs": "catalog:", "yauzl": "catalog:", diff --git a/typedoc.json b/typedoc.json deleted file mode 100644 index 1523eca2..00000000 --- a/typedoc.json +++ /dev/null @@ -1,13 +0,0 @@ -{ - "$schema": "https://typedoc.org/schema.json", - "entryPoints": [ - "packages/lib/", - "packages/controller/", - "packages/host/", - "packages/ctl/", - "packages/web_ui/", - ], - "entryPointStrategy": "packages", - "cleanOutputDir": false, - "out": "docs/api" -} From 885de50625f20010026e2036265b4f9b978d5f78 Mon Sep 17 00:00:00 2001 From: bbassie <17990055+bbassie@users.noreply.github.com> Date: Thu, 29 Oct 2026 00:20:23 +0000 Subject: [PATCH 2/4] Build with TypeScript 7 TypeScript 7 is the native port of the compiler. The repository builds with it unchanged: no new type errors, the emitted JavaScript differs only in the order of react/jsx-runtime imports, and the declarations only in union and property order, which TypeScript 5.9 consumers read the same way. The plugin template moves to it too. Co-Authored-By: Claude Opus 5.5 --- packages/create/templates/common/package.json | 2 +- pnpm-workspace.yaml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/create/templates/common/package.json b/packages/create/templates/common/package.json index 75de43fb..b5a690d7 100644 --- a/packages/create/templates/common/package.json +++ b/packages/create/templates/common/package.json @@ -55,7 +55,7 @@ "devDependencies": { //%// Typescript and type declarations //%if typescript - "typescript": "^5.9.3", + "typescript": "^7.0.2", "@types/node": "^24.13.4", //%endif //%if typescript & web diff --git a/pnpm-workspace.yaml b/pnpm-workspace.yaml index de679916..ddd59f18 100644 --- a/pnpm-workspace.yaml +++ b/pnpm-workspace.yaml @@ -31,7 +31,7 @@ catalog: react-router-dom: ^7.18.4 semver: ^7.8.5 set-blocking: ^2.0.0 - typescript: ^5.9.3 + typescript: ^7.0.2 vite: ^8.3.4 winston: ^3.19.0 winston-daily-rotate-file: ^5.0.0 From 7d421847f58f70b54a899fcb71dfb7a7e976876c Mon Sep 17 00:00:00 2001 From: bbassie <17990055+bbassie@users.noreply.github.com> Date: Thu, 29 Oct 2026 00:45:25 +0000 Subject: [PATCH 3/4] Drop the self-referencing constructor type on ModPortalGetAllResponse TypeScript 7.1 reports TS5088 for it: the inferred type of the static Response property references itself through the declared constructor. The other inline Response classes do not declare it either. Co-Authored-By: Claude Opus 5.5 --- packages/lib/src/data/messages_mod.ts | 1 - 1 file changed, 1 deletion(-) diff --git a/packages/lib/src/data/messages_mod.ts b/packages/lib/src/data/messages_mod.ts index 5d26fc78..f0fb57c3 100644 --- a/packages/lib/src/data/messages_mod.ts +++ b/packages/lib/src/data/messages_mod.ts @@ -251,7 +251,6 @@ export class ModPortalGetAllRequest { // Define the Response class inline static Response = class ModPortalGetAllResponse { - declare ["constructor"]: typeof ModPortalGetAllResponse; constructor( public mods: Static[], ) { } From 30794267127350dcb447c1602037320ccd9117a8 Mon Sep 17 00:00:00 2001 From: bbassie <17990055+bbassie@users.noreply.github.com> Date: Thu, 29 Oct 2026 01:03:46 +0000 Subject: [PATCH 4/4] List node in the types of the node tsconfigs Since TypeScript 6 the types option defaults to an empty list, so @types/node was only loaded because winston and undici-types reference it. Name it explicitly. The emitted files do not change. Co-Authored-By: Claude Opus 5.5 --- packages/create/templates/plugin-ts/tsconfig.node.json | 1 + tsconfig.node.json | 1 + 2 files changed, 2 insertions(+) diff --git a/packages/create/templates/plugin-ts/tsconfig.node.json b/packages/create/templates/plugin-ts/tsconfig.node.json index 53333178..78554d9f 100644 --- a/packages/create/templates/plugin-ts/tsconfig.node.json +++ b/packages/create/templates/plugin-ts/tsconfig.node.json @@ -2,6 +2,7 @@ "extends": "./tsconfig.base.json", "compilerOptions": { "lib": ["es2023"], + "types": ["node"], "module": "node16", "moduleResolution": "node16", "target": "es2022", diff --git a/tsconfig.node.json b/tsconfig.node.json index da0a3006..d0941899 100644 --- a/tsconfig.node.json +++ b/tsconfig.node.json @@ -2,6 +2,7 @@ "extends": "./tsconfig.base.json", "compilerOptions": { "lib": ["es2023"], + "types": ["node"], "module": "nodenext", "moduleResolution": "node16", "target": "es2022",