Skip to content

Commit

Permalink
chore(next-swc): avoid deleting .gitignore when running "clean" script (
Browse files Browse the repository at this point in the history
#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
<snip>

$ git status
<snip>
Changes not staged for commit:
  (use "git add/rm <file>..." to update what will be committed)
  (use "git restore <file>..." 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.
  • Loading branch information
lubieowoce committed Aug 7, 2024
1 parent 27ca3ac commit 8cac0f1
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 4 deletions.
2 changes: 2 additions & 0 deletions packages/next-swc/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
# Ignore build artifacts
native/*
4 changes: 0 additions & 4 deletions packages/next-swc/native/.gitignore

This file was deleted.

0 comments on commit 8cac0f1

Please sign in to comment.