Skip to content

Commit 3ccc0c9

Browse files
committed
Adding initial file structure, configs, npm scripts, etc.
1 parent 69b3e73 commit 3ccc0c9

8 files changed

+125
-0
lines changed

.babelrc

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

package.json

+45
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
{
2+
"name": "bingo-blower",
3+
"version": "1.0.0",
4+
"description": "POC for a Bingo blower component with nice animations created with CreateJS.",
5+
"main": "index.js",
6+
"scripts": {
7+
"prestart": "babel-node tools/start-message.js",
8+
"start": "npm-run-all --parallel test:watch open:src lint:watch",
9+
"open:src": "babel-node tools/srcServer.js",
10+
"lint": "node_modules/.bin/esw webpack.config.* src tools",
11+
"lint:watch": "npm run lint -- --watch",
12+
"test": "mocha --reporter spec tools/testSetup.js \"src/**/*.test.js\"",
13+
"test:watch": "npm run test -- --watch",
14+
"clean-dist": "npm run remove-dist && mkdir dist",
15+
"remove-dist": "node_modules/.bin/rimraf ./dist",
16+
"build:html": "babel-node tools/buildHtml.js",
17+
"prebuild": "npm-run-all clean-dist test lint build:html",
18+
"build": "babel-node tools/build.js",
19+
"postbuild": "babel-node tools/distServer.js"
20+
},
21+
"repository": {
22+
"type": "git",
23+
"url": "git+https://github.com/mihailgaberov/bingo-blower.git"
24+
},
25+
"keywords": [
26+
"bingo",
27+
"game",
28+
"blower",
29+
"animation",
30+
"es6",
31+
"javascript"
32+
],
33+
"author": "Mihail Gaberov",
34+
"license": "MIT",
35+
"bugs": {
36+
"url": "https://github.com/mihailgaberov/bingo-blower/issues"
37+
},
38+
"homepage": "https://github.com/mihailgaberov/bingo-blower#readme",
39+
"devDependencies": {
40+
"babel-preset-es2015": "6.6.0",
41+
"colors": "^1.1.2",
42+
"path": "^0.12.7",
43+
"webpack": "^2.2.1"
44+
}
45+
}

src/index.html

+11
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
<!DOCTYPE html>
2+
<html lang="en">
3+
<head>
4+
<meta charset="UTF-8">
5+
<title>Bingo Blower</title>
6+
</head>
7+
<body>
8+
<div id="app"></div>
9+
<script src="/bundle.js"></script>
10+
</body>
11+
</html>

src/index.js

+4
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
/**
2+
* Created by Mihail on 3/5/2017.
3+
*/
4+
console.log('It works!');

src/styles/styles.css

Whitespace-only changes.

tools/src-server.js

+25
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
/**
2+
* Created by Mihail on 3/5/2017.
3+
*/
4+
import express from 'express';
5+
import webpack from 'webpack';
6+
import path from 'path';
7+
import config from '../webpack.config.js';
8+
import open from 'open';
9+
10+
const port = 3000;
11+
const app = express();
12+
const compiler = webpack(config);
13+
14+
15+
app.get('*', function(req, res) {
16+
res.sendFile(path.join( __dirname, '../src/index.html'));
17+
});
18+
19+
app.listen(port, function(err) {
20+
if (err) {
21+
console.log(err);
22+
} else {
23+
open(`http://localhost:${port}`);
24+
}
25+
});

tools/start-message.js

+6
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
/**
2+
* Created by Mihail on 3/5/2017.
3+
*/
4+
import colors from 'colors'
5+
6+
console.log('Starting app in dev mode...' .green)

webpack.config.js

+31
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
import webpack from 'webpack';
2+
3+
export default {
4+
debug: true,
5+
noInfo: false,
6+
entry: [
7+
path.resolve(__dirname, 'src/index')
8+
],
9+
target: 'web',
10+
output: {
11+
path: __dirname + '/dist', // Note: Physical files are only output by the production build task `npm run build`.
12+
publicPath: '/',
13+
filename: 'bundle.js'
14+
},
15+
devServer: {
16+
contentBase: path.resolve(__dirname, 'src')
17+
},
18+
module: {
19+
loaders: [
20+
{test: /\.js$/, include: path.join(__dirname, 'src'), loaders: ['babel']},
21+
{test: /(\.css)$/, loaders: ['style', 'css']}
22+
]
23+
},
24+
externals: {
25+
// Include createjs script on your page, then add the below.
26+
// The left hand side represents the global module that gets exposed to your ES6 code
27+
// The right hand side represents the object that is exposed/imported from your externally referenced script.
28+
29+
"createjs": "createjs"
30+
}
31+
};

0 commit comments

Comments
 (0)