Skip to content
This repository was archived by the owner on Jun 17, 2020. It is now read-only.

Commit 5058f05

Browse files
committed
feat(Initial): Added initial starter config.
1 parent 08cba48 commit 5058f05

File tree

12 files changed

+329
-0
lines changed

12 files changed

+329
-0
lines changed

.babelrc

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
{
2+
"presets": ["@babel/preset-env", "@babel/preset-react"],
3+
"plugins": ["@babel/plugin-syntax-dynamic-import", "lodash"]
4+
}

.eslintrc

Lines changed: 99 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,99 @@
1+
{
2+
"parser": "babel-eslint",
3+
"parserOptions": {
4+
"ecmaVersion": 6,
5+
"sourceType": "module",
6+
"ecmaFeatures": {
7+
"jsx": true,
8+
"modules": true,
9+
"experimentalObjectRestSpread": true
10+
}
11+
},
12+
"settings": {
13+
"react": {
14+
"version": 16.6
15+
}
16+
},
17+
"globals": {
18+
"beforeAll": true,
19+
"describe": true,
20+
"expect": true,
21+
"it": true
22+
},
23+
"extends": ["react-app", "prettier", "eslint:recommended", "plugin:react/recommended"],
24+
"env": {
25+
"es6": true,
26+
"browser": true,
27+
"node": true,
28+
"jest": true
29+
},
30+
"rules": {
31+
"react/jsx-filename-extension": [1, { "extensions": [".js", ".jsx"] }],
32+
"react/display-name": "off",
33+
"array-bracket-spacing": ["error", "always", {
34+
"objectsInArrays": false
35+
}],
36+
"comma-dangle": [1, "always-multiline"],
37+
"comma-spacing": ["error", {
38+
"after": true
39+
}],
40+
"comma-style": "error",
41+
"camelcase": "error",
42+
"curly": ["error", "all"],
43+
"eol-last": "error",
44+
"eqeqeq": "error",
45+
"indent": ["error", 2, {
46+
"SwitchCase": 1,
47+
"MemberExpression": 0,
48+
"ImportDeclaration": 1,
49+
"ObjectExpression": 1
50+
}],
51+
"react/jsx-curly-spacing": ["error", "always", {
52+
"children": true,
53+
"allowMultiline": false,
54+
"spacing": {
55+
"objectLiterals": "never"
56+
}
57+
}],
58+
"key-spacing": "error",
59+
"keyword-spacing": "error",
60+
"linebreak-style": ["warn", "unix"],
61+
"max-len": ["error", 150],
62+
"new-cap": "error",
63+
"no-bitwise": "error",
64+
"no-caller": "error",
65+
"no-console": "warn",
66+
"no-mixed-spaces-and-tabs": "error",
67+
"no-multiple-empty-lines": ["error", {
68+
"max": 1
69+
}],
70+
"no-trailing-spaces": "error",
71+
"no-use-before-define": ["error", {
72+
"functions": false
73+
}],
74+
"no-undef": "error",
75+
"no-var": "error",
76+
"no-with": "error",
77+
"object-shorthand": "error",
78+
"object-curly-spacing": ["error", "always", {
79+
"objectsInObjects": false,
80+
"arraysInObjects": false
81+
}],
82+
"one-var": ["error", "never"],
83+
"padding-line-between-statements": ["error", {
84+
"blankLine": "always",
85+
"prev": "block-like",
86+
"next": "*"
87+
}],
88+
"quote-props": ["error", "as-needed"],
89+
"quotes": ["error", "single", {
90+
"allowTemplateLiterals": true
91+
}],
92+
"semi": ["error", "always"],
93+
"space-in-parens": "error",
94+
"space-infix-ops": "error",
95+
"wrap-iife": "error",
96+
"yoda": ["error", "never"],
97+
"jsx-a11y/href-no-hash": "off"
98+
}
99+
}

