+`;
+}
\ No newline at end of file
diff --git a/dev/lib/register-github-app/index.d.ts b/dev/setup/lib/index.d.ts
similarity index 100%
rename from dev/lib/register-github-app/index.d.ts
rename to dev/setup/lib/index.d.ts
diff --git a/dev/lib/register-github-app/index.js b/dev/setup/lib/index.js
similarity index 56%
rename from dev/lib/register-github-app/index.js
rename to dev/setup/lib/index.js
index 8aaf92f..277acc8 100644
--- a/dev/lib/register-github-app/index.js
+++ b/dev/setup/lib/index.js
@@ -1,13 +1,13 @@
/**
- * Register a GitHub App using the manifest flow
- * @see https://github.com/gr2m/register-github-app
+ * Register a GitHub App via a local server and the GitHub App Manifest flow
+ * @uses https://github.com/gr2m/register-github-app
*
* @ts-check
*/
import { createServer } from "node:http";
-
import { request as octokitRequest } from "@octokit/request";
+import { getStartPage, getNextStepPage } from "./content.html.js";
const DEFAULT_MANIFEST = {
url: "https://github.com",
@@ -19,9 +19,9 @@ const DEFAULT_META_OPTIONS = {
};
/**
- * @param {import('./index').Manifest} manifest
- * @param {import('./index').MetaOptions} metaOptions
- * @returns {Promise}
+ * @param {import('../index').Manifest} manifest
+ * @param {import('../index').MetaOptions} metaOptions
+ * @returns {Promise}
*/
export default async function registerGitHubApp(
{ org, ...manifest } = DEFAULT_MANIFEST,
@@ -55,7 +55,7 @@ export default async function registerGitHubApp(
// @ts-expect-error - I have yet to see a usecase when `server.address()` can be a string
server.address().port;
- log(`Open http://localhost:${port}`);
+ log(`Open http://localhost:${port} in the browser to get started`);
server.on("error", (error) => {
reject(new Error("A server error occured", { cause: error }));
@@ -75,30 +75,7 @@ export default async function registerGitHubApp(
console.log(appCredentials);
response.writeHead(200, { "Content-Type": "text/html" });
- response.end(`
-
-
GitHub App registered successfully
-
- Now follow this steps below..
-
-
- Create a new github repository with name "jargons.dev-test" at https://github.com/new
-
-
- Copy and paste the repo name in full as value to the "PUBLIC_PROJECT_REPO" in the newly created .env;
-
- Example: (assuming you chose the suggested name)
-
-
- PUBLIC_PROJECT_REPO="${appCredentials.owner.login}/jargons.dev-test"
-
-