sailfork / t3code-github / .repos/ alchemy-effect/ packages/ cloudflare-runtime/ src/ internal/ workers-shared
.repos/alchemy-effect/packages/cloudflare-runtime/src/internal/workers-shared/README.md
@distilled.cloud/vendor-workers-shared
Private workspace package vendoring raw TypeScript source from
@cloudflare/workers-shared.
This package does not bundle or publish; consumer packages in this monorepo
import the .ts files directly and apply their own bundling.
Sibling vendored packages live alongside this one under packages/
(e.g. packages/cloudflare-runtime/src/internal/workflows-shared for @cloudflare/workflows-shared).
Layout
The source tree is split into three buckets that correspond to three tsconfig project references:
src/internal/workers-shared/workers/— code that runs in the Workers runtime. Typechecked against@cloudflare/workers-typesonly (plus@cloudflare/vitest-plugin/typesfor the colocatedtests/directories).src/internal/workers-shared/shared/— isomorphic code (web-platform APIs only) used by both Workers and Node consumers. Typechecked against the intersection of Workers and Node type sets.src/internal/workers-shared/node/— Node-only code (build/config-time helpers that usenode:fs,node:path,process, etc.). Typechecked against@types/nodeonly.
src/internal/workers-shared/index.ts is the Node-facing barrel (matching the upstream
packages/workers-shared/index.ts) and is typechecked under tsconfig.node.json.
Provenance
Sourced from cloudflare/workers-sdk
at commit 8d98a15a05fa1f4d27654168ed16df1ff4ff1173 (path:
packages/workers-shared). Upstream license: MIT OR Apache-2.0.
| Upstream path | Vendored path |
|---|---|
asset-worker/ | src/internal/workers-shared/workers/asset-worker/ |
router-worker/ | src/internal/workers-shared/workers/router-worker/ |
utils/{constants,types,performance,responses,sentry,tracing}.ts | src/internal/workers-shared/shared/ |
utils/configuration/{constants,parseHeaders,parseRedirects,parseStaticRouting,validateURL,types}.ts | src/internal/workers-shared/shared/configuration/ |
utils/tests/parse*.test.ts | src/internal/workers-shared/shared/tests/ |
utils/helpers.ts | src/internal/workers-shared/node/helpers.ts |
utils/configuration/constructConfiguration.ts | src/internal/workers-shared/node/configuration/constructConfiguration.ts |
utils/tests/helpers.test.ts | src/internal/workers-shared/node/tests/helpers.test.ts |
index.ts | src/internal/workers-shared/index.ts (rewritten paths) |
Consumer imports
// Node-facing barrel (helpers + parsers + types + constants)
import { getContentType, parseHeaders } from "@distilled.cloud/vendor-workers-shared";
// Worker entries (default + named re-exports of their local ./src/worker)
import assetWorker from "@distilled.cloud/vendor-workers-shared/workers/asset-worker";
import routerWorker from "@distilled.cloud/vendor-workers-shared/workers/router-worker";
// Any individual module under the package via the wildcard
import { AssetConfig } from "@distilled.cloud/vendor-workers-shared/shared/types";
import { generateRulesMatcher } from "@distilled.cloud/vendor-workers-shared/workers/asset-worker/src/utils/rules-engine";