Skip to content
This repository has been archived by the owner on Apr 21, 2019. It is now read-only.

Commit

Permalink
feat(Cottontail): build local or watch dependencies with one gulp com…
Browse files Browse the repository at this point in the history
…mand, updated readme
  • Loading branch information
Maja Nedeljković committed Apr 17, 2016
1 parent 5a98309 commit 77528c5
Show file tree
Hide file tree
Showing 5 changed files with 60 additions and 5 deletions.
36 changes: 34 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,44 @@ Running `npm run package` in the root project folder will produce a tarball in t
In order to improve our software, we may report runtime errors back to our servers.
If you explicitly wish to disable this, you can add a `--no-error-reporting` parameter to the CLI command.

## Local Development

Local cottontail requires the following dependencies:

- [NodeJS 4+](https://nodejs.org/en/)
- [Bower](http://bower.io/)


After cloning the repo locally, run the following commands in the root of the cottontail project:

cd server
npm install

This will install the dependencies required for the server to run, then from the server directory:

cd ../client
npm install && bower install
cd src/editors
npm install && bower install

After all dependencies are installed, from the client root (`cottontail/client`) **run `gulp local-build` to build JS/CSS required for the client.**

To watch all JS and SCSS files during development, run `gulp watch`.


## Running the Server

After all local dependencies have been installed, you can run the server by doing the following from the root of the cottontail project:

cd ../server
node app.js {target_directory} [-o (open browser, optional)] [--port 1337 (optional)]

## Tests

**Server tests: **
**Server tests:**
To run the server tests run the following command from the project root:

node serverSpec-runner.js

This will run the tests in the ==/spec== folder and generates a JUnitXml report in the ==/spec/report== folder. The tests files must have a ***[sS]pec.js** ending.
This will run the tests in the `/spec` folder and generates a JUnitXml report in the `/spec/report` folder. The tests files must have a ***[sS]pec.js** ending.

2 changes: 1 addition & 1 deletion client/gulp/scripts.js
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,6 @@ gulp.task('scripts', function () {
return webpack(false);
});

gulp.task('scripts:watch', ['editor:templates', 'scripts'], function (callback) {
gulp.task('scripts:watch', ['scripts'], function (callback) {
return webpack(true, callback);
});
21 changes: 20 additions & 1 deletion client/gulp/templates.js
Original file line number Diff line number Diff line change
Expand Up @@ -44,5 +44,24 @@ gulp.task('cliche:templates', function () {
});

gulp.task('editor:templates', ['cliche:templates', 'dyole:templates'], function () {

});

gulp.task('templates:watch', function() {
gulp.watch([
path.join(conf.paths.src, '/editors/app/views/**/*.html'),
path.join(conf.paths.src, '/editors/app/views/dyole/**/*.html'),
path.join(conf.paths.src, '/editors/app/views/cliche/**/*.html'),
path.join(conf.paths.src, '/editors/app/views/app/**/*.html'),
path.join(conf.paths.src, '/editors/app/views/repo/**/*.html'),
path.join(conf.paths.src, '/editors/app/views/task/**/*.html')
], ['dyole:templates']);

gulp.watch([
path.join(conf.paths.src, '/editors/app/views/**/*.html'),
path.join(conf.paths.src, '/editors/app/views/cliche/**/*.html'),
path.join(conf.paths.src, '/editors/app/views/app/**/*.html'),
path.join(conf.paths.src, '/editors/app/views/repo/**/*.html'),
path.join(conf.paths.src, '/editors/app/views/task/**/*.html')
], ['cliche:templates'])

});
2 changes: 1 addition & 1 deletion client/gulp/watch.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ function isOnlyChange(event) {
return event.type === 'changed';
}

gulp.task('watch', ['scripts:watch', 'inject'], function () {
gulp.task('watch', ['scripts:watch', 'templates:watch', 'inject'], function () {

gulp.watch([path.join(conf.paths.src, '/*.html'), 'bower.json'], ['inject']);

Expand Down
4 changes: 4 additions & 0 deletions client/gulpfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,3 +27,7 @@ wrench.readdirSyncRecursive('./gulp').filter(function(file) {
gulp.task('default', ['clean'], function () {
gulp.start('build');
});

gulp.task('local-build', ['editor:templates', 'scripts', 'styles'], function () {
gulp.start('inject');
});

0 comments on commit 77528c5

Please sign in to comment.