@@ -108,17 +108,17 @@ describe("runtime postbuild static assets", () => {
108108 "dist/extensions/acpx/mcp-command-line.mjs" ,
109109 "dist/extensions/acpx/mcp-proxy.mjs" ,
110110 "dist/extensions/crabbox/assets/openclaw-worker-wallpaper.png" ,
111- "dist/extensions/diffs-language-pack/assets/viewer-runtime.js" ,
112- "dist/extensions/diffs/assets/viewer-runtime.js" ,
113111 "dist/extensions/discord/assets/embedded-app-sdk.mjs" ,
114112 "dist/extensions/onepassword/onepassword-op-path.js" ,
115113 "dist/extensions/onepassword/onepassword-secret-id.js" ,
116114 "dist/extensions/onepassword/onepassword-secret-ref-resolver.js" ,
117115 "dist/extensions/vault/vault-secret-id.js" ,
118116 "dist/extensions/vault/vault-secret-ref-resolver.js" ,
119117 ] ) ;
120- expect ( payload . sources ) . toContain ( "extensions/diffs-language-pack/assets/viewer-runtime.js" ) ;
121- expect ( payload . sources ) . toContain ( "extensions/diffs/assets/viewer-runtime.js" ) ;
118+ expect ( payload . sources ) . not . toContain (
119+ "extensions/diffs-language-pack/assets/viewer-runtime.js" ,
120+ ) ;
121+ expect ( payload . sources ) . not . toContain ( "extensions/diffs/assets/viewer-runtime.js" ) ;
122122 expect ( payload . sources ) . toContain ( "extensions/discord/assets/embedded-app-sdk.mjs" ) ;
123123 expect ( payload . sources ) . toContain ( "extensions/crabbox/assets/openclaw-worker-wallpaper.png" ) ;
124124 } ) ;
@@ -177,7 +177,15 @@ describe("runtime postbuild static assets", () => {
177177 expect ( discoverStaticExtensionAssets ( { rootDir } ) ) . toEqual ( [ ] ) ;
178178 } ) ;
179179
180- it ( "excludes external plugin (bundledDist: false) static assets by default" , async ( ) => {
180+ it . each ( [
181+ { name : "normal root build" , params : { } , included : false } ,
182+ { name : "isolated external build" , params : { includeExternalPlugins : true } , included : true } ,
183+ {
184+ name : "Docker-selected build" ,
185+ params : { env : { OPENCLAW_INTERNAL_DOCKER_BUILD_PLUGIN_IDS : "external-demo" } } ,
186+ included : true ,
187+ } ,
188+ ] ) ( "$name handles external plugin assets" , async ( { params, included } ) => {
181189 const rootDir = createTempDir ( "openclaw-runtime-postbuild-" ) ;
182190 const packageDir = path . join ( rootDir , "extensions" , "external-demo" ) ;
183191 await fs . mkdir ( packageDir , { recursive : true } ) ;
@@ -200,39 +208,17 @@ describe("runtime postbuild static assets", () => {
200208 "utf8" ,
201209 ) ;
202210
203- expect ( discoverStaticExtensionAssets ( { rootDir } ) ) . toEqual ( [ ] ) ;
204- } ) ;
205-
206- it ( "includes external plugin (bundledDist: false) static assets when includeExternalPlugins is true" , async ( ) => {
207- const rootDir = createTempDir ( "openclaw-runtime-postbuild-" ) ;
208- const packageDir = path . join ( rootDir , "extensions" , "external-demo" ) ;
209- await fs . mkdir ( packageDir , { recursive : true } ) ;
210- await fs . writeFile (
211- path . join ( packageDir , "package.json" ) ,
212- JSON . stringify ( {
213- name : "@openclaw/external-demo" ,
214- openclaw : {
215- build : {
216- bundledDist : false ,
217- staticAssets : [
218- {
219- source : "./assets/runtime.js" ,
220- output : "assets/runtime.js" ,
221- } ,
222- ] ,
223- } ,
224- } ,
225- } ) ,
226- "utf8" ,
211+ expect ( discoverStaticExtensionAssets ( { rootDir, ...params } ) ) . toEqual (
212+ included
213+ ? [
214+ {
215+ pluginDir : "external-demo" ,
216+ src : "extensions/external-demo/assets/runtime.js" ,
217+ dest : "dist/extensions/external-demo/assets/runtime.js" ,
218+ } ,
219+ ]
220+ : [ ] ,
227221 ) ;
228-
229- expect ( discoverStaticExtensionAssets ( { rootDir, includeExternalPlugins : true } ) ) . toEqual ( [
230- {
231- pluginDir : "external-demo" ,
232- src : "extensions/external-demo/assets/runtime.js" ,
233- dest : "dist/extensions/external-demo/assets/runtime.js" ,
234- } ,
235- ] ) ;
236222 } ) ;
237223
238224 it ( "copies declared static assets into root and package dist" , async ( ) => {
0 commit comments