fimo 0.3.2 → 0.3.3-experimental.1783410168478
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/references/locales.md +13 -1
- package/dist/build/vite/index.d.ts.map +1 -1
- package/dist/build/vite/index.js +9 -1
- package/dist/cli/bundle.json +2 -2
- package/dist/cli/index.js +469 -224
- package/dist/runtime/primitives/index.d.ts +1 -1
- package/dist/runtime/primitives/index.d.ts.map +1 -1
- package/dist/runtime/primitives/public-surface.test.d.ts +2 -0
- package/dist/runtime/primitives/public-surface.test.d.ts.map +1 -0
- package/dist/runtime/primitives/public-surface.test.js +14 -0
- package/package.json +1 -1
- package/release.json +2 -2
- package/scripts/publish-npm.mjs +53 -47
- package/templates/react-router/package.json +1 -1
|
@@ -85,7 +85,19 @@ Read the active locale with `useLocale()` when component logic needs it:
|
|
|
85
85
|
```tsx
|
|
86
86
|
import { useLocale } from 'fimo/ui';
|
|
87
87
|
|
|
88
|
-
const { locale, defaultLocale, routePath } = useLocale();
|
|
88
|
+
const { locale, defaultLocale, locales, routePath, dir } = useLocale();
|
|
89
|
+
```
|
|
90
|
+
|
|
91
|
+
`locales` lists every configured locale, so a language switcher needs no API call and no extra component:
|
|
92
|
+
|
|
93
|
+
```tsx
|
|
94
|
+
const { locale, locales, routePath } = useLocale();
|
|
95
|
+
|
|
96
|
+
locales.map((code) => (
|
|
97
|
+
<FimoLink key={code} to={routePath} locale={code} aria-current={code === locale ? 'true' : undefined}>
|
|
98
|
+
{new Intl.DisplayNames([code], { type: 'language' }).of(code)}
|
|
99
|
+
</FimoLink>
|
|
100
|
+
));
|
|
89
101
|
```
|
|
90
102
|
|
|
91
103
|
## Custom Frameworks
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/build/vite/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAU,YAAY,EAAE,MAAM,MAAM,CAAC;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/build/vite/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAU,YAAY,EAAE,MAAM,MAAM,CAAC;AAiFjD,MAAM,WAAW,eAAe;IAC9B;;;;;OAKG;IACH,OAAO,CAAC,EAAE,OAAO,CAAC;IAElB;;;;;;OAMG;IACH,MAAM,CAAC,EAAE,OAAO,CAAC;IAEjB;;;;;;;;;;OAUG;IACH,GAAG,CAAC,EAAE,OAAO,CAAC;CACf;AAGD,wBAAgB,IAAI,CAAC,IAAI,GAAE,eAAoB,GAAG,YAAY,EAAE,CAsB/D"}
|
package/dist/build/vite/index.js
CHANGED
|
@@ -34,7 +34,15 @@ function bundleFimoIntoSsrPlugin() {
|
|
|
34
34
|
config: () => ({
|
|
35
35
|
ssr: { noExternal: ['fimo'] },
|
|
36
36
|
optimizeDeps: {
|
|
37
|
-
include
|
|
37
|
+
// Pre-include fimo's scanner-invisible dependency surface. The
|
|
38
|
+
// scanner can't traverse the fimo package (virtual: imports), so deps
|
|
39
|
+
// reached only THROUGH fimo (its react-router adapter subpath, its
|
|
40
|
+
// internal react-query usage) get discovered mid-first-load — vite
|
|
41
|
+
// re-optimizes and 504s the in-flight generation's chunks ("Outdated
|
|
42
|
+
// Optimize Dep") and the app never mounts (blank preview; caught by
|
|
43
|
+
// content/query e2e). Deps the template's own source imports (react,
|
|
44
|
+
// react-router) are scanner-visible and need no listing.
|
|
45
|
+
include: ['fimo/ui', 'fimo/react-router', '@tanstack/react-query'],
|
|
38
46
|
esbuildOptions: {
|
|
39
47
|
plugins: [
|
|
40
48
|
{
|
package/dist/cli/bundle.json
CHANGED