Skip to content

Commit

Permalink
Added more granular JS API exports
Browse files Browse the repository at this point in the history
  • Loading branch information
jpellizzari committed Mar 8, 2017
1 parent d775020 commit 38d2b8d
Show file tree
Hide file tree
Showing 8 changed files with 14 additions and 4 deletions.
5 changes: 4 additions & 1 deletion client/.babelrc
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
{
"plugins": ["lodash"],
"plugins": [
"lodash",
["transform-object-rest-spread", { "useBuiltIns": true }]
],
"presets": ["es2015", "react"]
}
1 change: 1 addition & 0 deletions client/app/scripts/actions.js
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
module.exports = require('./actions/app-actions');
1 change: 1 addition & 0 deletions client/app/scripts/component.js
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
module.exports = require('./components/app').default;
1 change: 0 additions & 1 deletion client/app/scripts/index.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
exports.reducer = require('./reducers/root').default;
exports.Scope = require('./components/app').default;
exports.actions = require('./actions/app-actions');
exports.ContrastStyleCompiler = require('./contrast-compiler');
1 change: 1 addition & 0 deletions client/app/scripts/reducer.js
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
module.exports = require('./reducers/root').default;
2 changes: 1 addition & 1 deletion client/app/scripts/utils/router-utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ export function getRouter(dispatch, initialState) {
if (storageState) {
window.location.hash = `!/state/${storageState}`;
const parsedState = JSON.parse(decodeURL(storageState));
mergedState = Object.assign(initialState, parsedState);
mergedState = { ...initialState, ...parsedState };
}

page('/', () => {
Expand Down
3 changes: 3 additions & 0 deletions client/app/scripts/utils/web-api-utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -363,7 +363,10 @@ export function teardownWebsockets() {
if (socket) {
socket.onerror = null;
socket.onclose = null;
socket.onmessage = null;
socket.onopen = null;
socket.close();
socket = null;
currentOptions = null;
}
}
4 changes: 3 additions & 1 deletion client/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@
"babel-eslint": "7.1.1",
"babel-jest": "17.0.2",
"babel-loader": "6.2.8",
"babel-plugin-transform-object-rest-spread": "^6.23.0",
"babel-preset-es2015": "6.18.0",
"babel-preset-react": "6.16.0",
"clean-webpack-plugin": "0.1.14",
Expand Down Expand Up @@ -93,7 +94,8 @@
"scripts": {
"build": "webpack --config webpack.production.config.js",
"build-external": "EXTERNAL=true webpack --config webpack.production.config.js",
"build-pkg": "mkdir -p build-pkg && node node_modules/.bin/babel app/scripts --ignore __tests__ --out-dir build-pkg && cp package.json build-pkg/ && cp -R app/styles build-pkg/",
"copy-pkg-files": "cp package.json build-pkg/ && cp -R app/styles build-pkg/",
"build-pkg": "mkdir -p build-pkg && node node_modules/.bin/babel app/scripts --ignore __tests__ --out-dir build-pkg && npm run copy-pkg-files",
"bundle": "npm run build-pkg && npm pack ./build-pkg && mv weave-scope-$npm_package_version.tgz ./tmp/weave-scope.tgz",
"start": "node server.js",
"start-production": "NODE_ENV=production node server.js",
Expand Down

0 comments on commit 38d2b8d

Please sign in to comment.