@harlan-zw/nuxt-cloudflare 0.4.2 → 0.4.4

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/README.md CHANGED
@@ -1,35 +1,32 @@
1
- <h1>@harlan-zw/nuxt-cloudflare</h1>
1
+ # Nuxt Cloudflare
2
2
 
3
3
  [![npm version][npm-version-src]][npm-version-href]
4
4
  [![npm downloads][npm-downloads-src]][npm-downloads-href]
5
5
  [![License][license-src]][license-href]
6
6
  [![Nuxt][nuxt-src]][nuxt-href]
7
7
 
8
- Nuxt Cloudflare gives a Nuxt 4 app opinionated Cloudflare defaults, a generated Wrangler config, and diagnostics that fail a bad deploy before Cloudflare does.
8
+ > Cloudflare defaults, a generated Wrangler config, and Wrangler diagnostics for Nuxt 4 apps.
9
9
 
10
- The defaults come from production patterns already running in Nuxt SEO and gscdump. The module owns platform policy. Your application topology stays yours.
10
+ ## Why Nuxt Cloudflare?
11
11
 
12
- Status: experimental. APIs may change before the first release.
12
+ Every Nuxt app on Cloudflare Workers needs the same Wrangler setup. Small mistakes in it surface only at deploy time or in production.
13
13
 
14
- <p align="center">
15
- <table>
16
- <tbody>
17
- <td align="center">
18
- <sub>Made possible by my <a href="https://github.com/sponsors/harlan-zw">Sponsor Program 💖</a><br> Follow me <a href="https://twitter.com/harlan_zw">@harlan_zw</a> 🐦 • Join <a href="https://discord.gg/275MBUBvgP">Discord</a> for help</sub><br>
19
- </td>
20
- </tbody>
21
- </table>
22
- </p>
14
+ - 💥 **Deploys fail late**: Cloudflare rejects a broken Wrangler config at deploy, after your build already passed.
15
+ - 💰 **Surprise bills**: Unsampled Workers Logs and Worker-first asset routing turn free requests into billed ones.
16
+ - 🗄️ **Stale cached pages**: A cached document can name build chunks that a later deploy deleted.
17
+ - 🔑 **Binding drift**: A wrong binding name or a stale binding type fails only in production.
18
+
19
+ Nuxt Cloudflare applies defaults from production patterns already running in Nuxt SEO and gscdump, and fails a bad deploy in your build. The module owns platform policy; your application topology stays yours.
23
20
 
24
21
  ## Features
25
22
 
26
- - ⚙️ **Generated Wrangler config:** Cloudflare preset, Node compatibility, and sane observability, with anything you authored left alone.
27
- - 🩺 **Deploy doctor:** audits Wrangler's effective config, including generated redirects and every named environment.
28
- - 💰 **Cost controls:** 1% log and trace sampling, asset-first routing, and warnings when a setting turns free requests into billed ones.
29
- - 🗄️ **Workers Caching:** version-isolated by default, with a fail-closed `private, no-store` for rendered HTML.
30
- - 📦 **Partial bundling:** chunks deploy as separate modules, which cut startup CPU on the Nuxt SEO Pro Worker from 118ms to 81ms.
31
- - 🔑 **Exact binding types:** `nuxt prepare` runs Wrangler and writes a compatibility-aware declaration, then production builds fail on drift.
32
- - 🧰 **D1 primitives:** recovering sessions, safe write retries, and parameter plans that respect the 100-bind limit.
23
+ - ⚙️ **Generated Wrangler config**: You skip the Cloudflare boilerplate, and every key you wrote stays yours.
24
+ - 🩺 **Deploy doctor**: A broken Wrangler config fails in CI, before a deploy reaches Cloudflare.
25
+ - 💰 **Cost controls**: Surprise bills from unsampled logs or newly billable asset requests get flagged before you deploy.
26
+ - 🗄️ **Workers Caching**: One deploy never serves another deploy's cache, and rendered pages stay out of the shared cache by default.
27
+ - 📦 **Partial bundling**: Large Workers start faster; the Nuxt SEO Pro Worker dropped from 118ms to 81ms startup CPU.
28
+ - 🔑 **Exact binding types**: A wrong binding name or stale binding type fails before it reaches production.
29
+ - 🧰 **D1 primitives**: Session resets, lock contention, and the 100-bind limit stop breaking your queries.
33
30
 
