Skip to content

Commit 55d8bc9

Browse files
authored
Build/yarn 2 3 (#2765)
* build: use yarn 2.3 with nohoisting * build: correct debug version * build: add output to clean script * build: update lint script * build: fix unit testing * build: add yarn plugin version * build: ignore tests when cutting versions * build: remove duplicate testing * build: remove lerna tooling
1 parent 7857c62 commit 55d8bc9

File tree

32 files changed

+31070
-25347
lines changed

32 files changed

+31070
-25347
lines changed

.github/workflows/gh-pages.yml

+2-3
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,8 @@ jobs:
1515
with:
1616
node-version: 12.x
1717

18-
- run: npm i -g pnpm
19-
- run: pnpm install
20-
- run: pnpm build
18+
- run: yarn install
19+
- run: yarn build
2120
- run: yarn lerna run build_site --scope react-dnd-documentation
2221

2322
- name: deploy

.github/workflows/node-ci.yml

+2-3
Original file line numberDiff line numberDiff line change
@@ -18,11 +18,10 @@ jobs:
1818
with:
1919
node-version: ${{ matrix.node-version }}
2020

21-
- run: npm i -g pnpm
22-
- run: pnpm install
21+
- run: yarn install
2322
name: Install Dependencies
2423

25-
- run: pnpm ci
24+
- run: yarn ci
2625
name: Execute Tests
2726
env:
2827
CI: true

.gitignore

+9
Original file line numberDiff line numberDiff line change
@@ -9,3 +9,12 @@ coverage
99
test-results.xml
1010
*-*.log
1111
.jest-cache
12+
13+
# Yarn v2
14+
# https://yarnpkg.com/advanced/qa#which-files-should-be-gitignored
15+
.yarn/*
16+
!.yarn/releases
17+
!.yarn/plugins
18+
!.yarn/sdks
19+
!.yarn/versions
20+
.pnp.*

.prettierignore

+1
Original file line numberDiff line numberDiff line change
@@ -4,3 +4,4 @@ lib/
44
build/
55
pnpm-lock.yaml
66
pnpm-workspace.yaml
7+
.yarn/

.yarn/plugins/@yarnpkg/plugin-interactive-tools.cjs

+38
Large diffs are not rendered by default.

.yarn/plugins/@yarnpkg/plugin-version.cjs

+52
Large diffs are not rendered by default.

.yarn/plugins/@yarnpkg/plugin-workspace-tools.cjs

+29
Large diffs are not rendered by default.

.yarn/releases/yarn-2.3.0.cjs

+55
Large diffs are not rendered by default.

.yarnrc.yml

+21
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
nmHoistingLimits: dependencies
2+
3+
nodeLinker: node-modules
4+
5+
plugins:
6+
- path: .yarn/plugins/@yarnpkg/plugin-workspace-tools.cjs
7+
spec: '@yarnpkg/plugin-workspace-tools'
8+
- path: .yarn/plugins/@yarnpkg/plugin-interactive-tools.cjs
9+
spec: '@yarnpkg/plugin-interactive-tools'
10+
- path: .yarn/plugins/@yarnpkg/plugin-version.cjs
11+
spec: '@yarnpkg/plugin-version'
12+
13+
yarnPath: .yarn/releases/yarn-2.3.0.cjs
14+
15+
changesetBaseRefs:
16+
- 'main'
17+
- 'origin/main'
18+
- 'upstream/main'
19+
20+
changesetIgnorePatterns:
21+
- '**/*.spec.{js,ts,tsx}'

lerna.json

-11
This file was deleted.

package.json

+40-35
Original file line numberDiff line numberDiff line change
@@ -36,32 +36,29 @@
3636
},
3737
"homepage": "https://github.com/react-dnd/react-dnd",
3838
"scripts": {
39-
"preinstall": "npx only-allow pnpm",
39+
"preinstall": "npx only-allow yarn",
4040
"postinstall": "shx rm -rf node_modules/@types/react-native",
41-
"clean": "pnpm run clean -r --parallel",
42-
"build": "pnpm run build -r --stream",
41+
"clean": "yarn workspaces foreach -pv run clean",
42+
"build": "yarn workspaces foreach -vt run build",
4343
"unit_test": "jest",
44-
"jest:watch": "jest --watch",
45-
"jest:cov": "jest --coverage",
44+
"unit_test:watch": "jest --watch",
45+
"unit_test:coverage": "jest --coverage",
4646
"lint:code": "eslint . --ext .js,.ts,.jsx,.tsx",
4747
"lint:spelling": "mdspell 'packages/documentation/docsite/markdown/**/*.md' --en-us --report",
4848
"lint:tone": "alex .",
4949
"lint:formatting": "pretty-quick --check",
50-
"lint": "run-s lint:*",
50+
"lint": "run-s 'lint:*'",
5151
"changelog": "conventional-changelog -p eslint -i CHANGELOG.md -s -r 0",
52-
"release_canary": "lerna publish -c --preid next --yes",
5352
"release": "run-s clean test go_no_go release:packages changelog",
54-
"release:packages": "lerna publish",
55-
"test_modules": "CI=true pnpm run test -r --stream",
53+
"test_modules": "CI=true yarn workspaces foreach -pv run test",
5654
"go_no_go": "node scripts/go_no_go.js",
57-
"ci": "run-s clean lint build test_modules jest:cov",
55+
"ci": "run-s clean lint build test_modules unit_test:coverage",
5856
"prettify:source": "prettier 'packages/*/*/src/**/*.ts*'",
5957
"prettify": "pretty-quick --fix",
6058
"precommit:lint": "lint-staged",
6159
"precommit:format": "pretty-quick --staged",
62-
"start": "pnpm run -r --parallel --stream start",
63-
"start_docs": "pnpm run --stream --scope react-dnd-documentation start",
64-
"watch": "pnpm run -r --parallel --stream watch",
60+
"start": "yarn workspaces foreach -pvi run start",
61+
"watch": "yarn workspaces foreach -pvi run watch",
6562
"git-is-clean": "git diff-index --quiet HEAD"
6663
},
6764
"husky": {
@@ -70,54 +67,58 @@
7067
"commit-msg": "commitlint -E HUSKY_GIT_PARAMS"
7168
}
7269
},
70+
"workspaces": [
71+
"packages/*/*"
72+
],
7373
"devDependencies": {
7474
"@babel/cli": "^7.11.6",
7575
"@babel/core": "^7.11.6",
7676
"@babel/plugin-proposal-class-properties": "^7.10.4",
7777
"@babel/plugin-proposal-object-rest-spread": "^7.11.0",
7878
"@babel/preset-env": "^7.11.5",
79-
"@commitlint/cli": "^9.1.2",
80-
"@commitlint/config-conventional": "^9.1.2",
81-
"@rollup/plugin-commonjs": "^15.0.0",
79+
"@commitlint/cli": "^11.0.0",
80+
"@commitlint/config-conventional": "^11.0.0",
81+
"@rollup/plugin-commonjs": "^15.1.0",
8282
"@rollup/plugin-node-resolve": "^9.0.0",
8383
"@rollup/plugin-replace": "^2.3.3",
84-
"@types/enzyme": "^3.10.5",
85-
"@types/jest": "^26.0.13",
86-
"@typescript-eslint/eslint-plugin": "^4.0.1",
87-
"@typescript-eslint/parser": "^4.0.1",
84+
"@types/jest": "^26.0.14",
85+
"@typescript-eslint/eslint-plugin": "^4.3.0",
86+
"@typescript-eslint/parser": "^4.3.0",
8887
"alex": "^9.0.1",
8988
"conventional-changelog-cli": "^2.1.0",
9089
"enzyme": "^3.11.0",
91-
"enzyme-adapter-react-16": "^1.15.4",
92-
"eslint": "^7.8.1",
93-
"eslint-config-prettier": "^6.11.0",
90+
"enzyme-adapter-react-16": "^1.15.5",
91+
"eslint": "^7.10.0",
92+
"eslint-config-prettier": "^6.12.0",
9493
"eslint-config-react-app": "^5.2.1",
9594
"eslint-plugin-no-for-of-loops": "^1.0.1",
9695
"eslint-plugin-prettier": "^3.1.4",
97-
"eslint-plugin-react": "^7.20.6",
98-
"eslint-plugin-react-hooks": "^4.1.0",
99-
"husky": "^4.2.5",
96+
"eslint-plugin-react": "^7.21.3",
97+
"eslint-plugin-react-hooks": "^4.1.2",
98+
"husky": "^4.3.0",
10099
"inquirer": "^7.3.3",
101100
"jest": "^26.4.2",
102101
"jest-environment-jsdom": "^26.3.0",
103-
"lerna": "^3.22.1",
104-
"lint-staged": "^10.3.0",
102+
"lint-staged": "^10.4.0",
105103
"markdown-spellcheck": "^1.3.1",
106104
"npm-run-all": "^4.1.5",
107-
"prettier": "^2.1.1",
108-
"pretty-quick": "^3.0.0",
105+
"prettier": "^2.1.2",
106+
"pretty-quick": "^3.0.2",
107+
"react": "^16.13.1",
109108
"react-dnd": "^11.1.3",
110-
"react-dnd-test-utils": "11.1.3",
111109
"react-dnd-html5-backend": "11.1.3",
112-
"react-dnd-touch-backend": "11.1.3",
113110
"react-dnd-test-backend": "11.1.3",
111+
"react-dnd-test-utils": "11.1.3",
112+
"react-dnd-touch-backend": "11.1.3",
113+
"react-dom": "^16.13.1",
114+
"react-test-renderer": "^16.13.1",
114115
"replace-in-file": "^6.1.0",
115116
"rimraf": "^3.0.2",
116-
"rollup": "^2.26.10",
117+
"rollup": "^2.28.2",
117118
"rollup-plugin-terser": "^7.0.2",
118119
"shx": "^0.3.2",
119-
"ts-jest": "^26.3.0",
120-
"typescript": "^4.0.2"
120+
"ts-jest": "^26.4.1",
121+
"typescript": "^4.0.3"
121122
},
122123
"jest": {
123124
"clearMocks": true,
@@ -187,5 +188,9 @@
187188
}
188189
}
189190
]
191+
},
192+
"resolutions": {
193+
"@types/react": "16.9.50",
194+
"@types/react-dom": "16.9.8"
190195
}
191196
}

packages/core/dnd-core/package.json

+3-3
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@
33
"version": "11.1.3",
44
"description": "Drag and drop sans the GUI",
55
"license": "MIT",
6-
"main": "./dist/cjs/index.js",
7-
"module": "./dist/esm/index.js",
6+
"main": "dist/cjs/index.js",
7+
"module": "dist/esm/index.js",
88
"types": "./lib/index.d.ts",
99
"sideEffects": false,
1010
"scripts": {
@@ -19,6 +19,6 @@
1919
"dependencies": {
2020
"@react-dnd/asap": "^4.0.0",
2121
"@react-dnd/invariant": "^2.0.0",
22-
"redux": "^4.0.4"
22+
"redux": "^4.0.5"
2323
}
2424
}

packages/core/html5-backend/package.json

+5-5
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@
22
"name": "react-dnd-html5-backend",
33
"version": "11.1.3",
44
"description": "HTML5 backend for React DnD",
5-
"main": "./dist/cjs/index.js",
6-
"module": "./dist/esm/index.js",
5+
"main": "dist/cjs/index.js",
6+
"module": "dist/esm/index.js",
77
"types": "lib/index.d.ts",
88
"sideEffects": false,
99
"license": "MIT",
@@ -20,9 +20,9 @@
2020
"dnd-core": "^11.1.3"
2121
},
2222
"devDependencies": {
23-
"@types/react": "^16.9.35",
24-
"react": "^16.12.0",
23+
"@types/react": "^16.9.50",
24+
"react": "^16.13.1",
2525
"react-dnd-test-backend": "^11.1.3",
26-
"react-dom": "^16.12.0"
26+
"react-dom": "^16.13.1"
2727
}
2828
}
+9-6
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,11 @@
11
{
2-
"extends": "../../../tsconfig.base.json",
3-
"compilerOptions": {
4-
"outDir": "./lib",
5-
"baseUrl": "./src"
6-
},
7-
"include": ["./src/index.ts"]
2+
"extends": "../../../tsconfig.base.json",
3+
"compilerOptions": {
4+
"outDir": "./lib",
5+
"baseUrl": "./src"
6+
},
7+
"exclude": [
8+
"../../../node_modules/@types/enzyme/node_modules/@types/react/index.d.ts"
9+
],
10+
"include": ["./src/index.ts"]
811
}

