Skip to content

Commit 4a535ed

Browse files
committed
Enable use as a Git dependency
1 parent 98fcc29 commit 4a535ed

File tree

3 files changed

+20
-3
lines changed

3 files changed

+20
-3
lines changed

CHANGELOG.md

+2-3
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,10 @@ Changes since the last non-beta release.
2020

2121
#### Fixed
2222

23+
- Incorrect type and confusing name for `ReactOnRails.registerStore`, use `registerStoreGenerators` instead. [PR 1651](https://github.com/shakacode/react_on_rails/pull/1651) by [alexeyr-ci](https://github.com/alexeyr-ci).
2324
- Changed the ReactOnRails' version checker to use `ReactOnRails.configuration.node_modules_location` to determine the location of the package.json that the `react-on-rails` dependency is expected to be set by.
2425
- Also, all errors that would be raised by the version checking have been converted to `Rails.Logger` warnings to avoid any breaking changes. [PR 1657](https://github.com/shakacode/react_on_rails/pull/1657) by [judahmeek](https://github.com/judahmeek).
26+
- Enable use as a `git:` dependency. [PR 1664](https://github.com/shakacode/react_on_rails/pull/1664) by [alexeyr-ci](https://github.com/alexeyr-ci).
2527

2628
#### Added
2729
- Added streaming server rendering support:
@@ -35,9 +37,6 @@ Changes since the last non-beta release.
3537
#### Changed
3638
- Console replay script generation now awaits the render request promise before generating, allowing it to capture console logs from asynchronous operations. This requires using a version of the Node renderer that supports replaying async console logs. [PR #1649](https://github.com/shakacode/react_on_rails/pull/1649) by [AbanoubGhadban](https://github.com/AbanoubGhadban).
3739

38-
#### Fixed
39-
- Incorrect type and confusing name for `ReactOnRails.registerStore`, use `registerStoreGenerators` instead. [PR 1651](https://github.com/shakacode/react_on_rails/pull/1651) by [alexeyr-ci](https://github.com/alexeyr-ci).
40-
4140
### [14.0.5] - 2024-08-20
4241
#### Fixed
4342
- Should force load react-components which send over turbo-stream [PR #1620](https://github.com/shakacode/react_on_rails/pull/1620) by [theforestvn88](https://github.com/theforestvn88).

package-scripts.yml

+16
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,22 @@ scripts:
1414
description: Run eslint in debug mode.
1515
script: DEBUG=eslint:cli-engine nps eslint
1616

17+
build:
18+
prepack:
19+
description: Build the project in the prepack script.
20+
# This is necessary when used as a Git dependency since we don't have the dist directory in the repo.
21+
# Depending on the package manager, `prepack`, `prepare`, or both may be run.
22+
# They may also be run when publishing or in other cases, so we want to cover all of them.
23+
# 1. If the project is already built, do nothing;
24+
# 2. Build the project but ignore TypeScript errors from missing devDependencies;
25+
# 3. Check if the project is built now;
26+
# 4. If it failed, print an error message (still follow https://docs.npmjs.com/cli/v8/using-npm/scripts#best-practices).
27+
script: >
28+
[ -f node_package/lib/ReactOnRails.js ] ||
29+
(npm run build >/dev/null 2>&1 || true) &&
30+
[ -f node_package/lib/ReactOnRails.js ] ||
31+
{ echo 'Building react-on-rails seems to have failed!'; }
32+
1733
format:
1834
default:
1935
description: Format files using prettier.

package.json

+2
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,8 @@
6161
"test": "jest node_package/tests",
6262
"clean": "rm -rf node_package/lib",
6363
"start": "nps",
64+
"prepack": "nps build.prepack",
65+
"prepare": "nps build.prepack",
6466
"prepublishOnly": "yarn run build",
6567
"build": "yarn run clean && yarn run tsc --declaration",
6668
"build-watch": "yarn run clean && yarn run tsc --watch",

0 commit comments

Comments
 (0)