Skip to content

Commit 88b01c5

Browse files
Update dependency cosmiconfig to v9 (#1069)
1 parent bd21061 commit 88b01c5

4 files changed

Lines changed: 43 additions & 43 deletions

File tree

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
{
2+
"type": "patch",
3+
"comment": "Update dependency cosmiconfig to v9",
4+
"packageName": "beachball",
5+
"email": "email not defined",
6+
"dependentChangeType": "patch"
7+
}

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@
4747
]
4848
},
4949
"dependencies": {
50-
"cosmiconfig": "^8.3.6",
50+
"cosmiconfig": "^9.0.0",
5151
"execa": "^5.0.0",
5252
"fs-extra": "^11.1.1",
5353
"lodash": "^4.17.15",

src/options/getRepoOptions.ts

Lines changed: 17 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
import { cosmiconfigSync } from 'cosmiconfig';
2-
import { getDefaultRemoteBranch } from 'workspace-tools';
2+
import { findGitRoot, getDefaultRemoteBranch } from 'workspace-tools';
33
import { env } from '../env';
44
import type { RepoOptions, CliOptions, BeachballOptions } from '../types/BeachballOptions';
5+
import path from 'path';
56

67
const cachedRepoOptions = new Map<CliOptions, Partial<RepoOptions>>();
78

@@ -13,7 +14,21 @@ export function getRepoOptions(cliOptions: CliOptions): Partial<RepoOptions> {
1314

1415
let repoOptions: Partial<RepoOptions> | null | undefined;
1516

16-
const configExplorer = cosmiconfigSync('beachball', { cache: false });
17+
let rootDir: string;
18+
try {
19+
rootDir = findGitRoot(cwd);
20+
} catch {
21+
rootDir = path.parse(cwd).root;
22+
}
23+
const configExplorer = cosmiconfigSync('beachball', {
24+
cache: false,
25+
// cosmiconfig v9 doesn't search up by default. To preserve most of the old behavior plus
26+
// some of the efficiency gains, search up to the git root (if available, since realistically
27+
// this is the farthest up that a config file is likely to be) or fall back to searching up
28+
// to the filesystem root (probably the old behavior).
29+
stopDir: rootDir,
30+
searchStrategy: 'global',
31+
});
1732

1833
if (configPath) {
1934
repoOptions = configExplorer.load(configPath)?.config as Partial<RepoOptions> | undefined;

yarn.lock

Lines changed: 18 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -1017,16 +1017,11 @@ async@3.2.4:
10171017
resolved "https://registry.yarnpkg.com/async/-/async-3.2.4.tgz#2d22e00f8cddeb5fde5dd33522b56d1cf569a81c"
10181018
integrity sha512-iAB+JbDEGXhyIUavoDl9WP/Jj106Kz9DEn1DPgYw5ruDn0e3Wgi3sKFm55sASdGBNOQB8F59d9qQ7deqrHA8wQ==
10191019

1020-
async@3.2.5:
1020+
async@3.2.5, async@^3.2.3:
10211021
version "3.2.5"
10221022
resolved "https://registry.yarnpkg.com/async/-/async-3.2.5.tgz#ebd52a8fdaf7a2289a24df399f8d8485c8a46b66"
10231023
integrity sha512-baNZyqaaLhyLVKm/DlvdW051MSgO6b8eVfIezl9E5PqWxFgzLm/wQntEW4zOytVburDEr0JlALEpdOFwvErLsg==
10241024

1025-
async@^3.2.3:
1026-
version "3.2.6"
1027-
resolved "https://registry.yarnpkg.com/async/-/async-3.2.6.tgz#1b0728e14929d51b85b449b7f06e27c1145e38ce"
1028-
integrity sha512-htCUDlxyyCLMgaM3xXg0C0LW2xqfuQ6p05pCEIsXuyQ+a1koYKTuBMzRNwmybfLgvJDMd0r1LTn4+E0Ti6C2AA==
1029-
10301025
asynckit@^0.4.0:
10311026
version "0.4.0"
10321027
resolved "https://registry.yarnpkg.com/asynckit/-/asynckit-0.4.0.tgz#c79ed97f7f34cb8f2ba1bc9790bcc366474b4b79"
@@ -1436,16 +1431,11 @@ core-js@3.35.0:
14361431
resolved "https://registry.yarnpkg.com/core-js/-/core-js-3.35.0.tgz#58e651688484f83c34196ca13f099574ee53d6b4"
14371432
integrity sha512-ntakECeqg81KqMueeGJ79Q5ZgQNR+6eaE8sxGCx62zMbAIj65q+uYvatToew3m6eAGdU4gNZwpZ34NMe4GYswg==
14381433

1439-
core-util-is@1.0.2:
1434+
core-util-is@1.0.2, core-util-is@~1.0.0:
14401435
version "1.0.2"
14411436
resolved "https://registry.yarnpkg.com/core-util-is/-/core-util-is-1.0.2.tgz#b5fd54220aa2bc5ab57aab7140c940754503c1a7"
14421437
integrity sha512-3lqz5YjWTYnW6dlDa5TLaTCcShfar1e40rmcJVwCBJC6mWlFuj0eCHIElmG1g5kyuJ/GD+8Wn4FFCcz4gJPfaQ==
14431438

1444-
core-util-is@~1.0.0:
1445-
version "1.0.3"
1446-
resolved "https://registry.yarnpkg.com/core-util-is/-/core-util-is-1.0.3.tgz#a6042d3634c2b27e9328f837b965fac83808db85"
1447-
integrity sha512-ZQBvi1DcpJ4GDqanjucZ2Hj3wEO5pZDS89BWbkcrvdxksJorwUDDZamX9ldFkp9aw2lmBDLgkObEA4DWNJ9FYQ==
1448-
14491439
cors@2.8.5:
14501440
version "2.8.5"
14511441
resolved "https://registry.yarnpkg.com/cors/-/cors-2.8.5.tgz#eac11da51592dd86b9f06f6e7ac293b3df875d29"
@@ -1454,15 +1444,15 @@ cors@2.8.5:
14541444
object-assign "^4"
14551445
vary "^1"
14561446

1457-
cosmiconfig@^8.3.6:
1458-
version "8.3.6"
1459-
resolved "https://registry.yarnpkg.com/cosmiconfig/-/cosmiconfig-8.3.6.tgz#060a2b871d66dba6c8538ea1118ba1ac16f5fae3"
1460-
integrity sha512-kcZ6+W5QzcJ3P1Mt+83OUv/oHFqZHIx8DuxG6eZ5RGMERoLqp4BuGjhHLYGK+Kf5XVkQvqBSmAy/nGWN3qDgEA==
1447+
cosmiconfig@^9.0.0:
1448+
version "9.0.0"
1449+
resolved "https://registry.yarnpkg.com/cosmiconfig/-/cosmiconfig-9.0.0.tgz#34c3fc58287b915f3ae905ab6dc3de258b55ad9d"
1450+
integrity sha512-itvL5h8RETACmOTFc4UfIyB2RfEHi71Ax6E/PivVxq9NseKbOWpeyHEOIbmAw1rs8Ak0VursQNww7lf7YtUwzg==
14611451
dependencies:
1452+
env-paths "^2.2.1"
14621453
import-fresh "^3.3.0"
14631454
js-yaml "^4.1.0"
14641455
parse-json "^5.2.0"
1465-
path-type "^4.0.0"
14661456

14671457
create-jest@^29.7.0:
14681458
version "29.7.0"
@@ -1505,14 +1495,7 @@ debug@2.6.9:
15051495
dependencies:
15061496
ms "2.0.0"
15071497

1508-
debug@4, debug@^4.1.0, debug@^4.1.1, debug@^4.3.1, debug@^4.3.4:
1509-
version "4.4.0"
1510-
resolved "https://registry.yarnpkg.com/debug/-/debug-4.4.0.tgz#2b3f2aea2ffeb776477460267377dc8710faba8a"
1511-
integrity sha512-6WTZ/IxCY/T6BALoZHaE4ctp9xm+Z5kY/pzYaCHRFeyVhojxlrm+46y68HA6hr0TcwEssoxNiDEUJQjfPZ/RYA==
1512-
dependencies:
1513-
ms "^2.1.3"
1514-
1515-
debug@4.3.4:
1498+
debug@4, debug@4.3.4, debug@^4.1.0, debug@^4.1.1, debug@^4.3.1, debug@^4.3.4:
15161499
version "4.3.4"
15171500
resolved "https://registry.yarnpkg.com/debug/-/debug-4.3.4.tgz#1319f6579357f2338d3337d2cdd4914bb5dcc865"
15181501
integrity sha512-PRWFHuSU3eDtQJPvnNY7Jcket1j0t5OuOsFzPPzsekD52Zl8qUfFIPEiswXqIvHWGVHOgX+7G/vCNNhehwxfkQ==
@@ -1644,6 +1627,11 @@ end-of-stream@^1.4.1:
16441627
dependencies:
16451628
once "^1.4.0"
16461629

1630+
env-paths@^2.2.1:
1631+
version "2.2.1"
1632+
resolved "https://registry.yarnpkg.com/env-paths/-/env-paths-2.2.1.tgz#420399d416ce1fbe9bc0a07c62fa68d67fd0f8f2"
1633+
integrity sha512-+h1lkLKhZMTYjog1VEpJNG7NZJWcuc2DDk/qsqSTRRCOXiLjeQ1d1/udrUGhqMxUgAlwKNZ0cf2uqan5GLuS2A==
1634+
16471635
envinfo@7.11.0:
16481636
version "7.11.0"
16491637
resolved "https://registry.yarnpkg.com/envinfo/-/envinfo-7.11.0.tgz#c3793f44284a55ff8c82faf1ffd91bc6478ea01f"
@@ -1793,16 +1781,11 @@ extend@~3.0.2:
17931781
resolved "https://registry.yarnpkg.com/extend/-/extend-3.0.2.tgz#f8b1136b4071fbd8eb140aff858b1019ec2915fa"
17941782
integrity sha512-fjquC59cD7CyW6urNXK0FBufkZcoiGG80wTuPujX590cB5Ttln20E2UB4S/WARVqhXffZl2LNgS+gQdPIIim/g==
17951783

1796-
extsprintf@1.3.0:
1784+
extsprintf@1.3.0, extsprintf@^1.2.0:
17971785
version "1.3.0"
17981786
resolved "https://registry.yarnpkg.com/extsprintf/-/extsprintf-1.3.0.tgz#96918440e3041a7a414f8c52e3c574eb3c3e1e05"
17991787
integrity sha512-11Ndz7Nv+mvAC1j0ktTa7fAb0vLyGGX+rMHNBYQviQDGU0Hw7lhctJANqbPhu9nV9/izT/IntTgZ7Im/9LJs9g==
18001788

1801-
extsprintf@^1.2.0:
1802-
version "1.4.1"
1803-
resolved "https://registry.yarnpkg.com/extsprintf/-/extsprintf-1.4.1.tgz#8d172c064867f235c0c84a596806d279bf4bcc07"
1804-
integrity sha512-Wrk35e8ydCKDj/ArClo1VrPVmN8zph5V4AtHwIuHhvMXsKf73UT3BOD+azBIW+3wOJ4FhEH7zyaJCFvChjYvMA==
1805-
18061789
fast-deep-equal@^3.1.1:
18071790
version "3.1.3"
18081791
resolved "https://registry.yarnpkg.com/fast-deep-equal/-/fast-deep-equal-3.1.3.tgz#3a7d56b559d6cbc3eb512325244e619a65c6c525"
@@ -3061,16 +3044,11 @@ micromatch@^4.0.0, micromatch@^4.0.4, micromatch@^4.0.5, micromatch@^4.0.8:
30613044
braces "^3.0.3"
30623045
picomatch "^2.3.1"
30633046

3064-
mime-db@1.52.0:
3047+
mime-db@1.52.0, "mime-db@>= 1.43.0 < 2":
30653048
version "1.52.0"
30663049
resolved "https://registry.yarnpkg.com/mime-db/-/mime-db-1.52.0.tgz#bbabcdc02859f4987301c856e3387ce5ec43bf70"
30673050
integrity sha512-sPU4uV7dYlvtWJxwwxHD0PuihVNiE7TyAbQ5SWxDCB9mUYvOgroQOwYQQOKPJ8CIbE+1ETVlOoK1UC2nU3gYvg==
30683051

3069-
"mime-db@>= 1.43.0 < 2":
3070-
version "1.54.0"
3071-
resolved "https://registry.yarnpkg.com/mime-db/-/mime-db-1.54.0.tgz#cddb3ee4f9c64530dff640236661d42cb6a314f5"
3072-
integrity sha512-aU5EJuIN2WDemCcAp2vFBfp/m4EAhWJnUNSSw0ixs7/kXbd6Pg64EmwJkNdFhB8aWt1sH2CTXrLxo/iAGV3oPQ==
3073-
30743052
mime-types@^2.1.12, mime-types@~2.1.19, mime-types@~2.1.24, mime-types@~2.1.34:
30753053
version "2.1.35"
30763054
resolved "https://registry.yarnpkg.com/mime-types/-/mime-types-2.1.35.tgz#381a871b62a734450660ae3deee44813f70d959a"
@@ -3146,7 +3124,7 @@ ms@2.1.2:
31463124
resolved "https://registry.yarnpkg.com/ms/-/ms-2.1.2.tgz#d09d1f357b443f493382a8eb3ccd183872ae6009"
31473125
integrity sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==
31483126

3149-
ms@2.1.3, ms@^2.1.1, ms@^2.1.3:
3127+
ms@2.1.3, ms@^2.1.1:
31503128
version "2.1.3"
31513129
resolved "https://registry.yarnpkg.com/ms/-/ms-2.1.3.tgz#574c8138ce1d2b5861f0b44579dbadd60c6615b2"
31523130
integrity sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==
@@ -3698,12 +3676,12 @@ rxjs@^7.5.5:
36983676
dependencies:
36993677
tslib "^2.1.0"
37003678

3701-
safe-buffer@5.1.2, safe-buffer@~5.1.0, safe-buffer@~5.1.1:
3679+
safe-buffer@5.1.2, safe-buffer@^5.0.1, safe-buffer@^5.1.2, safe-buffer@~5.1.0, safe-buffer@~5.1.1:
37023680
version "5.1.2"
37033681
resolved "https://registry.yarnpkg.com/safe-buffer/-/safe-buffer-5.1.2.tgz#991ec69d296e0313747d59bdfd2b745c35f8828d"
37043682
integrity sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==
37053683

3706-
safe-buffer@5.2.1, safe-buffer@^5.0.1, safe-buffer@^5.1.2, safe-buffer@~5.2.0:
3684+
safe-buffer@5.2.1, safe-buffer@~5.2.0:
37073685
version "5.2.1"
37083686
resolved "https://registry.yarnpkg.com/safe-buffer/-/safe-buffer-5.2.1.tgz#1eaf9fa9bdb1fdd4ec75f58f9cdb4e6b7827eec6"
37093687
integrity sha512-rp3So07KcdmmKbGvgaNxQSJr7bGVSVk5S9Eq1F+ppbRo70+YeaDxkw5Dd8NPN+GD6bjnYm2VuPuCXmpuYvmCXQ==

0 commit comments

Comments
 (0)