Skip to content

Commit

Permalink
internal: Move to yarn 3
Browse files Browse the repository at this point in the history
  • Loading branch information
ntucker committed Jul 25, 2022
1 parent bc215d0 commit 9f22c30
Show file tree
Hide file tree
Showing 32 changed files with 29,234 additions and 19,912 deletions.
38 changes: 10 additions & 28 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,38 +13,20 @@ jobs:
- checkout
- restore_cache:
keys:
- v5-dependencies-{{ checksum "yarn.lock" }}
- v7-dependencies-{{ checksum "yarn.lock" }}
# fallback to using the latest cache if no exact match is found
- v5-dependencies-
- v7-dependencies-
- run:
name: yarn install
command: |
yarn config set cache-folder ~/.cache/yarn
yarn install --prefer-offline --frozen-lockfile
npm install -g corepack
corepack enable
yarn install --immutable
- save_cache:
paths:
- node_modules
- packages/core/node_modules
- packages/endpoint/node_modules
- packages/experimental/node_modules
- packages/graphql/node_modules
- packages/hooks/node_modules
- packages/img/node_modules
- packages/legacy/node_modules
- packages/normalizr/node_modules
- packages/rest/node_modules
- packages/rest-hooks/node_modules
- packages/test/node_modules
- packages/use-enhanced-reducer/node_modules
- examples/benchmark/node_modules
- examples/normalizr-bench/node_modules
- examples/normalizr-github/node_modules
- examples/normalizr-redux/node_modules
- examples/normalizr-relationships/node_modules
- examples/todo-app/node_modules
- examples/github-app/node_modules
- ~/.cache/yarn
key: v5-dependencies-{{ checksum "yarn.lock" }}
- .yarn/cache
- .yarn/install-state.gz
key: v7-dependencies-{{ checksum "yarn.lock" }}
- run: yarn run lerna run build --stream
- persist_to_workspace:
root: ~/
Expand Down Expand Up @@ -83,7 +65,7 @@ jobs:
- run:
command: |
if [ "<< parameters.react-version >>" != "^18" ]; then
yarn add -W --dev react@<< parameters.react-version >> react-dom@<< parameters.react-version >> react-test-renderer@<< parameters.react-version >> @testing-library/react@^12.0.0
yarn add --dev react@<< parameters.react-version >> react-dom@<< parameters.react-version >> react-test-renderer@<< parameters.react-version >> @testing-library/react@^12.0.0
fi
- run:
command: |
Expand All @@ -97,7 +79,7 @@ jobs:
at: ~/
- run:
command: |
yarn add -W --dev react@^17.0.0 react-dom@^17.0.0 react-test-renderer@^17.0.0 @testing-library/react@^12.0.0
yarn add --dev react@^17.0.0 react-dom@^17.0.0 react-test-renderer@^17.0.0 @testing-library/react@^12.0.0
- run:
command: |
curl -Os https://uploader.codecov.io/latest/linux/codecov;
Expand Down
6 changes: 5 additions & 1 deletion .github/workflows/benchmark.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,11 @@ jobs:
with:
node-version: '18'
- name: Run benchmark
run: yarn install && NODE_ENV=production BROWSERSLIST_ENV=modern yarn lerna run --scope @rest-hooks/core --include-dependencies build && yarn workspace benchmark start | tee output.txt
run: |
npm install -g corepack
corepack enable
yarn install --immutable
NODE_ENV=production BROWSERSLIST_ENV=modern yarn lerna run --scope @rest-hooks/core --include-dependencies build && yarn workspace benchmark start | tee output.txt
# PR comments on changes
Expand Down
8 changes: 7 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,13 @@ build/Release
# Dependency directories
node_modules/
jspm_packages/
flow-typed/
.pnp.*
.yarn/*
!.yarn/patches
!.yarn/plugins
!.yarn/releases
!.yarn/sdks
!.yarn/versions

# Typescript v1 declaration files
typings/
Expand Down
541 changes: 541 additions & 0 deletions .yarn/plugins/@yarnpkg/plugin-interactive-tools.cjs

Large diffs are not rendered by default.

9 changes: 9 additions & 0 deletions .yarn/plugins/@yarnpkg/plugin-typescript.cjs

Large diffs are not rendered by default.

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

Large diffs are not rendered by default.

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

Large diffs are not rendered by default.

783 changes: 783 additions & 0 deletions .yarn/releases/yarn-3.2.2.cjs

Large diffs are not rendered by default.

17 changes: 17 additions & 0 deletions .yarnrc.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
changesetIgnorePatterns:
- "**/__tests__/**"
- "**/*.md"

nodeLinker: node-modules

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

