Merge branch 'master' into fix/esm-coverage

This commit is contained in:
Cooldude2606 authored and GitHub committed 2026-09-13 01:08:43 +01:00
commit 820bafa11f
13 files changed
+154 -99

No files matched your search

+53
View File
@@ -0,0 +1,53 @@
name: Install dependencies
description: Set up pnpm and Node.js, restore caches and run pnpm install
inputs:
node-version:
description: Node.js version passed to actions/setup-node
required: true
ignore-scripts:
description: Skip the prepare scripts that build the workspace packages
default: "false"
runs:
using: composite
steps:
- uses: pnpm/action-setup@v6
- uses: actions/setup-node@v7
with:
node-version: ${{ inputs.node-version }}
# The lockfile is not committed, so the usual lockfile hash key does not
# apply. Instead a new store snapshot is saved whenever a package.json
# changes or a week passes, and every run restores the most recent one.
- id: store
shell: bash
run: |
echo "path=$(pnpm store path --silent)" >> "$GITHUB_OUTPUT"
echo "week=$(date -u +%G-%V)" >> "$GITHUB_OUTPUT"
- uses: actions/cache@v6
with:
path: ${{ steps.store.outputs.path }}
key: pnpm-store-${{ runner.os }}-${{ steps.store.outputs.week }}-${{ hashFiles('**/package.json', 'pnpm-workspace.yaml') }}
restore-keys: pnpm-store-${{ runner.os }}-
# The prepare scripts run tsc --build and webpack, both incremental when
# their previous output is present. Every run saves its output and the
# next run starts from the most recent one.
- if: inputs.ignore-scripts != 'true'
uses: actions/cache@v6
with:
path: |
packages/*/dist
plugins/*/dist
packages/*/node_modules/.cache
plugins/*/node_modules/.cache
key: build-${{ runner.os }}-${{ github.sha }}
restore-keys: build-${{ runner.os }}-
- shell: bash
run: pnpm i --no-frozen-lockfile ${{ inputs.ignore-scripts == 'true' && '--ignore-scripts' || '' }}
# Drop packages the restored store had but this install did not use, so
# the snapshot does not grow with every version bump.
- shell: bash
run: pnpm store prune
+8 -15
View File
@@ -31,13 +31,10 @@ jobs:
steps: steps:
- uses: actions/checkout@v7 - uses: actions/checkout@v7
- uses: pnpm/action-setup@v6 - name: Prepare and install
- name: Use Node.js ${{ matrix.node-version }} uses: ./.github/actions/pnpm-install
uses: actions/setup-node@v7
with: with:
node-version: ${{ matrix.node-version }} node-version: ${{ matrix.node-version }}
- name: Prepare and install
run: pnpm i --no-frozen-lockfile
- name: Use Factorio ${{ matrix.factorio-version }} - name: Use Factorio ${{ matrix.factorio-version }}
run: wget -q -O factorio.tar.gz https://www.factorio.com/get-download/${{ matrix.factorio-version }}/headless/linux64 && tar -xf factorio.tar.gz && rm factorio.tar.gz run: wget -q -O factorio.tar.gz https://www.factorio.com/get-download/${{ matrix.factorio-version }}/headless/linux64 && tar -xf factorio.tar.gz && rm factorio.tar.gz
- name: Run tests - name: Run tests
@@ -78,12 +75,10 @@ jobs:
steps: steps:
- uses: actions/checkout@v7 - uses: actions/checkout@v7
- uses: pnpm/action-setup@v6 - name: Prepare and install
- uses: actions/setup-node@v7 uses: ./.github/actions/pnpm-install
with: with:
node-version: ${{ env.NODE_VERSION }} node-version: ${{ env.NODE_VERSION }}
- name: Prepare and install
run: pnpm i --no-frozen-lockfile
- name: Build - name: Build
run: pnpm run build run: pnpm run build
- name: Test ${{ matrix.controller }} controller with ${{ matrix.host }} host - name: Test ${{ matrix.controller }} controller with ${{ matrix.host }} host
@@ -98,11 +93,10 @@ jobs:
timeout-minutes: 5 timeout-minutes: 5
steps: steps:
- uses: actions/checkout@v7 - uses: actions/checkout@v7
- uses: pnpm/action-setup@v6 - uses: ./.github/actions/pnpm-install
- uses: actions/setup-node@v7
with: with:
node-version: ${{ env.NODE_VERSION }} node-version: ${{ env.NODE_VERSION }}
- run: pnpm i --no-frozen-lockfile ignore-scripts: true
- run: pnpm run lint - run: pnpm run lint
build: build:
@@ -110,11 +104,10 @@ jobs:
timeout-minutes: 5 timeout-minutes: 5
steps: steps:
- uses: actions/checkout@v7 - uses: actions/checkout@v7
- uses: pnpm/action-setup@v6 - uses: ./.github/actions/pnpm-install
- uses: actions/setup-node@v7
with: with:
node-version: ${{ env.NODE_VERSION }} node-version: ${{ env.NODE_VERSION }}
- run: pnpm i --no-frozen-lockfile ignore-scripts: true
- run: pnpm run build-mod - run: pnpm run build-mod
# Upload build to artifacts # Upload build to artifacts
- name: Upload build to artifacts - name: Upload build to artifacts
+1
View File
@@ -148,6 +148,7 @@ export default defineConfig([{
"new-cap": ["error", { "new-cap": ["error", {
"capIsNewExceptions": ["StringEnum", "StringKey"], "capIsNewExceptions": ["StringEnum", "StringKey"],
"capIsNewExceptionPattern": "^Type\\.", "capIsNewExceptionPattern": "^Type\\.",
"newIsCapExceptions": ["constructor"],
}], }],
"new-parens": "error", "new-parens": "error",
+16 -16
View File
@@ -43,24 +43,24 @@
"@clusterio/host": "workspace:^", "@clusterio/host": "workspace:^",
"@clusterio/lib": "workspace:^", "@clusterio/lib": "workspace:^",
"@clusterio/web_ui": "workspace:^", "@clusterio/web_ui": "workspace:^",
"@eslint/eslintrc": "^3.3.1", "@eslint/eslintrc": "^3.3.7",
"@eslint/js": "^9.32.0", "@eslint/js": "^10.0.1",
"@stylistic/eslint-plugin": "^5.2.2", "@stylistic/eslint-plugin": "^5.10.0",
"@swc/core": "^1.13.3", "@swc/core": "catalog:",
"@types/node": "catalog:", "@types/node": "catalog:",
"@typescript-eslint/eslint-plugin": "^8.38.0",
"@typescript-eslint/parser": "^8.38.0",
"c8": "^12.0.0", "c8": "^12.0.0",
"eslint": "^9.32.0", "@typescript-eslint/eslint-plugin": "^8.70.0",
"@typescript-eslint/parser": "^8.70.0",
"eslint": "^10.10.0",
"eslint-plugin-node": "^11.1.0", "eslint-plugin-node": "^11.1.0",
"express": "^5.1.0", "express": "catalog:",
"form-data": "^4.0.4", "form-data": "^4.0.6",
"globals": "^16.3.0", "globals": "^17.12.0",
"jsonwebtoken": "^9.0.2", "jsonwebtoken": "catalog:",
"jszip": "^3.10.1", "jszip": "catalog:",
"mocha": "^11.7.1", "mocha": "^11.8.0",
"typedoc": "^0.28.9", "typedoc": "^0.28.20",
"typescript": "^5.9.2", "typescript": "catalog:",
"yargs": "^18.0.0" "yargs": "catalog:"
} }
} }
+9 -9
View File
@@ -39,36 +39,36 @@
"@clusterio/lib": "workspace:^", "@clusterio/lib": "workspace:^",
"@sinclair/typebox": "catalog:", "@sinclair/typebox": "catalog:",
"busboy": "^1.6.0", "busboy": "^1.6.0",
"compression": "^1.8.0", "compression": "^1.8.2",
"express": "catalog:", "express": "catalog:",
"finalhandler": "^1.3.1", "finalhandler": "^2.1.1",
"jsonwebtoken": "catalog:", "jsonwebtoken": "catalog:",
"jszip": "catalog:", "jszip": "catalog:",
"semver": "^7.7.1", "semver": "catalog:",
"winston": "catalog:", "winston": "catalog:",
"winston-daily-rotate-file": "catalog:", "winston-daily-rotate-file": "catalog:",
"ws": "catalog:", "ws": "catalog:",
"yargs": "^17.7.2" "yargs": "catalog:"
}, },
"devDependencies": { "devDependencies": {
"@clusterio/web_ui": "workspace:^", "@clusterio/web_ui": "workspace:^",
"@swc/core": "catalog:", "@swc/core": "catalog:",
"@types/busboy": "^1.5.0", "@types/busboy": "^1.5.4",
"@types/compression": "^1.7.2", "@types/compression": "^1.8.1",
"@types/express": "catalog:", "@types/express": "catalog:",
"@types/finalhandler": "catalog:", "@types/finalhandler": "catalog:",
"@types/jsonwebtoken": "catalog:", "@types/jsonwebtoken": "catalog:",
"@types/node": "catalog:", "@types/node": "catalog:",
"@types/semver": "^7.5.0", "@types/semver": "catalog:",
"@types/ws": "catalog:", "@types/ws": "catalog:",
"@types/yargs": "^17.0.33", "@types/yargs": "catalog:",
"react": "catalog:", "react": "catalog:",
"react-dom": "catalog:", "react-dom": "catalog:",
"react-router-dom": "catalog:", "react-router-dom": "catalog:",
"typescript": "catalog:", "typescript": "catalog:",
"webpack": "catalog:", "webpack": "catalog:",
"webpack-cli": "catalog:", "webpack-cli": "catalog:",
"webpack-dev-middleware": "^6.1.1", "webpack-dev-middleware": "^6.1.3",
"webpack-merge": "catalog:" "webpack-merge": "catalog:"
} }
} }
+8 -4
View File
@@ -349,7 +349,7 @@ export async function createProxyStream(app: Application): Promise<ProxyStream>
return stream; return stream;
} }
async function putStream(req: Request, res: Response) { async function putStream(req: Request<{ id: string }>, res: Response) {
const stream = req.app.locals.streams.get(req.params.id); const stream = req.app.locals.streams.get(req.params.id);
if (!stream || stream.source) { if (!stream || stream.source) {
res.sendStatus(404); res.sendStatus(404);
@@ -388,7 +388,7 @@ function startStream(res: Response, stream: ProxyStream) {
clearTimeout(stream.timeout); clearTimeout(stream.timeout);
} }
async function getStream(req: Request, res: Response) { async function getStream(req: Request<{ id: string }>, res: Response) {
const stream = req.app.locals.streams.get(req.params.id); const stream = req.app.locals.streams.get(req.params.id);
if (!stream || stream.flowing) { if (!stream || stream.flowing) {
res.sendStatus(404); res.sendStatus(404);
@@ -695,8 +695,12 @@ export function addRouteHandlers(app: Application) {
validateHostToken, validateHostToken,
(req:Request, res:Response, next:any) => uploadExport(req, res).catch(next) (req:Request, res:Response, next:any) => uploadExport(req, res).catch(next)
); );
app.put("/api/stream/:id", (req:Request, res:Response, next:any) => putStream(req, res).catch(next)); app.put("/api/stream/:id",
app.get("/api/stream/:id", (req:Request, res:Response, next:any) => getStream(req, res).catch(next)); (req:Request<{ id: string }>, res:Response, next:any) => putStream(req, res).catch(next)
);
app.get("/api/stream/:id",
(req:Request<{ id: string }>, res:Response, next:any) => getStream(req, res).catch(next)
);
app.post("/api/upload-save", app.post("/api/upload-save",
validateUserToken, validateUserToken,
(req:Request, res:Response, next:any) => uploadSave(req, res).catch(next) (req:Request, res:Response, next:any) => uploadSave(req, res).catch(next)
+1 -1
View File
@@ -34,6 +34,6 @@
"dependencies": { "dependencies": {
"chalk": "catalog:", "chalk": "catalog:",
"inquirer": "^8.2.4", "inquirer": "^8.2.4",
"yargs": "^17.7.2" "yargs": "catalog:"
} }
} }
@@ -55,21 +55,21 @@
"devDependencies": { "devDependencies": {
//%// Typescript and type declarations //%// Typescript and type declarations
//%if typescript //%if typescript
"typescript": "^5.5.3", "typescript": "^5.9.3",
"@types/node": "^20.4.5", "@types/node": "^24.13.4",
//%endif //%endif
//%if typescript & web //%if typescript & web
"@types/react": "^18.2.21", "@types/react": "^18.3.31",
//%endif //%endif
//%// Everything else //%// Everything else
//%if web //%if web
"antd": "^5.13.0", "antd": "^5.29.3",
"react": "^18.2.0", "react": "^18.2.0",
"react-dom": "^18.2.0", "react-dom": "^18.2.0",
//%endif //%endif
//%if webpack //%if webpack
"webpack": "^5.88.2", "webpack": "^5.110.3",
"webpack-cli": "^5.1.4", "webpack-cli": "^7.2.3",
"webpack-merge": "^5.9.0", "webpack-merge": "^5.9.0",
//%endif //%endif
//%if controller //%if controller
@@ -87,7 +87,7 @@
"@clusterio/lib": "^__clusterio_version__" "@clusterio/lib": "^__clusterio_version__"
}, },
"dependencies": { "dependencies": {
"@sinclair/typebox": "^0.30.4" "@sinclair/typebox": "^0.30.6"
}, },
"publishConfig": { "publishConfig": {
"access": "public" "access": "public"
+2 -2
View File
@@ -39,11 +39,11 @@
"@clusterio/lib": "workspace:^", "@clusterio/lib": "workspace:^",
"as-table": "^1.0.55", "as-table": "^1.0.55",
"winston": "catalog:", "winston": "catalog:",
"yargs": "^17.7.2" "yargs": "catalog:"
}, },
"devDependencies": { "devDependencies": {
"@types/node": "catalog:", "@types/node": "catalog:",
"@types/yargs": "^17.0.33", "@types/yargs": "catalog:",
"typescript": "catalog:" "typescript": "catalog:"
} }
} }
+7 -7
View File
@@ -39,22 +39,22 @@
"dependencies": { "dependencies": {
"@clusterio/lib": "workspace:^", "@clusterio/lib": "workspace:^",
"@sinclair/typebox": "catalog:", "@sinclair/typebox": "catalog:",
"jimp": "^1.6.0", "jimp": "^1.6.1",
"jszip": "catalog:", "jszip": "catalog:",
"pidusage": "^3.0.2", "pidusage": "^4.0.1",
"rcon-client": "^4.2.5", "rcon-client": "^4.2.5",
"semver": "^7.7.1", "semver": "catalog:",
"set-blocking": "catalog:", "set-blocking": "catalog:",
"winston": "catalog:", "winston": "catalog:",
"winston-daily-rotate-file": "catalog:", "winston-daily-rotate-file": "catalog:",
"yargs": "^17.7.2" "yargs": "catalog:"
}, },
"devDependencies": { "devDependencies": {
"@types/node": "catalog:", "@types/node": "catalog:",
"@types/pidusage": "^2.0.2", "@types/pidusage": "^2.0.5",
"@types/semver": "^7.5.0", "@types/semver": "catalog:",
"@types/set-blocking": "catalog:", "@types/set-blocking": "catalog:",
"@types/yargs": "^17.0.33", "@types/yargs": "catalog:",
"typescript": "catalog:" "typescript": "catalog:"
} }
} }
+4 -4
View File
@@ -45,7 +45,7 @@
"dependencies": { "dependencies": {
"@sinclair/typebox": "catalog:", "@sinclair/typebox": "catalog:",
"ajv": "^8.17.1", "ajv": "^8.20.0",
"chalk": "catalog:", "chalk": "catalog:",
"fast-deep-equal": "^3.1.3", "fast-deep-equal": "^3.1.3",
"jszip": "catalog:", "jszip": "catalog:",
@@ -54,14 +54,14 @@
"winston": "catalog:", "winston": "catalog:",
"winston-transport": "catalog:", "winston-transport": "catalog:",
"ws": "catalog:", "ws": "catalog:",
"yargs": "^17.7.2" "yargs": "catalog:"
}, },
"devDependencies": { "devDependencies": {
"@types/node": "catalog:", "@types/node": "catalog:",
"@types/set-blocking": "catalog:", "@types/set-blocking": "catalog:",
"@types/triple-beam": "^1.3.2", "@types/triple-beam": "^1.3.5",
"@types/ws": "catalog:", "@types/ws": "catalog:",
"@types/yargs": "^17.0.33", "@types/yargs": "catalog:",
"typescript": "catalog:" "typescript": "catalog:"
} }
} }
+16 -16
View File
@@ -35,38 +35,38 @@
"dependencies": { "dependencies": {
"@ant-design/icons": "^5.6.1", "@ant-design/icons": "^5.6.1",
"@clusterio/lib": "workspace:^", "@clusterio/lib": "workspace:^",
"@sinclair/typebox": "^0.30.4", "@sinclair/typebox": "catalog:",
"@swc/core": "^1.13.3", "@swc/core": "catalog:",
"antd": "^5.24.2", "antd": "catalog:",
"assert": "^2.0.0", "assert": "^2.1.0",
"browserify-zlib": "^0.2.0", "browserify-zlib": "^0.2.0",
"buffer": "^6.0.3", "buffer": "^6.0.3",
"clean-webpack-plugin": "^4.0.0", "clean-webpack-plugin": "^4.0.0",
"css-loader": "^6.8.1", "css-loader": "^7.1.5",
"events": "^3.3.0", "events": "^3.3.0",
"file-loader": "^6.2.0", "file-loader": "^6.2.0",
"null-loader": "^4.0.1", "null-loader": "^4.0.1",
"os-browserify": "^0.3.0", "os-browserify": "^0.3.0",
"path-browserify": "^1.0.1", "path-browserify": "^1.0.1",
"process": "^0.11.10", "process": "^0.11.10",
"rc-field-form": "^1.37.0", "rc-field-form": "^1.44.0",
"react": "^18.2.0", "react": "catalog:",
"react-dom": "^18.2.0", "react-dom": "catalog:",
"react-markdown": "catalog:", "react-markdown": "catalog:",
"react-router-dom": "^6.29.0", "react-router-dom": "catalog:",
"stream-browserify": "^3.0.0", "stream-browserify": "^3.0.0",
"style-loader": "^3.3.3", "style-loader": "^4.0.0",
"swc-loader": "^0.2.6", "swc-loader": "^0.2.7",
"terser-webpack-plugin": "^5.3.11", "terser-webpack-plugin": "^5.6.1",
"typescript": "^5.7.3", "typescript": "catalog:",
"util": "^0.12.5", "util": "^0.12.5",
"webpack": "catalog:", "webpack": "catalog:",
"webpack-cli": "catalog:", "webpack-cli": "catalog:",
"webpack-manifest-plugin": "^5.0.0" "webpack-manifest-plugin": "^5.0.0"
}, },
"devDependencies": { "devDependencies": {
"@types/node": "^20.17.19", "@types/node": "catalog:",
"@types/react": "^18.3.18", "@types/react": "catalog:",
"@types/react-dom": "^18.3.5" "@types/react-dom": "^18.3.7"
} }
} }
+22 -18
View File
@@ -6,33 +6,37 @@ packages:
- test/ - test/
catalog: catalog:
'@sinclair/typebox': ^0.30.4 '@sinclair/typebox': ^0.30.6
'@swc/core': ^1.13.3 '@swc/core': ^1.16.2
'@types/express': ^4.17.17 '@types/express': ^5.0.6
'@types/finalhandler': ^1.2.0 '@types/finalhandler': ^1.2.4
'@types/jsonwebtoken': ^9.0.9 '@types/jsonwebtoken': ^9.0.10
'@types/node': ^22.20.1 '@types/node': ^24.13.4
'@types/react': ^18.3.18 '@types/react': ^18.3.31
'@types/set-blocking': ^2.0.0 '@types/semver': ^7.8.0
'@types/ws': ^8.5.14 '@types/set-blocking': ^2.0.2
antd: ^5.24.2 '@types/ws': ^8.18.1
chalk: ^4.1.2 '@types/yargs': ^17.0.35
express: ^5.1.0 antd: ^5.29.3
jsonwebtoken: ^9.0.2 chalk: ^6.0.0
jszip: ^3.10.1 express: ^5.2.1
jsonwebtoken: ^9.0.3
jszip: ^3.10.2
react: ^18.2.0 react: ^18.2.0
react-dom: ^18.2.0 react-dom: ^18.2.0
react-markdown: ^10.1.0 react-markdown: ^10.1.0
react-router-dom: ^6.29.0 react-router-dom: ^6.30.6
semver: ^7.8.5
set-blocking: ^2.0.0 set-blocking: ^2.0.0
typescript: ^5.7.3 typescript: ^5.9.3
webpack: ^5.110.3 webpack: ^5.110.3
webpack-cli: ^7.2.3 webpack-cli: ^7.2.3
webpack-merge: 5.9.0 webpack-merge: 5.9.0
winston: ^3.17.0 winston: ^3.19.0
winston-daily-rotate-file: ^4.7.1 winston-daily-rotate-file: ^4.7.1
winston-transport: ^4.9.0 winston-transport: ^4.9.0
ws: ^8.18.1 ws: ^8.21.3
yargs: ^18.1.0
catalogMode: strict catalogMode: strict