Skip to content

Commit

Permalink
basics
Browse files Browse the repository at this point in the history
  • Loading branch information
zepfan committed Jun 16, 2018
1 parent 28bb44c commit 3596a13
Show file tree
Hide file tree
Showing 7 changed files with 247 additions and 1 deletion.
8 changes: 8 additions & 0 deletions .babelrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"env": {
"test": {
"presets": ["env", "react"],
"plugins": ["transform-object-rest-spread", "transform-decorators-legacy"]
}
}
}
33 changes: 33 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
# http://editorconfig.org

# A special property that should be specified at the top of the file outside of
# any sections. Set to true to stop .editor config file search on current file
root = true

[*]
# Indentation style
# Possible values - tab, space
indent_style = tab

# Indentation size in single-spaced characters
# Possible values - an integer, tab
indent_size = 4

# Line ending file format
# Possible values - lf, crlf, cr
end_of_line = lf

# File character encoding
# Possible values - latin1, utf-8, utf-16be, utf-16le
charset = utf-8

# Denotes whether to trim whitespace at the end of lines
# Possible values - true, false
trim_trailing_whitespace = true

# Denotes whether file should end with a newline
# Possible values - true, false
insert_final_newline = true

[package.json]
indent_size = 2
63 changes: 63 additions & 0 deletions .eslintrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
module.exports = {
parser: 'babel-eslint',
parserOptions: {
ecmaVersion: 8,
sourceType: 'module',
ecmaFeatures: {
impliedStrict: true,
jsx: true,
experimentalObjectRestSpread: true
}
},
plugins: [
'react'
],
globals: {
APP_ID: false,
API_HOST: false,
API_KEY: false,
fetch: false
},
extends: [
'eslint:recommended',
'plugin:react/recommended'
],
env: {
browser: true,
node: true,
es6: true
},
rules: {
'brace-style': 2,
camelcase: 2,
'class-methods-use-this': 2,
'comma-dangle': 2,
'comma-spacing': 2,
'dot-notation': 2,
eqeqeq: 2,
indent: [2, 'tab', {SwitchCase: 1}],
'key-spacing': 2,
'lines-between-class-members': 2,
'max-len': [2, 200, 2],
'newline-per-chained-call': [2, {ignoreChainWithDepth: 3}],
'no-console': [2, {allow: ['error']}],
'no-multiple-empty-lines': 2,
'no-shadow': 2,
'no-unneeded-ternary': [2, {defaultAssignment: false}],
'no-unused-expressions': 2,
'no-var': 2,
'object-shorthand': 2,
'padded-blocks': [2, 'never'],
'prefer-const': 2,
'prefer-arrow-callback': 2,
'quote-props': [2, 'as-needed'],
quotes: [2, 'single'],
'require-await': 2,
semi: [2, 'always'],
'space-before-function-paren': [2, {anonymous: 'always', named: 'never'}],
'space-infix-ops': 2,
strict: 2,
yoda: 2,
'react/no-unescaped-entities': 0
}
};
14 changes: 14 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
dist/
node_modules/

# OS generated files #
######################
.DS_Store
.DS_Store?
._*
.Spotlight-V100
.Trashes
ehthumbs.db
Thumbs.db
.log
*.log
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
# ui
ui
UI kit for pubrec products, built on React
47 changes: 47 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
{
"name": "ui",
"version": "1.0.0",
"description": "UI kit based on ReactJS for TCG projects",
"main": "src/index.js",
"scripts": {
"test": "eslint ./src"
},
"repository": {
"type": "git",
"url": "git+https://github.com/the-control-group/ui.git"
},
"author": "The Control Group",
"license": "UNLICENSED",
"private": "true",
"bugs": {
"url": "https://github.com/the-control-group/ui/issues"
},
"homepage": "https://github.com/the-control-group/ui#readme",
"devDependencies": {
"autoprefixer": "^8.1.0",
"babel-core": "^6.26.0",
"babel-eslint": "^8.2.2",
"babel-loader": "^7.1.4",
"babel-plugin-transform-object-rest-spread": "^6.26.0",
"babel-preset-env": "^1.6.1",
"babel-preset-react": "^6.24.1",
"classnames": "^2.2.5",
"css-loader": "^0.28.11",
"cssnano": "^3.10.0",
"eslint": "^4.19.0",
"eslint-plugin-react": "^7.7.0",
"file-loader": "^1.1.11",
"less": "^3.0.1",
"less-loader": "^4.1.0",
"normalize.css": "^8.0.0",
"prop-types": "^15.6.1",
"react": "^16.2.0",
"react-devtools": "^3.1.0",
"react-dom": "^16.2.0",
"style-loader": "^0.20.3",
"url-loader": "^1.0.1",
"webpack": "^4.1.1",
"webpack-cli": "^2.0.12",
"webpack-dev-server": "^3.1.1"
}
}
81 changes: 81 additions & 0 deletions webpack.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,81 @@
const path = require("path");
const HtmlWebpackPlugin = require("html-webpack-plugin");

module.exports = {
entry: path.join(__dirname, "src/docs"),
output: {
path: path.join(__dirname, "docs"),
filename: "bundle.js"
},
module: {
rules: [
{
test: /\.(js|jsx)$/,
use: "babel-loader",
exclude: /node_modules/
},
{
test: /\.css$/,
use: ["style-loader", "css-loader"]
}
]
},
plugins: [
new HtmlWebpackPlugin({
template: path.join(__dirname, "src/docs/index.html")
})
],
resolve: {
extensions: [".js", ".jsx"]
},
devServer: {
contentBase: path.join(__dirname, "docs"),
port: 8000,
stats: "minimal"
}
};

// const path = require('path'),
// CleanWebpackPlugin = require('clean-webpack-plugin'),
// HtmlWebpackPlugin = require('html-webpack-plugin'),
// ScriptExtHtmlWebpackPlugin = require('script-ext-html-webpack-plugin'),
// ExtractTextPlugin = require('extract-text-webpack-plugin');

// const extractLess = new ExtractTextPlugin({
// filename: 'main.[contenthash].css',
// disable: process.env.NODE_ENV !== 'production'
// });

// const config = {
// resolve: {
// modules: [path.resolve(__dirname, 'src'), 'node_modules']
// },
// module: {
// rules: [
// {
// test: /(\.less$)|(\.css$)/,
// use: extractLess.extract({
// use: ['css-loader', 'less-loader'],
// fallback: 'style-loader'
// })
// },
// {
// test: /(\.jpg$)|(\.png$)/,
// use: 'url-loader'
// }
// ]
// },
// plugins: [
// new CleanWebpackPlugin(['dist']),
// new HtmlWebpackPlugin({
// inject: 'head',
// template: 'src/index.html'
// }),
// new ScriptExtHtmlWebpackPlugin({
// defaultAttribute: 'defer'
// }),
// extractLess
// ]
// };

// module.exports = config;

0 comments on commit 3596a13

Please sign in to comment.