Skip to content

Commit 7bf4276

Browse files
committed
initial commit
0 parents  commit 7bf4276

15 files changed

Lines changed: 287 additions & 0 deletions

.babelrc

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

.editorconfig

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
# editorconfig.org
2+
root = true
3+
[*]
4+
indent_style= space
5+
indent_size= 2
6+
end_of_line= lf
7+
charset = utf-8
8+
trim_trailing_whitespace= true
9+
insert_final_newline= true
10+
11+
[*.md]
12+
trim_trailing_whitespace= false

.eslintrc.json

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
{
2+
"root": true,
3+
"extends": [
4+
"eslint:recommended",
5+
"plugin:import/errors",
6+
"plugin:import/warnings"
7+
],
8+
"parserOptions": {
9+
"ecmaVersion": 7,
10+
"sourceType": "module"
11+
},
12+
"env": {
13+
"browser": true,
14+
"node": true,
15+
"mocha": true
16+
},
17+
"rules": {
18+
"no-console": 1 // 0 Off; 1 Warning; 2 Error
19+
}
20+
}

.gitignore

Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
# Created by .ignore support plugin (hsz.mobi)
2+
### Node template
3+
# Logs
4+
logs
5+
*.log
6+
npm-debug.log*
7+
yarn-debug.log*
8+
yarn-error.log*
9+
10+
.idea/
11+
12+
# Runtime data
13+
pids
14+
*.pid
15+
*.seed
16+
*.pid.lock
17+
18+
# Directory for instrumented libs generated by jscoverage/JSCover
19+
lib-cov
20+
21+
# Coverage directory used by tools like istanbul
22+
coverage
23+
24+
# nyc test coverage
25+
.nyc_output
26+
27+
# Bower dependency directory (https://bower.io/)
28+
bower_components
29+
30+
# node-waf configuration
31+
.lock-wscript
32+
33+
# Compiled binary addons (http://nodejs.org/api/addons.html)
34+
build/Release
35+
36+
# Dependency directories
37+
node_modules/
38+
jspm_packages/
39+
40+
# Optional npm cache directory
41+
.npm
42+
43+
# Optional eslint cache
44+
.eslintcache
45+
46+
# Optional REPL history
47+
.node_repl_history
48+
49+
# Output of 'npm pack'
50+
*.tgz
51+
52+
# Yarn Integrity file
53+
.yarn-integrity
54+
55+
# dotenv environment variables file
56+
.env

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
course about setting up a JavaScript Development Environment

buildScripts/srcServer.js

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
import express from 'express';
2+
import path from 'path';
3+
import open from 'open';
4+
import webpack from 'webpack';
5+
import config from '../webpack.config.dev';
6+
7+
/* eslint-disable no-console */
8+
const port = 3000;
9+
const app = express();
10+
const compiler = webpack(config);
11+
12+
app.use(require('webpack-dev-middleware')(compiler, {
13+
noInfo: true,
14+
publicPath: config.output.publicPath
15+
}));
16+
17+
app.get('/', function (req, res) {
18+
res.sendFile(path.join(__dirname, '../src/index.html'));
19+
});
20+
21+
app.listen(port, function (err) {
22+
if (err) {
23+
console.log(err);
24+
} else {
25+
open(`http://localhost:${port}`, 'google chrome');
26+
}
27+
})

buildScripts/startMessage.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
import chalk from 'chalk';
2+
3+
console.log(chalk.green('Starting app in dev mode...')); // eslint-disable-line no-console

buildScripts/testSetup.js

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
// this file isn't transpiled, so must use CommonJS and ES5
2+
3+
// Register babel to transpile before our test run.
4+
require('babel-register')();
5+
6+
// Disable webpack features that Mocha doesn't understand.
7+
require.extensions['.css'] = function () {
8+
9+
};

package.json

Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
{
2+
"name": "javascript-development-environment",
3+
"version": "1.0.0",
4+
"description": "JavaScript development environment",
5+
"scripts": {
6+
"prestart": "babel-node buildScripts/startMessage.js",
7+
"start": "npm-run-all --parallel security-check open:src lint:watch test:watch",
8+
"open:src": "babel-node buildScripts/srcServer.js",
9+
"lint": "esw webpack.config.*, src, buildScripts --color",
10+
"lint:watch": "npm run lint -- --watch",
11+
"security-check": "nsp check",
12+
"localtunnel": "lt --port 3000",
13+
"share": "npm-run-all --parallel open:src localtunnel",
14+
"test": "mocha --reporter progress buildScripts/testSetup.js \"src/**/*.test.js\"",
15+
"test:watch": "npm run test -- --watch"
16+
},
17+
"author": "kildem",
18+
"license": "MIT",
19+
"dependencies": {
20+
"whatwg-fetch": "1.0.0"
21+
},
22+
"devDependencies": {
23+
"babel-cli": "^6.24.0",
24+
"babel-core": "^6.24.0",
25+
"babel-loader": "^6.4.1",
26+
"babel-preset-latest": "^6.24.0",
27+
"babel-register": "^6.24.0",
28+
"chai": "3.5.0",
29+
"chalk": "1.1.3",
30+
"cheerio": "0.22.0",
31+
"compression": "1.6.2",
32+
"cross-env": "3.1.3",
33+
"css-loader": "^0.28.0",
34+
"eslint": "^3.19.0",
35+
"eslint-plugin-import": "^2.2.0",
36+
"eslint-watch": "^3.0.1",
37+
"express": "4.14.0",
38+
"extract-text-webpack-plugin": "1.0.1",
39+
"html-webpack-plugin": "2.22.0",
40+
"jsdom": "^9.12.0",
41+
"json-schema-faker": "^0.4.1",
42+
"json-server": "^0.9.6",
43+
"localtunnel": "^1.8.2",
44+
"mocha": "^3.2.0",
45+
"nock": "8.1.0",
46+
"npm-run-all": "^4.0.2",
47+
"nsp": "^2.6.3",
48+
"numeral": "^2.0.6",
49+
"open": "0.0.5",
50+
"rimraf": "2.5.4",
51+
"style-loader": "^0.16.1",
52+
"webpack": "^2.3.3",
53+
"webpack-dev-middleware": "^1.10.1",
54+
"webpack-hot-middleware": "^2.18.0",
55+
"webpack-md5-hash": "0.0.5"
56+
}
57+
}

src/index.css

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
body {
2+
font-family: Sans-Serif;
3+
}
4+
5+
table th {
6+
padding: 5px
7+
}

0 commit comments

Comments
 (0)