Skip to content

chore: add prepack and publishConfig to all workspace packages#1309

Merged
isamu merged 1 commit into
mainfrom
chore/add-prepack-publishconfig
Apr 18, 2026
Merged

chore: add prepack and publishConfig to all workspace packages#1309
isamu merged 1 commit into
mainfrom
chore/add-prepack-publishconfig

Conversation

@isamu
Copy link
Copy Markdown
Contributor

@isamu isamu commented Apr 18, 2026

Summary

  • Adds "prepack": "yarn build" to every workspace package's scripts so that npm publish / yarn pack always regenerates lib/ before the tarball is assembled.
  • Adds top-level "publishConfig": { "access": "public" } to every workspace package so npm publish --access public is no longer required at the CLI for scoped packages.
  • Keeps lib/ as the build output (no migration to dist/).
  • Affects 33 package.json files across packages/, agents/, agent_filters/, and llm_agents/.
  • Adds plans/chore-prepack-publishconfig.md per the repo's bug-fix / feature-request workflow.

Items to Confirm / Review

  1. prepack semantics — the hook runs on both npm pack and npm publish, and also on yarn pack (verified locally with yarn pack --dry-run in packages/graphai). If the release process currently assumes a pre-built lib/, this change no-ops; if it assumed no build, the extra build is the intended fix.
  2. No private: true packages — every workspace package was treated as publishable. None were marked private, including packages/samples and llm_agents/playground whose build scripts are echo nothing. For those, prepack effectively does nothing, which is harmless.
  3. Non-scoped graphai packagepublishConfig.access: "public" is valid but technically redundant for the unscoped graphai package. Left in for uniformity; can be removed if preferred.
  4. Release docs in CLAUDE.mdnpm publish --access public still works; --access public is now redundant but not harmful. Docs not updated in this PR — flag if you'd like that follow-up.

User Prompt

npm の publish 時の設定、prepackyarn buildlib/ 生成 → publishConfiglib/ が参照される流れです。これを全てのパッケージで追加できる?

(当初は dist/ と書いてあったがコピペミスで、正しくは lib/

B案(lib/ のまま、prepackpublishConfig だけ追加する最小変更)で、ブランチを作って進めて。PRも作ってほしい。

Implementation

Per-file change (all 33 package.json files):

   "scripts": {
     …existing scripts…,
+    "prepack": "yarn build"
   },
   …
+  "publishConfig": {
+    "access": "public"
+  }

Applied mechanically via a one-shot Node script that parsed/serialized each package.json preserving existing key order (script deleted before commit).

Validation

  • yarn format — clean
  • yarn build — all 33 packages built successfully
  • yarn pack --dry-run in packages/graphai — confirms prepackyarn build runs before tarball creation
  • yarn eslint — one pre-existing error in the untracked file packages/agentdoc/tests/schema2doc.ts; unrelated to this PR (reproduces on main)

Test plan

  • CI passes on this PR
  • On next package release, confirm npm publish (or yarn npm publish) triggers yarn build automatically via prepack
  • Confirm publishConfig.access is honored by the registry (no --access public needed)

🤖 Generated with Claude Code

Why: guarantee a fresh lib/ build via prepack on every npm publish, and
standardize scoped-package publish access so --access public is no longer
required at the CLI.

- Adds "prepack": "yarn build" to every package's scripts
- Adds "publishConfig": { "access": "public" } to every package
- Keeps lib/ as the output directory (no migration to dist/)

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented Apr 18, 2026

Warning

Rate limit exceeded

@isamu has exceeded the limit for the number of commits that can be reviewed per hour. Please wait 36 minutes and 42 seconds before requesting another review.

Your organization is not enrolled in usage-based pricing. Contact your admin to enable usage-based pricing to continue reviews beyond the rate limit, or try again in 36 minutes and 42 seconds.

⌛ How to resolve this issue?

After the wait time has elapsed, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout.

Please see our FAQ for further information.

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 22456dec-5e26-4c3c-bdec-2f3fa2d31fd3

📥 Commits

Reviewing files that changed from the base of the PR and between e181366 and bfed3cc.

📒 Files selected for processing (34)
  • agent_filters/cache_agent_filter/package.json
  • agent_filters/http_client_agent_filter/package.json
  • agent_filters/namedinput_validator_agent_filter/package.json
  • agent_filters/step_runner_agent_filter/package.json
  • agent_filters/stream_agent_filter/package.json
  • agent_filters/utils/package.json
  • agents/agent_utils/package.json
  • agents/data_agents/package.json
  • agents/input_agents/package.json
  • agents/llm_agents/package.json
  • agents/service_agents/package.json
  • agents/sleeper_agents/package.json
  • agents/vanilla_agents/package.json
  • agents/vanilla_node_agents/package.json
  • llm_agents/anthropic_agent/package.json
  • llm_agents/gemini_agent/package.json
  • llm_agents/groq_agent/package.json
  • llm_agents/llm_utils/package.json
  • llm_agents/openai_agent/package.json
  • llm_agents/openai_fetch_agent/package.json
  • llm_agents/playground/package.json
  • llm_agents/replicate_agent/package.json
  • llm_agents/slashgpt_agent/package.json
  • llm_agents/token_bound_string_agent/package.json
  • llm_agents/tools_agent/package.json
  • packages/agent_filters/package.json
  • packages/agentdoc/package.json
  • packages/agents/package.json
  • packages/cli/package.json
  • packages/graphai/package.json
  • packages/lite/package.json
  • packages/samples/package.json
  • packages/test_utils/package.json
  • plans/chore-prepack-publishconfig.md
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch chore/add-prepack-publishconfig

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@isamu isamu merged commit cb15212 into main Apr 18, 2026
12 checks passed
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.

1 participant