Exclude .next & include .gitignore (#757)

This commit is contained in:
Will Chen
2025-07-31 14:25:21 -07:00
committed by GitHub
parent a6e0ea2f73
commit 7938b69eca
26 changed files with 416 additions and 27 deletions

View File

@@ -332,7 +332,31 @@ You need to first add Supabase to your app and then we can add auth.
=== ===
role: user role: user
message: This is my codebase. <dyad-file path=".gitignore"> message: This is my codebase. <dyad-file path=".gitignore">
// File contents excluded from context # Logs
logs
*.log
npm-debug.log*
yarn-debug.log*
yarn-error.log*
pnpm-debug.log*
lerna-debug.log*
node_modules
dist
dist-ssr
*.local
# Editor directories and files
.vscode/*
!.vscode/extensions.json
.idea
.DS_Store
*.suo
*.ntvs*
*.njsproj
*.sln
*.sw?
</dyad-file> </dyad-file>
<dyad-file path="file1.txt"> <dyad-file path="file1.txt">

View File

@@ -149,7 +149,31 @@ You need to first add Supabase to your app and then we can add auth.
=== ===
role: user role: user
message: This is my codebase. <dyad-file path=".gitignore"> message: This is my codebase. <dyad-file path=".gitignore">
// File contents excluded from context # Logs
logs
*.log
npm-debug.log*
yarn-debug.log*
yarn-error.log*
pnpm-debug.log*
lerna-debug.log*
node_modules
dist
dist-ssr
*.local
# Editor directories and files
.vscode/*
!.vscode/extensions.json
.idea
.DS_Store
*.suo
*.ntvs*
*.njsproj
*.sln
*.sw?
</dyad-file> </dyad-file>
<dyad-file path="file1.txt"> <dyad-file path="file1.txt">

View File

@@ -332,7 +332,31 @@ You need to first add Supabase to your app and then we can add auth.
=== ===
role: user role: user
message: This is my codebase. <dyad-file path=".gitignore"> message: This is my codebase. <dyad-file path=".gitignore">
// File contents excluded from context # Logs
logs
*.log
npm-debug.log*
yarn-debug.log*
yarn-error.log*
pnpm-debug.log*
lerna-debug.log*
node_modules
dist
dist-ssr
*.local
# Editor directories and files
.vscode/*
!.vscode/extensions.json
.idea
.DS_Store
*.suo
*.ntvs*
*.njsproj
*.sln
*.sw?
</dyad-file> </dyad-file>
<dyad-file path="file1.txt"> <dyad-file path="file1.txt">

View File

@@ -334,7 +334,31 @@ You need to first add Supabase to your app and then we can add auth.
=== ===
role: user role: user
message: This is my codebase. <dyad-file path=".gitignore"> message: This is my codebase. <dyad-file path=".gitignore">
// File contents excluded from context # Logs
logs
*.log
npm-debug.log*
yarn-debug.log*
yarn-error.log*
pnpm-debug.log*
lerna-debug.log*
node_modules
dist
dist-ssr
*.local
# Editor directories and files
.vscode/*
!.vscode/extensions.json
.idea
.DS_Store
*.suo
*.ntvs*
*.njsproj
*.sln
*.sw?
</dyad-file> </dyad-file>
<dyad-file path="AI_RULES.md"> <dyad-file path="AI_RULES.md">

View File

@@ -334,7 +334,31 @@ You need to first add Supabase to your app and then we can add auth.
=== ===
role: user role: user
message: This is my codebase. <dyad-file path=".gitignore"> message: This is my codebase. <dyad-file path=".gitignore">
// File contents excluded from context # Logs
logs
*.log
npm-debug.log*
yarn-debug.log*
yarn-error.log*
pnpm-debug.log*
lerna-debug.log*
node_modules
dist
dist-ssr
*.local
# Editor directories and files
.vscode/*
!.vscode/extensions.json
.idea
.DS_Store
*.suo
*.ntvs*
*.njsproj
*.sln
*.sw?
</dyad-file> </dyad-file>
<dyad-file path="AI_RULES.md"> <dyad-file path="AI_RULES.md">

View File

@@ -334,7 +334,31 @@ You need to first add Supabase to your app and then we can add auth.
=== ===
role: user role: user
message: This is my codebase. <dyad-file path=".gitignore"> message: This is my codebase. <dyad-file path=".gitignore">
// File contents excluded from context # Logs
logs
*.log
npm-debug.log*
yarn-debug.log*
yarn-error.log*
pnpm-debug.log*
lerna-debug.log*
node_modules
dist
dist-ssr
*.local
# Editor directories and files
.vscode/*
!.vscode/extensions.json
.idea
.DS_Store
*.suo
*.ntvs*
*.njsproj
*.sln
*.sw?
</dyad-file> </dyad-file>
<dyad-file path="AI_RULES.md"> <dyad-file path="AI_RULES.md">

View File

@@ -334,7 +334,31 @@ You need to first add Supabase to your app and then we can add auth.
=== ===
role: user role: user
message: This is my codebase. <dyad-file path=".gitignore"> message: This is my codebase. <dyad-file path=".gitignore">
// File contents excluded from context # Logs
logs
*.log
npm-debug.log*
yarn-debug.log*
yarn-error.log*
pnpm-debug.log*
lerna-debug.log*
node_modules
dist
dist-ssr
*.local
# Editor directories and files
.vscode/*
!.vscode/extensions.json
.idea
.DS_Store
*.suo
*.ntvs*
*.njsproj
*.sln
*.sw?
</dyad-file> </dyad-file>
<dyad-file path="AI_RULES.md"> <dyad-file path="AI_RULES.md">

View File

@@ -334,7 +334,31 @@ You need to first add Supabase to your app and then we can add auth.
=== ===
role: user role: user
message: This is my codebase. <dyad-file path=".gitignore"> message: This is my codebase. <dyad-file path=".gitignore">
// File contents excluded from context # Logs
logs
*.log
npm-debug.log*
yarn-debug.log*
yarn-error.log*
pnpm-debug.log*
lerna-debug.log*
node_modules
dist
dist-ssr
*.local
# Editor directories and files
.vscode/*
!.vscode/extensions.json
.idea
.DS_Store
*.suo
*.ntvs*
*.njsproj
*.sln
*.sw?
</dyad-file> </dyad-file>
<dyad-file path="AI_RULES.md"> <dyad-file path="AI_RULES.md">

View File

@@ -23,7 +23,7 @@
"files": [ "files": [
{ {
"path": ".gitignore", "path": ".gitignore",
"content": "// File contents excluded from context", "content": "# Logs\nlogs\n*.log\nnpm-debug.log*\nyarn-debug.log*\nyarn-error.log*\npnpm-debug.log*\nlerna-debug.log*\n\nnode_modules\ndist\ndist-ssr\n*.local\n\n# Editor directories and files\n.vscode/*\n!.vscode/extensions.json\n.idea\n.DS_Store\n*.suo\n*.ntvs*\n*.njsproj\n*.sln\n*.sw?\n",
"force": false "force": false
}, },
{ {

View File

@@ -18,7 +18,7 @@
"files": [ "files": [
{ {
"path": ".gitignore", "path": ".gitignore",
"content": "// File contents excluded from context", "content": "# Logs\nlogs\n*.log\nnpm-debug.log*\nyarn-debug.log*\nyarn-error.log*\npnpm-debug.log*\nlerna-debug.log*\n\nnode_modules\ndist\ndist-ssr\n*.local\n\n# Editor directories and files\n.vscode/*\n!.vscode/extensions.json\n.idea\n.DS_Store\n*.suo\n*.ntvs*\n*.njsproj\n*.sln\n*.sw?\n",
"force": false "force": false
}, },
{ {

View File

@@ -18,7 +18,7 @@
"files": [ "files": [
{ {
"path": ".gitignore", "path": ".gitignore",
"content": "// File contents excluded from context", "content": "# Logs\nlogs\n*.log\nnpm-debug.log*\nyarn-debug.log*\nyarn-error.log*\npnpm-debug.log*\nlerna-debug.log*\n\nnode_modules\ndist\ndist-ssr\n*.local\n\n# Editor directories and files\n.vscode/*\n!.vscode/extensions.json\n.idea\n.DS_Store\n*.suo\n*.ntvs*\n*.njsproj\n*.sln\n*.sw?\n",
"force": false "force": false
}, },
{ {

View File

@@ -23,7 +23,7 @@
"files": [ "files": [
{ {
"path": ".gitignore", "path": ".gitignore",
"content": "// File contents excluded from context", "content": "# Logs\nlogs\n*.log\nnpm-debug.log*\nyarn-debug.log*\nyarn-error.log*\npnpm-debug.log*\nlerna-debug.log*\n\nnode_modules\ndist\ndist-ssr\n*.local\n\n# Editor directories and files\n.vscode/*\n!.vscode/extensions.json\n.idea\n.DS_Store\n*.suo\n*.ntvs*\n*.njsproj\n*.sln\n*.sw?\n",
"force": false "force": false
}, },
{ {

View File

@@ -23,7 +23,7 @@
"files": [ "files": [
{ {
"path": ".gitignore", "path": ".gitignore",
"content": "// File contents excluded from context", "content": "# Logs\nlogs\n*.log\nnpm-debug.log*\nyarn-debug.log*\nyarn-error.log*\npnpm-debug.log*\nlerna-debug.log*\n\nnode_modules\ndist\ndist-ssr\n*.local\n\n# Editor directories and files\n.vscode/*\n!.vscode/extensions.json\n.idea\n.DS_Store\n*.suo\n*.ntvs*\n*.njsproj\n*.sln\n*.sw?\n",
"force": false "force": false
}, },
{ {

File diff suppressed because one or more lines are too long

View File

@@ -318,7 +318,31 @@ You need to first add Supabase to your app and then we can add auth.
=== ===
role: user role: user
message: This is my codebase. <dyad-file path=".gitignore"> message: This is my codebase. <dyad-file path=".gitignore">
// File contents excluded from context # Logs
logs
*.log
npm-debug.log*
yarn-debug.log*
yarn-error.log*
pnpm-debug.log*
lerna-debug.log*
node_modules
dist
dist-ssr
*.local
# Editor directories and files
.vscode/*
!.vscode/extensions.json
.idea
.DS_Store
*.suo
*.ntvs*
*.njsproj
*.sln
*.sw?
</dyad-file> </dyad-file>
<dyad-file path="AI_RULES.md"> <dyad-file path="AI_RULES.md">

View File

@@ -332,7 +332,31 @@ You need to first add Supabase to your app and then we can add auth.
=== ===
role: user role: user
message: This is my codebase. <dyad-file path=".gitignore"> message: This is my codebase. <dyad-file path=".gitignore">
// File contents excluded from context # Logs
logs
*.log
npm-debug.log*
yarn-debug.log*
yarn-error.log*
pnpm-debug.log*
lerna-debug.log*
node_modules
dist
dist-ssr
*.local
# Editor directories and files
.vscode/*
!.vscode/extensions.json
.idea
.DS_Store
*.suo
*.ntvs*
*.njsproj
*.sln
*.sw?
</dyad-file> </dyad-file>
<dyad-file path="file1.txt"> <dyad-file path="file1.txt">

View File

@@ -318,7 +318,31 @@ You need to first add Supabase to your app and then we can add auth.
=== ===
role: user role: user
message: This is my codebase. <dyad-file path=".gitignore"> message: This is my codebase. <dyad-file path=".gitignore">
// File contents excluded from context # Logs
logs
*.log
npm-debug.log*
yarn-debug.log*
yarn-error.log*
pnpm-debug.log*
lerna-debug.log*
node_modules
dist
dist-ssr
*.local
# Editor directories and files
.vscode/*
!.vscode/extensions.json
.idea
.DS_Store
*.suo
*.ntvs*
*.njsproj
*.sln
*.sw?
</dyad-file> </dyad-file>
<dyad-file path="AI_RULES.md"> <dyad-file path="AI_RULES.md">

View File

@@ -318,7 +318,31 @@ You need to first add Supabase to your app and then we can add auth.
=== ===
role: user role: user
message: This is my codebase. <dyad-file path=".gitignore"> message: This is my codebase. <dyad-file path=".gitignore">
// File contents excluded from context # Logs
logs
*.log
npm-debug.log*
yarn-debug.log*
yarn-error.log*
pnpm-debug.log*
lerna-debug.log*
node_modules
dist
dist-ssr
*.local
# Editor directories and files
.vscode/*
!.vscode/extensions.json
.idea
.DS_Store
*.suo
*.ntvs*
*.njsproj
*.sln
*.sw?
</dyad-file> </dyad-file>
<dyad-file path="AI_RULES.md"> <dyad-file path="AI_RULES.md">

View File

@@ -318,7 +318,31 @@ You need to first add Supabase to your app and then we can add auth.
=== ===
role: user role: user
message: This is my codebase. <dyad-file path=".gitignore"> message: This is my codebase. <dyad-file path=".gitignore">
// File contents excluded from context # Logs
logs
*.log
npm-debug.log*
yarn-debug.log*
yarn-error.log*
pnpm-debug.log*
lerna-debug.log*
node_modules
dist
dist-ssr
*.local
# Editor directories and files
.vscode/*
!.vscode/extensions.json
.idea
.DS_Store
*.suo
*.ntvs*
*.njsproj
*.sln
*.sw?
</dyad-file> </dyad-file>
<dyad-file path="AI_RULES.md"> <dyad-file path="AI_RULES.md">

View File

@@ -318,7 +318,31 @@ You need to first add Supabase to your app and then we can add auth.
=== ===
role: user role: user
message: This is my codebase. <dyad-file path=".gitignore"> message: This is my codebase. <dyad-file path=".gitignore">
// File contents excluded from context # Logs
logs
*.log
npm-debug.log*
yarn-debug.log*
yarn-error.log*
pnpm-debug.log*
lerna-debug.log*
node_modules
dist
dist-ssr
*.local
# Editor directories and files
.vscode/*
!.vscode/extensions.json
.idea
.DS_Store
*.suo
*.ntvs*
*.njsproj
*.sln
*.sw?
</dyad-file> </dyad-file>
<dyad-file path="AI_RULES.md"> <dyad-file path="AI_RULES.md">

View File

@@ -318,7 +318,31 @@ You need to first add Supabase to your app and then we can add auth.
=== ===
role: user role: user
message: This is my codebase. <dyad-file path=".gitignore"> message: This is my codebase. <dyad-file path=".gitignore">
// File contents excluded from context # Logs
logs
*.log
npm-debug.log*
yarn-debug.log*
yarn-error.log*
pnpm-debug.log*
lerna-debug.log*
node_modules
dist
dist-ssr
*.local
# Editor directories and files
.vscode/*
!.vscode/extensions.json
.idea
.DS_Store
*.suo
*.ntvs*
*.njsproj
*.sln
*.sw?
</dyad-file> </dyad-file>
<dyad-file path="AI_RULES.md"> <dyad-file path="AI_RULES.md">

View File

@@ -318,7 +318,31 @@ You need to first add Supabase to your app and then we can add auth.
=== ===
role: user role: user
message: This is my codebase. <dyad-file path=".gitignore"> message: This is my codebase. <dyad-file path=".gitignore">
// File contents excluded from context # Logs
logs
*.log
npm-debug.log*
yarn-debug.log*
yarn-error.log*
pnpm-debug.log*
lerna-debug.log*
node_modules
dist
dist-ssr
*.local
# Editor directories and files
.vscode/*
!.vscode/extensions.json
.idea
.DS_Store
*.suo
*.ntvs*
*.njsproj
*.sln
*.sw?
</dyad-file> </dyad-file>
<dyad-file path="AI_RULES.md"> <dyad-file path="AI_RULES.md">

View File

@@ -31,7 +31,7 @@
"files": [ "files": [
{ {
"path": ".gitignore", "path": ".gitignore",
"content": "// File contents excluded from context", "content": "# Logs\nlogs\n*.log\nnpm-debug.log*\nyarn-debug.log*\nyarn-error.log*\npnpm-debug.log*\nlerna-debug.log*\n\nnode_modules\ndist\ndist-ssr\n*.local\n\n# Editor directories and files\n.vscode/*\n!.vscode/extensions.json\n.idea\n.DS_Store\n*.suo\n*.ntvs*\n*.njsproj\n*.sln\n*.sw?\n",
"force": false "force": false
}, },
{ {

View File

@@ -39,7 +39,7 @@
"files": [ "files": [
{ {
"path": ".gitignore", "path": ".gitignore",
"content": "// File contents excluded from context", "content": "# Logs\nlogs\n*.log\nnpm-debug.log*\nyarn-debug.log*\nyarn-error.log*\npnpm-debug.log*\nlerna-debug.log*\n\nnode_modules\ndist\ndist-ssr\n*.local\n\n# Editor directories and files\n.vscode/*\n!.vscode/extensions.json\n.idea\n.DS_Store\n*.suo\n*.ntvs*\n*.njsproj\n*.sln\n*.sw?\n",
"force": false "force": false
}, },
{ {

View File

@@ -47,7 +47,7 @@
"files": [ "files": [
{ {
"path": ".gitignore", "path": ".gitignore",
"content": "// File contents excluded from context", "content": "# Logs\nlogs\n*.log\nnpm-debug.log*\nyarn-debug.log*\nyarn-error.log*\npnpm-debug.log*\nlerna-debug.log*\n\nnode_modules\ndist\ndist-ssr\n*.local\n\n# Editor directories and files\n.vscode/*\n!.vscode/extensions.json\n.idea\n.DS_Store\n*.suo\n*.ntvs*\n*.njsproj\n*.sln\n*.sw?\n",
"force": false "force": false
}, },
{ {

View File

@@ -44,13 +44,18 @@ const ALLOWED_EXTENSIONS = [
]; ];
// Directories to always exclude // Directories to always exclude
const EXCLUDED_DIRS = ["node_modules", ".git", "dist", "build"]; // Normally these files are excluded by the gitignore, but sometimes
// people don't have their gitignore setup correctly so we want to
// be conservative and never include these directories.
//
// ex: https://github.com/dyad-sh/dyad/issues/727
const EXCLUDED_DIRS = ["node_modules", ".git", "dist", "build", ".next"];
// Files to always exclude // Files to always exclude
const EXCLUDED_FILES = ["pnpm-lock.yaml", "package-lock.json"]; const EXCLUDED_FILES = ["pnpm-lock.yaml", "package-lock.json"];
// Files to always include, regardless of extension // Files to always include, regardless of extension
const ALWAYS_INCLUDE_FILES = ["package.json"]; const ALWAYS_INCLUDE_FILES = ["package.json", ".gitignore"];
// File patterns to omit (contents will be replaced with a placeholder) // File patterns to omit (contents will be replaced with a placeholder)
// //