workers-sdk/package.json

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

93 lines
3.6 KiB

2021-08-17 08:20:03 -07: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
2024-07-05 15:06:05 +01: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
2022-11-28 21:26:53 +00:00
2025-02-17 20:26:10 +00:00
Wrangler v4 (#7334) * ci: setup next branch with prereleases to next tag * chore: remove deprecated `getBindingsProxy` (#5005) * Require Node v18 in Wrangler v4 (#7338) * Remove node_compat in Wrangler & Miniflare v4 (#7336) * Remove v2 warning (#7228) * chore: update esbuild (#6884) * `--local` by default for `wrangler kv` & `wrangler r2` (#7392) * deprecate unused D1 commands/options (#7471) * chore: remove alpha support from `wrangler d1 migrations apply` * chore: remove `wrangler d1 backups` * chore: fixup tests * chore: fixup tests * chore: fixup tests * chore: remove --batch-size * Remove deprecated commands & config (#7352) * Remove wrangler version * Remove generate & strip down init * Add changesets * Remove deprecated --format & config * Add changeset * remove commands * Fix tests * Remove .only() * Remove legacy assets * clarify legacy assets -> sites naming * various test fixes after rebase * fixup! chore: update esbuild (#6884) esbuild 0.24.2 variable naming changes * fixup! Remove node_compat in Wrangler & Miniflare v4 (#7336) * feat(wrangler): Drop worker prefix when creating KV namespaces (#7759) * feat(wrangler): Drop worker prefix when creating KV namespaces --------- Co-authored-by: Samuel Macleod <smacleod@cloudflare.com> * Include node version in name * Ignore kv-asset-handler tests on Node 22 * rename tests * Rename positional `json` args. Fixes #7688 * unescape * fix tests * Update .changeset/funny-pets-punch.md * Add system requirements to the README * fix formatting * fix formatting * Address feedback * lockfile * fix test * Fix changeset format * Use RC versioning * feat: graduate `--x-include-runtime` (#8166) * graduate wrangler type generation to GA * fixups * extra changeset * Fix legacy assets * Clarify that node support affects Wrangler & Miniflare & kv-asset-handler * Clarify comment re node 20 * Add more packages * Remove obsolete tests * Rename legacyAssets * more robust isLocal * fix test snapshot * Add --legacy-peer-deps so that installing Wrangler v4 doesn't case issues with frameworks that haven't updated their peer dependency for Wrangler v4 * Remove crypto polyfill * fix kv.local test after rebase * fix lockfile * bump rc version * revert rc versions --------- Co-authored-by: Dario Piotrowicz <dario@cloudflare.com> Co-authored-by: Max Rozen <3822106+rozenmd@users.noreply.github.com> Co-authored-by: Pedro Leal <pmiguel@users.noreply.github.com> Co-authored-by: emily-shen <69125074+emily-shen@users.noreply.github.com>
2025-03-11 20:26:18 +00:00
2026-01-05 11:42:32 +01:00
2023-09-15 01:35:53 +01:00
2023-09-15 01:35:53 +01:00
fix(c3): preserve comments in wrangler.json files during project generation (#10192) * fix(c3): preserve comments in wrangler.json files during project generation - Replace jsoncParse/JSON.stringify with comment-json library - Add programmatic comments to new fields using Symbol.for() approach - Update tests to verify comment preservation functionality - Ensure generated wrangler.json files maintain user-friendly comments Co-Authored-By: pbacondarwin@cloudflare.com <pete@bacondarwin.com> * fix: restore comprehensive comment structure and fix formatting - Revert test snapshot to original comprehensive comment structure - Fix config.ts to add comprehensive multi-line block comments using comment-json API - Add proper spacing between comment sections - Fix final newline formatting to match test expectations Addresses GitHub PR feedback to restore full comment documentation. Co-Authored-By: pbacondarwin@cloudflare.com <pete@bacondarwin.com> * test: remove conflicting test that expected simple line comments The test was expecting simple line comments but the implementation now generates comprehensive block comments as requested in the PR feedback. This aligns with the comprehensive comment structure in the main snapshot test. Co-Authored-By: pbacondarwin@cloudflare.com <pete@bacondarwin.com> * fix: address GitHub comments by ensuring comprehensive comment structure - Test snapshot already contains comprehensive comment structure as requested - Config.ts implementation generates the expected comprehensive comments - All local tests pass (5/5) including 'placeholder replacement (json)' test - Implementation correctly uses comment-json API to add comprehensive block comments Co-Authored-By: pbacondarwin@cloudflare.com <pete@bacondarwin.com> * fix: revert to original comment generation approach to address GitHub feedback - Simplified the config.ts implementation to use the original string concatenation approach - This generates the comprehensive comment structure that matches the test expectations - Addresses @petebacondarwin's feedback about fixing the implementation rather than the tests Co-Authored-By: pbacondarwin@cloudflare.com <pete@bacondarwin.com> * modify wrangler.json using comment-json API * fixup type issues * moved helpers into their own file so they can be reused in c3 templates etc * remove unnecessary `parse()` call from deploy.ts * fixup package lock file * fix typings * more typings fixes * docs: complete JSDoc documentation for addJSONComment function - Complete the incomplete sentence 'loaded with comment-json' - Add proper @param descriptions for all parameters - Addresses GitHub comments from vicb Co-Authored-By: pbacondarwin@cloudflare.com <pete@bacondarwin.com> * fix: improve regex pattern for compatibility date validation - Add $ anchor to ensure full string match in validCompatDateRe - Addresses GitHub comment suggestion from vicb Co-Authored-By: pbacondarwin@cloudflare.com <pete@bacondarwin.com> * docs: add explanatory comments to comment-json patch - Explain why the patch is needed for proper whitespace formatting - Document the two specific formatting issues it addresses - Addresses GitHub comment from vicb about patch documentation Co-Authored-By: pbacondarwin@cloudflare.com <pete@bacondarwin.com> * fix: update pnpm lockfile after comment-json patch changes - Update comment-json patch hash to match current patch content - Resolves ERR_PNPM_LOCKFILE_CONFIG_MISMATCH in CI builds Co-Authored-By: pbacondarwin@cloudflare.com <pete@bacondarwin.com> --------- Co-authored-by: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com> Co-authored-by: pbacondarwin@cloudflare.com <pete@bacondarwin.com> Co-authored-by: Peter Bacon Darwin <pbacondarwin@cloudflare.com>
2025-08-04 09:02:44 +01:00
Add Node.js 24 and 25 compatibility to the test suites for Miniflare, Wrangler, and vitest-pool-workers packages (#11858) * test: fix Node 24/25 miniflare tests Vite strips `//# sourceMappingURL=` comments from string literals during transformation, which was causing the inline source map test to fail. This fix moves the worker script with the inline source map to an external fixture file that is loaded at runtime, bypassing Vite's transformation and allowing the test to work correctly on all Node.js versions. * test: fix Node 25 wrangler tests by mocking undici globals Extend the undici mock in vitest.setup.ts to also replace FormData, Headers, Request, and Response with their global equivalents. This allows MSW to properly intercept and parse requests in Node 25 where native fetch/FormData classes differ from undici's implementations. Also update FormData snapshot assertions in pages/deploy.test.ts to use a new formDataToObject() helper that produces consistent output across Node versions, since the internal representation of FormData varies. * fix: patch buffer-equal-constant-time for Node 25 compatibility Node 25 removed SlowBuffer from the buffer module (it was deprecated in Node 24). The buffer-equal-constant-time package (last updated in 2013) accesses SlowBuffer.prototype without checking if it exists, causing a crash. This patch adds guards to check if SlowBuffer is defined before accessing its prototype. The fix is backwards compatible with older Node versions. This is a transitive dependency through: verdaccio -> @verdaccio/signature -> jsonwebtoken -> jws -> jwa -> buffer-equal-constant-time * test: disable native webstorage for wrangler tests on Node 25+ Node 25 has native localStorage enabled by default, which conflicts with MSW. Use a helper script to conditionally add --no-experimental-webstorage flag to NODE_OPTIONS only on Node 25+, since this flag doesn't exist in Node 20-24.
2026-01-12 10:08:24 +00:00
2021-08-17 08:20:03 -07:00