Skip to content

Commit db822c6

Browse files
committed
feat: antd filter dev
1 parent 967beb7 commit db822c6

Some content is hidden

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

70 files changed

+1539
-1623
lines changed

.DS_Store

6 KB
Binary file not shown.

.eslintrc.js

Lines changed: 48 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
/* eslint max-len: 0 */
12
module.exports = {
23
root: true,
34
env: {
@@ -13,34 +14,28 @@ module.exports = {
1314
'plugin:@typescript-eslint/strict-type-checked',
1415
'plugin:import/recommended',
1516
'plugin:import/typescript',
16-
'prettier',
17+
'plugin:react/jsx-runtime',
18+
'plugin:prettier/recommended',
1719
],
18-
plugins: ['@typescript-eslint'],
20+
plugins: ['@typescript-eslint', 'simple-import-sort'],
1921
settings: {
2022
react: {
2123
version: '17.0.2',
2224
},
23-
'import/parsers': {
24-
'@typescript-eslint/parser': ['.ts', '.tsx'],
25-
},
2625
'import/resolver': {
2726
typescript: {
2827
alwaysTryTypes: true,
29-
project: ['./tsconfig.json', './packages/*/tsconfig.json'],
30-
},
31-
node: {
32-
extensions: ['.js', '.jsx', '.ts', '.tsx'],
28+
project: ['./packages/*/tsconfig.json'],
3329
},
3430
},
35-
'import/extensions': ['.js', '.jsx', '.ts', '.tsx'],
3631
},
3732
parser: '@typescript-eslint/parser',
3833
parserOptions: {
39-
tsconfigRootDir: __dirname,
34+
// tsconfigRootDir: __dirname,
4035
sourceType: 'module',
41-
ecmaVersion: 2023,
36+
ecmaVersion: 'latest',
4237
alwaysTryTypes: true,
43-
project: ['./tsconfig.json', './packages/*/tsconfig.json'],
38+
project: ['**/tsconfig.json', './packages/*/tsconfig.json'],
4439
},
4540
overrides: [
4641
{
@@ -52,6 +47,45 @@ module.exports = {
5247
'linebreak-style': 0,
5348
'multiline-comment-style': ['error', 'starred-block'],
5449
'import/no-cycle': 0,
50+
'import/prefer-default-export': 0,
51+
'simple-import-sort/imports': [
52+
'error',
53+
{
54+
groups: [
55+
// `react` related packages & side effect imports come first.
56+
['^react', '^\\u0000'],
57+
/*
58+
* Node.js builtins. You could also generate this regex if you use a `.js` config.
59+
* For example: `^(${require("module").builtinModules.join("|")})(/|$)`
60+
*/
61+
[
62+
'^(assert|buffer|child_process|cluster|console|constants|crypto|dgram|dns|domain|events|fs|http|https|module|net|os|path|punycode|querystring|readline|repl|stream|string_decoder|sys|timers|tls|tty|url|util|vm|zlib|freelist|v8|process|async_hooks|http2|perf_hooks)(/.*|$)',
63+
],
64+
// Other packages.
65+
['^\\w', '^@\\w'],
66+
// internal package
67+
[
68+
'^(@|@assets|assets|@styles|styles|@static|static|@utils|utils|@tools|tools|@hooks|hooks|@pages|pages|@components|components|@component|component|@service|service|@services|services|@constants|@store|store|@types|types|@src|src|@providers|providers|@containers|containers|@layout|layout)(/.*|$)',
69+
],
70+
[
71+
// Parent imports. Put `..` last.
72+
'^\\.\\.(?!/?$)',
73+
'^\\.\\./?$',
74+
// Other relative imports. Put same-folder imports and `.` last.
75+
'^\\./(?=.*/)(?!/?$)',
76+
'^\\.(?!/?$)',
77+
'^\\./?$',
78+
],
79+
[
80+
// Image imports.
81+
'^.+\\.(gif|png|jpg|jpeg|webp|svg)$',
82+
// Style imports.
83+
'^.+\\.(sass|scss|less|css)$',
84+
],
85+
],
86+
},
87+
],
88+
'simple-import-sort/exports': 'error',
5589
'import/extensions': [
5690
'error',
5791
'ignorePackages',
@@ -62,11 +96,10 @@ module.exports = {
6296
tsx: 'never',
6397
},
6498
],
65-
'import/no-unresolved': [1, { ignore: ['@rc-querybuilder/antd'] }],
6699
'no-shadow': 0,
67100
'no-underscore-dangle': 0,
68101
'import/no-extraneous-dependencies': 0,
69-
'max-len': ['error', { code: 160, tabWidth: 2 }],
102+
'max-len': ['error', { code: 200, tabWidth: 2 }],
70103
'no-param-reassign': 0,
71104
'no-restricted-syntax': 0,
72105
'react/require-default-props': 0,

.stylelintrc.js

Lines changed: 20 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,20 @@
1-
module.exports = {
2-
extends: ['stylelint-config-standard', 'stylelint-prettier/recommended'],
3-
customSyntax: 'postcss-less',
4-
overrides: [
5-
{
6-
files: ['*.less', '**/*.less'],
7-
customSyntax: 'postcss-less',
8-
},
9-
],
10-
rules: {
11-
'rule-empty-line-before': 'always',
12-
'prettier/prettier': [true, { endOfLine: 'auto' }],
13-
},
14-
};
1+
module.exports = {
2+
extends: ['stylelint-config-standard'],
3+
plugins: ['stylelint-prettier'],
4+
customSyntax: 'postcss-less',
5+
overrides: [
6+
{
7+
files: ['*.less', '**/*.less'],
8+
customSyntax: 'postcss-less',
9+
},
10+
],
11+
rules: {
12+
'rule-empty-line-before': [
13+
'always',
14+
{
15+
ignore: ['after-comment', 'first-nested', 'inside-block'],
16+
},
17+
],
18+
'prettier/prettier': [true, { endOfLine: 'auto' }],
19+
},
20+
};

.vscode/settings.json

Lines changed: 38 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -1,36 +1,38 @@
1-
{
2-
"editor.defaultFormatter": "esbenp.prettier-vscode",
3-
"editor.codeActionsOnSave": {
4-
"source.fixAll": "explicit",
5-
"source.fixAll.eslint": "explicit",
6-
"source.fixAll.stylelint": "explicit"
7-
},
8-
"css.validate": false,
9-
"less.validate": false,
10-
"scss.validate": false,
11-
"[javascript]": {
12-
"editor.defaultFormatter": "esbenp.prettier-vscode"
13-
},
14-
"[json]": {
15-
"editor.defaultFormatter": "esbenp.prettier-vscode"
16-
},
17-
"[css]": {
18-
"editor.formatOnSave": true,
19-
"editor.formatOnPaste": true,
20-
"editor.defaultFormatter": "stylelint.vscode-stylelint"
21-
},
22-
"[less]": {
23-
"editor.formatOnSave": true,
24-
"editor.formatOnPaste": true,
25-
"editor.defaultFormatter": "stylelint.vscode-stylelint"
26-
},
27-
"[scss]": {
28-
"editor.formatOnSave": true,
29-
"editor.formatOnPaste": true,
30-
"editor.defaultFormatter": "stylelint.vscode-stylelint"
31-
},
32-
"[svg]": {
33-
"editor.formatOnSave": true,
34-
"editor.formatOnPaste": true
35-
}
36-
}
1+
{
2+
"editor.defaultFormatter": "esbenp.prettier-vscode",
3+
"editor.codeActionsOnSave": {
4+
"source.fixAll": "never",
5+
"source.fixAll.eslint": "explicit",
6+
"source.fixAll.stylelint": "explicit"
7+
},
8+
"css.validate": false,
9+
"less.validate": false,
10+
"scss.validate": false,
11+
"[javascript]": {
12+
"editor.defaultFormatter": "esbenp.prettier-vscode"
13+
},
14+
"[json]": {
15+
"editor.defaultFormatter": "esbenp.prettier-vscode"
16+
},
17+
"[css]": {
18+
"editor.formatOnSave": true,
19+
"editor.formatOnPaste": true,
20+
"editor.defaultFormatter": "stylelint.vscode-stylelint"
21+
},
22+
"[less]": {
23+
"editor.formatOnSave": true,
24+
"editor.formatOnPaste": true,
25+
"editor.defaultFormatter": "stylelint.vscode-stylelint"
26+
},
27+
"[scss]": {
28+
"editor.formatOnSave": true,
29+
"editor.formatOnPaste": true,
30+
"editor.defaultFormatter": "stylelint.vscode-stylelint"
31+
},
32+
"[svg]": {
33+
"editor.formatOnSave": true,
34+
"editor.formatOnPaste": true
35+
},
36+
"typescript.enablePromptUseWorkspaceTsdk": true,
37+
"typescript.tsdk": "node_modules/typescript/lib"
38+
}

package.json

Lines changed: 14 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,34 +1,31 @@
11
{
2-
"name": "react-query-builder",
2+
"name": "react-filter-component",
33
"private": true,
44
"author": "wangkka1@163.com",
5-
"description": "react query builder component monorepo",
5+
"description": "react filter expressions input component monorepo",
66
"keywords": [
77
"react",
88
"react component",
9-
"query-builder",
9+
"react filter expressions component",
10+
"react query builder component",
1011
"typescript",
1112
"javascript",
1213
"pnpm"
1314
],
14-
"homepage": "https://reactqb.icodex.me",
15-
"bugs": "https://github.com/wood3n/react-query-builder/issues",
15+
"homepage": "https://reactfilter.icodex.me",
16+
"bugs": "https://github.com/wood3n/react-filter-component/issues",
1617
"repository": {
1718
"type": "git",
18-
"url": "https://github.com/wood3n/react-query-builder"
19+
"url": "https://github.com/wood3n/react-filter-component"
1920
},
2021
"scripts": {
2122
"prepare": "is-ci || husky install",
2223
"preinstall": "npx only-allow pnpm",
23-
"dev": "pnpm --filter @rc-querybuilder/antd run dev",
24-
"build:core": "pnpm --filter @rc-querybuilder/core run build",
25-
"build:antd": "pnpm --filter @rc-querybuilder/antd run build",
26-
"lint": "pnpm run lint:component && pnpm run lint:style",
27-
"lint-fix": "pnpm run lint-fix:component && pnpm run lint-fix:style",
28-
"lint-fix:component": "pnpm run lint:component -- --fix",
29-
"lint:component": "eslint . --ext .js,.jsx,.ts,.tsx --cache",
30-
"lint-fix:style": "pnpm run lint:style -- --fix",
31-
"lint:style": "stylelint \"**/*.{css,less}\"",
24+
"dev": "pnpm --filter @react-filter/core run dev",
25+
"dev:antd": "pnpm --filter @react-filter/antd run dev",
26+
"build:core": "pnpm --filter @react-filter/core run build",
27+
"build:antd": "pnpm --filter @react-filter/antd run build",
28+
"lint-fix": "eslint --fix --ext .js,.jsx,.ts,.tsx . && stylelint \"**/*.{css,less}\" --fix",
3229
"prettier": "prettier . --write",
3330
"test": "jest"
3431
},
@@ -47,8 +44,10 @@
4744
"eslint-import-resolver-typescript": "^3.6.1",
4845
"eslint-plugin-import": "^2.29.0",
4946
"eslint-plugin-jsx-a11y": "^6.7.1",
47+
"eslint-plugin-prettier": "^5.1.3",
5048
"eslint-plugin-react": "^7.33.2",
5149
"eslint-plugin-react-hooks": "^4.6.0",
50+
"eslint-plugin-simple-import-sort": "^12.0.0",
5251
"husky": "^8.0.3",
5352
"is-ci": "^3.0.1",
5453
"lint-staged": "^15.0.2",
File renamed without changes.

packages/antd/README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
# @rc-filter/antd
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
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-
<link rel="icon" href="./react.svg" />
7-
<title>docs</title>
8-
</head>
9-
<body>
10-
<div id="root"></div>
11-
<script type="module" src="/src/App.tsx"></script>
12-
</body>
13-
</html>
1+
<!doctype html>
2+
<html lang="zh-CN">
3+
<head>
4+
<meta charset="UTF-8" />
5+
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
6+
<link rel="icon" href="./react.svg" />
7+
<title>react filter</title>
8+
</head>
9+
<body>
10+
<div id="root"></div>
11+
<script type="module" src="./src/App.tsx"></script>
12+
</body>
13+
</html>
Lines changed: 14 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
{
2-
"name": "@rc-querybuilder/antd",
2+
"name": "@react-filter/antd",
33
"version": "1.0.0",
44
"author": "wangkka1@163.com",
55
"license": "MIT",
6-
"description": "react query builder component based antd component library",
6+
"description": "react filter component based on antd component library",
77
"main": "lib/index.js",
88
"module": "es/index.js",
99
"typings": "es/index.d.ts",
@@ -22,23 +22,29 @@
2222
"antd",
2323
"react",
2424
"react component",
25-
"query-builder",
25+
"react query filter component",
26+
"react query builder component",
2627
"typescript",
2728
"javascript"
2829
],
29-
"homepage": "https://reactqb.icodex.me",
30-
"bugs": "https://github.com/wood3n/react-query-builder/issues",
30+
"homepage": "https://reactfilter.icodex.me",
31+
"bugs": "https://github.com/wood3n/react-filter-component/issues",
3132
"repository": {
3233
"type": "git",
33-
"url": "https://github.com/wood3n/react-query-builder"
34+
"url": "https://github.com/wood3n/react-filter-component",
35+
"directory": "packages/antd"
3436
},
3537
"dependencies": {
38+
"@dnd-kit/core": "^6.1.0",
39+
"@dnd-kit/modifiers": "^7.0.0",
40+
"ahooks": "^3.7.10",
3641
"async-validator": "^4.2.5",
3742
"classnames": "^2.3.2",
3843
"immer": "^10.0.3",
3944
"lodash-es": "^4.17.21",
4045
"react-dnd": "^16.0.1",
41-
"react-dnd-html5-backend": "^16.0.1"
46+
"react-dnd-html5-backend": "^16.0.1",
47+
"use-immer": "^0.9.0"
4248
},
4349
"devDependencies": {
4450
"@ant-design/icons": "^5.2.6",
@@ -48,7 +54,6 @@
4854
"@types/react-dom": "17.0.22",
4955
"@vitejs/plugin-react": "^4.1.0",
5056
"antd": "^5.10.2",
51-
"less": "^4.2.0",
5257
"react": "17.0.2",
5358
"react-dom": "17.0.2",
5459
"vite": "^4.5.0",
@@ -57,7 +62,7 @@
5762
"peerDependencies": {
5863
"@ant-design/icons": ">=4.0.0",
5964
"antd": ">4.0.0",
60-
"react": "^17.0.2",
65+
"react": ">=16.8.0",
6166
"react-dom": ">=16.8.0"
6267
},
6368
"publishConfig": {

0 commit comments

Comments
 (0)