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
64 changes: 64 additions & 0 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 3 additions & 1 deletion packages/webui/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,8 @@
"build:wasm": "bash scripts/build-wasm.sh",
"build": "npm run build:wasm && npm run extract-samples && webpack --mode production --progress --config ./webpack.config.js",
"typecheck": "tsc --noEmit",
"test": "echo \"Error: no test specified\"",
"test": "echo 'playwright tests disabled on CI (run npm run test:e2e locally)'",
"test:e2e": "playwright test",
"dev": "npm run build:wasm && npm run extract-samples && webpack serve --mode development --progress --hot --config ./webpack.config.js",
"fmt": "prettier --write .",
"check-fmt": "prettier --check '{src,webpack}/**/*.{tsx,ts,js}'",
Expand All @@ -33,6 +34,7 @@
"newtype-ts": "^0.3.5"
},
"devDependencies": {
"@playwright/test": "^1.58.2",
"css-loader": "^7.1.2",
"gh-pages": "^6.1.1",
"html-webpack-plugin": "^5.6.0",
Expand Down
22 changes: 22 additions & 0 deletions packages/webui/playwright.config.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
import { defineConfig } from "@playwright/test";

export default defineConfig({
testDir: "./tests",
timeout: 30_000,
use: {
baseURL: "http://localhost:9090",
headless: true,
},
webServer: {
command: "npx webpack serve --mode development --port 9090",
port: 9090,
timeout: 60_000,
reuseExistingServer: true,
},
projects: [
{
name: "chromium",
use: { browserName: "chromium" },
},
],
});
55 changes: 1 addition & 54 deletions packages/webui/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,60 +12,7 @@ import "./wasm-utxo/addresses";
import "./wasm-solana/transaction";
import "./wasm-utxo/parser";

// Common styles used across components
export const commonStyles = `
* {
box-sizing: border-box;
}

:host {
display: block;
font-family: 'JetBrains Mono', 'Fira Code', 'Cascadia Code', monospace;
color: var(--fg, #c9d1d9);
line-height: 1.5;
}

a {
color: var(--accent, #58a6ff);
text-decoration: none;
}

a:hover {
text-decoration: underline;
}

button, input, textarea, select {
font-family: inherit;
}

h1, h2, h3 {
margin: 0 0 1rem;
font-weight: 500;
}

h1 {
font-size: 1.5rem;
color: var(--fg, #c9d1d9);
}

h2 {
font-size: 1.25rem;
}

.breadcrumb {
font-size: 0.875rem;
margin-bottom: 1.5rem;
color: var(--muted, #8b949e);
}

.breadcrumb a {
color: var(--accent, #58a6ff);
}

.breadcrumb span {
color: var(--fg, #c9d1d9);
}
`;
import { commonStyles } from "./styles";

/**
* Home page component - navigation hub for all demos.
Expand Down
54 changes: 54 additions & 0 deletions packages/webui/src/styles.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
/** Common styles shared across all web components. */
export const commonStyles = `
* {
box-sizing: border-box;
}

:host {
display: block;
font-family: 'JetBrains Mono', 'Fira Code', 'Cascadia Code', monospace;
color: var(--fg, #c9d1d9);
line-height: 1.5;
}

a {
color: var(--accent, #58a6ff);
text-decoration: none;
}

a:hover {
text-decoration: underline;
}

button, input, textarea, select {
font-family: inherit;
}

h1, h2, h3 {
margin: 0 0 1rem;
font-weight: 500;
}

h1 {
font-size: 1.5rem;
color: var(--fg, #c9d1d9);
}

h2 {
font-size: 1.25rem;
}

.breadcrumb {
font-size: 0.875rem;
margin-bottom: 1.5rem;
color: var(--muted, #8b949e);
}

.breadcrumb a {
color: var(--accent, #58a6ff);
}

.breadcrumb span {
color: var(--fg, #c9d1d9);
}
`;
2 changes: 1 addition & 1 deletion packages/webui/src/wasm-solana/transaction/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

import { BaseComponent, defineComponent, h, css, fragment, type Child } from "../../lib/html";
import { setParams } from "../../lib/router";
import { commonStyles } from "../../index";
import { commonStyles } from "../../styles";
import {
Transaction,
parseTransaction,
Expand Down
2 changes: 1 addition & 1 deletion packages/webui/src/wasm-utxo/addresses/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

import { BaseComponent, defineComponent, h, css, fragment, type Child } from "../../lib/html";
import { setParams } from "../../lib/router";
import { commonStyles } from "../../index";
import { commonStyles } from "../../styles";
import { address, type CoinName, type AddressFormat } from "@bitgo/wasm-utxo";

const { toOutputScriptWithCoin, fromOutputScriptWithCoin } = address;
Expand Down
Loading