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
2 changes: 1 addition & 1 deletion .vscode/extensions.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{
"recommendations": ["astro-build.astro-vscode"],
"recommendations": ["astro-build.astro-vscode", "ms-playwright.playwright"],
"unwantedRecommendations": []
}
8 changes: 4 additions & 4 deletions docs/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,13 @@
"@tweakpane/core": "2.0.5",
"gray-matter": "4.0.3",
"markdown-it-container": "4.0.0",
"sass": "1.83.4",
"sass": "1.89.2",
"tweakpane": "4.0.5",
"typescript": "5.7.3",
"typescript": "5.8.3",
"usegl": "workspace:*",
"vitepress": "1.6.3",
"vitepress-plugin-group-icons": "1.3.5",
"vitepress-plugin-group-icons": "1.6.1",
"vitepress-plugin-sandpack": "1.1.4",
"vue": "3.5.13"
"vue": "3.5.18"
}
}
19 changes: 8 additions & 11 deletions lib/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,20 +1,17 @@
FROM mcr.microsoft.com/playwright:v1.49.1 AS base
RUN npm i -g pnpm
FROM mcr.microsoft.com/playwright:v1.49.1
RUN npm install -g corepack@latest
RUN corepack enable

FROM base AS deps
WORKDIR /app

COPY package.json ./
RUN --mount=type=cache,id=pnpm,target=/pnpm/store pnpm install

FROM base AS runner
WORKDIR /app
COPY --from=deps /app/node_modules ./node_modules
COPY playwright.config.ts ./
COPY astro.config.mjs ./
COPY tsconfig.json ./
COPY package.json ./
COPY playwright.config.ts astro.config.mjs tsconfig.json ./
COPY tests ./tests
COPY playground ./playground
COPY src ./src

CMD ["sh", "-c", "xvfb-run pnpm run test -u"]
EXPOSE 9323

CMD ["sh", "-c", "xvfb-run pnpm run test"]
8 changes: 8 additions & 0 deletions lib/compose.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
services:
test:
build: .
ports:
- "9323:9323"
volumes:
- ./test-results:/app/test-results
- ./tests/__screenshots__:/app/tests/__screenshots__
24 changes: 12 additions & 12 deletions lib/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -29,26 +29,26 @@
"prepack": "pnpm build",
"release": "changelogen --release --clean",
"test": "playwright test",
"test:local": "docker build -t usegl . && docker run --rm -v $(pwd)/test-results:/app/test-results usegl /bin/sh -c 'xvfb-run pnpm run test'",
"test:ui": "playwright test --ui",
"test:update": "docker build -t usegl . && docker run --rm -v $(pwd)/test-results:/app/test-results -v $(pwd)/tests/__screenshots__:/app/tests/__screenshots__ usegl",
"test:local": "docker compose run --build --rm -p 9323:9323 test",
"test:update": "docker compose run --build --rm test sh -c 'xvfb-run pnpm run test -u'",
"typecheck": "tsc --noEmit && astro check --tsconfig playground/tsconfig.json"
},
"devDependencies": {
"@astrojs/check": "0.9.4",
"@playwright/test": "1.49.1",
"@types/node": "22.10.7",
"astro": "5.1.8",
"changelogen": "0.5.7",
"eslint": "9.18.0",
"eslint-config-unjs": "0.4.2",
"prettier": "3.4.2",
"typescript": "5.7.3",
"unbuild": "3.3.1"
"@types/node": "22.16.5",
"astro": "5.12.3",
"changelogen": "0.6.2",
"eslint": "9.32.0",
"eslint-config-unjs": "0.5.0",
"prettier": "3.6.2",
"typescript": "5.8.3",
"unbuild": "3.6.0"
},
"changelog": {
"excludeAuthors": [
""
]
}
},
"packageManager": "pnpm@10.13.1"
}
9 changes: 7 additions & 2 deletions lib/playground/src/components/routes.ts
Original file line number Diff line number Diff line change
@@ -1,11 +1,16 @@
import { readdirSync } from "node:fs";
import path from "node:path";
import { fileURLToPath } from "node:url";

export const sections = readdirSync("playground/src/pages", { withFileTypes: true })
const __filename = fileURLToPath(import.meta.url);
const __dirname = path.dirname(__filename);

export const sections = readdirSync(path.join(__dirname, "../pages"), { withFileTypes: true })
.filter((file) => file.isDirectory())
.map((folder) => folder.name);

export const routes = sections.flatMap((section) => {
const files = readdirSync(`playground/src/pages/${section}`);
const files = readdirSync(path.join(__dirname, "../pages", section));

return files.map((file) => {
const route = file.replace(".astro", "");
Expand Down
2 changes: 1 addition & 1 deletion lib/playwright.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ export default defineConfig({
forbidOnly: !!process.env.CI,
retries: process.env.CI ? 3 : 0,
/* Reporter to use. See https://playwright.dev/docs/test-reporters */
reporter: "html",
reporter: [["html", { host: "0.0.0.0" }]],
use: {
trace: "on-first-retry",
baseURL: serverUrl,
Expand Down
Loading