Skip to content

Commit

Permalink
Build/yarn 2 3 (#2765)
Browse files Browse the repository at this point in the history
* 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
  • Loading branch information
darthtrevino committed Oct 2, 2020
1 parent 7857c62 commit 55d8bc9
Show file tree
Hide file tree
Showing 32 changed files with 31,070 additions and 25,347 deletions.
5 changes: 2 additions & 3 deletions .github/workflows/gh-pages.yml
Expand Up @@ -15,9 +15,8 @@ jobs:
with:
node-version: 12.x

- run: npm i -g pnpm
- run: pnpm install
- run: pnpm build
- run: yarn install
- run: yarn build
- run: yarn lerna run build_site --scope react-dnd-documentation

- name: deploy
Expand Down
5 changes: 2 additions & 3 deletions .github/workflows/node-ci.yml
Expand Up @@ -18,11 +18,10 @@ jobs:
with:
node-version: ${{ matrix.node-version }}

- run: npm i -g pnpm
- run: pnpm install
- run: yarn install
name: Install Dependencies

- run: pnpm ci
- run: yarn ci
name: Execute Tests
env:
CI: true
Expand Down
9 changes: 9 additions & 0 deletions .gitignore
Expand Up @@ -9,3 +9,12 @@ coverage
test-results.xml
*-*.log
.jest-cache

# Yarn v2
# https://yarnpkg.com/advanced/qa#which-files-should-be-gitignored
.yarn/*
!.yarn/releases
!.yarn/plugins
!.yarn/sdks
!.yarn/versions
.pnp.*
1 change: 1 addition & 0 deletions .prettierignore
Expand Up @@ -4,3 +4,4 @@ lib/
build/
pnpm-lock.yaml
pnpm-workspace.yaml
.yarn/
38 changes: 38 additions & 0 deletions .yarn/plugins/@yarnpkg/plugin-interactive-tools.cjs

Large diffs are not rendered by default.

52 changes: 52 additions & 0 deletions .yarn/plugins/@yarnpkg/plugin-version.cjs

Large diffs are not rendered by default.

29 changes: 29 additions & 0 deletions .yarn/plugins/@yarnpkg/plugin-workspace-tools.cjs

Large diffs are not rendered by default.

55 changes: 55 additions & 0 deletions .yarn/releases/yarn-2.3.0.cjs

Large diffs are not rendered by default.

21 changes: 21 additions & 0 deletions .yarnrc.yml
@@ -0,0 +1,21 @@
nmHoistingLimits: dependencies

nodeLinker: node-modules

plugins:
- path: .yarn/plugins/@yarnpkg/plugin-workspace-tools.cjs
spec: '@yarnpkg/plugin-workspace-tools'
- path: .yarn/plugins/@yarnpkg/plugin-interactive-tools.cjs
spec: '@yarnpkg/plugin-interactive-tools'
- path: .yarn/plugins/@yarnpkg/plugin-version.cjs
spec: '@yarnpkg/plugin-version'

yarnPath: .yarn/releases/yarn-2.3.0.cjs

changesetBaseRefs:
- 'main'
- 'origin/main'
- 'upstream/main'

changesetIgnorePatterns:
- '**/*.spec.{js,ts,tsx}'
11 changes: 0 additions & 11 deletions lerna.json

This file was deleted.

75 changes: 40 additions & 35 deletions package.json
Expand Up @@ -36,32 +36,29 @@
},
"homepage": "https://github.com/react-dnd/react-dnd",
"scripts": {
"preinstall": "npx only-allow pnpm",
"preinstall": "npx only-allow yarn",
"postinstall": "shx rm -rf node_modules/@types/react-native",
"clean": "pnpm run clean -r --parallel",
"build": "pnpm run build -r --stream",
"clean": "yarn workspaces foreach -pv run clean",
"build": "yarn workspaces foreach -vt run build",
"unit_test": "jest",
"jest:watch": "jest --watch",
"jest:cov": "jest --coverage",
"unit_test:watch": "jest --watch",
"unit_test:coverage": "jest --coverage",
"lint:code": "eslint . --ext .js,.ts,.jsx,.tsx",
"lint:spelling": "mdspell 'packages/documentation/docsite/markdown/**/*.md' --en-us --report",
"lint:tone": "alex .",
"lint:formatting": "pretty-quick --check",
"lint": "run-s lint:*",
"lint": "run-s 'lint:*'",
"changelog": "conventional-changelog -p eslint -i CHANGELOG.md -s -r 0",
"release_canary": "lerna publish -c --preid next --yes",
"release": "run-s clean test go_no_go release:packages changelog",
"release:packages": "lerna publish",
"test_modules": "CI=true pnpm run test -r --stream",
"test_modules": "CI=true yarn workspaces foreach -pv run test",
"go_no_go": "node scripts/go_no_go.js",
"ci": "run-s clean lint build test_modules jest:cov",
"ci": "run-s clean lint build test_modules unit_test:coverage",
"prettify:source": "prettier 'packages/*/*/src/**/*.ts*'",
"prettify": "pretty-quick --fix",
"precommit:lint": "lint-staged",
"precommit:format": "pretty-quick --staged",
"start": "pnpm run -r --parallel --stream start",
"start_docs": "pnpm run --stream --scope react-dnd-documentation start",
"watch": "pnpm run -r --parallel --stream watch",
"start": "yarn workspaces foreach -pvi run start",
"watch": "yarn workspaces foreach -pvi run watch",
"git-is-clean": "git diff-index --quiet HEAD"
},
"husky": {
Expand All @@ -70,54 +67,58 @@
"commit-msg": "commitlint -E HUSKY_GIT_PARAMS"
}
},
"workspaces": [
"packages/*/*"
],
"devDependencies": {
"@babel/cli": "^7.11.6",
"@babel/core": "^7.11.6",
"@babel/plugin-proposal-class-properties": "^7.10.4",
"@babel/plugin-proposal-object-rest-spread": "^7.11.0",
"@babel/preset-env": "^7.11.5",
"@commitlint/cli": "^9.1.2",
"@commitlint/config-conventional": "^9.1.2",
"@rollup/plugin-commonjs": "^15.0.0",
"@commitlint/cli": "^11.0.0",
"@commitlint/config-conventional": "^11.0.0",
"@rollup/plugin-commonjs": "^15.1.0",
"@rollup/plugin-node-resolve": "^9.0.0",
"@rollup/plugin-replace": "^2.3.3",
"@types/enzyme": "^3.10.5",
"@types/jest": "^26.0.13",
"@typescript-eslint/eslint-plugin": "^4.0.1",
"@typescript-eslint/parser": "^4.0.1",
"@types/jest": "^26.0.14",
"@typescript-eslint/eslint-plugin": "^4.3.0",
"@typescript-eslint/parser": "^4.3.0",
"alex": "^9.0.1",
"conventional-changelog-cli": "^2.1.0",
"enzyme": "^3.11.0",
"enzyme-adapter-react-16": "^1.15.4",
"eslint": "^7.8.1",
"eslint-config-prettier": "^6.11.0",
"enzyme-adapter-react-16": "^1.15.5",
"eslint": "^7.10.0",
"eslint-config-prettier": "^6.12.0",
"eslint-config-react-app": "^5.2.1",
"eslint-plugin-no-for-of-loops": "^1.0.1",
"eslint-plugin-prettier": "^3.1.4",
"eslint-plugin-react": "^7.20.6",
"eslint-plugin-react-hooks": "^4.1.0",
"husky": "^4.2.5",
"eslint-plugin-react": "^7.21.3",
"eslint-plugin-react-hooks": "^4.1.2",
"husky": "^4.3.0",
"inquirer": "^7.3.3",
"jest": "^26.4.2",
"jest-environment-jsdom": "^26.3.0",
"lerna": "^3.22.1",
"lint-staged": "^10.3.0",
"lint-staged": "^10.4.0",
"markdown-spellcheck": "^1.3.1",
"npm-run-all": "^4.1.5",
"prettier": "^2.1.1",
"pretty-quick": "^3.0.0",
"prettier": "^2.1.2",
"pretty-quick": "^3.0.2",
"react": "^16.13.1",
"react-dnd": "^11.1.3",
"react-dnd-test-utils": "11.1.3",
"react-dnd-html5-backend": "11.1.3",
"react-dnd-touch-backend": "11.1.3",
"react-dnd-test-backend": "11.1.3",
"react-dnd-test-utils": "11.1.3",
"react-dnd-touch-backend": "11.1.3",
"react-dom": "^16.13.1",
"react-test-renderer": "^16.13.1",
"replace-in-file": "^6.1.0",
"rimraf": "^3.0.2",
"rollup": "^2.26.10",
"rollup": "^2.28.2",
"rollup-plugin-terser": "^7.0.2",
"shx": "^0.3.2",
"ts-jest": "^26.3.0",
"typescript": "^4.0.2"
"ts-jest": "^26.4.1",
"typescript": "^4.0.3"
},
"jest": {
"clearMocks": true,
Expand Down Expand Up @@ -187,5 +188,9 @@
}
}
]
},
"resolutions": {
"@types/react": "16.9.50",
"@types/react-dom": "16.9.8"
}
}
6 changes: 3 additions & 3 deletions packages/core/dnd-core/package.json
Expand Up @@ -3,8 +3,8 @@
"version": "11.1.3",
"description": "Drag and drop sans the GUI",
"license": "MIT",
"main": "./dist/cjs/index.js",
"module": "./dist/esm/index.js",
"main": "dist/cjs/index.js",
"module": "dist/esm/index.js",
"types": "./lib/index.d.ts",
"sideEffects": false,
"scripts": {
Expand All @@ -19,6 +19,6 @@
"dependencies": {
"@react-dnd/asap": "^4.0.0",
"@react-dnd/invariant": "^2.0.0",
"redux": "^4.0.4"
"redux": "^4.0.5"
}
}
10 changes: 5 additions & 5 deletions packages/core/html5-backend/package.json
Expand Up @@ -2,8 +2,8 @@
"name": "react-dnd-html5-backend",
"version": "11.1.3",
"description": "HTML5 backend for React DnD",
"main": "./dist/cjs/index.js",
"module": "./dist/esm/index.js",
"main": "dist/cjs/index.js",
"module": "dist/esm/index.js",
"types": "lib/index.d.ts",
"sideEffects": false,
"license": "MIT",
Expand All @@ -20,9 +20,9 @@
"dnd-core": "^11.1.3"
},
"devDependencies": {
"@types/react": "^16.9.35",
"react": "^16.12.0",
"@types/react": "^16.9.50",
"react": "^16.13.1",
"react-dnd-test-backend": "^11.1.3",
"react-dom": "^16.12.0"
"react-dom": "^16.13.1"
}
}
15 changes: 9 additions & 6 deletions packages/core/html5-backend/tsconfig.json
@@ -1,8 +1,11 @@
{
"extends": "../../../tsconfig.base.json",
"compilerOptions": {
"outDir": "./lib",
"baseUrl": "./src"
},
"include": ["./src/index.ts"]
"extends": "../../../tsconfig.base.json",
"compilerOptions": {
"outDir": "./lib",
"baseUrl": "./src"
},
"exclude": [
"../../../node_modules/@types/enzyme/node_modules/@types/react/index.d.ts"
],
"include": ["./src/index.ts"]
}
15 changes: 8 additions & 7 deletions packages/core/react-dnd/package.json
Expand Up @@ -2,8 +2,8 @@
"name": "react-dnd",
"version": "11.1.3",
"description": "Drag and Drop for React",
"main": "./dist/cjs/index.js",
"module": "./dist/esm/index.js",
"main": "dist/cjs/index.js",
"module": "dist/esm/index.js",
"types": "lib/index.d.ts",
"sideEffects": false,
"repository": {
Expand All @@ -19,15 +19,16 @@
"dependencies": {
"@react-dnd/invariant": "^2.0.0",
"@react-dnd/shallowequal": "^2.0.0",
"@types/hoist-non-react-statics": "^3.3.1",
"dnd-core": "^11.1.3",
"hoist-non-react-statics": "^3.3.0"
"hoist-non-react-statics": "^3.3.2"
},
"devDependencies": {
"@types/react": "^16.9.35",
"@types/enzyme": "^3.10.7",
"@types/hoist-non-react-statics": "^3.3.1",
"@types/react": "^16.9.50",
"@types/react-dom": "^16.9.8",
"react": "^16.12.0",
"react-dom": "^16.12.0"
"react": "^16.13.1",
"react-dom": "^16.13.1"
},
"peerDependencies": {
"react": ">= 16.9.0",
Expand Down
4 changes: 2 additions & 2 deletions packages/core/touch-backend/package.json
Expand Up @@ -2,8 +2,8 @@
"name": "react-dnd-touch-backend",
"version": "11.1.3",
"description": "Touch backend for react-dnd",
"main": "./dist/cjs/index.js",
"module": "./dist/esm/index.js",
"main": "dist/cjs/index.js",
"module": "dist/esm/index.js",
"types": "lib/index.d.ts",
"sideEffects": false,
"license": "MIT",
Expand Down
8 changes: 4 additions & 4 deletions packages/documentation/cra-test/package.json
Expand Up @@ -3,13 +3,13 @@
"version": "11.1.3",
"private": true,
"dependencies": {
"react": "^16.12.0",
"lodash": "^4.17.20",
"react": "^16.13.1",
"react-dnd": "^11.1.3",
"react-dnd-examples-hooks": "^11.1.3",
"react-dnd-html5-backend": "^11.1.3",
"react-dom": "^16.12.0",
"react-scripts": "^3.2.0",
"lodash": "^4.17.20"
"react-dom": "^16.13.1",
"react-scripts": "^3.4.3"
},
"devDependencies": {
"babel-eslint": "^10.1.0"
Expand Down
23 changes: 0 additions & 23 deletions packages/documentation/cra-test/public/index.html
Expand Up @@ -5,34 +5,11 @@
<link rel="shortcut icon" href="%PUBLIC_URL%/favicon.ico" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<meta name="theme-color" content="#000000" />
<!--
manifest.json provides metadata used when your web app is installed on a
user's mobile device or desktop. See https://developers.google.com/web/fundamentals/web-app-manifest/
-->
<link rel="manifest" href="%PUBLIC_URL%/manifest.json" />
<!--
Notice the use of %PUBLIC_URL% in the tags above.
It will be replaced with the URL of the `public` folder during the build.
Only files inside the `public` folder can be referenced from the HTML.
Unlike "/favicon.ico" or "favicon.ico", "%PUBLIC_URL%/favicon.ico" will
work correctly both with client-side routing and a non-root public URL.
Learn how to configure a non-root public URL by running `npm run build`.
-->
<title>React App</title>
</head>
<body>
<noscript>You need to enable JavaScript to run this app.</noscript>
<div id="root"></div>
<!--
This HTML file is a template.
If you open it directly in the browser, you will see an empty page.
You can add webfonts, meta tags, or analytics to this file.
The build step will place the bundled scripts into the <body> tag.
To begin the development, run `npm start` or `pnpm start`.
To create a production bundle, use `npm run build` or `pnpm build`.
-->
</body>
</html>
Expand Up @@ -11,7 +11,7 @@ React DnD is test-friendly. The whole drag and drop interaction, including the r

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.**

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.
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.

### Testing the Components in Isolation

Expand Down
Expand Up @@ -25,9 +25,9 @@ For these examples, the following flags are available. To enable them add them t
To run these examples locally, clone the `react-dnd` repository, and run

```
> pnpm install
> pnpm build
> pnpm start
> yarn install
> yarn build
> yarn start
```

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 comments on commit 55d8bc9

Please sign in to comment.