@@ -18,6 +18,10 @@ describe("package git fixture", () => {
1818 {
1919 dependencies : { "@openclaw/ai" : "2026.6.11" , chalk : "5.6.2" } ,
2020 bundleDependencies : [ "@openclaw/ai" , "chalk" ] ,
21+ scripts : {
22+ build : "node build.mjs" ,
23+ openclaw : "node scripts/run-node.mjs" ,
24+ } ,
2125 } ,
2226 null ,
2327 2 ,
@@ -48,6 +52,10 @@ describe("package git fixture", () => {
4852 const packageJson = JSON . parse ( readFileSync ( path . join ( root , "package.json" ) , "utf8" ) ) ;
4953 expect ( packageJson . dependencies [ "@openclaw/ai" ] ) . toBe ( "file:.openclaw-fixture/packages/ai" ) ;
5054 expect ( packageJson . bundleDependencies ) . toEqual ( [ "chalk" ] ) ;
55+ expect ( packageJson . scripts ) . toEqual ( {
56+ build : "node build.mjs" ,
57+ openclaw : "node openclaw.mjs" ,
58+ } ) ;
5159 const relocatedAiPackage = JSON . parse (
5260 readFileSync ( path . join ( root , ".openclaw-fixture" , "packages" , "ai" , "package.json" ) , "utf8" ) ,
5361 ) ;
@@ -79,4 +87,39 @@ describe("package git fixture", () => {
7987 expect ( staged . stdout ) . not . toContain ( "node_modules" ) ;
8088 expect ( staged . stdout ) . not . toContain ( "pnpm-lock.yaml" ) ;
8189 } ) ;
90+
91+ it ( "uses the packed entrypoint without a bundled ai runtime" , ( ) => {
92+ const root = tempDirs . make ( "openclaw-package-git-fixture-no-ai-" ) ;
93+ writeFileSync (
94+ path . join ( root , "package.json" ) ,
95+ `${ JSON . stringify (
96+ {
97+ dependencies : { chalk : "5.6.2" } ,
98+ scripts : {
99+ lint : "node lint.mjs" ,
100+ openclaw : "node scripts/run-node.mjs" ,
101+ } ,
102+ } ,
103+ null ,
104+ 2 ,
105+ ) } \n`,
106+ ) ;
107+
108+ const result = spawnSync (
109+ process . execPath ,
110+ [ "scripts/e2e/lib/package-git-fixture.mjs" , "prepare" , root ] ,
111+ { cwd : process . cwd ( ) , encoding : "utf8" } ,
112+ ) ;
113+
114+ expect ( result . status , `${ result . stdout } \n${ result . stderr } ` ) . toBe ( 0 ) ;
115+ const packageJson = JSON . parse ( readFileSync ( path . join ( root , "package.json" ) , "utf8" ) ) ;
116+ expect ( packageJson ) . toMatchObject ( {
117+ dependencies : { chalk : "5.6.2" } ,
118+ scripts : {
119+ lint : "node lint.mjs" ,
120+ openclaw : "node openclaw.mjs" ,
121+ } ,
122+ } ) ;
123+ expect ( packageJson . dependencies ) . not . toHaveProperty ( "@openclaw/ai" ) ;
124+ } ) ;
82125} ) ;
0 commit comments