Commit ad6e8964 ad6e896497bb331ebc3a57f3c79ff600fd0b1560 by Vincent Peybernes

#9 Prepare publish - publishing process

1 parent cb379802
Pipeline #29 for ad6e8964 passed in 2 minutes 5 seconds
......@@ -7,6 +7,7 @@ cache:
stages:
- test
- build
- publish
node_test:
stage: test
......@@ -25,3 +26,17 @@ build:
script:
- npm install
- npm run build
publish:
stage: publish
when: manual
only:
- master
environment:
name: npm
url: https://www.npmjs.com/package/relative-placement-js
script:
- npm install
- npm version $PUBLISH_VERSION
- npm run build
- npm publish
\ No newline at end of file
......
### v0.1.0-rc _`2016-12-08`_
* Fix algorithm
* Improve test
* Add readme and licence
* Add export management
\ No newline at end of file
......@@ -7,15 +7,24 @@ const distPath = './dist/';
var gulp = require('gulp');
var babel = require('gulp-babel');
var replace = require('gulp-replace');
var rename = require('gulp-rename');
var del = require('del');
var package = require('./package.json');
gulp.task('default', ['build']);
gulp.task('build',['clean'], ()=>{
return gulp.src(srcPath)
.pipe(replace(/RelativePlacement.version = '.+?';/, 'RelativePlacement.version = \''+package.version+'\';'))
.pipe(gulp.dest(distPath))
.pipe(babel({
presets: ['es2015']
}))
.pipe(rename(path => {
path.basename += '-es2015'
}))
.pipe(gulp.dest(distPath));
});
......
......@@ -3,6 +3,7 @@
* @module relativePlacement
*/
(function (definition) {
// Node export
if(global && module && module.exports) return module.exports = definition();
//Browser export
......@@ -30,6 +31,8 @@
});
}
RelativePlacement.version = '0.0.0';
/**
* @name addCandidate
* @param {String} candidateName
......
......@@ -6,7 +6,7 @@
"name": "Techniv",
"email": "contact@techniv.fr"
},
"main": "./lib/relative-placement.js",
"main": "./dist/relative-placement.js",
"repository":{
"type": "git",
......@@ -19,6 +19,8 @@
"devDependencies": {
"gulp": "*",
"gulp-babel": "*",
"gulp-replace": "*",
"gulp-rename": "*",
"del": "*",
"babel-preset-es2015": "*",
"mocha": "*"
......