Skip to content

Commit

Permalink
Merge pull request #806 from reactjs/top-level-package-json
Browse files Browse the repository at this point in the history
Move package.json to top level
  • Loading branch information
BookOfGreg authored Oct 12, 2017
2 parents 4ef22da + d1f3cd1 commit 35d1530
Show file tree
Hide file tree
Showing 3 changed files with 120 additions and 114 deletions.
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

0 comments on commit 35d1530

Please sign in to comment.