Skip to content

Commit 79164cd

Browse files
Initial project setup
0 parents  commit 79164cd

File tree

8 files changed

+154
-0
lines changed

8 files changed

+154
-0
lines changed

.babelrc

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
{
2+
"presets": ["es2015"]
3+
}

LICENSE

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
The MIT License (MIT)
2+
3+
Copyright (c) 2016 Nikita Savchenko, [email protected]
4+
5+
Permission is hereby granted, free of charge, to any person obtaining a copy
6+
of this software and associated documentation files (the "Software"), to deal
7+
in the Software without restriction, including without limitation the rights
8+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9+
copies of the Software, and to permit persons to whom the Software is
10+
furnished to do so, subject to the following conditions:
11+
12+
The above copyright notice and this permission notice shall be included in all
13+
copies or substantial portions of the Software.
14+
15+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21+
SOFTWARE.

README.md

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
# iKnow Entity Browser
2+
3+
A visualizer of iKnow entities.
4+
5+
Development
6+
-----------
7+
8+
Requires [Node.JS](https://nodejs.org) (v0.10.0-6.2.2+),
9+
[Git](https://git-scm.com) and
10+
[Caché](http://www.intersystems.com/library/software-downloads/) 2017.1+
11+
to be installed.
12+
13+
To install & test, open up a terminal and execute the following set of commands:
14+
15+
```sh
16+
git clone https://github.com/intersystems-ru/iknow-entity-browser
17+
cd iknow-entity-browser
18+
npm install
19+
gulp
20+
```
21+
22+
Then, open `build/static/index.html` file.

gulpfile.babel.js

Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
import gulp from "gulp";
2+
import rimraf from "gulp-rimraf";
3+
import preprocess from "gulp-preprocess";
4+
import cssMin from "gulp-cssmin";
5+
import browserify from "browserify";
6+
import to5ify from "6to5ify";
7+
import streamify from "gulp-streamify";
8+
import source from "vinyl-source-stream";
9+
import scss from "gulp-sass";
10+
import pkg from "./package.json";
11+
12+
const
13+
SOURCE_DIR = `${ __dirname }/src`,
14+
BUILD_DIR = `${ __dirname }/build`,
15+
context = {
16+
package: pkg
17+
};
18+
19+
gulp.task("clean", () => {
20+
return gulp.src(BUILD_DIR, { read: false })
21+
.pipe(rimraf());
22+
});
23+
24+
gulp.task("cls", ["clean"], () => {
25+
return gulp.src(SOURCE_DIR + "/cls/**/*.cls")
26+
.pipe(preprocess({ context: context }))
27+
.pipe(gulp.dest(BUILD_DIR + "/cls"));
28+
});
29+
30+
gulp.task("html", ["clean"], () => {
31+
return gulp.src(SOURCE_DIR + "/static/**/*.html")
32+
.pipe(preprocess({ context: context }))
33+
.pipe(gulp.dest(BUILD_DIR + "/static"));
34+
});
35+
36+
gulp.task("js", ["clean"], () => {
37+
return browserify(`${ SOURCE_DIR }/static/js/index.js`, { debug: true })
38+
.transform(to5ify)
39+
.bundle()
40+
.on(`error`, (err) => { console.error(err); })
41+
.pipe(source("index.js"))
42+
.pipe(streamify(preprocess({ context: context })))
43+
.pipe(gulp.dest(`${ BUILD_DIR }/static/js`));
44+
});
45+
46+
gulp.task("css", ["clean"], () => {
47+
return gulp.src(`${ SOURCE_DIR }/static/scss/index.scss`)
48+
.pipe(scss().on("error", scss.logError))
49+
.pipe(cssMin())
50+
.pipe(gulp.dest(`${ BUILD_DIR }/static/css`));
51+
});
52+
53+
gulp.task("default", ["cls", "html", "js", "css"]);

package.json

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
{
2+
"name": "iknow-entity-browser",
3+
"version": "0.0.1",
4+
"description": "Visualizer for iKnow entities",
5+
"main": "gulpfile.babel.js",
6+
"scripts": {
7+
"gulp": "gulp",
8+
"build": "npm run gulp"
9+
},
10+
"repository": {
11+
"type": "git",
12+
"url": "https://github.com/intersystems-ru/iknow-entity-browser"
13+
},
14+
"author": "ZitRo",
15+
"license": "MIT",
16+
"devDependencies": {
17+
"6to5ify": "^4.1.1",
18+
"babel": "^6.5.2",
19+
"babel-core": "^6.18.2",
20+
"babel-preset-es2015": "^6.18.0",
21+
"browserify": "^13.1.1",
22+
"gulp": "^3.9.1",
23+
"gulp-cssmin": "^0.1.7",
24+
"gulp-preprocess": "^2.0.0",
25+
"gulp-rimraf": "^0.2.0",
26+
"gulp-sass": "^2.3.2",
27+
"gulp-streamify": "^1.0.2",
28+
"vinyl-source-stream": "^1.1.0"
29+
}
30+
}

src/static/index.html

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
<!DOCTYPE html>
2+
<html lang="en">
3+
<head>
4+
<meta charset="UTF-8">
5+
<title>iKnow Entity Browser</title>
6+
<meta name="author" content="ZitRo">
7+
<link rel="stylesheet" href="css/index.css"/>
8+
<script type="text/javascript" src="js/index.js" async></script>
9+
</head>
10+
<body>
11+
<div class="version">v<!-- @echo package.version --></div>
12+
</body>
13+
</html>

src/static/js/index.js

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
if (document.readyState !== "loading")
2+
init();
3+
else
4+
document.addEventListener(`DOMContentLoaded`, init, false);
5+
6+
function init () {
7+
8+
}

src/static/scss/index.scss

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
html, body {
2+
margin: 0;
3+
padding: 0;
4+
}

0 commit comments

Comments
 (0)