Skip to content

Commit 9cb659b

Browse files
committed
Update documentation for public package distribution
Following PR #1901's switch from GitHub Packages to public distribution, update all documentation to reflect that React on Rails Pro packages are now publicly available on npmjs.org and RubyGems.org. Changes: - Remove all GitHub Personal Access Token requirements - Remove .npmrc and gem credentials configuration steps - Simplify installation to standard gem/npm commands - Update releasing docs to show all 5 packages as public - Remove "private repository" language throughout - Update troubleshooting to remove token-related issues Files updated: - react_on_rails_pro/docs/installation.md (major simplification) - docs/contributor-info/releasing.md - react_on_rails_pro/docs/contributors-info/releasing.md - react_on_rails_pro/docs/contributors-info/onboarding-customers.md - react_on_rails_pro/docs/troubleshooting.md - react_on_rails_pro/docs/ruby-api.md - react_on_rails_pro/docs/code-splitting-loadable-components.md - react_on_rails_pro/docs/node-renderer/basics.md - react_on_rails_pro/docs/node-renderer/error-reporting-and-tracing.md
1 parent 329cc5f commit 9cb659b

File tree

9 files changed

+46
-141
lines changed

9 files changed

+46
-141
lines changed

docs/contributor-info/releasing.md

Lines changed: 6 additions & 28 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. **@shakacode-tools/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

@@ -147,39 +147,17 @@ After a successful release, you'll see instructions to:
147147

148148
### NPM Publishing
149149

150-
You must be logged in and have publish permissions:
151-
152-
**For public packages (npmjs.org):**
150+
You must be logged in to npmjs.org and have publish permissions:
153151

154152
```bash
155153
npm login
156154
```
157155

158-
**For private packages (GitHub Packages):**
159-
160-
- Get a GitHub personal access token with `write:packages` scope
161-
- Add to `~/.npmrc`:
162-
```ini
163-
//npm.pkg.github.com/:_authToken=<TOKEN>
164-
always-auth=true
165-
```
166-
- Set environment variable:
167-
```bash
168-
export GITHUB_TOKEN=<TOKEN>
169-
```
156+
All NPM packages are published to npmjs.org.
170157

171158
### RubyGems Publishing
172159

173-
**For public gem (rubygems.org):**
174-
175-
- Standard RubyGems credentials via `gem push`
176-
177-
**For private gem (GitHub Packages):**
178-
179-
- Add to `~/.gem/credentials`:
180-
```
181-
:github: Bearer <GITHUB_TOKEN>
182-
```
160+
Standard RubyGems credentials via `gem push`. All gems are published to rubygems.org.
183161

