refactor: fork publishing setup (package.json rename, .gitignore, CLAUDE.md)#2
refactor: fork publishing setup (package.json rename, .gitignore, CLAUDE.md)#2NeverMore93 merged 2 commits intomainfrom
Conversation
…lishing - Expand .gitignore to production standard (node_modules, dist, env, IDE, OS) - Replace repository-ownership CLAUDE.md with project-specific coding guidelines - Change package name from @opencode-ai/plugin-worktree to opencode-worktree - Add exports field, author, homepage, repository pointing to fork - Move dependencies to top-level (jsonc-parser, zod are runtime deps) - Add opencode-plugin and multi-repo keywords for discoverability
|
Warning Rate limit exceeded
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 5 minutes and 5 seconds. ⌛ How to resolve this issue?After the wait time has elapsed, a review can be triggered using the 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 configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: ⛔ Files ignored due to path filters (1)
📒 Files selected for processing (10)
✨ Finishing Touches🧪 Generate unit tests (beta)
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. Comment |
|
@coderabbitai review |
✅ Actions performedReview triggered.
|
There was a problem hiding this comment.
Code Review
This pull request initializes the project structure for the opencode-worktree plugin, including configuration for Git, NPM, TypeScript, and the tsup bundler, alongside behavioral guidelines in CLAUDE.md. The review identifies a mismatch between the build output path and the package.json entry point, suggests moving bundled dependencies to devDependencies, recommends explicitly declaring the Bun runtime requirement in the engines field, and notes a metadata artifact that should be removed from the documentation.
| import { defineConfig } from "tsup"; | ||
|
|
||
| export default defineConfig({ | ||
| entry: ["src/plugin/worktree.ts"], |
There was a problem hiding this comment.
The current entry configuration ["src/plugin/worktree.ts"] will cause tsup to output the bundle to dist/worktree.js. However, package.json expects the file at dist/plugin/worktree.js (see main and exports fields). To maintain the desired directory structure in the output and avoid breaking the package for consumers, use an object-based entry configuration.
| entry: ["src/plugin/worktree.ts"], | |
| entry: { "plugin/worktree": "src/plugin/worktree.ts" }, |
| "dependencies": { | ||
| "jsonc-parser": "^3.3.1", | ||
| "zod": "^3.24.0" | ||
| }, |
There was a problem hiding this comment.
| "devDependencies": { | ||
| "@opencode-ai/plugin": "^1.14.18", | ||
| "@opencode-ai/sdk": "^1.0.0", | ||
| "@types/bun": "^1.2.0", | ||
| "bumpp": "^10.4.1", | ||
| "tsup": "^8.5.1", | ||
| "typescript": "^5.5.0" | ||
| }, |
There was a problem hiding this comment.
Add jsonc-parser and zod to devDependencies since they are bundled at build time and not required as runtime dependencies by the consumer.
"devDependencies": {
"@opencode-ai/plugin": "^1.14.18",
"@opencode-ai/sdk": "^1.0.0",
"@types/bun": "^1.2.0",
"bumpp": "^10.4.1",
"jsonc-parser": "^3.3.1",
"tsup": "^8.5.1",
"typescript": "^5.5.0",
"zod": "^3.24.0"
},| "typescript": "^5.5.0" | ||
| }, | ||
| "engines": { | ||
| "node": ">=20.3.0" |
There was a problem hiding this comment.
|
|
||
| **These guidelines are working if:** fewer unnecessary changes in diffs, fewer rewrites due to overcomplication, and clarifying questions come before implementation rather than after mistakes. | ||
|
|
||
| (End of file - total 65 lines) No newline at end of file |
… engines - Use object-form entry in tsup.config.ts for explicit output path - Remove metadata artifact from CLAUDE.md footer - Add bun>=1.0.0 to engines field (plugin uses bun:sqlite API) - Keep jsonc-parser and zod in dependencies (bundled but listed for safety)
Summary
Prepare the fork for independent npm publishing by updating package metadata and project configuration.
Changes
@opencode-ai/plugin-worktreetoopencode-worktreeto avoid npm scope conflictexportsfield for ESM best practiceauthor,homepage,repositorypointing to forkjsonc-parser,zod) to top-leveldependenciesopencode-pluginandmulti-repokeywordsTest Plan
npm run build— verify tsup builds successfullynpm run typecheck— verify TypeScript compiles without errorsnpm publish --dry-run— verify package can be published (no scope conflict)Root Cause
The original
@opencode-ai/plugin-worktreename requires npm org membership to publish. Since this is a fork for independent publishing, we need a non-scoped or own-scope package name.