From 8cac0f157066f1925febf2b5dc4495667b6a64a6 Mon Sep 17 00:00:00 2001 From: Janka Uryga Date: Wed, 7 Aug 2024 13:45:58 +0200 Subject: [PATCH] chore(next-swc): avoid deleting .gitignore when running "clean" script (#68624) ### What/Why Running `pnpm clean` always removes the `packages/next-swc/native/.gitignore` file in `next-swc`, which is annoying because that's meant to stay checked in. This PR moves the `.gitignore` file out from the `native` directory to avoid this. How to reproduce this problem: ```console $ pnpm clean $ git status Changes not staged for commit: (use "git add/rm ..." to update what will be committed) (use "git restore ..." to discard changes in working directory) deleted: packages/next-swc/native/.gitignore ``` This is because the `clean` script just removes the entire `native` directory: https://github.com/vercel/next.js/blob/a5e2a02f5a988d50a35fc2932b069dff5200e2c6/packages/next-swc/package.json#L6 so moving the `.gitignore` file out from there avoids this. --- packages/next-swc/.gitignore | 2 ++ packages/next-swc/native/.gitignore | 4 ---- 2 files changed, 2 insertions(+), 4 deletions(-) create mode 100644 packages/next-swc/.gitignore delete mode 100644 packages/next-swc/native/.gitignore diff --git a/packages/next-swc/.gitignore b/packages/next-swc/.gitignore new file mode 100644 index 0000000000000..ce954f85c7014 --- /dev/null +++ b/packages/next-swc/.gitignore @@ -0,0 +1,2 @@ +# Ignore build artifacts +native/* diff --git a/packages/next-swc/native/.gitignore b/packages/next-swc/native/.gitignore deleted file mode 100644 index 86d0cb2726c6c..0000000000000 --- a/packages/next-swc/native/.gitignore +++ /dev/null @@ -1,4 +0,0 @@ -# Ignore everything in this directory -* -# Except this file -!.gitignore \ No newline at end of file