From ed1f844da0fb73fa270c53f1dc42bfa961d7b011 Mon Sep 17 00:00:00 2001 From: Tobias Date: Thu, 21 Nov 2024 06:46:27 +0100 Subject: [PATCH 1/3] Link to github app in `.env` for `slugEnv` Finding the link to the app on GitHub to edit the settings (like adding a `redirect_uri`) is hard. Having the link right where the app is defined means most users will not have to read the docs from https://github.com/Thinkmill/keystatic/pull/1359. --- packages/keystatic/src/api/api-node.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/keystatic/src/api/api-node.ts b/packages/keystatic/src/api/api-node.ts index b36b9e95b..c5a29c62a 100644 --- a/packages/keystatic/src/api/api-node.ts +++ b/packages/keystatic/src/api/api-node.ts @@ -70,7 +70,7 @@ export async function handleGitHubAppCreation( KEYSTATIC_GITHUB_CLIENT_ID=${ghAppDataResult.client_id} KEYSTATIC_GITHUB_CLIENT_SECRET=${ghAppDataResult.client_secret} KEYSTATIC_SECRET=${randomBytes(40).toString('hex')} -${slugEnvVarName ? `${slugEnvVarName}=${ghAppDataResult.slug}\n` : ''}`; +${slugEnvVarName ? `${slugEnvVarName}=${ghAppDataResult.slug} # https://github.com/apps/${ghAppDataResult.slug}\n` : ''}`; let prevEnv: string | undefined; try { From b33b159f134ac88e4c2b8a35a8ba87946b726848 Mon Sep 17 00:00:00 2001 From: Emma Hamilton Date: Fri, 22 Nov 2024 08:58:49 +1000 Subject: [PATCH 2/3] Create spotty-badgers-punch.md --- .changeset/spotty-badgers-punch.md | 5 +++++ 1 file changed, 5 insertions(+) create mode 100644 .changeset/spotty-badgers-punch.md diff --git a/.changeset/spotty-badgers-punch.md b/.changeset/spotty-badgers-punch.md new file mode 100644 index 000000000..b4bbc759c --- /dev/null +++ b/.changeset/spotty-badgers-punch.md @@ -0,0 +1,5 @@ +--- +"@keystatic/core": patch +--- + +Add link to created GitHub App in generated `.env` From cf26cef18d1b255c83e8cae62d86e1395e884b41 Mon Sep 17 00:00:00 2001 From: Emma Hamilton Date: Fri, 22 Nov 2024 09:04:34 +1000 Subject: [PATCH 3/3] Prettier --- packages/keystatic/src/api/api-node.ts | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/packages/keystatic/src/api/api-node.ts b/packages/keystatic/src/api/api-node.ts index c5a29c62a..a1b9d65cc 100644 --- a/packages/keystatic/src/api/api-node.ts +++ b/packages/keystatic/src/api/api-node.ts @@ -70,7 +70,11 @@ export async function handleGitHubAppCreation( KEYSTATIC_GITHUB_CLIENT_ID=${ghAppDataResult.client_id} KEYSTATIC_GITHUB_CLIENT_SECRET=${ghAppDataResult.client_secret} KEYSTATIC_SECRET=${randomBytes(40).toString('hex')} -${slugEnvVarName ? `${slugEnvVarName}=${ghAppDataResult.slug} # https://github.com/apps/${ghAppDataResult.slug}\n` : ''}`; +${ + slugEnvVarName + ? `${slugEnvVarName}=${ghAppDataResult.slug} # https://github.com/apps/${ghAppDataResult.slug}\n` + : '' +}`; let prevEnv: string | undefined; try {