Skip to content

Commit 05ab507

Browse files
Merge pull request #32 from ansble/refactor/uuids-websockets-autoids
Refactor/uuids websockets autoids
2 parents c808cae + cb83160 commit 05ab507

23 files changed

Lines changed: 926 additions & 697 deletions

.eslintrc

Lines changed: 134 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,134 @@
1+
{
2+
"env": {
3+
"browser": true,
4+
"node": true,
5+
"es6": true
6+
},
7+
"rules": {
8+
"eqeqeq": 2,
9+
"curly": 2,
10+
"quotes": [2, "single"],
11+
"no-undef": 2,
12+
comma-style: [2, "first"],
13+
"camelcase": [2, {"properties": "always"}],
14+
"indent": 2,
15+
"no-mixed-spaces-and-tabs": 2,
16+
"one-var": [2, "always"],
17+
"arrow-body-style": [2, "always"],
18+
"arrow-parens": [2, "always"],
19+
"arrow-spacing": 2,
20+
"prefer-const": 1,
21+
"prefer-arrow-callback": 1,
22+
"prefer-template": 1,
23+
"no-var": 2,
24+
"strict": [2, "global"],
25+
"no-unused-vars": 2,
26+
"no-use-before-define": 2,
27+
"no-shadow-restricted-names": 2,
28+
"no-shadow": 2,
29+
"no-catch-shadow": 2,
30+
"no-path-concat": 2,
31+
"brace-style": 2,
32+
"array-bracket-spacing": [2, "always"],
33+
"block-spacing": [2, "always"],
34+
"comma-spacing": [2, {"before": false, "after": true}],
35+
"key-spacing": [2, {"beforeColon": false, "afterColon": true}],
36+
"new-cap": 2,
37+
"new-parens": 2,
38+
"newline-after-var": [2, "always"],
39+
"no-negated-condition": 1,
40+
"no-unneeded-ternary": 2,
41+
"no-nested-ternary": 2,
42+
"no-spaced-func": 2,
43+
"no-array-constructor": 2,
44+
"no-new-object": 2,
45+
"no-trailing-spaces": 2,
46+
"no-underscore-dangle": 1,
47+
"object-curly-spacing": [2, "always"],
48+
"quote-props": [2, "as-needed"],
49+
"semi": [2, "always"],
50+
"space-before-function-paren": 2,
51+
"space-after-keywords": 2,
52+
"space-in-parens": [2, "never"],
53+
"space-infix-ops": 2,
54+
"space-return-throw-case": 2,
55+
"space-unary-ops": 2,
56+
"spaced-comment": [2, "always"],
57+
"no-cond-assign": 2,
58+
"no-constant-condition": 2,
59+
"no-debugger": 2,
60+
"valid-typeof": 2,
61+
"use-isnan": 2,
62+
"no-unreachable": 2,
63+
"no-unexpected-multiline": 2,
64+
"no-sparse-arrays": 2,
65+
"no-regex-spaces": 2,
66+
"no-obj-calls": 2,
67+
"no-invalid-regexp": 2,
68+
"no-inner-declarations": 2,
69+
"no-func-assign": 2,
70+
"no-extra-semi": 2,
71+
"no-extra-parens": 2,
72+
"no-extra-boolean-cast": 2,
73+
"no-ex-assign": 2,
74+
"no-empty": 2,
75+
"no-empty-character-class": 2,
76+
"no-duplicate-case": 2,
77+
"no-dupe-args": 2,
78+
"no-dupe-keys": 2,
79+
"no-control-regex": 2,
80+
"yoda": 2,
81+
"wrap-iife": [2, "inside"],
82+
"vars-on-top": 2,
83+
"radix": 2,
84+
"no-with": 2,
85+
"no-warning-comments": 1,
86+
"no-void": 2,
87+
"no-useless-concat": 2,
88+
"no-useless-call": 2,
89+
"no-unused-expressions": 2,
90+
"no-throw-literal": 2,
91+
"no-sequences": 2,
92+
"no-self-compare": 2,
93+
"no-script-url": 2,
94+
"no-return-assign": 2,
95+
"no-redeclare": 2,
96+
"no-proto": 2,
97+
"no-process-env": 1,
98+
"no-param-reassign": [1, {"props": true}],
99+
"no-octal": 2,
100+
"no-new": 2,
101+
"no-new-wrappers": 2,
102+
"no-new-func": 2,
103+
"no-native-reassign": 1,
104+
"no-multi-str": 1,
105+
"no-multi-spaces": 2,
106+
"no-magic-numbers": 0,
107+
"no-loop-func": 1,
108+
"no-lone-blocks": 2,
109+
"no-labels": 2,
110+
"no-iterator": 2,
111+
"no-invalid-this": 2,
112+
"no-implied-eval": 2,
113+
"no-floating-decimal": 2,
114+
"no-fallthrough": 2,
115+
"no-extra-bind": 2,
116+
"no-extend-native": 2,
117+
"no-eval": 2,
118+
"no-eq-null": 2,
119+
"no-empty-label": 2,
120+
"no-div-regex": 1,
121+
"no-caller": 2,
122+
"no-alert": 2,
123+
"guard-for-in": 2,
124+
"dot-notation": 2,
125+
"dot-location": [2, "property"],
126+
"default-case": 1,
127+
"complexity": [1,5],
128+
129+
"max-len": [1, 100, 4],
130+
"no-bitwise": 2,
131+
"max-params": [1, 3],
132+
"max-depth": [2, 2]
133+
}
134+
}

