mirror of
https://github.com/openclaw/openclaw.git
synced 2026-05-06 13:40:44 +00:00
refactor: trim helper exports
This commit is contained in:
@@ -1,9 +1,6 @@
|
||||
import { existsSync, readFileSync, readdirSync } from "node:fs";
|
||||
import { join, posix, resolve } from "node:path";
|
||||
|
||||
export const EXTENSION_PACKAGE_BOUNDARY_BASE_CONFIG =
|
||||
"extensions/tsconfig.package-boundary.base.json" as const;
|
||||
|
||||
export const EXTENSION_PACKAGE_BOUNDARY_INCLUDE = ["./*.ts", "./src/**/*.ts"] as const;
|
||||
export const EXTENSION_PACKAGE_BOUNDARY_EXCLUDE = [
|
||||
"./**/*.test.ts",
|
||||
@@ -104,7 +101,7 @@ export const EXTENSION_PACKAGE_BOUNDARY_XAI_PATHS = {
|
||||
"@openclaw/speech-core/runtime-api.js": ["./.boundary-stubs/speech-core-runtime-api.d.ts"],
|
||||
} as const;
|
||||
|
||||
export type ExtensionPackageBoundaryTsConfigJson = {
|
||||
type ExtensionPackageBoundaryTsConfigJson = {
|
||||
extends?: unknown;
|
||||
compilerOptions?: {
|
||||
rootDir?: unknown;
|
||||
@@ -114,7 +111,7 @@ export type ExtensionPackageBoundaryTsConfigJson = {
|
||||
exclude?: unknown;
|
||||
};
|
||||
|
||||
export type ExtensionPackageBoundaryPackageJson = {
|
||||
type ExtensionPackageBoundaryPackageJson = {
|
||||
devDependencies?: Record<string, string>;
|
||||
};
|
||||
|
||||
@@ -123,21 +120,18 @@ function readJsonFile<T>(filePath: string): T {
|
||||
return JSON.parse(readFileSync(filePath, "utf8")) as T;
|
||||
}
|
||||
|
||||
export function collectBundledExtensionIds(rootDir = resolve(".")): string[] {
|
||||
function collectBundledExtensionIds(rootDir = resolve(".")): string[] {
|
||||
return readdirSync(join(rootDir, "extensions"), { withFileTypes: true })
|
||||
.filter((entry) => entry.isDirectory())
|
||||
.map((entry) => entry.name)
|
||||
.toSorted();
|
||||
}
|
||||
|
||||
export function resolveExtensionTsconfigPath(extensionId: string, rootDir = resolve(".")): string {
|
||||
function resolveExtensionTsconfigPath(extensionId: string, rootDir = resolve(".")): string {
|
||||
return join(rootDir, "extensions", extensionId, "tsconfig.json");
|
||||
}
|
||||
|
||||
export function resolveExtensionPackageJsonPath(
|
||||
extensionId: string,
|
||||
rootDir = resolve("."),
|
||||
): string {
|
||||
function resolveExtensionPackageJsonPath(extensionId: string, rootDir = resolve(".")): string {
|
||||
return join(rootDir, "extensions", extensionId, "package.json");
|
||||
}
|
||||
|
||||
@@ -178,29 +172,3 @@ export function collectOptInExtensionPackageBoundaries(rootDir = resolve(".")):
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
export function renderExtensionPackageBoundaryTsconfig(params?: {
|
||||
paths?: Record<string, readonly string[]>;
|
||||
}): {
|
||||
extends: "../tsconfig.package-boundary.base.json";
|
||||
compilerOptions: { rootDir: "."; paths?: Record<string, readonly string[]> };
|
||||
include: typeof EXTENSION_PACKAGE_BOUNDARY_INCLUDE;
|
||||
exclude: typeof EXTENSION_PACKAGE_BOUNDARY_EXCLUDE;
|
||||
} {
|
||||
return {
|
||||
extends: "../tsconfig.package-boundary.base.json",
|
||||
compilerOptions: {
|
||||
rootDir: ".",
|
||||
...(params?.paths
|
||||
? {
|
||||
paths: {
|
||||
...EXTENSION_PACKAGE_BOUNDARY_BASE_PATHS,
|
||||
...params.paths,
|
||||
},
|
||||
}
|
||||
: {}),
|
||||
},
|
||||
include: EXTENSION_PACKAGE_BOUNDARY_INCLUDE,
|
||||
exclude: EXTENSION_PACKAGE_BOUNDARY_EXCLUDE,
|
||||
};
|
||||
}
|
||||
|
||||
@@ -7,30 +7,17 @@ import {
|
||||
collectChangedExtensionIdsFromPaths,
|
||||
collectPublishablePluginPackageErrors,
|
||||
parsePluginReleaseArgs,
|
||||
parsePluginReleaseSelection,
|
||||
parsePluginReleaseSelectionMode,
|
||||
resolvePublishablePluginVersion,
|
||||
resolveGitCommitSha,
|
||||
resolveChangedPublishablePluginPackages,
|
||||
resolveSelectedPublishablePluginPackages,
|
||||
type GitRangeSelection,
|
||||
type ParsedPluginReleaseArgs,
|
||||
type PluginReleaseSelectionMode,
|
||||
} from "./plugin-npm-release.ts";
|
||||
|
||||
export {
|
||||
collectChangedExtensionIdsFromPaths,
|
||||
parsePluginReleaseArgs,
|
||||
parsePluginReleaseSelection,
|
||||
parsePluginReleaseSelectionMode,
|
||||
resolveChangedPublishablePluginPackages,
|
||||
resolveSelectedPublishablePluginPackages,
|
||||
type GitRangeSelection,
|
||||
type ParsedPluginReleaseArgs,
|
||||
type PluginReleaseSelectionMode,
|
||||
};
|
||||
export { parsePluginReleaseArgs };
|
||||
|
||||
export type PluginPackageJson = {
|
||||
type PluginPackageJson = {
|
||||
name?: string;
|
||||
version?: string;
|
||||
private?: boolean;
|
||||
@@ -63,17 +50,17 @@ export type PublishablePluginPackage = {
|
||||
publishTag: "latest" | "beta";
|
||||
};
|
||||
|
||||
export type PluginReleasePlanItem = PublishablePluginPackage & {
|
||||
type PluginReleasePlanItem = PublishablePluginPackage & {
|
||||
alreadyPublished: boolean;
|
||||
};
|
||||
|
||||
export type PluginReleasePlan = {
|
||||
type PluginReleasePlan = {
|
||||
all: PluginReleasePlanItem[];
|
||||
candidates: PluginReleasePlanItem[];
|
||||
skippedPublished: PluginReleasePlanItem[];
|
||||
};
|
||||
|
||||
export type ClawHubPublishablePluginPackageFilters = {
|
||||
type ClawHubPublishablePluginPackageFilters = {
|
||||
extensionIds?: readonly string[];
|
||||
packageNames?: readonly string[];
|
||||
};
|
||||
|
||||
@@ -383,7 +383,6 @@ function collectGatewayCpuObservations(params) {
|
||||
}
|
||||
|
||||
export {
|
||||
collectCommandAliasRecords,
|
||||
collectQaBaselineRegressionObservations,
|
||||
collectGatewayCpuObservations,
|
||||
collectMetricObservations,
|
||||
|
||||
Reference in New Issue
Block a user