Skip to content

Commit 752984a

Browse files
author
Christopher Whatley
committed
Initial commit
1 parent 2abae8c commit 752984a

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

66 files changed

+5093
-0
lines changed

.babelrc

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
{
2+
"presets": ["react", "env"],
3+
"plugins": [
4+
"transform-object-rest-spread",
5+
"transform-class-properties",
6+
"transform-runtime"
7+
],
8+
"env": {
9+
"development": {
10+
"plugins": [
11+
["react-transform", {
12+
"transforms": [{
13+
"transform": "react-transform-hmr",
14+
"imports": ["react"],
15+
"locals": ["module"]
16+
}]
17+
}]
18+
]
19+
}
20+
}
21+
}

.editorconfig

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
[*]
2+
3+
indent_style = space
4+
indent_size = 2
5+
charset = utf-8
6+
insert_final_newline = true

.eslintrc

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
{
2+
"parser": "babel-eslint",
3+
"rules": {
4+
"react/jsx-uses-react": 2,
5+
"react/jsx-uses-vars": 2,
6+
"react/react-in-jsx-scope": 2,
7+
"react/jsx-tag-spacing": [1, {
8+
"beforeSelfClosing": "always"
9+
}],
10+
"curly": [2],
11+
"linebreak-style": [2, "unix"],
12+
"semi": [2, "always"],
13+
"comma-dangle": [0],
14+
"no-unused-vars": [2, {
15+
"vars": "all",
16+
"args": "none",
17+
"ignoreRestSiblings": true
18+
}],
19+
"no-console": [0],
20+
"object-curly-spacing": [2, "always"],
21+
"keyword-spacing": ["error"]
22+
},
23+
"env": {
24+
"es6": true,
25+
"browser": true,
26+
"node": true
27+
},
28+
"extends": "eslint:recommended",
29+
"ecmaFeatures": {
30+
"modules": true,
31+
"jsx": true,
32+
"experimentalObjectRestSpread": true
33+
},
34+
"plugins": [
35+
"jsx-a11y",
36+
"react"
37+
]
38+
}

.gitignore

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
npm-debug.log
2+
node_modules
3+
build
4+
dist
5+
lib
6+
yarn.lock

.npmignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
src/

.tern-port

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
59230

.travis.yml

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
sudo: false
2+
language:
3+
- node_js
4+
node_js:
5+
- "6"
6+
env:
7+
- ACTION=test
8+
- ACTION="run lint"
9+
- ACTION="run cs-check"
10+
- ACTION="run dist"
11+
script:
12+
- npm $ACTION

README.md

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
material-ui-react-jsonschema-form
2+
==================================
3+
4+
This package exports a Form object that renders using material-ui by
5+
default.
6+
7+
Unlike other similar packages, this is, a customization of
8+
react-jsonschema-form rather than a fork or reimplementation of it and
9+
keeping up to date with that project should be quite a bit simpler.
10+
11+
Use of this package should be roughly the same as 'mozilla-services/react-jsonschema-form'.
12+
13+
You can launch a playground that has been ported to material-ui via 'npm start'.

devServer.js

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
const path = require("path");
2+
const express = require("express");
3+
const webpack = require("webpack");
4+
5+
const server = process.env.RJSF_DEV_SERVER || "localhost:8080";
6+
const splitServer = server.split(":");
7+
const host = splitServer[0];
8+
const port = splitServer[1];
9+
const env = "dev";
10+
11+
const webpackConfig = require("./webpack.config." + env);
12+
const compiler = webpack(webpackConfig);
13+
const app = express();
14+
15+
app.use(require("webpack-dev-middleware")(compiler, {
16+
publicPath: webpackConfig.output.publicPath,
17+
noInfo: true
18+
}));
19+
20+
app.use(require("webpack-hot-middleware")(compiler));
21+
22+
app.get("/favicon.ico", function(req, res) {
23+
res.status(204).end();
24+
});
25+
26+
app.get("/", function(req, res) {
27+
res.sendFile(path.join(__dirname, "playground", "index.html"));
28+
});
29+
30+
app.listen(port, host, function(err) {
31+
if (err) {
32+
console.log(err);
33+
return;
34+
}
35+
36+
console.log(`Listening at http://${server}`);
37+
});

package.json

