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

Issue:
🐛 Bug: pnpm dedupe --offline doesn't always have available packages
### 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

Back in #1610 -> #1611, I'd switched package dedupe checks to `pnpm dedupe --offline` as a performance improvement. I'd thought that in theory all packages needed for this should be available. It's always run after a `pnpm install`, after all:

https://github.com/JoshuaKGoldberg/create-typescript-app/blob/c179a7ee157d359e8ac2f39b2c598c128c7b9739/src/blocks/blockPnpmDedupe.ts#L34

https://github.com/JoshuaKGoldberg/create-typescript-app/blob/c179a7ee157d359e8ac2f39b2c598c128c7b9739/src/blocks/blockPackageJson.ts#L93-L101

### Actual

When running on existing repos in transition mode, I've started to see errors like:

```plaintext
■  The pnpm dedupe --offline script failed. You should re-run it and fix its complaints.
│  ExecaError: Command failed with exit code 1: pnpm dedupe --offline
│  
│  Progress: resolved 1, reused 0, downloaded 0, added 0
│  \u2009ERR_PNPM_NO_MATCHING_VERSION\u2009 No matching version found for @eslint/js@9.23.0 while fetching it from https://registry.npmjs.org/
│  
│  This error happened while installing a direct dependency of /Users/josh/repos/all-contributors-for-repository
│  
│  The latest release of @eslint/js is "9.22.0".
│  
│  Other releases are:
│    * next: 9.0.0-rc.0
│    * maintenance: 8.57.1
│  
│  If you need the full list of all 60 published versions run "$ pnpm view @eslint/js versions".
│      at getFinalError (file:///Users/josh/repos/create-typescript-app/node_modules/.pnpm/execa@9.5.2/node_modules/execa/lib/return/final-error.js:6:9)
```

This is from https://github.com/JoshuaKGoldberg/all-contributors-for-repository, ae53c7ce6620ca4394577b971312b206148388fa.

### Additional Info

💖 

Pull request description:
fix: run pnpm dedupe without --offline
## PR Checklist

- [x] Addresses an existing open issue: fixes #2005
- [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

Added a snapshot test while I was in the area.

💖 

Patch:
diff --git a/src/blocks/blockPnpmDedupe.ts b/src/blocks/blockPnpmDedupe.ts
index 9491b56..033f673 100644
--- a/src/blocks/blockPnpmDedupe.ts
+++ b/src/blocks/blockPnpmDedupe.ts
@@ -31,7 +31,7 @@ export const blockPnpmDedupe = base.createBlock({
 					removedWorkflows: ["lint-packages"],
 				}),
 				blockPackageJson({
-					cleanupCommands: ["pnpm dedupe --offline"],
+					cleanupCommands: ["pnpm dedupe"],
 					properties: {
 						scripts: {
 							"lint:packages": "pnpm dedupe --check",


Test patch:
diff --git a/src/blocks/blockPnpmDedupe.test.ts b/src/blocks/blockPnpmDedupe.test.ts
new file mode 100644
index 0000000..1c8855e
--- /dev/null
+++ b/src/blocks/blockPnpmDedupe.test.ts
@@ -0,0 +1,65 @@
+import { testBlock } from "bingo-stratum-testers";
+import { describe, expect, test } from "vitest";
+
+import { blockPnpmDedupe } from "./blockPnpmDedupe.js";
+import { optionsBase } from "./options.fakes.js";
+
+describe("blockPnpmDedupe", () => {
+	test("production", () => {
+		const creation = testBlock(blockPnpmDedupe, {
+			options: optionsBase,
+		});
+
+		expect(creation).toMatchInlineSnapshot(`
+			{
+			  "addons": [
+			    {
+			      "addons": {
+			        "sections": {
+			          "Linting": {
+			            "contents": {
+			              "items": [
+			                "- \`pnpm lint:packages\` ([pnpm dedupe --check](https://pnpm.io/cli/dedupe)): Checks for unnecessarily duplicated packages in the \`pnpm-lock.yml\` file",
+			              ],
+			            },
+			          },
+			        },
+			      },
+			      "block": [Function],
+			    },
+			    {
+			      "addons": {
+			        "jobs": [
+			          {
+			            "name": "Lint Packages",
+			            "steps": [
+			              {
+			                "run": "pnpm lint:packages",
+			              },
+			            ],
+			          },
+			        ],
+			        "removedWorkflows": [
+			          "lint-packages",
+			        ],
+			      },
+			      "block": [Function],
+			    },
+			    {
+			      "addons": {
+			        "cleanupCommands": [
+			          "pnpm dedupe",
+			        ],
+			        "properties": {
+			          "scripts": {
+			            "lint:packages": "pnpm dedupe --check",
+			          },
+			        },
+			      },
+			      "block": [Function],
+			    },
+			  ],
+			}
+		`);
+	});
+});