Skip to content

Changes towards modularity #71

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 5 commits into from
Jan 15, 2016
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .eslintignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
**/node_modules/
16 changes: 16 additions & 0 deletions .eslintrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
{
"extends": "defaults",

"env": {
"browser": true,
"node": true
},

"globals": {
"$": true
},

"rules": {
"no-console": 0
}
}
246 changes: 0 additions & 246 deletions Gruntfile.js

This file was deleted.

30 changes: 30 additions & 0 deletions devserver.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
var path = require('path');
var express = require('express');
var webpack = require('webpack');
var config = require('./webpack.config');

var port = 8000;
var app = express();
var compiler = webpack(config);

app.use(express.static(process.cwd()));

app.use(require('webpack-dev-middleware')(compiler, {
noInfo: true,
publicPath: config.output.publicPath
}));

app.use(require('webpack-hot-middleware')(compiler));

app.get('/', function (req, res) {
res.sendFile(path.join(__dirname, 'index.html'));
});

app.listen(port, '0.0.0.0', function (err) {
if (err) {
console.log(err);
return;
}

console.log('Listening at http://0.0.0.0:%s', port);
});
33 changes: 33 additions & 0 deletions index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
<!doctype html>
<html lang="en">
<head>
<title>Demo page</title>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta http-equiv="x-ua-compatible" content="ie=edge">
</head>
<body>
<div id="chart">
st=>start: Start|past:>http://www.google.com[blank]
e=>end: End:>http://www.google.com
op1=>operation: My Operation|past
op2=>operation: Stuff|current
sub1=>subroutine: My Subroutine|invalid
cond=>condition: Yes
or No?|approved:>http://www.google.com
c2=>condition: Good idea|rejected
io=>inputoutput: catch something...|request

st->op1(right)->cond
cond(yes, right)->c2
cond(no)->sub1(left)->op1
c2(yes)->io->e
c2(no)->op2->e
</div>
<script src="/node_modules/jquery/dist/jquery.js"></script>
<script src="/build/flowchart.js"></script>
<script>
$('#chart').flowChart();
</script>
</body>
</html>
13 changes: 13 additions & 0 deletions index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
require('./src/flowchart.shim');
var parse = require('./src/flowchart.parse');
require('./src/jquery-plugin');

var FlowChart = {
parse: parse
};

if (typeof window !== 'undefined') {
window.FlowChart = FlowChart;
}

module.exports = FlowChart;
34 changes: 18 additions & 16 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,22 +2,32 @@
"author": "adrai",
"name": "flowchart",
"version": "1.4.2",
"main": "./index",
"private": false,
"engines": {
"node": "~v0.4.12"
},
"dependencies": {},
"dependencies": {
"raphael": "git://github.com/DmitryBaranovskiy/raphael.git"
},
"devDependencies": {
"grunt": ">=0.4.1",
"grunt-rigger": ">=0.5.0",
"grunt-contrib": ">=0.1.0",
"eslint": "^1.10.3",
"eslint-config-defaults": "^8.0.2",
"express": ">= 0.0.1",
"async": ">= 0.1.18",
"jquery": "^2.2.0",
"lodash": ">=0.2.1",
"zipstream": ">=0.2.1"
"moment": "^2.11.1",
"webpack": "^1.12.11",
"webpack-dev-middleware": "^1.4.0",
"webpack-hot-middleware": "^2.6.0"
},
"scripts": {
"test": ""
"start": "node devserver.js",
"lint": "eslint src",
"build:unminified": "NODE_ENV=production webpack -d --config webpack.config.js",
"build:minified": "NODE_ENV=production MINIFIED=1 webpack -d --config webpack.config.js",
"build": "npm run build:unminified && npm run build:minified",
"test": "npm run lint"
},
"repository": {
"type": "git",
Expand All @@ -29,13 +39,5 @@
"script"
],
"homepage": "http://flowchart.js.org/",
"license": "MIT",
"files": [
"release/flowchart.js",
"release/flowchart.min.js",
"release/flowchart.min.map",
"release/flowchart.amd.js",
"release/flowchart.amd.min.js",
"release/flowchart.amd.min.map"
]
"license": "MIT"
}
Loading