Skip to content

Commit 24b774f

Browse files
author
dhsaks
authored
Merge pull request #247 from hydrotik/feature/install-config-cleanup
Feature/install config cleanup
2 parents 405cbb6 + 49641c0 commit 24b774f

37 files changed

+307
-265
lines changed
File renamed without changes.

src/global/server/config.pages.js renamed to config.pages.js

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ function ConfigPages() {
5555
},
5656
webpack: {
5757
id: 'home',
58-
src: path.join(__dirname, '../client/pages/home/index')
58+
src: './src/global/client/pages/home/index'
5959
}
6060
},
6161
// %END PAGE%
@@ -72,7 +72,7 @@ function ConfigPages() {
7272
},
7373
webpack: {
7474
id: 'about',
75-
src: path.join(__dirname, '../client/pages/about/index')
75+
src: './src/global/client/pages/about/index'
7676
}
7777
},
7878
// %END PAGE%
@@ -89,7 +89,7 @@ function ConfigPages() {
8989
},
9090
webpack: {
9191
id: 'contact',
92-
src: path.join(__dirname, '../client/pages/contact/index')
92+
src: './src/global/client/pages/contact/index'
9393
}
9494
},
9595
// %END PAGE%
@@ -106,7 +106,7 @@ function ConfigPages() {
106106
},
107107
webpack: {
108108
id: 'signup',
109-
src: path.join(__dirname, '../client/pages/signup/index')
109+
src: './src/global/client/pages/signup/index'
110110
}
111111
},
112112
// %END PAGE%
@@ -123,7 +123,7 @@ function ConfigPages() {
123123
},
124124
webpack: {
125125
id: 'account',
126-
src: path.join(__dirname, '../client/pages/account/index')
126+
src: './src/global/client/pages/account/index'
127127
}
128128
},
129129
// %END PAGE%
@@ -140,7 +140,7 @@ function ConfigPages() {
140140
},
141141
webpack: {
142142
id: 'admin',
143-
src: path.join(__dirname, '../client/pages/admin/index')
143+
src: './src/global/client/pages/admin/index'
144144
}
145145
},
146146
// %END PAGE%
@@ -157,7 +157,7 @@ function ConfigPages() {
157157
},
158158
webpack: {
159159
id: 'login',
160-
src: path.join(__dirname, '../client/pages/login/index')
160+
src: './src/global/client/pages/login/index'
161161
}
162162
},
163163
// %END PAGE%
@@ -174,7 +174,7 @@ function ConfigPages() {
174174
},
175175
webpack: {
176176
id: 'dashboard',
177-
src: path.join(__dirname, '../client/pages/dashboard/index')
177+
src: './src/global/client/pages/dashboard/index'
178178
}
179179
}
180180
// %END PAGE%

