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
15 changes: 3 additions & 12 deletions Rakefile
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,6 @@ def copy_react_asset(webpack_file, destination_file)
FileUtils.cp(full_webpack_path, full_destination_path)
end

# Move to `dirname` and execute `yarn {cmd}`
def yarn_run_in(dirname, cmd)
Dir.chdir(dirname) do
`yarn #{cmd}`
end
end

namespace :react do
desc 'Run the JS build process to put files in the gem source'
task update: [:install, :build, :copy]
Expand Down Expand Up @@ -54,12 +47,12 @@ namespace :ujs do

desc 'Install the JavaScript dependencies'
task :install do
yarn_run_in('react_ujs', 'upgrade')
`yarn upgrade`
end

desc 'Build the JS bundles with Webpack'
task :build do
yarn_run_in('react_ujs', 'build')
`yarn build`
end

desc "Copy browser-ready JS files to the gem's asset paths"
Expand All @@ -71,9 +64,7 @@ namespace :ujs do

desc 'Publish the package in ./react_ujs/ to npm as `react_ujs`'
task publish: :update do
Dir.chdir('react_ujs') do
`npm publish`
end
`npm publish`
end
end

Expand Down
7 changes: 5 additions & 2 deletions react_ujs/package.json → package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,13 @@
"name": "react_ujs",
"version": "2.3.1",
"description": "Rails UJS for the react-rails gem",
"main": "index.js",
"main": "react_ujs/index.js",
"files": [
"react_ujs"
],
"repository": "reactjs/react-rails",
"scripts": {
"build": "webpack"
"build": "cd react_ujs && webpack"
},
"devDependencies": {
"webpack": "^2.3.3"
Expand Down
Loading