# HG changeset patch # User nowmad@23.1.168.192.in-addr.arpa # Date 1447408942 -3600 # Node ID 10f67f0281e1f94c86b8ae1bb7c69c570864dfa6 # Parent ba32dd4cf8d38cc3c3fe6e5fbef7ef8b9404db13 move the gulpfile in the cms folder instead of the app - add readme for module and cms diff -r ba32dd4cf8d3 -r 10f67f0281e1 cms/README.md --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/cms/README.md Fri Nov 13 11:02:22 2015 +0100 @@ -0,0 +1,28 @@ +# Corpus CMS + +This README describes how to generate a Drupal module embedding a ember app. + +## Prerequisites + +You will need the following things properly installed on your computer. + +* [Node.js](http://nodejs.org/) (with NPM) + +## Installation + +* `npm install --prefix app-client/` (install the dependencies of the ember app) +* `npm install` + +### Building + +To build the module, you need to build the ember app then to copy the correct files into the modules folder. It can easily be done by the following command line: + +* `npm run build` + +It will first run `npm run build --prefix app-client` which will build the ember app, and then run `gulp copy-module` to copy the built files into the module folder. + +### Deploy + +Once the module has been updated with the correct built app, you can compress it and share it. +To include the compressed module to a Drupal website, simply unzip the module and place it in the modules/ folder in your Drupal project. +Report to the README inside the module folder for further informations. diff -r ba32dd4cf8d3 -r 10f67f0281e1 cms/app-client/gulpfile.js --- a/cms/app-client/gulpfile.js Fri Nov 13 11:01:27 2015 +0100 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,14 +0,0 @@ -var gulp = require('gulp'), - rename = require('gulp-rename'); - -var buildFolder = './dist'; -var moduleFolder = '../corpus_module'; - -gulp.task('copy-module', function () { - gulp.src(buildFolder+'/assets/**/*') - .pipe(gulp.dest(moduleFolder+'/app-client/assets')); - gulp.src(buildFolder+'/fonts/**/*') - .pipe(gulp.dest(moduleFolder+'/app-client/fonts')); - gulp.src(moduleFolder+'/**/*') - .pipe(gulp.dest('../../../drupal-7.41/modules/corpus')); -}); diff -r ba32dd4cf8d3 -r 10f67f0281e1 cms/app-client/package.json --- a/cms/app-client/package.json Fri Nov 13 11:01:27 2015 +0100 +++ b/cms/app-client/package.json Fri Nov 13 11:02:22 2015 +0100 @@ -8,7 +8,6 @@ "test": "tests" }, "scripts": { - "module": "ember build --environment=production && gulp copy-module", "build": "ember build --environment=production", "start": "ember serve --environment=development", "test": "ember test" @@ -37,8 +36,6 @@ "ember-cli-uglify": "^1.2.0", "ember-data": "1.13.8", "ember-disable-proxy-controllers": "^1.0.0", - "ember-export-application-global": "^1.0.3", - "gulp": "^3.9.0", - "gulp-rename": "^1.2.2" + "ember-export-application-global": "^1.0.3" } } diff -r ba32dd4cf8d3 -r 10f67f0281e1 cms/corpus_module/README.md --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/cms/corpus_module/README.md Fri Nov 13 11:02:22 2015 +0100 @@ -0,0 +1,20 @@ +# Corpus module + +This README describes how to configure this Drupal module in order to add it to your Drupal project. + +## Prerequisites + +You will need the following things properly installed on your computer. + +* A Drupal project + +## Installation + +* Place this module into the modules/ folder of your Drupal project. + +### Configuration + +You can setting up the module by changing the following variable in the corpus.module file: +* define('CORPUS_URL', 'corpus'); - The url to access to your module +* define('CORPUS_APP', 'app-client'); - The name of the folder the module look into to find the ember app to embed +* define('MODULE_NAME', 'corpus'); - The name of the module. It must match the name of the module folder. diff -r ba32dd4cf8d3 -r 10f67f0281e1 cms/gulpfile.js --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/cms/gulpfile.js Fri Nov 13 11:02:22 2015 +0100 @@ -0,0 +1,13 @@ +var gulp = require('gulp'); + +var buildFolder = 'app-client/dist'; +var moduleFolder = 'corpus_module'; + +gulp.task('copy-module', function () { + gulp.src(buildFolder+'/assets/**/*') + .pipe(gulp.dest(moduleFolder+'/app-client/assets')); + gulp.src(buildFolder+'/fonts/**/*') + .pipe(gulp.dest(moduleFolder+'/app-client/fonts')); + gulp.src(moduleFolder+'/**/*') + .pipe(gulp.dest('../../../drupal-7.41/modules/corpus')); +}); diff -r ba32dd4cf8d3 -r 10f67f0281e1 cms/package.json --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/cms/package.json Fri Nov 13 11:02:22 2015 +0100 @@ -0,0 +1,12 @@ +{ + "name": "corpus-cms", + "version": "0.0.1", + "description": "drupal module to embed the Ember app \"app-client\"", + "scripts": { + "build": "npm run build --prefix app-client/ && gulp copy-module" + }, + "author": "IRI", + "devDependencies": { + "gulp": "^3.9.0" + } +}