mirror of
https://github.com/openclaw/openclaw.git
synced 2026-02-09 05:19:32 +08:00
chore: fix vitest standalone configs and update package description (#11865)
* chore: fix vitest standalone configs and update package description - vitest.live.config.ts and vitest.e2e.config.ts now extend root config - Inherits testTimeout (120s), resolve.alias, pool, setupFiles, excludes - ui/vitest.node.config.ts gets explicit 120s timeout - package.json description updated for multi-channel AI gateway - Removed unused src/utils/time-format.ts * chore: filter inherited excludes in live/e2e vitest configs * refactor: dedupe GroupPolicy/DmPolicy in extensions Import from openclaw/plugin-sdk instead of re-declaring identical types.
This commit is contained in:
@@ -1,5 +1,4 @@
|
||||
export type DmPolicy = "pairing" | "allowlist" | "open" | "disabled";
|
||||
export type GroupPolicy = "open" | "disabled" | "allowlist";
|
||||
export type { DmPolicy, GroupPolicy } from "openclaw/plugin-sdk";
|
||||
|
||||
export type BlueBubblesGroupConfig = {
|
||||
/** If true, only respond in this group when mentioned. */
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
import type { DmPolicy } from "openclaw/plugin-sdk";
|
||||
import {
|
||||
addWildcardAllowFrom,
|
||||
formatDocsLink,
|
||||
@@ -6,7 +7,7 @@ import {
|
||||
type ChannelOnboardingDmPolicy,
|
||||
type WizardPrompter,
|
||||
} from "openclaw/plugin-sdk";
|
||||
import type { CoreConfig, DmPolicy } from "./types.js";
|
||||
import type { CoreConfig } from "./types.js";
|
||||
import { listMatrixDirectoryGroupsLive } from "./directory-live.js";
|
||||
import { resolveMatrixAccount } from "./matrix/accounts.js";
|
||||
import { ensureMatrixSdkInstalled, isMatrixSdkAvailable } from "./matrix/deps.js";
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
export type { DmPolicy, GroupPolicy } from "openclaw/plugin-sdk";
|
||||
|
||||
export type ReplyToMode = "off" | "first" | "all";
|
||||
export type GroupPolicy = "open" | "disabled" | "allowlist";
|
||||
export type DmPolicy = "pairing" | "allowlist" | "open" | "disabled";
|
||||
|
||||
export type MatrixDmConfig = {
|
||||
/** If false, ignore all incoming Matrix DMs. Default: true. */
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
{
|
||||
"name": "openclaw",
|
||||
"version": "2026.2.6-3",
|
||||
"description": "WhatsApp gateway CLI (Baileys web) with Pi RPC agent",
|
||||
"description": "Multi-channel AI gateway with extensible messaging integrations",
|
||||
"keywords": [],
|
||||
"license": "MIT",
|
||||
"author": "",
|
||||
|
||||
@@ -1,6 +0,0 @@
|
||||
import { formatRelativeTimestamp } from "../infra/format-time/format-relative.ts";
|
||||
|
||||
/** Delegates to centralized formatRelativeTimestamp with date fallback for >7d. */
|
||||
export function formatRelativeTime(timestamp: number): string {
|
||||
return formatRelativeTimestamp(timestamp, { dateFallback: true, fallback: "unknown" });
|
||||
}
|
||||
@@ -3,6 +3,7 @@ import { defineConfig } from "vitest/config";
|
||||
// Node-only tests for pure logic (no Playwright/browser dependency).
|
||||
export default defineConfig({
|
||||
test: {
|
||||
testTimeout: 120_000,
|
||||
include: ["src/**/*.node.test.ts"],
|
||||
environment: "node",
|
||||
},
|
||||
|
||||
@@ -1,22 +1,20 @@
|
||||
import os from "node:os";
|
||||
import { defineConfig } from "vitest/config";
|
||||
import baseConfig from "./vitest.config.ts";
|
||||
|
||||
const isCI = process.env.CI === "true" || process.env.GITHUB_ACTIONS === "true";
|
||||
const cpuCount = os.cpus().length;
|
||||
const e2eWorkers = isCI ? 2 : Math.min(4, Math.max(1, Math.floor(cpuCount * 0.25)));
|
||||
|
||||
const baseTest = (baseConfig as { test?: { exclude?: string[] } }).test ?? {};
|
||||
const exclude = (baseTest.exclude ?? []).filter((p) => p !== "**/*.e2e.test.ts");
|
||||
|
||||
export default defineConfig({
|
||||
...baseConfig,
|
||||
test: {
|
||||
pool: "forks",
|
||||
...baseTest,
|
||||
maxWorkers: e2eWorkers,
|
||||
include: ["test/**/*.e2e.test.ts", "src/**/*.e2e.test.ts"],
|
||||
setupFiles: ["test/setup.ts"],
|
||||
exclude: [
|
||||
"dist/**",
|
||||
"apps/macos/**",
|
||||
"apps/macos/.build/**",
|
||||
"**/vendor/**",
|
||||
"dist/OpenClaw.app/**",
|
||||
],
|
||||
exclude,
|
||||
},
|
||||
});
|
||||
|
||||
@@ -1,17 +1,15 @@
|
||||
import { defineConfig } from "vitest/config";
|
||||
import baseConfig from "./vitest.config.ts";
|
||||
|
||||
const baseTest = (baseConfig as { test?: { exclude?: string[] } }).test ?? {};
|
||||
const exclude = (baseTest.exclude ?? []).filter((p) => p !== "**/*.live.test.ts");
|
||||
|
||||
export default defineConfig({
|
||||
...baseConfig,
|
||||
test: {
|
||||
pool: "forks",
|
||||
...baseTest,
|
||||
maxWorkers: 1,
|
||||
include: ["src/**/*.live.test.ts"],
|
||||
setupFiles: ["test/setup.ts"],
|
||||
exclude: [
|
||||
"dist/**",
|
||||
"apps/macos/**",
|
||||
"apps/macos/.build/**",
|
||||
"**/vendor/**",
|
||||
"dist/OpenClaw.app/**",
|
||||
],
|
||||
exclude,
|
||||
},
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user