mirror of
https://github.com/openclaw/openclaw.git
synced 2026-08-25 03:45:46 -06:00
fix(build): include AI runtime in focused profiles
This commit is contained in:
@@ -308,6 +308,7 @@ export const BUILD_ALL_PROFILES: Record<string, string[]> = {
|
||||
],
|
||||
ciArtifacts: [
|
||||
"plugins:assets:build",
|
||||
"tsdown-ai",
|
||||
"tsdown",
|
||||
"external-plugins:local-dist",
|
||||
"check-cli-bootstrap-imports",
|
||||
@@ -322,6 +323,7 @@ export const BUILD_ALL_PROFILES: Record<string, string[]> = {
|
||||
"write-cli-startup-metadata",
|
||||
],
|
||||
gatewayWatch: [
|
||||
"tsdown-ai",
|
||||
"tsdown",
|
||||
"external-plugins:local-dist",
|
||||
"check-cli-bootstrap-imports",
|
||||
@@ -331,6 +333,7 @@ export const BUILD_ALL_PROFILES: Record<string, string[]> = {
|
||||
],
|
||||
qaRuntime: [
|
||||
"plugins:assets:build",
|
||||
"tsdown-ai",
|
||||
"tsdown",
|
||||
"external-plugins:local-dist",
|
||||
"check-cli-bootstrap-imports",
|
||||
@@ -341,6 +344,7 @@ export const BUILD_ALL_PROFILES: Record<string, string[]> = {
|
||||
],
|
||||
sourcePerformance: [
|
||||
"plugins:assets:build",
|
||||
"tsdown-ai",
|
||||
"tsdown",
|
||||
"external-plugins:local-dist",
|
||||
"check-cli-bootstrap-imports",
|
||||
@@ -352,6 +356,7 @@ export const BUILD_ALL_PROFILES: Record<string, string[]> = {
|
||||
"write-cli-startup-metadata",
|
||||
],
|
||||
cliStartup: [
|
||||
"tsdown-ai",
|
||||
"tsdown",
|
||||
"external-plugins:local-dist",
|
||||
"check-cli-bootstrap-imports",
|
||||
@@ -369,6 +374,9 @@ export const BUILD_ALL_PROFILE_STEP_ENV: Record<string, Record<string, NodeJS.Pr
|
||||
},
|
||||
},
|
||||
ciArtifacts: {
|
||||
"tsdown-ai": {
|
||||
OPENCLAW_RUN_NODE_SKIP_DTS_BUILD: "1",
|
||||
},
|
||||
tsdown: {
|
||||
// Global declaration emission is ~95% of the tsdown wall clock and PR
|
||||
// CI's dist consumers are runtime JS only; the plugin-sdk gate below
|
||||
@@ -382,6 +390,9 @@ export const BUILD_ALL_PROFILE_STEP_ENV: Record<string, Record<string, NodeJS.Pr
|
||||
},
|
||||
},
|
||||
gatewayWatch: {
|
||||
"tsdown-ai": {
|
||||
OPENCLAW_RUN_NODE_SKIP_DTS_BUILD: "1",
|
||||
},
|
||||
tsdown: {
|
||||
OPENCLAW_RUN_NODE_SKIP_DTS_BUILD: "1",
|
||||
},
|
||||
@@ -390,17 +401,26 @@ export const BUILD_ALL_PROFILE_STEP_ENV: Record<string, Record<string, NodeJS.Pr
|
||||
},
|
||||
},
|
||||
qaRuntime: {
|
||||
"tsdown-ai": {
|
||||
OPENCLAW_RUN_NODE_SKIP_DTS_BUILD: "1",
|
||||
},
|
||||
tsdown: {
|
||||
OPENCLAW_RUN_NODE_SKIP_DTS_BUILD: "1",
|
||||
},
|
||||
},
|
||||
sourcePerformance: {
|
||||
"tsdown-ai": {
|
||||
OPENCLAW_RUN_NODE_SKIP_DTS_BUILD: "1",
|
||||
},
|
||||
tsdown: {
|
||||
OPENCLAW_RUN_NODE_SKIP_DTS_BUILD: "1",
|
||||
OPENCLAW_PRESERVE_CLI_STARTUP_METADATA: "1",
|
||||
},
|
||||
},
|
||||
cliStartup: {
|
||||
"tsdown-ai": {
|
||||
OPENCLAW_RUN_NODE_SKIP_DTS_BUILD: "1",
|
||||
},
|
||||
tsdown: {
|
||||
OPENCLAW_RUN_NODE_SKIP_DTS_BUILD: "1",
|
||||
OPENCLAW_PRESERVE_CLI_STARTUP_METADATA: "1",
|
||||
|
||||
@@ -433,6 +433,7 @@ describe("resolveBuildAllSteps", () => {
|
||||
it("uses a runtime artifact plus plugin SDK export profile for ci artifacts", () => {
|
||||
expect(resolveBuildAllSteps("ciArtifacts").map((step) => step.label)).toEqual([
|
||||
"plugins:assets:build",
|
||||
"tsdown-ai",
|
||||
"tsdown",
|
||||
"external-plugins:local-dist",
|
||||
"check-cli-bootstrap-imports",
|
||||
@@ -450,15 +451,20 @@ describe("resolveBuildAllSteps", () => {
|
||||
|
||||
it("skips bundled tsdown declarations for runtime-only profiles", () => {
|
||||
for (const profile of [
|
||||
"ciArtifacts",
|
||||
"gatewayWatch",
|
||||
"qaRuntime",
|
||||
"sourcePerformance",
|
||||
"cliStartup",
|
||||
] as const) {
|
||||
const tsdown = resolveBuildAllSteps(profile).find((step) => step.label === "tsdown");
|
||||
const tsdownAi = resolveBuildAllSteps(profile).find((step) => step.label === "tsdown-ai");
|
||||
if (!tsdown) {
|
||||
throw new Error(`Missing ${profile} tsdown step`);
|
||||
}
|
||||
if (!tsdownAi) {
|
||||
throw new Error(`Missing ${profile} tsdown-ai step`);
|
||||
}
|
||||
|
||||
expect(
|
||||
expectDefined(BUILD_ALL_PROFILE_STEP_ENV[profile], `${profile} build step env`).tsdown,
|
||||
@@ -470,6 +476,12 @@ describe("resolveBuildAllSteps", () => {
|
||||
).toMatchObject({
|
||||
OPENCLAW_RUN_NODE_SKIP_DTS_BUILD: "1",
|
||||
});
|
||||
expect(
|
||||
resolveBuildAllStep(tsdownAi, { env: { OPENCLAW_RUN_NODE_SKIP_DTS_BUILD: "0" } }).options
|
||||
.env,
|
||||
).toMatchObject({
|
||||
OPENCLAW_RUN_NODE_SKIP_DTS_BUILD: "1",
|
||||
});
|
||||
}
|
||||
});
|
||||
|
||||
@@ -565,6 +577,7 @@ describe("resolveBuildAllSteps", () => {
|
||||
|
||||
it("uses a minimal built runtime profile for gateway watch regression", () => {
|
||||
expect(resolveBuildAllSteps("gatewayWatch").map((step) => step.label)).toEqual([
|
||||
"tsdown-ai",
|
||||
"tsdown",
|
||||
"external-plugins:local-dist",
|
||||
"check-cli-bootstrap-imports",
|
||||
@@ -577,6 +590,7 @@ describe("resolveBuildAllSteps", () => {
|
||||
it("uses a QA runtime profile with generated plugin assets but no startup metadata", () => {
|
||||
expect(resolveBuildAllSteps("qaRuntime").map((step) => step.label)).toEqual([
|
||||
"plugins:assets:build",
|
||||
"tsdown-ai",
|
||||
"tsdown",
|
||||
"external-plugins:local-dist",
|
||||
"check-cli-bootstrap-imports",
|
||||
@@ -590,6 +604,7 @@ describe("resolveBuildAllSteps", () => {
|
||||
it("uses a source performance profile with QA assets and immutable build provenance", () => {
|
||||
expect(resolveBuildAllSteps("sourcePerformance").map((step) => step.label)).toEqual([
|
||||
"plugins:assets:build",
|
||||
"tsdown-ai",
|
||||
"tsdown",
|
||||
"external-plugins:local-dist",
|
||||
"check-cli-bootstrap-imports",
|
||||
@@ -604,6 +619,7 @@ describe("resolveBuildAllSteps", () => {
|
||||
|
||||
it("uses a CLI startup profile without generated plugin assets", () => {
|
||||
expect(resolveBuildAllSteps("cliStartup").map((step) => step.label)).toEqual([
|
||||
"tsdown-ai",
|
||||
"tsdown",
|
||||
"external-plugins:local-dist",
|
||||
"check-cli-bootstrap-imports",
|
||||
|
||||
Reference in New Issue
Block a user