Skip to content

Commit bae3526

Browse files
committed
fix(common): created common package
1 parent f35a7d9 commit bae3526

File tree

7 files changed

+260
-0
lines changed

7 files changed

+260
-0
lines changed

packages/common/.eslintrc

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

packages/common/.gitignore

Lines changed: 66 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,66 @@
1+
# Logs
2+
logs
3+
*.log
4+
npm-debug.log*
5+
yarn-debug.log*
6+
yarn-error.log*
7+
8+
# Runtime data
9+
pids
10+
*.pid
11+
*.seed
12+
*.pid.lock
13+
14+
# Directory for instrumented libs generated by jscoverage/JSCover
15+
lib-cov
16+
17+
# Coverage directory used by tools like istanbul
18+
coverage
19+
20+
# nyc test coverage
21+
.nyc_output
22+
23+
# Grunt intermediate storage (http://gruntjs.com/creating-plugins#storing-task-files)
24+
.grunt
25+
26+
# Bower dependency directory (https://bower.io/)
27+
bower_components
28+
29+
# node-waf configuration
30+
.lock-wscript
31+
32+
# Compiled binary addons (https://nodejs.org/api/addons.html)
33+
build/Release
34+
35+
# Dependency directories
36+
node_modules/
37+
jspm_packages/
38+
39+
# TypeScript v1 declaration files
40+
typings/
41+
42+
# Optional npm cache directory
43+
.npm
44+
45+
# Optional eslint cache
46+
.eslintcache
47+
48+
# Optional REPL history
49+
.node_repl_history
50+
51+
# Output of 'npm pack'
52+
*.tgz
53+
54+
# Yarn Integrity file
55+
.yarn-integrity
56+
57+
# dotenv environment variables file
58+
.env
59+
60+
# next.js build output
61+
.next
62+
dist
63+
node_modules
64+
coverage
65+
yarn.lock
66+
*.log

packages/common/LICENSE

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
MIT License
2+
3+
Copyright (c) 2018 Data driven forms
4+
5+
Permission is hereby granted, free of charge, to any person obtaining a copy
6+
of this software and associated documentation files (the "Software"), to deal
7+
in the Software without restriction, including without limitation the rights
8+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9+
copies of the Software, and to permit persons to whom the Software is
10+
furnished to do so, subject to the following conditions:
11+
12+
The above copyright notice and this permission notice shall be included in all
13+
copies or substantial portions of the Software.
14+
15+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21+
SOFTWARE.

packages/common/README.md

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
# `@data-driven-forms/common`
2+
3+
> TODO: description
4+
5+
## Usage
6+
7+
```
8+
const common = require('@data-driven-forms/common');
9+
10+
// TODO: DEMONSTRATE API
11+
```

packages/common/babel.config.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
module.exports = {
2+
extends: '../../babel.config.js',
3+
};

packages/common/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() });

packages/common/package.json

Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
{
2+
"name": "@data-driven-forms/common",
3+
"version": "1.0.0",
4+
"description": "Common components, helpers and other pieces of code",
5+
"license": "Apache-2.0",
6+
"scripts": {
7+
},
8+
"repository": "[email protected]:data-driven-forms/react-forms.git",
9+
"devDependencies": {
10+
"@babel/core": "^7.2.2",
11+
"@babel/plugin-syntax-dynamic-import": "^7.0.0",
12+
"@babel/preset-env": "^7.1.6",
13+
"@babel/preset-react": "^7.0.0",
14+
"babel-core": "^7.0.0-bridge.0",
15+
"babel-eslint": "9.x",
16+
"babel-jest": "^23.6.0",
17+
"babel-loader": "^8.0.4",
18+
"babel-plugin-lodash": "^3.3.4",
19+
"css-loader": "^1.0.1",
20+
"enzyme": "^3.7.0",
21+
"enzyme-adapter-react-16": "^1.7.0",
22+
"enzyme-to-json": "^3.3.4",
23+
"eslint": "5.x",
24+
"eslint-config-prettier": "^3.3.0",
25+
"eslint-config-react-app": "^3.0.5",
26+
"eslint-loader": "^2.1.1",
27+
"eslint-plugin-flowtype": "2.x",
28+
"eslint-plugin-import": "2.x",
29+
"eslint-plugin-jsx-a11y": "6.x",
30+
"eslint-plugin-react": "^7.11.1",
31+
"html-webpack-plugin": "^3.2.0",
32+
"mini-css-extract-plugin": "^0.4.4",
33+
"node-sass": "^4.10.0",
34+
"prop-types": "^15.6.2",
35+
"react": "^16.6.3",
36+
"react-dom": "^16.6.3",
37+
"regenerator-runtime": "^0.12.1",
38+
"resolve-url-loader": "^3.0.0",
39+
"sass-loader": "^7.1.0",
40+
"semantic-release": "15.12.0",
41+
"style-loader": "^0.23.1",
42+
"url-loader": "^1.1.2",
43+
"webpack": "^4.25.1",
44+
"webpack-cli": "^3.1.2",
45+
"webpack-dev-server": "^3.1.10",
46+
"webpack-merge": "^4.1.4"
47+
},
48+
"dependencies": {
49+
"@babel/plugin-proposal-class-properties": "^7.1.0"
50+
},
51+
"peerDependencies": {
52+
"react": "^16.6.0",
53+
"react-dom": "^16.6.0"
54+
}
55+
}

0 commit comments

Comments
 (0)