Lines changed: 124 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,124 @@
1+
{
2+
"name": "material-ui-react-jsonschema-form",
3+
"version": "0.0.3",
4+
"description": "A simple React component capable of building HTML forms out of a JSON schema based on the Material UI React library. Primary dependency is Mozilla react-jsonschema-form",
5+
"scripts": {
6+
"build:readme": "toctoc README.md -w",
7+
"build:lib": "rimraf lib && cross-env NODE_ENV=production babel -d lib/ src/",
8+
"build:dist": "rimraf dist && cross-env NODE_ENV=production webpack --config webpack.config.dist.js",
9+
"build:playground": "rimraf build && cross-env NODE_ENV=production webpack --config webpack.config.prod.js && cp playground/index.prod.html build/index.html",
10+
"cs-check": "prettier -l $npm_package_prettierOptions '{playground,src,test}/**/*.js'",
11+
"cs-format": "prettier --jsx-bracket-same-line --trailing-comma es5 --use-tabs false --semi --tab-width 2 '{playground,src,test}/**/*.js' --write",
12+
"dist": "npm run build:lib && npm run build:dist",
13+
"lint": "eslint src test playground",
14+
"prepare": "npm run dist",
15+
"precommit": "lint-staged",
16+
"publish-to-gh-pages": "npm run build:playground && gh-pages --dist build/",
17+
"publish-to-npm": "npm run build:readme && npm run dist && npm publish",
18+
"preversion": "npm run build:playground && npm run dist && npm run build:readme && npm run cs-check && npm run lint",
19+
"start": "node devServer.js",
20+
"tdd": "cross-env NODE_ENV=test mocha --require babel-register --watch --require ./test/setup-jsdom.js test/**/*_test.js",
21+
"test": "cross-env NODE_ENV=test mocha --require babel-register --require ./test/setup-jsdom.js test/**/*_test.js"
22+
},
23+
"prettierOptions": "--jsx-bracket-same-line --trailing-comma es5 --semi --tab-width 2",
24+
"lint-staged": {
25+
"{playground,src,test}/**/*.js": [
26+
"npm run lint",
27+
"npm run cs-format",
28+
"git add"
29+
]
30+
},
31+
"main": "lib/index.js",
32+
"files": [
33+
"dist",
34+
"lib"
35+
],
36+
"engineStrict": false,
37+
"engines": {
38+
"npm": ">=2.14.7",
39+
"node": ">=6"
40+
},
41+
"peerDependencies": {
42+
"react": ">=16.6.3",
43+
"react-dom": ">=16.6.3"
44+
},
45+
"dependencies": {
46+
"@material-ui/core": "^3.5.1",
47+
"@material-ui/icons": "^3.0.1",
48+
"ajv": "^5.2.3",
49+
"babel-runtime": "^6.26.0",
50+
"core-js": "^2.5.7",
51+
"lodash.topath": "^4.5.2",
52+
"prop-types": "^15.5.8",
53+
"react": "^16.6.3",
54+
"react-dom": "^16.6.3",
55+
"react-jsonschema-form": "^1.0.6"
56+
},
57+
"devDependencies": {
58+
"atob": "^2.0.3",
59+
"babel-cli": "^6.18.0",
60+
"babel-core": "^6.26.3",
61+
"babel-eslint": "^7.2.3",
62+
"babel-loader": "^7.1.5",
63+
"babel-plugin-react-transform": "^2.0.2",
64+
"babel-plugin-transform-class-properties": "^6.18.0",
65+
"babel-plugin-transform-object-rest-spread": "^6.16.0",
66+
"babel-plugin-transform-runtime": "^6.23.0",
67+
"babel-preset-env": "^1.7.0",
68+
"babel-preset-react": "^6.16.0",
69+
"babel-register": "^6.18.0",
70+
"chai": "^3.3.0",
71+
"codemirror": "^5.30.0",
72+
"cross-env": "^2.0.1",
73+
"css-loader": "^0.23.1",
74+
"eslint": "^4.9.0",
75+
"eslint-config-react-app": "^2.0.1",
76+
"eslint-plugin-flowtype": "^2.39.1",
77+
"eslint-plugin-import": "^2.7.0",
78+
"eslint-plugin-jsx-a11y": "^5.1.1",
79+
"eslint-plugin-react": "^7.4.0",
80+
"estraverse": "^4.2.0",
81+
"estraverse-fb": "^1.3.1",
82+
"express": "^4.14.0",
83+
"gh-pages": "^0.11.0",
84+
"html": "^1.0.0",
85+
"husky": "^0.13.2",
86+
"jsdom": "^8.3.0",
87+
"json-loader": "^0.5.7",
88+
"lint-staged": "^3.3.1",
89+
"mini-css-extract-plugin": "^0.4.3",
90+
"mocha": "^5.2.0",
91+
"prettier": "^1.15.1",
92+
"react": "^16.6.3",
93+
"react-addons-test-utils": "^15.3.2",
94+
"react-codemirror2": "^4.1.0",
95+
"react-dom": "^16.6.3",
96+
"react-transform-catch-errors": "^1.0.0",
97+
"react-transform-hmr": "^1.0.1",
98+
"redbox-react": "^1.3.3",
99+
"rimraf": "^2.5.4",
100+
"sinon": "^1.17.6",
101+
"style-loader": "^0.13.1",
102+
"toctoc": "^0.2.3",
103+
"webpack": "^4.20.2",
104+
"webpack-cli": "^3.1.2",
105+
"webpack-dev-middleware": "^3.4.0",
106+
"webpack-hot-middleware": "^2.13.2"
107+
},
108+
"directories": {
109+
"test": "test"
110+
},
111+
"repository": {
112+
"type": "git",
113+
"url": "git+https://github.com/cwhatley/material-ui-react-jsonschema-form.git"
114+
},
115+
"author": "Chris Whatley <whatleyc@gmail.com>",
116+
"keywords": [
117+
"react",
118+
"form",
119+
"json-schema",
120+
"material-ui"
121+
],
122+
"license": "Apache-2.0",
123+
"homepage": "https://github.com/cwhatley/material-ui-react-jsonschema-form#readme"
124+
}

0 commit comments

Comments
 (0)