Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Upgrade Framework to Yarn v3 #3154

Merged
merged 62 commits into from
Oct 5, 2021
Merged
Show file tree
Hide file tree
Changes from 54 commits
Commits
Show all changes
62 commits
Select commit Hold shift + click to select a range
843d37d
setup and install yarn berry
thedavidprice Jun 16, 2021
4bfd735
futz'n to get it work'n
thedavidprice Jun 16, 2021
cc5671e
upgrade @babel/parser
thedavidprice Jun 16, 2021
94fef57
trying to run eslint to from tasks/framework-tools
thedavidprice Jun 16, 2021
08e02c5
Merge branch 'main' into dsp-yarn2-for-the-lulz
thedavidprice Jul 30, 2021
6439d1e
upgrade to yarn v3.0.0
thedavidprice Jul 30, 2021
d39e0ee
upgrade all task projects
thedavidprice Jul 30, 2021
f16f751
e2e install fix
thedavidprice Jul 30, 2021
0bc141e
fix lint and tooling scripts
thedavidprice Jul 31, 2021
dcf4b6f
lint fix
thedavidprice Jul 31, 2021
039d451
Merge branch 'main' into dsp-yarn3-for-the-lulz
thedavidprice Aug 12, 2021
919f37c
Merge branch 'main' into dsp-yarn3-for-the-lulz
thedavidprice Aug 12, 2021
2ada2d1
changes per review comments
thedavidprice Aug 12, 2021
3266701
fix test
thedavidprice Aug 12, 2021
0c16aa9
use yarn cache GH workflow
thedavidprice Aug 12, 2021
131ed68
upgrade cypress
thedavidprice Aug 12, 2021
bb04fa7
fix local cypress run-e2e
thedavidprice Aug 13, 2021
fe20ee1
stashed: experimenting with execa process
thedavidprice Aug 25, 2021
62f00ba
enable preferInteractive
redwoodjsbot Sep 10, 2021
feef9f9
Update yarn v3.0.2
redwoodjsbot Sep 10, 2021
41b4cf4
Revert "stashed: experimenting with execa process"
thedavidprice Sep 10, 2021
9ac8f3b
Merge branch 'main' into dsp-yarn3-for-the-lulz
thedavidprice Sep 10, 2021
2737519
update yarn.lock files
thedavidprice Sep 10, 2021
83970e8
build:test-project working 🚀
thedavidprice Sep 10, 2021
8699a41
use demandCommand instead
redwoodjsbot Sep 11, 2021
5445100
draft code for subDir check
thedavidprice Sep 11, 2021
b4d4731
Merge branch 'dsp-yarn3-for-the-lulz' of https://github.com/redwoodjs…
thedavidprice Sep 11, 2021
147f6de
Add SubDir check
thedavidprice Sep 11, 2021
19f7dd9
add Yarn TypeScript plugin
thedavidprice Sep 13, 2021
dfdf88b
remove cross-env from yarn scripts
thedavidprice Sep 13, 2021
db3c7d4
GH Actions: fix command, add (update) yarn caching
thedavidprice Sep 17, 2021
8add30b
Merge branch 'main' into dsp-yarn3-for-the-lulz
thedavidprice Sep 17, 2021
1f2ae80
update yarn.lock
thedavidprice Sep 17, 2021
091a52d
fix yarn cache on CI
thedavidprice Sep 17, 2021
c5fd36f
added yarn constraints plugin
thedavidprice Sep 17, 2021
6904dc9
CI fix
thedavidprice Sep 17, 2021
f4b4cea
Update global declaration for useAuth
dac09 Sep 17, 2021
74bec5e
Move auth global type augmentation to ambient.d.ts
dac09 Sep 17, 2021
5489d4a
Also update web tsconfig to use ambient
dac09 Sep 17, 2021
5e4a7b2
Also do ambient type thingies for router
dac09 Sep 17, 2021
740b823
misc TS fixes and lint cleanup
thedavidprice Sep 17, 2021
3fd938d
CI: add yarn constraints and dedupe checks
thedavidprice Sep 17, 2021
0de9cf8
allow package scripts build and test
thedavidprice Sep 17, 2021
50417ce
Merge branch 'main' into dsp-yarn3-for-the-lulz
thedavidprice Sep 18, 2021
1fcb94b
fix dependency constraintes dedupe
thedavidprice Sep 18, 2021
3d1e8f1
Merge branch 'main' into dsp-yarn3-for-the-lulz
thedavidprice Sep 20, 2021
f9817be
Merge branch 'main' into dsp-yarn3-for-the-lulz
thedavidprice Oct 4, 2021
b6ff7ae
update yarn.lock
thedavidprice Oct 4, 2021
06c3d9f
fix build TS and codemod package errors
thedavidprice Oct 4, 2021
360884a
Merge branch 'main' into dsp-yarn3-for-the-lulz
thedavidprice Oct 4, 2021
db03b6a
update yarn.lock
thedavidprice Oct 4, 2021
38b2c8f
use jscodeshift in root
redwoodjsbot Oct 5, 2021
f724b71
remove jscodeshift from root package.json
redwoodjsbot Oct 5, 2021
5b907cf
align loose option for babel plugins
redwoodjsbot Oct 5, 2021
137eff4
add yarn seciton to contributing
redwoodjsbot Oct 5, 2021
cfe396f
add babel plugin
redwoodjsbot Oct 5, 2021
c0eccaf
update contributing toc
redwoodjsbot Oct 5, 2021
ca96cd7
update Yarn section in CONTRIBUTING
thedavidprice Oct 5, 2021
5be6af4
add yarn cache to GH Workflow publish canary
thedavidprice Oct 5, 2021
50c217b
Merge branch 'main' into dsp-yarn3-for-the-lulz
thedavidprice Oct 5, 2021
885c725
Merge branch 'main' into dsp-yarn3-for-the-lulz
thedavidprice Oct 5, 2021
a8cc0c3
move dep to devDep per comment review
thedavidprice Oct 5, 2021
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 20 additions & 6 deletions .github/workflows/build-eslint-jest.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -21,14 +21,28 @@ jobs:
with:
node-version: ${{ matrix.node-version }}

