@@ -31,7 +31,8 @@ import {
3131 OPENCLAW_PLUGIN_NPM_REPOSITORY_URL ,
3232} from "../scripts/lib/plugin-npm-release.ts" ;
3333import { runPluginClawHubReleaseCheck } from "../scripts/plugin-clawhub-release-check.ts" ;
34- import { cleanupTempDirs , makeTempRepoRoot } from "./helpers/temp-repo.js" ;
34+ import { writePublishablePluginFixture } from "./helpers/publishable-plugin-fixture.js" ;
35+ import { cleanupTempDirs , makeTempRepoRoot , writeJsonFile } from "./helpers/temp-repo.js" ;
3536
3637const tempDirs : string [ ] = [ ] ;
3738
@@ -2109,59 +2110,31 @@ function createTempPluginRepo(
21092110 ) ;
21102111 writeFileSync ( join ( repoDir , "pnpm-lock.yaml" ) , "lockfileVersion: '9.0'\n" ) ;
21112112 for ( const currentExtensionId of extensionIds ) {
2112- mkdirSync ( join ( repoDir , "extensions" , currentExtensionId ) , { recursive : true } ) ;
2113- writeFileSync (
2114- join ( repoDir , "extensions" , currentExtensionId , "package.json" ) ,
2115- JSON . stringify (
2116- {
2117- name : `@openclaw/${ currentExtensionId } ` ,
2118- version : "2026.4.1" ,
2119- type : "module" ,
2120- repository : {
2121- type : "git" ,
2122- url : OPENCLAW_PLUGIN_NPM_REPOSITORY_URL ,
2123- } ,
2124- ...( options . requiredLatestDependencyVersion
2125- ? {
2126- dependencies : {
2127- "demo-runtime" : options . requiredLatestDependencyVersion ,
2128- } ,
2129- }
2130- : { } ) ,
2131- openclaw : {
2132- extensions : [ "./index.ts" ] ,
2133- ...( options . includeClawHubContract === false
2134- ? { }
2135- : {
2136- compat : {
2137- pluginApi : ">=2026.4.1" ,
2138- } ,
2139- build : {
2140- openclawVersion : "2026.4.1" ,
2141- } ,
2142- } ) ,
2143- install : {
2144- npmSpec : `@openclaw/${ currentExtensionId } ` ,
2145- } ,
2146- release : {
2147- publishToClawHub : options . publishToClawHub ?? true ,
2148- ...( options . requiredLatestDependencyVersion
2149- ? {
2150- requireLatestDependencies : [ "demo-runtime" ] ,
2151- }
2152- : { } ) ,
2113+ const fixture = writePublishablePluginFixture ( repoDir , {
2114+ extensionId : currentExtensionId ,
2115+ version : "2026.4.1" ,
2116+ publishTo : options . publishToClawHub === false ? "clawhub-disabled" : "clawhub" ,
2117+ ...( options . requiredLatestDependencyVersion
2118+ ? {
2119+ dependency : {
2120+ packageName : "demo-runtime" ,
2121+ version : options . requiredLatestDependencyVersion ,
2122+ requireLatest : true ,
21532123 } ,
2154- } ,
2155- } ,
2156- null ,
2157- 2 ,
2158- ) ,
2159- ) ;
2160- writeFileSync (
2161- join ( repoDir , "extensions" , currentExtensionId , "index.ts" ) ,
2162- `export const ${ currentExtensionId . replaceAll ( / [ - . ] / g, "_" ) } = 1;\n` ,
2163- ) ;
2164- writeFileSync ( join ( repoDir , "extensions" , currentExtensionId , "README.md" ) , "# Demo plugin\n" ) ;
2124+ }
2125+ : { } ) ,
2126+ } ) ;
2127+ if ( options . includeClawHubContract === false ) {
2128+ const manifestPath = join ( fixture . packageDir , "package.json" ) ;
2129+ const manifest = JSON . parse ( readFileSync ( manifestPath , "utf8" ) ) as {
2130+ openclaw ?: { build ?: unknown ; compat ?: unknown } ;
2131+ } ;
2132+ if ( manifest . openclaw ) {
2133+ delete manifest . openclaw . compat ;
2134+ delete manifest . openclaw . build ;
2135+ }
2136+ writeJsonFile ( manifestPath , manifest ) ;
2137+ }
21652138 }
21662139
21672140 git ( repoDir , [ "init" , "-b" , "main" ] ) ;
0 commit comments