From 20cbf057ce083daf45affe66b73c65f3acb34fdc Mon Sep 17 00:00:00 2001 From: tommy-mitchell Date: Mon, 12 Jun 2023 11:15:24 -0500 Subject: [PATCH 1/2] fix(`ui`): handle first time display of dependencies --- source/util.js | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/source/util.js b/source/util.js index 00c21244..a9528898 100644 --- a/source/util.js +++ b/source/util.js @@ -84,7 +84,14 @@ export const getNewFiles = async rootDir => { }; export const getNewDependencies = async (newPkg, rootDir) => { - let oldPkg = await git.readFileFromLastRelease(path.resolve(rootDir, 'package.json')); + let oldPkg; + + try { + oldPkg = await git.readFileFromLastRelease(path.resolve(rootDir, 'package.json')); + } catch { + return Object.keys(newPkg.dependencies ?? {}); + } + oldPkg = JSON.parse(oldPkg); const newDependencies = []; From 85943de91d4589150247e104590539dfb9074777 Mon Sep 17 00:00:00 2001 From: tommy-mitchell Date: Mon, 12 Jun 2023 11:54:31 -0500 Subject: [PATCH 2/2] add comment --- source/util.js | 1 + 1 file changed, 1 insertion(+) diff --git a/source/util.js b/source/util.js index a9528898..348bb13d 100644 --- a/source/util.js +++ b/source/util.js @@ -89,6 +89,7 @@ export const getNewDependencies = async (newPkg, rootDir) => { try { oldPkg = await git.readFileFromLastRelease(path.resolve(rootDir, 'package.json')); } catch { + // Handle first time publish return Object.keys(newPkg.dependencies ?? {}); }