fimo 0.21.0-staging.2 → 0.21.0-staging.4

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.
Files changed (59) hide show
  1. package/assets/agent-templates/_default/GOAL.md +10 -0
  2. package/assets/agent-templates/_default/capabilities.yaml +10 -0
  3. package/assets/content-templates/shared/types.eta +1 -1
  4. package/assets/skills/fimo-cli/SKILL.md +1 -1
  5. package/assets/skills/fimo-cli/references/agents.md +85 -32
  6. package/assets/skills/fimo-cli/references/deploy.md +9 -0
  7. package/assets/skills/fimo-cli/references/domains.md +4 -4
  8. package/assets/skills/fimo-cli/references/init.md +4 -0
  9. package/assets/skills/fimo-cli/references/locales.md +1 -1
  10. package/assets/skills/fimo-cli/references/mcp.md +1 -1
  11. package/assets/skills/fimo-cli/references/media.md +18 -1
  12. package/assets/skills/fimo-code/references/content/schema.md +23 -0
  13. package/assets/skills/fimo-code/references/frameworks/next/locales.md +4 -4
  14. package/assets/skills/fimo-code/references/frameworks/react-router.md +2 -1
  15. package/assets/skills/fimo-code/references/frameworks/sveltekit.md +3 -5
  16. package/assets/skills/fimo-code/references/locales.md +2 -2
  17. package/assets/skills/fimo-studio/references/billing-and-credits.md +6 -4
  18. package/assets/skills/fimo-studio/references/cms.md +2 -0
  19. package/assets/skills/fimo-studio/references/preview-and-responsive.md +1 -0
  20. package/dist/cli/bundle.json +1 -1
  21. package/dist/cli/index.js +102 -101
  22. package/dist/runtime/app/FimoProviders.js +8 -1
  23. package/dist/runtime/app/FimoScripts.d.ts +0 -1
  24. package/dist/runtime/app/FimoScripts.js +1 -4
  25. package/dist/runtime/next/client.d.ts +2 -2
  26. package/dist/runtime/next/client.js +1 -1
  27. package/dist/runtime/next/provider.d.ts +0 -5
  28. package/dist/runtime/next/provider.js +21 -6
  29. package/dist/runtime/preview/script.d.ts +3 -0
  30. package/dist/runtime/preview/script.js +14 -0
  31. package/dist/runtime/react/primitives/contracts.d.ts +7 -1
  32. package/dist/runtime/sveltekit/preview.d.ts +1 -2
  33. package/dist/runtime/sveltekit/preview.js +1 -14
  34. package/dist/scripts/sync-schemas.js +84 -0
  35. package/dist/scripts/validate-schemas.js +63 -2
  36. package/package.json +6 -1
  37. package/templates/astro/AGENTS.md +1 -1
  38. package/templates/astro/package.json +2 -1
  39. package/templates/astro/pnpm-workspace.yaml +6 -2
  40. package/templates/nextjs/.fimo/config.json +1 -2
  41. package/templates/nextjs/AGENTS.md +5 -15
  42. package/templates/nextjs/next.config.ts +3 -1
  43. package/templates/nextjs/package.json +2 -1
  44. package/templates/nextjs/pnpm-workspace.yaml +6 -2
  45. package/templates/nextjs/src/app/layout.tsx +16 -0
  46. package/templates/nextjs/src/locales.ts +3 -6
  47. package/templates/react-router/AGENTS.md +1 -1
  48. package/templates/react-router/package.json +3 -2
  49. package/templates/react-router/pnpm-workspace.yaml +6 -6
  50. package/templates/react-router/src/vite-env.d.ts +0 -1
  51. package/templates/sveltekit/AGENTS.md +1 -1
  52. package/templates/sveltekit/package.json +2 -1
  53. package/templates/sveltekit/pnpm-workspace.yaml +6 -2
  54. package/templates/nextjs/src/app/(default)/layout.tsx +0 -10
  55. package/templates/nextjs/src/app/[locale]/layout.tsx +0 -22
  56. package/templates/nextjs/src/app/[locale]/page.tsx +0 -1
  57. package/templates/nextjs/src/components/Document.tsx +0 -26
  58. package/templates/nextjs/src/components/FimoPreviewBridge.tsx +0 -13
  59. /package/templates/nextjs/src/app/{(default)/page.tsx → page.tsx} +0 -0
@@ -1,8 +1,8 @@
1
- # Build approval is handled by Fimo-controlled install commands (`fimo create
2
- # --install`, sandbox `fimopm install`, and E2E helpers) via scoped pnpm
3
- # allow-all-builds flags. Do NOT add `allowBuilds` / `onlyBuiltDependencies`
4
- # here: pnpm refuses to have both an allowlist and allow-all-builds
5
- # (ERR_PNPM_CONFIG_CONFLICT_BUILT_DEPENDENCIES), which makes sandbox installs
6
- # fail before the project's `fimo` dep is available.
1
+ # Keep dependency-script decisions explicit across local, Preview, and production installs.
2
+
3
+ strictDepBuilds: true
4
+ allowBuilds:
5
+ esbuild: true
6
+ fimo: true
7
7
 
8
8
  packages: []
@@ -3,7 +3,6 @@
3
3
  interface ImportMetaEnv {
4
4
  readonly VITE_API_URL?: string;
5
5
  readonly FIMO_ENV?: string;
6
- readonly VITE_PREVIEW_SCRIPT_URL?: string;
7
6
  }
8
7
 
9
8
  interface ImportMeta {
@@ -27,7 +27,7 @@ a code-only task, or use `npx fimo@latest` for project-local code generation and
27
27
  ## Project rules
28
28
 
29
29
  - **Deploy is on-demand**, not a save step. Batch related edits into one deploy.
30
- - With pnpm, run `pnpm install --config.dangerouslyAllowAllBuilds=true`; a bare install can skip the build scripts required by Fimo and the framework toolchain.
30
+ - Use the selected package manager's committed build-script policy. pnpm projects pin `pnpm@10.26.0` and approve `esbuild` and `fimo` through `pnpm-workspace.yaml#allowBuilds`; Bun projects trust the same packages through `package.json#trustedDependencies`. Run a plain install with the selected manager so local installation matches Preview and production publishing. Review new dependencies before extending the policy; all three paths stop on unreviewed scripts.
31
31
  - Treat the user's language request as part of setup. The first explicitly requested locale is the primary locale; put it first and set it as `i18n.defaultLocale` in `.fimo/config.json`. If no language is requested, keep `en` and state that choice. `src/locales.ts` derives the default and prefixed locale set from that config.
32
32
  - Preserve the native `[[locale=locale]]` route boundary. The optional parameter keeps the default locale at `/`; the matcher prevents ordinary top-level routes from being mistaken for locales. The root server layout passes the tracked `event.params` through `resolveLocale`, then sends that locale to `getLabels` and `FimoProvider`. Remove the extra brackets only when every locale must be prefixed.
33
33
  - Keep the document language request-aware: `src/hooks.server.ts` renders the initial `<html lang>`, and the root layout updates it after client navigation.
@@ -24,5 +24,6 @@
24
24
  },
25
25
  "engines": {
26
26
  "node": ">=22.22.0"
27
- }
27
+ },
28
+ "packageManager": "pnpm@10.26.0"
28
29
  }
@@ -1,4 +1,8 @@
1
- # Build approval is handled by Fimo-controlled install commands. Do not add a
2
- # package-level allowlist because Fimo installs with dangerouslyAllowAllBuilds.
1
+ # Keep dependency-script decisions explicit across local, Preview, and production installs.
2
+
3
+ strictDepBuilds: true
4
+ allowBuilds:
5
+ esbuild: true
6
+ fimo: true
3
7
 
4
8
  packages: []
@@ -1,10 +0,0 @@
1
- import type { ReactNode } from 'react';
2
-
3
- import Document from '../../components/Document';
4
- import { defaultLocale } from '../../locales';
5
-
6
- import '../globals.css';
7
-
8
- export default function DefaultLocaleLayout({ children }: Readonly<{ children: ReactNode }>) {
9
- return <Document locale={defaultLocale}>{children}</Document>;
10
- }
@@ -1,22 +0,0 @@
1
- import { notFound } from 'next/navigation';
2
- import type { ReactNode } from 'react';
3
-
4
- import Document from '../../components/Document';
5
- import { prefixedLocales } from '../../locales';
6
-
7
- import '../globals.css';
8
-
9
- export default async function LocaleLayout({
10
- children,
11
- params,
12
- }: Readonly<{ children: ReactNode; params: Promise<{ locale: string }> }>) {
13
- const { locale } = await params;
14
-
15
- // The default locale is served unprefixed by `app/(default)`, so its prefix
16
- // is not a second URL for the same page.
17
- if (!prefixedLocales.has(locale)) {
18
- notFound();
19
- }
20
-
21
- return <Document locale={locale}>{children}</Document>;
22
- }
@@ -1 +0,0 @@
1
- export { default } from '../(default)/page';
@@ -1,26 +0,0 @@
1
- import { FimoProvider } from 'fimo/next/client';
2
- import type { ReactNode } from 'react';
3
-
4
- import FimoPreviewBridge from './FimoPreviewBridge';
5
-
6
- /**
7
- * The HTML document for one locale tree. Only a root layout may render `<html>`
8
- * in the App Router, so each locale tree has its own root layout and renders
9
- * this with the locale that tree serves. That is what makes `<html lang>` and
10
- * the Fimo locale context correct on both the unprefixed and prefixed routes.
11
- */
12
- export default function Document({ children, locale }: Readonly<{ children: ReactNode; locale: string }>) {
13
- const previewScriptUrl = process.env.NEXT_PUBLIC_FIMO_PREVIEW_SCRIPT_URL;
14
-
15
- return (
16
- <html lang={locale}>
17
- <body>
18
- <FimoProvider locale={locale}>
19
- <FimoPreviewBridge />
20
- {children}
21
- </FimoProvider>
22
- {previewScriptUrl ? <script src={previewScriptUrl} defer /> : null}
23
- </body>
24
- </html>
25
- );
26
- }
@@ -1,13 +0,0 @@
1
- 'use client';
2
-
3
- import { FimoPreviewBridge as RuntimeFimoPreviewBridge } from 'fimo/next/client';
4
- import { usePathname, useRouter } from 'next/navigation';
5
- import { useCallback } from 'react';
6
-
7
- export default function FimoPreviewBridge() {
8
- const pathname = usePathname();
9
- const router = useRouter();
10
- const navigate = useCallback((to: string) => router.push(to), [router]);
11
-
12
- return <RuntimeFimoPreviewBridge pathname={pathname} navigate={navigate} />;
13
- }