Skip to content

fix: ship a correct .gitignore to generated projects#123

Merged
markshust merged 1 commit into
developfrom
feature/skeleton-ship-gitignore-track-lock
Jun 23, 2026
Merged

fix: ship a correct .gitignore to generated projects#123
markshust merged 1 commit into
developfrom
feature/skeleton-ship-gitignore-track-lock

Conversation

@markshust

Copy link
Copy Markdown
Collaborator

Problem

The skeleton's .gitattributes marked /.gitignore as export-ignore, so composer create-project marko/skeleton stripped it from the dist archive. Every generated project shipped without a .gitignore at all — leaving vendor/ (~3,500 files), node_modules/, build artifacts and runtime state untracked and trivial to commit by accident. Confirmed on a fresh marko/skeleton project where vendor/ landed in the initial commit.

Changes

  • .gitattributes — remove the /.gitignore export-ignore rule 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 the storage:link symlink
    • Drop composer.lock — application projects must commit their lock file for reproducible, repeatable installs across the team.
  • PackageStructureTest — new regression guards: .gitignore is shipped (not export-ignored), composer.lock stays tracked, dependency/build dirs are ignored, and storage/ runtime contents are ignored while .gitkeep is preserved.

Notes

  • .claude/ (written by devai) is intentionally left tracked — it's shared team agent config, and is the devai package's domain, not the skeleton's.
  • Existing projects created from the old skeleton won't be retroactively fixed; this only affects newly generated projects.

Test plan

  • pest packages/skeleton/tests/PackageStructureTest.php — 20 passed (37 assertions)
  • phpcs clean on touched files

🤖 Generated with Claude Code

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>
@github-actions github-actions Bot added the bug Something isn't working label Jun 23, 2026
@markshust markshust merged commit 81a5273 into develop Jun 23, 2026
1 check passed
@markshust markshust deleted the feature/skeleton-ship-gitignore-track-lock branch June 23, 2026 16:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant