Skip to content

Commit 7b4f016

Browse files
authored
Upgrade to Yarn 3 (emotion-js#2841)
* [wip] yarn3 upgrade * Upgrade yarn.lock * Fix ssr-benchmarks import * Add back accidentally-removed stuff from package.json * Fix action.yml * Remove jest-snapshot patch * empty commit to test CI caching * Add Yarn 3 patch for jest-snapshot
1 parent 16d971d commit 7b4f016

File tree

30 files changed

+32239
-23456
lines changed

30 files changed

+32239
-23456
lines changed

.github/actions/ci-setup/action.yml

+2-16
Original file line numberDiff line numberDiff line change
@@ -6,22 +6,8 @@ runs:
66
uses: actions/setup-node@v3
77
with:
88
node-version: 16.x
9-
10-
- name: Get yarn cache directory path
11-
id: yarn-cache-dir-path
12-
run: echo "::set-output name=dir::$(yarn cache dir)"
13-
shell: bash
14-
15-
- uses: actions/cache@v3
16-
id: yarn-cache
17-
with:
18-
path: |
19-
${{ steps.yarn-cache-dir-path.outputs.dir }}
20-
node_modules
21-
key: ${{ runner.os }}-yarn-${{ hashFiles('yarn.lock') }}
22-
restore-keys: |
23-
${{ runner.os }}-yarn-
9+
cache: yarn
2410

2511
- name: Install Dependencies
26-
run: yarn --frozen-lockfile
12+
run: yarn --immutable
2713
shell: bash

.gitignore

+7
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,13 @@ package-lock.json
1313
*.orig
1414
*.tsbuildinfo
1515

16+
.yarn/*
17+
!.yarn/patches
18+
!.yarn/plugins
19+
!.yarn/releases
20+
!.yarn/sdks
21+
!.yarn/versions
22+
1623
# Website
1724
site/out
1825
.next

patches/jest-cli++jest-snapshot+27.4.5.patch .yarn/patches/jest-snapshot-npm-27.4.5-6ace6bf68e.patch

+4-4
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
1-
diff --git a/node_modules/jest-cli/node_modules/jest-snapshot/build/InlineSnapshots.js b/node_modules/jest-cli/node_modules/jest-snapshot/build/InlineSnapshots.js
2-
index 5f9c3d5..1ec2ce5 100644
3-
--- a/node_modules/jest-cli/node_modules/jest-snapshot/build/InlineSnapshots.js
4-
+++ b/node_modules/jest-cli/node_modules/jest-snapshot/build/InlineSnapshots.js
1+
diff --git a/build/InlineSnapshots.js b/build/InlineSnapshots.js
2+
index 5f9c3d5816c5e944f6810bc42ff67ed649d84a2b..1ec2ce5d6a5a81ccd8cd898fb65be432b04cb514 100644
3+
--- a/build/InlineSnapshots.js
4+
+++ b/build/InlineSnapshots.js
55
@@ -219,7 +219,8 @@ const saveSnapshotsForFile = (snapshots, sourceFilePath, prettier) => {
66
filename: sourceFilePath,
77
plugins,

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

+28
Large diffs are not rendered by default.

.yarn/releases/yarn-3.2.2.cjs

+783
Large diffs are not rendered by default.

.yarnrc

-1
This file was deleted.

.yarnrc.yml

+9
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
plugins:
2+
- path: .yarn/plugins/@yarnpkg/plugin-workspace-tools.cjs
3+
spec: "@yarnpkg/plugin-workspace-tools"
4+
5+
yarnPath: .yarn/releases/yarn-3.2.2.cjs
6+
7+
nodeLinker: node-modules
8+
9+
npmPublishAccess: public

CONTRIBUTING.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
## Prerequisites
22

3-
- [Node.js](http://nodejs.org/) >= v7 must be installed.
4-
- [Yarn](https://yarnpkg.com/en/docs/install)
3+
- [Node.js](http://nodejs.org/) >= v16 must be installed.
4+
- We are using Yarn Modern so you need either a global install of Yarn v1 (`npm i -g yarn`) or you need to [enable Corepack](https://yarnpkg.com/getting-started/install).
55

66
## Installation
77

netlify.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
[build.environment]
66
NODE_VERSION = "16"
77
YARN_VERSION = "1.22.19"
8-
YARN_FLAGS = "--frozen-lockfile"
8+
YARN_FLAGS = "--immutable"
99
NETLIFY = "true"
1010

1111
# These take effect in production and should match the redirects in next.config.js

package.json

+6-9
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
"test:debug": "node --inspect-brk ./node_modules/jest/bin/jest.js --runInBand --watch",
1010
"test": "jest",
1111
"test:react18": "jest -c jest-react18.config.js",
12-
"test:typescript": "yarn workspaces run test:typescript",
12+
"test:typescript": "yarn workspaces foreach --verbose --exclude emotion-monorepo run test:typescript",
1313
"test:ci": "jest --coverage --no-cache --ci --runInBand",
1414
"test:react18:ci": "yarn test:react18 --coverage --no-cache --ci --runInBand",
1515
"test:prod": "yarn build && jest -c jest.dist.js --no-cache --ci --runInBand",
@@ -21,17 +21,11 @@
2121
"flow": "flow",
2222
"flow:check": "flow check --flowconfig-name=.flowconfig-ci",
2323
"preinstall": "node ./scripts/ensure-yarn.js",
24-
"postinstall": "patch-package && opencollective postinstall && preconstruct dev && manypkg check",
24+
"postinstall": "preconstruct dev && manypkg check",
2525
"changeset": "changeset",
2626
"version-packages": "changeset version",
2727
"release": "yarn build && changeset publish"
2828
},
29-
"resolutions": {
30-
"**/react": "16.14.0",
31-
"**/react-dom": "16.14.0",
32-
"**/browserslist": "^3.2.8",
33-
"**/graphql-type-json": "0.2.4"
34-
},
3529
"author": "Kye Hohenberger",
3630
"homepage": "https://emotion.sh",
3731
"license": "MIT",
@@ -234,7 +228,6 @@
234228
"normalize.css": "^8.0.0",
235229
"npm-run-all": "^4.0.2",
236230
"opencollective": "^1.0.3",
237-
"patch-package": "^6.4.7",
238231
"polished": "^1.2.1",
239232
"prettier": "^2.3.0",
240233
"raf": "^3.4.0",
@@ -250,5 +243,9 @@
250243
"through": "^2.3.8",
251244
"unified": "^6.1.6",
252245
"webpack-bundle-analyzer": "3.3.2"
246+
},
247+
"packageManager": "yarn@3.2.2",
248+
"resolutions": {
249+
"jest-snapshot@27.4.5": "patch:jest-snapshot@npm:27.4.5#.yarn/patches/jest-snapshot-npm-27.4.5-6ace6bf68e.patch"
253250
}
254251
}

