mirror of
https://github.com/openclaw/openclaw.git
synced 2026-05-06 16:01:01 +00:00
refactor: hide optional bundle helpers
This commit is contained in:
@@ -1,10 +1,4 @@
|
||||
export const optionalBundledClusters: string[];
|
||||
export const optionalBundledClusterSet: Set<string>;
|
||||
export const OPTIONAL_BUNDLED_BUILD_ENV: "OPENCLAW_INCLUDE_OPTIONAL_BUNDLED";
|
||||
export function isOptionalBundledCluster(cluster: string): boolean;
|
||||
export function shouldIncludeOptionalBundledClusters(env?: NodeJS.ProcessEnv): boolean;
|
||||
export function hasReleasedBundledInstall(packageJson: unknown): boolean;
|
||||
export function isExplicitlyDownloadablePlugin(packageJson: unknown): boolean;
|
||||
export function shouldBuildBundledCluster(
|
||||
cluster: string,
|
||||
env?: NodeJS.ProcessEnv,
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
export const optionalBundledClusters = [
|
||||
const optionalBundledClusters = [
|
||||
"acpx",
|
||||
"diagnostics-otel",
|
||||
"diffs",
|
||||
@@ -16,26 +16,26 @@ export const optionalBundledClusters = [
|
||||
|
||||
export const optionalBundledClusterSet = new Set(optionalBundledClusters);
|
||||
|
||||
export const OPTIONAL_BUNDLED_BUILD_ENV = "OPENCLAW_INCLUDE_OPTIONAL_BUNDLED";
|
||||
const OPTIONAL_BUNDLED_BUILD_ENV = "OPENCLAW_INCLUDE_OPTIONAL_BUNDLED";
|
||||
|
||||
export function isOptionalBundledCluster(cluster) {
|
||||
function isOptionalBundledCluster(cluster) {
|
||||
return optionalBundledClusterSet.has(cluster);
|
||||
}
|
||||
|
||||
export function shouldIncludeOptionalBundledClusters(env = process.env) {
|
||||
function shouldIncludeOptionalBundledClusters(env = process.env) {
|
||||
// Release artifacts should preserve the last shipped upgrade surface by
|
||||
// default. Specific size-sensitive lanes can still opt out explicitly.
|
||||
return env[OPTIONAL_BUNDLED_BUILD_ENV] !== "0";
|
||||
}
|
||||
|
||||
export function hasReleasedBundledInstall(packageJson) {
|
||||
function hasReleasedBundledInstall(packageJson) {
|
||||
return (
|
||||
typeof packageJson?.openclaw?.install?.npmSpec === "string" &&
|
||||
packageJson.openclaw.install.npmSpec.trim().length > 0
|
||||
);
|
||||
}
|
||||
|
||||
export function isExplicitlyDownloadablePlugin(packageJson) {
|
||||
function isExplicitlyDownloadablePlugin(packageJson) {
|
||||
return packageJson?.openclaw?.bundle?.includeInCore === false;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user