Repository navigation
Conversation
- unify all workspaces on ^1.4.0, the last stable line supporting Node 20 (2.x requires Node >= 22; repo pins Node 20.20.2) - migrate generated API calls from positional args to object args - drop .body unwrapping: API methods now return resources directly, including all wrapper call sites that tsc could not see through `any` - replace PatchUtils with PatchStrategy; pass patch Content-Type via request middleware (object-args API has no headers option) - replace HttpError with ApiException (statusCode -> code) - rename applytoHTTPSOptions -> applyToHTTPSOptions - set SDK peer ranges to >=1.0.0 <2.0.0 for client-sdk/metrics-sdk whose compiled code now requires the 1.x object-args API (mcp-sdk only re-exports types and keeps >=0.18.1 <2.0.0)
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Why
All workspaces were pinned to the deprecated 0.18.x / 0.21.x line of
@kubernetes/client-node, which still depends on the unmaintainedrequestlibrary (deprecated since 2020). Versions were also inconsistent across the monorepo (0.18.0,^0.18.1,^0.21.0), resulting in multiple instances in the pnpm lockfile.Target is 1.4.0 — the latest stable line that supports Node 20 (the repo pins Node 20.20.2 in
.nvmrc, engines, and the deploy image). Upstream 2.x drops Node 20 support, so it is out of scope until the repo moves to Node 22+.What changed
Dependency unification
desktop,providers/license,providers/costcenter:^1.4.0(single instance)packages/client-sdk,packages/metrics-sdk: devDeps to^1.4.0; peer ranges narrowed to>=1.0.0 <2.0.0since their compiled code now requires the 1.x object-args APIpackages/mcp-sdk: peer keeps>=0.18.1 <2.0.0(it never calls the library, types only)API migration (0.18 → 1.x breaking changes)
listNamespacedPod(ns, ...)→listNamespacedPod({ namespace, ... })).bodyunwrapping on success responses, including call sites that tsc could not catch because the wrapper return type isany(payment status, notification list, guide update, default/installed apps)PatchUtils→PatchStrategy; patchContent-Type(JSON patch / strategic-merge) is now passed via request middleware, since the object-args API no longer accepts a headers optionHttpError→ApiException(statusCode→code);.bodyon error objects is preservedapplytoHTTPSOptions→applyToHTTPSOptionspackages/metrics-sdk: migratedcreateSelfSubjectAccessReviewto object args (would have thrownRequiredErrorat runtime otherwise)Compatibility notes
@kubernetes/client-nodeis ESM-only since 1.0.0. All consumers here go through Next.js webpack or vitest, both verified working.sealos-desktop-sdk/@sealos/metrics-sdkmust upgrade their own@kubernetes/client-nodeto >= 1.0.0 when they pick up this version (peer range now enforces it).Verification
tsc --noEmit: desktop / license / client-sdk / metrics-sdk — 0 errors; costcenter — 1 pre-existing error, identical tomain(unrelated Mock typing)vitest run --project unit(desktop): 38 files, 281 tests passednext build(desktop): success — confirms the ESM-only package bundles finepnpm run build-packages: all workspace packages buildKubeConfig.loadFromDefault+makeApiClient(CoreV1Api / CustomObjectsApi)OKFollow-ups (not in this PR)