mirror of
https://github.com/openclaw/openclaw.git
synced 2026-06-02 12:26:19 +08:00
Extract shared normalization/coercion helpers into private @openclaw/normalization-core workspace package while preserving existing plugin SDK helper subpaths.\n\nAlso keeps direct normalization-core imports internal, wires UI/build/loader resolution, and replaces the slow PR network CodeQL lane with a fast added-line boundary scan while retaining full CodeQL for scheduled/manual runs.\n\nVerification: local moved tests, plugin SDK boundary tests, extension loader tests, agents-support shard, UI build/test, build artifacts, lint, workflow guards, autoreview, and GitHub CI passed on PR head 963d893715.
73 lines
2.1 KiB
TypeScript
73 lines
2.1 KiB
TypeScript
import path from "node:path";
|
|
import { fileURLToPath } from "node:url";
|
|
import { playwright } from "@vitest/browser-playwright";
|
|
import { defineConfig, defineProject } from "vitest/config";
|
|
import {
|
|
jsdomOptimizedDeps,
|
|
resolveDefaultVitestPool,
|
|
} from "../test/vitest/vitest.shared.config.ts";
|
|
|
|
const here = path.dirname(fileURLToPath(import.meta.url));
|
|
const repoRoot = path.resolve(here, "..");
|
|
const sharedUiTestConfig = {
|
|
isolate: false,
|
|
pool: resolveDefaultVitestPool(),
|
|
} as const;
|
|
const nodeDrivenBrowserLayoutTests = [
|
|
"src/ui/chat/chat-responsive.browser.test.ts",
|
|
"src/ui/views/sessions.browser.test.ts",
|
|
] as const;
|
|
|
|
export default defineConfig({
|
|
resolve: {
|
|
alias: [
|
|
{
|
|
find: /^@openclaw\/normalization-core\/(.+)$/u,
|
|
replacement: path.resolve(repoRoot, "packages/normalization-core/src/$1"),
|
|
},
|
|
],
|
|
},
|
|
test: {
|
|
...sharedUiTestConfig,
|
|
projects: [
|
|
defineProject({
|
|
test: {
|
|
...sharedUiTestConfig,
|
|
deps: jsdomOptimizedDeps,
|
|
name: "unit",
|
|
include: ["src/**/*.test.ts"],
|
|
exclude: ["src/**/*.browser.test.ts", "src/**/*.e2e.test.ts", "src/**/*.node.test.ts"],
|
|
environment: "jsdom",
|
|
setupFiles: ["./src/test-helpers/lit-warnings.setup.ts"],
|
|
},
|
|
}),
|
|
defineProject({
|
|
test: {
|
|
...sharedUiTestConfig,
|
|
deps: jsdomOptimizedDeps,
|
|
name: "unit-node",
|
|
include: ["src/**/*.node.test.ts", ...nodeDrivenBrowserLayoutTests],
|
|
environment: "jsdom",
|
|
setupFiles: ["./src/test-helpers/lit-warnings.setup.ts"],
|
|
},
|
|
}),
|
|
defineProject({
|
|
test: {
|
|
...sharedUiTestConfig,
|
|
name: "browser",
|
|
include: ["src/**/*.browser.test.ts"],
|
|
exclude: [...nodeDrivenBrowserLayoutTests],
|
|
setupFiles: ["./src/test-helpers/lit-warnings.setup.ts"],
|
|
browser: {
|
|
enabled: true,
|
|
provider: playwright(),
|
|
instances: [{ browser: "chromium", name: "chromium" }],
|
|
headless: true,
|
|
ui: false,
|
|
},
|
|
},
|
|
}),
|
|
],
|
|
},
|
|
});
|