ci: fix Pages base path + add npm publish workflow#103
Conversation
Pages - Pages was 404'ing because the action couldn't auto-create the site (`enablement: false` is the default in actions/configure-pages@v5). Pass `enablement: true` so a fresh clone deploys without flipping the toggle in repo Settings. - Repo is naorsabag/openhop (lowercase) but the workflow was passing `VITE_BASE: /OpenHop/`. The Pages site URL is https://naorsabag.github.io/openhop/ — assets 404 if Vite builds with the wrong case. Updated the test + comment to match. Publish - New workflow that publishes @openhop/web and openhop on master push whenever either package.json version differs from what's already on the npm registry under the `beta` tag. Web ships first (CLI depends on it). NPM_TOKEN secret is set on the repo. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (1)
🚧 Files skipped from review as they are similar to previous changes (1)
WalkthroughThis PR normalizes the GitHub Pages base path to lowercase ( ChangesPages Base Path Normalization
NPM Publishing Workflow
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes Possibly related PRs
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Comment |
|
You are seeing this message because GitHub Code Scanning has recently been set up for this repository, or this pull request contains the workflow file for the Code Scanning tool. What Enabling Code Scanning Means:
For more information about GitHub Code Scanning, check out the documentation. |
There was a problem hiding this comment.
🧹 Nitpick comments (1)
.github/workflows/publish.yml (1)
14-18: ⚡ Quick winNarrow the push path filters to version files only.
Lines 17-18 trigger publish runs for non-version changes, but publish eligibility is already version-driven. Restricting this trigger reduces unnecessary CI runs.
Proposed diff
push: branches: [master] paths: - 'packages/web/package.json' - 'packages/cli/package.json' - - 'packages/cli/src/index.ts' - - 'packages/server/package.json'🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In @.github/workflows/publish.yml around lines 14 - 18, Update the workflow's paths filter so the publish job only triggers on version file changes: remove the non-version entry 'packages/cli/src/index.ts' (and any other non-version paths) from the paths list and keep only the package manifest/version files such as 'packages/web/package.json', 'packages/cli/package.json', and 'packages/server/package.json' (or any canonical VERSION files you use); ensure the paths block contains only those version-related file paths so non-version changes no longer trigger publish.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Nitpick comments:
In @.github/workflows/publish.yml:
- Around line 14-18: Update the workflow's paths filter so the publish job only
triggers on version file changes: remove the non-version entry
'packages/cli/src/index.ts' (and any other non-version paths) from the paths
list and keep only the package manifest/version files such as
'packages/web/package.json', 'packages/cli/package.json', and
'packages/server/package.json' (or any canonical VERSION files you use); ensure
the paths block contains only those version-related file paths so non-version
changes no longer trigger publish.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro Plus
Run ID: 216eda55-12ac-46cd-be16-e9f2c4498332
📒 Files selected for processing (4)
.github/workflows/pages.yml.github/workflows/publish.ymlpackages/web/__tests__/share-url.test.tspackages/web/src/lib/share-url.ts
The bump in #102 only updated the package.json versions; the lockfile still pinned cli@0.1.0-beta.4 + @openhop/web@0.1.0-beta.2. That mismatch made `npm ci` rebuild the cli workspace, which fired its prepare script (`tsc --noEmit && esbuild ...`) — and tsc failed because @openhop/server hadn't been built yet at that step. CI on this PR caught it. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This reverts commit 708260e.
`prepare` was firing on every `npm ci` (and inconsistently — sometimes the workspace prepare order let it succeed, sometimes it ran before @openhop/server's dist existed and failed with TS2307). The build is only needed to produce the publishable tarball, so collapse it into prepack which fires automatically on `npm publish` (and during the publish workflow's tarball preparation). Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Pages
Publish
New workflow (`.github/workflows/publish.yml`) that publishes both packages to npm under the `beta` tag whenever the version in either `packages/web/package.json` or `packages/cli/package.json` differs from what's on the registry. Web publishes first (CLI depends on it). `NPM_TOKEN` secret is set on the repo.
Trigger: push to master (paths-filtered) + `workflow_dispatch` for manual runs.
Test plan
🤖 Generated with Claude Code
Summary by CodeRabbit
New Features
Chores
Tests