From 6c830f9658c87a696027e02272eac72b40e82804 Mon Sep 17 00:00:00 2001 From: AnuragVasanwala <75766877+AnuragVasanwala@users.noreply.github.com> Date: Fri, 2 Oct 2026 01:50:05 +0530 Subject: [PATCH] fix(release): ship a .distignore so release:zip packs only the plugin release:zip never reads .gitignore and its default list leaves out only a few paths, so the zip carried .env.local, .claude/, docs/, src/, graphify-out/ and the lint and test configs. Add the .distignore the docs already recommend, update the docs to say it ships, and gitignore dist/. --- .distignore | 24 ++++++++++++++++++++++++ .gitignore | 3 +++ docs/local-development.md | 8 ++++---- 3 files changed, 31 insertions(+), 4 deletions(-) create mode 100644 .distignore diff --git a/.distignore b/.distignore new file mode 100644 index 0000000..a49a3a4 --- /dev/null +++ b/.distignore @@ -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 diff --git a/.gitignore b/.gitignore index 63635c5..f163d47 100644 --- a/.gitignore +++ b/.gitignore @@ -26,6 +26,9 @@ Thumbs.db # Build assets/build/ +# Release zips written by `npm run release:zip` +/dist/ + # Cache .phpunit.result.cache diff --git a/docs/local-development.md b/docs/local-development.md index c33309c..295c8bb 100644 --- a/docs/local-development.md +++ b/docs/local-development.md @@ -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