yarnPath: .yarn/releases/yarn-3.2.2.cjs
12 changes: 9 additions & 3 deletions examples/benchmark/package.json
Original file line number Diff line number Diff line change
@@ -1,15 +1,21 @@
{
"name": "benchmark",
"name": "example-benchmark",
"version": "0.1.5",
"description": "Benchmark for normalizr",
"main": "index.js",
"author": "Nathaniel Tucker",
"license": "MIT",
"private": true,
"scripts": {
"start": "cross-env NODE_ENV=production BROWSERSLIST_ENV=modern babel-node --root-mode upward ./ --extensions '.ts,.tsx,.js'"
"start": "NODE_ENV=production BROWSERSLIST_ENV=modern babel-node --root-mode upward ./ --extensions '.ts,.tsx,.js'"
},
"dependencies": {
"@rest-hooks/core": "^3.2.8",
"@rest-hooks/normalizr": "^8.2.6",
"benchmark": "^2.1.4"
},
"devDependencies": {
"@rest-hooks/normalizr": "^8.2.6"
"@babel/node": "^7.18.9",
"@types/benchmark": "^2"
}
}
20 changes: 20 additions & 0 deletions examples/github-app/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -30,9 +30,26 @@
"@linaria/core": "3.0.0-beta.22",
"@linaria/react": "3.0.0-beta.22",
"@linaria/shaker": "3.0.0-beta.22",
"@types/eslint": "^8",
"@types/parse-link-header": "^2.0.0",
"@types/prettier": "^2",
"@types/react": "^18.0.15",
"@types/react-dom": "18.0.6",
"eslint": "^8.20.0",
"eslint-plugin-import": "^2.26.0",
"eslint-plugin-prettier": "^4.2.1",
"eslint-plugin-react": "^7.30.1",
"eslint-plugin-react-hooks": "^4.6.0",
"prettier": "^2.7.1",
"react-refresh": "0.14.0",
"rollup": "^2.77.0",
"rollup-plugin-babel": "^4.4.0",
"rollup-plugin-commonjs": "^10.1.0",
"rollup-plugin-filesize": "^9.1.2",
"rollup-plugin-json": "^4.0.0",
"rollup-plugin-node-resolve": "^5.2.0",
"rollup-plugin-replace": "^2.2.0",
"rollup-plugin-terser": "^7.0.2",
"serve": "14.0.1",
"webpack": "5.73.0",
"webpack-cli": "4.10.0",
Expand All @@ -41,7 +58,10 @@
"dependencies": {
"@anansi/router": "0.6.8",
"@ant-design/icons": "^4.7.0",
"@rest-hooks/core": "^3.2.8",
"@rest-hooks/endpoint": "^2.2.11",
"@rest-hooks/experimental": "^5.0.3",
"@rest-hooks/rest": "^5.0.5",
"antd": "4.21.7",
"parse-link-header": "^2.0.0",
"react": "18.2.0",
Expand Down
11 changes: 11 additions & 0 deletions examples/normalizr-github/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,5 +11,16 @@
},
"dependencies": {
"@rest-hooks/normalizr": "^8.2.6"
},
"devDependencies": {
"@babel/node": "^7.18.9",
"rollup": "^2.77.0",
"rollup-plugin-babel": "^4.4.0",
"rollup-plugin-commonjs": "^10.1.0",
"rollup-plugin-filesize": "^9.1.2",
"rollup-plugin-json": "^4.0.0",
"rollup-plugin-node-resolve": "^5.2.0",
"rollup-plugin-replace": "^2.2.0",
"rollup-plugin-terser": "^7.0.2"
}
}
11 changes: 10 additions & 1 deletion examples/normalizr-redux/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,19 @@
"start": "babel-node ./ --root-mode upward --extensions '.ts,.tsx,.js'"
},
"devDependencies": {
"@babel/node": "^7.18.9",
"@octokit/rest": "19.0.3",
"@rest-hooks/normalizr": "^8.2.6",
"inquirer": "^8.1.1",
"redux": "4.2.0",
"redux-thunk": "^2.3.0"
"redux-thunk": "^2.3.0",
"rollup": "^2.77.0",
"rollup-plugin-babel": "^4.4.0",
"rollup-plugin-commonjs": "^10.1.0",
"rollup-plugin-filesize": "^9.1.2",
"rollup-plugin-json": "^4.0.0",
"rollup-plugin-node-resolve": "^5.2.0",
"rollup-plugin-replace": "^2.2.0",
"rollup-plugin-terser": "^7.0.2"
}
}
11 changes: 10 additions & 1 deletion examples/normalizr-relationships/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,16 @@
"start": "babel-node ./ --root-mode upward --extensions '.ts,.tsx,.js'"
},
"devDependencies": {
"mockdate": "^3.0.5"
"@babel/node": "^7.18.9",
"mockdate": "^3.0.5",
"rollup": "^2.77.0",
"rollup-plugin-babel": "^4.4.0",
"rollup-plugin-commonjs": "^10.1.0",
"rollup-plugin-filesize": "^9.1.2",
"rollup-plugin-json": "^4.0.0",
"rollup-plugin-node-resolve": "^5.2.0",
"rollup-plugin-replace": "^2.2.0",
"rollup-plugin-terser": "^7.0.2"
},
"dependencies": {
"@rest-hooks/normalizr": "^8.2.6"
Expand Down
17 changes: 17 additions & 0 deletions examples/todo-app/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -30,14 +30,31 @@
"@linaria/core": "3.0.0-beta.22",
"@linaria/react": "3.0.0-beta.22",
"@linaria/shaker": "3.0.0-beta.22",
"@types/eslint": "^8",
"@types/prettier": "^2",
"@types/react-dom": "18.0.6",
"eslint": "^8.20.0",
"eslint-plugin-import": "^2.26.0",
"eslint-plugin-prettier": "^4.2.1",
"eslint-plugin-react": "^7.30.1",
"eslint-plugin-react-hooks": "^4.6.0",
"prettier": "^2.7.1",
"react-refresh": "0.14.0",
"rollup": "^2.77.0",
"rollup-plugin-babel": "^4.4.0",
"rollup-plugin-commonjs": "^10.1.0",
"rollup-plugin-filesize": "^9.1.2",
"rollup-plugin-json": "^4.0.0",
"rollup-plugin-node-resolve": "^5.2.0",
"rollup-plugin-replace": "^2.2.0",
"rollup-plugin-terser": "^7.0.2",
"serve": "14.0.1",
"webpack": "5.73.0",
"webpack-cli": "4.10.0",
"webpack-dev-server": "4.9.3"
},
"dependencies": {
"@rest-hooks/endpoint": "^2.2.11",
"@rest-hooks/rest": "^5.0.2",
"react": "18.2.0",
"react-dom": "18.2.0",
Expand Down
22 changes: 11 additions & 11 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,13 @@
"build:clean": "lerna run build:clean --stream",
"build:types": "yarn build:copy:ambient && tsc --build && lerna run build:legacy-types --stream",
"build:copy:ambient": "mkdirp ./packages/normalizr/lib && copyfiles --flat ./packages/normalizr/src/schema.d.ts ./packages/normalizr/lib/ && mkdirp ./packages/endpoint/lib && copyfiles --flat ./packages/endpoint/src/endpoint.d.ts ./packages/endpoint/lib/&& mkdirp ./packages/core/lib && copyfiles --flat ./packages/core/src/state/RIC.d.ts ./packages/core/lib/state",
"test": "cross-env NODE_ENV=test NODE_OPTIONS=--experimental-vm-modules jest",
"test:ci": "yarn test -- --ci",
"test:coverage": "yarn test -- --coverage",
"test": "NODE_ENV=test NODE_OPTIONS=--experimental-vm-modules jest",
"test:ci": "yarn test --ci",
"test:coverage": "yarn test --coverage",
"prepare": "yarn build:copy:ambient && tsc --build",
"prepublishOnly": "lerna run build:legacy-types --stream"
"prepack": "yarn prepare",
"prepublishOnly": "lerna run build:legacy-types --stream",
"postinstall": "yarn prepare"
},
"engines": {
"node": "^12.17 || ^13.7 || >=14"
Expand All @@ -40,22 +42,22 @@
"@babel/node": "7.18.9",
"@commitlint/cli": "17.0.3",
"@commitlint/config-conventional": "17.0.3",
"@rest-hooks/core": "workspace:^",
"@rest-hooks/test": "^7.2.1",
"@testing-library/react": "13.3.0",
"@testing-library/react-hooks": "8.0.1",
"@testing-library/react-native": "10.1.1",
"@types/jest": "28.1.6",
"@types/lodash": "^4.14.166",
"@types/node": "^18.0.6",
"@types/react": "18.0.15",
"benchmark": "^2.1.4",
"conventional-changelog-anansi": "^0.2.0",
"copyfiles": "^2.4.1",
"core-js": "3.23.5",
"coveralls": "^3.1.0",
"cpy-cli": "^4.0.0",
"cross-env": "^7.0.2",
"cross-fetch": "^3.0.6",
"downlevel-dts": "^0.10.0",
"eslint": "8.20.0",
"eslint-plugin-import": "^2.26.0",
"eslint-plugin-prettier": "4.2.1",
Expand All @@ -73,11 +75,11 @@
"react-native": "0.69.2",
"react-test-renderer": "18.2.0",
"redux": "4.2.0",
"rest-hooks": "workspace:^",
"rimraf": "^3.0.2",
"rollup": "2.77.0",
"rollup-plugin-babel": "^4.4.0",
"rollup-plugin-commonjs": "^10.1.0",
"rollup-plugin-filesize": "^9.1.0",
"rollup-plugin-filesize": "^9.1.2",
"rollup-plugin-json": "^4.0.0",
"rollup-plugin-node-resolve": "^5.2.0",
"rollup-plugin-replace": "^2.2.0",
Expand All @@ -86,7 +88,5 @@
"typescript": "next",
"whatwg-fetch": "3.0.0"
},
"resolutions": {
"@lerna/conventional-commits": "https://github.com/ntucker/lerna-conventional-commits.git"
}
"packageManager": "[email protected]"
}
32 changes: 22 additions & 10 deletions packages/core/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -51,21 +51,18 @@
"./rest_hooks_logo_and_text.svg"
],
"scripts": {
"build:lib": "cross-env NODE_ENV=production BROWSERSLIST_ENV='2020' babel --root-mode upward src --out-dir lib --source-maps inline --extensions '.ts,.tsx,.js,.jsx' --ignore '**/__tests__/**' --ignore '**/*.d.ts'",
"build:legacy:lib": "cross-env NODE_ENV=production BROWSERSLIST_ENV='2018' babel --root-mode upward src --out-dir legacy --source-maps inline --extensions '.ts,.tsx,.js,.jsx' --ignore '**/__tests__/**' --ignore '**/*.d.ts'",
"build:js:node": "cross-env BROWSERSLIST_ENV=node12 rollup -c",
"build:js:browser": "cross-env BROWSERSLIST_ENV=legacy rollup -c",
"build:bundle": "run-p build:js:* && echo '{\"type\":\"commonjs\"}' > dist/package.json",
"build:lib": "NODE_ENV=production BROWSERSLIST_ENV='2020' babel --root-mode upward src --out-dir lib --source-maps inline --extensions '.ts,.tsx,.js,.jsx' --ignore '**/__tests__/**' --ignore '**/*.d.ts'",
"build:legacy:lib": "NODE_ENV=production BROWSERSLIST_ENV='2018' babel --root-mode upward src --out-dir legacy --source-maps inline --extensions '.ts,.tsx,.js,.jsx' --ignore '**/__tests__/**' --ignore '**/*.d.ts'",
"build:js:node": "BROWSERSLIST_ENV=node12 rollup -c",
"build:js:browser": "BROWSERSLIST_ENV=legacy rollup -c",
"build:bundle": "run-p build:js:\\* && echo '{\"type\":\"commonjs\"}' > dist/package.json",
"build:clean": "rimraf lib ts3.4 legacy dist *.tsbuildinfo",
"build:legacy-types": "yarn run downlevel-dts lib ts3.4 && copyfiles --up 1 ./src-legacy-types/**/*.d.ts ./ts3.4/",
"build": "yarn run build:lib && yarn run build:legacy:lib && yarn run build:bundle",
"dev": "yarn run build:lib -w",
"prepare": "yarn run build:lib",
"prepublishOnly": "yarn run build:bundle && yarn run build:legacy:lib",
"test": "cross-env NODE_ENV=test jest",
"test:ci": "yarn test -- --ci",
"test:watch": "yarn test -- --watch",
"test:coverage": "yarn test -- --coverage"
"prepack": "yarn prepare",
"prepublishOnly": "yarn run build:bundle && yarn run build:legacy:lib"
},
"keywords": [
"react",
Expand Down Expand Up @@ -118,5 +115,20 @@
"@types/react": {
"optional": true
}
},
"devDependencies": {
"@babel/cli": "^7.18.9",
"@babel/core": "^7.18.9",
"@types/babel__core": "^7",
"downlevel-dts": "^0.10.0",
"npm-run-all": "^4.1.5",
"rollup": "^2.77.0",
"rollup-plugin-babel": "^4.4.0",
"rollup-plugin-commonjs": "^10.1.0",
"rollup-plugin-filesize": "^9.1.2",
"rollup-plugin-json": "^4.0.0",
"rollup-plugin-node-resolve": "^5.2.0",
"rollup-plugin-replace": "^2.2.0",
"rollup-plugin-terser": "^7.0.2"
}
}
Loading

0 comments on commit 9f22c30

Please sign in to comment.