# - name: Cache "node_modules"
# uses: actions/cache@v2
# with:
# path: '**/node_modules'
# key: node_modules_${{ runner.os }}_${{ hashFiles('**/yarn.lock') }}
- name: Get yarn cache directory path
id: yarn-cache-dir-path
run: echo "::set-output name=dir::$(yarn config get cacheFolder)"

- name: Cache yarn
uses: actions/cache@v2
id: yarn-cache
with:
path: ${{ steps.yarn-cache-dir-path.outputs.dir }}
key: yarn-${{ hashFiles('yarn.lock') }}
restore-keys: |
yarn-

- name: Install dependencies
run: yarn install --frozen-lockfile
run: yarn install --immutable

- name: 'Check Yarn constraints (fix w/ "yarn constraints --fix")'
run: yarn constraints

- name: 'Check for duplicate dependencies (fix w/ "yarn dedupe")'
if: steps.yarn-cache.outputs.cache-hit != 'true'
run: yarn dedupe --check

- name: Build
run: yarn build
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/create-pr-artifact.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ jobs:
node-version: 14

- name: Install dependencies
run: yarn install --frozen-lockfile
run: yarn install --immutable

- name: Build
run: yarn build
Expand Down
17 changes: 12 additions & 5 deletions .github/workflows/e2e.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -23,14 +23,21 @@ jobs:
with:
node-version: ${{ matrix.node-version }}

- name: Cache "node_modules"
- name: Get yarn cache directory path
id: yarn-cache-dir-path
run: echo "::set-output name=dir::$(yarn config get cacheFolder)"

- name: Cache yarn
uses: actions/cache@v2
id: yarn-cache
with:
path: '**/node_modules'
key: node_modules_${{ runner.os }}_${{ hashFiles('**/yarn.lock') }}
path: ${{ steps.yarn-cache-dir-path.outputs.dir }}
key: yarn-${{ hashFiles('yarn.lock') }}
restore-keys: |
yarn-

- name: Install framework modules
run: yarn install --frozen-lockfile
- name: Install dependencies
run: yarn install --immutable

