@bakery-framework/core 1.1.0 → 1.1.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/package.json +1 -1
- package/src/client/utils.ts +11 -1
package/package.json
CHANGED
package/src/client/utils.ts
CHANGED
|
@@ -161,7 +161,17 @@ Object.assign(globalThis, {
|
|
|
161
161
|
request,
|
|
162
162
|
randomId,
|
|
163
163
|
Bakery: {
|
|
164
|
-
|
|
164
|
+
// **Cast rather than `import.meta.env` directly.** `ImportMeta.env` is
|
|
165
|
+
// declared by `bun-types`, and this file is compiled by the *client*
|
|
166
|
+
// tsconfig, which deliberately has none — reaching for a Bun-provided type
|
|
167
|
+
// here would undo the split it exists to enforce.
|
|
168
|
+
//
|
|
169
|
+
// Declaring `ImportMeta` in client/globals.d.ts instead would clash with
|
|
170
|
+
// bun-types inside core's own project, which is the incompatible
|
|
171
|
+
// redeclaration this repo has already had once. The value is substituted by
|
|
172
|
+
// the compiler at build time, so the cast describes what is actually there.
|
|
173
|
+
version: (import.meta as { env?: Record<string, string | undefined> }).env
|
|
174
|
+
?.BAKERY_VERSION,
|
|
165
175
|
async virtual(path: string) {
|
|
166
176
|
const response = await fetch(path)
|
|
167
177
|
if (!response.ok) {
|