Skip to content

Commit 3d2ebf4

Browse files
antfubotantfu
andauthored
fix(deps): upgrade Vite DevTools to 0.5.1, fix e2e client-context global (#1069)
Co-authored-by: Anthony Fu <github@antfu.me>
1 parent d2c6d90 commit 3d2ebf4

6 files changed

Lines changed: 218 additions & 230 deletions

File tree

‎pnpm-lock.yaml‎

Lines changed: 203 additions & 203 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

‎pnpm-workspace.yaml‎

Lines changed: 2 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ allowBuilds:
4141
vue-demi: true
4242

4343
refs:
44-
devframe: &devframe ^0.9.2
44+
devframe: &devframe ^0.9.4
4545
# Nuxt 5 nightly. Its own `@nuxt/vite-builder-nightly` already requires
4646
# `vite@^8.1.5`, so this and the `vite` ref below move together.
4747
#
@@ -64,7 +64,7 @@ refs:
6464
shiki: &shiki ^4.4.3
6565
unocss: &unocss ^66.7.5
6666
vite: &vite ^8.2.1
67-
vite-devtools: &vite-devtools ^0.5.0
67+
vite-devtools: &vite-devtools ^0.5.1
6868
vue: &vue ^3.5.41
6969
vueuse: &vueuse ^14.4.0
7070
overrides:
@@ -84,25 +84,13 @@ overrides:
8484
chokidar: ^5.0.0
8585
devframe: *devframe
8686
esbuild: ^0.28.2
87-
# `unplugin-vue-markdown@32.0.0` depends on its own `markdown-exit
88-
# ^1.0.0-beta.9`, a different prerelease tuple than the `^1.1.0-beta.2`
89-
# `packages/devtools` depends on directly — semver won't let one satisfy
90-
# the other, so without this override pnpm resolves and ships two copies
91-
# of the engine. Force both onto the version this workspace uses directly.
9287
markdown-exit: ^1.1.0-beta.2
9388
rollup: ^4.62.4
9489
semver: ^7.8.5
9590
typescript: ^6.0.3
9691
unimport: ^6.4.0
9792
vite: *vite
9893
vue: *vue
99-
# `@nuxt/module-builder@1.0.3` bundles `mkdist@2.4.1`, whose own
100-
# `vue-sfc-transformer` dependency is pinned to `^0.1.17` — but
101-
# `resolutionMode: highest` otherwise hoists mkdist's copy up to
102-
# `@nuxt/module-builder`'s own newer `^0.2.3` want, and mkdist's `.vue`
103-
# transform silently breaks under that mismatch (it wrote compiled output
104-
# into `packages/devtools/src/runtime/**` instead of `dist/`, clobbering
105-
# `auth/index.html` in the process). Pin to what mkdist itself needs.
10694
vue-sfc-transformer: ^0.2.5
10795
vue-tsc: ^3.3.10
10896
catalogs:

‎tests/e2e/fixtures/devtools.ts‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -28,17 +28,17 @@ async function ensureDockReady(page: Page): Promise<void> {
2828
{timeout: 30_000},
2929
)
3030
awaitpage.waitForFunction(
31-
()=>Boolean((globalThisasany).__VITE_DEVTOOLS_CLIENT_CONTEXT__?.rpc),
31+
()=>Boolean((globalThisasany).__DEVFRAME_HUB_CLIENT_CONTEXT__?.rpc),
3232
null,
3333
{timeout: 30_000},
3434
)
3535
awaitpage.evaluate(()=>{
36-
constctx=(globalThisasany).__VITE_DEVTOOLS_CLIENT_CONTEXT__
36+
constctx=(globalThisasany).__DEVFRAME_HUB_CLIENT_CONTEXT__
3737
if(ctx?.rpc&&!ctx.rpc.isTrusted)
3838
ctx.rpc.events?.emit?.('rpc:is-trusted:updated',true)
3939
})
4040
awaitpage.waitForFunction(
41-
()=>Boolean((globalThisasany).__VITE_DEVTOOLS_CLIENT_CONTEXT__?.docks?.entries?.length),
41+
()=>Boolean((globalThisasany).__DEVFRAME_HUB_CLIENT_CONTEXT__?.docks?.entries?.length),
4242
null,
4343
{timeout: 30_000},
4444
)

‎tests/e2e/specs/code-server.spec.ts‎

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -13,13 +13,13 @@ test('reports a missing editor binary without starting a process', async ({ page
1313
awaitopenDevTools()
1414

1515
awaitpage.waitForFunction((id)=>{
16-
constctx=(globalThisasany).__VITE_DEVTOOLS_CLIENT_CONTEXT__
16+
constctx=(globalThisasany).__DEVFRAME_HUB_CLIENT_CONTEXT__
1717
returnctx?.docks?.entries?.some((entry: any)=>entry.id===id)
1818
},CODE_SERVER_DOCK_ID,{timeout: 30_000})
1919

2020
// Open the Code Server member the way a user would.
2121
awaitpage.evaluate(async(id)=>{
22-
constctx=(globalThisasany).__VITE_DEVTOOLS_CLIENT_CONTEXT__
22+
constctx=(globalThisasany).__DEVFRAME_HUB_CLIENT_CONTEXT__
2323
awaitctx.docks.switchEntry(id)
2424
},CODE_SERVER_DOCK_ID)
2525

@@ -30,7 +30,7 @@ test('reports a missing editor binary without starting a process', async ({ page
3030

3131
// Opening the member performs detection only — it must not launch a process.
3232
conststatus=awaitpage.evaluate(async(rpcName)=>{
33-
constctx=(globalThisasany).__VITE_DEVTOOLS_CLIENT_CONTEXT__
33+
constctx=(globalThisasany).__DEVFRAME_HUB_CLIENT_CONTEXT__
3434
returnctx.rpc.call(rpcName)
3535
},CODE_SERVER_STATUS_RPC)
3636
expect((statusasany).server.status).toBe('stopped')
@@ -45,20 +45,20 @@ test('launches an installed Code Server with authenticated iframe handoff', asyn
4545
awaitpage.goto('/')
4646
awaitopenDevTools()
4747
awaitpage.waitForFunction((id)=>{
48-
constctx=(globalThisasany).__VITE_DEVTOOLS_CLIENT_CONTEXT__
48+
constctx=(globalThisasany).__DEVFRAME_HUB_CLIENT_CONTEXT__
4949
returnctx?.docks?.entries?.some((entry: any)=>entry.id===id)
5050
},CODE_SERVER_DOCK_ID,{timeout: 30_000})
5151

5252
awaitpage.evaluate(async(id)=>{
53-
constctx=(globalThisasany).__VITE_DEVTOOLS_CLIENT_CONTEXT__
53+
constctx=(globalThisasany).__DEVFRAME_HUB_CLIENT_CONTEXT__
5454
awaitctx.docks.switchEntry(id)
5555
},CODE_SERVER_DOCK_ID)
5656
constlauncher=page.frameLocator(`iframe[src*="${CODE_SERVER_DOCK_ID}"]`)
5757
awaitlauncher.getByRole('button',{name: 'Launch editor'}).click()
5858

5959
awaitexpect.poll(async()=>{
6060
returnpage.evaluate(async(rpcName)=>{
61-
constctx=(globalThisasany).__VITE_DEVTOOLS_CLIENT_CONTEXT__
61+
constctx=(globalThisasany).__DEVFRAME_HUB_CLIENT_CONTEXT__
6262
returnctx.rpc.call(rpcName)
6363
},CODE_SERVER_STATUS_RPC)
6464
},{timeout: 60_000}).toMatchObject({
@@ -67,7 +67,7 @@ test('launches an installed Code Server with authenticated iframe handoff', asyn
6767
})
6868

6969
construnningStatus=awaitpage.evaluate(async(rpcName)=>{
70-
constctx=(globalThisasany).__VITE_DEVTOOLS_CLIENT_CONTEXT__
70+
constctx=(globalThisasany).__DEVFRAME_HUB_CLIENT_CONTEXT__
7171
returnctx.rpc.call(rpcName)
7272
},CODE_SERVER_STATUS_RPC)asany
7373
constserverPort=String(runningStatus.server.port)

‎tests/e2e/specs/data-inspector.spec.ts‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ const EXAMPLE_SOURCE_ID = 'devframes:plugin:data-inspector:example'
88

99
asyncfunctioninspectorSources(page: any): Promise<string[]>{
1010
returnpage.evaluate(async()=>{
11-
constctx=(globalThisasany).__VITE_DEVTOOLS_CLIENT_CONTEXT__
11+
constctx=(globalThisasany).__DEVFRAME_HUB_CLIENT_CONTEXT__
1212
constsources=awaitctx.rpc.call('devframes:plugin:data-inspector:sources')
1313
return(sourcesas{id: string}[]).map(s=>s.id)
1414
})
@@ -29,7 +29,7 @@ test('exposes the live Nuxt application as a data source and hides the demo sour
2929

3030
// Querying the live source returns data (the integration is wired end to end).
3131
constresults=awaitpage.evaluate(async(sourceId)=>{
32-
constctx=(globalThisasany).__VITE_DEVTOOLS_CLIENT_CONTEXT__
32+
constctx=(globalThisasany).__DEVFRAME_HUB_CLIENT_CONTEXT__
3333
constnuxt=awaitctx.rpc.call('devframes:plugin:data-inspector:query',sourceId,'nuxt')
3434
constvite=awaitctx.rpc.call('devframes:plugin:data-inspector:query',sourceId,'vite')
3535
return{ nuxt, vite }

‎tests/e2e/specs/devtools.spec.ts‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ test('registers a single Nuxt entry (no duplicate from the SSR Vite context)', a
2323
// group. There is no user-visible proxy for "how many groups registered", so
2424
// this is the one place we read the dock registry — kept to a single count.
2525
constnuxtGroups=awaitpage.evaluate(()=>{
26-
constctx=(globalThisasany).__VITE_DEVTOOLS_CLIENT_CONTEXT__
26+
constctx=(globalThisasany).__DEVFRAME_HUB_CLIENT_CONTEXT__
2727
returnctx.docks.entries.filter((entry: any)=>entry.id==='nuxt').length
2828
})
2929
expect(nuxtGroups).toBe(1)

0 commit comments

Comments
 (0)