fix: ship a correct .gitignore to generated projects#123
Merged
Conversation
The skeleton's .gitattributes export-ignored .gitignore, so composer create-project stripped it from the dist archive and every generated project shipped without one — leaving vendor/, node_modules/, build artifacts and runtime state untracked and easy to commit by accident (e.g. the 3,500-file vendor/ dir). Changes: - Remove the .gitignore export-ignore rule so it lands in new projects. - Expand .gitignore to cover everything the framework generates: /vendor/, /node_modules/, /.marko/ runtime state, /storage/* runtime output (keeping /storage/.gitkeep), and the Vite/storage-link artifacts /public/build, /public/hot, /public/storage. - Drop composer.lock from .gitignore: application projects must commit their lock file for reproducible, repeatable team installs. Add PackageStructureTest guards covering: .gitignore is shipped (not export-ignored), composer.lock stays tracked, the dependency/build directories are ignored, and storage runtime contents are ignored while .gitkeep preserves the directory. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
The skeleton's
.gitattributesmarked/.gitignoreasexport-ignore, socomposer create-project marko/skeletonstripped it from the dist archive. Every generated project shipped without a.gitignoreat all — leavingvendor/(~3,500 files),node_modules/, build artifacts and runtime state untracked and trivial to commit by accident. Confirmed on a freshmarko/skeletonproject wherevendor/landed in the initial commit.Changes
.gitattributes— remove the/.gitignore export-ignorerule so the ignore file actually lands in new projects. The other export-ignore rules (/tests,/.github,/phpunit.xml.dist,/.gitattributes) are package-development files and correctly stay stripped..gitignore— expand to cover everything the framework generates:/vendor/,/node_modules/— dependency install output/.marko/— framework runtime state (dev-server PIDs, code-index cache, devai marker)/storage/*+!/storage/.gitkeep— runtime cache/logs/debugbar output, keeping the directory on a fresh clone/public/build,/public/hot,/public/storage— Vite assets, HMR marker, and thestorage:linksymlinkcomposer.lock— application projects must commit their lock file for reproducible, repeatable installs across the team.PackageStructureTest— new regression guards:.gitignoreis shipped (not export-ignored),composer.lockstays tracked, dependency/build dirs are ignored, andstorage/runtime contents are ignored while.gitkeepis preserved.Notes
.claude/(written bydevai) is intentionally left tracked — it's shared team agent config, and is thedevaipackage's domain, not the skeleton's.Test plan
pest packages/skeleton/tests/PackageStructureTest.php— 20 passed (37 assertions)phpcsclean on touched files🤖 Generated with Claude Code