From 2c14c2d5798068b1f49fc1aad9eb5b9ab23441e6 Mon Sep 17 00:00:00 2001 From: John Reilly Date: Sat, 24 Aug 2024 17:52:59 +0100 Subject: [PATCH] fix: exclude tests with.npmignore (#1637) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ## PR Checklist - [x] Addresses an existing open issue: fixes #1629 - [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 Doing this on a mobile phone on a train. It can never work, can it? --- .npmignore | 1 + src/steps/writing/creation/rootFiles.ts | 1 + 2 files changed, 2 insertions(+) create mode 100644 .npmignore diff --git a/.npmignore b/.npmignore new file mode 100644 index 000000000..9db083158 --- /dev/null +++ b/.npmignore @@ -0,0 +1 @@ +*.test.* diff --git a/src/steps/writing/creation/rootFiles.ts b/src/steps/writing/creation/rootFiles.ts index c5ea67ed4..9c9229401 100644 --- a/src/steps/writing/creation/rootFiles.ts +++ b/src/steps/writing/creation/rootFiles.ts @@ -25,6 +25,7 @@ export async function createRootFiles(options: Options) { "node_modules/", ]), }), + ".npmignore": `*.test.*\n`, ".nvmrc": `20.12.2\n`, ".prettierignore": formatIgnoreFile([ ...(options.excludeAllContributors ? [] : [".all-contributorsrc"]),