Skip to content

Commit

Permalink
fix: avoid to hoist fsevents require
Browse files Browse the repository at this point in the history
  • Loading branch information
fjc0k committed Jul 21, 2021
1 parent dd35f4d commit 86ed15f
Show file tree
Hide file tree
Showing 3 changed files with 79 additions and 3 deletions.
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
"publish-vscode": "cd packages/vscode && vsce publish",
"publish-npm": "cd packages/npm && npm publish",
"preinstall": "npx only-allow yarn",
"postinstall": "node ./node_modules/vscode/bin/install"
"postinstall": "patch-package && node ./node_modules/vscode/bin/install"
},
"contributes": {
"commands": [
Expand Down Expand Up @@ -102,6 +102,7 @@
"lint-staged": "^10",
"microbundle": "^0.13.3",
"only-allow": "^1.0.0",
"patch-package": "^6.4.7",
"prettier": "^2",
"rollup-plugin-typescript2": "^0.27.0",
"standard-version": "^6.0.1",
Expand Down
13 changes: 13 additions & 0 deletions patches/chokidar+3.5.2.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
diff --git a/node_modules/chokidar/lib/fsevents-handler.js b/node_modules/chokidar/lib/fsevents-handler.js
index 0f7f2cb..75bae1f 100644
--- a/node_modules/chokidar/lib/fsevents-handler.js
+++ b/node_modules/chokidar/lib/fsevents-handler.js
@@ -6,7 +6,7 @@ const { promisify } = require('util');

let fsevents;
try {
- fsevents = require('fsevents');
+ fsevents = global.require('fsevents');
} catch (error) {
if (process.env.CHOKIDAR_PRINT_FSEVENTS_REQUIRE_ERROR) console.error(error);
}
66 changes: 64 additions & 2 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -1654,6 +1654,11 @@
semver "^7.3.2"
tsutils "^3.17.1"

"@yarnpkg/lockfile@^1.1.0":
version "1.1.0"
resolved "https://registry.nlark.com/@yarnpkg/lockfile/download/@yarnpkg/lockfile-1.1.0.tgz#e77a97fbd345b76d83245edcd17d393b1b41fb31"
integrity sha1-53qX+9NFt22DJF7c0X05OxtB+zE=

JSONStream@^1.0.4:
version "1.3.5"
resolved "https://registry.nlark.com/JSONStream/download/JSONStream-1.3.5.tgz#3208c1f08d3a4d99261ab64f92302bc15e111ca0"
Expand Down Expand Up @@ -3988,6 +3993,13 @@ find-versions@^4.0.0:
dependencies:
semver-regex "^3.1.2"

find-yarn-workspace-root@^2.0.0:
version "2.0.0"
resolved "https://registry.npm.taobao.org/find-yarn-workspace-root/download/find-yarn-workspace-root-2.0.0.tgz#f47fb8d239c900eb78179aa81b66673eac88f7bd"
integrity sha1-9H+40jnJAOt4F5qoG2ZnPqyI970=
dependencies:
micromatch "^4.0.2"

flat-cache@^2.0.1:
version "2.0.1"
resolved "https://registry.nlark.com/flat-cache/download/flat-cache-2.0.1.tgz#5d296d6f04bda44a4630a301413bdbc2ec085ec0"
Expand Down Expand Up @@ -4049,6 +4061,15 @@ fs-extra@8.1.0:
jsonfile "^4.0.0"
universalify "^0.1.0"

fs-extra@^7.0.1:
version "7.0.1"
resolved "https://registry.nlark.com/fs-extra/download/fs-extra-7.0.1.tgz?cache=0&other_urls=https%3A%2F%2Fregistry.nlark.com%2Ffs-extra%2Fdownload%2Ffs-extra-7.0.1.tgz#4f189c44aa123b895f722804f55ea23eadc348e9"
integrity sha1-TxicRKoSO4lfcigE9V6iPq3DSOk=
dependencies:
graceful-fs "^4.1.2"
jsonfile "^4.0.0"
universalify "^0.1.0"

fs-extra@^9.0.0:
version "9.1.0"
resolved "https://registry.nlark.com/fs-extra/download/fs-extra-9.1.0.tgz#5954460c764a8da2094ba3554bf839e6b9a7c86d"
Expand Down Expand Up @@ -4293,7 +4314,7 @@ globrex@^0.1.2:
resolved "https://registry.nlark.com/globrex/download/globrex-0.1.2.tgz#dd5d9ec826232730cd6793a5e33a9302985e6098"
integrity sha1-3V2eyCYjJzDNZ5Ol4zqTApheYJg=

graceful-fs@^4.1.15, graceful-fs@^4.1.2, graceful-fs@^4.1.6, graceful-fs@^4.2.0, graceful-fs@^4.2.4:
graceful-fs@^4.1.11, graceful-fs@^4.1.15, graceful-fs@^4.1.2, graceful-fs@^4.1.6, graceful-fs@^4.2.0, graceful-fs@^4.2.4:
version "4.2.6"
resolved "https://registry.nlark.com/graceful-fs/download/graceful-fs-4.2.6.tgz#ff040b2b0853b23c3d31027523706f1885d76bee"
integrity sha1-/wQLKwhTsjw9MQJ1I3BvGIXXa+4=
Expand Down Expand Up @@ -5782,6 +5803,13 @@ kind-of@^6.0.0, kind-of@^6.0.2, kind-of@^6.0.3:
resolved "https://registry.npm.taobao.org/kind-of/download/kind-of-6.0.3.tgz#07c05034a6c349fa06e24fa35aa76db4580ce4dd"
integrity sha1-B8BQNKbDSfoG4k+jWqdttFgM5N0=

klaw-sync@^6.0.0:
version "6.0.0"
resolved "https://registry.nlark.com/klaw-sync/download/klaw-sync-6.0.0.tgz#1fd2cfd56ebb6250181114f0a581167099c2b28c"
integrity sha1-H9LP1W67YlAYERTwpYEWcJnCsow=
dependencies:
graceful-fs "^4.1.11"

kleur@^3.0.3:
version "3.0.3"
resolved "https://registry.nlark.com/kleur/download/kleur-3.0.3.tgz?cache=0&sync_timestamp=1621558601121&other_urls=https%3A%2F%2Fregistry.nlark.com%2Fkleur%2Fdownload%2Fkleur-3.0.3.tgz#a79c9ecc86ee1ce3fa6206d1216c501f147fc07e"
Expand Down Expand Up @@ -6650,6 +6678,14 @@ only-allow@^1.0.0:
boxen "^4.2.0"
which-pm-runs "^1.0.0"

open@^7.4.2:
version "7.4.2"
resolved "https://registry.nlark.com/open/download/open-7.4.2.tgz#b8147e26dcf3e426316c730089fd71edd29c2321"
integrity sha1-uBR+Jtzz5CYxbHMAif1x7dKcIyE=
dependencies:
is-docker "^2.0.0"
is-wsl "^2.1.1"

opencollective-postinstall@^2.0.2:
version "2.0.3"
resolved "https://registry.nlark.com/opencollective-postinstall/download/opencollective-postinstall-2.0.3.tgz#7a0fff978f6dbfa4d006238fbac98ed4198c3259"
Expand Down Expand Up @@ -6849,6 +6885,25 @@ pascalcase@^0.1.1:
resolved "https://registry.nlark.com/pascalcase/download/pascalcase-0.1.1.tgz#b363e55e8006ca6fe21784d2db22bd15d7917f14"
integrity sha1-s2PlXoAGym/iF4TS2yK9FdeRfxQ=

patch-package@^6.4.7:
version "6.4.7"
resolved "https://registry.nlark.com/patch-package/download/patch-package-6.4.7.tgz#2282d53c397909a0d9ef92dae3fdeb558382b148"
integrity sha1-IoLVPDl5CaDZ75La4/3rVYOCsUg=
dependencies:
"@yarnpkg/lockfile" "^1.1.0"
chalk "^2.4.2"
cross-spawn "^6.0.5"
find-yarn-workspace-root "^2.0.0"
fs-extra "^7.0.1"
is-ci "^2.0.0"
klaw-sync "^6.0.0"
minimist "^1.2.0"
open "^7.4.2"
rimraf "^2.6.3"
semver "^5.6.0"
slash "^2.0.0"
tmp "^0.0.33"

path-case@^2.1.0:
version "2.1.1"
resolved "https://registry.nlark.com/path-case/download/path-case-2.1.1.tgz#94b8037c372d3fe2906e465bb45e25d226e8eea5"
Expand Down Expand Up @@ -7864,6 +7919,13 @@ rimraf@2.6.3:
dependencies:
glob "^7.1.3"

rimraf@^2.6.3:
version "2.7.1"
resolved "https://registry.npm.taobao.org/rimraf/download/rimraf-2.7.1.tgz?cache=0&sync_timestamp=1599054269784&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Frimraf%2Fdownload%2Frimraf-2.7.1.tgz#35797f13a7fdadc566142c29d4f07ccad483e3ec"
integrity sha1-NXl/E6f9rcVmFCwp1PB8ytSD4+w=
dependencies:
glob "^7.1.3"

rimraf@^3.0.0, rimraf@^3.0.2:
version "3.0.2"
resolved "https://registry.nlark.com/rimraf/download/rimraf-3.0.2.tgz#f1a5402ba6220ad52cc1282bac1ae3aa49fd061a"
Expand Down Expand Up @@ -8047,7 +8109,7 @@ semver-regex@^3.1.2:
resolved "https://registry.nlark.com/semver-regex/download/semver-regex-3.1.2.tgz#34b4c0d361eef262e07199dbef316d0f2ab11807"
integrity sha1-NLTA02Hu8mLgcZnb7zFtDyqxGAc=

"semver@2 || 3 || 4 || 5", semver@^5.4.1, semver@^5.5.0:
"semver@2 || 3 || 4 || 5", semver@^5.4.1, semver@^5.5.0, semver@^5.6.0:
version "5.7.1"
resolved "https://registry.nlark.com/semver/download/semver-5.7.1.tgz#a954f931aeba508d307bbf069eff0c01c96116f7"
integrity sha1-qVT5Ma66UI0we78Gnv8MAclhFvc=
Expand Down

0 comments on commit 86ed15f

Please sign in to comment.