Skip to content

Commit

Permalink
fix(dependencies): update to move dependencies to devDep and peerDep (#…
Browse files Browse the repository at this point in the history
…44)

* fix(dependences): update to move dependencies to devDep and peerDep

* chore(yarn): add yarn.lock file in

* fix(linting): move deps and disable lint lints

* chore(lint): move server.js to the linting ignore
  • Loading branch information
Chris Dhanaraj authored and hellobrian committed May 1, 2017
1 parent 50b530b commit e631f5c
Show file tree
Hide file tree
Showing 4 changed files with 6,500 additions and 50 deletions.
1 change: 1 addition & 0 deletions .eslintignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,4 @@
dist
demo/demo.js
node_modules
server.js
21 changes: 11 additions & 10 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -29,15 +29,13 @@
"style guide"
],
"dependencies": {
"adaro": "1.0.4",
"bluebird": "~3.1.1",
"carbon-icons": "5.1.2",
"eslint": "^3.0.0",
"express": "4.13.4",
"globby": "4.0.0",
"lodash.debounce": "^4.0.8"
},
"peerDependencies": {
"carbon-icons": "5.1.2"
},
"devDependencies": {
"adaro": "1.0.4",
"babel-core": "^6.22.0",
"babel-eslint": "^7.0.0",
"babel-plugin-external-helpers": "^6.22.0",
Expand All @@ -47,15 +45,18 @@
"babel-plugin-transform-runtime": "^6.22.0",
"babel-preset-env": "^1.0.0",
"babel-runtime": "^6.22.0",
"bluebird": "~3.1.1",
"browser-sync": "~2.10.0",
"chai": "~3.4.1",
"chai": "^3.5.0",
"core-js": "^2.4.0",
"custom-event": "^1.0.0",
"cz-conventional-changelog": "^1.2.0",
"del": "~2.0.2",
"eslint": "^3.0.0",
"eslint-config-airbnb-base": "^11.0.0",
"eslint-plugin-import": "^2.2.0",
"express": "4.13.4",
"globby": "4.0.0",
"gulp": "~3.9.0",
"gulp-autoprefixer": "~3.0.1",
"gulp-babel": "^6.1.2",
Expand Down Expand Up @@ -98,8 +99,8 @@
"rollup-plugin-uglify": "^1.0.1",
"scss-to-json": "1.1.0",
"semantic-release": "^6.3.2",
"sinon": "1.17.3",
"sinon-chai": "2.8.0",
"sinon": "^2.1.0",
"sinon-chai": "^2.9.0",
"svgxuse": "1.1.22",
"validate-commit-msg": "^2.8.2",
"vinyl-named": "^1.1.0"
Expand Down Expand Up @@ -176,4 +177,4 @@
"email": "[email protected]"
}
]
}
}
79 changes: 39 additions & 40 deletions server.js
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
'use strict';

const globby = require('globby');
const Promise = require('bluebird');
const globby = require('globby'); // eslint-disable-line
const Promise = require('bluebird'); // eslint-disable-line
const fs = require('fs');
const path = require('path');
const express = require('express');
const express = require('express'); // eslint-disable-line

const app = express();
const adaro = require('adaro');
const adaro = require('adaro'); // eslint-disable-line

const port = process.env.PORT || 8080;

Expand All @@ -34,45 +34,44 @@ app.use(express.static('src'));
app.use('/docs/js', express.static('docs/js'));

const getContent = glob =>
globby(glob)
.then((paths) => { // eslint-disable-line arrow-body-style
return paths.length === 0 ? undefined : paths
.map(file => fs.readFileSync(file, { encoding: 'utf8' }))
.reduce((a, b) => a.concat(b));
});
globby(glob).then(
paths =>
(paths.length === 0
? undefined
: paths
.map(file => fs.readFileSync(file, { encoding: 'utf8' }))
.reduce((a, b) => a.concat(b)))
);

const allLinks = globby(directoryOrder)
.then((paths) => { // eslint-disable-line arrow-body-style
return paths
.map((filePath) => {
const indices = [];
for (let i = 0; i < filePath.length; i++) {
if (filePath[i] === '/') {
indices.push(i);
}
const allLinks = globby(directoryOrder).then(paths => {
// eslint-disable-line arrow-body-style
return paths
.map(filePath => {
const indices = [];
for (let i = 0; i < filePath.length; i++) {
if (filePath[i] === '/') {
indices.push(i);
}
return filePath.slice(0, indices[1]);
})
.filter((filePath, index, a) => a.indexOf(filePath) === index)
.map(filePath => ({
url: filePath,
}));
});

}
return filePath.slice(0, indices[1]);
})
.filter((filePath, index, a) => a.indexOf(filePath) === index)
.map(filePath => ({
url: filePath,
}));
});

app.get('/', (req, res) => {
Promise.all([
getContent(htmlFiles.all),
])
.then((results) => {
res.render('demo-all', {
html: results[0],
Promise.all([getContent(htmlFiles.all)])
.then(results => {
res.render('demo-all', {
html: results[0],
});
})
.catch(error => {
console.error(error.stack); // eslint-disable-line no-console
res.status(500).end();
});
})
.catch((error) => {
console.error(error.stack); // eslint-disable-line no-console
res.status(500).end();
});
});

app.get('/components/:component', (req, res) => {
Expand All @@ -82,7 +81,7 @@ app.get('/components/:component', (req, res) => {
res.status(404).end();
} else {
Promise.all([getContent(glob), allLinks])
.then((results) => {
.then(results => {
if (typeof results[0] === 'undefined') {
res.status(404).end();
} else {
Expand All @@ -91,7 +90,7 @@ app.get('/components/:component', (req, res) => {
});
}
})
.catch((error) => {
.catch(error => {
console.error(error.stack); // eslint-disable-line no-console
res.status(500).end();
});
Expand Down
Loading

0 comments on commit e631f5c

Please sign in to comment.