Skip to content

Commit 2fd8829

Browse files
fix: remaining create branch cleanups (#1746)
## PR Checklist - [x] Addresses an existing open issue: fixes #1745 - [x] That issue was marked as [`status: accepting prs`](https://github.com/JoshuaKGoldberg/create-typescript-app/issues?q=is%3Aopen+is%3Aissue+label%3A%22status%3A+accepting+prs%22) - [x] Steps in [CONTRIBUTING.md](https://github.com/JoshuaKGoldberg/create-typescript-app/blob/main/.github/CONTRIBUTING.md) were taken ## Overview 💖
1 parent a0d27c5 commit 2fd8829

23 files changed

+190
-173
lines changed

.prettierrc.json

+2-2
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@
33
"overrides": [{ "files": ".nvmrc", "options": { "parser": "yaml" } }],
44
"plugins": [
55
"prettier-plugin-curly",
6-
"prettier-plugin-sh",
7-
"prettier-plugin-packagejson"
6+
"prettier-plugin-packagejson",
7+
"prettier-plugin-sh"
88
],
99
"useTabs": true
1010
}

package.json

+4-4
Original file line numberDiff line numberDiff line change
@@ -15,11 +15,11 @@
1515
"main": "./lib/index.js",
1616
"bin": "./bin/index.js",
1717
"files": [
18+
"LICENSE.md",
19+
"README.md",
1820
"bin/index.js",
1921
"lib/",
20-
"package.json",
21-
"LICENSE.md",
22-
"README.md"
22+
"package.json"
2323
],
2424
"scripts": {
2525
"build": "tsup",
@@ -42,6 +42,7 @@
4242
},
4343
"dependencies": {
4444
"@clack/prompts": "^0.8.2",
45+
"@prettier/sync": "^0.5.2",
4546
"all-contributors-for-repository": "^0.3.0",
4647
"chalk": "^5.3.0",
4748
"execa": "^9.5.1",
@@ -67,7 +68,6 @@
6768
"@octokit/request-error": "6.1.5",
6869
"@release-it/conventional-changelog": "9.0.3",
6970
"@types/eslint-plugin-markdown": "2.0.2",
70-
"@types/eslint__js": "8.42.3",
7171
"@types/git-url-parse": "9.0.3",
7272
"@types/js-yaml": "4.0.9",
7373
"@types/node": "22.10.1",

pnpm-lock.yaml

+18-10
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/shared/types.ts

+3
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ import { z } from "zod";
33
import { StatusCode } from "./codes.js";
44

55
export interface AllContributorContributor {
6+
avatar_url: string;
67
contributions: string[];
78
login: string;
89
}
@@ -37,9 +38,11 @@ export interface PartialPackageData {
3738
description?: string;
3839
devDependencies?: Record<string, string>;
3940
email?: string;
41+
engine?: { node?: string };
4042
name?: string;
4143
repository?: string | { type: string; url: string };
4244
scripts?: Record<string, string>;
45+
version?: string;
4346
}
4447

4548
/**

src/steps/addOwnerAsAllContributor.ts

+6-2
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,11 @@ import { Octokit } from "octokit";
33

44
import { getGitHubUserAsAllContributor } from "../shared/getGitHubUserAsAllContributor.js";
55
import { readFileAsJson } from "../shared/readFileAsJson.js";
6-
import { AllContributorsData, Options } from "../shared/types.js";
6+
import {
7+
AllContributorContributor,
8+
AllContributorsData,
9+
Options,
10+
} from "../shared/types.js";
711
import { formatJson } from "./writing/creation/formatters/formatJson.js";
812

913
export async function addOwnerAsAllContributor(
@@ -38,7 +42,7 @@ export async function addOwnerAsAllContributor(
3842
contributors.push({
3943
contributions: ["tool"],
4044
login: user,
41-
});
45+
} as AllContributorContributor);
4246
}
4347

4448
await fs.writeFile(

src/steps/finalizeDependencies.test.ts

+3-3
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ describe("finalize", () => {
3838
expect(mockExecaCommand.mock.calls).toMatchInlineSnapshot(`
3939
[
4040
[
41-
"pnpm add @eslint-community/eslint-plugin-eslint-comments@latest @eslint/js@latest @release-it/conventional-changelog@latest @types/eslint-plugin-markdown@latest @types/eslint__js@latest @types/node@latest @vitest/coverage-v8@latest @vitest/eslint-plugin@latest all-contributors-cli@latest console-fail-test@latest cspell@latest eslint@latest eslint-plugin-jsdoc@latest eslint-plugin-jsonc@latest eslint-plugin-markdown@latest eslint-plugin-n@latest eslint-plugin-package-json@latest eslint-plugin-perfectionist@latest eslint-plugin-regexp@latest eslint-plugin-yml@latest husky@latest jsonc-eslint-parser@latest knip@latest lint-staged@latest markdownlint@latest markdownlint-cli@latest prettier@latest prettier-plugin-curly@latest prettier-plugin-packagejson@latest prettier-plugin-sh@latest release-it@latest sentences-per-line@latest tsup@latest typescript@latest typescript-eslint@latest vitest@latest -D",
41+
"pnpm add @eslint-community/eslint-plugin-eslint-comments@latest @eslint/js@latest @release-it/conventional-changelog@latest @types/eslint-plugin-markdown@latest @types/node@latest @vitest/coverage-v8@latest @vitest/eslint-plugin@latest all-contributors-cli@latest console-fail-test@latest cspell@latest eslint@latest eslint-plugin-jsdoc@latest eslint-plugin-jsonc@latest eslint-plugin-markdown@latest eslint-plugin-n@latest eslint-plugin-package-json@latest eslint-plugin-perfectionist@latest eslint-plugin-regexp@latest eslint-plugin-yml@latest husky@latest knip@latest lint-staged@latest markdownlint@latest markdownlint-cli@latest prettier@latest prettier-plugin-curly@latest prettier-plugin-packagejson@latest prettier-plugin-sh@latest release-it@latest sentences-per-line@latest tsup@latest typescript@latest typescript-eslint@latest vitest@latest -D",
4242
],
4343
[
4444
"npx all-contributors-cli generate",
@@ -59,7 +59,7 @@ describe("finalize", () => {
5959
expect(mockExecaCommand.mock.calls).toMatchInlineSnapshot(`
6060
[
6161
[
62-
"pnpm add @eslint-community/eslint-plugin-eslint-comments@latest @eslint/js@latest @release-it/conventional-changelog@latest @types/eslint-plugin-markdown@latest @types/eslint__js@latest @types/node@latest @vitest/coverage-v8@latest @vitest/eslint-plugin@latest all-contributors-cli@latest console-fail-test@latest cspell@latest eslint@latest eslint-plugin-jsdoc@latest eslint-plugin-jsonc@latest eslint-plugin-markdown@latest eslint-plugin-n@latest eslint-plugin-package-json@latest eslint-plugin-perfectionist@latest eslint-plugin-regexp@latest eslint-plugin-yml@latest husky@latest jsonc-eslint-parser@latest knip@latest lint-staged@latest markdownlint@latest markdownlint-cli@latest prettier@latest prettier-plugin-curly@latest prettier-plugin-packagejson@latest prettier-plugin-sh@latest release-it@latest sentences-per-line@latest tsup@latest typescript@latest typescript-eslint@latest vitest@latest -D --offline",
62+
"pnpm add @eslint-community/eslint-plugin-eslint-comments@latest @eslint/js@latest @release-it/conventional-changelog@latest @types/eslint-plugin-markdown@latest @types/node@latest @vitest/coverage-v8@latest @vitest/eslint-plugin@latest all-contributors-cli@latest console-fail-test@latest cspell@latest eslint@latest eslint-plugin-jsdoc@latest eslint-plugin-jsonc@latest eslint-plugin-markdown@latest eslint-plugin-n@latest eslint-plugin-package-json@latest eslint-plugin-perfectionist@latest eslint-plugin-regexp@latest eslint-plugin-yml@latest husky@latest knip@latest lint-staged@latest markdownlint@latest markdownlint-cli@latest prettier@latest prettier-plugin-curly@latest prettier-plugin-packagejson@latest prettier-plugin-sh@latest release-it@latest sentences-per-line@latest tsup@latest typescript@latest typescript-eslint@latest vitest@latest -D --offline",
6363
],
6464
[
6565
"npx all-contributors-cli generate",
@@ -92,7 +92,7 @@ describe("finalize", () => {
9292
expect(mockExecaCommand.mock.calls).toMatchInlineSnapshot(`
9393
[
9494
[
95-
"pnpm add @eslint-community/eslint-plugin-eslint-comments@latest @eslint/js@latest @types/eslint__js@latest @types/node@latest eslint@latest eslint-plugin-jsdoc@latest eslint-plugin-n@latest eslint-plugin-regexp@latest husky@latest lint-staged@latest prettier@latest prettier-plugin-curly@latest prettier-plugin-packagejson@latest prettier-plugin-sh@latest tsup@latest typescript@latest typescript-eslint@latest -D",
95+
"pnpm add @eslint-community/eslint-plugin-eslint-comments@latest @eslint/js@latest @types/node@latest eslint@latest eslint-plugin-jsdoc@latest eslint-plugin-n@latest eslint-plugin-regexp@latest husky@latest lint-staged@latest prettier@latest prettier-plugin-curly@latest prettier-plugin-packagejson@latest prettier-plugin-sh@latest tsup@latest typescript@latest typescript-eslint@latest -D",
9696
],
9797
[
9898
"pnpm dedupe --offline",

src/steps/finalizeDependencies.ts

-4
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@ import { Options } from "../shared/types.js";
66
export async function finalizeDependencies(options: Options) {
77
const devDependencies = [
88
"@eslint/js",
9-
"@types/eslint__js",
109
"@types/node",
1110
"eslint",
1211
"eslint-plugin-n",
@@ -25,9 +24,6 @@ export async function finalizeDependencies(options: Options) {
2524
: ["@eslint-community/eslint-plugin-eslint-comments"]),
2625
...(options.excludeLintJSDoc ? [] : ["eslint-plugin-jsdoc"]),
2726
...(options.excludeLintJson ? [] : ["eslint-plugin-jsonc"]),
28-
...(options.excludeLintJson && options.excludeLintPackageJson
29-
? []
30-
: ["jsonc-eslint-parser"]),
3127
...(options.excludeLintKnip ? [] : ["knip"]),
3228
...(options.excludeLintMd
3329
? []

src/steps/uninstallPackages.ts

+1
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ export async function uninstallPackages(offline: boolean | undefined) {
88
await removeDependencies(
99
[
1010
"@clack/prompts",
11+
"@prettier/sync",
1112
"all-contributors-for-repository",
1213
"chalk",
1314
"execa",

src/steps/writing/creation/createDotGitignore.ts

+7-5
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,11 @@ import { Options } from "../../../shared/types.js";
22
import { formatIgnoreFile } from "./formatters/formatIgnoreFile.js";
33

44
export function createDotGitignore(options: Pick<Options, "excludeTests">) {
5-
return formatIgnoreFile([
6-
...(options.excludeTests ? [] : ["/coverage"]),
7-
"/lib",
8-
"/node_modules",
9-
]);
5+
return formatIgnoreFile(
6+
[
7+
...(options.excludeTests ? [] : ["/coverage"]),
8+
"/lib",
9+
"/node_modules",
10+
].sort(),
11+
);
1012
}

0 commit comments

Comments
 (0)