Skip to content

Plugin: add build step so compiled dist/ is included in published package#114

Closed
MatthewSchleder wants to merge 1 commit into
pwrdrvr:mainfrom
MatthewSchleder:fix/compiled-output-for-plugin-install
Closed

Plugin: add build step so compiled dist/ is included in published package#114
MatthewSchleder wants to merge 1 commit into
pwrdrvr:mainfrom
MatthewSchleder:fix/compiled-output-for-plugin-install

Conversation

@MatthewSchleder
Copy link
Copy Markdown

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, ./index.js, ./index.mjs, ./index.cjs

The install also fails with package.json missing openclaw.hooks because the hook-pack validation runs on the tarball before the plugin registration (this is a separate but related issue — the plugin uses openclaw.extensions, not openclaw.hooks).

Fix

  1. package.json: Add build: tsc -p tsconfig.build.json and prepublishOnly: pnpm run build so both local builds and prepublish hook work.
  2. tsconfig.build.json: New file (gitignored) that compiles index.ts + src/*.tsdist/.
  3. .gitignore / .npmignore: Include tsconfig.build.json and dist/ appropriately (gitignore excludes, npmignore ships it for npm pack).
  4. .github/workflows/publish.yml: Add Build step after pack:smoke (before npm auth), runs pnpm build so dist/ is included in the published tarball.
  5. scripts/pack-smoke.mjs: Verify dist/index.js exists in the published package.

Testing

  • pnpm build produces dist/index.js and dist/src/*.js (23 compiled files)
  • pnpm pack produces a tarball containing package/dist/index.js
  • pack:smoke passes with the new dist/index.js check

Related

Fixes #113

…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
@huntharo
Copy link
Copy Markdown
Contributor

huntharo commented May 8, 2026

I think I'll have something better for you this weekend.

@MatthewSchleder
Copy link
Copy Markdown
Author

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.

@huntharo
Copy link
Copy Markdown
Contributor

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!

@MatthewSchleder
Copy link
Copy Markdown
Author

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

v0.7.0-beta.1 install fails: missing compiled output (dist/)

2 participants