Skip to content
This repository was archived by the owner on Jul 24, 2025. It is now read-only.

Commit 8de03a3

Browse files
committed
Use fs-extra to copy playground
1 parent c2289a7 commit 8de03a3

File tree

4 files changed

+49
-4
lines changed

4 files changed

+49
-4
lines changed

package.json

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,10 @@
2222
"devDependencies": {
2323
"@nabla/tnode": "^0.7.0",
2424
"@playwright/test": "^1.28.1",
25+
"@types/fs-extra": "^9.0.13",
2526
"@types/node": "^18.11.9",
2627
"esbuild": "^0.15.15",
28+
"fs-extra": "^11.1.0",
2729
"prettier": "^2.8.0",
2830
"typescript": "^4.9.3",
2931
"vite": "^4.0.0-alpha.5"

playwright.config.ts

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,11 @@
11
import { devices, PlaywrightTestConfig } from "@playwright/test";
2+
import { resolve } from "node:path";
3+
import * as fs from "fs-extra";
4+
5+
const tempDir = resolve(__dirname, "playground-temp");
6+
fs.ensureDirSync(tempDir);
7+
fs.emptyDirSync(tempDir);
8+
fs.copySync(resolve(__dirname, "playground"), tempDir);
29

310
const config: PlaywrightTestConfig = {
411
testDir: "./tests",
@@ -7,8 +14,8 @@ const config: PlaywrightTestConfig = {
714
reporter: process.env.CI ? "github" : "list",
815
projects: [{ name: "chromium", use: devices["Desktop Chrome"] }],
916
webServer: {
10-
command:
11-
"rm -rf playground-temp/ && cp -r playground/ playground-temp/ && cd playground-temp/ && pnpm dev",
17+
cwd: "playground-temp",
18+
command: "pnpm dev",
1219
port: 5173,
1320
},
1421
};

pnpm-lock.yaml

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

scripts/bundle.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
#!/usr/bin/env tnode
2-
import { rmSync, writeFileSync } from "fs";
3-
import { execSync } from "child_process";
2+
import { rmSync, writeFileSync } from "node:fs";
3+
import { execSync } from "node:child_process";
44
import { build, BuildOptions } from "esbuild";
55

66
import * as packageJSON from "../package.json";

0 commit comments

Comments
 (0)