34
31
  ## Installation
35
32
 
@@ -67,8 +64,8 @@ Every default below yields to a value you wrote. The root `wrangler.jsonc`, `wra
67
64
  - Cloudflare module preset, generated Wrangler config, and Node compatibility
68
65
  - Static assets remain asset first by default. Blanket `assets.run_worker_first: true` warns because valid authentication and transform use cases exist
69
66
  - Workers Logs sampled at 1%, traces at 1%, both overridable
70
- - Preview URLs disabled unless explicitly enabled
71
- - `workers_dev` disabled when a route proves the Worker remains reachable; workers without routes must choose explicitly
67
+ - Preview URLs disabled unless you enable them
68
+ - `workers_dev` disabled when a route keeps the Worker reachable; a Worker without routes must set it
72
69
  - Version metadata binding at `CF_VERSION_METADATA`
73
70
  - Smart Placement enabled unless the project chooses a placement
74
71
  - Partial bundling: `find_additional_modules` plus a fallthrough `ESModule` rule for `**/*.mjs`, unless a rule already covers mjs or `no_bundle` is set
@@ -88,9 +85,9 @@ Persistent KV mounts are never wrapped. The expiry policy applies only to cache
88
85
 
89
86
  ## Configuration
90
87
 
91
- Everything below is optional. The defaults above already cover a plain deploy.
88
+ Everything below is optional. The defaults cover a plain deploy.
92
89
 
93
- To configure a cache mount when one does not already exist:
90
+ If you have no cache mount, configure one:
94
91
 
95
92
  ```ts
96
93
  export default defineNuxtConfig({
@@ -105,11 +102,13 @@ export default defineNuxtConfig({
105
102
 
106
103
  Cloudflare KV requires TTLs of at least 60 seconds. The cache wrapper raises shorter positive TTLs to 60 seconds.
107
104
 
108
- Keep server runtime secret defaults empty. Nuxt reads matching `NUXT_*` values from Worker secret bindings at runtime. The production build guard rejects secret build environment values before Nitro can include them in the bundle. Nuxt Scripts proxy signing remains allowed because that module registers its security plugin during the build.
105
+ Keep server runtime secret defaults empty. At runtime, Nuxt reads matching `NUXT_*` values from Worker secret bindings. The production build guard rejects a secret build environment value before Nitro can put it in the bundle. Nuxt Scripts proxy signing still works, because that module registers its security plugin during the build.
106
+
107
+ Workers Caching is separate from Nitro's KV-backed cache. The module turns on version-isolated caching by default. To opt out, set `workersCache: { _tag: 'disabled' }`. Choose cross-version caching only if you have a purge path.
109
108
 
110
- Workers Caching is separate from Nitro's KV-backed cache. The module enables version-isolated caching by default. Set `workersCache: { _tag: 'disabled' }` to opt out. Choose cross-version caching only with an explicit purge path.
109
+ Partial bundling is on by default. Wrangler's default bundling inlines every lazy chunk into one module, and the isolate parses all of it at startup. On the Nuxt SEO Pro Worker that module was 26.3MB. Deploying chunks as separate modules cut `wrangler check startup` active CPU from 118ms to 81ms.
111
110
 
112
- Partial bundling is on by default. Wrangler's default bundling inlines every lazy chunk into one module the isolate parses at startup; on the Nuxt SEO Pro Worker that was a 26.3MB bundle, and partial bundling cut `wrangler check startup` active CPU from 118ms to 81ms by deploying chunks as separate modules. The generated config gains `find_additional_modules: true` and a fallthrough `ESModule` rule for `**/*.mjs`; rules you wrote are kept, and one that already covers mjs wins. Configs with `no_bundle` inject neither key, because Wrangler already defaults `find_additional_modules` to true there and applies your rules as written. Set `partialBundles: false` to keep single-bundle deploys.
111
+ The generated config gains `find_additional_modules: true` and a fallthrough `ESModule` rule for `**/*.mjs`. The module keeps rules you wrote, and a rule of yours that covers mjs wins. With `no_bundle`, the module adds neither key: Wrangler already defaults `find_additional_modules` to true there and applies your rules as written. To keep single-bundle deploys, set `partialBundles: false`.
113
112
 
114
113
  The module writes a fail-closed `private, no-store` before routing, so a response nobody described is never cached. It never rewrites a policy you set on a response that is not a rendered document, so asset and API route rules are yours.
115
114
 
@@ -141,28 +140,28 @@ export default defineNuxtConfig({
141
140
  })
142
141
  ```
143
142
 
144
- It emits `max-age`, never `s-maxage`. Cloudflare reads `s-maxage` as implying `proxy-revalidate`, which disables `stale-while-revalidate` and `stale-if-error`, so a policy that looks like it serves stale blocks on revalidation instead. The module warns at build if a route rule you wrote by hand hits that.
143
+ It emits `max-age`, never `s-maxage`. Cloudflare reads `s-maxage` as `proxy-revalidate`, which turns off `stale-while-revalidate` and `stale-if-error`. A policy that looks like it serves stale then blocks on revalidation. If a route rule you wrote by hand hits this, the module warns at build.
145
144
 
146
145
  ## Cost controls
147
146
 
148
- Cloudflare pricing changes. Check the linked pricing pages before making a budget.
147
+ Cloudflare pricing changes. Before you set a budget, check the linked pricing pages.
149
148
 
150
149
  - Workers Logs use a 1% routine sample. Paid plans include 20 million monthly events. Extra events cost $0.60 per million. See [Workers Logs pricing](https://developers.cloudflare.com/workers/observability/logs/workers-logs/#pricing).
151
- - Invocation logs remain enabled. High-volume Workers with complete error telemetry can set `observability.logs.invocation_logs: false`. This removes one event per sampled invocation.
150
+ - Invocation logs stay on. If a high-volume Worker already has full error telemetry, set `observability.logs.invocation_logs: false`. This removes one event per sampled invocation.
152
151
  - Traces use a separate 1% sample. Each span is metered. [Trace pricing](https://developers.cloudflare.com/workers/observability/traces/#limits--pricing) lists 10 million included monthly events. It also says the quota is shared with logs. The Workers Logs page lists 20 million. Budget against 10 million until the pages agree.
153
152
  - Workers Caching uses version isolation by default. [Workers pricing](https://developers.cloudflare.com/workers/platform/pricing/#workers) bills cache hits as Worker requests. This includes static assets and Worker-to-Worker requests. Disable caching when CPU savings do not exceed the added request cost.
154
153
  - Static assets stay asset first. Their requests are free and unlimited. The module warns when blanket Worker-first routing makes assets billable.
155
154
  - Cloudflare's 30-second CPU limit remains unchanged. The doctor warns when `limits.cpu_ms` exceeds 30,000. A higher ceiling increases runaway-cost exposure.
156
- - Queue retries add billed read operations. Each 64 KB message chunk incurs write, read, and delete operations. Keep payloads small and retries deliberate.
155
+ - Queue retries add billed read operations. Each 64 KB message chunk costs a write, a read, and a delete. Keep payloads small and retries few.
157
156
  - The KV-backed Nitro cache expires entries after 30 days. This bounds stored cache data. It does not reduce billed operations.
158
157
 
159
- [D1 pricing](https://developers.cloudflare.com/d1/platform/pricing/) charges for rows read, rows written, and stored data. Indexes reduce billed scans but add writes and storage. Read replicas add no separate charge. The module preserves D1 routing and session behavior.
158
+ [D1 pricing](https://developers.cloudflare.com/d1/platform/pricing/) charges for rows read, rows written, and stored data. Indexes reduce billed scans but add writes and storage. Read replicas cost nothing extra. The module does not change D1 routing or session behavior.
160
159
 
161
- Doctor warnings surface log or trace sampling above 1%, Workers Caching with static assets, CPU limits above 30 seconds, and queue retries above three.
160
+ The doctor warns on log or trace sampling above 1%, Workers Caching with static assets, CPU limits above 30 seconds, and queue retries above three.
162
161
 
163
162
  ## Doctor
164
163
 
165
- Audit Wrangler's effective configuration, including generated config redirects and named environments:
164
+ Audit the config Wrangler will actually deploy, including generated config redirects and named environments:
166
165
 
167
166
  ```sh
168
167
  pnpm nuxt-cloudflare doctor
@@ -170,13 +169,15 @@ pnpm nuxt-cloudflare doctor --env production --json
170
169
  pnpm nuxt-cloudflare doctor --strict --allow-warning source-maps-disabled
171
170
  ```
172
171
 
173
- The CLI reads Wrangler config through Wrangler itself, so JSON, JSONC, TOML, environments, upward lookup, and Nitro generated-config redirects follow deployment semantics. It separately inspects root authoring format. Existing TOML remains supported and receives non-blocking guidance because Cloudflare recommends JSONC for new projects. Shadowed root configs warn because they can silently drift.
172
+ The CLI reads Wrangler config through Wrangler itself. JSON, JSONC, TOML, environments, upward lookup, and Nitro generated-config redirects resolve the same way a deploy resolves them. The CLI also checks the format of the root config. TOML still works; the doctor suggests JSONC without failing, because Cloudflare recommends JSONC for new projects. A shadowed root config warns, because it can drift without anyone noticing.
174
173
 
175
- Errors cover `_headers` and `_redirects` files past Cloudflare's rule limits, malformed asset patterns, invalid Durable Object lifecycles, invalid Container storage, queue limits, unsafe example bindings, and unflattened generated environments. Warnings cover blanket Worker-first assets, missing environment bindings, unrestricted email, local service fidelity, deprecated fields, telemetry gaps, and public endpoints. Secret values are never included.
174
+ Errors cover `_headers` and `_redirects` files past Cloudflare's rule limits, malformed asset patterns, invalid Durable Object lifecycles, invalid Container storage, queue limits, unsafe example bindings, and unflattened generated environments.
176
175
 
177
- Normal mode fails errors. `--strict` also fails warnings. Intentional exceptions remain visible and may be listed with `--allow-warning`. Module builds use the equivalent policy:
176
+ Warnings cover blanket Worker-first assets, missing environment bindings, unrestricted email, local service fidelity, deprecated fields, telemetry gaps, and public endpoints. The output never includes secret values.
178
177
 
179
- `nodejs_compat` is required by default because this is a Nuxt module. Use `--node-compat ignore` only when auditing a non-Nuxt companion Worker, such as a redirect-only Worker.
178
+ `nodejs_compat` is required by default because this is a Nuxt module. Use `--node-compat ignore` only to audit a non-Nuxt companion Worker, such as a redirect-only Worker.
179
+
180
+ Normal mode fails on errors. `--strict` also fails on warnings. An intentional exception stays visible; list it with `--allow-warning`. Module builds use the same policy:
180
181
 
181
182
  ```ts
182
183
  export default defineNuxtConfig({
@@ -199,14 +200,14 @@ pnpm wrangler deploy --strict --dry-run --config .output/server/wrangler.json --
199
200
  pnpm wrangler check startup --config .output/server/wrangler.json
200
201
  ```
201
202
 
202
- Pass the final generated config explicitly to `types` and `check startup`; Nitro's `.wrangler/deploy/config.json` redirect does not apply to those commands.
203
+ Pass the final generated config to `types` and `check startup` yourself. Nitro's `.wrangler/deploy/config.json` redirect does not apply to those commands.
203
204
 
204
205
  ### Product guidance
205
206
 
206
207
  - Named environments do not inherit bindings. The doctor reports each omitted root binding.
207
208
  - AI, Browser, Images, mTLS, Vectorize, and Flagship warn when local development omits `remote: true`.
208
209
  - Every Container must match a local SQLite Durable Object. Legacy `dev` and `standard` instance types warn.
209
- - Email bindings should restrict senders or destinations.
210
+ - An email binding without a sender or destination restriction warns.
210
211
  - Legacy module bindings and the old Pipeline `pipeline` field warn with their current replacements.
211
212
 
212
213
  ## Runtime primitives
@@ -231,11 +232,11 @@ await retryIdempotentD1Write({
231
232
  })
232
233
  ```
233
234
 
234
- `getRecoveringRequestD1Session` caches one `first-primary` session per request and binding. Use `withD1ResetRecovery` when no request context exists. D1 already retries read-only queries. Recovery handles failures that outlive those retries. It opens a replacement session after `D1_RESET_DO`, carries the last bookmark, and rebuilds the prepared statement with its bound values. Replica disconnects and connection loss retry on the current session.
235
+ `getRecoveringRequestD1Session` caches one `first-primary` session per request and binding. If no request context exists, use `withD1ResetRecovery`. D1 already retries read-only queries. Recovery handles the failures that outlast those retries. It opens a replacement session after `D1_RESET_DO`, carries the last bookmark, and rebuilds the prepared statement with its bound values. Replica disconnects and connection loss retry on the current session.
235
236
 
236
- Recovery replays only `SELECT`, read-only CTE, and `EXPLAIN` statements. It never replays writes, PRAGMA statements, mixed batches, or unknown statements. A session reset still opens a healthy session for the next statement. `onRecovery` receives tagged `retrying` or `stopped` events for request telemetry.
237
+ Recovery replays only `SELECT`, read-only CTE, and `EXPLAIN` statements. It never replays writes, PRAGMA statements, mixed batches, or unknown statements. After a reset, the next statement still gets a healthy session. `onRecovery` receives tagged `retrying` or `stopped` events for request telemetry.
237
238
 
238
- Write retries require an explicit safety tag. `lock-only` retries SQLite lock contention; `replay-safe` also permits classified network and storage reset failures. Resource pressure, queue delay, CPU, and memory errors are never retried.
239
+ Every write retry needs a safety tag. `lock-only` retries SQLite lock contention; `replay-safe` also permits classified network and storage reset failures. Resource pressure, queue delay, CPU, and memory errors are never retried.
239
240
 
240
241
  ### D1 parameter plans
241
242
 
@@ -258,7 +259,7 @@ for (const ids of chunkD1Items(siteIds, siteIdPlan)) {
258
259
  }
259
260
  ```
260
261
 
261
- D1 allows 100 bound parameters per statement, including each statement inside `db.batch()`. The parsed opaque plan rejects fractions, non-finite values, negative reservations, forged runtime plans, and budgets that cannot fit one item. `parametersPerItem` supports multi-row inserts; `reservedParameters` accounts for fixed binds and deliberate headroom. `assertD1BoundParameters` verifies the final ORM output in regression tests. Chunk execution, ordering, transaction boundaries, and result merging remain explicit at the call site.
262
+ D1 allows 100 bound parameters per statement, including each statement inside `db.batch()`. `defineD1ParameterPlan` rejects fractions, non-finite values, negative reservations, forged runtime plans, and budgets that cannot fit one item. `parametersPerItem` supports multi-row inserts; `reservedParameters` accounts for fixed binds and deliberate headroom. `assertD1BoundParameters` checks the final ORM output in regression tests. You still write chunk execution, ordering, transaction boundaries, and result merging at the call site.
262
263
 
263
264
  ### Bindings
264
265
 
@@ -278,9 +279,9 @@ function apiToken(event?: H3Event) {
278
279
  }
279
280
  ```
280
281
 
281
- `nuxt prepare` runs Wrangler and writes exact, compatibility-aware types to `.nuxt/types/cloudflare-bindings.d.ts`. It merges root JSON, JSONC, or TOML bindings with `nitro.cloudflare.wrangler`. Nuxt and Nitro typechecks both reference the declaration, while bindings remain server runtime values. Production builds compare it with the final generated Wrangler config and fail on drift. Set `bindingTypes: false` only when another tool owns the declaration.
282
+ `nuxt prepare` runs Wrangler and writes exact, compatibility-aware types to `.nuxt/types/cloudflare-bindings.d.ts`. It merges root JSON, JSONC, or TOML bindings with `nitro.cloudflare.wrangler`. Nuxt and Nitro typechecks both use the declaration. Bindings are still server runtime values only. Production builds compare it with the final generated Wrangler config and fail on drift. If another tool owns the declaration, set `bindingTypes: false`.
282
283
 
283
- Binding types use a shared cache under `$XDG_CACHE_HOME/nuxt-cloudflare` or `~/.cache/nuxt-cloudflare`. The cache key includes the Wrangler config and version. Each worktree still receives private `.nuxt` files. Set `cacheDir` to a shared absolute path. Set it to `false` to bypass the cache.
284
+ Binding types use a shared cache under `$XDG_CACHE_HOME/nuxt-cloudflare` or `~/.cache/nuxt-cloudflare`. The cache key includes the Wrangler config and version. Each worktree still gets its own `.nuxt` files. To move the cache, set `cacheDir` to a shared absolute path. To skip the cache, set it to `false`.
284
285
 
285
286
  ```ts
286
287
  export default defineNuxtConfig({
@@ -292,9 +293,9 @@ export default defineNuxtConfig({
292
293
  })
293
294
  ```
294
295
 
295
- The source may be an H3 event, Nitro task input, or task context. Eventless access uses Nitro's `globalThis.__env__` Cloudflare entry shim. An explicit environment always wins and never mixes with the global environment. Binding names come from the generated `CloudflareBindings` interface. Missing required bindings throw. Pass a generic only to override generated types in a focused test.
296
+ The source may be an H3 event, Nitro task input, or task context. Eventless access uses Nitro's `globalThis.__env__` Cloudflare entry shim. An explicit environment always wins and never mixes with the global environment. Binding names come from the generated `CloudflareBindings` interface. A missing required binding throws. Pass a generic only to override generated types in a focused test.
296
297
 
297
- `useCloudflareRuntimeConfig` reads runtime config from both contexts. On Cloudflare, `NUXT_*` Worker vars and secrets bind onto runtime config only through an event, so a bare `useRuntimeConfig()` off the request path returns build-time defaults. Without an event this reads the Cloudflare entry environment and wraps it as the source Nitro requires. The module's Nitro plugin supplies the reader; use `runtimeConfigSource` directly only when you own the `useRuntimeConfig` call.
298
+ `useCloudflareRuntimeConfig` reads runtime config from both contexts. On Cloudflare, `NUXT_*` Worker vars and secrets bind onto runtime config only through an event, so a bare `useRuntimeConfig()` off the request path returns build-time defaults. Without an event, it reads the Cloudflare entry environment and wraps it as the source Nitro needs. The module's Nitro plugin supplies the reader; use `runtimeConfigSource` directly only when you own the `useRuntimeConfig` call.
298
299
 
299
300
  ### Scoped secrets file
300
301
 
@@ -315,22 +316,11 @@ await withWorkerSecretsFile({
315
316
  })
316
317
  ```
317
318
 
318
- The helper owns a private temporary directory and creates the JSON file with mode 0600. It removes the directory after deployment succeeds or fails. Secret values may be strings or `null`; Wrangler treats `null` as a deletion marker.
319
+ The helper creates a private temporary directory and writes the JSON file with mode 0600. It removes the directory whether the deploy succeeds or fails. Secret values may be strings or `null`; Wrangler treats `null` as a deletion marker.
319
320
 
320
321
  ## Deliberate boundaries
321
322
 
322
- The module does not choose Worker names, routes, domains, resource IDs, placement, CPU limits, queue jobs, R2 deletion policy, or deployment promotion. `@harlan-zw/nuxt-cf-jobs` continues to own queues, job durability, recovery, and outbox behavior.
323
-
324
- Next extractions from Nuxt SEO and gscdump:
325
-
326
- 1. Nuxt Content D1 sync plus readiness verification
327
- 2. Expand-only D1 migration audit with protected-table rebuild detection
328
- 3. Lease/CAS API idempotency with canonical request fingerprints
329
- 4. D1 request telemetry for serial waves, rows, regions, and primary versus replica reads
330
- 5. Atomic D1 fixed-window rate limiting
331
- 6. R2 lifecycle declaration and read-only storage stocktake
332
-
333
- These remain separate adapters because their schemas, retention, and deployment ordering require explicit application policy.
323
+ The module does not choose Worker names, routes, domains, resource IDs, placement, CPU limits, queue jobs, R2 deletion policy, or deployment promotion. `@harlan-zw/nuxt-cf-jobs` owns queues, job durability, recovery, and outbox behavior.
334
324
 
335
325
  ## Sponsors
336
326
 
package/dist/module.json CHANGED
@@ -4,7 +4,7 @@
4
4
  "compatibility": {
5
5
  "nuxt": ">=4.5.0 <6.0.0"
6
6
  },
7
- "version": "0.4.2",
7
+ "version": "0.4.4",
8
8
  "builder": {
9
9
  "@nuxt/module-builder": "1.0.3",
10
10
  "unbuild": "3.6.1"
package/dist/module.mjs CHANGED
@@ -237,8 +237,15 @@ async function auditGeneratedWranglerConfig(nitro, options, buildDir, rootDir, b
237
237
  const policy = options.doctor ?? { _tag: "advisory" };
238
238
  const outcome = evaluateWranglerDiagnostics(diagnostics, policy);
239
239
  const blocking = new Set(outcome.blockingDiagnostics);
240
- const warnings = diagnostics.filter((diagnostic) => diagnostic._tag === "warning" && !blocking.has(diagnostic));
241
- const information = diagnostics.filter((diagnostic) => diagnostic._tag === "info");
240
+ const accepted = new Set(policy._tag === "strict" ? policy.allowedWarnings ?? [] : []);
241
+ const warnings = diagnostics.filter((diagnostic) => diagnostic._tag === "warning" && !blocking.has(diagnostic) && !accepted.has(diagnostic.code));
242
+ const information = diagnostics.flatMap((diagnostic) => {
243
+ if (diagnostic._tag === "info")
244
+ return [diagnostic];
245
+ if (diagnostic._tag === "warning" && accepted.has(diagnostic.code))
246
+ return [{ ...diagnostic, _tag: "info" }];
247
+ return [];
248
+ });
242
249
  if (information.length > 0)
243
250
  logger.info(formatWranglerDiagnostics(information));
244
251
  if (warnings.length > 0)
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@harlan-zw/nuxt-cloudflare",
3
3
  "type": "module",
4
- "version": "0.4.2",
4
+ "version": "0.4.4",
5
5
  "description": "Opinionated Cloudflare deployment defaults and diagnostics for Nuxt.",
6
6
  "author": {
7
7
  "name": "Harlan Wilton",
@@ -26,35 +26,43 @@
26
26
  "exports": {
27
27
  ".": {
28
28
  "types": "./dist/module.d.mts",
29
- "import": "./dist/module.mjs"
29
+ "import": "./dist/module.mjs",
30
+ "default": "./dist/module.mjs"
30
31
  },
31
32
  "./d1": {
32
33
  "types": "./dist/d1.d.mts",
33
- "import": "./dist/d1.mjs"
34
+ "import": "./dist/d1.mjs",
35
+ "default": "./dist/d1.mjs"
34
36
  },
35
37
  "./bindings": {
36
38
  "types": "./dist/bindings.d.mts",
37
- "import": "./dist/bindings.mjs"
39
+ "import": "./dist/bindings.mjs",
40
+ "default": "./dist/bindings.mjs"
38
41
  },
39
42
  "./deploy": {
40
43
  "types": "./dist/deploy.d.mts",
41
- "import": "./dist/deploy.mjs"
44
+ "import": "./dist/deploy.mjs",
45
+ "default": "./dist/deploy.mjs"
42
46
  },
43
47
  "./storage": {
44
48
  "types": "./dist/storage.d.mts",
45
- "import": "./dist/storage.mjs"
49
+ "import": "./dist/storage.mjs",
50
+ "default": "./dist/storage.mjs"
46
51
  },
47
52
  "./wrangler": {
48
53
  "types": "./dist/wrangler.d.mts",
49
- "import": "./dist/wrangler.mjs"
54
+ "import": "./dist/wrangler.mjs",
55
+ "default": "./dist/wrangler.mjs"
50
56
  },
51
57
  "./cache": {
52
58
  "types": "./dist/cache.d.mts",
53
- "import": "./dist/cache.mjs"
59
+ "import": "./dist/cache.mjs",
60
+ "default": "./dist/cache.mjs"
54
61
  },
55
62
  "./checks": {
56
63
  "types": "./dist/checks.d.mts",
57
- "import": "./dist/checks.mjs"
64
+ "import": "./dist/checks.mjs",
65
+ "default": "./dist/checks.mjs"
58
66
  }
59
67
  },
60
68
  "main": "./dist/module.mjs",
@@ -94,7 +102,7 @@
94
102
  "node": ">=22.12.0"
95
103
  },
96
104
  "peerDependencies": {
97
- "@harlan-zw/nuxt-checkin": "^0.1.0 || ^0.2.0-0",
105
+ "@harlan-zw/nuxt-checkin": "^0.1.0 || ^0.2.0-0 || ^0.3.0",
98
106
  "nuxt": ">=4.5.0 <6.0.0",
99
107
  "wrangler": ">=4.120.0 <5.0.0"
100
108
  },
@@ -126,8 +134,8 @@
126
134
  "unbuild": "^3.6.1",
127
135
  "vitest": "^4.1.10",
128
136
  "wrangler": "^4.120.1",
129
- "@harlan-zw/nuxt-checkin": "0.2.0",
130
- "@harlan-zw/nuxt-wide-events": "^0.1.4"
137
+ "@harlan-zw/nuxt-wide-events": "^0.1.4",
138
+ "@harlan-zw/nuxt-checkin": "0.3.0"
131
139
  },
132
140
  "scripts": {
133
141
  "build": "nuxt-module-build build --stub && nuxt-module-build prepare && nuxt-module-build build",