Skip to content

Commit cf5b39b

Browse files
authored
Merge pull request #271 from data-driven-forms/himdel-common
Himdel common
2 parents c1d294d + 7a9ee07 commit cf5b39b

Some content is hidden

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

29 files changed

+287
-734
lines changed

LICENSE

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -186,7 +186,7 @@
186186
same "printed page" as the copyright notice for easier
187187
identification within third-party archives.
188188

189-
Copyright [yyyy] [name of copyright owner]
189+
Copyright 2019, Data Driven Forms
190190

191191
Licensed under the Apache License, Version 2.0 (the "License");
192192
you may not use this file except in compliance with the License.

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

packages/common/LICENSE

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

packages/common/README.md

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
[![Data Driven Form logo](images/logo.png)](https://data-driven-forms.org/)
2+
3+
# `@data-driven-forms/common` - common code shared by multiple `@data-driven-forms/*` packages
4+
5+
This package exists to share code used by more than one data-driven-forms package, such as:
6+
7+
* shared interfaces - propTypes
8+
* common mapper code - `condition` implementation
9+
10+
11+
## Usage
12+
13+
```
14+
const common = require('@data-driven-forms/common');
15+
16+
// shared props
17+
function MyComponent() {...}
18+
19+
MyComponent.propTypes = {
20+
...common.children.propTypes,
21+
isMulti: PropTypes.bool.isRequired,
22+
};
23+
24+
MyComponent.defaultProps = {
25+
...common.children.defaultProps,
26+
};
27+
28+
// condition code
29+
common.condition.evaluate({
30+
when: "field",
31+
in: ["foo", "bar"],
32+
}, { field: "baz" }); // false
33+
```

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

packages/mui-component-mapper/.eslintrc

Lines changed: 0 additions & 99 deletions
This file was deleted.
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
../common/.eslintrc

0 commit comments

Comments
 (0)