Plugin: add build step so compiled dist/ is included in published package#114
Conversation
…kage Problem: The plugin install validation requires compiled JavaScript output when extensions[] points to a TypeScript entry. The v0.7.0-beta.1 release had no build step in the publish workflow, so dist/index.js was absent from the npm tarball, causing install to fail with: 'package install requires compiled runtime output for TypeScript entry ./index.ts: expected ./dist/index.js, ./dist/index.mjs, ./dist/index.cjs...' Fix: - Add 'build: tsc -p tsconfig.build.json' and 'prepublishOnly: pnpm run build' to package.json scripts so 'pnpm build' and 'pnpm prepublishOnly' both work - Add tsconfig.build.json (gitignored, shipped via .npmignore) - Add 'Build' step to publish.yml after pack:smoke (before npm auth) - Update .gitignore and .npmignore to exclude/include tsconfig.build.json and dist/ appropriately - Update pack-smoke to verify dist/index.js exists in the published tarball Fixes pwrdrvr#113
|
I think I'll have something better for you this weekend. |
Perfect! Looking forward to it. Love this plugin btw. I couldn't ever get the /codex bind command to allow me to pick up where I left off in codex cli sessions. |
Thank you for your contribution! The new project is live: https://github.com/pwrdrvr/PwrAgent That gives you a Codex Desktop replacement app (uses Codex) but also integrates with messaging with openclaw-codex-app-server-like functionality. But I gotta say, the messaging integration is awesome... way better than I had it in this initial plugin. Please give it a try! |
Best wishes on your new app! I migrated over to the chatgpt official app now that it has codex support over ssh connection. |
Problem
The plugin install validation requires compiled JavaScript output when
extensions[]points to a TypeScript entry. The v0.7.0-beta.1 release had no build step in the publish workflow, sodist/index.jswas absent from the npm tarball, causing install to fail with:The install also fails with
package.json missing openclaw.hooksbecause the hook-pack validation runs on the tarball before the plugin registration (this is a separate but related issue — the plugin usesopenclaw.extensions, notopenclaw.hooks).Fix
build: tsc -p tsconfig.build.jsonandprepublishOnly: pnpm run buildso both local builds and prepublish hook work.index.ts+src/*.ts→dist/.tsconfig.build.jsonanddist/appropriately (gitignore excludes, npmignore ships it for npm pack).Buildstep afterpack:smoke(before npm auth), runspnpm buildsodist/is included in the published tarball.dist/index.jsexists in the published package.Testing
pnpm buildproducesdist/index.jsanddist/src/*.js(23 compiled files)pnpm packproduces a tarball containingpackage/dist/index.jspack:smokepasses with the newdist/index.jscheckRelated
Fixes #113