Skip to content

Commit 0e84967

Browse files
committed
Merge branch 'main' into dependabot/npm_and_yarn/major-deps-updates-a3b06a597f
2 parents 785bf68 + 0516eb8 commit 0e84967

File tree

12 files changed

+1039
-1916
lines changed

12 files changed

+1039
-1916
lines changed

example/package.json

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,13 @@
22
"name": "examples",
33
"type": "module",
44
"devDependencies": {
5-
"@wdio/cli": "9.24.0",
6-
"@wdio/cucumber-framework": "9.24.0",
5+
"@wdio/cli": "9.27.0",
6+
"@wdio/cucumber-framework": "9.27.0",
77
"@wdio/devtools-service": "workspace:*",
8-
"@wdio/globals": "9.23.0",
9-
"@wdio/local-runner": "9.24.0",
10-
"@wdio/spec-reporter": "9.24.0",
11-
"@wdio/types": "9.24.0",
8+
"@wdio/globals": "9.27.0",
9+
"@wdio/local-runner": "9.27.0",
10+
"@wdio/spec-reporter": "9.27.0",
11+
"@wdio/types": "9.27.0",
1212
"expect-webdriverio": "^5.4.0",
1313
"ts-node": "^10.9.2",
1414
"tsconfig-paths": "^4.2.0",

package.json

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
"name": "devtools-monorepo",
33
"type": "module",
44
"scripts": {
5-
"build": "pnpm --parallel build",
5+
"build": "pnpm -r build",
66
"demo": "wdio run ./example/wdio.conf.ts",
77
"demo:nightwatch": "pnpm --filter @wdio/nightwatch-devtools example",
88
"dev": "pnpm --parallel dev",
@@ -18,7 +18,8 @@
1818
"pnpm": {
1919
"overrides": {
2020
"vite": "^8.0.7",
21-
"@types/node": "25.5.2"
21+
"@types/node": "25.5.2",
22+
"@codemirror/state": "6.5.4"
2223
},
2324
"ignoredBuiltDependencies": [
2425
"chromedriver"
@@ -51,6 +52,6 @@
5152
"webdriverio": "^9.19.1"
5253
},
5354
"dependencies": {
54-
"@wdio/cli": "9.24.0"
55+
"@wdio/cli": "9.27.0"
5556
}
5657
}

packages/app/package.json

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
"@iconify-json/mdi": "^1.2.3",
2323
"@lit/context": "^1.1.6",
2424
"@wdio/devtools-service": "workspace:*",
25-
"@wdio/protocols": "9.24.0",
25+
"@wdio/protocols": "9.27.0",
2626
"codemirror": "^6.0.2",
2727
"lit": "^3.3.2",
2828
"placeholder-loading": "^0.7.0",
@@ -33,15 +33,16 @@
3333
"license": "MIT",
3434
"devDependencies": {
3535
"@tailwindcss/postcss": "^4.1.18",
36-
"@wdio/reporter": "9.24.0",
36+
"@wdio/reporter": "9.27.0",
3737
"autoprefixer": "^10.4.21",
3838
"postcss": "^8.5.6",
3939
"postcss-import": "^16.1.1",
4040
"rollup": "^4.47.0",
4141
"stylelint": "^17.6.0",
4242
"stylelint-config-recommended": "^18.0.0",
4343
"stylelint-config-tailwindcss": "^1.0.1",
44-
"tailwindcss": "~4.1.18",
45-
"vite": "8.0.7"
44+
"vite": "8.0.7",
45+
"tailwindcss": "~4.2.2",
46+
"typescript": "6.0.2"
4647
}
4748
}

packages/app/src/components/workbench/source.ts

Lines changed: 43 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import { Element } from '@core/element'
2-
import { html, css } from 'lit'
3-
import { customElement } from 'lit/decorators.js'
2+
import { html, css, type PropertyValues } from 'lit'
3+
import { customElement, state } from 'lit/decorators.js'
44
import { consume } from '@lit/context'
55

66
import { EditorView, basicSetup } from 'codemirror'
@@ -28,45 +28,78 @@ export class DevtoolsSource extends Element {
2828
width: 100%;
2929
height: 100%;
3030
padding: 10px 0px;
31+
flex: 1;
32+
min-height: 0;
3133
}
3234
.cm-content {
3335
padding: 0 !important;
3436
}
3537
3638
.source-container {
39+
display: flex;
40+
flex-direction: column;
3741
width: 100%;
3842
height: 100%;
43+
overflow: hidden;
3944
}
4045
`
4146
]
4247

4348
@consume({ context: sourceContext, subscribe: true })
49+
@state()
4450
sources: Record<string, string> = {}
4551

4652
#editorView?: EditorView
4753
#activeFile?: string
54+
#tabObserver?: MutationObserver
4855

4956
connectedCallback(): void {
5057
super.connectedCallback()
5158
window.addEventListener(
5259
'app-source-highlight',
5360
this.#highlightCallSource.bind(this)
5461
)
62+
// Observe when the containing tab becomes active so CodeMirror can remeasure
63+
// after having been initialized while the tab was hidden (display:none).
64+
requestAnimationFrame(() => {
65+
const tab = this.closest('wdio-devtools-tab')
66+
if (tab) {
67+
this.#tabObserver = new MutationObserver(() => {
68+
if (tab.hasAttribute('active') && this.#editorView) {
69+
// Force CodeMirror to remeasure and re-render after becoming visible
70+
requestAnimationFrame(() => {
71+
this.#editorView?.requestMeasure()
72+
this.#editorView?.dom.dispatchEvent(new Event('resize'))
73+
})
74+
}
75+
})
76+
this.#tabObserver.observe(tab, {
77+
attributes: true,
78+
attributeFilter: ['active']
79+
})
80+
}
81+
})
5582
}
5683

5784
disconnectedCallback(): void {
5885
super.disconnectedCallback()
5986
this.#editorView?.destroy()
6087
this.#editorView = undefined
88+
this.#tabObserver?.disconnect()
89+
this.#tabObserver = undefined
6190
}
6291

63-
updated() {
92+
updated(_changedProperties: PropertyValues<this>) {
6493
const sourceFileNames = Object.keys(this.sources || {})
6594
if (sourceFileNames.length === 0) {
6695
return
6796
}
68-
// Mount or refresh the editor for the first source file
69-
this.#mountEditor(sourceFileNames[0])
97+
// Respect an explicitly highlighted file; otherwise show the first available
98+
const targetFile =
99+
this.#activeFile && this.sources?.[this.#activeFile]
100+
? this.#activeFile
101+
: sourceFileNames[0]
102+
this.#mountEditor(targetFile)
70103
}
71104

72105
#mountEditor(filePath: string, highlightLine?: number) {
@@ -101,6 +134,11 @@ export class DevtoolsSource extends Element {
101134
this.#editorView = new EditorView(opts)
102135
this.#activeFile = filePath
103136

137+
// Force a measure on the next frame so CodeMirror can calculate heights
138+
// correctly — needed when the editor was created while the panel was hidden
139+
// or before layout was complete.
140+
requestAnimationFrame(() => this.#editorView?.requestMeasure())
141+
104142
if (highlightLine && highlightLine > 0) {
105143
this.#scrollToLine(this.#editorView, highlightLine)
106144
}

packages/app/tsconfig.json

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
11
{
2-
"extends": "../../tsconfig.json"
2+
"extends": "../../tsconfig.json",
3+
"compilerOptions": {
4+
"ignoreDeprecations": "6.0",
5+
"noUncheckedSideEffectImports": false
6+
}
37
}

packages/app/vite.config.ts

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,13 @@ const __dirname = url.fileURLToPath(new URL('.', import.meta.url))
99
export default defineConfig({
1010
resolve: {
1111
alias: {
12+
// Force all codemirror packages to use the same @codemirror/state instance,
13+
// preventing the "multiple instances" error when mixing codemirror meta-package
14+
// with direct @codemirror/* imports under pnpm.
15+
'@codemirror/state': path.resolve(
16+
__dirname,
17+
'../../node_modules/.pnpm/@codemirror+view@6.41.0/node_modules/@codemirror/state'
18+
),
1219
'@': path.resolve(__dirname, './src'),
1320
'@core': path.resolve(__dirname, './src/core'),
1421
'@components': path.resolve(__dirname, './src/components'),

packages/backend/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@
2525
"dependencies": {
2626
"@fastify/static": "^9.0.0",
2727
"@fastify/websocket": "^11.2.0",
28-
"@wdio/cli": "9.24.0",
28+
"@wdio/cli": "9.27.0",
2929
"@wdio/devtools-app": "workspace:^",
3030
"@wdio/logger": "9.18.0",
3131
"fastify": "^5.8.4",

packages/service/package.json

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -34,16 +34,16 @@
3434
"lint": "eslint ."
3535
},
3636
"dependencies": {
37+
"@babel/parser": "^7.28.4",
38+
"@babel/traverse": "^7.28.4",
3739
"@babel/types": "^7.28.4",
3840
"@wdio/devtools-backend": "workspace:^",
3941
"@wdio/devtools-script": "workspace:^",
4042
"@wdio/logger": "9.18.0",
41-
"@wdio/reporter": "9.24.0",
42-
"@wdio/types": "9.24.0",
43+
"@wdio/reporter": "9.27.0",
44+
"@wdio/types": "9.27.0",
4345
"import-meta-resolve": "^4.1.0",
4446
"stack-trace": "1.0.0-pre2",
45-
"@babel/parser": "^7.28.4",
46-
"@babel/traverse": "^7.28.4",
4747
"ws": "^8.18.3"
4848
},
4949
"license": "MIT",
@@ -52,13 +52,14 @@
5252
"@types/babel__traverse": "^7.28.0",
5353
"@types/stack-trace": "^0.0.33",
5454
"@types/ws": "^8.18.1",
55-
"@wdio/globals": "9.23.0",
56-
"@wdio/protocols": "9.24.0",
55+
"@wdio/globals": "9.27.0",
56+
"@wdio/protocols": "9.27.0",
57+
"typescript": "6.0.2",
58+
"vite": "8.0.7",
5759
"vite-plugin-dts": "^4.5.4"
58-
,"vite": "8.0.7"
5960
},
6061
"peerDependencies": {
61-
"@wdio/protocols": "9.24.0",
62+
"@wdio/protocols": "9.27.0",
6263
"devtools": "^8.42.0",
6364
"webdriverio": "^9.19.1"
6465
}
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
{
2+
"extends": "./tsconfig.json",
3+
"compilerOptions": {
4+
"rootDir": ".."
5+
}
6+
}

packages/service/tsconfig.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
{
22
"extends": "../../tsconfig.json",
33
"compilerOptions": {
4+
"ignoreDeprecations": "6.0",
45
"moduleResolution": "NodeNext",
56
"module": "NodeNext",
67
"types": ["@wdio/globals/types"]

0 commit comments

Comments
 (0)