diff --git a/frontend/.babelrc b/.babelrc similarity index 100% rename from frontend/.babelrc rename to .babelrc diff --git a/doc/MacInstallation.md b/doc/MacInstallation.md index 8d10eda5..b2ed8500 100644 --- a/doc/MacInstallation.md +++ b/doc/MacInstallation.md @@ -15,10 +15,11 @@ Now install homebrew. ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)" -Then install nodejs and frontend code +Then install nodejs and ES6 code brew install nodejs - (cd frontend && npm install && npm run build) + npm install + npm run build And postgresql: diff --git a/doc/UbuntuInstallation.md b/doc/UbuntuInstallation.md index 4df4762f..bc100fdb 100644 --- a/doc/UbuntuInstallation.md +++ b/doc/UbuntuInstallation.md @@ -50,9 +50,8 @@ Install the specific version of ruby needed this will take some time rvm install $(cat metamaps/.ruby-version) -While that is running, you can open another terminal and install the npm frontend code +While that is running, you can open another terminal and install the ES6 code - cd frontend npm install npm run build diff --git a/doc/WindowsInstallation.md b/doc/WindowsInstallation.md index 7580fe7f..2aed29fa 100644 --- a/doc/WindowsInstallation.md +++ b/doc/WindowsInstallation.md @@ -20,12 +20,10 @@ Now you are ready to clone the Metamaps git repository: The third `bundle install` command downloads and installs the rubygem dependencies of Metamaps. -You also need to install the Javascript frontend code from the nodejs repositories: +You also need to install the ES6 code from the nodejs repositories: - cd frontend npm install npm run build - cd .. At this point you should be in C:\git\metamaps, or whatever equivalent directory you've chosen. The next step is to set up your database diff --git a/doc/production/first-deploy.md b/doc/production/first-deploy.md index 8c350a08..925792d6 100644 --- a/doc/production/first-deploy.md +++ b/doc/production/first-deploy.md @@ -60,11 +60,10 @@ Run this in the metamaps directory, still as metamaps: # create, load schema, seed rake db:setup -#### Install js frontend code +#### Install node & ES6 modules sudo aptitude install nodejs npm sudo ln -s /usr/bin/nodejs /usr/bin/node - cd frontend npm install npm run build diff --git a/doc/production/pull-changes.md b/doc/production/pull-changes.md index 9d58ce57..b99b39db 100644 --- a/doc/production/pull-changes.md +++ b/doc/production/pull-changes.md @@ -23,7 +23,8 @@ Now that you have the code, run these commands: source .env bundle install - (cd frontend && npm install && npm run build) + npm install + npm run build rake db:migrate rake assets:precompile rake perms:fix diff --git a/frontend/README-frontend.md b/frontend/README-frontend.md index a0488cda..5d086600 100644 --- a/frontend/README-frontend.md +++ b/frontend/README-frontend.md @@ -1,10 +1,10 @@ -To setup javascript dev, `cd frontend` and then run +To setup javascript dev, first run npm install to set up your testing environment. Then use - npm test + npm run test to see the results of testing the current javascript files. diff --git a/frontend/package.json b/package.json similarity index 97% rename from frontend/package.json rename to package.json index d2d57876..acf69b97 100644 --- a/frontend/package.json +++ b/package.json @@ -24,6 +24,7 @@ "babel-preset-es2015": "^6.9.0", "babel-preset-react": "^6.11.1", "chai": "^3.5.0", + "jquery": "^1.12.1", "mocha": "^2.4.5", "webpack": "^1.13.1" }, diff --git a/frontend/webpack.config.js b/webpack.config.js similarity index 78% rename from frontend/webpack.config.js rename to webpack.config.js index 1faa891e..492871ff 100644 --- a/frontend/webpack.config.js +++ b/webpack.config.js @@ -15,10 +15,10 @@ const config = module.exports = { ] }, entry: { - 'metamaps.bundle': './src/index.js' + 'metamaps.bundle': './frontend/src/index.js' }, output: { - path: '../app/assets/javascripts/webpacked', + path: './app/assets/javascripts/webpacked', filename: '[name].js' } }