forked from objectscript/RESTFormsUI-react
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
0 parents
commit 944dcdd
Showing
13 changed files
with
313 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
{ | ||
"plugins": [ | ||
["import", { | ||
"libraryName": "antd", | ||
"style": "css" | ||
}] | ||
], | ||
"presets": ["react", "env", "stage-1"] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
# editorconfig.org | ||
root = true | ||
|
||
[*] | ||
indent_style = space | ||
indent_size = 2 | ||
end_of_line = lf | ||
charset = utf-8 | ||
trim_trailing_whitespace = true | ||
insert_final_newline = true | ||
|
||
[*.md] | ||
trim_trailing_whitespace = false |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,63 @@ | ||
{ | ||
"extends": [ | ||
"eslint:recommended", | ||
"plugin:import/errors", | ||
"plugin:import/warnings" | ||
], | ||
"plugins": [ | ||
"react" | ||
], | ||
"parser": "babel-eslint", | ||
"env": { | ||
"es6": true, | ||
"browser": true, | ||
"node": true, | ||
"mocha": true | ||
}, | ||
"rules": { | ||
"quotes": 0, | ||
"no-console": 1, | ||
"no-debugger": 1, | ||
"no-var": 1, | ||
"semi": [1, "always"], | ||
"no-trailing-spaces": 0, | ||
"eol-last": 0, | ||
"no-unused-vars": 0, | ||
"no-underscore-dangle": 0, | ||
"no-alert": 0, | ||
"no-lone-blocks": 0, | ||
"jsx-quotes": 1, | ||
"react/display-name": [ 1, {"ignoreTranspilerName": false }], | ||
"react/forbid-prop-types": [1, {"forbid": ["any"]}], | ||
"react/jsx-boolean-value": 1, | ||
"react/jsx-closing-bracket-location": 0, | ||
"react/jsx-curly-spacing": 1, | ||
"react/jsx-indent-props": 0, | ||
"react/jsx-key": 1, | ||
"react/jsx-max-props-per-line": 0, | ||
"react/jsx-no-bind": 1, | ||
"react/jsx-no-duplicate-props": 1, | ||
"react/jsx-no-literals": 0, | ||
"react/jsx-no-undef": 1, | ||
"react/jsx-pascal-case": 1, | ||
"react/jsx-sort-prop-types": 0, | ||
"react/jsx-sort-props": 0, | ||
"react/jsx-uses-react": 1, | ||
"react/jsx-uses-vars": 1, | ||
"react/jsx-wrap-multilines": 1, | ||
"react/no-danger": 1, | ||
"react/no-did-mount-set-state": 1, | ||
"react/no-did-update-set-state": 1, | ||
"react/no-direct-mutation-state": 1, | ||
"react/no-multi-comp": 0, | ||
"react/no-set-state": 0, | ||
"react/no-unknown-property": 1, | ||
"react/prefer-es6-class": 1, | ||
"react/prop-types": 1, | ||
"react/react-in-jsx-scope": 1, | ||
"react/self-closing-comp": 1, | ||
"react/sort-comp": 1, | ||
"import/no-named-as-default" : 0, | ||
"import/extensions": 1 | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
# See https://help.github.com/ignore-files/ for more about ignoring files. | ||
|
||
# dependencies | ||
/node_modules | ||
|
||
#IDE | ||
/.idea | ||
|
||
#production | ||
/dist | ||
|
||
# misc | ||
.DS_Store | ||
.env.local | ||
.env.development.local | ||
.env.test.local | ||
.env.production.local | ||
|
||
npm-debug.log* | ||
yarn-debug.log* | ||
yarn-error.log* |
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
{ | ||
"name": "react2", | ||
"version": "0.1.0", | ||
"private": true, | ||
"scripts": { | ||
"lint": "node_modules/.bin/eslint webpack.config.* src tools", | ||
"clean-dist": "npm run remove-dist && mkdir dist", | ||
"remove-dist": "node_modules/.bin/rimraf ./dist", | ||
"prebuild": "npm-run-all clean-dist lint", | ||
"build": "babel-node tools/build.js" | ||
}, | ||
"dependencies": { | ||
"antd": "2.13.6", | ||
"babel-polyfill": "^6.26.0", | ||
"react": "15.6.2", | ||
"react-dom": "15.6.2", | ||
"react-scripts": "1.0.14" | ||
}, | ||
"devDependencies": { | ||
"babel-cli": "^6.26.0", | ||
"babel-core": "^6.26.0", | ||
"babel-loader": "^7.1.2", | ||
"babel-plugin-import": "^1.6.2", | ||
"babel-preset-env": "^1.6.1", | ||
"babel-preset-react": "^6.24.1", | ||
"babel-preset-stage-1": "^6.24.1", | ||
"babel-register": "^6.26.0", | ||
"colors": "^1.1.2", | ||
"css-loader": "^0.28.7", | ||
"eslint": "4.9.0", | ||
"eslint-plugin-import": "2.8.0", | ||
"eslint-plugin-react": "7.4.0", | ||
"extract-text-webpack-plugin": "^3.0.1", | ||
"file-loader": "^1.1.5", | ||
"npm-run-all": "^4.1.1", | ||
"rimraf": "^2.6.2", | ||
"style-loader": "^0.19.0", | ||
"url-loader": "^0.6.2", | ||
"webpack": "^3.8.1" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
import React, { Component } from 'react'; | ||
|
||
import { Layout, Menu, Breadcrumb } from 'antd'; | ||
const { Header, Content, Footer } = Layout; | ||
|
||
class App extends Component { | ||
render() { | ||
return ( | ||
<Layout className="layout"> | ||
<Header> | ||
<div className="logo" /> | ||
<Menu | ||
theme="dark" | ||
mode="horizontal" | ||
defaultSelectedKeys={['2']} | ||
style={{ lineHeight: '64px' }} | ||
> | ||
<Menu.Item key="1">nav 1</Menu.Item> | ||
<Menu.Item key="2">nav 2</Menu.Item> | ||
<Menu.Item key="3">nav 3</Menu.Item> | ||
</Menu> | ||
</Header> | ||
<Content style={{ padding: '0 50px' }}> | ||
<Breadcrumb style={{ margin: '16px 0' }}> | ||
<Breadcrumb.Item>Home</Breadcrumb.Item> | ||
<Breadcrumb.Item>List</Breadcrumb.Item> | ||
<Breadcrumb.Item>App</Breadcrumb.Item> | ||
</Breadcrumb> | ||
<div style={{ background: '#fff', padding: 24, minHeight: 280 }}>Content</div> | ||
</Content> | ||
<Footer style={{ textAlign: 'center' }}> | ||
Ant Design ©2016 Created by Ant UED | ||
</Footer> | ||
</Layout> | ||
); | ||
} | ||
} | ||
|
||
export default App; |
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
<!DOCTYPE html> | ||
<html lang="en"> | ||
<head> | ||
<meta charset="utf-8"> | ||
<meta http-equiv="X-UA-Compatible" content="IE=edge"> | ||
<meta name="viewport" content="width=device-width, initial-scale=1.0"> | ||
<link rel="stylesheet" href="style.css"> | ||
<title>Сахалинский областной медицинский информационно-аналитический центр</title> | ||
</head> | ||
<body> | ||
<div id="app"></div> | ||
<script src="./bundle.js"></script> | ||
</body> | ||
</html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
import React from 'react'; | ||
import ReactDOM from 'react-dom'; | ||
import App from './components/App'; | ||
import './index.csp'; | ||
|
||
ReactDOM.render(<App />, document.getElementById('app')); |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
/*eslint-disable no-console */ | ||
import webpack from 'webpack'; | ||
import webpackConfig from '../webpack.config.babel'; | ||
import colors from 'colors'; | ||
|
||
process.env.NODE_ENV = 'production'; | ||
|
||
webpack(webpackConfig).run((err, stats) => { | ||
if (err) { | ||
console.log(err.bold.red); | ||
return 1; | ||
} | ||
|
||
const jsonStats = stats.toJson(); | ||
|
||
if (jsonStats.hasErrors) { | ||
return jsonStats.errors.map(error => console.log(error.red)); | ||
} | ||
|
||
if (jsonStats.hasWarnings) { | ||
console.log('Webpack generated the following warnings: '.bold.yellow); | ||
jsonStats.warnings.map(warning => console.log(warning.yellow)); | ||
} | ||
|
||
console.log(`${'Webpack stats'.bold.magenta}\n${stats.toString({ | ||
children: false, | ||
chunks: false, // Makes the build much quieter | ||
colors: true, // Shows colors in the console | ||
modules: false | ||
})}\n` | ||
); | ||
console.log('Your app has been compiled in production mode and written to /dist'); | ||
|
||
return 0; | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,65 @@ | ||
import webpack from 'webpack'; | ||
import path from 'path'; | ||
import ExtractTextPlugin from 'extract-text-webpack-plugin'; | ||
|
||
export default { | ||
stats: 'errors-only', | ||
devtool: 'source-map', | ||
entry: [ "babel-polyfill", path.resolve(__dirname, 'src/index') ], | ||
target: 'web', | ||
output: { | ||
path: __dirname + '/dist', | ||
publicPath: '/', | ||
filename: 'bundle.js' | ||
}, | ||
plugins: [ | ||
new webpack.optimize.OccurrenceOrderPlugin(), | ||
new ExtractTextPlugin('style.css'), | ||
//new webpack.optimize.UglifyJsPlugin() | ||
], | ||
module: { | ||
rules: [ | ||
{ | ||
test: /\.csp$/, | ||
exclude: /node_modules/, | ||
use: [ | ||
{ | ||
loader: 'file-loader', | ||
options: { | ||
name: '[name].[ext]' | ||
} | ||
} | ||
] | ||
}, | ||
|
||
{ | ||
test: /\.js$/, | ||
exclude: /node_modules/, | ||
include: path.join(__dirname, 'src'), | ||
use: [ | ||
{ | ||
loader: 'babel-loader', | ||
options: { | ||
presets: ['react', 'env', 'stage-1'], | ||
plugins: [[ "import", { "libraryName": "antd", "style": "css" }]] | ||
} | ||
} | ||
] | ||
}, | ||
|
||
{ | ||
test: /(\.css)$/, | ||
use: ExtractTextPlugin.extract({ | ||
fallback: "style-loader", | ||
use: "css-loader" | ||
}) | ||
}, | ||
|
||
{test: /\.eot(\?v=\d+\.\d+\.\d+)?$/, use: [ 'file-loader' ]}, | ||
{test: /\.(woff|woff2)$/, use: 'url-loader?prefix=font/&limit=5000'}, | ||
{test: /\.ttf(\?v=\d+\.\d+\.\d+)?$/, use: 'url-loader?limit=10000&mimetype=application/octet-stream'}, | ||
{test: /\.svg(\?v=\d+\.\d+\.\d+)?$/, use: 'url-loader?limit=10000&mimetype=image/svg+xml'}, | ||
{test: /\.png$/, exclude: /node_modules/, use: 'file-loader?name=images/[name].[ext]'} | ||
] | ||
} | ||
}; |