- name: Create a temporary directory
id: createpath
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/publish-npm-canary.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ jobs:
node --version
yarn --version
- name: Install dependencies
run: yarn install --frozen-lockfile --check-files
run: yarn install --immutable

- name: Build
run: yarn build
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/publish-npm-rc.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ jobs:
node-version: '14'

- name: Install dependencies
run: yarn install --frozen-lockfile --check-files
run: yarn install --immutable --check-files

- name: Build
run: yarn build
Expand Down
8 changes: 8 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -11,3 +11,11 @@ tasks/e2e/cypress/fixtures/example.json
tmp/
.vscode/*
blog-test-project/*
.yarn/*
**/.yarn/install-state.gz
!.yarn/patches
!.yarn/releases
!.yarn/plugins
!.yarn/sdks
!.yarn/versions
.pnp.*
52 changes: 52 additions & 0 deletions .yarn/plugins/@yarnpkg/plugin-constraints.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.

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

Large diffs are not rendered by default.

631 changes: 631 additions & 0 deletions .yarn/releases/yarn-3.0.2.cjs

Large diffs are not rendered by default.

19 changes: 19 additions & 0 deletions .yarnrc.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
compressionLevel: 0

enableGlobalCache: true

nmMode: hardlinks-local

nodeLinker: node-modules
thedavidprice marked this conversation as resolved.
Show resolved Hide resolved

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

preferInteractive: true

