* chore: add CI validation for external package dependencies
Add a validation check that ensures packages explicitly declare their
external (non-bundled) dependencies to prevent dependency chain poisoning.
- Add tools/deployments/validate-package-dependencies.ts validation script
- Add check:package-deps npm script and integrate into pnpm check
- Create scripts/deps.ts allowlists for packages with external dependencies:
- miniflare (12 deps)
- @cloudflare/vite-plugin (8 deps)
- @cloudflare/vitest-pool-workers (7 deps)
- @cloudflare/kv-asset-handler (1 dep)
- @cloudflare/workers-editor-shared (1 dep)
- Update CONTRIBUTING.md with documentation on managing dependencies
- Add unit tests for the validation logic (22 tests)
* fix(kv-asset-handler): bundle mime dependency instead of keeping it external
Move mime from dependencies to devDependencies so it gets bundled into
the distributable. This follows the project's practice of bundling
dependencies to prevent dependency chain poisoning.
* fix(miniflare): bundle acorn and acorn-walk dependencies
Move acorn and acorn-walk from dependencies to devDependencies so they
get bundled into the distributable. These are pure JavaScript parsing
libraries with no special runtime requirements, so they can be safely
bundled.
* chore: bundle more dependencies to reduce supply chain risk
Move 13 dependencies from dependencies to devDependencies so they get
bundled into the distributed packages rather than being installed as
transitive dependencies by users.
Packages updated:
- miniflare: bundle exit-hook, glob-to-regexp, stoppable, youch
- @cloudflare/vitest-pool-workers: bundle birpc, devalue, get-port, semver
- @cloudflare/vite-plugin: bundle @remix-run/node-fetch-server, defu,
get-port, picocolors, tinyglobby
Also updates the EXTERNAL_DEPENDENCIES comments to explain WHY each
remaining dependency cannot be bundled (native binaries, optional native
bindings, runtime resolution needs) rather than just describing how
they are used.
* fix(vitest-pool-workers): bundle dependencies that were moved to devDependencies
* chore: add changeset for dependency bundling
* fixup: remove unnecessary stuff from CONTRIBUTING
* Get Claude to review changesets
* Run on pull_reuest_target
* Extract changeset rules into readme
* Use GitHub API instead of checking out PR code
This avoids the CodeQL security warning about checking out untrusted
code in a privileged workflow. Claude now uses `gh` CLI to inspect
PR contents via the API instead of having the files on disk.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
* Add changeset guidelines to CLAUDE.md
Reference the detailed guidelines in .changeset/README.md and document
the preferred workflow using `pnpm changeset add --empty`.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
* Format
* Apply suggestions from code review
Co-authored-by: Pete Bacon Darwin <pete@bacondarwin.com>
* Address review feedback
- Add note about automatic dependency releases (no need to include dependent packages)
- Add CI-only changes to list of things not requiring changesets
- Call out that experimental features should be mentioned in changeset descriptions
- Remove unnecessary id-token permission
- Update prompt to note major version constraints from README
- Instruct Claude to fail the check (exit 1) for blocking issues
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
* Address additional review feedback
- Change 'workspaces' to 'packages' in README (fixtures aren't relevant)
- Add note that breaking changes to experimental features are not major
- Add use_sticky_comment to avoid multiple comments on the same PR
- Keep direct_prompt (verified correct for beta version)
- Keep GH_TOKEN env for gh CLI compatibility
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
* Migrate to claude-code-action v1
- Change @beta to @v1
- Change direct_prompt to prompt (per migration guide)
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
---------
Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com>
Co-authored-by: Pete Bacon Darwin <pete@bacondarwin.com>
* Update CONTRIBUTING.md
* Apply suggestion from @ascorbic
Co-authored-by: Matt Kane <m@mk.gg>
---------
Co-authored-by: Pete Bacon Darwin <pete@bacondarwin.com>
Co-authored-by: Matt Kane <m@mk.gg>
in the CONTRIBUTING.md document clarify the fact that any account
can be used to create an API token for the tests (instead of suggesting
to use DevProd Testing account alongise saying that other accounts can be
used as well)
as part of this remove the unnecessary validation check that ensures
that the account being used for the tests is the DevProd Testing one
(since this is not really necessary)
It is not necessary to create a changeset for the hotfix, this would only trigger another release of the package during the next normal release process. If such a release is necessary it would be triggered by the existence of a changeset for the feature/fix that needs releasing.
What is important is that the version in package.json is equal to the latest released version of the package. If it is behind then any changesets for that package that should trigger a release may only bump the version to the hotfix release version and so would not actually trigger a release of that package.
* add e2e tests for Versions
* add how to run e2e tests locally to CONTRIBUTING.md
* fix: don't print `undefined` in spinner.stop in non-interactive environments
* Rename and improve docs around Preview Playground Worker integration test workflow
* Remove workflows that deployed Workers to production
These implemented the `deploy-worker/...` branch approach
which is being replaced.
* Update Pages preview deployment workflows
The reusable action has been removed and the workflow simplified.
It is no longer triggered by changes to `main`, since that will be handled by changesets going forward.
* Implement non-npm package deployments via changesets
* Remove deployment of pre-release Worker from the pre-release workflow
This should now be handled by changesets
* Update Github Actions docs
* Ensure C3 e2e tests run on PRs and main
* fixup! Update Github Actions docs
* fixup! Implement non-npm package deployments via changesets
* fixup! Implement non-npm package deployments via changesets
* Turborepo
- Turbo Workspaces: isolated tasks and localized pipelines more complex packages to exist in the monorepo.
- Persistent mode for dev keyword let's Turborepo know it's something that will be watched or run long term.
- Update all packages with namespaced ones for configs
- Namespacing TSConfig & ESlint with `@Cloudflare/` per security suggestion by Greg Brimble
* ESLint and TSConfig Monorepo Configuration
- ESLint & TSConfig are local packages, the monorepo now isolates its configs to packages utilizing them,
configurations are now monorepo packages
- Type Checking TypeScript can now directly
use the TSConfig which infers from valid TS config formats, since we are using Monorepo conventions each
package only needs to care about its own config specifics and the extended global config as a package.
- Wrangler Emit TSConfig: Figure out if this can be part of the TurboRepo pipeline then move this into the workers-
tsconfig package as "wrangler-emit"
- TurboRepo setup to work with TypeScript subdirectories as TS projects & added configs to more fixtures
- Instructions for VSCode TypeScript Project Version
- ESLint & Turbo require the `.` declared where to run monorepo tasks from each package
* Dependencies
- Adding Wrangler as direct Dependency for Fixtures that need it
- Standardize Monorepo packaging in Fixtures
- All Wrangler dependencies are now devDependency
* Vitest
- Update Vitest & remove global Vitest config
- Added Vitest script for explicit test:watch
- Refactor pages-simple-assets test
- Fix tests in fixtures (thanks @petebacondarwin)
* feature: rename `publish` command to `deploy` and alias
This renames `wrangler (pages) publish` to `wrangler (pages) deploy`,
and adds a deprecated alias for `publish`. We'll remove this alias
in Wrangler 4.
* fixup! feature: rename `publish` command to `deploy` and alias
Rename `publish` directory too
* fixup! feature: rename `publish` command to `deploy` and alias
Fix import order lint errors
* First version of D1 support in Wrangler
* Bumped to miniflare v2.9.0
* Changes based on PR feedback
* Added clarifying comment to performApiFetch
* Cast Request objects in test to avoid typing issue
* moved npx-import to be a dev dep, since it is bundled
* added comment to readableRelative
* added Beta warning message on all D1 commands (and --help)
* adding d1_database to the safe bindings list
* Added D1 warning, and env var to silence it, on detecting D1 bindings
* updated changeset
Co-authored-by: Glen Maddern <glen@cloudflare.com>
Co-authored-by: Pete Bacon Darwin <pete@bacondarwin.com>
Watch the files in the wrangler workspace, and run the tests when anything changes:
```sh
> npm run test-watch -w wrangler
```
This will also run all the tests in a single process (rather than in parallel shards) and will increase the test-timeout to 50 seconds, which is helpful when debugging.
- Run the project checks in parallel
This should speed up CI by running the checks at the same time.
It doesn't give the possible 5x improvement because of the limited CI resources.
- Add npm cache to Github action cache
As well as caching node_modules we now also cache `~/.npm`, which will speed up cases where the dependencies have changed.
- Run tests independently of other checks
- Use incremental TS builds when type checking
- Use eslint cache