Skip to content

Commit

Permalink
Compile ES src/ into ES5 lib/
Browse files Browse the repository at this point in the history
  • Loading branch information
wildlyinaccurate committed Aug 14, 2018
1 parent 2048099 commit 02944ca
Show file tree
Hide file tree
Showing 7 changed files with 31 additions and 17 deletions.
3 changes: 2 additions & 1 deletion lib/State.js
Original file line number Diff line number Diff line change
Expand Up @@ -92,4 +92,5 @@ var State = function () {
return State;
}();

exports.default = State;
exports.default = State;
module.exports = exports['default'];
12 changes: 6 additions & 6 deletions lib/Static.js
Original file line number Diff line number Diff line change
Expand Up @@ -36,17 +36,17 @@ var componentToString = function componentToString(component) {
};

function render(component, update) {
if (typeof update === 'function') {
return new Promise(function (resolve) {
return new Promise(function (resolve) {
if (typeof update === 'function') {
var initialState = new _State2.default(component.init());

update(initialState, function (newState) {
var newComponent = componentWithState(component, newState);

resolve(componentToString(newComponent));
});
});
}

return componentToString(component);
} else {
resolve(componentToString(component));
}
});
}
3 changes: 2 additions & 1 deletion lib/dom/events.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,5 @@
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = ['blur', 'change', 'click', 'contextmenu', 'dblclick', 'error', 'focus', 'focusin', 'focusout', 'input', 'keydown', 'keypress', 'keyup', 'load', 'mousedown', 'mouseup', 'resize', 'select', 'submit', 'touchcancel', 'touchend', 'touchstart', 'unload'];
exports.default = ['blur', 'change', 'click', 'contextmenu', 'dblclick', 'error', 'focus', 'focusin', 'focusout', 'input', 'keydown', 'keypress', 'keyup', 'load', 'mousedown', 'mouseup', 'resize', 'select', 'submit', 'touchcancel', 'touchend', 'touchstart', 'unload'];
module.exports = exports['default'];
3 changes: 2 additions & 1 deletion lib/dom/virtual-dom.js
Original file line number Diff line number Diff line change
Expand Up @@ -48,4 +48,5 @@ function VirtualDom(state, render, raf) {
};

return { rootNode: rootNode, update: update };
}
}
module.exports = exports['default'];
18 changes: 13 additions & 5 deletions lib/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,11 @@
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.State = exports.start = exports.render = exports.initializeComponent = exports.h = exports.forwardDispatch = undefined;
exports.State = exports.start = exports.render = exports.initializeComponent = exports.forwardDispatch = exports.h = undefined;

var _h = require('virtual-dom/h');
var _h2 = require('virtual-dom/h');

var _h2 = _interopRequireDefault(_h);
var _h3 = _interopRequireDefault(_h2);

var _App = require('./App');

Expand All @@ -17,16 +17,24 @@ var _State2 = _interopRequireDefault(_State);

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }

function h(tag, attrs) {
for (var _len = arguments.length, children = Array(_len > 2 ? _len - 2 : 0), _key = 2; _key < _len; _key++) {
children[_key - 2] = arguments[_key];
}

return (0, _h3.default)(tag, attrs, children);
}

exports.default = {
h: h,
forwardDispatch: _App.forwardDispatch,
h: _h2.default,
initializeComponent: _App.initializeComponent,
render: _App.render,
start: _App.start,
State: _State2.default
};
exports.h = h;
exports.forwardDispatch = _App.forwardDispatch;
exports.h = _h2.default;
exports.initializeComponent = _App.initializeComponent;
exports.render = _App.render;
exports.start = _App.start;
Expand Down
3 changes: 2 additions & 1 deletion lib/utils/clone.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,4 +29,5 @@ function clone(obj) {
}

return newObj;
}
}
module.exports = exports['default'];
6 changes: 4 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "plait",
"version": "0.15.0",
"version": "0.15.1",
"description": "A minimal JavaScript framework for building isomorphic reactive web components",
"main": "lib/index.js",
"jsnext:main": "src/index.js",
Expand All @@ -14,7 +14,8 @@
"test": "test"
},
"scripts": {
"build": "webpack",
"build": "webpack && npm run buildLib",
"buildLib": "babel src --out-dir lib",
"buildExamples": "gulp buildExamples && webpack",
"test": "npm run buildExamples && gulp test && bundle exec cucumber",
"prepublish": "npm run build",
Expand All @@ -41,6 +42,7 @@
"virtual-raf": "^3.0.0"
},
"devDependencies": {
"babel-cli": "^6.26.0",
"babel-core": "^6.4.0",
"babel-loader": "^7.1.1",
"babel-plugin-add-module-exports": "^0.2.1",
Expand Down

0 comments on commit 02944ca

Please sign in to comment.