Skip to content

ci: fix Pages base path + add npm publish workflow#103

Merged
naorsabag merged 5 commits into
masterfrom
chore/ci-pages-and-publish
May 10, 2026
Merged

ci: fix Pages base path + add npm publish workflow#103
naorsabag merged 5 commits into
masterfrom
chore/ci-pages-and-publish

Conversation

@naorsabag
Copy link
Copy Markdown
Owner

@naorsabag naorsabag commented May 10, 2026

Pages

  • Was 404'ing on `actions/configure-pages@v5` because the site wasn't enabled. Pass `enablement: true` so the workflow auto-creates it on first run.
  • Repo is `naorsabag/openhop` (lowercase) but the workflow built with `VITE_BASE: /OpenHop/`. Pages serves from `https://naorsabag.github.io/openhop/\` — assets 404 with the wrong case. Fixed the env var, the test, and the comment.

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

  • `npm test -w @openhop/web` (42/42)
  • After merge: confirm Pages deploys to https://naorsabag.github.io/openhop/
  • Future bumps: confirm publish.yml runs but skips if the version already exists on the registry

🤖 Generated with Claude Code

Summary by CodeRabbit

  • New Features

    • Added an automated publishing workflow to publish beta releases to npm.
  • Chores

    • Changed GitHub Pages base path to the lowercase repository name and updated related docs/comments.
    • Adjusted packaging scripts to build before preparing bundled assets.
  • Tests

    • Updated share-url tests to validate URL construction for both dev and Pages deployment base paths.

Review Change Stack

Review Change Stack

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>
@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented May 10, 2026

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro Plus

Run ID: 7e49fa89-88e1-4a94-997f-5fe141ad8cce

📥 Commits

Reviewing files that changed from the base of the PR and between 2f879c2 and b0450ff.

📒 Files selected for processing (1)
  • .github/workflows/publish.yml
🚧 Files skipped from review as they are similar to previous changes (1)
  • .github/workflows/publish.yml

Walkthrough

This PR normalizes the GitHub Pages base path to lowercase (/openhop/), updates the Pages workflow with auto-enablement configuration, adds a publish workflow that conditionally releases @openhop/web and the CLI to npm beta tags, and tweaks the CLI package prepack script.

Changes

Pages Base Path Normalization

Layer / File(s) Summary
GitHub Pages Configuration
.github/workflows/pages.yml
VITE_BASE changed from /OpenHop/ to /openhop/; actions/configure-pages step with: block expanded to include enablement: true; header comments updated to describe auto-enablement.
Documentation and Tests
packages/web/src/lib/share-url.ts, packages/web/__tests__/share-url.test.ts
Comment above buildShareUrl updated to reference /openhop/; tests updated to assert URL generation for dev (/) and Pages (/openhop/) produce matching encoded fragments.

NPM Publishing Workflow

Layer / File(s) Summary
Publish Workflow
.github/workflows/publish.yml
New workflow that triggers on master pushes affecting package manifests or on manual dispatch, resolves current versions from package.json, checks npm for existing versions, and conditionally publishes @openhop/web then the CLI to the beta tag.
CLI prepack script change
packages/cli/package.json
prepack now runs npm run build before removing and copying skills; prepare script removed.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Possibly related PRs

  • naorsabag/openhop#91: Coordinated lowercase repo/name changes affecting Pages base path, docs/tests, and package metadata.
  • naorsabag/openhop#78: Modifies packages/cli/package.json scripts involving prepack/build/prepare similar to this PR's CLI script change.
  • naorsabag/openhop#77: Prior changes to the Pages fragment-mode deploy and base path casing related to these edits.
🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately summarizes the two main changes: fixing the GitHub Pages base path casing and adding a new npm publish workflow.
Docstring Coverage ✅ Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch chore/ci-pages-and-publish

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

@github-advanced-security
Copy link
Copy Markdown

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:

  • The 'Security' tab will display more code scanning analysis results (e.g., for the default branch).
  • Depending on your configuration and choice of analysis tool, future pull requests will be annotated with code scanning analysis results.
  • You will be able to see the analysis results for the pull request's branch on this overview once the scans have completed and the checks have passed.

For more information about GitHub Code Scanning, check out the documentation.

Copy link
Copy Markdown

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

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

🧹 Nitpick comments (1)
.github/workflows/publish.yml (1)

14-18: ⚡ Quick win

Narrow 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

📥 Commits

Reviewing files that changed from the base of the PR and between 7ba3019 and 3edc0c8.

📒 Files selected for processing (4)
  • .github/workflows/pages.yml
  • .github/workflows/publish.yml
  • packages/web/__tests__/share-url.test.ts
  • packages/web/src/lib/share-url.ts

naorsabag and others added 4 commits May 10, 2026 08:23
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>
`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>
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.

2 participants