.gitignore

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
dist
2+
node_modules
3+
coverage
4+
yarn.lock
5+
*.log

.npmignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
*
2+
3+
!dist

.travis.yml

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
language: node_js
2+
node_js: "8"
3+
sudo: required
4+
before_install:
5+
- curl -o- -L https://yarnpkg.com/install.sh | bash -s -- --version 1.7.0
6+
- export PATH="$HOME/.yarn/bin:$HOME/.config/yarn/global/node_modules/.bin:$PATH"
7+
- yarn install
8+
script:
9+
- yarn test
10+
- yarn build
11+
cache:
12+
yarn: true
13+
directories:
14+
- node_modules
15+
git:
16+
depth: 1
17+
18+
deploy:
19+
- provider: script
20+
on:
21+
branch: master
22+
script:
23+
- npx semantic-release
24+
skip_cleanup: true
25+

config/jest.setup.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
import { configure } from 'enzyme';
2+
import Adapter from 'enzyme-adapter-react-16';
3+
4+
configure({ adapter: new Adapter() });

config/webpack.config.js

Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
const HtmlWebPackPlugin = require('html-webpack-plugin');
2+
const resolve = require('path').resolve;
3+
const merge = require('webpack-merge');
4+
5+
const commonConfig = {
6+
module: {
7+
rules: [{
8+
test: /\.(js|jsx)$/,
9+
exclude: /node_modules/,
10+
use: {
11+
loader: 'babel-loader',
12+
},
13+
}, {
14+
test: /\.(sa|sc|c)ss$/,
15+
use: [ 'style-loader', 'css-loader', 'sass-loader', 'resolve-url-loader' ],
16+
}, {
17+
test: /\.(png|jpg|gif|svg|woff|ttf|eot)/,
18+
loader: 'url-loader',
19+
},
20+
],
21+
},
22+
};
23+
24+
const htmlPlugin = new HtmlWebPackPlugin({
25+
template: './demo/index.html',
26+
filename: './index.html',
27+
});
28+
29+
const devConfig = {
30+
mode: 'development',
31+
entry: './demo/index.js',
32+
output: {
33+
path: resolve('../dist'),
34+
filename: '[name].[hash].js',
35+
},
36+
devtool: 'source-map',
37+
plugins: [ htmlPlugin ],
38+
};
39+
40+
const prodConfig = {
41+
mode: 'production',
42+
entry: './src/index.js',
43+
output: {
44+
path: resolve('./dist'),
45+
library: '[name]',
46+
libraryTarget: 'umd',
47+
filename: 'index.js',
48+
},
49+
};
50+
51+
module.exports = env => ({
52+
dev: merge(commonConfig, devConfig),
53+
prod: merge(commonConfig, prodConfig),
54+
})[env];
55+

demo/index.html

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
<!DOCTYPE html>
2+
<html lang="en">
3+
<head>
4+
<meta charset="UTF-8">
5+
<meta name="viewport" content="width=device-width, initial-scale=1.0">
6+
<meta http-equiv="X-UA-Compatible" content="ie=edge">
7+
<title>Data driven forms</title>
8+
</head>
9+
<body>
10+
<section id="root"></section>
11+
</body>
12+
</html>

demo/index.js

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
/* eslint-disable */
2+
import React from "react";
3+
import ReactDOM from "react-dom";
4+
import App from '../src';
5+
6+
ReactDOM.render(<App />, document.getElementById('root'));

package.json

