Skip to content

feat: update libs#276

Merged
Julusian merged 10 commits intomainfrom
feat/update-libs
Apr 1, 2026
Merged

feat: update libs#276
Julusian merged 10 commits intomainfrom
feat/update-libs

Conversation

@Julusian
Copy link
Copy Markdown
Member

@Julusian Julusian commented Mar 17, 2026

About Me

Type of Contribution

This is a: Code improvement

Current Behavior

New Behavior

This updates a lot of the tooling and dependencies to be up to date. There are still some more bits that would be nice to look at, but I am unlikely to in this round.

A quick test with a demo rundown appears to be able to scan and generate previews as normal

Testing Instructions

Other Information

Status

  • PR is ready to be reviewed.
  • The functionality has been tested by the author.
  • Relevant unit tests has been added / updated.
  • Relevant documentation (code comments, system documentation) has been added / updated.

@coderabbitai
Copy link
Copy Markdown

coderabbitai bot commented Mar 17, 2026

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: e95d6a6e-e14c-4c12-9559-7394c0aee3e0

📥 Commits

Reviewing files that changed from the base of the PR and between 025f340 and 793f103.

⛔ Files ignored due to path filters (2)
  • .yarn/releases/yarn-4.1.1.cjs is excluded by !**/.yarn/**
  • yarn.lock is excluded by !**/yarn.lock, !**/*.lock
📒 Files selected for processing (39)
  • .github/workflows/build-windows.yaml
  • .github/workflows/lint-and-test.yaml
  • .github/workflows/publish-prerelease.yaml
  • .yarnrc.yml
  • apps/_boilerplate/app/package.json
  • apps/_boilerplate/packages/generic/package.json
  • apps/appcontainer-node/app/package.json
  • apps/appcontainer-node/packages/generic/package.json
  • apps/html-renderer/app/package.json
  • apps/html-renderer/packages/generic/package.json
  • apps/http-server/app/package.json
  • apps/http-server/packages/generic/package.json
  • apps/http-server/packages/generic/src/lib.ts
  • apps/http-server/packages/generic/src/server.ts
  • apps/package-manager/app/package.json
  • apps/package-manager/packages/generic/package.json
  • apps/quantel-http-transformer-proxy/app/package.json
  • apps/quantel-http-transformer-proxy/packages/generic/package.json
  • apps/quantel-http-transformer-proxy/packages/generic/src/server.ts
  • apps/single-app/app/package.json
  • apps/worker/app/package.json
  • apps/worker/packages/generic/package.json
  • apps/workforce/app/package.json
  • apps/workforce/packages/generic/package.json
  • jest.config.base.js
  • lerna.json
  • package.json
  • shared/packages/api/package.json
  • shared/packages/api/src/websocketServer.ts
  • shared/packages/expectationManager/package.json
  • shared/packages/worker/package.json
  • shared/packages/worker/src/worker/accessorHandlers/__tests__/fileShare.spec.ts
  • shared/packages/worker/src/worker/accessorHandlers/__tests__/localFolder.spec.ts
  • shared/packages/worker/src/worker/accessorHandlers/lib/FTPClient/FTPClient.ts
  • shared/packages/worker/src/worker/accessorHandlers/lib/fetch.ts
  • shared/packages/workforce/package.json
  • tests/internal-tests/package.json
  • tsconfig.build.json
  • tsconfig.jest.json
💤 Files with no reviewable changes (5)
  • shared/packages/worker/src/worker/accessorHandlers/lib/fetch.ts
  • .github/workflows/publish-prerelease.yaml
  • .github/workflows/build-windows.yaml
  • .github/workflows/lint-and-test.yaml
  • .yarnrc.yml
✅ Files skipped from review due to trivial changes (20)
  • apps/worker/packages/generic/package.json
  • apps/appcontainer-node/app/package.json
  • apps/worker/app/package.json
  • apps/quantel-http-transformer-proxy/app/package.json
  • shared/packages/workforce/package.json
  • shared/packages/worker/src/worker/accessorHandlers/lib/FTPClient/FTPClient.ts
  • apps/package-manager/app/package.json
  • apps/html-renderer/packages/generic/package.json
  • tsconfig.jest.json
  • apps/_boilerplate/app/package.json
  • apps/package-manager/packages/generic/package.json
  • tsconfig.build.json
  • shared/packages/worker/src/worker/accessorHandlers/tests/fileShare.spec.ts
  • shared/packages/expectationManager/package.json
  • tests/internal-tests/package.json
  • apps/appcontainer-node/packages/generic/package.json
  • apps/_boilerplate/packages/generic/package.json
  • apps/html-renderer/app/package.json
  • apps/workforce/packages/generic/package.json
  • shared/packages/api/package.json
🚧 Files skipped from review as they are similar to previous changes (11)
  • apps/workforce/app/package.json
  • shared/packages/worker/src/worker/accessorHandlers/tests/localFolder.spec.ts
  • shared/packages/api/src/websocketServer.ts
  • apps/http-server/packages/generic/src/server.ts
  • apps/http-server/app/package.json
  • lerna.json
  • apps/quantel-http-transformer-proxy/packages/generic/src/server.ts
  • apps/single-app/app/package.json
  • shared/packages/worker/package.json
  • apps/http-server/packages/generic/package.json
  • jest.config.base.js

Walkthrough

Monorepo-wide dependency and tooling upgrades, removal of Yarn-specific CI/cache settings, TypeScript target/module changes, and targeted migration from Koa v2/koa-router to Koa v3/@koa/router with corresponding route patterns and type updates.

Changes

Cohort / File(s) Summary
GitHub Actions Workflows
.github/workflows/build-windows.yaml, .github/workflows/lint-and-test.yaml, .github/workflows/publish-prerelease.yaml
Removed cache: 'yarn' from actions/setup-node@v6 steps; explicit actions/cache steps remain.
Yarn Config
.yarnrc.yml
Removed yarnPath entry that pinned a specific Yarn release.
Root manifests & tooling
package.json, jest.config.base.js, lerna.json
Bumped many devDeps (lerna→9, jest→30, ts-jest, typescript, rimraf, etc.); Jest: new ts-jest tsconfig, diagnostics ignore, JS transform, transformIgnorePatterns; lerna: added $schema, removed useWorkspaces, formatting changes.
TypeScript configs
tsconfig.build.json, tsconfig.jest.json
Updated compiler target/module (targetes2024, modulenode20, libes2023); added tsconfig.jest.json extending build config with allowJs.
Koa v3 & router migration
apps/http-server/.../package.json, apps/http-server/.../src/lib.ts, apps/http-server/.../src/server.ts, apps/quantel-http-transformer-proxy/.../package.json, apps/quantel-http-transformer-proxy/.../src/server.ts
Upgraded koa v2→v3 and replaced koa-router with @koa/router; adjusted route patterns to new {/*path} syntax and updated context types to RouterContext.
App dependency bumps
apps/*/app/package.json, apps/*/packages/generic/package.json (multiple apps)
Consistent dependency/devDependency updates across apps (e.g., lerna, rimraf, underscore, tslib, ws, plus app-specific bumps).
Shared packages & tests
shared/packages/*/package.json, shared/packages/api/src/websocketServer.ts, shared/packages/worker/.../__tests__/*.spec.ts, shared/packages/worker/.../FTPClient.ts, shared/packages/worker/.../fetch.ts
Updated runtime/dev deps (underscore, winston, ws, kairos-lib, jest, rimraf, @types/*); added null-check in WebsocketServer.port; test matcher tweaks (toThrow); added p-queue import; removed external abort-controller import.
Tests manifests
tests/internal-tests/package.json
Bumped jest and underscore versions.

Sequence Diagram(s)

mermaid
sequenceDiagram
participant Client as Client
participant Router as @koa/router
participant Server as KoaApp
participant Upstream as UpstreamTransformer
Client->>Router: HTTP request (e.g., /quantel/... or /package/...)
Router->>Server: matched route, params in ctx.params.path
Server->>Server: handler reads ctx.params.path, auth/intercept logic
alt proxy route
Server->>Upstream: forward request to transformer (this.transformerURL + ctx.path + query)
Upstream-->>Server: response
end
Server-->>Client: HTTP response

Estimated code review effort

🎯 4 (Complex) | ⏱️ ~45 minutes

🚥 Pre-merge checks | ✅ 1 | ❌ 2

❌ Failed checks (1 warning, 1 inconclusive)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
Title check ❓ Inconclusive The title 'feat: update libs' is vague and generic, using non-descriptive terms that don't convey meaningful information about the specific changes in the changeset. Consider using a more specific title that highlights the primary change, such as 'feat: upgrade dependencies and tooling (lerna, rimraf, koa, typescript)' or similar.
✅ Passed checks (1 passed)
Check name Status Explanation
Description check ✅ Passed The pull request description is related to the changeset, explaining that it updates tooling and dependencies. The author mentions testing was performed and provides context about scope limitations.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feat/update-libs

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@Julusian Julusian marked this pull request as ready for review March 17, 2026 13:25
Copy link
Copy Markdown

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 4

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (2)
shared/packages/worker/src/worker/accessorHandlers/lib/FTPClient/FTPClient.ts (2)

31-45: ⚠️ Potential issue | 🟠 Major

Add cd to the methodsToOverride list to serialize all FTP operations.

The queue wraps certain FTP methods for exclusive execution, but cd is missing from the list. This leaves direct this.client.cd('/') calls at lines 96, 199, 218, and 322 running outside the queue, allowing them to interleave with queued operations like ensureDir and remove. For example, ensureDir (queued) → cd (unqueued) → remove (queued) can race if another queued operation is waiting. This breaks the one-at-a-time guarantee.

Suggested fix
 		const methodsToOverride: (keyof FTP.Client)[] = [
 			'access',
+			'cd',
 			// 'close',
 			// 'closed',
 			'downloadTo',
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In
`@shared/packages/worker/src/worker/accessorHandlers/lib/FTPClient/FTPClient.ts`
around lines 31 - 45, The FTPClient currently lists methods to wrap in
methodsToOverride but omits 'cd', so direct calls to this.client.cd bypass the
queue; add 'cd' to the methodsToOverride array (alongside 'downloadTo',
'ensureDir', etc.) so the wrapper/serialization logic in the FTPClient class
will queue and serialize calls to this.client.cd (thereby ensuring calls like
this.client.cd('/') used elsewhere are routed through the same exclusive
execution mechanism).

52-54: ⚠️ Potential issue | 🔴 Critical

Unsafe JSON.stringify(args) breaks upload/download operations before execution.

The queue wrapper serializes args on line 53 for error context. Since uploadFrom and downloadTo methods receive stream objects (Readable, PassThrough) as arguments, JSON.stringify() throws on circular references and crashes the queued operation before orgMethod.apply() runs. This prevents legitimate file transfers from executing.

Suggested fix
-					const orgError = new Error(`Error executing ${method}: ${JSON.stringify(args)}`) // Used later
+					let serializedArgs = '[unserializable args]'
+					try {
+						serializedArgs = JSON.stringify(args)
+					} catch {
+						// keep fallback
+					}
+					const orgError = new Error(`Error executing ${String(method)}: ${serializedArgs}`) // Used later
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In
`@shared/packages/worker/src/worker/accessorHandlers/lib/FTPClient/FTPClient.ts`
around lines 52 - 54, The current queue wrapper creates orgError using
JSON.stringify(args), which throws when args contain stream objects (e.g., for
uploadFrom/downloadTo) and aborts the operation; replace that unsafe
serialization with a safe representation: detect stream-like objects (Readable,
PassThrough) or otherwise wrap JSON.stringify in a try/catch and fall back to a
placeholder (e.g., "<stream>" or "<unserializable>") per argument so that
creating orgError never throws; update the code around queue.add and the
orgError creation (referencing method, args, and orgMethod.apply) to use this
safe stringify logic before entering the try block.
🧹 Nitpick comments (3)
shared/packages/api/package.json (1)

20-20: Remove deprecated @types/winston stub.

Line 20 adds a legacy stub package while winston v3 already provides its own typings. Version mismatch between the @types/winston v2.4.4 stubs and winston v3.19.0 runtime can cause type conflicts.

♻️ Proposed cleanup
-        "@types/winston": "^2.4.4",
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@shared/packages/api/package.json` at line 20, Remove the legacy TypeScript
stub "@types/winston" from package.json to avoid conflicts with winston v3's
built-in typings; locate the entry "@types/winston": "^2.4.4" and delete it from
dependencies/devDependencies, then run the package manager to update the
lockfile (npm install / yarn install / pnpm install) so the change is reflected
in package-lock.json/yarn.lock and rebuild types to confirm no remaining type
errors.
jest.config.base.js (1)

1-1: Consider using node:path for explicit built-in module identification.

While require('path') is standard and always valid, the node: prefix makes it explicit that this is a built-in module. This is an optional stylistic convention in modern Node.js.

Optional cleanup
-const path = require('path')
+const path = require('node:path')
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@jest.config.base.js` at line 1, Update the built-in module import to use the
explicit node: prefix by replacing the top-level require('path') with
require('node:path') in jest.config.base.js (the symbol to change is the const
path = require('path') declaration), keeping the rest of the file unchanged so
it still uses the same `path` variable for path resolution.
apps/quantel-http-transformer-proxy/packages/generic/package.json (1)

14-14: Duplicate @koa/cors in dependencies and devDependencies.

@koa/cors is listed in both dependencies (line 14) and devDependencies (line 29) with the same version. This is redundant—it only needs to be in dependencies since it's used at runtime.

🧹 Proposed fix to remove duplicate
 	"devDependencies": {
-		"@koa/cors": "^5.0.0",
 		"@types/koa": "^3.0.1",

Also applies to: 29-29

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@apps/quantel-http-transformer-proxy/packages/generic/package.json` at line
14, The package.json currently lists the same runtime package "@koa/cors" in
both dependencies and devDependencies; remove the duplicate entry from
devDependencies so "@koa/cors" remains only in dependencies to avoid redundancy
and ensure it's available at runtime; update the devDependencies block to delete
the "@koa/cors" entry and ensure package.json remains valid JSON after the
change.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@apps/http-server/app/package.json`:
- Line 15: The package.json currently lists "rimraf" in dependencies but it's
only used by the build script ("build": "yarn rimraf dist ..."); remove the
"rimraf" entry from the dependencies object and add the same version string to
devDependencies instead (mirroring packages/generic), then update the lockfile
by running your package manager install (yarn or npm) so the move is reflected;
also ensure you remove the duplicate occurrence noted elsewhere and run the
build script to verify nothing breaks.

In `@apps/http-server/packages/generic/src/lib.ts`:
- Around line 1-5: The exported CTX and CTXPost types currently alias
RouterContext<any, any>, which erases context/state typing; update their
definitions to use Koa's DefaultState and DefaultContext so compile-time types
are preserved: replace occurrences of RouterContext<any, any> for the CTX and
CTXPost exports with RouterContext<DefaultState, DefaultContext> (import
DefaultState and DefaultContext from 'koa') and keep the same export names (CTX,
CTXPost).

In `@apps/http-server/packages/generic/src/server.ts`:
- Around line 98-105: The route patterns using the older wildcard syntax (e.g.
'/package/*path' and '/uploadForm/*path') won't match under `@koa/router` v15+;
update the router calls in server.ts (the router.get/ head/ post handlers that
call handleStorage and storage.getPackage/headPackage, and the routes around the
uploadForm handlers) to use the new named wildcard syntax '/package/{/*path}'
and '/uploadForm/{/*path}' so Koa will correctly bind ctx.params.path for the
existing handleStorage, storage.getPackage, storage.headPackage and the upload
form handlers.

In `@apps/quantel-http-transformer-proxy/packages/generic/src/server.ts`:
- Line 123: Update the Koa route pattern: replace the incorrect catch-all string
"{/*path}" with the correct "/{/*path}" wherever it's used (e.g., the
this.router.get('{/*path}', async (ctx, next) => { ... }) route in server.ts);
also make the same replacement for the other occurrence in the http-server app
so the root "/" is properly matched.

---

Outside diff comments:
In
`@shared/packages/worker/src/worker/accessorHandlers/lib/FTPClient/FTPClient.ts`:
- Around line 31-45: The FTPClient currently lists methods to wrap in
methodsToOverride but omits 'cd', so direct calls to this.client.cd bypass the
queue; add 'cd' to the methodsToOverride array (alongside 'downloadTo',
'ensureDir', etc.) so the wrapper/serialization logic in the FTPClient class
will queue and serialize calls to this.client.cd (thereby ensuring calls like
this.client.cd('/') used elsewhere are routed through the same exclusive
execution mechanism).
- Around line 52-54: The current queue wrapper creates orgError using
JSON.stringify(args), which throws when args contain stream objects (e.g., for
uploadFrom/downloadTo) and aborts the operation; replace that unsafe
serialization with a safe representation: detect stream-like objects (Readable,
PassThrough) or otherwise wrap JSON.stringify in a try/catch and fall back to a
placeholder (e.g., "<stream>" or "<unserializable>") per argument so that
creating orgError never throws; update the code around queue.add and the
orgError creation (referencing method, args, and orgMethod.apply) to use this
safe stringify logic before entering the try block.

---

Nitpick comments:
In `@apps/quantel-http-transformer-proxy/packages/generic/package.json`:
- Line 14: The package.json currently lists the same runtime package "@koa/cors"
in both dependencies and devDependencies; remove the duplicate entry from
devDependencies so "@koa/cors" remains only in dependencies to avoid redundancy
and ensure it's available at runtime; update the devDependencies block to delete
the "@koa/cors" entry and ensure package.json remains valid JSON after the
change.

In `@jest.config.base.js`:
- Line 1: Update the built-in module import to use the explicit node: prefix by
replacing the top-level require('path') with require('node:path') in
jest.config.base.js (the symbol to change is the const path = require('path')
declaration), keeping the rest of the file unchanged so it still uses the same
`path` variable for path resolution.

In `@shared/packages/api/package.json`:
- Line 20: Remove the legacy TypeScript stub "@types/winston" from package.json
to avoid conflicts with winston v3's built-in typings; locate the entry
"@types/winston": "^2.4.4" and delete it from dependencies/devDependencies, then
run the package manager to update the lockfile (npm install / yarn install /
pnpm install) so the change is reflected in package-lock.json/yarn.lock and
rebuild types to confirm no remaining type errors.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 6ef0909d-6fbc-4183-9de2-224b4afd99e5

📥 Commits

Reviewing files that changed from the base of the PR and between 051c811 and 025f340.

⛔ Files ignored due to path filters (2)
  • .yarn/releases/yarn-4.1.1.cjs is excluded by !**/.yarn/**
  • yarn.lock is excluded by !**/yarn.lock, !**/*.lock
📒 Files selected for processing (39)
  • .github/workflows/build-windows.yaml
  • .github/workflows/lint-and-test.yaml
  • .github/workflows/publish-prerelease.yaml
  • .yarnrc.yml
  • apps/_boilerplate/app/package.json
  • apps/_boilerplate/packages/generic/package.json
  • apps/appcontainer-node/app/package.json
  • apps/appcontainer-node/packages/generic/package.json
  • apps/html-renderer/app/package.json
  • apps/html-renderer/packages/generic/package.json
  • apps/http-server/app/package.json
  • apps/http-server/packages/generic/package.json
  • apps/http-server/packages/generic/src/lib.ts
  • apps/http-server/packages/generic/src/server.ts
  • apps/package-manager/app/package.json
  • apps/package-manager/packages/generic/package.json
  • apps/quantel-http-transformer-proxy/app/package.json
  • apps/quantel-http-transformer-proxy/packages/generic/package.json
  • apps/quantel-http-transformer-proxy/packages/generic/src/server.ts
  • apps/single-app/app/package.json
  • apps/worker/app/package.json
  • apps/worker/packages/generic/package.json
  • apps/workforce/app/package.json
  • apps/workforce/packages/generic/package.json
  • jest.config.base.js
  • lerna.json
  • package.json
  • shared/packages/api/package.json
  • shared/packages/api/src/websocketServer.ts
  • shared/packages/expectationManager/package.json
  • shared/packages/worker/package.json
  • shared/packages/worker/src/worker/accessorHandlers/__tests__/fileShare.spec.ts
  • shared/packages/worker/src/worker/accessorHandlers/__tests__/localFolder.spec.ts
  • shared/packages/worker/src/worker/accessorHandlers/lib/FTPClient/FTPClient.ts
  • shared/packages/worker/src/worker/accessorHandlers/lib/fetch.ts
  • shared/packages/workforce/package.json
  • tests/internal-tests/package.json
  • tsconfig.build.json
  • tsconfig.jest.json
💤 Files with no reviewable changes (5)
  • .yarnrc.yml
  • .github/workflows/publish-prerelease.yaml
  • .github/workflows/lint-and-test.yaml
  • .github/workflows/build-windows.yaml
  • shared/packages/worker/src/worker/accessorHandlers/lib/fetch.ts

Comment thread apps/http-server/app/package.json Outdated
Comment thread apps/http-server/packages/generic/src/lib.ts Outdated
Comment thread apps/http-server/packages/generic/src/server.ts Outdated
Comment thread apps/quantel-http-transformer-proxy/packages/generic/src/server.ts Outdated
Copy link
Copy Markdown
Member

@nytamin nytamin left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It'll be great to get this updated, thanks for this!

@sonarqubecloud
Copy link
Copy Markdown

sonarqubecloud bot commented Apr 1, 2026

@Julusian Julusian merged commit 11153f8 into main Apr 1, 2026
11 checks passed
@Julusian Julusian deleted the feat/update-libs branch April 1, 2026 13:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants