Repository: JoshuaKGoldberg/create-typescript-app (ts)

Issue:
🐛 Bug: package.json bin has unnecessary ./ prefix
### Bug Report Checklist

- [X] I have tried restarting my IDE and the issue persists.
- [X] I have pulled the latest `main` branch of the repository.
- [X] I have [searched for related issues](https://github.com/JoshuaKGoldberg/create-typescript-app/issues?q=is%3Aissue) and found none that matched my issue.

### Expected

`package.json`'s `bin` entry can be a path like `bin/index.js`. There doesn't need to be a `./` at the beginning.

### Actual

https://github.com/JoshuaKGoldberg/create-typescript-app/blob/91cb22b271d63b5e3324c9f17715ce6ae4480c6a/package.json#L16

### Additional Info

I bet this could be linted for...

💖 

Pull request:
fix: remove ./ prefixes in package.json bin and main
## PR Checklist

- [x] Addresses an existing open issue: fixes #1870
- [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

There are now no `./` instances in the `package.json` file. Nice.

💖 

Patch:
diff --git a/.github/DEVELOPMENT.md b/.github/DEVELOPMENT.md
index 307d39f..d403f38 100644
--- a/.github/DEVELOPMENT.md
+++ b/.github/DEVELOPMENT.md
@@ -32,7 +32,7 @@ pnpm build --watch
 
 This repository includes a [VS Code launch configuration](https://code.visualstudio.com/docs/editor/debugging) for debugging.
 To debug a `bin` app, add a breakpoint to your code, then run _Debug Program_ from the VS Code Debug panel (or press F5).
-VS Code will automatically run the `build` task in the background before running `./bin/index.js`.
+VS Code will automatically run the `build` task in the background before running `bin/index.js`.
 
 ## Formatting
 
diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml
index 39a417b..475d700 100644
--- a/.github/workflows/ci.yml
+++ b/.github/workflows/ci.yml
@@ -14,7 +14,7 @@ jobs:
       - uses: actions/checkout@v4
       - uses: ./.github/actions/prepare
       - run: pnpm build
-      - run: node ./lib/index.js --version
+      - run: node lib/index.js --version
   lint:
     name: Lint
     runs-on: ubuntu-latest
diff --git a/.vscode/launch.json b/.vscode/launch.json
index 1d2f28d..db136e5 100644
--- a/.vscode/launch.json
+++ b/.vscode/launch.json
@@ -14,7 +14,7 @@
 		{
 			"name": "Debug Program",
 			"preLaunchTask": "build",
-			"program": "./bin/index.js",
+			"program": "bin/index.js",
 			"request": "launch",
 			"skipFiles": ["<node_internals>/**"],
 			"type": "node"
diff --git a/docs/FAQs.md b/docs/FAQs.md
index 71eb537..22014ac 100644
--- a/docs/FAQs.md
+++ b/docs/FAQs.md
@@ -116,11 +116,11 @@ Then:
    	"exports": {
    		".": {
    			"types": {
-   				"import": "./lib/index.d.ts",
-   				"require": "./lib/index.d.cts"
+   				"import": "lib/index.d.ts",
+   				"require": "lib/index.d.cts"
    			},
-   			"import": "./lib/index.js",
-   			"require": "./lib/index.cjs"
+   			"import": "lib/index.js",
+   			"require": "lib/index.cjs"
    		}
    	}
    }
@@ -222,7 +222,7 @@ If you really want spaces in your project you can always remove the `"useTabs":
 ## How can I use `bin`?
 
 The `--bin` option allows you to create a `package.json` bin value to include for npx-style running.
-An example of this would be `"./bin/index.js"`.
+An example of this would be `"bin/index.js"`.
 You'll need to create the folders and files that `bin` references.
 
 If you'd like an example of what that looks like, take a look at the [CTA source code](https://github.com/JoshuaKGoldberg/create-typescript-app/blob/e7fafcb8968f8f6c551ab0917c9a6a849a3cba28/bin/index.js)!
diff --git a/package.json b/package.json
index ad89707..5214fc2 100644
--- a/package.json
+++ b/package.json
@@ -12,8 +12,8 @@
 		"email": "npm@joshuakgoldberg.com"
 	},
 	"type": "module",
-	"main": "./lib/index.js",
-	"bin": "./bin/index.js",
+	"main": "lib/index.js",
+	"bin": "bin/index.js",
 	"files": [
 		"LICENSE.md",
 		"README.md",
@@ -24,7 +24,7 @@
 	"scripts": {
 		"build": "tsup",
 		"format": "prettier .",
-		"initialize": "pnpm build --no-dts && tsx ./bin/index.js --mode initialize",
+		"initialize": "pnpm build --no-dts && tsx bin/index.js --mode initialize",
 		"lint": "eslint . --max-warnings 0",
 		"lint:knip": "knip",
 		"lint:md": "markdownlint \"**/*.md\" \".github/**/*.md\" --rules sentences-per-line",
diff --git a/src/next/blocks/blockPackageJson.ts b/src/next/blocks/blockPackageJson.ts
index 5995c20..42e74a1 100644
--- a/src/next/blocks/blockPackageJson.ts
+++ b/src/next/blocks/blockPackageJson.ts
@@ -79,7 +79,7 @@ export const blockPackageJson = base.createBlock({
 								keyword.split(/ /),
 							),
 							license: "MIT",
-							main: "./lib/index.js",
+							main: "lib/index.js",
 							name: options.repository,
 							repository: {
 								type: "git",
diff --git a/src/next/blocks/blockTSup.ts b/src/next/blocks/blockTSup.ts
index e2bfd29..7d6d8a3 100644
--- a/src/next/blocks/blockTSup.ts
+++ b/src/next/blocks/blockTSup.ts
@@ -60,7 +60,7 @@ pnpm build --watch
 							steps: [
 								{ run: "pnpm build" },
 								{
-									run: `node ./lib/index.js${addons.runArgs.map((arg) => ` ${arg}`).join("")}`,
+									run: `node lib/index.js${addons.runArgs.map((arg) => ` ${arg}`).join("")}`,
 								},
 							],
 						},
diff --git a/src/next/blocks/blockTypeScript.ts b/src/next/blocks/blockTypeScript.ts
index 9da7986..f893041 100644
--- a/src/next/blocks/blockTypeScript.ts
+++ b/src/next/blocks/blockTypeScript.ts
@@ -77,7 +77,7 @@ export * from "./types.js";
 					properties: {
 						devDependencies: getPackageDependencies("typescript"),
 						files: ["lib/"],
-						main: "./lib/index.js",
+						main: "lib/index.js",
 						scripts: {
 							tsc: "tsc",
 						},
diff --git a/src/steps/writing/creation/dotGitHub/createWorkflows.ts b/src/steps/writing/creation/dotGitHub/createWorkflows.ts
index c6c4f8a..46556c6 100644
--- a/src/steps/writing/creation/dotGitHub/createWorkflows.ts
+++ b/src/steps/writing/creation/dotGitHub/createWorkflows.ts
@@ -32,7 +32,7 @@ export function createWorkflows(options: Options) {
 			jobs: [
 				{
 					name: "Build",
-					steps: [{ run: "pnpm build" }, { run: "node ./lib/index.js" }],
+					steps: [{ run: "pnpm build" }, { run: "node lib/index.js" }],
 				},
 				{
 					name: "Prettier",
diff --git a/src/steps/writing/creation/writePackageJson.ts b/src/steps/writing/creation/writePackageJson.ts
index 742acc3..525c393 100644
--- a/src/steps/writing/creation/writePackageJson.ts
+++ b/src/steps/writing/creation/writePackageJson.ts
@@ -84,7 +84,7 @@ export async function writePackageJson(options: Options) {
 			"lint-staged": {
 				"*": "prettier --ignore-unknown --write",
 			},
-			main: "./lib/index.js",
+			main: "lib/index.js",
 			name: options.repository,
 			publishConfig: {
 				provenance: true,


Test patch:
diff --git a/script/__snapshots__/migrate-test-e2e.ts.snap b/script/__snapshots__/migrate-test-e2e.ts.snap
index a4452a0..b337a44 100644
--- a/script/__snapshots__/migrate-test-e2e.ts.snap
+++ b/script/__snapshots__/migrate-test-e2e.ts.snap
@@ -20,8 +20,8 @@ exports[`expected file changes > .github/workflows/ci.yml 1`] = `
        - uses: actions/checkout@v4
        - uses: ./.github/actions/prepare
        - run: pnpm build
--      - run: node ./lib/index.js --version
-+      - run: node ./lib/index.js
+-      - run: node lib/index.js --version
++      - run: node lib/index.js
    lint:
      name: Lint
      runs-on: ubuntu-latest
diff --git a/script/create-test-e2e.ts b/script/create-test-e2e.ts
index 2419e8b..28548f2 100644
--- a/script/create-test-e2e.ts
+++ b/script/create-test-e2e.ts
@@ -15,7 +15,7 @@ await rimraf(["coverage*", repository]);
 // asserting that pnpm i passes in that repository's directory.
 await $({
 	stdio: "inherit",
-})`c8 -o ./coverage-create -r html -r lcov  --src src node ./bin/index.js --base everything --mode create --author ${author} --email ${email} --description ${description} --owner ${owner} --title ${title} --repository ${repository} --skip-all-contributors-api --skip-github-api`;
+})`c8 -o ./coverage-create -r html -r lcov  --src src node bin/index.js --base everything --mode create --author ${author} --email ${email} --description ${description} --owner ${owner} --title ${title} --repository ${repository} --skip-all-contributors-api --skip-github-api`;
 
 process.chdir(repository);
 
diff --git a/script/initialize-test-e2e.ts b/script/initialize-test-e2e.ts
index a64be02..441e5f6 100644
--- a/script/initialize-test-e2e.ts
+++ b/script/initialize-test-e2e.ts
@@ -58,4 +58,4 @@ await $`pnpm i`;
 await $`pnpm run build`;
 await $({
 	stdio: "inherit",
-})`c8 -o ./coverage -r html -r lcov --src src node ./bin/index.js --base everything --mode initialize --description ${description} --owner ${owner} --title ${title} --repository ${repository} --skip-all-contributors-api --skip-github-api --skip-removal --skip-restore`;
+})`c8 -o ./coverage -r html -r lcov --src src node bin/index.js --base everything --mode initialize --description ${description} --owner ${owner} --title ${title} --repository ${repository} --skip-all-contributors-api --skip-github-api --skip-removal --skip-restore`;
diff --git a/script/migrate-test-e2e.ts b/script/migrate-test-e2e.ts
index d47a416..0b0b66f 100644
--- a/script/migrate-test-e2e.ts
+++ b/script/migrate-test-e2e.ts
@@ -33,7 +33,7 @@ const originalSnapshots = (
 
 await $({
 	stdio: "inherit",
-})`c8 -o ./coverage -r html -r lcov --src src node ./bin/index.js --auto --mode migrate --skip-all-contributors-api --skip-github-api --skip-install`;
+})`c8 -o ./coverage -r html -r lcov --src src node bin/index.js --auto --mode migrate --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/next/blocks/blockPackageJson.test.ts b/src/next/blocks/blockPackageJson.test.ts
index 1908b08..a0b34e4 100644
--- a/src/next/blocks/blockPackageJson.test.ts
+++ b/src/next/blocks/blockPackageJson.test.ts
@@ -13,7 +13,7 @@ describe("blockPackageJson", () => {
 		expect(creation).toMatchInlineSnapshot(`
 			{
 			  "files": {
-			    "package.json": "{"name":"test-repository","version":"0.0.0","description":"Test description","repository":{"type":"git","url":"git+https://github.com/test-owner/test-repository.git"},"license":"MIT","author":{"email":"npm@email.com"},"type":"module","main":"./lib/index.js","files":["README.md","package.json"]}",
+			    "package.json": "{"name":"test-repository","version":"0.0.0","description":"Test description","repository":{"type":"git","url":"git+https://github.com/test-owner/test-repository.git"},"license":"MIT","author":{"email":"npm@email.com"},"type":"module","main":"lib/index.js","files":["README.md","package.json"]}",
 			  },
 			  "scripts": [
 			    {
@@ -36,7 +36,7 @@ describe("blockPackageJson", () => {
 		expect(creation).toMatchInlineSnapshot(`
 			{
 			  "files": {
-			    "package.json": "{"name":"test-repository","version":"0.0.0","description":"Test description","repository":{"type":"git","url":"git+https://github.com/test-owner/test-repository.git"},"license":"MIT","author":{"email":"npm@email.com"},"type":"module","main":"./lib/index.js","files":["README.md","package.json"]}",
+			    "package.json": "{"name":"test-repository","version":"0.0.0","description":"Test description","repository":{"type":"git","url":"git+https://github.com/test-owner/test-repository.git"},"license":"MIT","author":{"email":"npm@email.com"},"type":"module","main":"lib/index.js","files":["README.md","package.json"]}",
 			  },
 			  "scripts": [
 			    {
@@ -73,7 +73,7 @@ describe("blockPackageJson", () => {
 		expect(creation).toMatchInlineSnapshot(`
 			{
 			  "files": {
-			    "package.json": "{"name":"test-repository","version":"0.0.0","description":"Test description","repository":{"type":"git","url":"git+https://github.com/test-owner/test-repository.git"},"license":"MIT","author":{"email":"npm@email.com"},"type":"module","main":"./lib/index.js","files":["README.md","package.json"],"dependencies":{"is-odd":"1.2.3"},"other":true}",
+			    "package.json": "{"name":"test-repository","version":"0.0.0","description":"Test description","repository":{"type":"git","url":"git+https://github.com/test-owner/test-repository.git"},"license":"MIT","author":{"email":"npm@email.com"},"type":"module","main":"lib/index.js","files":["README.md","package.json"],"dependencies":{"is-odd":"1.2.3"},"other":true}",
 			  },
 			  "scripts": [
 			    {
@@ -108,7 +108,7 @@ describe("blockPackageJson", () => {
 		expect(creation).toMatchInlineSnapshot(`
 			{
 			  "files": {
-			    "package.json": "{"name":"test-repository","version":"0.0.0","description":"Test description","repository":{"type":"git","url":"git+https://github.com/test-owner/test-repository.git"},"license":"MIT","author":{"email":"npm@email.com"},"type":"module","main":"./lib/index.js","files":["README.md","package.json"],"dependencies":{"is-odd":"1.2.3"},"devDependencies":{"is-even":"4.5.6"},"other":true}",
+			    "package.json": "{"name":"test-repository","version":"0.0.0","description":"Test description","repository":{"type":"git","url":"git+https://github.com/test-owner/test-repository.git"},"license":"MIT","author":{"email":"npm@email.com"},"type":"module","main":"lib/index.js","files":["README.md","package.json"],"dependencies":{"is-odd":"1.2.3"},"devDependencies":{"is-even":"4.5.6"},"other":true}",
 			  },
 			  "scripts": [
 			    {
diff --git a/src/next/blocks/blockTSup.test.ts b/src/next/blocks/blockTSup.test.ts
index 0619a57..1cfbe50 100644
--- a/src/next/blocks/blockTSup.test.ts
+++ b/src/next/blocks/blockTSup.test.ts
@@ -51,7 +51,7 @@ describe("blockTSup", () => {
 			                "run": "pnpm build",
 			              },
 			              {
-			                "run": "node ./lib/index.js",
+			                "run": "node lib/index.js",
 			              },
 			            ],
 			          },
@@ -139,7 +139,7 @@ describe("blockTSup", () => {
 			                "run": "pnpm build",
 			              },
 			              {
-			                "run": "node ./lib/index.js",
+			                "run": "node lib/index.js",
 			              },
 			            ],
 			          },
@@ -236,7 +236,7 @@ describe("blockTSup", () => {
 			                "run": "pnpm build",
 			              },
 			              {
-			                "run": "node ./lib/index.js",
+			                "run": "node lib/index.js",
 			              },
 			            ],
 			          },
diff --git a/src/next/blocks/blockTypeScript.test.ts b/src/next/blocks/blockTypeScript.test.ts
index 0946202..51238b4 100644
--- a/src/next/blocks/blockTypeScript.test.ts
+++ b/src/next/blocks/blockTypeScript.test.ts
@@ -107,7 +107,7 @@ describe("blockTypeScript", () => {
 			          "files": [
 			            "lib/",
 			          ],
-			          "main": "./lib/index.js",
+			          "main": "lib/index.js",
 			          "scripts": {
 			            "tsc": "tsc",
 			          },
@@ -258,7 +258,7 @@ describe("blockTypeScript", () => {
 			          "files": [
 			            "lib/",
 			          ],
-			          "main": "./lib/index.js",
+			          "main": "lib/index.js",
 			          "scripts": {
 			            "tsc": "tsc",
 			          },
diff --git a/src/shared/options/createOptionDefaults/index.test.ts b/src/shared/options/createOptionDefaults/index.test.ts
index 54189be..efb36a8 100644
--- a/src/shared/options/createOptionDefaults/index.test.ts
+++ b/src/shared/options/createOptionDefaults/index.test.ts
@@ -53,7 +53,7 @@ describe("createOptionDefaults", () => {
 		});
 
 		it("returns the bin when package data has a bin", async () => {
-			const bin = "./lib/index.js";
+			const bin = "lib/index.js";
 
 			mockReadPackageData.mockResolvedValue({ bin });
 
diff --git a/src/steps/writing/creation/dotGitHub/createDotGitHubFiles.test.ts b/src/steps/writing/creation/dotGitHub/createDotGitHubFiles.test.ts
index aab9305..14ebd59 100644
--- a/src/steps/writing/creation/dotGitHub/createDotGitHubFiles.test.ts
+++ b/src/steps/writing/creation/dotGitHub/createDotGitHubFiles.test.ts
@@ -11,7 +11,7 @@ const createOptions = (exclude: boolean) =>
 	({
 		access: "public",
 		base: "everything",
-		bin: exclude ? undefined : "./bin/index.js",
+		bin: exclude ? undefined : "bin/index.js",
 		description: "Test description.",
 		directory: ".",
 		email: {
diff --git a/src/steps/writing/creation/dotGitHub/createWorkflows.test.ts b/src/steps/writing/creation/dotGitHub/createWorkflows.test.ts
index 88c0811..cb6db0a 100644
--- a/src/steps/writing/creation/dotGitHub/createWorkflows.test.ts
+++ b/src/steps/writing/creation/dotGitHub/createWorkflows.test.ts
@@ -7,7 +7,7 @@ const createOptions = (exclude: boolean) =>
 	({
 		access: "public",
 		base: "everything",
-		bin: exclude ? undefined : "./bin/index.js",
+		bin: exclude ? undefined : "bin/index.js",
 		description: "Test description.",
 		directory: ".",
 		email: {
@@ -75,7 +75,7 @@ describe("createWorkflows", () => {
 			      - uses: actions/checkout@v4
 			      - uses: ./.github/actions/prepare
 			      - run: pnpm build
-			      - run: node ./lib/index.js
+			      - run: node lib/index.js
 			  lint:
 			    name: Lint
 			    runs-on: ubuntu-latest
@@ -320,7 +320,7 @@ describe("createWorkflows", () => {
 			      - uses: actions/checkout@v4
 			      - uses: ./.github/actions/prepare
 			      - run: pnpm build
-			      - run: node ./lib/index.js
+			      - run: node lib/index.js
 			  lint:
 			    name: Lint
 			    runs-on: ubuntu-latest
diff --git a/src/steps/writing/creation/index.test.ts b/src/steps/writing/creation/index.test.ts
index 14e8246..a0b4292 100644
--- a/src/steps/writing/creation/index.test.ts
+++ b/src/steps/writing/creation/index.test.ts
@@ -256,7 +256,7 @@ describe("createStructure", () => {
 					),
 					scripts: {
 						initialize:
-							"pnpm build --no-dts && tsx ./bin/index.js --mode initialize",
+							"pnpm build --no-dts && tsx bin/index.js --mode initialize",
 						"test:create": "npx tsx script/create-test-e2e.ts",
 						"test:initialize": "npx tsx script/initialize-test-e2e.ts",
 						"test:migrate": "vitest run -r script/",
diff --git a/src/steps/writing/creation/writePackageJson.test.ts b/src/steps/writing/creation/writePackageJson.test.ts
index 69c197c..704e055 100644
--- a/src/steps/writing/creation/writePackageJson.test.ts
+++ b/src/steps/writing/creation/writePackageJson.test.ts
@@ -89,7 +89,7 @@ describe("writePackageJson", () => {
 			  "lint-staged": {
 			    "*": "prettier --ignore-unknown --write",
 			  },
-			  "main": "./lib/index.js",
+			  "main": "lib/index.js",
 			  "name": "test-repository",
 			  "publishConfig": {
 			    "provenance": true,
@@ -121,7 +121,7 @@ describe("writePackageJson", () => {
 
 		const packageJson = await writePackageJson({
 			...options,
-			bin: "./bin/index.js",
+			bin: "bin/index.js",
 			excludeAllContributors: true,
 			excludeBuild: true,
 			excludeCompliance: true,
@@ -144,7 +144,7 @@ describe("writePackageJson", () => {
 			    "email": "npm@email.com",
 			    "name": "test-author",
 			  },
-			  "bin": "./bin/index.js",
+			  "bin": "bin/index.js",
 			  "description": "Test description.",
 			  "devDependencies": {},
 			  "engines": {
@@ -161,7 +161,7 @@ describe("writePackageJson", () => {
 			  "lint-staged": {
 			    "*": "prettier --ignore-unknown --write",
 			  },
-			  "main": "./lib/index.js",
+			  "main": "lib/index.js",
 			  "name": "test-repository",
 			  "publishConfig": {
 			    "provenance": true,