From 722b351d48b5ba50eee2669cd21679fa08924eb4 Mon Sep 17 00:00:00 2001 From: Alexey Romanov Date: Thu, 19 Dec 2024 14:18:03 +0000 Subject: [PATCH] Enable use as a Git dependency --- CHANGELOG.md | 5 ++--- package-scripts.yml | 13 +++++++++++++ package.json | 1 + 3 files changed, 16 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 95002c46d..0083f0ab0 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -20,8 +20,10 @@ Changes since the last non-beta release. #### Fixed +- 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). - 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. - 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). +- 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). #### Added - Added streaming server rendering support: @@ -35,9 +37,6 @@ Changes since the last non-beta release. #### Changed - 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). -#### Fixed -- 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). - ### [14.0.5] - 2024-08-20 #### Fixed - 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). diff --git a/package-scripts.yml b/package-scripts.yml index 7bae4f142..ba2bb5e31 100644 --- a/package-scripts.yml +++ b/package-scripts.yml @@ -14,6 +14,19 @@ scripts: description: Run eslint in debug mode. script: DEBUG=eslint:cli-engine nps eslint + build: + prepack: + description: Build the project in the prepack script. + # 1. If the project is already built, do nothing; + # 2. Build the project but ignore TypeScript errors from missing devDependencies; + # 3. Check if the project is built now; + # 4. If it failed, print an error message (still follow https://docs.npmjs.com/cli/v8/using-npm/scripts#best-practices). + script: > + [ -f node_package/lib/ReactOnRails.js ] || + yarn run build &> /dev/null || + [ -f node_package/lib/ReactOnRails.js ] || + { echo 'Building react-on-rails seems to have failed!'; } + format: default: description: Format files using prettier. diff --git a/package.json b/package.json index ccf823212..0cd52568f 100644 --- a/package.json +++ b/package.json @@ -61,6 +61,7 @@ "test": "jest node_package/tests", "clean": "rm -rf node_package/lib", "start": "nps", + "prepack": "nps build.prepack", "prepublishOnly": "yarn run build", "build": "yarn run clean && yarn run tsc --declaration", "build-watch": "yarn run clean && yarn run tsc --watch",