packages/babel-plugin-jsx-pragmatic/package.json

-3
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,6 @@
1313
},
1414
"license": "MIT",
1515
"repository": "https://github.com/emotion-js/emotion/tree/main/packages/babel-plugin-jsx-pragmatic",
16-
"scripts": {
17-
"test:typescript": "exit 0"
18-
},
1916
"dependencies": {
2017
"@babel/plugin-syntax-jsx": "^7.17.12"
2118
},

packages/babel-plugin/package.json

-3
Original file line numberDiff line numberDiff line change
@@ -16,9 +16,6 @@
1616
"lib",
1717
"dist"
1818
],
19-
"scripts": {
20-
"test:typescript": "exit 0"
21-
},
2219
"dependencies": {
2320
"@babel/helper-module-imports": "^7.16.7",
2421
"@babel/plugin-syntax-jsx": "^7.17.12",

packages/babel-preset-css-prop/package.json

-3
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,6 @@
1313
},
1414
"license": "MIT",
1515
"repository": "https://github.com/emotion-js/emotion/tree/main/packages/babel-preset-css-prop",
16-
"scripts": {
17-
"test:typescript": "exit 0"
18-
},
1916
"dependencies": {
2017
"@babel/plugin-transform-react-jsx": "^7.17.12",
2118
"@babel/runtime": "^7.18.3",

packages/cache/package.json

-3
Original file line numberDiff line numberDiff line change
@@ -36,9 +36,6 @@
3636
"@emotion/hash": "*",
3737
"typescript": "^4.5.5"
3838
},
39-
"publishConfig": {
40-
"access": "public"
41-
},
4239
"files": [
4340
"src",
4441
"dist",

packages/css-prettifier/package.json

-4
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,6 @@
22
"name": "@emotion/css-prettifier",
33
"version": "1.1.0",
44
"description": "Simple Stylis-based CSS prettifier",
5-
"scripts": {
6-
"test:typescript": "exit 0"
7-
},
85
"keywords": [
96
"emotion"
107
],
@@ -25,7 +22,6 @@
2522
"@emotion/memoize": "^0.8.0",
2623
"stylis": "4.0.13"
2724
},
28-
"devDependencies": {},
2925
"publishConfig": {
3026
"access": "public"
3127
},

packages/eslint-plugin/package.json