package.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@
44
"description": "Webpack, Typescript, React, Redux, Hapi, Sass, Node, MongoDB, Falcor, Mongoose, Susy, Breakpoint",
55
"main": "./src/global/server/server.js",
66
"directories": {
7-
"clientBuild": "./www",
87
"doc": "docs"
98
},
109
"engines": {
@@ -14,7 +13,7 @@
1413
"engineStrict": true,
1514
"scripts": {
1615
"build-client": "NODE_ENV=production bash -c 'npm run clean; npm run lint-es; npm run typings-install; ./node_modules/.bin/webpack -p --verbose --colors --display-error-details --config webpack.config.client-hot.js'",
17-
"clean": "bash -c 'rm -rf ./www'",
16+
"clean": "node ./script/clean.js",
1817
"lint-ts": "tslint --config tslint.json --ext .ts,.tsx",
1918
"lint-jsc": "jscs . --config .jscsrc",
2019
"lint-es": "./node_modules/.bin/eslint --config .eslintrc --ignore-path .eslintignore --ext .js,.jsx,.es6 .",
@@ -47,6 +46,7 @@
4746
"animate.css": "^3.4.0",
4847
"async": "^1.5.2",
4948
"autotrace": "0.0.1",
49+
"babel-polyfill": "^6.9.1",
5050
"bcrypt": "^0.8.5",
5151
"boom": "^3.1.2",
5252
"bootstrap": "^4.0.0-alpha.2",
@@ -199,7 +199,7 @@
199199
"redux-thunk": "^1.0.0",
200200
"require-dir": "^0.3.0",
201201
"resolve-url-loader": "^1.4.3",
202-
"rimraf": "^2.4.3",
202+
"rimraf": "^2.5.2",
203203
"rx-lite": "^4.0.7",
204204
"sass-loader": "^3.1.2",
205205
"sinon": "^1.17.2",

script/clean.js

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
var rimraf = require('rimraf');
2+
var Config = require('../config');
3+
4+
console.log('Deleting ' + Config.get('/buildDir'));
5+
rimraf(Config.get('/buildDir'), function(err) {
6+
if (err) {
7+
console.log('Could not delete ' + Config.get('/buildDir'));
8+
}
9+
});

script/copyfiles.sh

Lines changed: 0 additions & 7 deletions
This file was deleted.

src/global/server/api/contact.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
'use strict';
22

33
const Joi = require('joi');
4-
const Config = require('../config');
4+
const Config = require('../config').Config;
55

66

77
const internals = {};

src/global/server/api/login.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ const Boom = require('boom');
44
const Joi = require('joi');
55
const Async = require('async');
66
const Bcrypt = require('bcrypt');
7-
const Config = require('../config');
7+
const Config = require('../config').Config;
88

99

1010
const internals = {};

src/global/server/api/signup.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
const Boom = require('boom');
44
const Joi = require('joi');
55
const Async = require('async');
6-
const Config = require('../config');
6+
const Config = require('../config').Config;
77

88

99
const internals = {};

src/global/server/auth.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
const Async = require('async');
2-
const Config = require('./config');
2+
const Config = require('./config').Config;
33

44

55
exports.register = function (server, options, next) {

src/global/server/config.js

Lines changed: 4 additions & 94 deletions
Original file line numberDiff line numberDiff line change
@@ -1,94 +1,4 @@
1-
var Confidence = require('confidence');
2-
var pkg = require('../../../package.json');
3-
var criteria = {
4-
env: process.env.NODE_ENV
5-
};
6-
7-
8-
var config = {
9-
$meta: 'This file configures the plot device.',
10-
projectName: 'WattsProject',
11-
buildDir: pkg.directories.clientBuild,
12-
buildDirTests: '../../../build_tests',
13-
devHost: 'localhost',
14-
devPort: 8000,
15-
webpackPort: 8080,
16-
port: {
17-
web: {
18-
$filter: 'env',
19-
test: 9000,
20-
production: process.env.PORT,
21-
$default: 8000
22-
}
23-
},
24-
baseUrl: {
25-
$filter: 'env',
26-
$meta: 'values should not end in "/"',
27-
production: 'https://wattsproject.herokuapp.com',
28-
$default: 'http://localhost:8000'
29-
},
30-
authAttempts: {
31-
forIp: 50,
32-
forIpAndUser: 7
33-
},
34-
cookieSecret: {
35-
$filter: 'env',
36-
production: process.env.COOKIE_SECRET,
37-
$default: 'sezEhj(@#05Jxgnd5CTCGktuiXldIae3'
38-
},
39-
hapiMongoModels: {
40-
$filter: 'env',
41-
production: {
42-
mongodb: {
43-
url: process.env.MONGOLAB_URI
44-
},
45-
autoIndex: false
46-
},
47-
test: {
48-
mongodb: {
49-
url: 'mongodb://localhost:27017/wattsproject-test'
50-
},
51-
autoIndex: true
52-
},
53-
$default: {
54-
mongodb: {
55-
url: 'mongodb://localhost:27017/wattsproject'
56-
},
57-
autoIndex: true
58-
}
59-
},
60-
nodemailer: {
61-
host: 'smtp.gmail.com',
62-
port: 465,
63-
secure: true,
64-
auth: {
65-
66-
pass: ''
67-
}
68-
},
69-
system: {
70-
fromAddress: {
71-
name: 'WattsProject',
72-
address: '[email protected]'
73-
},
74-
toAddress: {
75-
name: 'WattsProject',
76-
address: '[email protected]'
77-
}
78-
}
79-
};
80-
81-
82-
var store = new Confidence.Store(config);
83-
84-
85-
exports.get = function (key) {
86-
87-
return store.get(key, criteria);
88-
};
89-
90-
91-
exports.meta = function (key) {
92-
93-
return store.meta(key, criteria);
94-
};
1+
// All necessary config from outside this folder should be referenced here
2+
module.exports.Config = require('../../../config');
3+
module.exports.Pages = require('../../../config.pages').getConfig();
4+
module.exports.Pkg = require('../../../package');

0 commit comments

Comments
 (0)