fimo 2.2.0-staging.5 → 2.2.0-staging.7
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/assets/skills/fimo-code/references/frameworks/next.md +4 -1
- package/dist/build/astro/config.js +2 -1
- package/dist/build/vite/plugins/preview-health.d.ts +4 -0
- package/dist/build/vite/plugins/preview-health.js +40 -0
- package/dist/cli/bundle.json +1 -1
- package/package.json +11 -7
- package/templates/astro/package.json +2 -2
- package/templates/nextjs/package.json +4 -4
- package/templates/react-router/package.json +4 -4
- package/templates/sveltekit/package.json +2 -2
- package/templates/vite/package.json +4 -4
|
@@ -47,7 +47,10 @@ own tenant URL.
|
|
|
47
47
|
## Hosted preview config
|
|
48
48
|
|
|
49
49
|
Wrap the existing Next config once so `next dev` accepts Fimo's hosted preview
|
|
50
|
-
origins without exposing the active preview provider to the application
|
|
50
|
+
origins without exposing the active preview provider to the application. If
|
|
51
|
+
the application does not set Next's `devIndicators`, the wrapper hides it in
|
|
52
|
+
hosted Preview while local `next dev` keeps Next's default. Any explicit
|
|
53
|
+
`devIndicators` setting is preserved:
|
|
51
54
|
|
|
52
55
|
```ts
|
|
53
56
|
import type { NextConfig } from 'next';
|
|
@@ -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,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
|
+
}
|
package/dist/cli/bundle.json
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "fimo",
|
|
3
|
-
"version": "2.2.0-staging.
|
|
3
|
+
"version": "2.2.0-staging.7",
|
|
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.
|
|
188
|
-
"@fimo/api-contracts": "2.2.0-staging.
|
|
189
|
-
"@fimo/cli-kit": "2.2.0-staging.
|
|
190
|
-
"@fimo/framework-detect": "2.2.0-staging.
|
|
191
|
-
"@fimo/routes": "2.2.0-staging.
|
|
192
|
-
"@fimo/tsconfig": "2.2.0-staging.
|
|
191
|
+
"@fimo/agents-bundle": "2.2.0-staging.7",
|
|
192
|
+
"@fimo/api-contracts": "2.2.0-staging.7",
|
|
193
|
+
"@fimo/cli-kit": "2.2.0-staging.7",
|
|
194
|
+
"@fimo/framework-detect": "2.2.0-staging.7",
|
|
195
|
+
"@fimo/routes": "2.2.0-staging.7",
|
|
196
|
+
"@fimo/tsconfig": "2.2.0-staging.7",
|
|
193
197
|
"@types/node": "22.18.6",
|
|
194
198
|
"agent-install": "^0.0.5",
|
|
195
199
|
"astro": "^7.1.6",
|
|
@@ -12,10 +12,10 @@
|
|
|
12
12
|
},
|
|
13
13
|
"dependencies": {
|
|
14
14
|
"@tanstack/react-query": "^5.80.6",
|
|
15
|
-
"fimo": "2.2.0-staging.
|
|
16
|
-
"fimo-next": "2.2.0-staging.
|
|
17
|
-
"fimo-react": "2.2.0-staging.
|
|
18
|
-
"next": "^16.3.
|
|
15
|
+
"fimo": "2.2.0-staging.7",
|
|
16
|
+
"fimo-next": "2.2.0-staging.7",
|
|
17
|
+
"fimo-react": "2.2.0-staging.7",
|
|
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.
|
|
25
|
-
"fimo-react": "2.2.0-staging.
|
|
26
|
-
"fimo-react-router": "2.2.0-staging.
|
|
27
|
-
"fimo-vite": "2.2.0-staging.
|
|
24
|
+
"fimo": "2.2.0-staging.7",
|
|
25
|
+
"fimo-react": "2.2.0-staging.7",
|
|
26
|
+
"fimo-react-router": "2.2.0-staging.7",
|
|
27
|
+
"fimo-vite": "2.2.0-staging.7",
|
|
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.
|
|
15
|
-
"fimo-sveltekit": "2.2.0-staging.
|
|
14
|
+
"fimo": "2.2.0-staging.7",
|
|
15
|
+
"fimo-sveltekit": "2.2.0-staging.7"
|
|
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.
|
|
15
|
-
"fimo-react": "2.2.0-staging.
|
|
16
|
-
"fimo-react-router": "2.2.0-staging.
|
|
17
|
-
"fimo-vite": "2.2.0-staging.
|
|
14
|
+
"fimo": "2.2.0-staging.7",
|
|
15
|
+
"fimo-react": "2.2.0-staging.7",
|
|
16
|
+
"fimo-react-router": "2.2.0-staging.7",
|
|
17
|
+
"fimo-vite": "2.2.0-staging.7",
|
|
18
18
|
"react": "^19.2.7",
|
|
19
19
|
"react-dom": "^19.2.7",
|
|
20
20
|
"react-router": "^8.3.0"
|