Skip to content

Commit bfbe49d

Browse files
authored
Wrangler capnp compilation (#3610)
1 parent f753f3a commit bfbe49d

17 files changed

+461
-134
lines changed

.changeset/fast-kids-pump.md

+7
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
---
2+
"wrangler": patch
3+
---
4+
5+
Wrangler Capnp Compilation
6+
7+
This PR replaces logfwdr's `schema` property with a new `unsafe.capnp` object. This object accepts either a `compiled_schema` property, or a `base_path` and array of `source_schemas` to get Wrangler to compile the capnp schema for you.

packages/wrangler/src/__tests__/configuration.test.ts

+4-4
Original file line numberDiff line numberDiff line change
@@ -2648,7 +2648,7 @@ describe("normalizeAndValidateConfig()", () => {
26482648
`);
26492649
});
26502650

2651-
it("should error if neither unsafe.bindings nor unsafe.metadata are defined", () => {
2651+
it("should error if unsafe.bindings, unsafe.metadata and unsafe.capnp are undefined", () => {
26522652
const { diagnostics } = normalizeAndValidateConfig(
26532653
{ unsafe: {} } as unknown as RawConfig,
26542654
undefined,
@@ -2661,7 +2661,7 @@ describe("normalizeAndValidateConfig()", () => {
26612661
`);
26622662
expect(diagnostics.renderErrors()).toMatchInlineSnapshot(`
26632663
"Processing wrangler configuration:
2664-
- The field \\"unsafe\\" should contain at least one of \\"bindings\\" or \\"metadata\\" properties but got {}."
2664+
- The field \\"unsafe\\" should contain at least one of \\"bindings\\", \\"metadata\\" or \\"capnp\\" properties but got {}."
26652665
`);
26662666
});
26672667

@@ -4202,7 +4202,7 @@ describe("normalizeAndValidateConfig()", () => {
42024202
`);
42034203
});
42044204

4205-
it("should error if neither unsafe.bindings nor unsafe.metadata are defined", () => {
4205+
it("should error if unsafe.bindings, unsafe.metadata and unsafe.capnp are undefined", () => {
42064206
const { diagnostics } = normalizeAndValidateConfig(
42074207
{ env: { ENV1: { unsafe: {} } } } as unknown as RawConfig,
42084208
undefined,
@@ -4219,7 +4219,7 @@ describe("normalizeAndValidateConfig()", () => {
42194219
"Processing wrangler configuration:
42204220
42214221
- \\"env.ENV1\\" environment configuration
4222-
- The field \\"env.ENV1.unsafe\\" should contain at least one of \\"bindings\\" or \\"metadata\\" properties but got {}."
4222+
- The field \\"env.ENV1.unsafe\\" should contain at least one of \\"bindings\\", \\"metadata\\" or \\"capnp\\" properties but got {}."
42234223
`);
42244224
});
42254225

0 commit comments

Comments
 (0)