packages/core/react-dnd/package.json

+8-7
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@
22
"name": "react-dnd",
33
"version": "11.1.3",
44
"description": "Drag and Drop for React",
5-
"main": "./dist/cjs/index.js",
6-
"module": "./dist/esm/index.js",
5+
"main": "dist/cjs/index.js",
6+
"module": "dist/esm/index.js",
77
"types": "lib/index.d.ts",
88
"sideEffects": false,
99
"repository": {
@@ -19,15 +19,16 @@
1919
"dependencies": {
2020
"@react-dnd/invariant": "^2.0.0",
2121
"@react-dnd/shallowequal": "^2.0.0",
22-
"@types/hoist-non-react-statics": "^3.3.1",
2322
"dnd-core": "^11.1.3",
24-
"hoist-non-react-statics": "^3.3.0"
23+
"hoist-non-react-statics": "^3.3.2"
2524
},
2625
"devDependencies": {
27-
"@types/react": "^16.9.35",
26+
"@types/enzyme": "^3.10.7",
27+
"@types/hoist-non-react-statics": "^3.3.1",
28+
"@types/react": "^16.9.50",
2829
"@types/react-dom": "^16.9.8",
29-
"react": "^16.12.0",
30-
"react-dom": "^16.12.0"
30+
"react": "^16.13.1",
31+
"react-dom": "^16.13.1"
3132
},
3233
"peerDependencies": {
3334
"react": ">= 16.9.0",

packages/core/touch-backend/package.json

+2-2
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@
22
"name": "react-dnd-touch-backend",
33
"version": "11.1.3",
44
"description": "Touch backend for react-dnd",
5-
"main": "./dist/cjs/index.js",
6-
"module": "./dist/esm/index.js",
5+
"main": "dist/cjs/index.js",
6+
"module": "dist/esm/index.js",
77
"types": "lib/index.d.ts",
88
"sideEffects": false,
99
"license": "MIT",

packages/documentation/cra-test/package.json

+4-4
Original file line numberDiff line numberDiff line change
@@ -3,13 +3,13 @@
33
"version": "11.1.3",
44
"private": true,
55
"dependencies": {
6-
"react": "^16.12.0",
6+
"lodash": "^4.17.20",
7+
"react": "^16.13.1",
78
"react-dnd": "^11.1.3",
89
"react-dnd-examples-hooks": "^11.1.3",
910
"react-dnd-html5-backend": "^11.1.3",
10-
"react-dom": "^16.12.0",
11-
"react-scripts": "^3.2.0",
12-
"lodash": "^4.17.20"
11+
"react-dom": "^16.13.1",
12+
"react-scripts": "^3.4.3"
1313
},
1414
"devDependencies": {
1515
"babel-eslint": "^10.1.0"

packages/documentation/cra-test/public/index.html

-23
Original file line numberDiff line numberDiff line change
@@ -5,34 +5,11 @@
55
<link rel="shortcut icon" href="%PUBLIC_URL%/favicon.ico" />
66
<meta name="viewport" content="width=device-width, initial-scale=1" />
77
<meta name="theme-color" content="#000000" />
8-
<!--
9-
manifest.json provides metadata used when your web app is installed on a
10-
user's mobile device or desktop. See https://developers.google.com/web/fundamentals/web-app-manifest/
11-
-->
128
<link rel="manifest" href="%PUBLIC_URL%/manifest.json" />
13-
<!--
14-
Notice the use of %PUBLIC_URL% in the tags above.
15-
It will be replaced with the URL of the `public` folder during the build.
16-
Only files inside the `public` folder can be referenced from the HTML.
17-
18-
Unlike "/favicon.ico" or "favicon.ico", "%PUBLIC_URL%/favicon.ico" will
19-
work correctly both with client-side routing and a non-root public URL.
20-
Learn how to configure a non-root public URL by running `npm run build`.
21-
-->
229
<title>React App</title>
2310
</head>
2411
<body>
2512
<noscript>You need to enable JavaScript to run this app.</noscript>
2613
<div id="root"></div>
27-
<!--
28-
This HTML file is a template.
29-
If you open it directly in the browser, you will see an empty page.
30-
31-
You can add webfonts, meta tags, or analytics to this file.
32-
The build step will place the bundled scripts into the <body> tag.
33-
34-
To begin the development, run `npm start` or `pnpm start`.
35-
To create a production bundle, use `npm run build` or `pnpm build`.
36-
-->
3714
</body>
3815
</html>

packages/documentation/docsite/markdown/docs/00 Quick Start/Testing.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ React DnD is test-friendly. The whole drag and drop interaction, including the r
1111

1212
There are several different approaches to testing React components. React DnD is not opinionated and lets you use any of them. **Not all approaches require that the browser event system be available.**
1313

14-
A few test examples are included with the React DnD inside its `examples` folder. Run `pnpm install` and `pnpm test` inside the `react-dnd` root folder to start them.
14+
A few test examples are included with the React DnD inside its `examples` folder. Run `yarn install` and `yarn test` inside the `react-dnd` root folder to start them.
1515

1616
### Testing the Components in Isolation
1717

packages/documentation/docsite/markdown/docs/examples/examplesRoot.md

+3-3
Original file line numberDiff line numberDiff line change
@@ -25,9 +25,9 @@ For these examples, the following flags are available. To enable them add them t
2525
To run these examples locally, clone the `react-dnd` repository, and run
2626

2727
```
28-
> pnpm install
29-
> pnpm build
30-
> pnpm start
28+
> yarn install
29+
> yarn build
30+
> yarn start
3131
```
3232

3333
It will take a while to start, but after the site is built, you can access the examples by opening [http://localhost:8000/](http://localhost:8000/) and clicking “Examples” in the navigation bar.

0 commit comments

Comments
 (0)