workers-sdk/CONTRIBUTING.md

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

476 lines
22 KiB

2024-09-13 12:43:58 +03:00
2025-09-10 12:32:03 +01:00
2024-09-13 12:43:58 +03:00
2024-09-13 12:43:58 +03:00
2024-09-13 12:43:58 +03:00
Turborepo Implementation & Monorepo standardization (#3261) * 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)
2023-06-12 12:57:01 -05:00
Turborepo Implementation & Monorepo standardization (#3261) * 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)
2023-06-12 12:57:01 -05:00
2023-02-23 12:08:52 +00:00
2025-01-29 13:27:02 +00:00
2025-01-29 13:27:02 +00:00
2024-11-05 18:33:48 +00:00
2024-11-05 18:33:48 +00:00
2024-11-05 18:33:48 +00:00
2024-11-05 18:33:48 +00:00
chore: add CI validation for external package dependencies (#11898) * 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
2026-01-14 21:11:35 +00:00
ci: use Claude to review changesets (#11599) * 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>
2025-12-11 14:54:57 +00:00
ci: use Claude to review changesets (#11599) * 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>
2025-12-11 14:54:57 +00:00
ci: use Claude to review changesets (#11599) * 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>
2025-12-11 14:54:57 +00:00
ci: use Claude to review changesets (#11599) * 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>
2025-12-11 14:54:57 +00:00