Skip to content

Commit ce57aed

Browse files
authored
Add automated markdown link checking GitHub Action (#1800)
Key improvements: - Adds GitHub Actions workflow for automated documentation link validation - Runs on PR/push changes to markdown files, weekly schedule, manual dispatch - Fixes 20+ broken documentation links discovered during implementation - Updates HTTP to HTTPS for all reactrails.com links - Marks Webpacker v3-v4 upgrade guide as outdated with clear notice - Configures smart link handling with ignore list for bot-blocked domains Breaking changes: None Security implications: None - workflow is read-only documentation checker Impact: - Existing installations: No impact on runtime behavior - New installations: Better documentation quality with all links working - Prevents future link rot through proactive weekly checks and PR validation
1 parent 7ef65c1 commit ce57aed

24 files changed

+112
-29
lines changed
Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
{
2+
"ignorePatterns": [
3+
{
4+
"pattern": "^http://localhost"
5+
},
6+
{
7+
"pattern": "^https://localhost"
8+
},
9+
{
10+
"pattern": "^mailto:"
11+
},
12+
{
13+
"pattern": "^https://www\\.npmjs\\.(org|com)"
14+
},
15+
{
16+
"pattern": "^https://your-shared-addr\\.c9users\\.io"
17+
},
18+
{
19+
"pattern": "^https://hichee\\.com"
20+
},
21+
{
22+
"pattern": "^https://github\\.com/shakacode/react-webpack-rails-tutorial/blob/master/config/webpacker\\.yml$"
23+
},
24+
{
25+
"pattern": "^https://github\\.com/shakacode/react-webpack-rails-tutorial/blob/master/client/webpack\\.client\\.base\\.config\\.js"
26+
}
27+
],
28+
"replacementPatterns": [
29+
{
30+
"pattern": "^/",
31+
"replacement": "https://github.com/shakacode/react_on_rails/blob/master/"
32+
}
33+
],
34+
"httpHeaders": [
35+
{
36+
"urls": ["https://docs.github.com", "https://github.com"],
37+
"headers": {
38+
"Accept": "text/html"
39+
}
40+
}
41+
],
42+
"timeout": "20s",
43+
"retryOn429": true,
44+
"retryCount": 3,
45+
"fallbackRetryDelay": "30s",
46+
"aliveStatusCodes": [200, 206]
47+
}
Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
name: Check Markdown Links
2+
3+
on:
4+
push:
5+
branches: [master]
6+
paths:
7+
- '**.md'
8+
- '.github/workflows/check-markdown-links.yml'
9+
- '.github/markdown-link-check-config.json'
10+
pull_request:
11+
paths:
12+
- '**.md'
13+
- '.github/workflows/check-markdown-links.yml'
14+
- '.github/markdown-link-check-config.json'
15+
schedule:
16+
# Run weekly on Monday at 8am UTC
17+
- cron: '0 8 * * 1'
18+
workflow_dispatch:
19+
20+
jobs:
21+
markdown-link-check:
22+
runs-on: ubuntu-latest
23+
steps:
24+
- uses: actions/checkout@v4
25+
26+
- name: Check markdown links
27+
uses: tcort/github-action-markdown-link-check@a800ad5f1c35bf61987946fd31c15726a1c9f2ba # v1.1.0
28+
with:
29+
use-quiet-mode: 'yes'
30+
use-verbose-mode: 'no'
31+
config-file: '.github/markdown-link-check-config.json'
32+
folder-path: 'docs/'
33+
file-extension: '.md'
34+
max-depth: -1
35+
check-modified-files-only: 'no'
36+
base-branch: 'master'

NEWS.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ _A history of the news. A few bullets at the top will also show on the [README.m
2121
- 2017-04-09: 8.0.0 beta work to include webpacker_lite gem has begun. See [#786](https://github.com/shakacode/react_on_rails/issues/786).
2222
- 2017-04-03: 6.9.3 Released! Props rendered in JSON script tag. Page size is smaller now due to less escaping!
2323
- 2017-03-06: Updated to Webpack v2!
24-
- 2017-03-02: Demo of internationalization (i18n) is live at [reactrails.com](https://www.reactrails.com/). Docs [here](docs/guides/i18n.md).
24+
- 2017-03-02: Demo of internationalization (i18n) is live at [reactrails.com](https://reactrails.com/). Docs [here](docs/guides/i18n.md).
2525
- 2017-02-28: See [discussions here on Webpacker](https://github.com/rails/webpacker/issues/139) regarding how Webpacker will allow React on Rails to avoid using the asset pipeline in the near future.
2626
- 2017-02-28: Upgrade to Webpack v2 or use the `--bail` option in your Webpack script for test and production builds. See the discussion on [PR #730](https://github.com/shakacode/react_on_rails/pull/730).
2727
- 2016-11-03: Spoke at [LA Ruby: "React on Rails: Why, What, and How?"](http://www.meetup.com/laruby/events/234825187/). [Video and pictures in this article](https://blog.shakacode.com/my-react-on-rails-talk-at-the-la-ruby-rails-meetup-november-10-2016-eaaa83aff800#.ej6h4eglp).

docs/additional-details/manual-installation-overview.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ The only requirements within this directory for basic React on Rails integration
1313
1. Your Webpack configuration files:
1414
1. Create outputs in a directory like `/public/webpack`, which is customizable in your `config/initializers/react_on_rails.rb`.
1515
1. Provide server rendering if you wish to use that feature.
16-
1. Your JavaScript code "registers" any components and stores per the ReactOnRails APIs of ReactOnRails.register(components) and ReactOnRails.registerStore(stores). See [our JavaScript API docs](../api/javascript-api.md) and the [React on Rails source](https://github.com/shakacode/react_on_rails/tree/master/node_package/src/ReactOnRails.client.js).
16+
1. Your JavaScript code "registers" any components and stores per the ReactOnRails APIs of ReactOnRails.register(components) and ReactOnRails.registerStore(stores). See [our JavaScript API docs](../api/javascript-api.md) and the [React on Rails source](https://github.com/shakacode/react_on_rails/tree/master/node_package/src/ReactOnRails.client.ts).
1717
1. Set your registration file as an "entry" point in your Webpack configs.
1818
1. Configure scripts in `client/package.json` as shown in the example apps. These are used for building your Webpack assets. Also do this for your top-level `package.json`.
1919

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,12 @@
1-
# Upgrading rails/webpacker v3.5 to v4
1+
# Upgrading rails/webpacker v3.5 to v4 (Outdated)
2+
3+
_Note: This guide is outdated. The configuration files it references were removed when React on Rails moved to Shakapacker. For migrating from Webpacker to Shakapacker, see the Shakapacker guide to upgrading to [version 6](https://github.com/shakacode/shakapacker/blob/master/docs/v6_upgrade.md) and [version 7](https://github.com/shakacode/shakapacker/blob/master/docs/v7_upgrade.md)._
24

35
The following steps can be followed to update a Webpacker v3.5 app to v4.
46

57
1. Update the gem `webpacker` and the package `@rails/webpacker`
6-
1. Merge changes from the new default [.babelrc](https://github.com/shakacode/react_on_rails/tree/master/lib/install/config/.babelrc) to your `/.babelrc`. If you are using React, you need to add `"@babel/preset-react"`, to the list of `presets`.
7-
1. Copy the file [.browserslistrc](https://github.com/shakacode/react_on_rails/tree/master/lib/install/config/.browserslistrc) to `/`.
8-
1. Merge any differences between [config/webpacker.yml](https://github.com/shakacode/react_on_rails/tree/master/lib/install/config/webpacker.yml) and your `/config/webpacker.yml`.
8+
1. Merge changes from the new default `.babelrc` to your `/.babelrc`. If you are using React, you need to add `"@babel/preset-react"`, to the list of `presets`.
9+
1. Copy the file `.browserslistrc` to `/`.
10+
1. Merge any differences between `config/webpacker.yml` and your `/config/webpacker.yml`.
911

1012
Here is an [example commit of these changes](https://github.com/shakacode/react_on_rails-tutorial-v11/pull/1/files).

docs/api/redux-store-api.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ yield
5959
...
6060
```
6161

62-
Components should be created as [stateless function(al) components](https://facebook.github.io/react/docs/reusable-components.html#stateless-functions). Since you can pass in initial props via the helper `redux_store`, you do not need to pass any props directly to the component. Instead, the component hydrates by connecting to the store.
62+
Components should be created as [function components](https://react.dev/learn/your-first-component#defining-a-component). Since you can pass in initial props via the helper `redux_store`, you do not need to pass any props directly to the component. Instead, the component hydrates by connecting to the store.
6363

6464
**\_comments.html.erb**
6565

docs/api/view-helpers-api.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -116,7 +116,7 @@ Renderer functions are not meant to be used on the server since there's no DOM o
116116
[React Router](https://reactrouter.com/) is supported, including server-side rendering! See:
117117

118118
1. [React on Rails docs for React Router](../javascript/react-router.md)
119-
2. Examples in [spec/dummy/app/views/react_router](https://github.com/shakacode/react_on_rails/tree/master/spec/dummy/app/views/react_router) and follow to the JavaScript code in the [spec/dummy/client/app/startup/ServerRouterApp.jsx](https://github.com/shakacode/react_on_rails/tree/master/spec/dummy/client/app/startup/ServerRouterApp.jsx).
119+
2. Examples in [spec/dummy/app/views/react_router](https://github.com/shakacode/react_on_rails/tree/master/spec/dummy/app/views/react_router) and follow to the JavaScript code in the [spec/dummy/client/app/startup/RouterApp.server.jsx](https://github.com/shakacode/react_on_rails/tree/master/spec/dummy/client/app/startup/RouterApp.server.jsx).
120120
3. [Code Splitting docs](../javascript/code-splitting.md) for information about how to set up code splitting for server rendered routes.
121121

122122
---

docs/contributor-info/linters.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ Rule severity is configured with `'off'`, `'warn'` or `'error'`. In older config
7070

7171
Rules can also take a few additional options. In this case, the rule can be set to an array, the first item of which is the severity and the rest are options.
7272

73-
See file [.eslintrc](https://github.com/shakacode/react_on_rails/tree/master/.eslintrc) for examples of configuration
73+
See file [.eslintrc](https://github.com/shakacode/react_on_rails/tree/master/lib/generators/react_on_rails/templates/.eslintrc) for examples of configuration
7474

7575
### Specify/Override rules in code
7676

docs/getting-started.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ This documentation assumes the usage of ReactOnRails with Shakapacker 7. For ins
77
1. Do the quick [tutorial](./guides/tutorial.md).
88
2. Add React on Rails to an existing Rails app per [the instructions](./guides/installation-into-an-existing-rails-app.md).
99
3. Look at [spec/dummy](https://github.com/shakacode/react_on_rails/tree/master/spec/dummy), a simple, no DB example.
10-
4. Look at [github.com/shakacode/react-webpack-rails-tutorial](https://github.com/shakacode/react-webpack-rails-tutorial); it's a full-featured example live at [www.reactrails.com](http://reactrails.com).
10+
4. Look at [github.com/shakacode/react-webpack-rails-tutorial](https://github.com/shakacode/react-webpack-rails-tutorial); it's a full-featured example live at [reactrails.com](https://reactrails.com).
1111

1212
## Basic Installation
1313

@@ -104,7 +104,7 @@ issue.
104104
<%= react_component("HelloWorld", props: { name: "Stranger" }) %>
105105
```
106106

107-
- This is what your HelloWorld.js file might contain. The railsContext is always available for any parameters that you _always_ want available for your React components. It has _nothing_ to do with the concept of the [React Context](https://reactjs.org/docs/context.html). See [Render-Functions and the RailsContext](./guides/render-functions-and-railscontext.md) for more details on this topic.
107+
- This is what your HelloWorld.js file might contain. The railsContext is always available for any parameters that you _always_ want available for your React components. It has _nothing_ to do with the concept of the [React Context](https://react.dev/reference/react/useContext). See [Render-Functions and the RailsContext](./guides/render-functions-and-railscontext.md) for more details on this topic.
108108

109109
```js
110110
import React from 'react';

docs/guides/how-react-on-rails-works.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ If you open the HTML source of any web page using React on Rails, you'll see the
2424
1. A script tag containing the properties of the React component, such as the registered name and any props. A JavaScript function runs after the page loads, using this data to build and initialize your React components.
2525
1. Additional JavaScript is placed to console-log any messages, such as server rendering errors. Note: these server-side logs can be configured only to be sent to the server logs.
2626

27-
You can see all this on the source for [reactrails.com](https://www.reactrails.com/)
27+
You can see all this on the source for [reactrails.com](https://reactrails.com/)
2828

2929
## Building the Bundles
3030

0 commit comments

Comments
 (0)