Skip to content
Merged
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
8 changes: 7 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,11 @@ Please follow the recommendations outlined at [keepachangelog.com](http://keepac
### [Unreleased]
Changes since the last non-beta release.

### [14.0.2] - 2024-06-11

#### Fixed
- Project initialization with Shakapacker v8+ fixed [PR 1629](https://github.com/shakacode/react_on_rails/pull/1629) by [vaukalak](https://github.com/vaukalak)

Comment on lines +21 to +25
Copy link
Contributor

Choose a reason for hiding this comment

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

Ensure proper markdown formatting by adding blank lines around headings and lists.

20a21
> 
23a25
> 
24a27
> 
Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
### [14.0.2] - 2024-06-11
#### Fixed
- Project initialization with Shakapacker v8+ fixed [PR 1629](https://github.com/shakacode/react_on_rails/pull/1629) by [vaukalak](https://github.com/vaukalak)
### [14.0.2] - 2024-06-11
#### Fixed
- Project initialization with Shakapacker v8+ fixed [PR 1629](https://github.com/shakacode/react_on_rails/pull/1629) by [vaukalak](https://github.com/vaukalak)
Tools
Markdownlint

23-23: Expected: 1; Actual: 0; Below (MD022, blanks-around-headings)
Headings should be surrounded by blank lines


24-24: null (MD032, blanks-around-lists)
Lists should be surrounded by blank lines

### [14.0.1] - 2024-05-16

#### Fixed
Expand Down Expand Up @@ -1128,7 +1133,8 @@ Best done with Object destructing:
##### Fixed
- Fix several generator-related issues.

[Unreleased]: https://github.com/shakacode/react_on_rails/compare/14.0.1...master
[Unreleased]: https://github.com/shakacode/react_on_rails/compare/14.0.2...master
[14.0.2]: https://github.com/shakacode/react_on_rails/compare/14.0.1...14.0.2
Comment on lines +1136 to +1137
Copy link
Contributor

Choose a reason for hiding this comment

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

Add blank lines around the heading and lists to adhere to markdown best practices.

1135a1136
> 
1136a1138
> 
Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
[Unreleased]: https://github.com/shakacode/react_on_rails/compare/14.0.2...master
[14.0.2]: https://github.com/shakacode/react_on_rails/compare/14.0.1...14.0.2
[Unreleased]: https://github.com/shakacode/react_on_rails/compare/14.0.2...master
[14.0.2]: https://github.com/shakacode/react_on_rails/compare/14.0.1...14.0.2

[14.0.1]: https://github.com/shakacode/react_on_rails/compare/14.0.0...14.0.1
[14.0.0]: https://github.com/shakacode/react_on_rails/compare/13.4.0...14.0.0
[13.4.0]: https://github.com/shakacode/react_on_rails/compare/13.3.5...13.4.0
Expand Down
3 changes: 2 additions & 1 deletion docs/getting-started.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,8 @@ You need a Rails application with Shakapacker installed and configured on it. Ch
rails new PROJECT_NAME --skip-javascript
cd PROJECT_NAME
bundle add shakapacker --strict
rails shakapacker:install
# currently react_on_rails uses yarn classic by default
PACKAGE_JSON_FALLBACK_MANAGER=yarn_classic rails shakapacker:install
```

You may need to check [the instructions for installing into an existing Rails app](https://www.shakacode.com/react-on-rails/docs/guides/installation-into-an-existing-rails-app/) if you have an already working Rails application.
Expand Down
3 changes: 1 addition & 2 deletions lib/generators/react_on_rails/base_generator.rb
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,7 @@ def copy_base_files
def copy_js_bundle_files
base_path = "base/base/"
base_files = %w[app/javascript/packs/server-bundle.js
app/javascript/bundles/HelloWorld/components/HelloWorldServer.js
app/javascript/bundles/HelloWorld/components/HelloWorld.module.css]
app/javascript/bundles/HelloWorld/components/HelloWorldServer.js]
base_files.each { |file| copy_file("#{base_path}#{file}", file) }
end

Expand Down
8 changes: 4 additions & 4 deletions lib/generators/react_on_rails/install_generator.rb
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ def invoke_generators
invoke "react_on_rails:react_no_redux"
end

invoke "react_on_rails:adapt_for_older_shakapacker" unless using_shakapacker_7?
invoke "react_on_rails:adapt_for_older_shakapacker" unless using_shakapacker_7_or_above?
end

# NOTE: other requirements for existing files such as .gitignore or application.
Expand Down Expand Up @@ -95,17 +95,17 @@ def add_bin_scripts

def add_post_install_message
message = GeneratorMessages.helpful_message_after_installation
unless using_shakapacker_7?
unless using_shakapacker_7_or_above?
message = message.gsub("config/shakapacker", "config/webpacker")
message = message.gsub("bin/shakapacker", "bin/webpacker")
end

GeneratorMessages.add_info(message)
end

def using_shakapacker_7?
def using_shakapacker_7_or_above?
shakapacker_gem = Gem::Specification.find_by_name("shakapacker")
shakapacker_gem.version.segments.first == 7
shakapacker_gem.version.segments.first >= 7
rescue Gem::MissingSpecError
# In case using Webpacker
false
Expand Down