Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 24 additions & 0 deletions .distignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
# Files left out of the release zip built by `npm run release:zip`.
# release:zip never reads .gitignore, and this list replaces its built-in
# default list, so everything not shipped must be listed here.

# Dotfiles, including .env.local and .wp-env.override.json
/.*
/bin/
/coverage/
/docs/
/graphify-out/
/node_modules/
/scripts/
/src/
/tests/
/*.config.js
/*.config.mjs
/*.dist
/AGENTS.md
/CLAUDE.md
/CONTRIBUTING.md
/DEVELOPMENT.md
/composer.lock
/package.json
/package-lock.json
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,9 @@ Thumbs.db
# Build
assets/build/

# Release zips written by `npm run release:zip`
/dist/

# Cache
.phpunit.result.cache

Expand Down
8 changes: 4 additions & 4 deletions docs/local-development.md
Original file line number Diff line number Diff line change
Expand Up @@ -96,11 +96,11 @@ If your host deploys from a build step or a site repository instead, run the fir

`release:zip` packs the working tree as it is on disk and never reads `.gitignore`. That is how the built `vendor/` and `assets/build/` get in, but it also means:

- Without a `.distignore` (the skeleton ships none), only `.git/`, `dist/`, `tests/`, `node_modules/`, `bin/`, `.github/`, `*.config.js` and `package-lock.json` are left out.
- Everything else is packed, including `src/`, `docs/`, `scripts/`, `coverage/`, `graphify-out/` and dotfiles such as the gitignored `.env.local` and `.wp-env.override.json`.
- A `.distignore` replaces that default list rather than extending it, and does not support `!` negation, so it must list everything to leave out.
- The plugin ships a `.distignore` that leaves out development files: dotfiles (including the gitignored `.env.local` and `.wp-env.override.json`), `src/`, `docs/`, `scripts/`, `tests/`, `bin/`, `graphify-out/`, build and lint configs, and the lock files.
- A `.distignore` replaces the built-in default list rather than extending it, and does not support `!` negation, so it must list everything to leave out. Keep it up to date when you add files that should not ship.
- Without a `.distignore`, only `.git/`, `dist/`, `tests/`, `node_modules/`, `bin/`, `.github/`, `*.config.js` and `package-lock.json` would be left out.

Add a `.distignore` before relying on the zip. This one is a good starting point:
The shipped `.distignore`:

```text
# Dotfiles, including .env.local and .wp-env.override.json
Expand Down
Loading