184162
### Ruby Version Management
185163

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

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -270,7 +270,6 @@ reactOnRailsProNodeRenderer(config);
270270
271271
## Making HMR Work
272272
To make HMR work, it's best to disable loadable-components when using the Dev Server.
273-
Note: you will need access to our **private** React on Rails Pro repository to open the following links.
274273
275274
Take a look at the code searches for ['imports-loadable'](https://github.com/shakacode/react_on_rails_pro/search?q=imports-loadable&type=code) and ['imports-hmr'](https://github.com/shakacode/react_on_rails_pro/search?q=imports-hmr&type=code)
276275
@@ -297,8 +296,6 @@ And compare:
297296
298297
### Routes file
299298
300-
Note: you will need access to our **private** React on Rails Pro repository to open the following links.
301-
302299
- [spec/dummy/client/app/components/Loadable/routes/Routes.imports-hmr.jsx](https://github.com/shakacode/react_on_rails_pro/blob/master/spec/dummy/client/app/components/Loadable/routes/Routes.imports-hmr.jsx)
303300
- [spec/dummy/client/app/components/Loadable/routes/Routes.imports-loadable.jsx](https://github.com/shakacode/react_on_rails_pro/blob/master/spec/dummy/client/app/components/Loadable/routes/Routes.imports-loadable.jsx)
304301
Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
# Creating a github OAuth Token
1+
# Customer Onboarding
22

3-
*[Document for ShakaCode Staff](https://docs.google.com/document/d/10snzXEWgkorcai76_OxlhjQcDae_WoxRfBCdVbmcQoU/edit)*
3+
React on Rails Pro packages are now publicly available. No GitHub tokens or special access required.
44

55
# Customer Steps
6-
See [Installation](../installation.md).
6+
See [Installation](../installation.md) for public package installation instructions.

react_on_rails_pro/docs/contributors-info/releasing.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -33,8 +33,8 @@ rake release[17.0.0,false,verdaccio]
3333
```
3434

3535
This unified script releases all 5 packages together:
36-
- react-on-rails (NPM)
37-
- react-on-rails-pro (NPM)
38-
- react_on_rails (RubyGem)
39-
- @shakacode-tools/react-on-rails-pro-node-renderer (NPM, GitHub Packages)
40-
- react_on_rails_pro (RubyGem, GitHub Packages)
36+
- react-on-rails (NPM, npmjs.org)
37+
- react-on-rails-pro (NPM, npmjs.org)
38+
- @shakacode-tools/react-on-rails-pro-node-renderer (NPM, npmjs.org)
39+
- react_on_rails (RubyGem, rubygems.org)
40+
- react_on_rails_pro (RubyGem, rubygems.org)
Lines changed: 22 additions & 77 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
# Installation
2-
Since the repository is private, you will get a **GitHub Personal Access Token** and an account that can access the packages. Substitute that value in the commands below. If you dont' have this, ask [[email protected]](mailto:[email protected]) to give you one.
2+
3+
React on Rails Pro packages are now publicly available on npmjs.org and RubyGems.org. No authentication or special access is required.
34

45
Check the [CHANGELOG](https://github.com/shakacode/react_on_rails_pro/blob/master/CHANGELOG.md) to see what version you want.
56

@@ -9,48 +10,30 @@ For the below docs, find the desired `<version>` in the CHANGELOG. Note, for pre
910

1011
# Ruby
1112
## Gem Installation
12-
1. Ensure your **Rails** app is using the **react_on_rails** gem, version greater than 11.0.7.
13-
1. Add the `react_on_rails_pro` gem to your **Gemfile**. Substitute the appropriate version number.
14-
15-
## Gemfile Change
1613

17-
Replace the following in the snippet for the Gemfile
18-
1. `<account>` for the api key
19-
2. `<api-key>`
20-
3. `<version>` desired
14+
1. Ensure your **Rails** app is using the **react_on_rails** gem, version greater than 11.0.7.
15+
2. Add the `react_on_rails_pro` gem to your **Gemfile**. Substitute the appropriate version number.
2116

22-
```ruby
23-
source "https://<rorp-account>:<token>@"\
24-
"rubygems.pkg.github.com/shakacode-tools" do
25-
gem "react_on_rails_pro", "<version>"
26-
end
27-
```
17+
## Gemfile
2818

29-
## Alternate installation keeping the key out of your Gemfile
19+
Add the following to your Gemfile:
3020

3121
```ruby
32-
source "https://rubygems.pkg.github.com/shakacode-tools" do
33-
gem "react_on_rails_pro", "<version>"
34-
end
22+
gem "react_on_rails_pro", "<version>"
3523
```
36-
Or use the `gem install` command:
24+
25+
Or install via command line:
3726

3827
```bash
39-
gem install react_on_rails_pro --version "<version>> --source "https://rubygems.pkg.github.com/shakacode-tools"
28+
gem install react_on_rails_pro --version "<version>"
4029
```
4130

42-
Then edit your permissions for bundler at the command line:
31+
Then run:
4332

44-
```
45-
bundle config set rubygems.pkg.github.com <username>:<token>
33+
```bash
34+
bundle install
4635
```
4736

48-
## Using a branch in your Gemfile
49-
Note, you should probably use an ENV value for the token so that you don't check this into your source code.
50-
```ruby
51-
gem "react_on_rails_pro", version: "<version>", git: "https://[your-github-token]:[email protected]/shakacode/react_on_rails_pro.git", tag: "<version>"
52-
```
53-
5437
## Rails Configuration
5538
You don't need to create an initializer if you are satisfied with the default as described in
5639
[Configuration](./configuration.md)
@@ -61,15 +44,8 @@ Note, you only need to install the Node Package if you are using the standalone
6144
## Installation
6245

6346
1. Create a subdirectory of your rails project for the Node renderer. Let's use `react-on-rails-pro`.
64-
65-
2. Create a file `react-on-rails-pro/.npmrc` with the following
66-
```
67-
always-auth=true
68-
//npm.pkg.github.com/:_authToken=<token>
69-
@shakacode-tools:registry=https://npm.pkg.github.com
70-
```
7147

72-
3. Create a `react-on-rails-pro/package.json`
48+
2. Create a `react-on-rails-pro/package.json`
7349
```json
7450
{
7551
"private": true,
@@ -82,11 +58,15 @@ always-auth=true
8258
}
8359
```
8460

85-
4. Be sure to run `npm i` **and not** `yarn` as only npm seems to work with the private github packages.
61+
3. Install dependencies using npm or yarn:
8662

87-
If you really want to use yarn, see [Yarn can't find private Github npm registry](https://stackoverflow.com/questions/58316109/yarn-cant-find-private-github-npm-registry)
63+
```bash
64+
npm install
65+
# or
66+
yarn install
67+
```
8868

89-
5. You can start the renderer with either the executable `node-renderer` or, preferably, with
69+
4. You can start the renderer with either the executable `node-renderer` or, preferably, with
9070
a startup JS file, say called `react-on-rails-pro/react-on-rails-pro-node-renderer.js` with
9171
these contents. _Note the use of the namespaced **`@shakacode-tools/react-on-rails-pro-node-renderer`** for the package.
9272

@@ -141,43 +121,8 @@ if (env.CI) {
141121
reactOnRailsProNodeRenderer(config)
142122
```
143123

144-
## Instructions for using a branch
145-
146-
Install the node-renderer executable, possibly globally. Substitute the branch name or tag for `master`
147-
```
148-
yarn global add https://<your-github-token>:[email protected]/shakacode/react_on_rails_pro.git\#master
149-
```
150-
151-
This installs a binary `node-renderer`.
152-
153-
### Using Github packages
154-
155-
Login into npm
156-
157-
```bash
158-
npm install @shakacode-tools/react-on-rails-pro-node-renderer@<version>
159-
```
160-
161-
or edit package.json directly
162-
```json
163-
"@shakacode-tools/react-on-rails-pro-node-renderer": "<version>"
164-
```
165-
166124
### Configuration
167125
See [NodeRenderer JavaScript Configuration](./node-renderer/js-configuration.md).
168126

169127
#### Webpack Configuration
170-
Set your server bundle webpack configuration to use a target of `node` per the [Webpack docs](https://webpack.js.org/concepts/targets/#usage).
171-
172-
## Authentication when using Github packages
173-
[Auth for the npm package](https://docs.github.com/en/packages/using-github-packages-with-your-projects-ecosystem/configuring-npm-for-use-with-github-packages#authenticating-to-github-packages)
174-
175-
Create a new ~/.npmrc file if one doesn't exist.
176-
```
177-
//npm.pkg.github.com/:_authToken=TOKEN
178-
```
179-
180-
To configure bundler if you don't want the token in your Gemfile:
181-
```
182-
bundle config https://rubygems.pkg.github.com/OWNER USERNAME:TOKEN
183-
```
128+
Set your server bundle webpack configuration to use a target of `node` per the [Webpack docs](https://webpack.js.org/concepts/targets/#usage).

react_on_rails_pro/docs/node-renderer/basics.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,10 +33,10 @@ For the most control over the setup, create a JavaScript file to start the NodeR
3333
cd renderer-app
3434
```
3535
2. Make sure you have **Node.js** version **14** or higher and **Yarn** installed.
36-
3. Init node application and yarn add to install `@shakacode-tools/react-on-rails-pro-node-renderer` package.
36+
3. Init node application and install `@shakacode-tools/react-on-rails-pro-node-renderer` package from npmjs.org.
3737
```sh
3838
yarn init
39-
yarn add https://[your-github-token]:[email protected]/shakacode/react_on_rails_pro.git\#master
39+
yarn add @shakacode-tools/react-on-rails-pro-node-renderer
4040
```
4141
4. Configure a JavaScript file that will launch the rendering server per the docs in [Node Renderer JavaScript Configuration](./js-configuration.md). For example, create a file `node-renderer.js`. Here is a simple example that uses all the defaults except for bundlePath:
4242

react_on_rails_pro/docs/node-renderer/error-reporting-and-tracing.md

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,8 +47,7 @@ To enable Sentry Tracing:
4747

4848
## Other services
4949
You can create your own integrations in the same way as the provided ones.
50-
If you have access to the React on Rails Pro repository,
51-
you can use [their implementations](https://github.com/shakacode/react_on_rails_pro/tree/master/packages/node-renderer/src/integrations) as examples.
50+
You can use [the provided implementations](https://github.com/shakacode/react_on_rails_pro/tree/master/packages/node-renderer/src/integrations) as examples.
5251
Import these functions from `@shakacode-tools/react-on-rails-pro-node-renderer/integrations/api`:
5352

5453
### Error reporting services

react_on_rails_pro/docs/ruby-api.md

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,5 @@
11
# Ruby API
22

3-
Note: you will need access to our **private** React on Rails Pro repository to open the following links.
4-
53
## View Helpers
64

75
See the [app/helpers/react_on_rails_pro_helper.rb](https://github.com/shakacode/react_on_rails_pro/blob/master/app/helpers/react_on_rails_pro_helper.rb) source.
Lines changed: 7 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,12 @@
11
# Troubleshooting
22

3-
## Invalid Token Workaround
4-
On June 27, 2024, tokens mysteriously did not work for a few hours. The problem resolved itself within a few hours.
3+
## Package Installation Issues
54

6-
If you do see this problem, get in touch with the package maintainers via Slack. You can also message
7-
Justin Gordon at +1-808-281-7272.
5+
React on Rails Pro packages are publicly available on npmjs.org and rubygems.org. No authentication tokens are required.
86

9-
As an alternative to the token issue, if you have an account with access to the docs and this file, you can
10-
create a new token and follow these steps.
7+
If you encounter installation issues:
118

12-
To create a new token, visit https://github.com/settings/apps:
13-
1. Developer Settings
14-
2. Personal access tokens
15-
3. Tokens (classic)
16-
4. Generate a new token, classic
17-
5. 30-day expiration (to be safer)
18-
6. Repo privileges (not ideal) but shouldn't last long
19-
20-
Then follow these steps to use your token:
21-
* [Ruby Gem](https://github.com/shakacode/react_on_rails_pro/blob/master/docs/installation.md#using-a-branch-in-your-gemfile)
22-
* [Node Package](https://github.com/shakacode/react_on_rails_pro/blob/master/docs/installation.md#instructions-for-using-a-branch)
23-
24-
Note that this token gives `repo` access, so you want to revoke this token ASAP.
9+
1. Ensure you're using the latest version of npm/yarn or bundler
10+
2. Check that you have network access to npmjs.org and rubygems.org
11+
3. Verify the package version exists in the [CHANGELOG](https://github.com/shakacode/react_on_rails_pro/blob/master/CHANGELOG.md)
12+
4. Contact support via Slack or email Justin Gordon at [email protected]

0 commit comments

Comments
 (0)