-3
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,6 @@
22
"name": "@emotion/eslint-plugin",
33
"version": "11.10.0",
44
"description": "ESLint rules for emotion",
5-
"scripts": {
6-
"test:typescript": "exit 0"
7-
},
85
"keywords": [
96
"eslint",
107
"eslintplugin",

packages/hash/package.json

-3
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,6 @@
77
"types": "types/index.d.ts",
88
"license": "MIT",
99
"repository": "https://github.com/emotion-js/emotion/tree/main/packages/hash",
10-
"publishConfig": {
11-
"access": "public"
12-
},
1310
"files": [
1411
"src",
1512
"dist",

packages/primitives-core/package.json

-3
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,6 @@
44
"description": "Shared utilities for emotion primitives and native",
55
"main": "dist/emotion-primitives-core.cjs.js",
66
"module": "dist/emotion-primitives-core.esm.js",
7-
"scripts": {
8-
"test:typescript": "exit 0"
9-
},
107
"files": [
118
"src",
129
"dist"

packages/primitives/package.json

-3
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,6 @@
33
"version": "11.10.0",
44
"main": "dist/emotion-primitives.cjs.js",
55
"module": "dist/emotion-primitives.esm.js",
6-
"scripts": {
7-
"test:typescript": "exit 0"
8-
},
96
"files": [
107
"src",
118
"dist",

packages/unitless/package.json

-3
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,6 @@
66
"module": "dist/emotion-unitless.esm.js",
77
"license": "MIT",
88
"repository": "https://github.com/emotion-js/emotion/tree/main/packages/unitless",
9-
"scripts": {
10-
"test:typescript": "exit 0"
11-
},
129
"publishConfig": {
1310
"access": "public"
1411
},

playgrounds/cra/package.json

-1
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@
1212
"start": "react-scripts start",
1313
"build": "react-scripts build",
1414
"test": "react-scripts test",
15-
"test:typescript": "exit 0",
1615
"eject": "react-scripts eject"
1716
},
1817
"browserslist": {

playgrounds/nextjs/package.json

+1-2
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,10 @@
11
{
2-
"name": "nextjs",
2+
"name": "nextjs-playground",
33
"version": "0.0.0",
44
"private": true,
55
"scripts": {
66
"dev": "next dev -p 4000",
77
"build": "next build",
8-
"test:typescript": "exit 0",
98
"start": "next start"
109
},
1110
"dependencies": {

scripts/babel-preset-emotion-dev/package.json

-3
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,6 @@
33
"main": "src/index",
44
"version": "9.2.6",
55
"private": true,
6-
"scripts": {
7-
"test:typescript": "exit 0"
8-
},
96
"dependencies": {
107
"@babel/plugin-proposal-class-properties": "^7.17.12",
118
"@babel/plugin-transform-flow-strip-types": "^7.17.12"

scripts/babel-tester/package.json

-3
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,6 @@
33
"main": "src/index.js",
44
"version": "0.4.5",
55
"private": true,
6-
"scripts": {
7-
"test:typescript": "exit 0"
8-
},
96
"dependencies": {
107
"@babel/plugin-syntax-class-properties": "^7.12.13",
118
"@babel/plugin-syntax-object-rest-spread": "^7.8.3"

scripts/benchmarks/package.json

+1-2
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,7 @@
55
"scripts": {
66
"start": "parcel src/index.html",
77
"build": "parcel build src/index.html --public-url .",
8-
"run-benchmark": "node run.js",
9-
"test:typescript": "exit 0"
8+
"run-benchmark": "node run.js"
109
},
1110
"dependencies": {
1211
"@babel/core": "^7.18.5",

scripts/ssr-benchmarks/bench.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ import { jsx, css, CacheProvider } from '@emotion/react'
66
import { createTriangle } from './triangle.js'
77
import { css as cssClassName } from '@emotion/css'
88
import { renderStylesToString } from '@emotion/server'
9-
import EmotionServer from '@emotion/server/create-instance/dist/emotion-server-create-instance.cjs.js'
9+
import EmotionServer from '@emotion/server/create-instance'
1010
import EmotionCache from '@emotion/cache'
1111
import { insertStyles } from '@emotion/utils'
1212

scripts/ssr-benchmarks/package.json

+1-2
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,7 @@
55
"type": "module",
66
"scripts": {
77
"start": "NODE_ENV=production node bench.js",
8-
"start-basic": "NODE_ENV=production node basic.js",
9-
"test:typescript": "exit 0"
8+
"start-basic": "NODE_ENV=production node basic.js"
109
},
1110
"dependencies": {
1211
"benchmark": "^2.1.4",

scripts/test-utils/package.json

+1-4
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,5 @@
22
"name": "test-utils",
33
"main": "src/index",
44
"version": "0.3.2",
5-
"private": true,
6-
"scripts": {
7-
"test:typescript": "exit 0"
8-
}
5+
"private": true
96
}

site/package.json

+1-2
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,7 @@
55
"scripts": {
66
"build": "next build && next export",
77
"dev": "next dev",
8-
"start": "next start",
9-
"test:typescript": "exit 0"
8+
"start": "next start"
109
},
1110
"dependencies": {
1211
"@babel/standalone": "^7.18.7",

0 commit comments

Comments
 (0)