Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 7 additions & 1 deletion example/wdio.conf.ts
Original file line number Diff line number Diff line change
Expand Up @@ -63,8 +63,14 @@ export const config: Options.Testrunner = {
capabilities: [
{
browserName: 'chrome',
browserVersion: '143.0.7499.169', // specify chromium browser version for testing
'goog:chromeOptions': {
args: ['--headless', '--disable-gpu', '--window-size=1280,800']
args: [
'--headless',
'--disable-gpu',
'--remote-allow-origins=*',
'--window-size=1280,800'
]
}
// }, {
// browserName: 'firefox',
Expand Down
15 changes: 10 additions & 5 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,18 +9,23 @@
"test": "pnpm --parallel test",
"watch": "pnpm build --watch"
},
"pnpm": {
"overrides": {
"vite": "^7.3.0"
}
},
"devDependencies": {
"@types/node": "^24.3.0",
"@types/node": "^25.0.3",
"@typescript-eslint/eslint-plugin": "^8.40.0",
"@typescript-eslint/parser": "^8.40.0",
"@typescript-eslint/utils": "^8.40.0",
"@vitest/browser": "^3.2.4",
"@vitest/browser": "^4.0.16",
"autoprefixer": "^10.4.21",
"eslint": "^9.33.0",
"eslint-config-prettier": "^10.1.8",
"eslint-plugin-import": "^2.32.0",
"eslint-plugin-prettier": "^5.5.4",
"eslint-plugin-unicorn": "^59.0.1",
"eslint-plugin-unicorn": "^62.0.0",
"npm-run-all": "^4.1.5",
"postcss": "^8.5.6",
"postcss-lit": "^1.2.0",
Expand All @@ -30,8 +35,8 @@
"tsx": "^4.20.4",
"typescript": "^5.9.2",
"unplugin-icons": "^22.2.0",
"vite": "^7.1.3",
"vitest": "^3.2.4",
"vite": "^7.3.0",
"vitest": "^4.0.16",
"webdriverio": "^9.19.1"
},
"dependencies": {
Expand Down
5 changes: 3 additions & 2 deletions packages/app/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -32,14 +32,15 @@
"author": "Christian Bromann <[email protected]>",
"license": "MIT",
"devDependencies": {
"@tailwindcss/postcss": "^4.1.12",
"@tailwindcss/postcss": "^4.1.18",
"@wdio/reporter": "9.18.0",
"autoprefixer": "^10.4.21",
"postcss": "^8.5.6",
"postcss-import": "^16.1.1",
"rollup": "^4.47.0",
"stylelint": "^16.24.0",
"stylelint-config-recommended": "^17.0.0",
"stylelint-config-tailwindcss": "^1.0.0",
"tailwindcss": "~3.4.17"
"tailwindcss": "~4.1.18"
}
}
3 changes: 2 additions & 1 deletion packages/app/postcss.config.cjs
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
module.exports = {
plugins: {
tailwindcss: {},
'postcss-import': {},
'@tailwindcss/postcss': {},
autoprefixer: {}
}
}
1 change: 1 addition & 0 deletions packages/app/src/app.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import './tailwind.css'
import { css, html, nothing } from 'lit'
import { customElement, query } from 'lit/decorators.js'
import { TraceType, type TraceLog } from '@wdio/devtools-service/types'
Expand Down
51 changes: 44 additions & 7 deletions packages/app/src/components/browser/snapshot.ts
Original file line number Diff line number Diff line change
Expand Up @@ -58,9 +58,10 @@ export class DevtoolsBrowser extends Element {
width: 100%;
height: 100%;
display: flex;
padding: 2rem;
padding: 2rem !important;
align-items: center;
justify-content: center;
box-sizing: border-box !important;
}

section {
Expand All @@ -70,6 +71,9 @@ export class DevtoolsBrowser extends Element {
display: flex;
flex-direction: column;
overflow: hidden;
background: var(--vscode-sideBar-background);
padding: 0.5rem;
gap: 0;
}

.frame-dot {
Expand All @@ -79,6 +83,35 @@ export class DevtoolsBrowser extends Element {
margin: 1em 0.25em;
flex-shrink: 0;
}

.frame-dot:nth-child(1) {
background-color: var(
--vscode-notificationsErrorIcon-foreground,
#e51400
);
}

.frame-dot:nth-child(2) {
background-color: var(
--vscode-notificationsWarningIcon-foreground,
#bf8803
);
}

.frame-dot:nth-child(3) {
background-color: var(
--vscode-ports-iconRunningProcessForeground,
#369432
);
}

iframe {
background-color: white;
flex: 1;
border: none;
border-radius: 0 0 0.5rem 0.5rem;
min-height: 0;
}
`
]

Expand Down Expand Up @@ -367,21 +400,25 @@ export class DevtoolsBrowser extends Element {

return html`
<section
class="w-full h-full bg-sideBarBackground rounded-t-md shadow-md"
class="w-full h-full bg-sideBarBackground rounded-lg border-2 border-panelBorder shadow-xl"
>
<header class="flex block mx-2">
<header
class="flex items-center mx-2 bg-sideBarBackground rounded-t-lg"
>
<div class="frame-dot bg-notificationsErrorIconForeground"></div>
<div class="frame-dot bg-notificationsWarningIconForeground"></div>
<div class="frame-dot bg-portsIconRunningProcessForeground"></div>
<div
class="flex mx-4 my-2 pr-2 bg-inputBackground text-inputForeground border border-transparent rounded leading-7 w-full"
class="flex items-center mx-4 my-2 pr-2 bg-input-background text-inputForeground border border-editorSuggestWidgetBorder rounded leading-7 flex-1 min-w-0 overflow-hidden"
>
<icon-mdi-world class="w-[20px] h-[20px] m-1 mr-2"></icon-mdi-world>
${this.#activeUrl}
<icon-mdi-world
class="w-[20px] h-[20px] m-1 mr-2 flex-shrink-0"
></icon-mdi-world>
<span class="truncate">${this.#activeUrl}</span>
</div>
</header>
${this.mutations && this.mutations.length
? html`<iframe class="origin-top-left h-full w-full"></iframe>`
? html`<iframe class="origin-top-left"></iframe>`
: html`<wdio-devtools-placeholder
style="height: 100%"
></wdio-devtools-placeholder>`}
Expand Down
2 changes: 1 addition & 1 deletion packages/app/src/components/sidebar/filter.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ export class DevtoolsSidebarFilter extends Element {
display: flex;
align-items: top;
font-size: 0.8em;
padding-right: 1em;
padding-right: 1em !important;
}

label {
Expand Down
14 changes: 9 additions & 5 deletions packages/app/src/components/workbench.ts
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ export class DevtoolsWorkbench extends Element {
minPosition: MIN_WORKBENCH_HEIGHT,
maxPosition: window.innerHeight * 0.7,
initialPosition: window.innerHeight * 0.7, // initial height of browser window is 70% of window
getContainerEl: () => this.getShadowRootAsync() as any as Element,
getContainerEl: () => this as unknown as Element,
direction: Direction.vertical
})

Expand Down Expand Up @@ -199,9 +199,11 @@ export class DevtoolsWorkbench extends Element {
<nav class="ml-auto" slot="actions">
<button
@click="${() => this.#toggle('toolbar')}"
class="flex h-10 w-10 items-center justify-center pointer ml-auto hover:bg-toolbarHoverBackground"
class="flex h-10 w-10 items-center justify-center pointer ml-auto hover:bg-toolbarHoverBackground group"
>
<icon-mdi-arrow-collapse-down></icon-mdi-arrow-collapse-down>
<icon-mdi-arrow-collapse-down
class="group-hover:text-chartsBlue"
></icon-mdi-arrow-collapse-down>
</button>
</nav>
</wdio-devtools-tabs>
Expand All @@ -210,9 +212,11 @@ export class DevtoolsWorkbench extends Element {
<button
@click="${() => this.#toggle('toolbar')}"
class="fixed z-[9999] right-2 bottom-2 bg-sideBarBackground flex h-10 w-10 items-center justify-center cursor-pointer rounded-md shadow
hover:bg-toolbarHoverBackground border border-panelBorder"
hover:bg-toolbarHoverBackground border border-panelBorder group"
>
<icon-mdi-arrow-collapse-up></icon-mdi-arrow-collapse-up>
<icon-mdi-arrow-collapse-up
class="group-hover:text-chartsBlue"
></icon-mdi-arrow-collapse-up>
</button>
`
: nothing}
Expand Down
18 changes: 10 additions & 8 deletions packages/app/src/core/core.css
Original file line number Diff line number Diff line change
@@ -1,12 +1,5 @@
@import url('./colors.css');
@import url('./shadow-styles.css');

@tailwind base;
@tailwind components;
@tailwind utilities;

/**
* general styles applied to all elements
*/
@layer base {
:host {
line-height: 1.5;
Expand All @@ -20,6 +13,15 @@
text-rendering: optimizeLegibility;
-webkit-font-smoothing: antialiased;
-moz-osx-font-smoothing: grayscale;
}
}

:host {
--spacing: 0.25rem;
}

@layer base {
:host {
-webkit-text-size-adjust: 100%;
}

Expand Down
3 changes: 2 additions & 1 deletion packages/app/src/core/element.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
import { LitElement, unsafeCSS } from 'lit'

import coreStyles from './core.css?inline'
import tailwindStyles from '../tailwind.css?inline'

export class Element extends LitElement {
static styles = [unsafeCSS(coreStyles)]
static styles = [unsafeCSS(tailwindStyles), unsafeCSS(coreStyles)]

/**
* get shadow root of element as promise which gets resolved once the element
Expand Down
32 changes: 32 additions & 0 deletions packages/app/src/core/shadow-styles.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
/* Shadow DOM Styles - includes everything needed */
@import url('./colors.css');

/* Tailwind directives - these will be processed when imported with ?inline */
@import "tailwindcss";

@source "../src/**/*.{html,js,ts,jsx,tsx}";
@source "../index.html";

@theme {
--color-panelBorder: var(--vscode-panel-border);
--color-editorSuggestWidgetBorder: var(--vscode-editorSuggestWidget-border);
}

/**
* general styles applied to all elements
*/
@layer base {
:host {
line-height: 1.5;
font-weight: 400;

color-scheme: light dark;
color: var(--vscode-foreground);
font-family: var(--vscode-font-family);

font-synthesis: none;
text-rendering: optimizeLegibility;
-webkit-font-smoothing: antialiased;
-moz-osx-font-smoothing: grayscale;
}
}
18 changes: 18 additions & 0 deletions packages/app/src/tailwind.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
@import "tailwindcss";

/* Tailwind v4 CSS-first configuration */
/* @source directive scans files for utility classes */
@source "../src/**/*.{html,js,ts,jsx,tsx}";
@source "../index.html";

/* @theme directive defines custom design tokens */
@theme {
--color-panelBorder: var(--vscode-panel-border);
--color-editorSuggestWidgetBorder: var(--vscode-editorSuggestWidget-border);
--color-toolbarHoverBackground: var(--vscode-toolbar-hoverBackground);
--color-chartsGreen: var(--vscode-charts-green);
--color-chartsRed: var(--vscode-charts-red);
--color-chartsYellow: var(--vscode-charts-yellow);
--color-chartsBlue: var(--vscode-charts-blue);
--color-input-background: var(--vscode-input-background);
}
35 changes: 6 additions & 29 deletions packages/app/tailwind.config.js
Original file line number Diff line number Diff line change
@@ -1,35 +1,12 @@
import fs from 'node:fs'

/**
* parse `./src/core/colors.css` and apply them to the theme
*/
const cssContent = fs.readFileSync('./src/core/colors.css', 'utf-8')
const cssVars = cssContent
.match(/--vscode-[^:]+/g)
.map((c) => [
c,
c.slice('--vscode-'.length).replace(/-(\w)/g, (_, m) => m.toUpperCase())
])
.reduce((acc, [key, value]) => {
acc[value] = `var(${key})`
return acc
}, {})

/** @type {import('tailwindcss').Config} */
export default {
darkMode: ['class', ':host-context(.dark)'],
content: ['./index.html', './src/**/*.{js,ts,jsx,tsx}'],
theme: {
extend: {},
colors: {
transparent: 'transparent',
current: 'currentColor',
white: '#ffffff',
black: '#000000',

wdio: '#ea5907',
...cssVars
extend: {
colors: {
panelBorder: 'var(--vscode-panel-border)',
editorSuggestWidgetBorder: 'var(--vscode-editorSuggestWidget-border)'
}
}
},
plugins: []
}
}
3 changes: 3 additions & 0 deletions packages/app/vite.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,9 @@ export default defineConfig({
)
}
},
css: {
postcss: './postcss.config.cjs'
},
plugins: [
Icons({
compiler: 'web-components',
Expand Down
2 changes: 1 addition & 1 deletion packages/backend/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
"test": "eslint ."
},
"dependencies": {
"@fastify/static": "^8.2.0",
"@fastify/static": "^9.0.0",
"@fastify/websocket": "^11.2.0",
"@wdio/cli": "9.18.0",
"@wdio/devtools-app": "workspace:^",
Expand Down
Loading