From 7389cd6fe2a385f11d7d61add7fb17e14c64d936 Mon Sep 17 00:00:00 2001 From: Simon Garner Date: Sat, 16 Mar 2024 09:46:20 +1300 Subject: [PATCH 1/4] fix: prevent looking for a package.json file infinitely --- utils.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/utils.js b/utils.js index 297d512..8f7acfc 100644 --- a/utils.js +++ b/utils.js @@ -15,7 +15,9 @@ const getConfigWithDir = () => { if (config) return { config, dir }; } - dir = path.join(dir, '..'); + const parentDir = path.resolve(dir, '..'); + if (parentDir === dir) break; + dir = parentDir; } console.log( From 7372f740c498bed26bfba4a9263de0195f9fd828 Mon Sep 17 00:00:00 2001 From: Simon Garner Date: Sat, 16 Mar 2024 09:47:12 +1300 Subject: [PATCH 2/4] fix: default selected DBs to valid DBs when no config --- utils.js | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/utils.js b/utils.js index 8f7acfc..9c1b03e 100644 --- a/utils.js +++ b/utils.js @@ -58,10 +58,11 @@ const getLicense = () => { }; const getSelectedDbs = () => { - const config = getConfig(); - const selected = config['selected-dbs']; const valids = ['City', 'Country', 'ASN']; - if (!selected) return valids; + + const config = getConfig(); + const selected = config?.['selected-dbs'] ?? valids; + if (!Array.isArray(selected)) { console.error('selected-dbs property must have be an array.'); process.exit(1); From 80ebec8b33d422262d0965aa4f18738e6c64590c Mon Sep 17 00:00:00 2001 From: Dmitry Shirokov Date: Mon, 18 Mar 2024 08:53:33 +1000 Subject: [PATCH 3/4] Create renovate.json --- renovate.json | 14 ++++++++++++++ 1 file changed, 14 insertions(+) create mode 100644 renovate.json diff --git a/renovate.json b/renovate.json new file mode 100644 index 0000000..719a2cd --- /dev/null +++ b/renovate.json @@ -0,0 +1,14 @@ +{ + "extends": ["config:base", ":disableDependencyDashboard"], + "schedule": "on the first day of the month", + "packageRules": [ + { + "updateTypes": ["minor", "patch", "pin", "digest"], + "automerge": true + }, + { + "depTypeList": ["devDependencies"], + "automerge": true + } + ] +} From c4f75016b57ba460596d31af0b8cd40aaf4c63f7 Mon Sep 17 00:00:00 2001 From: Simon Garner Date: Mon, 18 Mar 2024 15:27:20 +1300 Subject: [PATCH 4/4] =?UTF-8?q?fix:=20don=E2=80=99t=20use=20optional=20cha?= =?UTF-8?q?ining=20syntax?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- utils.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/utils.js b/utils.js index 9c1b03e..4436284 100644 --- a/utils.js +++ b/utils.js @@ -61,7 +61,10 @@ const getSelectedDbs = () => { const valids = ['City', 'Country', 'ASN']; const config = getConfig(); - const selected = config?.['selected-dbs'] ?? valids; + const selected = + config != null && config['selected-dbs'] != null + ? config['selected-dbs'] + : valids; if (!Array.isArray(selected)) { console.error('selected-dbs property must have be an array.');