Move remainder of Angular app under frontend

Templates, project infrastructure, configuration.

See 6ec5ca58.

Signed-off-by: Alex Coles <alex@alexbcoles.com>
This commit is contained in:
Alex Coles
2014-11-25 22:08:10 +01:00
parent b07c26d54b
commit 25a6b61f2d
67 changed files with 57 additions and 54 deletions
-3
View File
@@ -1,3 +0,0 @@
{
"directory": "vendor/assets/components"
}
-3
View File
@@ -53,7 +53,6 @@
/db/*.sqlite3
/db/schema.rb
/files/*
/frontend/tests/unit/reports
/log/*.log*
/log/mongrel_debug
/public/dispatch.*
@@ -66,7 +65,6 @@
/tmp/sockets/*
/tmp/test/*
/vendor/rails
/vendor/assets/components
/*.rbc
/doc/app
#/Gemfile.lock
@@ -82,4 +80,3 @@
# asset cache
/.sass-cache/
/node_modules/
+4 -4
View File
@@ -36,8 +36,8 @@ sudo: false
cache:
- bundler: true
- directories:
- node_modules
- vendor/assets/components
- frontend/node_modules
- frontend/bower_components
branches:
only:
@@ -70,7 +70,7 @@ before_install:
- "/sbin/start-stop-daemon --start -v --pidfile ./tmp/custom_xvfb_99.pid --make-pidfile --background --exec /usr/bin/Xvfb -- :99 -ac -screen 0 1920x1080x16"
- "echo `xdpyinfo -display :99 | grep 'dimensions' | awk '{ print $2 }'`"
- "nvm use 0.10"
- "travis_retry npm install"
- "cd frontend && travis_retry npm install && cd .."
before_script:
- if [[ ! $TEST_SUITE =~ ^(karma|protractor)$ ]]; then
@@ -79,7 +79,7 @@ before_script:
script:
- if [[ $TEST_SUITE =~ ^(karma|protractor)$ ]]; then
npm run $TEST_SUITE;
cd frontend && npm run $TEST_SUITE;
else
bundle exec rake $TEST_SUITE;
fi
+2
View File
@@ -0,0 +1,2 @@
{
}
+6
View File
@@ -0,0 +1,6 @@
/.sass-cache
/bower_components
/coverage
/node_modules
/tests/unit/reports
/tmp
View File
+9 -9
View File
@@ -42,8 +42,8 @@ var server;
var paths = {
scripts: [
'frontend/app/**/*.js',
'!frontend/app/vendor/**/*.js'
'app/**/*.js',
'!app/vendor/**/*.js'
]
};
@@ -54,13 +54,13 @@ gulp.task('lint', function() {
});
gulp.task('webpack', function() {
return gulp.src('frontend/app/openproject-app.js')
return gulp.src('app/openproject-app.js')
.pipe(gulpWebpack(config))
.pipe(gulp.dest('app/assets/javascripts/bundles'));
.pipe(gulp.dest('../app/assets/javascripts/bundles'));
});
gulp.task('sass', function() {
return gulp.src('app/assets/stylesheets/default.css.sass')
return gulp.src('../app/assets/stylesheets/default.css.sass')
.pipe(sass({
bundleExec: true,
require: 'bourbon'
@@ -72,7 +72,7 @@ gulp.task('sass', function() {
});
gulp.task('express', function() {
var expressApp = require('./frontend/tests/integration/server');
var expressApp = require('./tests/integration/server');
var port = process.env.PORT || 8080;
(function startServer(port) {
@@ -93,9 +93,9 @@ gulp.task('webdriver:update', webdriverUpdate);
gulp.task('webdriver:standalone', ['webdriver:update'], webdriverStandalone);
gulp.task('tests:protractor', ['webdriver:update', 'webpack', 'sass', 'express'], function(done) {
gulp.src('frontend/tests/integration/**/*_spec.js')
gulp.src('tests/integration/**/*_spec.js')
.pipe(protractor({
configFile: 'frontend/tests/integration/protractor.conf.js',
configFile: 'tests/integration/protractor.conf.js',
args: ['--baseUrl', 'http://' + server.address().address + ':' + server.address().port]
}))
.on('error', function(e) {
@@ -109,7 +109,7 @@ gulp.task('tests:protractor', ['webdriver:update', 'webpack', 'sass', 'express']
gulp.task('default', ['webpack', 'sass', 'express']);
gulp.task('watch', function() {
gulp.watch('frontend/app/**/*.js', ['webpack']);
gulp.watch('app/**/*.js', ['webpack']);
gulp.watch('config/locales/js-*.yml', ['webpack']);
gulp.watch('app/assets/stylesheets/**/*.sass', ['sass']);
});
+25 -25
View File
@@ -48,35 +48,35 @@ module.exports = function(config) {
// list of files / patterns to load in the browser
files: [
"vendor/assets/components/jquery/dist/jquery.js",
"vendor/assets/components/momentjs/moment.js",
"vendor/assets/components/moment-timezone/moment-timezone.js",
'vendor/assets/components/select2/select2.js',
"vendor/assets/javascripts/moment-timezone/moment-timezone-data.js",
"bower_components/jquery/dist/jquery.js",
"bower_components/momentjs/moment.js",
"bower_components/moment-timezone/moment-timezone.js",
'bower_components/select2/select2.js',
"../vendor/assets/javascripts/moment-timezone/moment-timezone-data.js",
'frontend/app/openproject-app.js',
"vendor/assets/components/angular-mocks/angular-mocks.js",
'app/openproject-app.js',
"bower_components/angular-mocks/angular-mocks.js",
"app/assets/javascripts/lib/jquery.trap.js",
"../app/assets/javascripts/lib/jquery.trap.js",
'app/assets/javascripts/autocompleter.js',
'app/assets/javascripts/members_select_boxes.js',
'app/assets/javascripts/openproject.js',
'app/assets/javascripts/timelines_select_boxes.js',
'app/assets/javascripts/jstoolbar/jstoolbar.js',
'../app/assets/javascripts/autocompleter.js',
'../app/assets/javascripts/members_select_boxes.js',
'../app/assets/javascripts/openproject.js',
'../app/assets/javascripts/timelines_select_boxes.js',
'../app/assets/javascripts/jstoolbar/jstoolbar.js',
'app/assets/javascripts/date-en-US.js',
'../app/assets/javascripts/date-en-US.js',
'frontend/tests/unit/tests/timeline_stubs.js',
'frontend/tests/unit/lib/rosie.js',
'frontend/tests/unit/tests/test-helper.js',
'frontend/tests/unit/factories/*factory.js',
'tests/unit/tests/timeline_stubs.js',
'tests/unit/lib/rosie.js',
'tests/unit/tests/test-helper.js',
'tests/unit/factories/*factory.js',
'vendor/assets/components/jquery-mockjax/jquery.mockjax.js',
'bower_components/jquery-mockjax/jquery.mockjax.js',
'frontend/tests/unit/tests/asset_functions.js',
'frontend/tests/unit/tests/**/*test.js',
'frontend/tests/unit/tests/legacy-tests.js',
'tests/unit/tests/asset_functions.js',
'tests/unit/tests/**/*test.js',
'tests/unit/tests/legacy-tests.js',
'public/templates/**/*.html'
],
@@ -91,8 +91,8 @@ module.exports = function(config) {
// preprocess matching files before serving them to the browser
// available preprocessors: https://npmjs.org/browse/keyword/karma-preprocessor
preprocessors: {
'app/assets/javascripts/*.js': ['coverage'],
'frontend/app/**/*.js': ['webpack'], // coverage disabled
'../app/assets/javascripts/*.js': ['coverage'],
'app/**/*.js': ['webpack'], // coverage disabled
'public/templates/**/*.html': ['ng-html2js']
},
@@ -132,7 +132,7 @@ module.exports = function(config) {
junitReporter: {
outputFile: 'frontend/tests/unit/reports/test-results.xml'
outputFile: 'tests/unit/reports/test-results.xml'
},
coverageReporter: {
+6 -5
View File
@@ -35,6 +35,7 @@ var mocks = globSync('./mocks/**/*.js', {
var express = require('express');
var railsRoot = __dirname + '/../../..';
var appRoot = __dirname + '/../..';
var app = express();
app.use(bodyParser.json());
@@ -50,13 +51,13 @@ app.use(express.static(__dirname));
app.use('/assets', express.static(railsRoot + '/app/assets/javascripts'));
app.use('/assets', express.static(railsRoot + '/app/assets/images'));
app.use('/assets', express.static(railsRoot + '/app/assets/stylesheets'));
app.use('/templates', express.static(railsRoot + '/public/templates'));
app.use('/javascripts', express.static(railsRoot + '/public/javascripts'));
app.use('/stylesheets', express.static(railsRoot + '/tmp/stylesheets'));
app.use('/bower_components', express.static(railsRoot +
'/vendor/assets/components'));
app.use('/assets/angular-busy', express.static(railsRoot +
'/vendor/assets/components/angular-busy'));
app.use('/templates', express.static(appRoot + '/public/templates'));
app.use('/bower_components', express.static(appRoot + '/bower_components'));
app.use('/assets/angular-busy', express.static(appRoot +
'/bower_components/angular-busy'));
app.get('/work_packages*', function(req, res) {
fs.readFile(__dirname + '/index.html', 'utf8', function(err,
text) {
@@ -1,7 +1,7 @@
var webpack = require('webpack'),
path = require('path'),
_ = require('lodash'),
pathConfig = require('./config/rails-plugins.conf');
pathConfig = require('./rails-plugins.conf');
var pluginEntries = _.reduce(pathConfig.pluginNamesPaths, function(entries, path, name) {
entries[name.replace(/^openproject\-/, '')] = name;
@@ -14,7 +14,7 @@ var pluginAliases = _.reduce(pathConfig.pluginNamesPaths, function(entries, plug
}, {});
module.exports = {
context: __dirname + '/frontend/app',
context: __dirname + '/app',
entry: _.merge({
app: './openproject-app.js'
@@ -22,7 +22,7 @@ module.exports = {
output: {
filename: 'openproject-[name].js',
path: path.join(__dirname, 'app', 'assets', 'javascripts', 'bundles')
path: path.join(__dirname, '..', 'app', 'assets', 'javascripts', 'bundles')
},
module: {
@@ -38,11 +38,11 @@ module.exports = {
modulesDirectories: [
'node_modules',
'vendor/assets/components'
'bower_components'
].concat(pathConfig.pluginDirectories),
alias: _.merge({
'locales': 'config/locales',
'locales': './../../config/locales',
'angular-ui-date': 'angular-ui-date/src/date',
'angular-truncate': 'angular-truncate/src/truncate',