Skip to content

Commit

Permalink
Simplify build, dev and deploy steps.
Browse files Browse the repository at this point in the history
  • Loading branch information
drichard committed Jul 15, 2017
1 parent c0263f3 commit 4cb7150
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 86 deletions.
47 changes: 1 addition & 46 deletions Jakefile.js
Original file line number Diff line number Diff line change
Expand Up @@ -155,32 +155,6 @@ task("default", [ "build" ], function() {
// build on default
});

desc("Deploy project to github pages");
task("deploy", [ "build" ], function() {
console.log("Deploying project to github pages");
var exec = require('child_process').exec;
/**
* The command copies all files from /bin into github pages repo, commits
* and pushes the changes.
*/
var command = "cp -r bin/* ../drichard.github.com/mindmaps/; "
+ "cd ../drichard.github.com/mindmaps/; " + "git add .; "
+ "git commit -a -m 'deploy mindmaps'; " + "git push;";
exec(command, function(error, stdout, stderr) {

if (error !== null) {
console.log('exec error: ' + error);
} else {
console.log("Deployed all files successfully");
console.log("STDOUT:\n" + stdout);
}

if (stderr) {
console.log("STDERR: " + stderr);
}
});
});

desc("Generate JSDoc");
task("generate-docs", function() {
console.log("Creating project documentation");
Expand All @@ -198,23 +172,4 @@ task("generate-docs", function() {
console.log("STDERR: " + stderr);
}
});
});

desc("Increase version");
task("increase-version", function(version) {
if (!version) fail("No version given");

console.log("Increasing version to", version)
// TODO write script that increases version in mindmaps.js, package.json,
// creates a git tag, commits all changes and pushes to master
});

desc("Start dev server");
task("server", function() {
jake.exec("node server.js", {printStdout: true, printStderr: true});
});

desc("Start dev server with production files");
task("server-prod", ["build"], function() {
jake.exec("node server.js --production", {printStdout: true, printStderr: true});
});
});
12 changes: 4 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# mindmaps
mindmaps is a prototype of an HTML5 based mind mapping application. It lets you create neat looking mind maps in the browser.
mindmaps is a prototype of an HTML5 based mind mapping application. It lets you create neat looking mind maps in the browser.

## HTML5 goodness
- Written entirely in JavaScript
Expand All @@ -10,15 +10,11 @@ mindmaps is a prototype of an HTML5 based mind mapping application. It lets you


## Try it out
The latest stable build is hosted [here] (http://drichard.org/mindmaps).
The latest stable build is hosted [here](http://drichard.org/mindmaps).

## Build
Although the application runs fine if you launch `/src/index.html`, be aware that this is just the DEBUG mode for development. In debug mode quite a lot of output is sent to the console, ApplicationCache is deactivated and all script files are served individually and uncompressed.

If you plan to host the application please build it properly by running the build script.
In order to build the application yourself you need to have node.js and a couple of modules installed. To install them simply run `npm install` in the root directory.

Then run the jakefile with `jake`. The finished build will appear in `/bin`.
* Run `npm run start` to launch a local dev server. The app will be hosted at [http://localhost:3000](http://localhost:3000).
* Run `npm run build` to compile the production bundle. The artifacts will be located in `./bin`.


## Host yourself
Expand Down
9 changes: 6 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "mindmaps",
"description": "mindmaps is a prototype of an HTML5 based mind mapping application. It lets you create neat looking mind maps in the browser.",
"version": "0.7.3",
"version": "0.8.0",
"keywords": ["html5", "mindmap", "offline"],
"author": "David Richard",
"repository": {
Expand All @@ -12,7 +12,10 @@
"url": "http://github.com/drichard/mindmaps/issues"
},
"scripts": {
"postinstall" : "npm install -g jake"
"start": "cd src && python -m SimpleHTTPServer 3000",
"start:prod": "npm run build && cd bin && python -m SimpleHTTPServer 3000",
"build": "jake",
"deploy": "npm run build && gh-pages -d bin"
},
"license": {
"type": "AGPL",
Expand All @@ -22,7 +25,7 @@
"node": ">=0.6"
},
"dependencies": {
"node-static": "0.5.9",
"jake": "^8.0.15",
"uglify-js": "1.2.5"
}
}
29 changes: 0 additions & 29 deletions server.js

This file was deleted.

0 comments on commit 4cb7150

Please sign in to comment.