From 0c13b123cd6fbfc95ed73174ff527297493a50aa Mon Sep 17 00:00:00 2001 From: jill64 Date: Thu, 21 Dec 2023 00:59:23 +0900 Subject: [PATCH 1/2] Update package.json with homepage URL --- packages/action/src/ghosts/docs/updatePackageJson.ts | 10 ++++++++-- .../action/src/ghosts/docs/updatePackageJsonList.ts | 1 - 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/packages/action/src/ghosts/docs/updatePackageJson.ts b/packages/action/src/ghosts/docs/updatePackageJson.ts index 305ba1eb..578ebc9b 100644 --- a/packages/action/src/ghosts/docs/updatePackageJson.ts +++ b/packages/action/src/ghosts/docs/updatePackageJson.ts @@ -31,8 +31,13 @@ export const updatePackageJson = return false } - const isRepoRoot = - path.relative(process.cwd(), packageJsonPath) === 'package.json' + const relative = path.relative(process.cwd(), packageJsonPath) + const relativeDir = path.dirname(relative) + const isRepoRoot = relative === 'package.json' + + const homepage = `${repository.html_url}${ + relativeDir === '.' ? '' : relativeDir + }#readme` const publishConfig = packageJson.name?.startsWith('@') ? { publishConfig: { access: 'public' } } @@ -45,6 +50,7 @@ export const updatePackageJson = const keywords = isRepoRoot ? { keywords: repository.topics ?? [] } : {} const repoInfo = { + homepage, ...repoLevelConfig, ...description, ...publishConfig, diff --git a/packages/action/src/ghosts/docs/updatePackageJsonList.ts b/packages/action/src/ghosts/docs/updatePackageJsonList.ts index ecb38654..fdaa99e8 100644 --- a/packages/action/src/ghosts/docs/updatePackageJsonList.ts +++ b/packages/action/src/ghosts/docs/updatePackageJsonList.ts @@ -31,7 +31,6 @@ export const updatePackageJsonList = async ({ const repoLevelConfig = { ...license, bugs: `${repository.html_url}/issues`, - homepage: `${repository.html_url}#readme`, author: { name: owner.login, email: owner.email ?? 'intents.turrets0h@icloud.com', From c61297d9adf9f0820acff6df9d5ca0ecead5737b Mon Sep 17 00:00:00 2001 From: "wraith-ci[bot]" Date: Wed, 20 Dec 2023 16:00:20 +0000 Subject: [PATCH 2/2] chore: regenerate artifact --- packages/action/dist/index.cjs | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/packages/action/dist/index.cjs b/packages/action/dist/index.cjs index 0e696929..58ba5621 100644 --- a/packages/action/dist/index.cjs +++ b/packages/action/dist/index.cjs @@ -34106,11 +34106,15 @@ var updatePackageJson = ({ core_exports.info(`[${packageJsonPath}]: No name found.`); return false; } - const isRepoRoot = import_node_path2.default.relative(process.cwd(), packageJsonPath) === "package.json"; + const relative = import_node_path2.default.relative(process.cwd(), packageJsonPath); + const relativeDir = import_node_path2.default.dirname(relative); + const isRepoRoot = relative === "package.json"; + const homepage = `${repository.html_url}${relativeDir === "." ? "" : relativeDir}#readme`; const publishConfig = packageJson.name?.startsWith("@") ? { publishConfig: { access: "public" } } : {}; const description = isRepoRoot ? { description: repository.description } : {}; const keywords = isRepoRoot ? { keywords: repository.topics ?? [] } : {}; const repoInfo = { + homepage, ...repoLevelConfig, ...description, ...publishConfig, @@ -34150,7 +34154,6 @@ var updatePackageJsonList = async ({ const repoLevelConfig = { ...license, bugs: `${repository.html_url}/issues`, - homepage: `${repository.html_url}#readme`, author: { name: owner.login, email: owner.email ?? "intents.turrets0h@icloud.com",