fimo-next 2.2.0-staging.6 → 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/README.md +9 -1
- package/dist/config.d.ts +6 -3
- package/dist/config.js +13 -6
- package/package.json +5 -5
package/README.md
CHANGED
|
@@ -15,4 +15,12 @@ never manages Fimo runtime variables.
|
|
|
15
15
|
|
|
16
16
|
Server Components, data functions, and route handlers import from `fimo-next`;
|
|
17
17
|
Client Components import from `fimo-next/client`. The Next configuration
|
|
18
|
-
wrapper for hosted preview origins is available from `fimo-next/config`.
|
|
18
|
+
wrapper for hosted preview origins is available from `fimo-next/config`. If the
|
|
19
|
+
application does not set Next.js's `devIndicators`, it hides the development
|
|
20
|
+
indicator in hosted Previews while leaving local `next dev` unchanged. Explicit
|
|
21
|
+
`devIndicators` settings are preserved:
|
|
22
|
+
|
|
23
|
+
```ts
|
|
24
|
+
const nextConfig = { devIndicators: { position: 'bottom-left' } };
|
|
25
|
+
export default withFimo(nextConfig);
|
|
26
|
+
```
|
package/dist/config.d.ts
CHANGED
|
@@ -7,9 +7,12 @@ export type FimoNextConfig<TConfig extends object = object> = TConfig | FimoNext
|
|
|
7
7
|
/**
|
|
8
8
|
* Connect `next dev` to Fimo's hosted preview gateway. The platform supplies
|
|
9
9
|
* the allowed preview origins at runtime, so applications do not need to know
|
|
10
|
-
* which preview provider Fimo currently uses.
|
|
11
|
-
*
|
|
12
|
-
*
|
|
10
|
+
* which preview provider Fimo currently uses. When an application does not
|
|
11
|
+
* configure Next's development indicator, hosted Preview hides it while local
|
|
12
|
+
* development keeps Next's default. Explicit application config is preserved.
|
|
13
|
+
* Every other phase returns the application config unchanged: the Fimo
|
|
14
|
+
* connection is resolved by `FimoProvider` and the server runtime, not by this
|
|
15
|
+
* config wrapper.
|
|
13
16
|
*/
|
|
14
17
|
export declare function withFimo<TConfig extends object>(applicationConfig: FimoNextConfig<TConfig>): FimoNextConfigFactory<TConfig>;
|
|
15
18
|
//# sourceMappingURL=config.d.ts.map
|
package/dist/config.js
CHANGED
|
@@ -9,9 +9,12 @@ function readPreviewOrigins() {
|
|
|
9
9
|
/**
|
|
10
10
|
* Connect `next dev` to Fimo's hosted preview gateway. The platform supplies
|
|
11
11
|
* the allowed preview origins at runtime, so applications do not need to know
|
|
12
|
-
* which preview provider Fimo currently uses.
|
|
13
|
-
*
|
|
14
|
-
*
|
|
12
|
+
* which preview provider Fimo currently uses. When an application does not
|
|
13
|
+
* configure Next's development indicator, hosted Preview hides it while local
|
|
14
|
+
* development keeps Next's default. Explicit application config is preserved.
|
|
15
|
+
* Every other phase returns the application config unchanged: the Fimo
|
|
16
|
+
* connection is resolved by `FimoProvider` and the server runtime, not by this
|
|
17
|
+
* config wrapper.
|
|
15
18
|
*/
|
|
16
19
|
export function withFimo(applicationConfig) {
|
|
17
20
|
return async (phase, context) => {
|
|
@@ -20,14 +23,18 @@ export function withFimo(applicationConfig) {
|
|
|
20
23
|
return config;
|
|
21
24
|
}
|
|
22
25
|
const previewOrigins = readPreviewOrigins();
|
|
26
|
+
let developmentConfig = config;
|
|
27
|
+
if (previewOrigins.length > 0 && config.devIndicators === undefined) {
|
|
28
|
+
developmentConfig = { ...config, devIndicators: false };
|
|
29
|
+
}
|
|
23
30
|
if (previewOrigins.length === 0) {
|
|
24
|
-
return
|
|
31
|
+
return developmentConfig;
|
|
25
32
|
}
|
|
26
|
-
const configuredOrigins =
|
|
33
|
+
const configuredOrigins = developmentConfig.allowedDevOrigins;
|
|
27
34
|
const allowedDevOrigins = [
|
|
28
35
|
...(Array.isArray(configuredOrigins) ? configuredOrigins : []),
|
|
29
36
|
...previewOrigins,
|
|
30
37
|
].filter((origin, index, origins) => origins.indexOf(origin) === index);
|
|
31
|
-
return { ...
|
|
38
|
+
return { ...developmentConfig, allowedDevOrigins };
|
|
32
39
|
};
|
|
33
40
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "fimo-next",
|
|
3
|
-
"version": "2.2.0-staging.
|
|
3
|
+
"version": "2.2.0-staging.7",
|
|
4
4
|
"description": "Fimo runtime for Next.js projects.",
|
|
5
5
|
"files": [
|
|
6
6
|
"dist/",
|
|
@@ -45,13 +45,13 @@
|
|
|
45
45
|
"test:watch": "vitest"
|
|
46
46
|
},
|
|
47
47
|
"devDependencies": {
|
|
48
|
-
"@fimo/tsconfig": "2.2.0-staging.
|
|
48
|
+
"@fimo/tsconfig": "2.2.0-staging.7",
|
|
49
49
|
"@tanstack/react-query": "^5.80.6",
|
|
50
50
|
"@types/node": "22.18.6",
|
|
51
51
|
"@types/react": "19.2.14",
|
|
52
52
|
"@types/react-dom": "19.2.3",
|
|
53
|
-
"fimo": "2.2.0-staging.
|
|
54
|
-
"fimo-react": "2.2.0-staging.
|
|
53
|
+
"fimo": "2.2.0-staging.7",
|
|
54
|
+
"fimo-react": "2.2.0-staging.7",
|
|
55
55
|
"next": "16.3.3",
|
|
56
56
|
"react": "19.2.4",
|
|
57
57
|
"react-dom": "19.2.4",
|
|
@@ -60,7 +60,7 @@
|
|
|
60
60
|
},
|
|
61
61
|
"peerDependencies": {
|
|
62
62
|
"@tanstack/react-query": "^5.80.6",
|
|
63
|
-
"fimo": "2.2.0-staging.
|
|
63
|
+
"fimo": "2.2.0-staging.7",
|
|
64
64
|
"fimo-react": ">=2.0.1",
|
|
65
65
|
"next": "^15.0.0 || ^16.0.0",
|
|
66
66
|
"react": "^18.2.0 || ^19.0.0",
|