diff --git a/script/__snapshots__/migrate-test-e2e.js.snap b/script/__snapshots__/migrate-test-e2e.js.snap index c0ddf53b4..201594600 100644 --- a/script/__snapshots__/migrate-test-e2e.js.snap +++ b/script/__snapshots__/migrate-test-e2e.js.snap @@ -95,11 +95,9 @@ exports[`expected file changes > README.md 1`] = ` "--- a/README.md +++ b/README.md @@ ... @@ - 💪 TypeScript: Strict -

--Project logo: the TypeScript blue square with rounded corners, but a plus sign instead of 'TS' -- + Project logo: the TypeScript blue square with rounded corners, but a plus sign instead of 'TS' + -\`create-typescript-app\` is a one-stop-shop solution to set up a new or existing repository with the latest and greatest TypeScript tooling. -It includes options not just for building and testing but also GitHub repository templates, contributor recognition, automated release management, and more. - diff --git a/script/migrate-test-e2e.js b/script/migrate-test-e2e.js index d7527c1c5..d528e60cb 100644 --- a/script/migrate-test-e2e.js +++ b/script/migrate-test-e2e.js @@ -32,6 +32,8 @@ const bin = "./bin/index.js"; const guide = "https://www.joshuakgoldberg.com/blog/contributing-to-a-create-typescript-app-repository"; const guideTitle = "Contributing to a create-typescript-app Repository"; +const logo = "./create-typescript-app.png"; +const logoAlt = `Project logo: the TypeScript blue square with rounded corners, but a plus sign instead of 'TS'`; const owner = "JoshuaKGoldberg"; const title = "Create TypeScript App"; @@ -47,7 +49,7 @@ const originalSnapshots = ( await $({ stdio: "inherit", -})`c8 -o ./coverage -r html -r lcov --src src node ${bin} --base everything --author ${authorName} --mode migrate --bin ${bin} --description ${description} --email-github ${emailGithub} --email-npm ${emailNpm} --guide ${guide} --guide-title ${guideTitle} --owner ${owner} --title ${title} --repository ${repository} --skip-all-contributors-api --skip-github-api --skip-install`; +})`c8 -o ./coverage -r html -r lcov --src src node ${bin} --base everything --author ${authorName} --mode migrate --bin ${bin} --description ${description} --email-github ${emailGithub} --email-npm ${emailNpm} --guide ${guide} --guide-title ${guideTitle} --logo ${logo} --logo-alt ${logoAlt} --owner ${owner} --title ${title} --repository ${repository} --skip-all-contributors-api --skip-github-api --skip-install`; // All Contributors seems to not be using Prettier to format files... await fs.writeFile( diff --git a/src/shared/options/readOptions.test.ts b/src/shared/options/readOptions.test.ts index f0bc7bf11..7849dffd8 100644 --- a/src/shared/options/readOptions.test.ts +++ b/src/shared/options/readOptions.test.ts @@ -37,6 +37,7 @@ const emptyOptions = { guide: undefined, guideTitle: undefined, logo: undefined, + logoAlt: undefined, offline: undefined, owner: undefined, preserveGeneratedFrom: false, @@ -756,6 +757,7 @@ describe("readOptions", () => { "guide": undefined, "guideTitle": undefined, "logo": undefined, + "logoAlt": undefined, "mode": "migrate", "offline": true, "owner": "TestOwner", diff --git a/src/shared/options/readOptions.ts b/src/shared/options/readOptions.ts index 8a60ae872..f813cab68 100644 --- a/src/shared/options/readOptions.ts +++ b/src/shared/options/readOptions.ts @@ -87,6 +87,7 @@ export async function readOptions( guide: values.guide, guideTitle: values["guide-title"], logo: values.logo, + logoAlt: values["logo-alt"], offline: values.offline, owner: values.owner, preserveGeneratedFrom: diff --git a/src/steps/writeReadme/generateTopContent.ts b/src/steps/writeReadme/generateTopContent.ts index 84e77ce42..04c04eac6 100644 --- a/src/steps/writeReadme/generateTopContent.ts +++ b/src/steps/writeReadme/generateTopContent.ts @@ -58,6 +58,14 @@ ${[...badges, ...remainingExistingBadges] .map((badge) => `\t${badge}`) .join("\n")}

${ + options.logo + ? ` + +${options.logo.alt} + +` + : "" + }${ options.mode === "migrate" ? "" : `