Skip to content

Commit 72f4dbc

Browse files
ihabadhamclaude
andauthored
Switch Pro packages to public distribution (#1901)
## Summary This PR implements the switch from GitHub Packages to public distribution for React on Rails Pro packages and gem. ### Changes **1. Node Renderer NPM Package (`react_on_rails_pro/package.json`)** - Removed `publishConfig` section to publish to npmjs.org instead of GitHub Packages - Updated repository URL to reflect monorepo location **2. Release Script (`rakelib/release.rake`)** - Updated node-renderer publishing logic (remove GitHub Packages messaging, add npmjs.org OTP prompt) - Updated Pro gem publishing: removed `--key github --host` arguments to publish to RubyGems.org - Updated documentation header to list all packages as PUBLIC - Updated success message to reflect unified public distribution **3. Documentation Updates** - Removed all GitHub PAT authentication instructions - Added license token security warning - Updated all package name references to unscoped version - Simplified installation flow ### Distribution Strategy **Before:** - Pro packages published to GitHub Packages (private) - Customers need GitHub PAT + JWT license token - Manual PAT generation by Justin for each customer **After:** - All packages published to public registries (npmjs.org + RubyGems.org) - Customers only need JWT license token - Runtime enforcement via JWT validation (unchanged) - Frictionless installation with `gem install` and `npm install` ### Breaking Change ⚠️ Existing customers using GitHub Packages will need to update their `.npmrc` configuration after this release. Justin will communicate migration steps directly to customers. ### Security Runtime enforcement remains completely unchanged: - JWT license validation at Rails startup (Ruby side) - JWT license validation at Node renderer startup (Node side) - Grace period system still in place - Attribution system still in place ### Testing Plan - [ ] Dry run: `rake release[16.2.0,true]` - [ ] Verdaccio test: `rake release[16.2.0-test.1,false,verdaccio]` - [ ] Verify packages publish successfully to public registries - [ ] Test installation without GitHub credentials - [ ] Test runtime enforcement still works 🤖 Generated with [Claude Code](https://claude.com/claude-code) <!-- Reviewable:start --> - - - This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/shakacode/react_on_rails/1901) <!-- Reviewable:end --> <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit * **Chores** * Publishing consolidated: packages now published publicly (npmjs.org & RubyGems.org); private registry references removed, publication messaging unified, and package names simplified to unscoped forms. OTP/publish prompts and final release summaries updated. * **Documentation** * Install, release, and node-renderer docs revised for public publishing and license-based runtime auth: simplified release commands, updated install/import examples, startup/config guidance, and error/tracing/integration instructions. <!-- end of auto-generated comment: release notes by coderabbit.ai --> --------- Co-authored-by: Claude <[email protected]>
1 parent d962941 commit 72f4dbc

File tree

17 files changed

+369
-196
lines changed

17 files changed

+369
-196
lines changed

CONTRIBUTING.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -129,7 +129,7 @@ Package [email protected] added ==> /Users/justin/shakacode/react-o
129129
Don't forget you may need to run yarn after adding packages with yalc to install/update dependencies/bin scripts.
130130
```
131131

132-
Of course, you can do the same with `react-on-rails-pro` and `@shakacode-tools/react-on-rails-pro-node-renderer` packages.
132+
Of course, you can do the same with `react-on-rails-pro` and `react-on-rails-pro-node-renderer` packages.
133133

134134
This is the approach `spec/dummy` apps use, so you can also look at their implementation.
135135

docs/contributor-info/releasing.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -58,9 +58,9 @@ The release task publishes 5 packages with unified versioning:
5858

5959
1. **react-on-rails** - NPM package
6060
2. **react-on-rails-pro** - NPM package
61-
3. **react_on_rails** - RubyGem
62-
63-
**PRIVATE (GitHub Packages):** 4. **@shakacode-tools/react-on-rails-pro-node-renderer** - NPM package 5. **react_on_rails_pro** - RubyGem
61+
3. **react-on-rails-pro-node-renderer** - NPM package
62+
4. **react_on_rails** - RubyGem
63+
5. **react_on_rails_pro** - RubyGem
6464

6565
### Version Synchronization
6666

rakelib/release.rake

Lines changed: 18 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -29,9 +29,8 @@ This will update and release:
2929
PUBLIC (npmjs.org + rubygems.org):
3030
- react-on-rails NPM package
3131
- react-on-rails-pro NPM package
32+
- react-on-rails-pro-node-renderer NPM package
3233
- react_on_rails RubyGem
33-
PRIVATE (GitHub Packages):
34-
- @shakacode-tools/react-on-rails-pro-node-renderer NPM package
3534
- react_on_rails_pro RubyGem
3635
3736
1st argument: Version (patch/minor/major OR explicit version like 16.2.0)
@@ -208,24 +207,17 @@ task :release, %i[version dry_run registry skip_push] do |_t, args|
208207
sh_in_dir(gem_root,
209208
"yarn workspace react-on-rails-pro publish --new-version #{actual_npm_version} #{npm_publish_args}")
210209

211-
# Publish node-renderer NPM package (to Verdaccio or GitHub Packages depending on mode)
210+
# Publish node-renderer NPM package (PUBLIC on npmjs.org)
212211
puts "\n#{'=' * 80}"
213-
if use_verdaccio
214-
puts "Publishing node-renderer to Verdaccio (local)..."
215-
else
216-
puts "Publishing PRIVATE node-renderer to GitHub Packages..."
217-
end
212+
puts "Publishing PUBLIC node-renderer to #{use_verdaccio ? 'Verdaccio (local)' : 'npmjs.org'}..."
218213
puts "=" * 80
219214

220215
# Publish react-on-rails-pro-node-renderer NPM package
221-
node_renderer_registry = if use_verdaccio
222-
"Verdaccio (http://localhost:4873/)"
223-
else
224-
"GitHub Packages"
225-
end
226-
node_renderer_name = "@shakacode-tools/react-on-rails-pro-node-renderer"
227-
puts "\nPublishing #{node_renderer_name}@#{actual_npm_version} to #{node_renderer_registry}..."
228-
puts "Ensure you're authenticated with GitHub Packages (see ~/.npmrc)" unless use_verdaccio
216+
# Note: Uses plain `yarn publish` (not `yarn workspace`) because the node-renderer
217+
# package.json is in react_on_rails_pro/ which is not defined as a workspace
218+
node_renderer_name = "react-on-rails-pro-node-renderer"
219+
puts "\nPublishing #{node_renderer_name}@#{actual_npm_version}..."
220+
puts "Carefully add your OTP for NPM when prompted." unless use_verdaccio
229221
sh_in_dir(pro_gem_root,
230222
"yarn publish --new-version #{actual_npm_version} --no-git-tag-version #{npm_publish_args}")
231223

@@ -241,14 +233,13 @@ task :release, %i[version dry_run registry skip_push] do |_t, args|
241233
sh_in_dir(gem_root, "gem release")
242234

243235
puts "\n#{'=' * 80}"
244-
puts "Publishing PRIVATE Ruby gem to GitHub Packages..."
236+
puts "Publishing PUBLIC Pro Ruby gem to RubyGems.org..."
245237
puts "=" * 80
246238

247-
# Publish react_on_rails_pro Ruby gem to GitHub Packages
248-
puts "\nPublishing react_on_rails_pro gem to GitHub Packages..."
249-
puts "Ensure you have GitHub token in ~/.gem/credentials"
250-
sh_in_dir(pro_gem_root,
251-
"gem release --key github --host https://rubygems.pkg.github.com/shakacode-tools")
239+
# Publish react_on_rails_pro Ruby gem to RubyGems.org
240+
puts "\nPublishing react_on_rails_pro gem to RubyGems.org..."
241+
puts "Carefully add your OTP for Rubygems when prompted."
242+
sh_in_dir(pro_gem_root, "gem release")
252243
end
253244
end
254245

@@ -286,13 +277,13 @@ task :release, %i[version dry_run registry skip_push] do |_t, args|
286277
Published to #{npm_registry_note}:
287278
- react-on-rails@#{actual_npm_version}
288279
- react-on-rails-pro@#{actual_npm_version}
289-
- @shakacode-tools/react-on-rails-pro-node-renderer@#{actual_npm_version}
280+
- react-on-rails-pro-node-renderer@#{actual_npm_version}
290281
MSG
291282

292283
unless use_verdaccio
293-
msg += "\n Ruby Gems:\n"
294-
msg += " - react_on_rails #{actual_gem_version} (RubyGems.org)\n"
295-
msg += " - react_on_rails_pro #{actual_gem_version} (GitHub Packages)\n"
284+
msg += "\n Ruby Gems (RubyGems.org):\n"
285+
msg += " - react_on_rails #{actual_gem_version}\n"
286+
msg += " - react_on_rails_pro #{actual_gem_version}\n"
296287
end
297288

298289
if skip_push
@@ -313,7 +304,7 @@ task :release, %i[version dry_run registry skip_push] do |_t, args|
313304
To test installation:
314305
npm install --registry http://localhost:4873/ react-on-rails@#{actual_npm_version}
315306
npm install --registry http://localhost:4873/ react-on-rails-pro@#{actual_npm_version}
316-
npm install --registry http://localhost:4873/ @shakacode-tools/react-on-rails-pro-node-renderer@#{actual_npm_version}
307+
npm install --registry http://localhost:4873/ react-on-rails-pro-node-renderer@#{actual_npm_version}
317308
318309
Note: Ruby gems were not published (Verdaccio is NPM-only)
319310

react_on_rails_pro/CONTRIBUTING.md

Lines changed: 2 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -347,24 +347,13 @@ Contact Justin Gordon, [[email protected]](mailto:[email protected]) for r
347347

348348
## Prerequisites
349349

350-
You need authentication for both public and private package registries:
350+
You need authentication for public package registries:
351351

352352
**Public packages (npmjs.org + rubygems.org):**
353353
- NPM: Run `npm login`
354354
- RubyGems: Standard credentials via `gem push`
355355

356-
**Private packages (GitHub Packages):**
357-
- Get a GitHub personal access token with `write:packages` scope
358-
- Configure `~/.npmrc`:
359-
```ini
360-
//npm.pkg.github.com/:_authToken=<TOKEN>
361-
always-auth=true
362-
```
363-
- Configure `~/.gem/credentials`:
364-
```yaml
365-
:github: Bearer <GITHUB_TOKEN>
366-
```
367-
- Set environment variable: `export GITHUB_TOKEN=<TOKEN>`
356+
All React on Rails and React on Rails Pro packages are now published publicly to npmjs.org and RubyGems.org.
368357

369358
## Release Command
370359

react_on_rails_pro/docs/code-splitting-loadable-components.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -245,7 +245,7 @@ In your `node-renderer.js` file which runs node renderer, you need to specify `s
245245
```js
246246
const path = require('path');
247247
const env = process.env;
248-
const { reactOnRailsProNodeRenderer } = require('@shakacode-tools/react-on-rails-pro-node-renderer');
248+
const { reactOnRailsProNodeRenderer } = require('react-on-rails-pro-node-renderer');
249249

250250
const config = {
251251
...

react_on_rails_pro/docs/contributors-info/releasing.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,6 @@ rake release[17.0.0,false,verdaccio]
3535
This unified script releases all 5 packages together:
3636
- react-on-rails (NPM)
3737
- react-on-rails-pro (NPM)
38+
- react-on-rails-pro-node-renderer (NPM)
3839
- react_on_rails (RubyGem)
39-
- @shakacode-tools/react-on-rails-pro-node-renderer (NPM, GitHub Packages)
40-
- react_on_rails_pro (RubyGem, GitHub Packages)
40+
- react_on_rails_pro (RubyGem)

0 commit comments

Comments
 (0)