Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,7 @@ Package [email protected] added ==> /Users/justin/shakacode/react-o
Don't forget you may need to run yarn after adding packages with yalc to install/update dependencies/bin scripts.
```

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

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

Expand Down
6 changes: 3 additions & 3 deletions docs/contributor-info/releasing.md
Original file line number Diff line number Diff line change
Expand Up @@ -58,9 +58,9 @@ The release task publishes 5 packages with unified versioning:

1. **react-on-rails** - NPM package
2. **react-on-rails-pro** - NPM package
3. **react_on_rails** - RubyGem

**PRIVATE (GitHub Packages):** 4. **@shakacode-tools/react-on-rails-pro-node-renderer** - NPM package 5. **react_on_rails_pro** - RubyGem
3. **react-on-rails-pro-node-renderer** - NPM package
4. **react_on_rails** - RubyGem
5. **react_on_rails_pro** - RubyGem

### Version Synchronization

Expand Down
43 changes: 16 additions & 27 deletions rakelib/release.rake
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,8 @@ This will update and release:
PUBLIC (npmjs.org + rubygems.org):
- react-on-rails NPM package
- react-on-rails-pro NPM package
- react-on-rails-pro-node-renderer NPM package
- react_on_rails RubyGem
PRIVATE (GitHub Packages):
- @shakacode-tools/react-on-rails-pro-node-renderer NPM package
- react_on_rails_pro RubyGem

1st argument: Version (patch/minor/major OR explicit version like 16.2.0)
Expand Down Expand Up @@ -208,24 +207,15 @@ task :release, %i[version dry_run registry skip_push] do |_t, args|
sh_in_dir(gem_root,
"yarn workspace react-on-rails-pro publish --new-version #{actual_npm_version} #{npm_publish_args}")

# Publish node-renderer NPM package (to Verdaccio or GitHub Packages depending on mode)
# Publish node-renderer NPM package (PUBLIC on npmjs.org)
puts "\n#{'=' * 80}"
if use_verdaccio
puts "Publishing node-renderer to Verdaccio (local)..."
else
puts "Publishing PRIVATE node-renderer to GitHub Packages..."
end
puts "Publishing PUBLIC node-renderer to #{use_verdaccio ? 'Verdaccio (local)' : 'npmjs.org'}..."
puts "=" * 80

# Publish react-on-rails-pro-node-renderer NPM package
node_renderer_registry = if use_verdaccio
"Verdaccio (http://localhost:4873/)"
else
"GitHub Packages"
end
node_renderer_name = "@shakacode-tools/react-on-rails-pro-node-renderer"
puts "\nPublishing #{node_renderer_name}@#{actual_npm_version} to #{node_renderer_registry}..."
puts "Ensure you're authenticated with GitHub Packages (see ~/.npmrc)" unless use_verdaccio
node_renderer_name = "react-on-rails-pro-node-renderer"
puts "\nPublishing #{node_renderer_name}@#{actual_npm_version}..."
puts "Carefully add your OTP for NPM when prompted." unless use_verdaccio
sh_in_dir(pro_gem_root,
"yarn publish --new-version #{actual_npm_version} --no-git-tag-version #{npm_publish_args}")

Comment on lines +217 to 221
Copy link
Contributor

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟠 Major

Add --access public when publishing the scoped renderer package

Scoped npm packages default to private. On the first public release, yarn publish without --access public fails with the npm error “You must provide --access public to publish scoped packages.” That blocks the new distribution flow this PR introduces. Please append the flag (while skipping it for Verdaccio runs) so the publish step succeeds.

-    sh_in_dir(pro_gem_root,
-              "yarn publish --new-version #{actual_npm_version} --no-git-tag-version #{npm_publish_args}")
+    publish_command = [
+      "yarn publish",
+      "--new-version #{actual_npm_version}",
+      "--no-git-tag-version"
+    ]
+    publish_command << npm_publish_args unless npm_publish_args.to_s.empty?
+    publish_command << "--access public" unless use_verdaccio
+    sh_in_dir(pro_gem_root, publish_command.join(" "))
🤖 Prompt for AI Agents
In rakelib/release.rake around lines 217 to 221, the yarn publish command needs
the --access public flag for scoped packages; update the sh_in_dir call so that
when use_verdaccio is false you append "--access public" to the yarn publish
arguments (while preserving existing npm_publish_args and --no-git-tag-version),
and do not add the flag when use_verdaccio is true.

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

puts "\n#{'=' * 80}"
puts "Publishing PRIVATE Ruby gem to GitHub Packages..."
puts "Publishing PUBLIC Pro Ruby gem to RubyGems.org..."
puts "=" * 80

# Publish react_on_rails_pro Ruby gem to GitHub Packages
puts "\nPublishing react_on_rails_pro gem to GitHub Packages..."
puts "Ensure you have GitHub token in ~/.gem/credentials"
sh_in_dir(pro_gem_root,
"gem release --key github --host https://rubygems.pkg.github.com/shakacode-tools")
# Publish react_on_rails_pro Ruby gem to RubyGems.org
puts "\nPublishing react_on_rails_pro gem to RubyGems.org..."
puts "Carefully add your OTP for Rubygems when prompted."
sh_in_dir(pro_gem_root, "gem release")
end
end

Expand Down Expand Up @@ -286,13 +275,13 @@ task :release, %i[version dry_run registry skip_push] do |_t, args|
Published to #{npm_registry_note}:
- react-on-rails@#{actual_npm_version}
- react-on-rails-pro@#{actual_npm_version}
- @shakacode-tools/react-on-rails-pro-node-renderer@#{actual_npm_version}
- react-on-rails-pro-node-renderer@#{actual_npm_version}
MSG

unless use_verdaccio
msg += "\n Ruby Gems:\n"
msg += " - react_on_rails #{actual_gem_version} (RubyGems.org)\n"
msg += " - react_on_rails_pro #{actual_gem_version} (GitHub Packages)\n"
msg += "\n Ruby Gems (RubyGems.org):\n"
msg += " - react_on_rails #{actual_gem_version}\n"
msg += " - react_on_rails_pro #{actual_gem_version}\n"
end

if skip_push
Expand All @@ -313,7 +302,7 @@ task :release, %i[version dry_run registry skip_push] do |_t, args|
To test installation:
npm install --registry http://localhost:4873/ react-on-rails@#{actual_npm_version}
npm install --registry http://localhost:4873/ react-on-rails-pro@#{actual_npm_version}
npm install --registry http://localhost:4873/ @shakacode-tools/react-on-rails-pro-node-renderer@#{actual_npm_version}
npm install --registry http://localhost:4873/ react-on-rails-pro-node-renderer@#{actual_npm_version}

Note: Ruby gems were not published (Verdaccio is NPM-only)

Expand Down
15 changes: 2 additions & 13 deletions react_on_rails_pro/CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -347,24 +347,13 @@ Contact Justin Gordon, [[email protected]](mailto:[email protected]) for r

## Prerequisites

You need authentication for both public and private package registries:
You need authentication for public package registries:

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

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

## Release Command

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -245,7 +245,7 @@ In your `node-renderer.js` file which runs node renderer, you need to specify `s
```js
const path = require('path');
const env = process.env;
const { reactOnRailsProNodeRenderer } = require('@shakacode-tools/react-on-rails-pro-node-renderer');
const { reactOnRailsProNodeRenderer } = require('react-on-rails-pro-node-renderer');

const config = {
...
Expand Down
4 changes: 2 additions & 2 deletions react_on_rails_pro/docs/contributors-info/releasing.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,6 @@ rake release[17.0.0,false,verdaccio]
This unified script releases all 5 packages together:
- react-on-rails (NPM)
- react-on-rails-pro (NPM)
- react-on-rails-pro-node-renderer (NPM)
- react_on_rails (RubyGem)
- @shakacode-tools/react-on-rails-pro-node-renderer (NPM, GitHub Packages)
- react_on_rails_pro (RubyGem, GitHub Packages)
- react_on_rails_pro (RubyGem)
Loading
Loading