@ts-cloud/core 0.16.40 → 0.16.42

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/types.d.ts CHANGED
@@ -584,6 +584,28 @@ export interface InfrastructureConfig {
584
584
  * }
585
585
  */
586
586
  r2?: R2Config;
587
+ /**
588
+ * Cloudflare Workers, bundled with `Bun.build` and uploaded through
589
+ * Cloudflare's account API on `cloud deploy` (see `reconcileCloudflareWorkers`).
590
+ *
591
+ * Keyed by a logical name; `name` is the script name in Cloudflare. Like
592
+ * `r2`, nothing here touches AWS, and the deploy needs `CLOUDFLARE_API_TOKEN`
593
+ * and `CLOUDFLARE_ACCOUNT_ID` in the env.
594
+ *
595
+ * @example
596
+ * workers: {
597
+ * tiles: {
598
+ * name: 'my-app-tiles',
599
+ * entry: 'workers/tiles.ts',
600
+ * bindings: {
601
+ * r2Buckets: { TILES: 'my-app-tiles' },
602
+ * vars: { CACHE_SECONDS: '86400' },
603
+ * },
604
+ * customDomains: ['tiles.example.com'],
605
+ * },
606
+ * }
607
+ */
608
+ workers?: Record<string, WorkerConfig>;
587
609
  security?: SecurityConfig;
588
610
  monitoring?: MonitoringConfig;
589
611
  api?: ApiConfig;
@@ -2289,6 +2311,40 @@ export interface R2Config {
2289
2311
  /** Buckets keyed by a logical name (the key is not the bucket name; `name` is). */
2290
2312
  buckets: Record<string, R2BucketConfig>;
2291
2313
  }
2314
+ /** Bindings a Worker is uploaded with. Secrets are not declared here; see {@link WorkerConfig}. */
2315
+ export interface WorkerBindingsConfig {
2316
+ /** R2 buckets, keyed by the binding name the Worker reads (`env.TILES`) with the bucket name as the value. */
2317
+ r2Buckets?: Record<string, string>;
2318
+ /** Plain-text environment variables, keyed by binding name. Visible in the dashboard; not for secrets. */
2319
+ vars?: Record<string, string>;
2320
+ }
2321
+ /**
2322
+ * One Cloudflare Worker (an ES module Worker), deployed from a TypeScript or
2323
+ * JavaScript entry that is bundled into a single module.
2324
+ *
2325
+ * Secrets set out of band (`wrangler secret put`, the dashboard) survive a
2326
+ * deploy: the upload keeps existing `secret_text` bindings rather than
2327
+ * replacing them.
2328
+ */
2329
+ export interface WorkerConfig {
2330
+ /** Script name in Cloudflare (lowercase letters, digits, `-` and `_`, up to 63 chars). */
2331
+ name: string;
2332
+ /** Entry module, relative to the project root, e.g. `workers/tiles.ts`. */
2333
+ entry: string;
2334
+ /** Workers runtime compatibility date. @default '2025-09-01' */
2335
+ compatibilityDate?: string;
2336
+ /** Workers runtime compatibility flags, e.g. `['nodejs_compat']`. */
2337
+ compatibilityFlags?: string[];
2338
+ bindings?: WorkerBindingsConfig;
2339
+ /**
2340
+ * Hostnames the Worker serves as Workers Custom Domains. Cloudflare creates
2341
+ * the DNS record and certificate itself, so a hostname must not already have
2342
+ * a DNS record or be attached to an R2 bucket or another Worker: the deploy
2343
+ * warns and leaves it alone rather than detaching anything. Attached, never
2344
+ * detached: removing a hostname from config leaves it attached.
2345
+ */
2346
+ customDomains?: string[];
2347
+ }
2292
2348
  export interface StorageItemConfig {
2293
2349
  /**
2294
2350
  * Physical S3 bucket name. When omitted, defaults to `{slug}-{environment}-{key}`.
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@ts-cloud/core",
3
3
  "type": "module",
4
- "version": "0.16.40",
4
+ "version": "0.16.42",
5
5
  "description": "Core CloudFormation generation library for ts-cloud",
6
6
  "author": "Chris Breuer <chris@stacksjs.com>",
7
7
  "license": "MIT",
@@ -31,7 +31,7 @@
31
31
  "typecheck": "tsc --noEmit"
32
32
  },
33
33
  "dependencies": {
34
- "@ts-cloud/aws-types": "0.16.40"
34
+ "@ts-cloud/aws-types": "0.16.42"
35
35
  },
36
36
  "devDependencies": {
37
37
  "typescript": "^7.0.2"