Skip to content

Commit a80a74f

Browse files
project build improvements, fixes to origin & styles
1 parent 367a7be commit a80a74f

File tree

7 files changed

+35
-15
lines changed

7 files changed

+35
-15
lines changed

gulpfile.js

Lines changed: 26 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ var gulp = require("gulp"),
44
concat = require("gulp-concat"),
55
uglify = require("gulp-uglify"),
66
wrap = require("gulp-wrap"),
7+
stripComments = require("gulp-strip-comments"),
78
addsrc = require('gulp-add-src'),
89
minifyCSS = require("gulp-minify-css"),
910
htmlReplace = require("gulp-html-replace"),
@@ -14,6 +15,7 @@ var gulp = require("gulp"),
1415
rename = require("gulp-rename");
1516

1617
var banner = [
18+
"",
1719
"/** <%= pkg.name %>",
1820
" ** <%= pkg.description %>",
1921
" ** @author <%= pkg.author %>",
@@ -29,24 +31,40 @@ gulp.task("clean", function () {
2931
.pipe(clean());
3032
});
3133

32-
gulp.task("gatherScripts", ["clean"], function () {
33-
return gulp.src("web/js/*.js")
34-
.pipe(concat("CacheUMLExplorer.js"))
35-
.pipe(replace(/\/\*\{\{replace:version}}\*\//, "\"" + pkg["version"] + "\""))
36-
.pipe(wrap("CacheUMLExplorer = (function(){<%= contents %> return CacheUMLExplorer;}());"))
34+
gulp.task("gatherLibs", ["clean"], function () {
35+
return gulp.src([
36+
"web/jsLib/joint.shapes.uml.js"
37+
])
3738
.pipe(uglify({
3839
output: {
3940
ascii_only: true,
4041
width: 30000,
4142
max_line_len: 30000
4243
}
4344
}))
44-
.pipe(header(banner, { pkg: pkg }))
4545
.pipe(addsrc.prepend([
4646
"web/jsLib/joint.min.js",
47-
"web/jsLib/joint.shapes.uml.js",
4847
"web/jsLib/joint.layout.DirectedGraph.min.js"
4948
]))
49+
.pipe(stripComments({ safe: true }))
50+
.pipe(concat("CacheUMLExplorer.js"))
51+
.pipe(gulp.dest("build/web/js/"));
52+
});
53+
54+
gulp.task("gatherScripts", ["clean", "gatherLibs"], function () {
55+
return gulp.src("web/js/*.js")
56+
.pipe(concat("CacheUMLExplorer.js"))
57+
.pipe(replace(/[^\s]+\/\*build.replace:(.*)\*\//g, "$1"))
58+
.pipe(wrap("CacheUMLExplorer = (function(){<%= contents %> return CacheUMLExplorer;}());"))
59+
.pipe(uglify({
60+
output: {
61+
ascii_only: true,
62+
width: 30000,
63+
max_line_len: 30000
64+
}
65+
}))
66+
.pipe(header(banner, { pkg: pkg }))
67+
.pipe(addsrc.prepend("build/web/js/CacheUMLExplorer.js"))
5068
.pipe(concat("CacheUMLExplorer.js"))
5169
.pipe(gulp.dest("build/web/js/"));
5270
});
@@ -90,7 +108,7 @@ gulp.task("exportCacheXML", [
90108
/\{\{replace:js}}/,
91109
function () { return fs.readFileSync("build/web/js/CacheUMLExplorer.js", "utf-8"); }
92110
))
93-
.pipe(rename(function (path) { path.basename += "-v" + pkg["version"]; }))
111+
.pipe(rename(function (path) { path.basename = "CacheUMLExplorer-v" + pkg["version"]; }))
94112
.pipe(gulp.dest("build/Cache"));
95113
});
96114

package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "CacheUMLExplorer",
3-
"version": "0.2",
3+
"version": "0.2.0",
44
"description": "An UML Class explorer for InterSystems Caché",
55
"directories": {
66
"test": "test"
@@ -17,6 +17,7 @@
1717
"gulp-minify-css": "^0.3.11",
1818
"gulp-rename": "^1.2.0",
1919
"gulp-replace": "^0.5.0",
20+
"gulp-strip-comments": "^1.0.1",
2021
"gulp-uglify": "^1.0.1",
2122
"gulp-wrap": "^0.5.0",
2223
"gulp-zip": "^2.0.2"

web/css/extras.css

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,8 +33,8 @@
3333
width: 30px;
3434
height: 30px;
3535
border-radius: 15px;
36-
background: white;
37-
box-shadow: 0 0 5px white;
36+
background: whitesmoke;
37+
box-shadow: 0 0 5px whitesmoke;
3838
z-index: 1;
3939
}
4040

web/index.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
<html>
33
<head lang="en">
44
<meta charset="UTF-8">
5-
<title>Caché UML explorer</title>
5+
<title>Cache UML explorer</title>
66
<!-- build:css -->
77
<link rel="stylesheet" href="css/interface.css"/>
88
<link rel="stylesheet" href="css/treeView.css"/>

web/js/Source.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
var Source = function () {
22

3-
this.URL = "http://localhost:57773/UMLExplorer";
3+
this.URL = window.location.protocol + "//" + window.location.hostname + ":" +
4+
57773/*build.replace:window.location.port*/ + "/UMLExplorer";
45

56
};
67

web/jsLib/joint.layout.DirectedGraph.min.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

web/jsLib/joint.shapes.uml.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
/*! JointJS v0.9.3 - JavaScript diagramming library 2015-02-03
1+
/* JointJS v0.9.3 - JavaScript diagramming library 2015-02-03
22
33
44
This Source Code Form is subject to the terms of the Mozilla Public

0 commit comments

Comments
 (0)