@void/deploy-cloudflare 1.5.0 → 1.6.0

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/index.d.mts CHANGED
@@ -269,10 +269,12 @@ export declare function renderCloudflareStaticEntry(options: {
269
269
  * Void has already compiled the root `_headers` and `_redirects` files into the thin edge
270
270
  * Worker. Wrangler parses those files independently of `.assetsignore`, so uploading the source
271
271
  * directory would apply every rule twice and can reject valid Void fallbacks as redirect loops.
272
+ * `headers` becomes the staged `_headers` for rules Cloudflare applies to asset responses itself.
272
273
  */
273
274
  export declare function stageCloudflareStaticAssets(options: {
274
275
  sourceDirectory: string;
275
276
  destinationDirectory: string;
277
+ headers?: string;
276
278
  }): void;
277
279
  /**
278
280
  * Persist the mutable Cloudflare target state without replacing comments,
package/dist/index.mjs CHANGED
@@ -657,6 +657,7 @@ function renderCloudflareStaticEntry(options) {
657
657
  * Void has already compiled the root `_headers` and `_redirects` files into the thin edge
658
658
  * Worker. Wrangler parses those files independently of `.assetsignore`, so uploading the source
659
659
  * directory would apply every rule twice and can reject valid Void fallbacks as redirect loops.
660
+ * `headers` becomes the staged `_headers` for rules Cloudflare applies to asset responses itself.
660
661
  */
661
662
  function stageCloudflareStaticAssets(options) {
662
663
  const sourceDirectory = resolve(options.sourceDirectory);
@@ -679,6 +680,7 @@ function stageCloudflareStaticAssets(options) {
679
680
  return !reserved.has(absolute) && !isInsideDestination(absolute);
680
681
  }
681
682
  });
683
+ if (options.headers !== void 0) writeFileSync(join(destinationDirectory, "_headers"), options.headers);
682
684
  }
683
685
  /**
684
686
  * Persist the mutable Cloudflare target state without replacing comments,
@@ -701,7 +703,7 @@ function writeCloudflareStaticDeployConfig(options) {
701
703
  upsert(["no_bundle"], false);
702
704
  upsert(["assets", "directory"], options.assetsDirectory);
703
705
  upsert(["assets", "binding"], "ASSETS");
704
- upsert(["assets", "run_worker_first"], true);
706
+ upsert(["assets", "run_worker_first"], options.assetConfig.run_worker_first ?? true);
705
707
  upsert(["assets", "not_found_handling"], options.assetConfig.not_found_handling ?? "none");
706
708
  upsert(["assets", "html_handling"], options.assetConfig.html_handling ?? "auto-trailing-slash");
707
709
  upsert(["durable_objects", "bindings"], []);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@void/deploy-cloudflare",
3
- "version": "1.5.0",
3
+ "version": "1.6.0",
4
4
  "description": "Cloudflare deployment primitives for Void runtimes and deployment adapters.",
5
5
  "homepage": "https://void.cloud",
6
6
  "bugs": {
@@ -26,7 +26,7 @@
26
26
  "access": "public"
27
27
  },
28
28
  "dependencies": {
29
- "@void/deploy-core": "1.5.0",
29
+ "@void/deploy-core": "1.6.0",
30
30
  "jsonc-parser": "^3.3.1"
31
31
  },
32
32
  "devDependencies": {