Gulpfile.js

Lines changed: 23 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,8 @@ var gulp = require('gulp')
1313
, handlebars = require('gulp-handlebars')
1414
, defineModule = require('gulp-define-module')
1515
, declare = require('gulp-declare')
16-
16+
, eslint = require('gulp-eslint')
17+
1718
//for restarting node on server file changes...
1819
, spawn = require('child_process').spawn
1920
, node;
@@ -38,7 +39,7 @@ gulp.task('server', function() {
3839
if (node) {
3940
node.kill();
4041
}
41-
42+
4243
node = spawn('node', ['app.js'], {stdio: 'inherit'});
4344

4445
node.on('close', function (code) {
@@ -48,7 +49,22 @@ gulp.task('server', function() {
4849
});
4950
});
5051

51-
gulp.task('test', function (){
52+
gulp.task('lint', () => {
53+
return gulp.src([
54+
'**/*.js'
55+
, '!templates/**/*'
56+
, '!node_modules/**/*'
57+
, '!coverage/**/*'
58+
, '!test_stubs/**/*'
59+
, '!Gulpfile.js'
60+
, '!public/**/*'
61+
])
62+
.pipe(eslint('./.eslintrc'))
63+
.pipe(eslint.format())
64+
.pipe(eslint.failAfterError());
65+
});
66+
67+
gulp.task('test', [ 'lint' ], function (){
5268
'use strict';
5369

5470
return gulp.src(['**/**_test.js', '!node_modules/**/*'], {read: false})
@@ -57,7 +73,7 @@ gulp.task('test', function (){
5773

5874
gulp.task('localBuild', ['buildTemplates'], function(){
5975
'use strict';
60-
76+
6177
gulp.src([
6278
'public/javascripts/libs/*.js'
6379
, '!public/javascripts/libs/zepto.min.js'
@@ -101,7 +117,7 @@ gulp.task('buildTemplates', function(){
101117

102118
gulp.task('build:prod', ['buildTemplates', 'localBuild'], function(){
103119
'use strict';
104-
120+
105121
gulp.src([
106122
'public/javascripts/action/*.min.js'
107123
, 'public/javascripts/built/*.min.js'
@@ -113,7 +129,7 @@ gulp.task('build:prod', ['buildTemplates', 'localBuild'], function(){
113129

114130
gulp.task('dev', ['server', 'sass'], function () {
115131
'use strict';
116-
132+
117133
gulp.watch([
118134
'./public/stylesheets/main.scss'
119135
, './public/stylesheets/colors.scss'
@@ -137,4 +153,4 @@ process.on('exit', function() {
137153
if (node) {
138154
node.kill();
139155
}
140-
});
156+
});

README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
1-
# Design Frontier
1+
# Ansble Store
22
------
33

4-
Rebuild of my website
4+
A simple REST APIed data store
55

66
------
77

8-
Built with [monumentjs](http://monument.ansble.com)
8+
Built with [monumentjs](http://monument.ansble.com)

app.js

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,15 @@
1-
var monument = require('monument');
1+
'use strict';
2+
3+
const monument = require('monument')
4+
, env = require('./utils/env');
25

36
require('./data/database');
47
require('./security');
58

69
monument.server({
7-
routePath: './routes'
8-
, templatePath: './templates'
9-
, publicPath: './public'
10-
, port: process.env.PORT || 3002
11-
, compress: false && (process.env.NODE_ENV && process.env.NODE_ENV === 'production')
12-
});
10+
routePath: './routes'
11+
, templatePath: './templates'
12+
, publicPath: './public'
13+
, port: env.PORT || 3002
14+
, compress: env.IS_PRODUCTION
15+
});

0 commit comments

Comments
 (0)