diff --git a/src/main.ts b/src/main.ts index cb2bf58..1c0d674 100644 --- a/src/main.ts +++ b/src/main.ts @@ -54,7 +54,7 @@ const previewUpdater = async () => { config.package ||= defaultPackage; config.data ||= {}; - config.package.name ||= packageLock.name; + config.package.name ||= packageLock.name || config.repository?.repo; config.data.title ||= titleCase(config.repository?.repo); config.data.description ||= packageLock.description || config.repository?.owner; diff --git a/src/types/lockFile.ts b/src/types/lockFile.ts index 9c190bd..9e7b71e 100644 --- a/src/types/lockFile.ts +++ b/src/types/lockFile.ts @@ -1,6 +1,6 @@ export interface LockFile { - name: string; - description: string; + name?: string; + description?: string; dependencies?: Record[]; require?: Record[]; diff --git a/src/utils/packageManagers.ts b/src/utils/packageManagers.ts index 0bf2d1f..38103a4 100644 --- a/src/utils/packageManagers.ts +++ b/src/utils/packageManagers.ts @@ -22,5 +22,9 @@ export const getPackageManager = (config: Config): LockFile => { return getComposer(config); } - return getNpm(config); + if (hasNpm(config) || hasYarn(config)) { + return getNpm(config); + } + + return {}; };