yarnPath: .yarn/releases/yarn-3.0.2.cjs
2 changes: 2 additions & 0 deletions babel.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -51,8 +51,10 @@ module.exports = {
* https://github.com/tc39/proposal-decorators
**/
['@babel/plugin-proposal-decorators', { legacy: true }],
// The "loose" option must be the same for all three of these plugins.
['@babel/plugin-proposal-class-properties', { loose: true }],
['@babel/plugin-proposal-private-methods', { loose: true }],
['@babel/plugin-proposal-private-property-in-object', { loose: true }],
jtoar marked this conversation as resolved.
Show resolved Hide resolved
],
overrides: [
// ** WEB PACKAGES **
Expand Down
14 changes: 14 additions & 0 deletions constraints.pro
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
% Yarn Constraints https://yarnpkg.com/features/constraints
thedavidprice marked this conversation as resolved.
Show resolved Hide resolved
% check with "yarn constraints" (fix w/ "yarn constraints --fix")
% reference for other constraints: https://github.com/babel/babel/blob/main/constraints.pro

% Enforces that a dependency doesn't appear in both `dependencies` and `devDependencies`
gen_enforced_dependency(WorkspaceCwd, DependencyIdent, null, 'devDependencies') :-
workspace_has_dependency(WorkspaceCwd, DependencyIdent, _, 'devDependencies'),
workspace_has_dependency(WorkspaceCwd, DependencyIdent, _, 'dependencies').

% Prevent two workspaces from depending on conflicting versions of a same dependency
gen_enforced_dependency(WorkspaceCwd, DependencyIdent, DependencyRange2, DependencyType) :-
workspace_has_dependency(WorkspaceCwd, DependencyIdent, DependencyRange, DependencyType),
workspace_has_dependency(OtherWorkspaceCwd, DependencyIdent, DependencyRange2, DependencyType2),
DependencyRange \= DependencyRange2.
11 changes: 9 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,13 @@
"packages/*"
],
"devDependencies": {
"@babel/cli": "7.15.4",
"@babel/node": "7.15.4",
"eslint": "7.32.0",
"jest": "27.2.0",
"npm-packlist": "3.0.0",
"rimraf": "3.0.2",
"typescript": "4.4.3",
"typescript-transform-paths": "3.3.1"
},
"resolutions": {
Expand All @@ -22,7 +28,7 @@
"vscode-languageserver-textdocument": "1.0.1"
},
"scripts": {
"framework": "yarn --cwd ./tasks/framework-tools",
"framework": "yarn ./tasks/framework-tools",
"build": "yarn framework build",
"build:js": "yarn framework build:js",
"build:types": "yarn framework build:types",
Expand All @@ -35,5 +41,6 @@
"postinstall": "yarn framework install",
"build:link": "node ./tasks/build-and-copy",
"build:test-project": "node ./tasks/test-project/test-project"
}
},
"packageManager": "[email protected]"
}
8 changes: 6 additions & 2 deletions packages/api-server/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
"main": "dist/handler",
"license": "MIT",
"dependencies": {
"@babel/plugin-transform-runtime": "7.15.0",
"ansi-colors": "4.1.1",
"body-parser": "1.19.0",
"chokidar": "3.5.2",
Expand All @@ -28,16 +29,19 @@
"youch-terminal": "1.1.1"
},
"devDependencies": {
"@babel/cli": "7.15.4",
"@types/aws-lambda": "8.10.83",
"@types/express": "4.17.13",
"@types/lodash.escape": "4.0.6",
"@types/morgan": "1.9.3",
"@types/qs": "6.9.7",
"@types/stack-trace": "0.0.29"
"@types/stack-trace": "0.0.29",
"jest": "27.2.0",
"typescript": "4.4.3"
},
"scripts": {
"build": "yarn build:js",
"prepublishOnly": "yarn cross-env NODE_ENV=production yarn build",
"prepublishOnly": "NODE_ENV=production yarn build",
thedavidprice marked this conversation as resolved.
Show resolved Hide resolved
"build:js": "babel src -d dist --extensions \".js,.ts,.tsx\"",
"build:watch": "nodemon --watch src --ext \"js,ts,tsx\" --ignore dist --exec \"yarn build && yarn fix:permissions\"",
"fix:permissions": "chmod +x dist/index.js; chmod +x dist/watch.js"
Expand Down
7 changes: 5 additions & 2 deletions packages/api/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,13 +22,16 @@
"uuid": "8.3.2"
},
"devDependencies": {
"@babel/cli": "7.15.4",
"@redwoodjs/auth": "0.37.2",
"@types/crypto-js": "4.0.2",
"@types/jsonwebtoken": "8.5.5",
"@types/lodash.merge": "4.6.6",
"@types/lodash.omitby": "4.6.6",
"@types/md5": "2.3.1",
"split2": "3.2.2"
"jest": "27.2.0",
"split2": "3.2.2",
"typescript": "4.4.3"
},
"jest": {
"testPathIgnorePatterns": [
Expand All @@ -37,7 +40,7 @@
},
"scripts": {
"build": "yarn build:js && yarn build:types",
"prepublishOnly": "yarn cross-env NODE_ENV=production yarn build",
"prepublishOnly": "NODE_ENV=production yarn build",
"build:js": "babel src -d dist --extensions \".js,.ts,.tsx\"",
"build:types": "tsc --build --verbose",
"build:watch": "nodemon --watch src --ext \"js,ts,tsx\" --ignore dist --exec \"yarn build\"",
Expand Down
17 changes: 17 additions & 0 deletions packages/auth/ambient.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
/* eslint-disable no-var */
import type { AuthContextInterface } from './src/index'

declare global {
// For some reason, in this package, we need to declare it here too
var __REDWOOD__USE_AUTH: () => AuthContextInterface
var __REDWOOD__API_PROXY_PATH: string

namespace NodeJS {
interface Global {
__REDWOOD__USE_AUTH: () => AuthContextInterface
__REDWOOD__API_PROXY_PATH: string
}
}
}

export {}
7 changes: 5 additions & 2 deletions packages/auth/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
"license": "MIT",
"devDependencies": {
"@auth0/auth0-spa-js": "1.18.0",
"@babel/cli": "7.15.4",
"@clerk/clerk-js": "1.33.0",
"@clerk/clerk-sdk-node": "0.5.2",
"@clerk/types": "1.13.0",
Expand All @@ -18,15 +19,17 @@
"firebase": "9.0.1",
"firebase-admin": "9.11.1",
"gotrue-js": "0.9.29",
"jest": "27.2.0",
"magic-sdk": "6.0.5",
"msal": "1.4.12",
"netlify-identity-widget": "1.9.2",
"nhost-js-sdk": "3.1.0",
"react": "17.0.2"
"react": "17.0.2",
"typescript": "4.4.3"
},
"scripts": {
"build": "yarn build:js && yarn build:types",
"prepublishOnly": "yarn cross-env NODE_ENV=production yarn build",
"prepublishOnly": "NODE_ENV=production yarn build",
"build:js": "babel src -d dist --extensions \".js,.ts,.tsx\"",
"build:types": "tsc --build --verbose",
"build:watch": "nodemon --watch src --ext \"js,ts,tsx\" --ignore dist --exec \"yarn build\"",
Expand Down
10 changes: 0 additions & 10 deletions packages/auth/src/useAuth.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,4 @@ export const useAuth = (): AuthContextInterface => {
return React.useContext(AuthContext) as AuthContextInterface
}

declare global {
// eslint-disable-next-line @typescript-eslint/no-namespace
namespace NodeJS {
interface Global {
__REDWOOD__USE_AUTH: () => AuthContextInterface
__REDWOOD__API_PROXY_PATH: string
}
}
}

global.__REDWOOD__USE_AUTH = useAuth
2 changes: 1 addition & 1 deletion packages/auth/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,5 +9,5 @@
"src/*": ["./src/*"]
}
},
"include": ["src"],
"include": ["src", "ambient.d.ts"]
}
11 changes: 7 additions & 4 deletions packages/cli/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,10 @@
"license": "MIT",
"bin": {
"redwood": "./dist/index.js",
"rw": "./dist/index.js",
"redwood-tools": "./dist/redwood-tools.js",
"rwt": "./dist/redwood-tools.js",
"rwfw": "./dist/rwfw.js"
"rw": "./dist/index.js",
"rwfw": "./dist/rwfw.js",
"rwt": "./dist/redwood-tools.js"
},
"files": [
"dist"
Expand Down Expand Up @@ -48,8 +48,11 @@
"yargs": "16.2.0"
},
"devDependencies": {
"@babel/cli": "7.15.4",
"@types/listr": "0.14.4",
"@types/node-fetch": "2.5.12"
"@types/node-fetch": "2.5.12",
"jest": "27.2.0",
"typescript": "4.4.3"
},
"scripts": {
"dev": "RWJS_CWD=../../__fixtures__/example-todo-main node dist/index.js",
Expand Down
4 changes: 3 additions & 1 deletion packages/codemods/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,13 @@
"dist"
],
"dependencies": {
"@babel/cli": "7.15.4",
"core-js": "3.17.3",
"deepmerge": "4.2.2",
"execa": "5.1.1",
"fast-glob": "3.2.7",
"findup-sync": "4.0.0",
"jest": "27.2.0",
"jscodeshift": "0.13.0",
"node-fetch": "2.6.1",
"tasuku": "1.0.2",
Expand All @@ -25,7 +27,7 @@
"prepublishOnly": "yarn build",
"build:js": "babel src -d dist --extensions \".js,.ts\" --ignore \"src/**/__tests__/**\" --ignore \"src/**/__testfixtures__/**\"",
"build:watch": "nodemon --watch src --ignore dist --exec \"yarn build\"",
"test": "cross-env NODE_ENV=test jest",
"test": "NODE_ENV=test jest",
"test:watch": "yarn test --watch"
},
"devDependencies": {
Expand Down
2 changes: 1 addition & 1 deletion packages/codemods/src/lib/runTransform.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ const getExecaArgs = () => {
*/
const jscodeshiftExecutable = path.resolve(
__dirname,
'../../node_modules/.bin/jscodeshift'
'../../../../node_modules/.bin/jscodeshift'
)

return {
Expand Down
4 changes: 2 additions & 2 deletions packages/core/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,6 @@
"babel-timing": "0.9.1",
"copy-webpack-plugin": "9.0.1",
"core-js": "3.17.3",
"cross-env": "7.0.3",
"css-loader": "6.2.0",
"css-minimizer-webpack-plugin": "3.0.2",
"dotenv-webpack": "7.0.3",
Expand Down Expand Up @@ -65,7 +64,8 @@
"devDependencies": {
"@types/babel-core": "6.25.7",
"@types/babel-plugin-tester": "9.0.4",
"babel-plugin-tester": "10.1.0"
"babel-plugin-tester": "10.1.0",
"jest": "27.2.0"
},
"gitHead": "8be6a35c2dfd5aaeb12d55be4f0c77eefceb7762",
"scripts": {
Expand Down
Loading