mirror of
https://github.com/moltbot/moltbot.git
synced 2026-05-13 15:47:28 +00:00
build: exclude private QA from npm package
This commit is contained in:
@@ -4,6 +4,7 @@ import { defineConfig, type UserConfig } from "tsdown";
|
||||
import {
|
||||
collectBundledPluginBuildEntries,
|
||||
listBundledPluginRuntimeDependencies,
|
||||
NON_PACKAGED_BUNDLED_PLUGIN_DIRS,
|
||||
} from "./scripts/lib/bundled-plugin-build-entries.mjs";
|
||||
import { buildPluginSdkEntrySources } from "./scripts/lib/plugin-sdk-entries.mjs";
|
||||
|
||||
@@ -92,6 +93,7 @@ function nodeBuildConfig(config: UserConfig): UserConfig {
|
||||
|
||||
const bundledPluginBuildEntries = collectBundledPluginBuildEntries();
|
||||
const bundledPluginRuntimeDependencies = listBundledPluginRuntimeDependencies();
|
||||
const shouldBuildPrivateQaEntries = process.env.OPENCLAW_BUILD_PRIVATE_QA === "1";
|
||||
|
||||
function buildBundledHookEntries(): Record<string, string> {
|
||||
const hooksRoot = path.join(process.cwd(), "src", "hooks", "bundled");
|
||||
@@ -235,7 +237,9 @@ const stagedBundledPluginBuildEntries = bundledPluginBuildEntries.filter(({ pack
|
||||
shouldStageBundledPluginRuntimeDependencies(packageJson),
|
||||
);
|
||||
const rootBundledPluginBuildEntries = bundledPluginBuildEntries.filter(
|
||||
({ packageJson }) => !shouldStageBundledPluginRuntimeDependencies(packageJson),
|
||||
({ id, packageJson }) =>
|
||||
!shouldStageBundledPluginRuntimeDependencies(packageJson) &&
|
||||
(shouldBuildPrivateQaEntries || !NON_PACKAGED_BUNDLED_PLUGIN_DIRS.has(id)),
|
||||
);
|
||||
|
||||
function buildUnifiedDistEntries(): Record<string, string> {
|
||||
@@ -249,6 +253,12 @@ function buildUnifiedDistEntries(): Record<string, string> {
|
||||
source,
|
||||
]),
|
||||
),
|
||||
...(shouldBuildPrivateQaEntries
|
||||
? {
|
||||
"plugin-sdk/qa-lab": "src/plugin-sdk/qa-lab.ts",
|
||||
"plugin-sdk/qa-runtime": "src/plugin-sdk/qa-runtime.ts",
|
||||
}
|
||||
: {}),
|
||||
...listBundledPluginEntrySources(rootBundledPluginBuildEntries),
|
||||
...bundledHookEntries,
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user