fimo 2.2.0-staging.5 → 2.2.0-staging.6

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.
@@ -1,6 +1,7 @@
1
1
  import { fileURLToPath } from 'node:url';
2
2
  import { getConfigPreviewRoutes } from '../../runtime/preview/routes.js';
3
3
  import { getConfigServer } from '../../runtime/shared/fimo-config.server.js';
4
+ import previewHealthPlugin from '../vite/plugins/preview-health.js';
4
5
  import runtimeEnvPlugin from '../vite/plugins/runtime-env.js';
5
6
  function serializeForModule(value) {
6
7
  return (JSON.stringify(value) ?? 'undefined')
@@ -32,7 +33,7 @@ export function fimo(options = {}) {
32
33
  // `as never` sidesteps a TS "excessive stack depth" on Astro's
33
34
  // DeepPartial<AstroConfig> vs Vite's Plugin type; the shape is the
34
35
  // documented `updateConfig({ vite: { plugins } })`.
35
- updateConfig({ vite: { plugins: [runtimeEnvPlugin()] } });
36
+ updateConfig({ vite: { plugins: [runtimeEnvPlugin(), previewHealthPlugin()] } });
36
37
  const fimoConfig = getConfigServer(fileURLToPath(config.root));
37
38
  const routes = getConfigPreviewRoutes(fimoConfig);
38
39
  injectScript('page', [
@@ -0,0 +1,4 @@
1
+ import type { Plugin } from 'vite';
2
+ export declare const PREVIEW_HEALTH_PATH = "/__fimo/preview-health";
3
+ export default function previewHealthPlugin(): Plugin;
4
+ //# sourceMappingURL=preview-health.d.ts.map
@@ -0,0 +1,40 @@
1
+ export const PREVIEW_HEALTH_PATH = '/__fimo/preview-health';
2
+ const OPTIMIZED_DEP_PATH = '/node_modules/.vite/deps/';
3
+ export default function previewHealthPlugin() {
4
+ let failure = null;
5
+ return {
6
+ name: 'fimo:preview-health',
7
+ apply: 'serve',
8
+ configureServer(server) {
9
+ // FIMO-1589: the sandbox watcher needs a durable signal because Vite's
10
+ // one-shot HMR reload can fire before the hosted preview socket connects.
11
+ if (!process.env.FIMO_PREVIEW_ALLOWED_ORIGINS) {
12
+ return;
13
+ }
14
+ server.middlewares.use((req, res, next) => {
15
+ const url = new URL(req.url ?? '/', 'http://127.0.0.1');
16
+ if (url.pathname === PREVIEW_HEALTH_PATH) {
17
+ res.statusCode = 200;
18
+ res.setHeader('content-type', 'application/json');
19
+ res.end(JSON.stringify({
20
+ failureGeneration: failure?.generation ?? 0,
21
+ lastFailure: failure,
22
+ }));
23
+ return;
24
+ }
25
+ if (url.pathname.includes(OPTIMIZED_DEP_PATH) && url.searchParams.has('v')) {
26
+ res.once('finish', () => {
27
+ if (res.statusCode >= 500) {
28
+ failure = {
29
+ generation: (failure?.generation ?? 0) + 1,
30
+ status: res.statusCode,
31
+ at: Date.now(),
32
+ };
33
+ }
34
+ });
35
+ }
36
+ next();
37
+ });
38
+ },
39
+ };
40
+ }
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "bundled": true,
3
3
  "bundler": "esbuild",
4
- "bundledAt": "2026-08-26T21:27:51.775Z",
4
+ "bundledAt": "2026-08-27T06:57:04.498Z",
5
5
  "cliVersion": "2.1.0",
6
6
  "external": [
7
7
  "oxc-parser",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "fimo",
3
- "version": "2.2.0-staging.5",
3
+ "version": "2.2.0-staging.6",
4
4
  "description": "Fimo CLI - create, deploy, and manage Fimo projects",
5
5
  "keywords": [
6
6
  "astro-component"
@@ -77,6 +77,10 @@
77
77
  "types": "./dist/runtime/astro/internal.d.ts",
78
78
  "import": "./dist/runtime/astro/internal.js"
79
79
  },
80
+ "./vite/preview-health": {
81
+ "types": "./dist/build/vite/plugins/preview-health.d.ts",
82
+ "import": "./dist/build/vite/plugins/preview-health.js"
83
+ },
80
84
  "./next": {
81
85
  "types": "./dist/build/next/moved.d.ts",
82
86
  "import": "./dist/build/next/moved.js"
@@ -184,12 +188,12 @@
184
188
  "devDependencies": {
185
189
  "@clack/core": "^1.2.0",
186
190
  "@clack/prompts": "^1.2.0",
187
- "@fimo/agents-bundle": "2.2.0-staging.5",
188
- "@fimo/api-contracts": "2.2.0-staging.5",
189
- "@fimo/cli-kit": "2.2.0-staging.5",
190
- "@fimo/framework-detect": "2.2.0-staging.5",
191
- "@fimo/routes": "2.2.0-staging.5",
192
- "@fimo/tsconfig": "2.2.0-staging.5",
191
+ "@fimo/agents-bundle": "2.2.0-staging.6",
192
+ "@fimo/api-contracts": "2.2.0-staging.6",
193
+ "@fimo/cli-kit": "2.2.0-staging.6",
194
+ "@fimo/framework-detect": "2.2.0-staging.6",
195
+ "@fimo/routes": "2.2.0-staging.6",
196
+ "@fimo/tsconfig": "2.2.0-staging.6",
193
197
  "@types/node": "22.18.6",
194
198
  "agent-install": "^0.0.5",
195
199
  "astro": "^7.1.6",
@@ -9,8 +9,8 @@
9
9
  "check": "astro sync && astro check"
10
10
  },
11
11
  "dependencies": {
12
- "fimo": "2.2.0-staging.5",
13
- "fimo-astro": "2.2.0-staging.5"
12
+ "fimo": "2.2.0-staging.6",
13
+ "fimo-astro": "2.2.0-staging.6"
14
14
  },
15
15
  "devDependencies": {
16
16
  "@astrojs/check": "^0.9.10",
@@ -12,10 +12,10 @@
12
12
  },
13
13
  "dependencies": {
14
14
  "@tanstack/react-query": "^5.80.6",
15
- "fimo": "2.2.0-staging.5",
16
- "fimo-next": "2.2.0-staging.5",
17
- "fimo-react": "2.2.0-staging.5",
18
- "next": "^16.3.0",
15
+ "fimo": "2.2.0-staging.6",
16
+ "fimo-next": "2.2.0-staging.6",
17
+ "fimo-react": "2.2.0-staging.6",
18
+ "next": "^16.3.3",
19
19
  "react": "^19.2.7",
20
20
  "react-dom": "^19.2.7"
21
21
  },
@@ -21,10 +21,10 @@
21
21
  "cmdk": "^1.1.1",
22
22
  "date-fns": "^4.1.0",
23
23
  "embla-carousel-react": "^8.6.0",
24
- "fimo": "2.2.0-staging.5",
25
- "fimo-react": "2.2.0-staging.5",
26
- "fimo-react-router": "2.2.0-staging.5",
27
- "fimo-vite": "2.2.0-staging.5",
24
+ "fimo": "2.2.0-staging.6",
25
+ "fimo-react": "2.2.0-staging.6",
26
+ "fimo-react-router": "2.2.0-staging.6",
27
+ "fimo-vite": "2.2.0-staging.6",
28
28
  "input-otp": "^1.4.2",
29
29
  "isbot": "^5",
30
30
  "lucide-react": "^0.577.0",
@@ -11,8 +11,8 @@
11
11
  "prepare": "svelte-kit sync"
12
12
  },
13
13
  "dependencies": {
14
- "fimo": "2.2.0-staging.5",
15
- "fimo-sveltekit": "2.2.0-staging.5"
14
+ "fimo": "2.2.0-staging.6",
15
+ "fimo-sveltekit": "2.2.0-staging.6"
16
16
  },
17
17
  "devDependencies": {
18
18
  "@sveltejs/kit": "^2.70.2",
@@ -11,10 +11,10 @@
11
11
  },
12
12
  "dependencies": {
13
13
  "@tanstack/react-query": "^5.80.6",
14
- "fimo": "2.2.0-staging.5",
15
- "fimo-react": "2.2.0-staging.5",
16
- "fimo-react-router": "2.2.0-staging.5",
17
- "fimo-vite": "2.2.0-staging.5",
14
+ "fimo": "2.2.0-staging.6",
15
+ "fimo-react": "2.2.0-staging.6",
16
+ "fimo-react-router": "2.2.0-staging.6",
17
+ "fimo-vite": "2.2.0-staging.6",
18
18
  "react": "^19.2.7",
19
19
  "react-dom": "^19.2.7",
20
20
  "react-router": "^8.3.0"