@zerotal/inertia 1.6.0 → 1.6.1

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/CHANGELOG.md CHANGED
@@ -8,6 +8,26 @@ follows the Zerotal monorepo's unified versioning.
8
8
 
9
9
  ## [Unreleased]
10
10
 
11
+ ## [1.6.1] — 2026-08-15
12
+
13
+ ### Fixed
14
+
15
+ - **DevTools reported that the app was not in dev mode, and suggested starting a Vite
16
+ server.** The advice cannot be followed in a Zerotal app, and the cause was real: the
17
+ Inertia adapter enables its client-side hooks from a `dev` option whose default is
18
+ `import.meta.env.DEV` — a Vite convention. Bun's bundler leaves that expression alone, so
19
+ it survived into the bundle and evaluated to `false` on every build.
20
+
21
+ Zerotal now defines `import.meta.env` for every Inertia build, development and production
22
+ alike, so the adapter's own default resolves. Nothing to configure, and no `dev` option to
23
+ pass by hand.
24
+
25
+ The subtlety worth recording: the adapter writes `import.meta.env?.DEV`, optional-chained
26
+ — which is why an undefined `import.meta.env` yields `false` rather than throwing, and why
27
+ a bundler define keyed on `import.meta.env.DEV` **does not match it**. The whole object has
28
+ to be replaced, not the member. A test pins that, because the member form compiles to a
29
+ perfectly clean no-op.
30
+
11
31
  ## [1.6.0] — 2026-08-15
12
32
 
13
33
  ### Added
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@zerotal/inertia",
3
- "version": "1.6.0",
3
+ "version": "1.6.1",
4
4
  "license": "MIT",
5
5
  "maturity": "stable",
6
6
  "private": false,
@@ -32,7 +32,7 @@
32
32
  "typecheck": "tsc --noEmit"
33
33
  },
34
34
  "dependencies": {
35
- "@zerotal/core": "1.6.0"
35
+ "@zerotal/core": "1.6.1"
36
36
  },
37
37
  "peerDependencies": {
38
38
  "react": "^18 || ^19",
@@ -1,5 +1,5 @@
1
1
  import { Command } from "@zerotal/core";
2
- import { pruneBuildOutput } from "@zerotal/core/dev";
2
+ import { pruneBuildOutput, browserEnvDefines } from "@zerotal/core/dev";
3
3
  import { generatePageRegistry } from "../PageRegistry.ts";
4
4
  import { detectCssPlugins } from "../css.ts";
5
5
  import { detectVuePlugin } from "../vuePlugin.ts";
@@ -55,6 +55,11 @@ export class InertiaBuildCommand extends Command {
55
55
  splitting: true, // REQUIRED: creates per-page chunks from dynamic imports
56
56
  minify: isProd,
57
57
  sourcemap: isProd ? "none" : "external",
58
+ // `createInertiaApp()`'s `dev` option defaults to `import.meta.env.DEV`, which
59
+ // Bun leaves in the bundle — so without this the client hooks the DevTools
60
+ // extension reads are never enabled, and the panel tells you to start a Vite
61
+ // server that a Zerotal app does not have.
62
+ define: browserEnvDefines(isProd),
58
63
  ...(plugins.length > 0 ? { plugins } : {}),
59
64
  });
60
65
 
@@ -1,5 +1,10 @@
1
1
  import { ServiceProvider, Router, ConfigError, ThrottleMiddleware } from "@zerotal/core";
2
- import { registerDevBuildHook, pruneBuildOutput, DEV_RELOAD_CLIENT } from "@zerotal/core/dev";
2
+ import {
3
+ registerDevBuildHook,
4
+ pruneBuildOutput,
5
+ browserEnvDefines,
6
+ DEV_RELOAD_CLIENT,
7
+ } from "@zerotal/core/dev";
3
8
  import type { AppEnvironment } from "@zerotal/core";
4
9
  import type { ConfigManager } from "@zerotal/core/config";
5
10
  import { _setHtmlTemplate, _setPagesDir } from "../inertia.ts";
@@ -123,6 +128,10 @@ export class InertiaProvider extends ServiceProvider {
123
128
  splitting: true,
124
129
  minify: false,
125
130
  sourcemap: "external",
131
+ // This hook only ever runs under the dev orchestrator, so the build is a
132
+ // development one by construction — which is what turns on the Inertia
133
+ // client hooks the DevTools extension reads.
134
+ define: browserEnvDefines(false),
126
135
  ...(plugins.length > 0 ? { plugins } : {}),
127
136
  });
128
137