Skip to content

Commit c1f0d54

Browse files
justin808claude
andcommitted
Fix code review concerns: gemspec bug, PropTypes, root Gemfile
- Fix critical Pro gemspec bug: Add Dir.chdir(__dir__) to ensure git ls-files only returns Pro package files, not entire repo - Revert PropTypes additions in generator templates to align with React 19 strategy (ESLint config says "React 19 doesn't need PropTypes") - Add root Gemfile for developer convenience (delegates to react_on_rails) 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <[email protected]>
1 parent 44d3ae1 commit c1f0d54

File tree

5 files changed

+16
-26
lines changed

5 files changed

+16
-26
lines changed

Gemfile

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
# frozen_string_literal: true
2+
3+
# Root Gemfile for developer convenience
4+
# Delegates to the react_on_rails gem for development
5+
6+
# Use the open-source gem's Gemfile
7+
eval_gemfile File.expand_path('react_on_rails/Gemfile', __dir__)

react_on_rails/lib/generators/react_on_rails/templates/base/base/app/javascript/bundles/HelloWorld/components/HelloWorld.jsx

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,8 @@
11
import React, { useState } from 'react';
2-
import PropTypes from 'prop-types';
32
import * as style from './HelloWorld.module.css';
43

5-
const HelloWorld = ({ name: initialName }) => {
6-
const [name, setName] = useState(initialName);
4+
const HelloWorld = (props) => {
5+
const [name, setName] = useState(props.name);
76

87
return (
98
<div>
@@ -19,8 +18,4 @@ const HelloWorld = ({ name: initialName }) => {
1918
);
2019
};
2120

22-
HelloWorld.propTypes = {
23-
name: PropTypes.string.isRequired,
24-
};
25-
2621
export default HelloWorld;

react_on_rails/lib/generators/react_on_rails/templates/base/base/app/javascript/src/HelloWorld/ror_components/HelloWorld.client.jsx

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,8 @@
11
import React, { useState } from 'react';
2-
import PropTypes from 'prop-types';
32
import * as style from './HelloWorld.module.css';
43

5-
const HelloWorld = ({ name: initialName }) => {
6-
const [name, setName] = useState(initialName);
4+
const HelloWorld = (props) => {
5+
const [name, setName] = useState(props.name);
76

87
return (
98
<div>
@@ -19,8 +18,4 @@ const HelloWorld = ({ name: initialName }) => {
1918
);
2019
};
2120

22-
HelloWorld.propTypes = {
23-
name: PropTypes.string.isRequired,
24-
};
25-
2621
export default HelloWorld;

react_on_rails/lib/generators/react_on_rails/templates/redux/base/app/javascript/bundles/HelloWorld/components/HelloWorld.jsx

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
import React from 'react';
2-
import PropTypes from 'prop-types';
32
import * as style from './HelloWorld.module.css';
43

54
const HelloWorld = ({ name, updateName }) => (
@@ -18,9 +17,4 @@ const HelloWorld = ({ name, updateName }) => (
1817
</div>
1918
);
2019

21-
HelloWorld.propTypes = {
22-
name: PropTypes.string.isRequired,
23-
updateName: PropTypes.func.isRequired,
24-
};
25-
2620
export default HelloWorld;

react_on_rails_pro/react_on_rails_pro.gemspec

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -20,12 +20,11 @@ Gem::Specification.new do |s|
2020
s.license = "UNLICENSED"
2121
s.metadata["rubygems_mfa_required"] = "true"
2222

23-
s.files = `git ls-files -z`.split("\x0")
24-
.reject { |f|
25-
f.match(
26-
%r{^(test|spec|features|tmp|node_modules|packages|coverage|Gemfile.lock|lib/tasks)/}
27-
)
28-
}
23+
s.files = Dir.chdir(__dir__) do
24+
`git ls-files -z`.split("\x0").reject do |f|
25+
f.match(%r{^(test|spec|features|tmp|node_modules|packages|coverage|Gemfile.lock|lib/tasks)/})
26+
end
27+
end
2928
s.bindir = "exe"
3029
s.executables = s.files.grep(%r{^exe/}) { |f| File.basename(f) }
3130
s.require_paths = ["lib"]

0 commit comments

Comments
 (0)