Lines changed: 104 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,104 @@
1+
{
2+
"name": "@data-driven-forms/react-starter",
3+
"version": "0.0.1",
4+
"description": "Starter kit for data-driven-forms libraries.",
5+
"main": "dist/index.js",
6+
"scripts": {
7+
"start": "webpack-dev-server --env dev --config ./config/webpack.config.js --open --hot",
8+
"build": "webpack --env prod --config ./config/webpack.config.js",
9+
"test": "jest --coverage"
10+
},
11+
"repository": {
12+
"type": "git",
13+
"url": "git+https://github.com/data-driven-forms/react-starter.git"
14+
},
15+
"keywords": [
16+
"react",
17+
"forms",
18+
"javascript",
19+
"starter app"
20+
],
21+
"author": "Martin Marosi",
22+
"license": "MIT",
23+
"bugs": {
24+
"url": "https://github.com/data-driven-forms/react-starter/issues"
25+
},
26+
"homepage": "https://github.com/data-driven-forms/react-starter#readme",
27+
"jest": {
28+
"setupFiles": [
29+
"./config/jest.setup.js"
30+
],
31+
"coverageDirectory": "./coverage/",
32+
"collectCoverage": true,
33+
"collectCoverageFrom": [
34+
"src/**/*.{js,jsx}",
35+
"!**/node_modules/**",
36+
"!**/.{snap}*",
37+
"!src/vendor.js"
38+
],
39+
"coverageReporters": [
40+
"text",
41+
"html",
42+
"lcov"
43+
],
44+
"moduleNameMapper": {
45+
"\\.(jpg|jpeg|png|gif|eot|otf|webp|svg|ttf|woff|woff2|mp4|webm|wav|mp3|m4a|aac|oga)$": "<rootDir>/__mocks__/fileMock.js",
46+
"\\.(css|scss)$": "identity-obj-proxy"
47+
}
48+
},
49+
"devDependencies": {
50+
"@babel/core": "^7.1.6",
51+
"@babel/plugin-syntax-dynamic-import": "^7.0.0",
52+
"@babel/preset-env": "^7.1.6",
53+
"@babel/preset-react": "^7.0.0",
54+
"@semantic-release/git": "^7.0.5",
55+
"@semantic-release/npm": "^5.1.1",
56+
"babel-core": "^7.0.0-bridge.0",
57+
"babel-eslint": "9.x",
58+
"babel-jest": "^23.6.0",
59+
"babel-loader": "^8.0.4",
60+
"babel-plugin-lodash": "^3.3.4",
61+
"css-loader": "^1.0.1",
62+
"enzyme": "^3.7.0",
63+
"enzyme-adapter-react-16": "^1.7.0",
64+
"enzyme-to-json": "^3.3.4",
65+
"eslint": "5.x",
66+
"eslint-config-prettier": "^3.3.0",
67+
"eslint-config-react-app": "^3.0.5",
68+
"eslint-loader": "^2.1.1",
69+
"eslint-plugin-flowtype": "2.x",
70+
"eslint-plugin-import": "2.x",
71+
"eslint-plugin-jsx-a11y": "6.x",
72+
"eslint-plugin-react": "^7.11.1",
73+
"html-webpack-plugin": "^3.2.0",
74+
"identity-obj-proxy": "^3.0.0",
75+
"jest": "^23.6.0",
76+
"mini-css-extract-plugin": "^0.4.4",
77+
"node-sass": "^4.10.0",
78+
"prop-types": "^15.6.2",
79+
"react": "^16.6.3",
80+
"react-dom": "^16.6.3",
81+
"regenerator-runtime": "^0.12.1",
82+
"resolve-url-loader": "^3.0.0",
83+
"sass-loader": "^7.1.0",
84+
"semantic-release": "15.12.0",
85+
"style-loader": "^0.23.1",
86+
"url-loader": "^1.1.2",
87+
"webpack": "^4.25.1",
88+
"webpack-cli": "^3.1.2",
89+
"webpack-dev-server": "^3.1.10",
90+
"webpack-merge": "^4.1.4"
91+
},
92+
"release": {
93+
"prepare": [
94+
"@semantic-release/npm",
95+
{
96+
"path": "@semantic-release/git",
97+
"assets": [
98+
"package.json"
99+
],
100+
"message": "Release of new version: ${nextRelease.version} <no> [skip ci]"
101+
}
102+
]
103+
}
104+
}

0 commit comments

Comments
 (0)