Skip to content

Conversation

@buremba
Copy link
Member

@buremba buremba commented Oct 26, 2025

Summary

  • Add environment: production to the release-please workflow job
  • This allows the workflow to access the NPM_TOKEN secret stored in the production environment
  • Fixes npm package publishing which was failing due to missing token

Context

The NPM_TOKEN is stored in the production environment secrets, but the release-please workflow wasn't configured to use that environment. This prevented npm packages (create-peerbot and @peerbot/worker) from being published when releases were created.

Test Plan

  • Merge this PR
  • Merge the pending release PR chore(main): release 2.0.0 #80 (v2.0.0)
  • Verify that npm packages are published successfully
  • Check that npm view create-peerbot and npm view @peerbot/worker return the published packages

🤖 Generated with Claude Code

buremba and others added 2 commits October 26, 2025 19:46
- Rename @peerbot/cli to create-peerbot package
- Update binary from peerbot to create-peerbot
- Update all documentation to use npm create peerbot
- Update GitHub Actions to publish create-peerbot
- Supports both npm create peerbot and npx create-peerbot
…blishing

The NPM_TOKEN is stored in the production environment secrets, but the
release-please workflow wasn't configured to use that environment. This
prevented npm packages from being published when releases were created.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
Copy link

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment on lines 461 to 483
// Create .env file
await renderTemplate(".env.tmpl", variables, join(cwd, ".env"));

// Append MCP environment variables if any were selected
if (answers.selectedMcpServers.length > 0) {
const requiredEnvVars = getRequiredEnvVars(answers.selectedMcpServers);
if (requiredEnvVars.length > 0) {
let mcpEnvContent = "\n# MCP Server Credentials\n";
mcpEnvContent +=
"# Add your OAuth client secrets and API keys below:\n";

for (const varName of requiredEnvVars) {
mcpEnvContent += `# ${varName}=your_${varName.toLowerCase()}_here\n`;
}

const envPath = join(cwd, ".env");
const currentContent = await readFile(envPath, "utf-8");
await writeFile(envPath, currentContent + mcpEnvContent);
}
}

// Create .gitignore
await renderTemplate(".gitignore.tmpl", {}, join(cwd, ".gitignore"));

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge Restore missing templates required by init command

The new initCommand renders .env.tmpl and .gitignore.tmpl via renderTemplate, but the templates directory now only contains Dockerfile and README templates. At runtime this call will throw an ENOENT before any files are created, causing create-peerbot to fail immediately for every user. Either add these template files back or stop referencing them.

Useful? React with 👍 / 👎.

Comment on lines 1 to 9
{
"name": "@peerbot/cli",
"name": "create-peerbot",
"version": "0.1.0",
"description": "CLI for deploying and managing Peerbot across multiple platforms",
"type": "module",
"main": "dist/index.js",
"bin": {
"peerbot": "./bin/peerbot.js"
"create-peerbot": "./bin/create-peerbot.js"
},

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge Provide an actual CLI executable for the published package

The package metadata still advertises a binary at ./bin/create-peerbot.js, but the repository no longer contains a bin directory or that file. After publishing, npx create-peerbot will fail with a "file not found" error because Node cannot locate the executable. Point the bin entry at a real built file (e.g. dist/index.js) or reintroduce the missing script before publishing.

Useful? React with 👍 / 👎.

@claude
Copy link
Contributor

claude bot commented Oct 26, 2025

Claude finished @buremba's task —— View job


PR Review Analysis

I'll provide a comprehensive review of this PR that adds production environment configuration for npm publishing.

Todo List:

  • Read and analyze changed files
  • Review workflow configuration changes
  • Assess security implications
  • Validate Codex feedback about missing templates/CLI
  • Check package renaming consistency
  • Provide final review feedback

Summary

Primary Issue: This PR correctly adds environment: production to access NPM_TOKEN, but two critical regression bugs from the previous refactor (commit bac16cf) will prevent successful publishing and break user experience.


🚨 Critical Issues (Must Fix Before Merge)

1. Missing CLI Executable (P1)

  • Issue: packages/cli/package.json:8 declares "bin": {"create-peerbot": "./bin/create-peerbot.js"} but /bin/create-peerbot.js doesn't exist
  • Impact: npx create-peerbot fails with "file not found" after publishing
  • Root Cause: Renamed from peerbot to create-peerbot in bac16cf but never created the new bin file
  • Fix: Either create /bin/create-peerbot.js or update package.json bin to point to "dist/index.js"

2. Missing Template Files (P1)

  • Issue: init.ts:462,483 calls renderTemplate(".env.tmpl") and renderTemplate(".gitignore.tmpl") but these files were deleted in commit bac16cf
  • Impact: create-peerbot init crashes immediately with ENOENT errors for all users
  • Root Cause: Templates package.json.tmpl, peerbot.config.js.tmpl, .gitignore.tmpl were removed but code still references them
  • Evidence: ✅ .gitignore.tmpl existed before bac16cf, ❌ missing after
  • Fix: Restore missing template files or update init.ts to not reference them

✅ What Works Well

Workflow Security & Configuration

  • Correct Fix: Adding environment: production properly grants access to NPM_TOKEN
  • Security: No credential exposure, proper use of GitHub environments
  • Process: Conditional publishing only on release creation is appropriate

Package Renaming Consistency

  • Package name correctly changed from @peerbot/clicreate-peerbot
  • Supports both npm create peerbot and npx create-peerbot conventions
  • Build script properly copies templates to dist/

🔍 Additional Observations

Build Process

  • Enhanced build script copies templates from src/templates/ to dist/templates/
  • TypeScript compilation to dist/ works correctly ✅

Template Architecture Change

The refactor simplified from complex config-driven templates to simple Docker Compose approach:

  • Removed: package.json.tmpl, peerbot.config.js.tmpl (advanced config)
  • Kept: Dockerfile.worker*.tmpl, README.md.tmpl
  • Missing: .env.tmpl still referenced in code ❌

🛠️ Recommended Actions

Block Merge Until Fixed:

  1. Fix CLI executable: Create /bin/create-peerbot.js or update package.json bin path
  2. Fix missing templates: Either restore .env.tmpl/.gitignore.tmpl or update init.ts logic

After Fixes:

Security: No concerns - environment approach is secure and follows best practices.

@buremba buremba merged commit 1cd6121 into main Oct 26, 2025
5 of 9 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