Refactor or remove some file

This commit is contained in:
Tyler Long
2017-04-22 17:13:05 +08:00
parent 391149dbd8
commit 1c7c109960
6 changed files with 5 additions and 41 deletions

View File

@@ -1,7 +1,6 @@
var gulp = require('gulp') var gulp = require('gulp')
var path = require('path') var path = require('path')
var less = require('gulp-less') var less = require('gulp-less')
var rename = require('gulp-rename')
var concat = require('gulp-concat') var concat = require('gulp-concat')
gulp.task('editor-less', function () { gulp.task('editor-less', function () {
@@ -14,21 +13,4 @@ gulp.task('editor-less', function () {
.pipe(gulp.dest('./editor/css/')) .pipe(gulp.dest('./editor/css/'))
}) })
gulp.task('mermaid-less', function () { gulp.task('less', ['editor-less'])
gulp.src(['./src/less/*/mermaid.less'])
.pipe(less({
generateSourceMap: false, // default true
paths: [path.join(__dirname, 'less', 'includes')]
}))
.pipe(rename(function (path) {
if (path.dirname === 'default') {
path.basename = 'mermaid'
} else {
path.basename = 'mermaid.' + path.dirname
}
path.dirname = ''
}))
.pipe(gulp.dest('./dist/'))
})
gulp.task('less', ['mermaid-less', 'editor-less'])

View File

@@ -1,11 +1,10 @@
var gulp = require('gulp') var gulp = require('gulp')
var jasmine = require('gulp-jasmine') var jasmine = require('gulp-jasmine')
var shell = require('gulp-shell')
var istanbul = require('gulp-istanbul') var istanbul = require('gulp-istanbul')
var qunit = require('gulp-qunit') var qunit = require('gulp-qunit')
var bower = require('gulp-bower') var bower = require('gulp-bower')
gulp.task('test', ['coverage', 'tape', 'jasmine', 'qunit']) gulp.task('test', ['coverage', 'jasmine', 'qunit'])
gulp.task('jasmine', ['jison', 'lint'], function () { gulp.task('jasmine', ['jison', 'lint'], function () {
return gulp.src(['src/**/*.spec.js']) return gulp.src(['src/**/*.spec.js'])
@@ -17,8 +16,6 @@ gulp.task('jas', function () {
.pipe(jasmine({ includeStackTrace: true })) .pipe(jasmine({ includeStackTrace: true }))
}) })
gulp.task('tape', shell.task(['node_modules/.bin/tape ./test/cli_test-*.js']))
gulp.task('coverage', function (cb) { gulp.task('coverage', function (cb) {
gulp.src(['src/**/*.js', '!src/**/*.spec.js']) gulp.src(['src/**/*.js', '!src/**/*.spec.js'])
.pipe(istanbul()) // Covering files .pipe(istanbul()) // Covering files

View File

@@ -1,3 +0,0 @@
#!/usr/bin/env bash
yarn build-mermaid -- --watch & gulp live-server

View File

@@ -13,9 +13,6 @@
}); });
$(function(){ $(function(){
var graphDefinition = 'graph TB\na-->b'; var graphDefinition = 'graph TB\na-->b';
// var cb = function(html){
// console.log(html);
// }
console.log(mermaidAPI.render(graphDefinition)); console.log(mermaidAPI.render(graphDefinition));
console.log(mermaidAPI.render('id',graphDefinition)); console.log(mermaidAPI.render('id',graphDefinition));
}); });
@@ -24,4 +21,4 @@
<body> <body>
</body> </body>
</html> </html>

View File

@@ -1,11 +1,8 @@
body { body {
background: #fcfcfe; background: #fcfcfe;
font-family: Helvetica; font-family: Helvetica;
} }
.mermaid {
/* width:400px;*/
}
.actor { .actor {
stroke: #CCCCFF; stroke: #CCCCFF;
fill: #ECECFF; fill: #ECECFF;
@@ -80,4 +77,4 @@ text.actor {
stroke:none; stroke:none;
font-family: 'trebuchet ms', verdana, arial; font-family: 'trebuchet ms', verdana, arial;
font-size:14px; font-size:14px;
} }

View File

@@ -1,6 +0,0 @@
/**
* Created by knut on 14-12-02.
*/
const mermaid = require('mermaid')
console.log('Test page! mermaid version' + mermaid.version())