Commit cf5dcc15 cf5dcc15bcf72e4c74b64d0df59ed3d466170e3f by Vincent Peybernes

#7 Add build task to transpil

1 parent 4d61bcc8
Pipeline #10 for cf5dcc15 failed in 55 seconds
.idea
node_modules
\ No newline at end of file
node_modules
dist
\ No newline at end of file
......
......@@ -5,10 +5,22 @@ cache:
- node_modules/
stages:
- install
- test
- build
install:
stage: install
script:
- npm install
node_test:
stage: test
script:
- npm install
- npm test
build:
stage: build
script:
- npm run build
......
/**
* Created by Techniv on 05/12/2016.
*/
const srcPath = './lib/relative-placement.js';
const distPath = './dist/';
var gulp = require('gulp');
var babel = require('gulp-babel');
var del = require('del');
gulp.task('default', ['build']);
gulp.task('build',['clean'], ()=>{
return gulp.src(srcPath)
.pipe(babel({
presets: ['es2015']
}))
.pipe(gulp.dest(distPath));
});
gulp.task('clean',() => {
return del(distPath);
});
\ No newline at end of file
/**
* Created by Techniv on 30/11/2016.
* @module relative_placement
* @module relativePlacement
*/
(function (define) {
module.exports = define();
(function (definition) {
// Node export
if(global && module && module.exports) return module.exports = definition();
//Browser export
if(window){
if(angular && angular.version.major == 1) return angular.module('relativePlacement').factory('RelativePlacement', definition);
if(requirejs) return define(definition());
window.RelativePlacement = definition();
}
})(function(){
/**
......
......@@ -3,12 +3,16 @@
"version": "0.0.1",
"devDependencies": {
"gulp": "*",
"nodeunit": "*",
"mocha": "*",
"karma": "*",
"karma-mocha": "*"
"gulp-babel": "*",
"del": "*",
"babel-preset-es2015": "*",
"mocha": "*"
},
"scripts": {
"build": "./node_modules/.bin/gulp build",
"test" : "./node_modules/.bin/mocha bdd tests/node/**/*Spec.js"
},
"engines": {
"node": ">=6.9.*"
}
}
......
......@@ -2,7 +2,7 @@
* Created by Techniv on 30/11/2016.
*/
var assert = require('assert');
var RelativePlacement = require('../../relative-placement');
var RelativePlacement = require('../../lib/relative-placement');
describe('RelativePlacement global', () => {
it('should provide RelativePlacement constructor', () => {
......
......@@ -3,7 +3,7 @@
*/
var assert = require('assert');
/** @type RelativePlacement.relativePlacement */
var relativePlacement = require('../../relative-placement').relativePlacement;
var relativePlacement = require('../../lib/relative-placement').relativePlacement;
/** @var {TestData[]} */
var testDataList = require('./results_data.json');
describe('RelativePlacement algo', () => {
......