Skip to content

Commit 6f4d746

Browse files
authored
Workspaces (#769)
* workspaces wip test works . . . . . * . * esm, no decorators, vite * todo! fullySpecified * sandbox-simple * vite * sandbox simple * sandbox * lint fix * . * todo: move webpack & babel to root . . * antd wip * good lint * utils * deps split . * mui * add react to dev deps * material * bootstrap * 6.0.0 * . . . * 1 * split core to core & ui * , * . * remove fullySpecified: false and type: module * . * VanillaWidgets . * readme * . * . * fixes for hoist * pnpm works ? * pnpm ready * . * for yarn v1 * Revert "for yarn v1" This reverts commit 61f46e8. * for npm 7 * fix pushd * fix build sh * workspace:* * no yarn build * pnpm * . * . * . * . * . * . * --access public * fix immutable has no default * 6.0.0-beta.1 * gitignore * 6.0.0-beta.2 * immutable 4 * beta3 * sass * Revert "immutable 4" This reverts commit 3e219f1. * Revert "fix immutable has no default" This reverts commit 161b3fd. * important fix * dirs cjs, esm, styles -> css . . * . * beta4 * . * styles! * . * . * . * css split a bit * beta5 * . * pnpm/action-setup . * readme * pnpm-lock.yaml * artifacts * smoko, del gpr * gh-pages * . * . * . * test! * . * . * . * test * . * . * . * . * csb * . * . * . * . * port * Revert "test!" This reverts commit 70f0cad. * . * tags * v6.0.0
1 parent 0e9506f commit 6f4d746

File tree

384 files changed

+17860
-2776
lines changed

Some content is hidden

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

384 files changed

+17860
-2776
lines changed

.babelrc

-31
This file was deleted.

.circleci/config.yml

+24-22
Original file line numberDiff line numberDiff line change
@@ -4,58 +4,60 @@ orbs:
44
jobs:
55
test:
66
docker:
7-
- image: cimg/node:12.22-browsers
7+
- image: cimg/node:14.20-browsers
88
steps:
99
- browser-tools/install-chrome
1010
- browser-tools/install-chromedriver
11+
- run:
12+
name: Install pnpm
13+
command: npm install --global pnpm
1114
- run:
1215
name: Check install
1316
command: |
1417
google-chrome --version
1518
chromedriver --version
1619
node --version
1720
npm --version
21+
pnpm --version
1822
- checkout
19-
# - restore_cache:
20-
# keys:
21-
# - node-deps-v1-{{ arch }}-{{checksum "package.json"}}-{{checksum "examples/package.json"}}-{{checksum "sandbox/package.json"}}-{{checksum "sandbox_simple/package.json"}}
22-
# - node-deps-v1-{{ arch }}-{{checksum "package.json"}}
23+
- restore_cache:
24+
name: Restore pnpm Package Cache
25+
keys:
26+
- pnpm-packages-{{ checksum "pnpm-lock.yaml" }}
2327
- run:
2428
name: Install
25-
command: npm run install-all
26-
# - save_cache:
27-
# key: node-deps-v1-{{ arch }}-{{checksum "package.json"}}-{{checksum "examples/package.json"}}-{{checksum "sandbox/package.json"}}-{{checksum "sandbox_simple/package.json"}}
28-
# paths:
29-
# - node_modules
30-
# - examples/node_modules
31-
# - sandbox/node_modules
32-
# - sandbox_simple/node_modules
29+
command: pnpm i
30+
- save_cache:
31+
name: Save pnpm Package Cache
32+
key: pnpm-packages-{{ checksum "pnpm-lock.yaml" }}
33+
paths:
34+
- node_modules
3335
- run:
3436
name: Lint
35-
command: npm run lint
37+
command: pnpm lint
3638
- run:
3739
name: Test
38-
command: npm run test
40+
command: pnpm test
3941
- store_test_results:
40-
path: ./junit
42+
path: ./packages/tests/junit
4143
- store_artifacts:
42-
path: ./junit
44+
path: ./packages/tests/junit
4345
destination: junit
4446
- store_artifacts:
45-
path: ./coverage/lcov
47+
path: ./packages/tests/coverage/lcov
4648
destination: lcov
4749
- store_artifacts:
48-
path: ./coverage/html
50+
path: ./packages/tests/coverage/html
4951
destination: coverage
5052
- run:
5153
name: Build
52-
command: npm run build-all
54+
command: pnpm build
5355
- store_artifacts:
54-
path: ./examples/build
56+
path: ./packages/examples/build
5557
destination: examples
5658
- run:
5759
name: Hot
58-
command: npm run check-hot
60+
command: pnpm check-hot
5961

6062
workflows:
6163
smoke:

.deepsource.toml

+2-2
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@ version = 1
33
test_patterns = ["tests/**"]
44

55
exclude_patterns = [
6-
"sandbox_simple/**",
7-
"sandbox/**",
6+
"packages/sandbox/**",
7+
"packages/sandbox_simple/**",
88
"scripts/**"
99
]
1010

.eslintignore

+2
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,4 @@
11
node_modules
22
build
3+
dist
4+
ts_out

.eslintrc.js

+64-42
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,12 @@ module.exports = {
22
"env": {
33
"browser": true,
44
"es6": true,
5-
"mocha": true,
6-
"jest": true,
75
"node": true
86
},
97
"ignorePatterns": [
108
"**/ts_out/*",
119
"**/build/*",
10+
"**/scripts/*",
1211
"**/dist/*",
1312
"**/node_modules/*",
1413
"bundle.js",
@@ -19,54 +18,59 @@ module.exports = {
1918
"extends": [
2019
"eslint:recommended",
2120
"plugin:import/recommended",
22-
"plugin:import/typescript",
21+
// "plugin:import/typescript", // not needed for JS
2322
"plugin:react/recommended",
24-
"plugin:@typescript-eslint/eslint-recommended",
23+
// "plugin:@typescript-eslint/eslint-recommended", // not needed for JS
2524
],
2625
"globals": {
2726
"Atomics": "readonly",
2827
"SharedArrayBuffer": "readonly"
2928
},
30-
"parserOptions": {
31-
"ecmaVersion": 11,
32-
"ecmaFeatures": {
33-
"legacyDecorators": true,
34-
"jsx": true
35-
},
36-
"sourceType": "module"
37-
},
3829
"plugins": [
3930
"react",
4031
"babel",
4132
"import",
4233
"@typescript-eslint"
4334
],
35+
"parser": "@typescript-eslint/parser",
36+
"parserOptions": {
37+
"ecmaVersion": 11,
38+
"ecmaFeatures": {
39+
"jsx": true
40+
},
41+
"sourceType": "module",
42+
"project": "tsconfig.json", // resolves dynamically for each package
43+
},
4444
"settings": {
4545
"react": {
4646
"version": "detect"
4747
},
48-
"import/resolver": {
49-
"webpack": {
50-
"config": "./webpack.config.js"
51-
}
52-
},
5348
"import/extensions": [
54-
".js",
55-
".jsx",
56-
".ts",
57-
".tsx"
49+
".js", ".jsx",
50+
// ".ts", ".tsx"
5851
],
5952
"import/parsers": {
6053
"@typescript-eslint/parser": [
61-
".ts",
62-
".tsx"
63-
]
54+
".ts", ".tsx"
55+
],
56+
},
57+
"import/resolver": {
58+
// order matters, so push "node" to end as fallback
59+
"typescript": {
60+
// "alwaysTryTypes": true,
61+
"project": "packages/*/tsconfig.json",
62+
},
63+
"node": true,
6464
},
6565
"import/core-modules": [
66-
"react-awesome-query-builder/lib/css/styles.css"
67-
]
66+
// "@react-awesome-query-builder/ui/css/styles.scss",
67+
"react" // for import `react` in `core/modules/index.d.ts`
68+
],
69+
"import/ignore": [
70+
/\.(scss|less|css)$/
71+
],
72+
"import/internal-regex": /^@react-awesome-query-builder/
6873
},
69-
"parser": "@typescript-eslint/parser",
7074
"rules": {
7175
"indent": [
7276
"error",
@@ -123,33 +127,51 @@ module.exports = {
123127
"prefer-const": [
124128
//todo: set to warn
125129
"off", {}
130+
],
131+
"import/no-named-as-default-member": [
132+
"off", {}
126133
]
127134
},
128135
"overrides": [
129136
{
130-
"files": ["modules/**/*.ts", "modules/**/*.tsx"],
131-
"parserOptions": {
132-
"project": 'tsconfig.json',
137+
"files": ["packages/tests/**/*"],
138+
"env": {
139+
"mocha": true,
140+
"jasmine": true,
133141
},
134-
},
135-
{
136-
"files": ["examples/**/*.ts", "examples/**/*.tsx"],
137-
"parserOptions": {
138-
"project": 'examples/tsconfig.json',
142+
"settings": {
143+
"import/core-modules": [
144+
"sinon",
145+
"chai"
146+
],
147+
// "import/resolver": {
148+
// "webpack": {
149+
// "config": "./webpack.config.js"
150+
// }
151+
// },
139152
},
140153
},
141154
{
142-
"files": ["sandbox/**/*.ts", "sandbox/**/*.tsx"],
155+
"files": ["packages/sandbox_simple/**/*"],
156+
"parser": "@babel/eslint-parser",
143157
"parserOptions": {
144-
"project": 'sandbox/tsconfig.json',
158+
"requireConfigFile": false,
159+
"babelOptions": {
160+
"presets": [
161+
"@babel/preset-env",
162+
"@babel/preset-react"
163+
],
164+
},
165+
"sourceType": "module",
145166
},
146-
},
147-
{
148-
"files": ["tests/**/*.ts", "tests/**/*.tsx"],
149-
"parserOptions": {
150-
"project": 'tests/tsconfig.json',
167+
"settings": {
168+
"import/core-modules": [
169+
"react",
170+
"@react-awesome-query-builder/ui/css/styles.css"
171+
],
151172
},
152173
},
174+
153175
{
154176
"files": ["**/*.ts", "**/*.tsx"],
155177
"extends": [

.github/workflows/codecov-report.yml

+10-5
Original file line numberDiff line numberDiff line change
@@ -9,13 +9,18 @@ jobs:
99
run:
1010
runs-on: ubuntu-latest
1111
steps:
12-
- uses: actions/checkout@v2
13-
- uses: actions/setup-node@v1
12+
- uses: actions/checkout@v3
13+
- uses: pnpm/action-setup@v2
14+
with:
15+
version: 7
16+
- uses: actions/setup-node@v3
1417
with:
1518
node-version: 14
16-
- run: npm i
19+
#cache: 'pnpm'
20+
- run: pnpm i
1721
- run: echo fs.inotify.max_user_watches=524288 | sudo tee -a /etc/sysctl.conf && sudo sysctl -p
18-
- run: npm test
19-
- uses: codecov/codecov-action@v1
22+
- run: pnpm test
23+
- uses: codecov/codecov-action@v3
2024
with:
2125
token: ${{ secrets.CODECOV_TOKEN }}
26+
directory: ./packages/tests/coverage/

.github/workflows/gh-pages.yml

+29-32
Original file line numberDiff line numberDiff line change
@@ -6,37 +6,34 @@ on:
66
workflow_dispatch:
77

88
jobs:
9-
page_build:
10-
name: Update GitHub pages
9+
run:
1110
runs-on: ubuntu-latest
1211
steps:
13-
- uses: actions/checkout@v1
14-
with:
15-
ref: master
16-
- uses: actions/setup-node@v1
17-
with:
18-
node-version: '14.x'
19-
- run: npm install
20-
- name: Build examples
21-
run: npm run build-examples
22-
- name: Copy build
23-
run: |
24-
rm -rf /tmp/react-awesome-query-builder
25-
mkdir /tmp/react-awesome-query-builder
26-
mkdir /tmp/react-awesome-query-builder/gh-pages
27-
cp ./examples/build/*bundle* /tmp/react-awesome-query-builder/gh-pages/
28-
- uses: actions/checkout@v1
29-
with:
30-
ref: gh-pages
31-
- name: Commit build
32-
run: |
33-
cp -R /tmp/react-awesome-query-builder/gh-pages/* .
34-
git config --local user.email "[email protected]"
35-
git config --local user.name "GitHub Action"
36-
git add ./*bundle*
37-
git commit -m "update to ${GITHUB_SHA}"
38-
- name: Push changes
39-
uses: ad-m/github-push-action@master
40-
with:
41-
branch: gh-pages
42-
github_token: ${{ secrets.GITHUB_TOKEN }}
12+
- uses: actions/checkout@v3
13+
- uses: pnpm/action-setup@v2
14+
with:
15+
version: 7
16+
- uses: actions/setup-node@v3
17+
with:
18+
node-version: 14
19+
#cache: 'pnpm'
20+
- name: Install packages
21+
run: pnpm i
22+
- name: Setup
23+
run: echo fs.inotify.max_user_watches=524288 | sudo tee -a /etc/sysctl.conf && sudo sysctl -p
24+
- name: Build
25+
run: pnpm build
26+
- name: Copy build
27+
run: |
28+
rm -rf /tmp/gh-pages
29+
mkdir /tmp/gh-pages
30+
cp ./packages/examples/build/* /tmp/gh-pages/
31+
mkdir /tmp/gh-pages/sandbox
32+
cp -r ./packages/sandbox/dist/* /tmp/gh-pages/sandbox/
33+
mkdir /tmp/gh-pages/sandbox_simple
34+
cp -r ./packages/sandbox_simple/dist/* /tmp/gh-pages/sandbox_simple/
35+
- name: Deploy
36+
uses: peaceiris/actions-gh-pages@v3
37+
with:
38+
github_token: ${{ secrets.GITHUB_TOKEN }}
39+
publish_dir: /tmp/gh-pages/

0 commit comments

Comments
 (0)