Skip to content

Commit

Permalink
[build-tools][create-eas-build-function] bump package-manager version (
Browse files Browse the repository at this point in the history
…#482)

# Why

fixes expo/eas-cli#2782

# How

- `@expo/[email protected]` supports bun text-based lock file. this pr bumps the version
- replace `findWorkspaceRoot -> resolveWorkspaceRoot` because of breaking change from expo/expo#31124
- as new package-manager uses `node:fs` under the hood. it breaks jest tests, we have to replicate the [changes](expo/expo#31690) here
  • Loading branch information
Kudo authored Jan 8, 2025
1 parent f794e13 commit 55b9932
Show file tree
Hide file tree
Showing 6 changed files with 55 additions and 61 deletions.
2 changes: 1 addition & 1 deletion packages/build-tools/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
"@expo/eas-build-job": "1.0.156",
"@expo/env": "^0.4.0",
"@expo/logger": "1.0.117",
"@expo/package-manager": "1.5.2",
"@expo/package-manager": "1.7.0",
"@expo/plist": "^0.2.0",
"@expo/repack-app": "0.0.6",
"@expo/results": "^1.0.0",
Expand Down
3 changes: 3 additions & 0 deletions packages/build-tools/src/__mocks__/fs.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,3 +24,6 @@ const fsRm = (
};

module.exports = { ...fs, realpath: fsRealpath, rm: fsRm };

// NOTE(cedric): workaround to also mock `node:fs`
jest.mock('node:fs', () => require('fs'));
3 changes: 3 additions & 0 deletions packages/build-tools/src/__mocks__/fs/promises.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,3 +13,6 @@ const fsRm = (path: string, options: object): Promise<void> => {
};

module.exports = { ...fs.promises, realpath: fsRealpath, rm: fsRm };

// NOTE(cedric): workaround to also mock `node:fs/promises`
jest.mock('node:fs/promises', () => require('memfs').fs.promises);
2 changes: 1 addition & 1 deletion packages/build-tools/src/utils/packageManager.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ export function resolvePackageManager(directory: string): PackageManager {
}

export function findPackagerRootDir(currentDir: string): string {
return PackageManagerUtils.findWorkspaceRoot(currentDir) ?? currentDir;
return PackageManagerUtils.resolveWorkspaceRoot(currentDir) ?? currentDir;
}

export async function isAtLeastNpm7Async(): Promise<boolean> {
Expand Down
2 changes: 1 addition & 1 deletion packages/create-eas-build-function/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@
"@expo/steps": "1.0.156"
},
"devDependencies": {
"@expo/package-manager": "1.5.2",
"@expo/package-manager": "1.7.0",
"@jest/globals": "^29.7.0",
"@types/jest": "^29.5.12",
"@types/node": "20.14.2",
Expand Down
104 changes: 46 additions & 58 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -770,15 +770,6 @@
json5 "^2.2.2"
write-file-atomic "^2.3.0"

"@expo/json-file@^8.3.0":
version "8.3.3"
resolved "https://registry.yarnpkg.com/@expo/json-file/-/json-file-8.3.3.tgz#7926e3592f76030ce63d6b1308ac8f5d4d9341f4"
integrity sha512-eZ5dld9AD0PrVRiIWpRkm5aIoWBw3kAyd8VkuWEy92sEthBKDDDHAnK2a0dw0Eil6j7rK7lS/Qaq/Zzngv2h5A==
dependencies:
"@babel/code-frame" "~7.10.4"
json5 "^2.2.2"
write-file-atomic "^2.3.0"

"@expo/json-file@^9.0.0", "@expo/json-file@~9.0.0":
version "9.0.0"
resolved "https://registry.yarnpkg.com/@expo/json-file/-/json-file-9.0.0.tgz#e3688c9b108cfd7e819f1354a9458ba6e93fc943"
Expand All @@ -797,21 +788,21 @@
json5 "^2.2.2"
write-file-atomic "^2.3.0"

"@expo/package-manager@1.5.2":
version "1.5.2"
resolved "https://registry.yarnpkg.com/@expo/package-manager/-/package-manager-1.5.2.tgz#6015963669977a188bbbac930aa0dc103162ee73"
integrity sha512-IuA9XtGBilce0q8cyxtWINqbzMB1Fia0Yrug/O53HNuRSwQguV/iqjV68bsa4z8mYerePhcFgtvISWLAlNEbUA==
"@expo/package-manager@1.7.0":
version "1.7.0"
resolved "https://registry.yarnpkg.com/@expo/package-manager/-/package-manager-1.7.0.tgz#6d98090fdfa9d31ab885acb012d6615741594fd1"
integrity sha512-yWn5TIjd42wLHZjNtdZkvCkcxqUGxlI4YHb+bQmgm3tWZ8aBHnLhPb0rgU8+hVHCofmRvVUXfVZv8Uh+kkLXgw==
dependencies:
"@expo/json-file" "^8.3.0"
"@expo/json-file" "^9.0.0"
"@expo/spawn-async" "^1.7.2"
ansi-regex "^5.0.0"
chalk "^4.0.0"
find-up "^5.0.0"
find-yarn-workspace-root "~2.0.0"
js-yaml "^3.13.1"
micromatch "^4.0.2"
npm-package-arg "^7.0.0"
micromatch "^4.0.8"
npm-package-arg "^11.0.0"
ora "^3.4.0"
resolve-workspace-root "^2.0.0"
split "^1.0.1"
sudo-prompt "9.1.1"

Expand Down Expand Up @@ -2705,7 +2696,7 @@ brace-expansion@^2.0.1:
dependencies:
balanced-match "^1.0.0"

braces@^3.0.1, braces@~3.0.2:
braces@^3.0.1, braces@^3.0.3, braces@~3.0.2:
version "3.0.3"
resolved "https://registry.yarnpkg.com/braces/-/braces-3.0.3.tgz#490332f40919452272d55a8480adc0c441358789"
integrity sha512-yQbXgO/OSZVD2IsiLlro+7Hf6Q18EJrKSEsdoMzKePKXct3gvD8oLcOQdIzGupr5Fj+EDe8gO/lxc1BzfMpxvA==
Expand Down Expand Up @@ -4419,13 +4410,6 @@ find-up@^5.0.0, find-up@~5.0.0:
locate-path "^6.0.0"
path-exists "^4.0.0"

find-yarn-workspace-root@~2.0.0:
version "2.0.0"
resolved "https://registry.yarnpkg.com/find-yarn-workspace-root/-/find-yarn-workspace-root-2.0.0.tgz#f47fb8d239c900eb78179aa81b66673eac88f7bd"
integrity sha512-1IMnbjt4KzsQfnhnzNd8wUEgXZ44IzZaZmnLYx7D5FZlaHt2gW20Cri8Q+E/t5tIj4+epTBub+2Zxu/vNILzqQ==
dependencies:
micromatch "^4.0.2"

flat-cache@^3.0.4:
version "3.0.4"
resolved "https://registry.yarnpkg.com/flat-cache/-/flat-cache-3.0.4.tgz#61b0338302b2fe9f957dcc32fc2a87f1c3048b11"
Expand Down Expand Up @@ -5054,7 +5038,7 @@ hosted-git-info@^2.1.4:
resolved "https://registry.yarnpkg.com/hosted-git-info/-/hosted-git-info-2.8.9.tgz#dffc0bf9a21c02209090f2aa69429e1414daf3f9"
integrity sha512-mxIDAb9Lsm6DoOJ7xH+5+X4y1LU/4Hi50L9C5sIswK3JzULS4bwk1FvjdBgvYR4bzT4tuUQiC15FE2f5HbLvYw==

hosted-git-info@^3.0.2, hosted-git-info@^3.0.6:
hosted-git-info@^3.0.6:
version "3.0.8"
resolved "https://registry.yarnpkg.com/hosted-git-info/-/hosted-git-info-3.0.8.tgz#6e35d4cc87af2c5f816e4cb9ce350ba87a3f370d"
integrity sha512-aXpmwoOhRBrw6X3j0h5RloK4x1OzsxMPyxqIHyNfSe2pypkVTZFpEiRoSipPEPlMrh0HW/XsjkJ5WgnCirpNUw==
Expand All @@ -5075,6 +5059,13 @@ hosted-git-info@^6.0.0:
dependencies:
lru-cache "^7.5.1"

hosted-git-info@^7.0.0:
version "7.0.2"
resolved "https://registry.yarnpkg.com/hosted-git-info/-/hosted-git-info-7.0.2.tgz#9b751acac097757667f30114607ef7b661ff4f17"
integrity sha512-puUZAUKT5m8Zzvs72XWy3HtvVbTWljRE66cP60bxJzAqf2DgICo7lYTY2IHUmLnNpjYvw5bvmoHvPc0QO2a62w==
dependencies:
lru-cache "^10.0.1"

html-escaper@^2.0.0:
version "2.0.2"
resolved "https://registry.yarnpkg.com/html-escaper/-/html-escaper-2.0.2.tgz#dfd60027da36a36dfcbe236262c00a5822681453"
Expand Down Expand Up @@ -6643,6 +6634,11 @@ lowercase-keys@^2.0.0:
resolved "https://registry.yarnpkg.com/lowercase-keys/-/lowercase-keys-2.0.0.tgz#2603e78b7b4b0006cbca2fbcc8a3202558ac9479"
integrity sha512-tqNXrS78oMOE73NMxK4EMLQsQowWf8jKooH9g7xPavRT706R6bkQJ6DY2Te7QukaZsulxa30wQ7bk0pm4XiHmA==

lru-cache@^10.0.1:
version "10.4.3"
resolved "https://registry.yarnpkg.com/lru-cache/-/lru-cache-10.4.3.tgz#410fc8a17b70e598013df257c2446b7f3383f119"
integrity sha512-JNAzZcXrCt42VGLuYz0zfAzDfAvJWW6AfYlDBQyDV5DClI2m5sAmK+OIO7s59XfsRsWHp02jAJrRadPRGTt6SQ==

lru-cache@^10.2.0:
version "10.2.2"
resolved "https://registry.yarnpkg.com/lru-cache/-/lru-cache-10.2.2.tgz#48206bc114c1252940c41b25b41af5b545aca878"
Expand Down Expand Up @@ -6787,14 +6783,6 @@ merge2@^1.3.0, merge2@^1.4.1:
resolved "https://registry.yarnpkg.com/merge2/-/merge2-1.4.1.tgz#4368892f885e907455a6fd7dc55c0c9d404990ae"
integrity sha512-8q7VEgMJW4J8tcfVPy8g09NcQwZdbwFEqhe/WZkoIzjn/3TGDwtOCYtXGxA3O8tPzpczCCDgv+P2P5y00ZJOOg==

micromatch@^4.0.2:
version "4.0.2"
resolved "https://registry.yarnpkg.com/micromatch/-/micromatch-4.0.2.tgz#4fcb0999bf9fbc2fcbdd212f6d629b9a56c39259"
integrity sha512-y7FpHSbMUMoyPbYUSzO6PaZ6FyRnQOpHuKwbo1G+Knck95XVU4QAiKdGEnj5wwoS7PlOgthX/09u5iFJ+aYf5Q==
dependencies:
braces "^3.0.1"
picomatch "^2.0.5"

micromatch@^4.0.4:
version "4.0.4"
resolved "https://registry.yarnpkg.com/micromatch/-/micromatch-4.0.4.tgz#896d519dfe9db25fce94ceb7a500919bf881ebf9"
Expand All @@ -6803,6 +6791,14 @@ micromatch@^4.0.4:
braces "^3.0.1"
picomatch "^2.2.3"

micromatch@^4.0.8:
version "4.0.8"
resolved "https://registry.yarnpkg.com/micromatch/-/micromatch-4.0.8.tgz#d66fa18f3a47076789320b9b1af32bd86d9fa202"
integrity sha512-PXwfBhYu0hBCPw8Dn0E+WDYb7af3dSLVWKi3HGv84IdF4TyFoC0ysxFd0Goxw7nSv4T/PzEJQxsYsEiFCKo2BA==
dependencies:
braces "^3.0.3"
picomatch "^2.3.1"

[email protected]:
version "1.46.0"
resolved "https://registry.yarnpkg.com/mime-db/-/mime-db-1.46.0.tgz#6267748a7f799594de3cbc8cde91def349661cee"
Expand Down Expand Up @@ -7280,15 +7276,15 @@ npm-package-arg@^10.0.0, npm-package-arg@^10.1.0:
semver "^7.3.5"
validate-npm-package-name "^5.0.0"

npm-package-arg@^7.0.0:
version "7.0.0"
resolved "https://registry.yarnpkg.com/npm-package-arg/-/npm-package-arg-7.0.0.tgz#52cdf08b491c0c59df687c4c925a89102ef794a5"
integrity sha512-xXxr8y5U0kl8dVkz2oK7yZjPBvqM2fwaO5l3Yg13p03v8+E3qQcD0JNhHzjL1vyGgxcKkD0cco+NLR72iuPk3g==
npm-package-arg@^11.0.0:
version "11.0.3"
resolved "https://registry.yarnpkg.com/npm-package-arg/-/npm-package-arg-11.0.3.tgz#dae0c21199a99feca39ee4bfb074df3adac87e2d"
integrity sha512-sHGJy8sOC1YraBywpzQlIKBE4pBbGbiF95U6Auspzyem956E0+FtDtsx1ZxlOJkQCZ1AFXAY/yuvtFYrOxF+Bw==
dependencies:
hosted-git-info "^3.0.2"
osenv "^0.1.5"
semver "^5.6.0"
validate-npm-package-name "^3.0.0"
hosted-git-info "^7.0.0"
proc-log "^4.0.0"
semver "^7.3.5"
validate-npm-package-name "^5.0.0"

[email protected]:
version "5.1.1"
Expand Down Expand Up @@ -7607,24 +7603,11 @@ ora@^6.3.1:
strip-ansi "^7.0.1"
wcwidth "^1.0.1"

os-homedir@^1.0.0:
version "1.0.2"
resolved "https://registry.yarnpkg.com/os-homedir/-/os-homedir-1.0.2.tgz#ffbc4988336e0e833de0c168c7ef152121aa7fb3"
integrity sha1-/7xJiDNuDoM94MFox+8VISGqf7M=

os-tmpdir@^1.0.0, os-tmpdir@~1.0.2:
os-tmpdir@~1.0.2:
version "1.0.2"
resolved "https://registry.yarnpkg.com/os-tmpdir/-/os-tmpdir-1.0.2.tgz#bbe67406c79aa85c5cfec766fe5734555dfa1274"
integrity sha1-u+Z0BseaqFxc/sdm/lc0VV36EnQ=

osenv@^0.1.5:
version "0.1.5"
resolved "https://registry.yarnpkg.com/osenv/-/osenv-0.1.5.tgz#85cdfafaeb28e8677f416e287592b5f3f49ea410"
integrity sha512-0CWcCECdMVc2Rw3U5w9ZjqX6ga6ubk1xDVKxtBQPK7wis/0F2r9T6k4ydGYhecl7YUBxBVxhL5oisPsNxAPe2g==
dependencies:
os-homedir "^1.0.0"
os-tmpdir "^1.0.0"

p-cancelable@^2.0.0:
version "2.1.0"
resolved "https://registry.yarnpkg.com/p-cancelable/-/p-cancelable-2.1.0.tgz#4d51c3b91f483d02a0d300765321fca393d758dd"
Expand Down Expand Up @@ -7869,12 +7852,12 @@ picocolors@^1.0.0:
resolved "https://registry.yarnpkg.com/picocolors/-/picocolors-1.0.0.tgz#cb5bdc74ff3f51892236eaf79d68bc44564ab81c"
integrity sha512-1fygroTLlHu66zi26VoTDv8yRgm0Fccecssto+MhsZ0D/DGW2sm8E8AjW7NU5VVTRt5GxbeZ5qBuJr+HyLYkjQ==

picomatch@^2.0.4, picomatch@^2.0.5:
picomatch@^2.0.4:
version "2.2.2"
resolved "https://registry.yarnpkg.com/picomatch/-/picomatch-2.2.2.tgz#21f333e9b6b8eaff02468f5146ea406d345f4dad"
integrity sha512-q0M/9eZHzmr0AulXyPwNfZjtwZ/RBZlbN3K3CErVrk50T2ASYI7Bye0EvekFY3IP1Nt2DHu0re+V2ZHIpMkuWg==

picomatch@^2.2.1, picomatch@^2.2.3:
picomatch@^2.2.1, picomatch@^2.2.3, picomatch@^2.3.1:
version "2.3.1"
resolved "https://registry.yarnpkg.com/picomatch/-/picomatch-2.3.1.tgz#3ba3833733646d9d3e4995946c1365a67fb07a42"
integrity sha512-JU3teHTNjmE2VCGFzuY8EXzCDVwEqB2a8fsIvwaStHhAWJEeVd1o1QD80CU6+ZdEXXSLbSsuLwJjkCBWqRQUVA==
Expand Down Expand Up @@ -7981,6 +7964,11 @@ proc-log@^3.0.0:
resolved "https://registry.yarnpkg.com/proc-log/-/proc-log-3.0.0.tgz#fb05ef83ccd64fd7b20bbe9c8c1070fc08338dd8"
integrity sha512-++Vn7NS4Xf9NacaU9Xq3URUuqZETPsf8L4j5/ckhaRYsfPeRyzGw+iDjFhV/Jr3uNmTvvddEJFWh5R1gRgUH8A==

proc-log@^4.0.0:
version "4.2.0"
resolved "https://registry.yarnpkg.com/proc-log/-/proc-log-4.2.0.tgz#b6f461e4026e75fdfe228b265e9f7a00779d7034"
integrity sha512-g8+OnU/L2v+wyiVK+D5fA34J7EH8jZ8DDlvwhRCMxmMj7UCBvxiO1mGeN+36JXIKF4zevU4kRBd8lVgG9vLelA==

process-nextick-args@~2.0.0:
version "2.0.1"
resolved "https://registry.yarnpkg.com/process-nextick-args/-/process-nextick-args-2.0.1.tgz#7820d9b16120cc55ca9ae7792680ae7dba6d7fe2"
Expand Down

0 comments on commit 55b9932

Please sign in to comment.