mirror of
https://github.com/murashit/codex-panel.git
synced 2026-07-22 06:57:10 +00:00
Clean temporary test workspaces and build before checks
This commit is contained in:
parent
7f09418f7c
commit
2a0fb96ce6
3 changed files with 21 additions and 6 deletions
|
|
@ -20,7 +20,7 @@
|
|||
"api:baseline": "node scripts/api-baseline.mjs",
|
||||
"build": "node esbuild.config.mjs",
|
||||
"build:styles": "node scripts/build-styles.mjs",
|
||||
"check": "concurrently --group --pad-prefix 'node:check:*' && node --run build",
|
||||
"check": "node --run build && concurrently --group --pad-prefix 'node:check:*'",
|
||||
"check:biome": "biome check --diagnostic-level=warn --error-on-warnings",
|
||||
"check:css-usage": "node scripts/check-css-usage.mjs",
|
||||
"check:eslint": "eslint src manifest.json LICENSE --max-warnings=0",
|
||||
|
|
|
|||
|
|
@ -1,11 +1,17 @@
|
|||
import { spawnSync } from "node:child_process";
|
||||
import { mkdir, mkdtemp, readdir, readFile, writeFile } from "node:fs/promises";
|
||||
import { mkdir, mkdtemp, readdir, readFile, rm, writeFile } from "node:fs/promises";
|
||||
import { tmpdir } from "node:os";
|
||||
import path from "node:path";
|
||||
import { pathToFileURL } from "node:url";
|
||||
import { describe, expect, it } from "vitest";
|
||||
import { afterEach, describe, expect, it } from "vitest";
|
||||
|
||||
const repoRoot = process.cwd();
|
||||
const tempWorkspaces = new Set<string>();
|
||||
|
||||
afterEach(async () => {
|
||||
await Promise.all([...tempWorkspaces].map((workspace) => rm(workspace, { recursive: true, force: true })));
|
||||
tempWorkspaces.clear();
|
||||
});
|
||||
|
||||
describe("development scripts", () => {
|
||||
it("fails style builds when CSS files are missing from the style order file", async () => {
|
||||
|
|
@ -193,7 +199,9 @@ describe("development scripts", () => {
|
|||
});
|
||||
|
||||
async function tempWorkspace(): Promise<string> {
|
||||
return mkdtemp(path.join(tmpdir(), "codex-panel-scripts-"));
|
||||
const workspace = await mkdtemp(path.join(tmpdir(), "codex-panel-scripts-"));
|
||||
tempWorkspaces.add(workspace);
|
||||
return workspace;
|
||||
}
|
||||
|
||||
async function styleOrderFixture(): Promise<string> {
|
||||
|
|
|
|||
|
|
@ -1,11 +1,17 @@
|
|||
import { spawnSync } from "node:child_process";
|
||||
import { readFileSync } from "node:fs";
|
||||
import { mkdir, mkdtemp, readdir, writeFile } from "node:fs/promises";
|
||||
import { mkdir, mkdtemp, readdir, rm, writeFile } from "node:fs/promises";
|
||||
import { tmpdir } from "node:os";
|
||||
import path from "node:path";
|
||||
import { describe, expect, it } from "vitest";
|
||||
import { afterEach, describe, expect, it } from "vitest";
|
||||
|
||||
const repoRoot = process.cwd();
|
||||
const tempWorkspaces = new Set();
|
||||
|
||||
afterEach(async () => {
|
||||
await Promise.all([...tempWorkspaces].map((workspace) => rm(workspace, { recursive: true, force: true })));
|
||||
tempWorkspaces.clear();
|
||||
});
|
||||
const biomeBin = path.join(repoRoot, "node_modules", ".bin", "biome");
|
||||
const projectBiomeConfig = parseJsonc(readFileSync(path.join(repoRoot, "biome.jsonc"), "utf8"));
|
||||
const projectPluginEntries = projectBiomeConfig.plugins;
|
||||
|
|
@ -1486,6 +1492,7 @@ export async function read(client: AppServerClient): Promise<void> {
|
|||
|
||||
async function tempBiomeWorkspace(plugins) {
|
||||
const cwd = await mkdtemp(path.join(tmpdir(), "codex-panel-grit-policy-"));
|
||||
tempWorkspaces.add(cwd);
|
||||
await mkdir(cwd, { recursive: true });
|
||||
await mkdir(path.join(cwd, "src/features/chat/domain/thread-stream"), { recursive: true });
|
||||
await mkdir(path.join(cwd, "src/features/chat/application/state"), { recursive: true });
|
||||
|
|
|
|||
Loading…
Reference in a new issue