Skip to content

Commit e7494ce

Browse files
author
Matthew R. Elliott
committed
Merge pull request #7 from TechniqueSoftware/release/0.3.1
Release v0.3.1
2 parents 78dcb4e + d7a93a1 commit e7494ce

9 files changed

+41
-43
lines changed

.babelrc

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
{
2+
"presets": [
3+
"es2015"
4+
]
5+
}

.eslintignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,3 @@
11
spec/spec.js
22
*.md
3+
webpack.config.spec.js

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,11 @@
22

33
`npm install react-json-schema`
44

5-
This library builds React elements from JSON by mapping JSON definitions to React components that you expose. The interest behind making this library is to allow non-programmers to construct a view using JSON, which can be stored and retrieved in a database. Use it as you'd like.
5+
This library constructs React elements from JSON by mapping JSON definitions to React components that you expose.
66

77
JSX is not a dependency for react-json-schema.
88

9-
For a quick reference, you can jump to [full example](#putting-it-all-together).
9+
For a quick reference, you can jump to the [full example](#putting-it-all-together).
1010

1111
For 0.3.0+, you must use React 0.14.0+. You may use 0.2.0 for older versions.
1212

dist/react-json-schema.js

Lines changed: 13 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,26 @@
11
'use strict';
22

3-
Object.defineProperty(exports, '__esModule', {
3+
var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
4+
5+
Object.defineProperty(exports, "__esModule", {
46
value: true
57
});
68

7-
var _createClass = (function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ('value' in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; })();
8-
9-
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }
10-
11-
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError('Cannot call a class as a function'); } }
12-
139
var _react = require('react');
1410

15-
var _node_modulesReactLibReactDOMFactories = require('../node_modules/react/lib/ReactDOMFactories');
11+
var _ReactDOMFactories = require('react/lib/ReactDOMFactories');
1612

17-
var _node_modulesReactLibReactDOMFactories2 = _interopRequireDefault(_node_modulesReactLibReactDOMFactories);
13+
var _ReactDOMFactories2 = _interopRequireDefault(_ReactDOMFactories);
1814

1915
var _lodash = require('lodash');
2016

17+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
18+
19+
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
20+
2121
var _componentMap = null;
2222

23-
var ReactJsonSchema = (function () {
23+
var ReactJsonSchema = function () {
2424
function ReactJsonSchema() {
2525
_classCallCheck(this, ReactJsonSchema);
2626
}
@@ -67,7 +67,7 @@ var ReactJsonSchema = (function () {
6767
Component = schema.component;
6868
} else if (_componentMap && _componentMap[schema.component]) {
6969
Component = _componentMap[schema.component];
70-
} else if ((0, _lodash.has)(_node_modulesReactLibReactDOMFactories2['default'], schema.component)) {
70+
} else if ((0, _lodash.has)(_ReactDOMFactories2.default, schema.component)) {
7171
Component = schema.component;
7272
}
7373
} else {
@@ -93,7 +93,6 @@ var ReactJsonSchema = (function () {
9393
}]);
9494

9595
return ReactJsonSchema;
96-
})();
96+
}();
9797

98-
exports['default'] = ReactJsonSchema;
99-
module.exports = exports['default'];
98+
exports.default = ReactJsonSchema;

dist/react-json-schema.min.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

lib/ReactJsonSchema.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import { createElement } from 'react';
2-
import ReactDOMFactories from '../node_modules/react/lib/ReactDOMFactories';
3-
import { isFunction, isArray, forEach, omit, clone, has, isObject, isString } from 'lodash';
2+
import ReactDOMFactories from 'react/lib/ReactDOMFactories';
3+
import { isArray, forEach, omit, clone, has, isObject } from 'lodash';
44

55
let _componentMap = null;
66

@@ -44,7 +44,7 @@ export default class ReactJsonSchema {
4444
} else if (has(ReactDOMFactories, schema.component)) {
4545
Component = schema.component;
4646
}
47-
} else {
47+
} else {
4848
throw new Error('ReactJsonSchema could not resolve a component due to a missing component attribute in the schema.');
4949
}
5050
return Component;

package.json

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "react-json-schema",
3-
"version": "0.3.0",
3+
"version": "0.3.1",
44
"description": "Write component schema in JSON; parse to create react elements.",
55
"keywords": [
66
"react",
@@ -37,9 +37,12 @@
3737
"react": "^0.14.2"
3838
},
3939
"devDependencies": {
40-
"babel-core": "^5.8.25",
40+
"babel-cli": "^6.4.0",
41+
"babel-core": "^6.4.0",
4142
"babel-eslint": "^4.1.3",
42-
"babel-loader": "^5.3.2",
43+
"babel-loader": "6.1.0",
44+
"babel-preset-es2015": "6.1.18",
45+
"babel-preset-react": "6.1.18",
4346
"bootstrap": "^3.3.5",
4447
"eslint": "^1.5.1",
4548
"eslint-config-airbnb": "^0.1.0",

webpack.config.demo.js

Lines changed: 4 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,3 @@
1-
/* eslint "esnext": false */
2-
3-
'use strict';
4-
51
module.exports = {
62
entry: {
73
javascript: './demo/index.jsx',
@@ -13,14 +9,13 @@ module.exports = {
139
},
1410
module: {
1511
loaders: [
16-
{
17-
test: /\.jsx$/,
18-
loader: 'jsx-loader'
19-
},
2012
{
2113
test: /\.js|jsx$/,
2214
exclude: /node_modules/,
23-
loader: 'babel-loader'
15+
loader: 'babel-loader',
16+
query: {
17+
presets: ['react', 'es2015']
18+
}
2419
},
2520
{
2621
test: /\.html$/,

webpack.config.spec.js

Lines changed: 6 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,10 @@
1-
/* eslint "esnext": false */
2-
3-
'use strict';
4-
51
var path = require('path');
62
var srcPath = path.join(__dirname, './spec');
73

84
module.exports = {
95
entry: {
10-
javascript: path.join(srcPath, 'spec.entry'),
11-
html: path.join(srcPath, 'index.html')
6+
javascript: path.join(srcPath, 'spec.entry'),
7+
html: path.join(srcPath, 'index.html')
128
},
139
output: {
1410
path: srcPath,
@@ -17,14 +13,13 @@ module.exports = {
1713
},
1814
module: {
1915
loaders: [
20-
{
21-
test: /\.js|jsx$/,
22-
loader: 'jsx-loader'
23-
},
2416
{
2517
test: /\.js|jsx$/,
2618
exclude: /node_modules/,
27-
loader: 'babel-loader'
19+
loader: 'babel-loader',
20+
query: {
21+
presets: ['react', 'es2015']
22+
}
2823
},
2924
{
3025
test: /\.html$/,

0 commit comments

Comments
 (0)