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.
- package/assets/agent-templates/_default/GOAL.md +10 -0
- package/assets/agent-templates/_default/capabilities.yaml +10 -0
- package/assets/content-templates/shared/types.eta +1 -1
- package/assets/skills/fimo-cli/SKILL.md +1 -1
- package/assets/skills/fimo-cli/references/agents.md +85 -32
- package/assets/skills/fimo-cli/references/deploy.md +9 -0
- package/assets/skills/fimo-cli/references/domains.md +4 -4
- package/assets/skills/fimo-cli/references/init.md +4 -0
- package/assets/skills/fimo-cli/references/locales.md +1 -1
- package/assets/skills/fimo-cli/references/mcp.md +1 -1
- package/assets/skills/fimo-cli/references/media.md +18 -1
- package/assets/skills/fimo-code/references/content/schema.md +23 -0
- package/assets/skills/fimo-code/references/frameworks/next/locales.md +4 -4
- package/assets/skills/fimo-code/references/frameworks/react-router.md +2 -1
- package/assets/skills/fimo-code/references/frameworks/sveltekit.md +3 -5
- package/assets/skills/fimo-code/references/locales.md +2 -2
- package/assets/skills/fimo-studio/references/billing-and-credits.md +6 -4
- package/assets/skills/fimo-studio/references/cms.md +2 -0
- package/assets/skills/fimo-studio/references/preview-and-responsive.md +1 -0
- package/dist/cli/bundle.json +1 -1
- package/dist/cli/index.js +102 -101
- package/dist/runtime/app/FimoProviders.js +8 -1
- package/dist/runtime/app/FimoScripts.d.ts +0 -1
- package/dist/runtime/app/FimoScripts.js +1 -4
- package/dist/runtime/next/client.d.ts +2 -2
- package/dist/runtime/next/client.js +1 -1
- package/dist/runtime/next/provider.d.ts +0 -5
- package/dist/runtime/next/provider.js +21 -6
- package/dist/runtime/preview/script.d.ts +3 -0
- package/dist/runtime/preview/script.js +14 -0
- package/dist/runtime/react/primitives/contracts.d.ts +7 -1
- package/dist/runtime/sveltekit/preview.d.ts +1 -2
- package/dist/runtime/sveltekit/preview.js +1 -14
- package/dist/scripts/sync-schemas.js +84 -0
- package/dist/scripts/validate-schemas.js +63 -2
- package/package.json +6 -1
- package/templates/astro/AGENTS.md +1 -1
- package/templates/astro/package.json +2 -1
- package/templates/astro/pnpm-workspace.yaml +6 -2
- package/templates/nextjs/.fimo/config.json +1 -2
- package/templates/nextjs/AGENTS.md +5 -15
- package/templates/nextjs/next.config.ts +3 -1
- package/templates/nextjs/package.json +2 -1
- package/templates/nextjs/pnpm-workspace.yaml +6 -2
- package/templates/nextjs/src/app/layout.tsx +16 -0
- package/templates/nextjs/src/locales.ts +3 -6
- package/templates/react-router/AGENTS.md +1 -1
- package/templates/react-router/package.json +3 -2
- package/templates/react-router/pnpm-workspace.yaml +6 -6
- package/templates/react-router/src/vite-env.d.ts +0 -1
- package/templates/sveltekit/AGENTS.md +1 -1
- package/templates/sveltekit/package.json +2 -1
- package/templates/sveltekit/pnpm-workspace.yaml +6 -2
- package/templates/nextjs/src/app/(default)/layout.tsx +0 -10
- package/templates/nextjs/src/app/[locale]/layout.tsx +0 -22
- package/templates/nextjs/src/app/[locale]/page.tsx +0 -1
- package/templates/nextjs/src/components/Document.tsx +0 -26
- package/templates/nextjs/src/components/FimoPreviewBridge.tsx +0 -13
- /package/templates/nextjs/src/app/{(default)/page.tsx → page.tsx} +0 -0
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
#
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
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: []
|
|
@@ -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
|
-
-
|
|
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.
|
|
@@ -1,4 +1,8 @@
|
|
|
1
|
-
#
|
|
2
|
-
|
|
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
|
-
}
|
|
File without changes
|