From 0150a7368af92595d5d55c178a4f10fba0443ecd Mon Sep 17 00:00:00 2001 From: Anthony Fu Date: Thu, 28 May 2026 11:14:52 +0900 Subject: [PATCH] chore: migrate to devframe v0.5.2 --- pnpm-lock.yaml | 30 ++++++++++++++++++++++-------- pnpm-workspace.yaml | 4 ++-- src/devframe/hub-mode.ts | 4 ++-- src/devframe/project-factory.ts | 4 ++-- src/devframe/rpc/hub-context.ts | 4 ++-- src/devframe/rpc/index.ts | 4 ++-- src/devframe/rpc/types.ts | 2 +- src/devframe/rpc/utils.ts | 20 ++++++++++---------- src/devframe/ui-mode.ts | 4 ++-- ui/composables/useRpc.ts | 10 +++++----- 10 files changed, 50 insertions(+), 36 deletions(-) diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 857b3b5b..44752c63 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -67,8 +67,8 @@ catalogs: specifier: ^0.6.1 version: 0.6.1 devframe: - specifier: ^0.4.1 - version: 0.4.1 + specifier: ^0.5.2 + version: 0.5.2 dotenv: specifier: ^17.4.2 version: 17.4.2 @@ -185,7 +185,7 @@ importers: version: 7.0.0 devframe: specifier: 'catalog:' - version: 0.4.1(crossws@0.4.5(srvx@0.11.15))(typescript@6.0.3) + version: 0.5.2(crossws@0.4.5(srvx@0.11.15))(typescript@6.0.3) dotenv: specifier: 'catalog:' version: 17.4.2 @@ -276,7 +276,7 @@ importers: version: 0.6.1 devframe: specifier: 'catalog:' - version: 0.4.1(crossws@0.4.5(srvx@0.11.15))(typescript@6.0.3) + version: 0.5.2(crossws@0.4.5(srvx@0.11.15))(typescript@6.0.3) floating-vue: specifier: 'catalog:' version: 5.2.2(@nuxt/kit@4.4.6(magicast@0.5.2))(vue@3.5.34(typescript@6.0.3)) @@ -3376,8 +3376,8 @@ packages: devalue@5.8.1: resolution: {integrity: sha512-4CXDYRBGqN+57wVJkuXBYmpAVUSg3L6JAQa/DFqm238G73E1wuyc/JhGQJzN7vUf/CMphYau2zXbfWzDR5aTEw==} - devframe@0.4.1: - resolution: {integrity: sha512-9HTn7CITFmyd7lj14YAUX7z1PbWEDVcXLtI0UUApBkCP1QgHEVOUTvgbXyuZr4EUw1vNSdeo0nW1UyimpsDSFA==} + devframe@0.5.2: + resolution: {integrity: sha512-8dIdlOmuY+6NcCsaI2qS0uRLTZ3SvpejY8OYVbXvdWSQV7pvjdWaYNZhVfOfCSd/a5dSCgSge4vW4DCyJSf7+g==} peerDependencies: '@modelcontextprotocol/sdk': ^1.0.0 peerDependenciesMeta: @@ -6133,6 +6133,18 @@ packages: utf-8-validate: optional: true + ws@8.21.0: + resolution: {integrity: sha512-Vsp28b7DRcimFQvrqu2Wek3z1iYxDCWqHYB8Qsnk/S4RfaCQzPGPyBNuVjJV3cd6UiKtUtp6sNM77gWvzcCH+g==} + engines: {node: '>=10.0.0'} + peerDependencies: + bufferutil: ^4.0.1 + utf-8-validate: '>=5.0.2' + peerDependenciesMeta: + bufferutil: + optional: true + utf-8-validate: + optional: true + wsl-utils@0.1.0: resolution: {integrity: sha512-h3Fbisa2nKGPxCpm89Hk33lBLsnaGBvctQopaBSOW/uIs6FTe1ATyAnKFJrzVs9vpGdsTe73WF3V4lIsk4Gacw==} engines: {node: '>=18'} @@ -9194,7 +9206,7 @@ snapshots: devalue@5.8.1: {} - devframe@0.4.1(crossws@0.4.5(srvx@0.11.15))(typescript@6.0.3): + devframe@0.5.2(crossws@0.4.5(srvx@0.11.15))(typescript@6.0.3): dependencies: '@valibot/to-json-schema': 1.7.0(valibot@1.4.1(typescript@6.0.3)) birpc: 4.0.0 @@ -9204,7 +9216,7 @@ snapshots: nostics: 0.2.0 pathe: 2.0.3 valibot: 1.4.1(typescript@6.0.3) - ws: 8.20.0 + ws: 8.21.0 transitivePeerDependencies: - bufferutil - crossws @@ -12509,6 +12521,8 @@ snapshots: ws@8.20.0: {} + ws@8.21.0: {} + wsl-utils@0.1.0: dependencies: is-wsl: 3.1.1 diff --git a/pnpm-workspace.yaml b/pnpm-workspace.yaml index a322746c..7d4802f9 100644 --- a/pnpm-workspace.yaml +++ b/pnpm-workspace.yaml @@ -9,7 +9,7 @@ minimumReleaseAgeExclude: - vitest@4.1.7 - '@tanstack/virtual-core@3.15.0' - '@tanstack/vue-virtual@3.13.25' - - devframe@0.4.1 + - devframe@0.5.2 - portless@0.13.1 shellEmulator: true @@ -41,7 +41,7 @@ catalog: bumpp: ^11.1.0 cac: ^7.0.0 colorjs.io: ^0.6.1 - devframe: ^0.4.1 + devframe: ^0.5.2 dotenv: ^17.4.2 eslint: ^10.4.0 floating-vue: ^5.2.2 diff --git a/src/devframe/hub-mode.ts b/src/devframe/hub-mode.ts index 846ad854..878c6a3f 100644 --- a/src/devframe/hub-mode.ts +++ b/src/devframe/hub-mode.ts @@ -1,4 +1,4 @@ -import type { DevToolsNodeContext } from 'devframe' +import type { DevframeNodeContext } from 'devframe' import type { ProjectContext, ProjectRegistry } from './project-context' import type { HubInfo } from './rpc/types' import { resolve } from 'pathe' @@ -34,7 +34,7 @@ export interface HubModeHandle { } export async function setupHubMode( - devframeCtx: DevToolsNodeContext, + devframeCtx: DevframeNodeContext, options: HubModeOptions, ): Promise { const launchCwd = resolve(options.cwd) diff --git a/src/devframe/project-factory.ts b/src/devframe/project-factory.ts index 54e0c330..bb689f95 100644 --- a/src/devframe/project-factory.ts +++ b/src/devframe/project-factory.ts @@ -1,4 +1,4 @@ -import type { DevToolsNodeContext } from 'devframe' +import type { DevframeNodeContext } from 'devframe' import type { GhfsResolvedConfig } from '../types' import type { RepositoryProvider } from '../types/provider' import type { ProjectBroadcast, ProjectContext } from './project-context' @@ -26,7 +26,7 @@ export interface BuildProjectOptions { onRequestToken?: () => Promise /** Poller tick — default 60s. Hub passes a slower tick. */ pollerIntervalMs?: number - devframeCtx: DevToolsNodeContext + devframeCtx: DevframeNodeContext } export async function buildProjectContext(options: BuildProjectOptions): Promise { diff --git a/src/devframe/rpc/hub-context.ts b/src/devframe/rpc/hub-context.ts index b2aa5c86..e034d4cc 100644 --- a/src/devframe/rpc/hub-context.ts +++ b/src/devframe/rpc/hub-context.ts @@ -1,4 +1,4 @@ -import type { DevToolsNodeContext } from 'devframe' +import type { DevframeNodeContext } from 'devframe' import type { ProjectContext } from '../project-context' import type { HubInfo } from './types' @@ -8,7 +8,7 @@ import type { HubInfo } from './types' * context with `setHubContext`. */ export interface HubRpcContext { - devframeCtx: DevToolsNodeContext + devframeCtx: DevframeNodeContext homeDir?: string launchCwd: string roots: Set diff --git a/src/devframe/rpc/index.ts b/src/devframe/rpc/index.ts index 617b8857..245e1ce9 100644 --- a/src/devframe/rpc/index.ts +++ b/src/devframe/rpc/index.ts @@ -1,4 +1,4 @@ -import type { DevToolsNodeContext } from 'devframe' +import type { DevframeNodeContext } from 'devframe' import { addQueueOp } from './add-queue-op' import { capabilities } from './capabilities' import { checkRemote } from './check-remote' @@ -82,7 +82,7 @@ export const rpcFunctions = [ setRepoTemplates, ] as const -export function registerGhfsRpc(ctx: DevToolsNodeContext): void { +export function registerGhfsRpc(ctx: DevframeNodeContext): void { for (const fn of rpcFunctions) ctx.rpc.register(fn as any) } diff --git a/src/devframe/rpc/types.ts b/src/devframe/rpc/types.ts index a6296ca0..1293aaec 100644 --- a/src/devframe/rpc/types.ts +++ b/src/devframe/rpc/types.ts @@ -261,7 +261,7 @@ export interface CardsSharedState { } declare module 'devframe/types' { - interface DevToolsRpcSharedStates { + interface DevframeRpcSharedStates { 'ghfs:cards-pile': CardsSharedState } } diff --git a/src/devframe/rpc/utils.ts b/src/devframe/rpc/utils.ts index 6f7283c4..ee6d17c4 100644 --- a/src/devframe/rpc/utils.ts +++ b/src/devframe/rpc/utils.ts @@ -1,39 +1,39 @@ -import type { DevToolsNodeContext } from 'devframe' +import type { DevframeNodeContext } from 'devframe' import type { UiState } from '../../server/types' import type { ProjectRegistry } from '../project-context' import type { HubRpcContext } from './hub-context' import { diagnostics } from '../../logger' -const registryMap = new WeakMap() -const hubMap = new WeakMap() -const uiStateSavedMap = new WeakMap void>() +const registryMap = new WeakMap() +const hubMap = new WeakMap() +const uiStateSavedMap = new WeakMap void>() -export function getProjectRegistry(ctx: DevToolsNodeContext): ProjectRegistry { +export function getProjectRegistry(ctx: DevframeNodeContext): ProjectRegistry { const reg = registryMap.get(ctx) if (!reg) throw diagnostics.GHFS0206({ detail: 'Project registry not initialized for this devframe context.' }) return reg } -export function setProjectRegistry(ctx: DevToolsNodeContext, registry: ProjectRegistry): void { +export function setProjectRegistry(ctx: DevframeNodeContext, registry: ProjectRegistry): void { registryMap.set(ctx, registry) } -export function getHubContext(ctx: DevToolsNodeContext): HubRpcContext { +export function getHubContext(ctx: DevframeNodeContext): HubRpcContext { const hub = hubMap.get(ctx) if (!hub) throw diagnostics.GHFS0206({ detail: 'Hub context not initialized for this devframe context.' }) return hub } -export function setHubContext(ctx: DevToolsNodeContext, hub: HubRpcContext): void { +export function setHubContext(ctx: DevframeNodeContext, hub: HubRpcContext): void { hubMap.set(ctx, hub) } -export function getUiStateSavedCallback(ctx: DevToolsNodeContext): ((state: UiState, projectId: string) => void) | undefined { +export function getUiStateSavedCallback(ctx: DevframeNodeContext): ((state: UiState, projectId: string) => void) | undefined { return uiStateSavedMap.get(ctx) } -export function setUiStateSavedCallback(ctx: DevToolsNodeContext, cb: (state: UiState, projectId: string) => void): void { +export function setUiStateSavedCallback(ctx: DevframeNodeContext, cb: (state: UiState, projectId: string) => void): void { uiStateSavedMap.set(ctx, cb) } diff --git a/src/devframe/ui-mode.ts b/src/devframe/ui-mode.ts index 6a2f39f5..f702efc7 100644 --- a/src/devframe/ui-mode.ts +++ b/src/devframe/ui-mode.ts @@ -1,4 +1,4 @@ -import type { DevToolsNodeContext } from 'devframe' +import type { DevframeNodeContext } from 'devframe' import type { GhfsResolvedConfig } from '../types' import type { ProjectRegistry } from './project-context' import { createAutoSyncTimer } from '../hub/auto-sync' @@ -26,7 +26,7 @@ export interface UiModeHandle { } export async function setupUiMode( - devframeCtx: DevToolsNodeContext, + devframeCtx: DevframeNodeContext, options: UiModeOptions, ): Promise { const project = await buildProjectContext({ diff --git a/ui/composables/useRpc.ts b/ui/composables/useRpc.ts index cd366c29..e9ba22c5 100644 --- a/ui/composables/useRpc.ts +++ b/ui/composables/useRpc.ts @@ -1,6 +1,6 @@ import type { GhfsCapabilities, GhfsClientFunctions, GhfsServerFunctions } from '#ghfs/rpc-types' import type { SyncStage } from '#ghfs/sync-contracts' -import type { DevToolsRpcClient } from 'devframe/client' +import type { DevframeRpcClient } from 'devframe/client' import { connectDevframe } from 'devframe/client' import { useAppState } from './useAppState' import type { ProgressCurrentItem } from './useAppState' @@ -54,15 +54,15 @@ export interface GhfsRpc { } let rpcShim: GhfsRpc | null = null -let clientPromise: Promise | null = null +let clientPromise: Promise | null = null -function ensureClient(): Promise { +function ensureClient(): Promise { if (clientPromise) return clientPromise // Fetch our own `/__connection.json` and pass the result explicitly. // // Why not let devframe fetch it via `baseURL`? Because - // `connectDevframe()` first checks `window.__VITE_DEVTOOLS_CONNECTION_META__`, + // `connectDevframe()` first checks `window.__DEVFRAME_CONNECTION_META__`, // and the newer Vite/Nuxt DevTools sets that global to point at the // Nuxt dev server's own WS — which lands devframe on the wrong port // (the SPA port, not the paired ghfs server's port). Passing @@ -123,7 +123,7 @@ export function useRpc(): GhfsRpc { * Access the full devframe client — needed for `rpc.sharedState`, * `rpc.streaming`, etc. Resolves once the connection handshake completes. */ -export function useRpcClient(): Promise { +export function useRpcClient(): Promise { if (typeof window === 'undefined') return Promise.reject(new Error('devframe RPC not available (SSR)')) return ensureClient()