From 307e0a0fa20b16ae715af95033c30ec51bd8ed8d Mon Sep 17 00:00:00 2001 From: Antoine du Hamel Date: Thu, 30 Mar 2023 14:42:09 +0200 Subject: [PATCH] Patch Preact to work with Jest --- .../preact-npm-10.10.0-dd04de05e8.patch | 64 ++++++++++++++++--- yarn.lock | 16 ++--- 2 files changed, 64 insertions(+), 16 deletions(-) diff --git a/.yarn/patches/preact-npm-10.10.0-dd04de05e8.patch b/.yarn/patches/preact-npm-10.10.0-dd04de05e8.patch index e4029d65d84..219ca12418d 100644 --- a/.yarn/patches/preact-npm-10.10.0-dd04de05e8.patch +++ b/.yarn/patches/preact-npm-10.10.0-dd04de05e8.patch @@ -1,12 +1,60 @@ +diff --git a/debug/package.json b/debug/package.json +index 71a28079028bb7ace44e86f352ac1ca09868163e..6cbf94bfeb30c6fdbba5f1755f29f587b86a1a69 100644 +--- a/debug/package.json ++++ b/debug/package.json +@@ -15,6 +15,7 @@ + "peerDependencies": { + "preact": "^10.0.0" + }, ++ "type": "module", + "exports": { + ".": { + "browser": "./dist/debug.module.js", +diff --git a/devtools/package.json b/devtools/package.json +index c12ac730f0b3197afc27df6033f13325d6789799..629e41b8248df6f894c46047f874445cf12c974f 100644 +--- a/devtools/package.json ++++ b/devtools/package.json +@@ -13,6 +13,7 @@ + "peerDependencies": { + "preact": "^10.0.0" + }, ++ "type": "module", + "exports": { + ".": { + "types": "./src/index.d.ts", +diff --git a/hooks/package.json b/hooks/package.json +index 787927573e95500078cf423711fa07ddbead37f1..0f252d2b9784f08a739bbef23d52cb31bdb4afa0 100644 +--- a/hooks/package.json ++++ b/hooks/package.json +@@ -23,6 +23,7 @@ + "mangle": { + "regex": "^_" + }, ++ "type": "module", + "exports": { + ".": { + "types": "./src/index.d.ts", +diff --git a/jsx-runtime/package.json b/jsx-runtime/package.json +index 1014de1c8222e3a4aa03fbd64f226ef3de503562..e609d398eab3cbc9f81f51c64d02131320c3233a 100644 +--- a/jsx-runtime/package.json ++++ b/jsx-runtime/package.json +@@ -16,6 +16,7 @@ + "mangle": { + "regex": "^_" + }, ++ "type": "module", + "exports": { + ".": { + "types": "./src/index.d.ts", diff --git a/package.json b/package.json -index 60279c24a08b808ffbf7dc64a038272bddb6785d..71cb8aa038daeeb7edf43564ed78a219003a0c99 100644 +index 24096672ccdded9493dea31a3add321aa487e3d1..4626226b6b07e0dee6405e210ee5b1d81986c062 100644 --- a/package.json +++ b/package.json @@ -9,6 +9,7 @@ - "umd:main": "dist/preact.umd.js", - "unpkg": "dist/preact.min.js", - "source": "src/index.js", -+ "type": "module", - "exports": { - ".": { - "types": "./src/index.d.ts", + "umd:main": "dist/preact.umd.js", + "unpkg": "dist/preact.min.js", + "source": "src/index.js", ++ "type": "module", + "exports": { + ".": { + "types": "./src/index.d.ts", diff --git a/yarn.lock b/yarn.lock index 695f46a28fb..464274270e3 100644 --- a/yarn.lock +++ b/yarn.lock @@ -27592,17 +27592,17 @@ __metadata: languageName: node linkType: hard -"preact@npm:10.10.0": - version: 10.10.0 - resolution: "preact@npm:10.10.0" - checksum: ec34f0e7a8677080debb5e7035a749d30a23694a68389e6f577e051e91a1e1014913c56845a615d1f9a4f2cd0321c46faaded4d4a0457c755d637a3a811fd69e +"preact@npm:10.13.2": + version: 10.13.2 + resolution: "preact@npm:10.13.2" + checksum: 3bc98aa09bcd297eb59abd7e4f3a4d499b8e345bd68b922f7678ef105ba4721dc9b9940b221e6e3443f957d51402fe407bb96ccaa0a4b65d6808ca8a3be76bfa languageName: node linkType: hard -"preact@patch:preact@npm:10.10.0#.yarn/patches/preact-npm-10.10.0-dd04de05e8.patch::locator=%40uppy-dev%2Fbuild%40workspace%3A.": - version: 10.10.0 - resolution: "preact@patch:preact@npm%3A10.10.0#.yarn/patches/preact-npm-10.10.0-dd04de05e8.patch::version=10.10.0&hash=a66388&locator=%40uppy-dev%2Fbuild%40workspace%3A." - checksum: f610d7f206e8cd71739023c3dbeae13fcaf9f9e6488295e2ae28f71c615d216c9b1d8b2fa2d616a629276948ee58a8d16fe77b8b7bc2e8d4aee1101e3336fe2b +"preact@patch:preact@npm:10.13.2#.yarn/patches/preact-npm-10.13.2-cd9ba63d69.patch::locator=%40uppy-dev%2Fbuild%40workspace%3A.": + version: 10.13.2 + resolution: "preact@patch:preact@npm%3A10.13.2#.yarn/patches/preact-npm-10.13.2-cd9ba63d69.patch::version=10.13.2&hash=d7e715&locator=%40uppy-dev%2Fbuild%40workspace%3A." + checksum: 278d3390eda9c7cff36d4e34f6c0d6b0e76ce7e650cc8a06d40b98b6c01acdb4c7dccc3ec24a417f494227e4fca23cc5890b6781537453498d65a1c294b33f52 languageName: node linkType: hard