mirror of
https://github.com/openclaw/openclaw.git
synced 2026-04-18 12:41:12 +00:00
refactor: finish browser compat untangle
This commit is contained in:
@@ -23,8 +23,11 @@ export {
|
||||
} from "../media/image-ops.js";
|
||||
export { ensureMediaDir, saveMediaBuffer } from "../media/store.js";
|
||||
export { normalizePluginsConfig, resolveEffectiveEnableState } from "../plugins/config-state.js";
|
||||
export {
|
||||
startLazyPluginServiceModule,
|
||||
type LazyPluginServiceHandle,
|
||||
} from "../plugins/lazy-service-module.js";
|
||||
export type { OpenClawPluginService } from "../plugins/types.js";
|
||||
export { startBrowserControlServerIfEnabled } from "../gateway/server-browser.js";
|
||||
export { resolveGatewayAuth } from "../gateway/auth.js";
|
||||
export { isLoopbackHost } from "../gateway/net.js";
|
||||
export { ensureGatewayStartupAuth } from "../gateway/startup-auth.js";
|
||||
|
||||
@@ -268,17 +268,22 @@ function collectExtensionSourceFiles(): string[] {
|
||||
function collectCoreSourceFiles(): string[] {
|
||||
const srcDir = resolve(ROOT_DIR, "..", "src");
|
||||
const normalizedPluginSdkDir = normalizePath(resolve(ROOT_DIR, "plugin-sdk"));
|
||||
const normalizedBrowserCompatDir = normalizePath(resolve(ROOT_DIR, "compat", "browser"));
|
||||
coreSourceFilesCache = collectSourceFiles(coreSourceFilesCache, {
|
||||
rootDir: srcDir,
|
||||
shouldSkipEntry: ({ normalizedFullPath }) =>
|
||||
normalizedFullPath.includes(".test.") ||
|
||||
normalizedFullPath.includes(".test-helpers.") ||
|
||||
normalizedFullPath.includes(".mock-harness.") ||
|
||||
normalizedFullPath.includes(".spec.") ||
|
||||
normalizedFullPath.includes(".fixture.") ||
|
||||
normalizedFullPath.includes(".snap") ||
|
||||
// src/plugin-sdk is the curated bridge layer; validate its contracts with dedicated
|
||||
// plugin-sdk guardrails instead of the generic "core should not touch extensions" rule.
|
||||
normalizedFullPath.includes(`${normalizedPluginSdkDir}/`),
|
||||
normalizedFullPath.includes(`${normalizedPluginSdkDir}/`) ||
|
||||
// src/compat/browser is the explicit browser compatibility shim layer that forwards
|
||||
// legacy core entrypoints into the bundled browser plugin.
|
||||
normalizedFullPath.includes(`${normalizedBrowserCompatDir}/`),
|
||||
});
|
||||
return coreSourceFilesCache;
|
||||
}
|
||||
|
||||
@@ -5,5 +5,6 @@ export * from "../plugins/hook-runner-global.js";
|
||||
export * from "../plugins/http-path.js";
|
||||
export * from "../plugins/http-registry.js";
|
||||
export * from "../plugins/interactive.js";
|
||||
export * from "../plugins/lazy-service-module.js";
|
||||
export * from "../plugins/types.js";
|
||||
export type { RuntimeLogger } from "../plugins/runtime/types.js";
|
||||
|
||||
Reference in New Issue
Block a user