fimo 0.20.0 → 0.21.0-experimental.1
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 +1 -1
- 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 +2 -1
- package/assets/skills/fimo-cli/references/agents.md +136 -36
- package/assets/skills/fimo-cli/references/branches.md +8 -5
- package/assets/skills/fimo-cli/references/deploy.md +11 -2
- package/assets/skills/fimo-cli/references/domains.md +12 -0
- package/assets/skills/fimo-cli/references/forms.md +1 -1
- package/assets/skills/fimo-cli/references/init.md +9 -2
- 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-cli/references/project-vars-and-secrets.md +3 -1
- package/assets/skills/fimo-cli/references/projects.md +7 -7
- package/assets/skills/fimo-code/assets/react-router-locales/navigation.tsx +1 -1
- package/assets/skills/fimo-code/references/assets.md +2 -2
- package/assets/skills/fimo-code/references/best-practices/next.md +1 -1
- package/assets/skills/fimo-code/references/content/schema.md +23 -0
- package/assets/skills/fimo-code/references/forms.md +1 -1
- package/assets/skills/fimo-code/references/frameworks/astro.md +8 -2
- package/assets/skills/fimo-code/references/frameworks/compatibility.md +9 -9
- package/assets/skills/fimo-code/references/frameworks/hosting.md +17 -13
- package/assets/skills/fimo-code/references/frameworks/next/app-router.md +8 -9
- package/assets/skills/fimo-code/references/frameworks/next/locales.md +5 -5
- package/assets/skills/fimo-code/references/frameworks/next/pages-router.md +5 -5
- package/assets/skills/fimo-code/references/frameworks/next.md +41 -32
- package/assets/skills/fimo-code/references/frameworks/react-router.md +10 -7
- package/assets/skills/fimo-code/references/frameworks/sveltekit.md +22 -15
- package/assets/skills/fimo-code/references/frameworks/vite-react.md +7 -5
- package/assets/skills/fimo-code/references/labels.md +4 -4
- package/assets/skills/fimo-code/references/locales.md +2 -2
- package/assets/skills/fimo-code/references/ui.md +4 -4
- package/assets/skills/fimo-migration/SKILL.md +51 -30
- package/assets/skills/fimo-migration/references/frameworks/nextjs.md +12 -15
- package/assets/skills/fimo-migration/references/media.md +12 -8
- package/assets/skills/fimo-migration/references/qa.md +12 -11
- package/assets/skills/fimo-migration/references/workers/content-planner.md +33 -4
- package/assets/skills/fimo-migration/references/workers/validator.md +10 -0
- package/assets/skills/fimo-migration/references/workers.md +19 -10
- package/assets/skills/fimo-migration/references/workflow.md +29 -11
- package/assets/skills/fimo-studio/references/ai-chat.md +1 -1
- package/assets/skills/fimo-studio/references/billing-and-credits.md +18 -1
- package/assets/skills/fimo-studio/references/cms.md +2 -0
- package/assets/skills/fimo-studio/references/preview-and-responsive.md +1 -0
- package/assets/starters/fimo-site/template/src/pages/Contact.tsx +1 -1
- package/assets/starters/fimo-site/template/src/pages/SiteContent.tsx +1 -1
- package/assets/starters/fimo-site/template/src/schemas/HomePage.ts +3 -3
- package/assets/starters/fimo-site/template/src/schemas/HomePage.types.ts +1 -1
- package/dist/build/astro/config.d.ts +13 -2
- package/dist/build/astro/config.js +9 -24
- package/dist/build/next/moved.d.ts +2 -0
- package/dist/build/next/moved.js +2 -0
- package/dist/build/react/router-moved.d.ts +2 -0
- package/dist/build/react/router-moved.js +2 -0
- package/dist/build/react/router-preset-moved.d.ts +2 -0
- package/dist/build/react/router-preset-moved.js +2 -0
- package/dist/build/react/router-routes-moved.d.ts +2 -0
- package/dist/build/react/router-routes-moved.js +2 -0
- package/dist/build/react/ui-moved.d.ts +2 -0
- package/dist/build/react/ui-moved.js +2 -0
- package/dist/build/react/vite-moved.d.ts +2 -0
- package/dist/build/react/vite-moved.js +2 -0
- package/dist/build/sveltekit/config.d.ts +5 -4
- package/dist/build/sveltekit/config.js +6 -15
- package/dist/build/sveltekit/moved.d.ts +13 -0
- package/dist/build/sveltekit/moved.js +3 -0
- package/dist/build/vite/data-id.d.ts +11 -0
- package/dist/build/vite/data-id.js +20 -0
- package/dist/build/vite/plugins/runtime-env.d.ts +1 -1
- package/dist/build/vite/plugins/runtime-env.js +6 -2
- package/dist/build/vite/runtime-env.d.ts +2 -0
- package/dist/build/vite/runtime-env.js +1 -0
- package/dist/cli/bundle.json +1 -1
- package/dist/cli/index.js +115 -110
- package/dist/runtime/content/client/internal.js +1 -1
- package/dist/runtime/content/index.d.ts +6 -1
- package/dist/runtime/content/index.js +6 -0
- package/dist/runtime/i18n/index.d.ts +2 -0
- package/dist/runtime/i18n/index.js +1 -0
- package/dist/runtime/labels/index.d.ts +3 -0
- package/dist/runtime/labels/index.js +2 -0
- package/dist/runtime/preview/index.d.ts +5 -0
- package/dist/runtime/preview/index.js +4 -0
- package/dist/runtime/preview/script.d.ts +3 -0
- package/dist/runtime/preview/script.js +14 -0
- package/dist/runtime/primitives/lib/index.d.ts +2 -0
- package/dist/runtime/primitives/lib/index.js +2 -0
- package/dist/runtime/seo/index.d.ts +0 -8
- package/dist/runtime/seo/index.js +0 -8
- package/dist/runtime/shared/config.d.ts +6 -0
- package/dist/runtime/shared/config.js +4 -0
- package/dist/runtime/shared/local-runtime-env.d.ts +2 -2
- package/dist/runtime/shared/local-runtime-env.js +7 -5
- package/dist/runtime/templates.d.ts +20 -4
- package/dist/runtime/templates.js +60 -18
- package/dist/scripts/extract-translations.js +8 -3
- package/dist/scripts/index.d.ts +3 -0
- package/dist/scripts/index.js +2 -0
- package/dist/scripts/sync-forms.js +21 -9
- package/dist/scripts/sync-schemas.js +129 -21
- package/dist/scripts/validate-schemas.js +63 -2
- package/package.json +72 -71
- package/release.json +2 -2
- package/templates/astro/AGENTS.md +1 -1
- package/templates/astro/astro.config.mjs +1 -1
- package/templates/astro/package.json +4 -2
- package/templates/astro/pnpm-workspace.yaml +6 -2
- package/templates/nextjs/.fimo/config.json +1 -2
- package/templates/nextjs/AGENTS.md +6 -16
- package/templates/nextjs/next.config.ts +4 -2
- package/templates/nextjs/package.json +4 -2
- 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 +5 -2
- package/templates/react-router/pnpm-workspace.yaml +6 -6
- package/templates/react-router/react-router.config.ts +1 -1
- package/templates/react-router/src/pages/legal/LegalPage.tsx +1 -1
- package/templates/react-router/src/root.tsx +1 -1
- package/templates/react-router/src/vite-env.d.ts +0 -1
- package/templates/react-router/vite.config.ts +1 -1
- package/templates/sveltekit/AGENTS.md +1 -1
- package/templates/sveltekit/package.json +4 -2
- package/templates/sveltekit/pnpm-workspace.yaml +6 -2
- package/templates/sveltekit/src/routes/+layout.server.ts +1 -1
- package/templates/sveltekit/src/routes/+layout.svelte +1 -1
- package/templates/sveltekit/svelte.config.js +1 -1
- package/templates/sveltekit/vite.config.ts +1 -1
- package/assets/sveltekit/components/Boolean.svelte +0 -19
- package/assets/sveltekit/components/Date.svelte +0 -33
- package/assets/sveltekit/components/DateTime.svelte +0 -35
- package/assets/sveltekit/components/FimoProvider.svelte +0 -35
- package/assets/sveltekit/components/Image.svelte +0 -80
- package/assets/sveltekit/components/Json.svelte +0 -18
- package/assets/sveltekit/components/Label.svelte +0 -16
- package/assets/sveltekit/components/Number.svelte +0 -21
- package/assets/sveltekit/components/RichText.svelte +0 -19
- package/assets/sveltekit/components/Text.svelte +0 -30
- package/assets/sveltekit/components/Video.svelte +0 -37
- package/assets/sveltekit/components/index.d.ts +0 -11
- package/assets/sveltekit/components/index.js +0 -11
- package/dist/build/next/config.d.ts +0 -17
- package/dist/build/next/config.js +0 -66
- package/dist/build/sveltekit/data-id.d.ts +0 -3
- package/dist/build/sveltekit/data-id.js +0 -171
- package/dist/build/sveltekit/files/edge.js +0 -68
- package/dist/build/sveltekit/files/serverless.js +0 -42
- package/dist/build/sveltekit/vite.d.ts +0 -12
- package/dist/build/sveltekit/vite.js +0 -14
- package/dist/build/vite/index.d.ts +0 -42
- package/dist/build/vite/index.js +0 -160
- package/dist/build/vite/plugins/content-sync.d.ts +0 -11
- package/dist/build/vite/plugins/content-sync.js +0 -41
- package/dist/build/vite/plugins/data-id.d.ts +0 -12
- package/dist/build/vite/plugins/data-id.js +0 -109
- package/dist/build/vite/plugins/fimo-config.d.ts +0 -12
- package/dist/build/vite/plugins/fimo-config.js +0 -68
- package/dist/build/vite/plugins/overlay.d.ts +0 -3
- package/dist/build/vite/plugins/overlay.js +0 -154
- package/dist/build/vite/plugins/robots.d.ts +0 -10
- package/dist/build/vite/plugins/robots.js +0 -56
- package/dist/build/vite/plugins/seo.d.ts +0 -3
- package/dist/build/vite/plugins/seo.js +0 -112
- package/dist/build/vite/plugins/server-config.d.ts +0 -3
- package/dist/build/vite/plugins/server-config.js +0 -36
- package/dist/build/vite/plugins/sitemap.d.ts +0 -3
- package/dist/build/vite/plugins/sitemap.js +0 -73
- package/dist/build/vite/plugins/translations.d.ts +0 -11
- package/dist/build/vite/plugins/translations.js +0 -601
- package/dist/runtime/app/FimoProviders.d.ts +0 -30
- package/dist/runtime/app/FimoProviders.js +0 -186
- package/dist/runtime/app/FimoScripts.d.ts +0 -14
- package/dist/runtime/app/FimoScripts.js +0 -48
- package/dist/runtime/app/index.d.ts +0 -8
- package/dist/runtime/app/index.js +0 -4
- package/dist/runtime/app/prefetch.d.ts +0 -9
- package/dist/runtime/app/prefetch.js +0 -39
- package/dist/runtime/content/DataSourcesProvider.d.ts +0 -4
- package/dist/runtime/content/DataSourcesProvider.js +0 -63
- package/dist/runtime/content/RefreshContentProvider.d.ts +0 -19
- package/dist/runtime/content/RefreshContentProvider.js +0 -71
- package/dist/runtime/content/client/createContentClient.d.ts +0 -7
- package/dist/runtime/content/client/createContentClient.js +0 -7
- package/dist/runtime/content/client/createSingletonClient.d.ts +0 -5
- package/dist/runtime/content/client/createSingletonClient.js +0 -6
- package/dist/runtime/content/client/react-content-client.d.ts +0 -10
- package/dist/runtime/content/client/react-content-client.js +0 -165
- package/dist/runtime/content/client/react-singleton-client.d.ts +0 -7
- package/dist/runtime/content/client/react-singleton-client.js +0 -38
- package/dist/runtime/content/client/types.d.ts +0 -42
- package/dist/runtime/content/client/types.js +0 -1
- package/dist/runtime/content/client/useQueryLocale.d.ts +0 -2
- package/dist/runtime/content/client/useQueryLocale.js +0 -5
- package/dist/runtime/content/client/vite-runtime.d.ts +0 -3
- package/dist/runtime/content/client/vite-runtime.js +0 -23
- package/dist/runtime/content/utils/retrieve-data-sources.d.ts +0 -29
- package/dist/runtime/content/utils/retrieve-data-sources.js +0 -107
- package/dist/runtime/core/AppErrorBoundary.d.ts +0 -10
- package/dist/runtime/core/AppErrorBoundary.js +0 -27
- package/dist/runtime/core/ViteLifecycles.d.ts +0 -5
- package/dist/runtime/core/ViteLifecycles.js +0 -35
- package/dist/runtime/i18n/FimoLocaleContext.d.ts +0 -9
- package/dist/runtime/i18n/FimoLocaleContext.js +0 -17
- package/dist/runtime/iframe/ConsoleErrorProvider.d.ts +0 -3
- package/dist/runtime/iframe/ConsoleErrorProvider.js +0 -103
- package/dist/runtime/iframe/ScreenshotProvider.d.ts +0 -3
- package/dist/runtime/iframe/ScreenshotProvider.js +0 -60
- package/dist/runtime/iframe/runtime/overlay-hmr.d.ts +0 -2
- package/dist/runtime/iframe/runtime/overlay-hmr.js +0 -27
- package/dist/runtime/iframe/runtime/overlay-runtime.d.ts +0 -2
- package/dist/runtime/iframe/runtime/overlay-runtime.js +0 -103
- package/dist/runtime/index.d.ts +0 -22
- package/dist/runtime/index.js +0 -23
- package/dist/runtime/next/client-runtime.d.ts +0 -3
- package/dist/runtime/next/client-runtime.js +0 -24
- package/dist/runtime/next/client.d.ts +0 -28
- package/dist/runtime/next/client.js +0 -25
- package/dist/runtime/next/facade.d.ts +0 -8
- package/dist/runtime/next/facade.js +0 -34
- package/dist/runtime/next/labels.d.ts +0 -7
- package/dist/runtime/next/labels.js +0 -9
- package/dist/runtime/next/preview.d.ts +0 -13
- package/dist/runtime/next/preview.js +0 -34
- package/dist/runtime/next/primitives/Text.d.ts +0 -10
- package/dist/runtime/next/primitives/Text.js +0 -18
- package/dist/runtime/next/primitives/server.d.ts +0 -11
- package/dist/runtime/next/primitives/server.js +0 -54
- package/dist/runtime/next/provider.d.ts +0 -18
- package/dist/runtime/next/provider.js +0 -39
- package/dist/runtime/next/server-runtime.d.ts +0 -3
- package/dist/runtime/next/server-runtime.js +0 -23
- package/dist/runtime/next/server.d.ts +0 -21
- package/dist/runtime/next/server.js +0 -16
- package/dist/runtime/primitives/index.d.ts +0 -16
- package/dist/runtime/primitives/index.js +0 -17
- package/dist/runtime/react/primitives/contracts.d.ts +0 -94
- package/dist/runtime/react/primitives/contracts.js +0 -1
- package/dist/runtime/react/primitives/editable/Boolean.d.ts +0 -5
- package/dist/runtime/react/primitives/editable/Boolean.js +0 -11
- package/dist/runtime/react/primitives/editable/Date.d.ts +0 -4
- package/dist/runtime/react/primitives/editable/Date.js +0 -12
- package/dist/runtime/react/primitives/editable/DateTime.d.ts +0 -4
- package/dist/runtime/react/primitives/editable/DateTime.js +0 -13
- package/dist/runtime/react/primitives/editable/Image.d.ts +0 -4
- package/dist/runtime/react/primitives/editable/Image.js +0 -10
- package/dist/runtime/react/primitives/editable/Json.d.ts +0 -5
- package/dist/runtime/react/primitives/editable/Json.js +0 -11
- package/dist/runtime/react/primitives/editable/RichText.d.ts +0 -4
- package/dist/runtime/react/primitives/editable/RichText.js +0 -11
- package/dist/runtime/react/primitives/editable/Text.d.ts +0 -20
- package/dist/runtime/react/primitives/editable/Text.js +0 -36
- package/dist/runtime/react/primitives/editable/Video.d.ts +0 -4
- package/dist/runtime/react/primitives/editable/Video.js +0 -10
- package/dist/runtime/react/primitives/renderers/DateRenderer.d.ts +0 -17
- package/dist/runtime/react/primitives/renderers/DateRenderer.js +0 -17
- package/dist/runtime/react/primitives/renderers/ImageRenderer.d.ts +0 -8
- package/dist/runtime/react/primitives/renderers/ImageRenderer.js +0 -31
- package/dist/runtime/react/primitives/renderers/RichTextRenderer.d.ts +0 -12
- package/dist/runtime/react/primitives/renderers/RichTextRenderer.js +0 -135
- package/dist/runtime/react/primitives/renderers/StaticImage.d.ts +0 -35
- package/dist/runtime/react/primitives/renderers/StaticImage.js +0 -58
- package/dist/runtime/react/primitives/renderers/VideoRenderer.d.ts +0 -8
- package/dist/runtime/react/primitives/renderers/VideoRenderer.js +0 -10
- package/dist/runtime/react/useFimoLiveValue.d.ts +0 -20
- package/dist/runtime/react/useFimoLiveValue.js +0 -43
- package/dist/runtime/react-router/active-routes.d.ts +0 -12
- package/dist/runtime/react-router/active-routes.js +0 -60
- package/dist/runtime/react-router/index.d.ts +0 -16
- package/dist/runtime/react-router/index.js +0 -20
- package/dist/runtime/react-router/legacy/routes.d.ts +0 -35
- package/dist/runtime/react-router/legacy/routes.js +0 -86
- package/dist/runtime/react-router/navigation-utils.d.ts +0 -8
- package/dist/runtime/react-router/navigation-utils.js +0 -36
- package/dist/runtime/react-router/navigation.d.ts +0 -12
- package/dist/runtime/react-router/navigation.js +0 -28
- package/dist/runtime/react-router/preset.d.ts +0 -30
- package/dist/runtime/react-router/preset.js +0 -33
- package/dist/runtime/routing/AppResetScrollOnNavigate.d.ts +0 -2
- package/dist/runtime/routing/AppResetScrollOnNavigate.js +0 -12
- package/dist/runtime/routing/AppRoutesProvider.d.ts +0 -25
- package/dist/runtime/routing/AppRoutesProvider.js +0 -112
- package/dist/runtime/seo/buildSeoForPath.d.ts +0 -74
- package/dist/runtime/seo/buildSeoForPath.js +0 -55
- package/dist/runtime/seo/htmlProps.d.ts +0 -13
- package/dist/runtime/seo/htmlProps.js +0 -15
- package/dist/runtime/sveltekit/content.d.ts +0 -25
- package/dist/runtime/sveltekit/content.js +0 -33
- package/dist/runtime/sveltekit/context-contract.d.ts +0 -5
- package/dist/runtime/sveltekit/context-contract.js +0 -2
- package/dist/runtime/sveltekit/context.d.ts +0 -8
- package/dist/runtime/sveltekit/context.js +0 -25
- package/dist/runtime/sveltekit/forms.d.ts +0 -15
- package/dist/runtime/sveltekit/forms.js +0 -15
- package/dist/runtime/sveltekit/index.d.ts +0 -9
- package/dist/runtime/sveltekit/index.js +0 -5
- package/dist/runtime/sveltekit/internal.d.ts +0 -6
- package/dist/runtime/sveltekit/internal.js +0 -12
- package/dist/runtime/sveltekit/labels.d.ts +0 -20
- package/dist/runtime/sveltekit/labels.js +0 -13
- package/dist/runtime/sveltekit/preview.d.ts +0 -28
- package/dist/runtime/sveltekit/preview.js +0 -82
- package/dist/runtime/sveltekit/runtime.d.ts +0 -9
- package/dist/runtime/sveltekit/runtime.js +0 -26
- package/dist/runtime/t/OptionalTracking.d.ts +0 -13
- package/dist/runtime/t/OptionalTracking.js +0 -28
- package/dist/runtime/t/Pageview.d.ts +0 -9
- package/dist/runtime/t/Pageview.js +0 -118
- package/dist/runtime/vite/Label.d.ts +0 -13
- package/dist/runtime/vite/Label.js +0 -16
- package/dist/runtime/vite/primitives/Images.d.ts +0 -4
- package/dist/runtime/vite/primitives/Images.js +0 -12
- package/dist/runtime/vite/translations.d.ts +0 -28
- package/dist/runtime/vite/translations.js +0 -103
- 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
|
@@ -23,8 +23,28 @@ const SCHEMA_DEFINITION_SCHEMA = z.object({
|
|
|
23
23
|
name: z.string().min(1).optional(),
|
|
24
24
|
isSingleton: z.boolean().optional(),
|
|
25
25
|
i18n: z.object({ enabled: z.boolean().optional() }).optional(),
|
|
26
|
+
groups: z
|
|
27
|
+
.array(z.object({ id: z.string().min(1), label: z.string().min(1), default: z.boolean().optional() }).strict())
|
|
28
|
+
.optional(),
|
|
26
29
|
fields: z.record(z.string(), z.unknown()).optional(),
|
|
27
30
|
});
|
|
31
|
+
const RUNTIME_TYPE_IMPORT_ORDER = [
|
|
32
|
+
'Fields',
|
|
33
|
+
'FimoBoolean',
|
|
34
|
+
'FimoMedia',
|
|
35
|
+
'FimoPolymorphicReference',
|
|
36
|
+
'FimoReference',
|
|
37
|
+
'FimoRichText',
|
|
38
|
+
'FimoRichTextContent',
|
|
39
|
+
'FimoString',
|
|
40
|
+
'Populate',
|
|
41
|
+
'PopulatedResult',
|
|
42
|
+
'ProjectedWithPopulate',
|
|
43
|
+
'Query',
|
|
44
|
+
'Sort',
|
|
45
|
+
'Where',
|
|
46
|
+
'WithReferences',
|
|
47
|
+
];
|
|
28
48
|
const CONTENT_TEMPLATE_PATHS = {
|
|
29
49
|
types: { current: 'shared/types.eta', legacy: 'types-template.eta' },
|
|
30
50
|
sharedServer: { current: 'shared/server.eta' },
|
|
@@ -83,6 +103,18 @@ function packageExportsSubpath(packageJson, subpath) {
|
|
|
83
103
|
!Array.isArray(exports) &&
|
|
84
104
|
Object.prototype.hasOwnProperty.call(exports, subpath));
|
|
85
105
|
}
|
|
106
|
+
function readProjectPackage(cwd, name) {
|
|
107
|
+
const packagePath = join(cwd, 'node_modules', name, 'package.json');
|
|
108
|
+
if (!existsSync(packagePath)) {
|
|
109
|
+
return null;
|
|
110
|
+
}
|
|
111
|
+
try {
|
|
112
|
+
return JSON.parse(readFileSync(packagePath, 'utf-8'));
|
|
113
|
+
}
|
|
114
|
+
catch {
|
|
115
|
+
return null;
|
|
116
|
+
}
|
|
117
|
+
}
|
|
86
118
|
function resolveProjectRuntime(cwd) {
|
|
87
119
|
const packagePath = join(cwd, 'node_modules', 'fimo', 'package.json');
|
|
88
120
|
if (!existsSync(packagePath)) {
|
|
@@ -108,22 +140,29 @@ function resolveProjectRuntime(cwd) {
|
|
|
108
140
|
return {
|
|
109
141
|
packageRoot: dirname(packagePath),
|
|
110
142
|
version,
|
|
111
|
-
|
|
143
|
+
providesReactRuntime: packageExportsSubpath(readProjectPackage(cwd, 'fimo-react'), '.'),
|
|
144
|
+
providesNextRuntime: packageExportsSubpath(readProjectPackage(cwd, 'fimo-next'), '.') &&
|
|
145
|
+
packageExportsSubpath(readProjectPackage(cwd, 'fimo-next'), './client'),
|
|
112
146
|
providesAstroRuntime: packageExportsSubpath(packageJson, './astro'),
|
|
113
|
-
|
|
147
|
+
// The SvelteKit runtime ships as its own package, so this probes the
|
|
148
|
+
// companion rather than a `fimo` subpath (FIMO-1635).
|
|
149
|
+
providesSvelteKitRuntime: packageExportsSubpath(readProjectPackage(cwd, 'fimo-sveltekit'), '.'),
|
|
114
150
|
};
|
|
115
151
|
}
|
|
116
152
|
function contentRuntimeImportFor(framework) {
|
|
117
153
|
if (framework === 'nextjs') {
|
|
118
|
-
return 'fimo
|
|
154
|
+
return 'fimo-next';
|
|
119
155
|
}
|
|
120
156
|
if (framework === 'astro') {
|
|
121
157
|
return 'fimo/astro';
|
|
122
158
|
}
|
|
123
|
-
|
|
124
|
-
|
|
159
|
+
// @vercel/frameworks reports SvelteKit as `sveltekit-1`, while Fimo's
|
|
160
|
+
// public runtime profile is `sveltekit`. Both describe the same codegen
|
|
161
|
+
// target; callers may supply either the detector evidence or the profile.
|
|
162
|
+
if (framework === 'sveltekit' || framework === 'sveltekit-1') {
|
|
163
|
+
return 'fimo-sveltekit';
|
|
125
164
|
}
|
|
126
|
-
return 'fimo
|
|
165
|
+
return 'fimo-react';
|
|
127
166
|
}
|
|
128
167
|
function templatePath(runtime, templateName) {
|
|
129
168
|
const template = CONTENT_TEMPLATE_PATHS[templateName];
|
|
@@ -134,13 +173,19 @@ function templatePath(runtime, templateName) {
|
|
|
134
173
|
return assetPath('content-templates', template.current);
|
|
135
174
|
}
|
|
136
175
|
function resolveSchemaGenerationTarget(runtimeImport, runtime) {
|
|
137
|
-
if (runtimeImport === 'fimo
|
|
176
|
+
if (runtimeImport === 'fimo-react' && !runtime.providesReactRuntime) {
|
|
177
|
+
throw new Error(`Cannot generate schema clients because the project does not provide the ` +
|
|
178
|
+
'fimo-react package required by this React project. ' +
|
|
179
|
+
`Install fimo-react@${runtime.version} alongside fimo, then run \`npx fimo@latest validate\` again. ` +
|
|
180
|
+
'No generated files were changed.');
|
|
181
|
+
}
|
|
182
|
+
if (runtimeImport === 'fimo-react') {
|
|
138
183
|
return 'react';
|
|
139
184
|
}
|
|
140
|
-
if (runtimeImport === 'fimo
|
|
141
|
-
throw new Error(`Cannot generate schema clients because project
|
|
142
|
-
'fimo
|
|
143
|
-
`
|
|
185
|
+
if (runtimeImport === 'fimo-next' && !runtime.providesNextRuntime) {
|
|
186
|
+
throw new Error(`Cannot generate schema clients because the project does not provide the ` +
|
|
187
|
+
'fimo-next and fimo-next/client exports required by this Next.js project. ' +
|
|
188
|
+
`Install fimo-next@${runtime.version} alongside fimo, then run \`npx fimo@latest validate\` again. ` +
|
|
144
189
|
'No generated files were changed.');
|
|
145
190
|
}
|
|
146
191
|
if (runtimeImport === 'fimo/astro' && !runtime.providesAstroRuntime) {
|
|
@@ -149,13 +194,12 @@ function resolveSchemaGenerationTarget(runtimeImport, runtime) {
|
|
|
149
194
|
`Run \`${CONTENT_CLIENT_RUNTIME_UPGRADE_COMMAND}\` in the project, then run \`npx fimo@latest validate\` again. ` +
|
|
150
195
|
'No generated files were changed.');
|
|
151
196
|
}
|
|
152
|
-
if (runtimeImport === 'fimo
|
|
153
|
-
throw new Error(
|
|
154
|
-
|
|
155
|
-
`Run \`${CONTENT_CLIENT_RUNTIME_UPGRADE_COMMAND}\` in the project, then run \`npx fimo@latest validate\` again. ` +
|
|
197
|
+
if (runtimeImport === 'fimo-sveltekit' && !runtime.providesSvelteKitRuntime) {
|
|
198
|
+
throw new Error('Cannot generate schema clients because this SvelteKit project has no project-local fimo-sveltekit package. ' +
|
|
199
|
+
`Run \`npm install fimo-sveltekit@${runtime.version}\` in the project, then run \`npx fimo@latest validate\` again. ` +
|
|
156
200
|
'No generated files were changed.');
|
|
157
201
|
}
|
|
158
|
-
if (runtimeImport === 'fimo
|
|
202
|
+
if (runtimeImport === 'fimo-next') {
|
|
159
203
|
return 'next';
|
|
160
204
|
}
|
|
161
205
|
return runtimeImport === 'fimo/astro' ? 'astro' : 'sveltekit';
|
|
@@ -166,17 +210,17 @@ function templatesForTarget(target, runtime, runtimeImport) {
|
|
|
166
210
|
{
|
|
167
211
|
suffix: '.types.ts',
|
|
168
212
|
path: templatePath(runtime, 'types'),
|
|
169
|
-
runtimeImport: 'fimo
|
|
213
|
+
runtimeImport: 'fimo-next',
|
|
170
214
|
},
|
|
171
215
|
{
|
|
172
216
|
suffix: '.ts',
|
|
173
217
|
path: templatePath(runtime, 'nextServer'),
|
|
174
|
-
runtimeImport: 'fimo
|
|
218
|
+
runtimeImport: 'fimo-next',
|
|
175
219
|
},
|
|
176
220
|
{
|
|
177
221
|
suffix: '.client.ts',
|
|
178
222
|
path: templatePath(runtime, 'nextClient'),
|
|
179
|
-
runtimeImport: 'fimo
|
|
223
|
+
runtimeImport: 'fimo-next/client',
|
|
180
224
|
},
|
|
181
225
|
];
|
|
182
226
|
}
|
|
@@ -199,12 +243,12 @@ function templatesForTarget(target, runtime, runtimeImport) {
|
|
|
199
243
|
{
|
|
200
244
|
suffix: '.types.ts',
|
|
201
245
|
path: templatePath(runtime, 'types'),
|
|
202
|
-
runtimeImport: 'fimo
|
|
246
|
+
runtimeImport: 'fimo-sveltekit',
|
|
203
247
|
},
|
|
204
248
|
{
|
|
205
249
|
suffix: '.ts',
|
|
206
250
|
path: templatePath(runtime, 'svelteKitContent'),
|
|
207
|
-
runtimeImport: 'fimo
|
|
251
|
+
runtimeImport: 'fimo-sveltekit',
|
|
208
252
|
},
|
|
209
253
|
];
|
|
210
254
|
}
|
|
@@ -335,6 +379,69 @@ function referenceImportsFor(schema, fields) {
|
|
|
335
379
|
}
|
|
336
380
|
return [...imports.values()].sort((a, b) => a.pascal.localeCompare(b.pascal));
|
|
337
381
|
}
|
|
382
|
+
function collectFieldRuntimeTypeImports(field, imports) {
|
|
383
|
+
if (!field || typeof field !== 'object' || Array.isArray(field)) {
|
|
384
|
+
return;
|
|
385
|
+
}
|
|
386
|
+
const definition = field;
|
|
387
|
+
switch (definition.type) {
|
|
388
|
+
case 'boolean':
|
|
389
|
+
imports.add('FimoBoolean');
|
|
390
|
+
return;
|
|
391
|
+
case 'media':
|
|
392
|
+
imports.add('FimoMedia');
|
|
393
|
+
return;
|
|
394
|
+
case 'reference':
|
|
395
|
+
imports.add(Array.isArray(definition.targets) && definition.targets.length > 0
|
|
396
|
+
? 'FimoPolymorphicReference'
|
|
397
|
+
: 'FimoReference');
|
|
398
|
+
return;
|
|
399
|
+
case 'richtext':
|
|
400
|
+
imports.add('FimoRichText');
|
|
401
|
+
imports.add('FimoRichTextContent');
|
|
402
|
+
return;
|
|
403
|
+
case 'blocks': {
|
|
404
|
+
const schema = definition.schema;
|
|
405
|
+
if (!schema || typeof schema !== 'object' || Array.isArray(schema)) {
|
|
406
|
+
return;
|
|
407
|
+
}
|
|
408
|
+
const blockSchema = schema;
|
|
409
|
+
const fieldGroups = Array.isArray(blockSchema.oneOf)
|
|
410
|
+
? blockSchema.oneOf.map((variant) => variant && typeof variant === 'object' && !Array.isArray(variant)
|
|
411
|
+
? variant.fields
|
|
412
|
+
: undefined)
|
|
413
|
+
: [blockSchema.fields];
|
|
414
|
+
for (const fields of fieldGroups) {
|
|
415
|
+
if (!fields || typeof fields !== 'object' || Array.isArray(fields)) {
|
|
416
|
+
continue;
|
|
417
|
+
}
|
|
418
|
+
for (const nestedField of Object.values(fields)) {
|
|
419
|
+
collectFieldRuntimeTypeImports(nestedField, imports);
|
|
420
|
+
}
|
|
421
|
+
}
|
|
422
|
+
return;
|
|
423
|
+
}
|
|
424
|
+
default:
|
|
425
|
+
return;
|
|
426
|
+
}
|
|
427
|
+
}
|
|
428
|
+
function runtimeTypeImportsFor(fields) {
|
|
429
|
+
const imports = new Set([
|
|
430
|
+
'Fields',
|
|
431
|
+
'FimoString',
|
|
432
|
+
'Populate',
|
|
433
|
+
'PopulatedResult',
|
|
434
|
+
'ProjectedWithPopulate',
|
|
435
|
+
'Query',
|
|
436
|
+
'Sort',
|
|
437
|
+
'Where',
|
|
438
|
+
'WithReferences',
|
|
439
|
+
]);
|
|
440
|
+
for (const field of Object.values(fields)) {
|
|
441
|
+
collectFieldRuntimeTypeImports(field, imports);
|
|
442
|
+
}
|
|
443
|
+
return RUNTIME_TYPE_IMPORT_ORDER.filter((typeImport) => imports.has(typeImport));
|
|
444
|
+
}
|
|
338
445
|
function schemaToModel(schema, localizedByUid) {
|
|
339
446
|
const fields = normalizeFields(schema.fields ?? {});
|
|
340
447
|
return {
|
|
@@ -353,6 +460,7 @@ function schemaToModel(schema, localizedByUid) {
|
|
|
353
460
|
.map(([fieldName]) => fieldName),
|
|
354
461
|
fields,
|
|
355
462
|
referenceImports: referenceImportsFor(schema, fields),
|
|
463
|
+
runtimeTypeImports: runtimeTypeImportsFor(fields),
|
|
356
464
|
};
|
|
357
465
|
}
|
|
358
466
|
export function syncSchemas(options) {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { existsSync, readFileSync, readdirSync } from 'node:fs';
|
|
2
2
|
import { basename, join, resolve } from 'node:path';
|
|
3
|
-
import { CONTENT_FIELD_NAME_PATTERN, CONTENT_FIELD_NAME_PATTERN_DESCRIPTION, CONTENT_TYPE_NAME_PATTERN, CONTENT_TYPE_NAME_PATTERN_DESCRIPTION, ContentFieldDefinitionSchema, FieldTypeSchema, MAX_STRUCTURED_CONTENT_DEPTH, RESERVED_CONTENT_FIELD_NAMES, collectConditionProblems, walkContentFields, } from '@fimo/api-contracts';
|
|
3
|
+
import { CONTENT_FIELD_NAME_PATTERN, CONTENT_FIELD_NAME_PATTERN_DESCRIPTION, CONTENT_TYPE_NAME_PATTERN, CONTENT_TYPE_NAME_PATTERN_DESCRIPTION, ContentFieldDefinitionSchema, ContentFieldGroupSchema, FieldTypeSchema, MAX_STRUCTURED_CONTENT_DEPTH, RESERVED_CONTENT_FIELD_NAMES, collectConditionProblems, walkContentFields, } from '@fimo/api-contracts';
|
|
4
4
|
/**
|
|
5
5
|
* Validate `src/schemas/*.json` locally against the same rules the API's
|
|
6
6
|
* schema validator enforces (field types, reserved field names, required
|
|
@@ -63,7 +63,7 @@ export function validateSchemaFile(absolutePath, file, schemaUids = new Set()) {
|
|
|
63
63
|
return [{ rule: 'schemas/shape', message: 'Schema must be a JSON object.', file }];
|
|
64
64
|
}
|
|
65
65
|
const errors = [];
|
|
66
|
-
const { uid, name, fields, i18n, isSingleton } = schema;
|
|
66
|
+
const { uid, name, fields, i18n, isSingleton, groups } = schema;
|
|
67
67
|
const expectedUid = basename(file, '.json');
|
|
68
68
|
if (typeof uid !== 'string' || uid.length === 0) {
|
|
69
69
|
errors.push({
|
|
@@ -119,6 +119,39 @@ export function validateSchemaFile(absolutePath, file, schemaUids = new Set()) {
|
|
|
119
119
|
}
|
|
120
120
|
}
|
|
121
121
|
}
|
|
122
|
+
const groupIds = new Set();
|
|
123
|
+
if (groups !== undefined) {
|
|
124
|
+
if (!Array.isArray(groups)) {
|
|
125
|
+
errors.push({ rule: 'schemas/groups', message: '"groups" must be an array.', file });
|
|
126
|
+
}
|
|
127
|
+
else {
|
|
128
|
+
let defaults = 0;
|
|
129
|
+
for (const [index, group] of groups.entries()) {
|
|
130
|
+
const parsed = ContentFieldGroupSchema.safeParse(group);
|
|
131
|
+
if (!parsed.success) {
|
|
132
|
+
errors.push({
|
|
133
|
+
rule: 'schemas/groups',
|
|
134
|
+
message: `Group at index ${index} is invalid: ${parsed.error.issues[0]?.message ?? 'invalid group'}.`,
|
|
135
|
+
file,
|
|
136
|
+
});
|
|
137
|
+
continue;
|
|
138
|
+
}
|
|
139
|
+
if (groupIds.has(parsed.data.id)) {
|
|
140
|
+
errors.push({
|
|
141
|
+
rule: 'schemas/groups',
|
|
142
|
+
message: `Group ID "${parsed.data.id}" is declared more than once.`,
|
|
143
|
+
file,
|
|
144
|
+
});
|
|
145
|
+
}
|
|
146
|
+
groupIds.add(parsed.data.id);
|
|
147
|
+
if (parsed.data.default)
|
|
148
|
+
defaults += 1;
|
|
149
|
+
}
|
|
150
|
+
if (defaults > 1) {
|
|
151
|
+
errors.push({ rule: 'schemas/groups', message: 'At most one group may be the default.', file });
|
|
152
|
+
}
|
|
153
|
+
}
|
|
154
|
+
}
|
|
122
155
|
if (typeof fields !== 'object' || fields === null || Array.isArray(fields)) {
|
|
123
156
|
errors.push({
|
|
124
157
|
rule: 'schemas/fields',
|
|
@@ -155,6 +188,27 @@ export function validateSchemaFile(absolutePath, file, schemaUids = new Set()) {
|
|
|
155
188
|
continue;
|
|
156
189
|
}
|
|
157
190
|
const { type } = definition;
|
|
191
|
+
const memberships = Array.isArray(definition.group)
|
|
192
|
+
? definition.group
|
|
193
|
+
: definition.group === undefined
|
|
194
|
+
? []
|
|
195
|
+
: [definition.group];
|
|
196
|
+
if (new Set(memberships).size !== memberships.length) {
|
|
197
|
+
errors.push({
|
|
198
|
+
rule: 'schemas/field-group',
|
|
199
|
+
message: `Field "${fieldName}" lists the same group more than once.`,
|
|
200
|
+
file,
|
|
201
|
+
});
|
|
202
|
+
}
|
|
203
|
+
for (const membership of memberships) {
|
|
204
|
+
if (typeof membership !== 'string' || !groupIds.has(membership)) {
|
|
205
|
+
errors.push({
|
|
206
|
+
rule: 'schemas/field-group',
|
|
207
|
+
message: `Field "${fieldName}" references unknown group "${String(membership)}".`,
|
|
208
|
+
file,
|
|
209
|
+
});
|
|
210
|
+
}
|
|
211
|
+
}
|
|
158
212
|
if (typeof type !== 'string' || !FIELD_TYPES.has(type)) {
|
|
159
213
|
errors.push({
|
|
160
214
|
rule: 'schemas/field-type',
|
|
@@ -203,6 +257,13 @@ export function validateSchemaFile(absolutePath, file, schemaUids = new Set()) {
|
|
|
203
257
|
}
|
|
204
258
|
parsedFields[fieldName] = parsed.data;
|
|
205
259
|
walkContentFields({ [fieldName]: parsed.data }, ({ field, path, structuredDepth, insideStructuredContent }) => {
|
|
260
|
+
if (insideStructuredContent && field.group !== undefined) {
|
|
261
|
+
errors.push({
|
|
262
|
+
rule: 'schemas/field-group',
|
|
263
|
+
message: `Field "${path.join('.')}" cannot use "group" inside blocks.`,
|
|
264
|
+
file,
|
|
265
|
+
});
|
|
266
|
+
}
|
|
206
267
|
if (field.type === 'blocks' && structuredDepth >= MAX_STRUCTURED_CONTENT_DEPTH) {
|
|
207
268
|
errors.push({
|
|
208
269
|
rule: 'schemas/structured-content-depth',
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "fimo",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.21.0-experimental.1",
|
|
4
4
|
"description": "Fimo CLI - create, deploy, and manage Fimo projects",
|
|
5
5
|
"bin": {
|
|
6
6
|
"fimo": "dist/cli/index.js"
|
|
@@ -19,8 +19,8 @@
|
|
|
19
19
|
"exports": {
|
|
20
20
|
"./package.json": "./package.json",
|
|
21
21
|
"./ui": {
|
|
22
|
-
"types": "./dist/
|
|
23
|
-
"import": "./dist/
|
|
22
|
+
"types": "./dist/build/react/ui-moved.d.ts",
|
|
23
|
+
"import": "./dist/build/react/ui-moved.js"
|
|
24
24
|
},
|
|
25
25
|
"./content": {
|
|
26
26
|
"types": "./dist/runtime/content/index.d.ts",
|
|
@@ -30,6 +30,34 @@
|
|
|
30
30
|
"types": "./dist/runtime/forms/index.d.ts",
|
|
31
31
|
"import": "./dist/runtime/forms/index.js"
|
|
32
32
|
},
|
|
33
|
+
"./labels": {
|
|
34
|
+
"types": "./dist/runtime/labels/index.d.ts",
|
|
35
|
+
"import": "./dist/runtime/labels/index.js"
|
|
36
|
+
},
|
|
37
|
+
"./i18n": {
|
|
38
|
+
"types": "./dist/runtime/i18n/index.d.ts",
|
|
39
|
+
"import": "./dist/runtime/i18n/index.js"
|
|
40
|
+
},
|
|
41
|
+
"./preview": {
|
|
42
|
+
"types": "./dist/runtime/preview/index.d.ts",
|
|
43
|
+
"import": "./dist/runtime/preview/index.js"
|
|
44
|
+
},
|
|
45
|
+
"./primitives": {
|
|
46
|
+
"types": "./dist/runtime/primitives/lib/index.d.ts",
|
|
47
|
+
"import": "./dist/runtime/primitives/lib/index.js"
|
|
48
|
+
},
|
|
49
|
+
"./config": {
|
|
50
|
+
"types": "./dist/runtime/shared/config.d.ts",
|
|
51
|
+
"import": "./dist/runtime/shared/config.js"
|
|
52
|
+
},
|
|
53
|
+
"./seo": {
|
|
54
|
+
"types": "./dist/runtime/seo/index.d.ts",
|
|
55
|
+
"import": "./dist/runtime/seo/index.js"
|
|
56
|
+
},
|
|
57
|
+
"./sync": {
|
|
58
|
+
"types": "./dist/scripts/index.d.ts",
|
|
59
|
+
"import": "./dist/scripts/index.js"
|
|
60
|
+
},
|
|
33
61
|
"./astro": {
|
|
34
62
|
"types": "./dist/runtime/astro/server.d.ts",
|
|
35
63
|
"import": "./dist/runtime/astro/server.js"
|
|
@@ -47,50 +75,49 @@
|
|
|
47
75
|
"import": "./dist/runtime/astro/internal.js"
|
|
48
76
|
},
|
|
49
77
|
"./next": {
|
|
50
|
-
"types": "./dist/
|
|
51
|
-
"import": "./dist/
|
|
78
|
+
"types": "./dist/build/next/moved.d.ts",
|
|
79
|
+
"import": "./dist/build/next/moved.js"
|
|
52
80
|
},
|
|
53
81
|
"./next/client": {
|
|
54
|
-
"types": "./dist/
|
|
55
|
-
"import": "./dist/
|
|
82
|
+
"types": "./dist/build/next/moved.d.ts",
|
|
83
|
+
"import": "./dist/build/next/moved.js"
|
|
56
84
|
},
|
|
57
85
|
"./next/config": {
|
|
58
|
-
"types": "./dist/build/next/
|
|
59
|
-
"import": "./dist/build/next/
|
|
60
|
-
"require": "./dist/build/next/
|
|
86
|
+
"types": "./dist/build/next/moved.d.ts",
|
|
87
|
+
"import": "./dist/build/next/moved.js",
|
|
88
|
+
"require": "./dist/build/next/moved.js"
|
|
61
89
|
},
|
|
62
90
|
"./react-router": {
|
|
63
|
-
"types": "./dist/
|
|
64
|
-
"import": "./dist/
|
|
91
|
+
"types": "./dist/build/react/router-moved.d.ts",
|
|
92
|
+
"import": "./dist/build/react/router-moved.js"
|
|
65
93
|
},
|
|
66
94
|
"./react-router/routes": {
|
|
67
|
-
"types": "./dist/
|
|
68
|
-
"import": "./dist/
|
|
95
|
+
"types": "./dist/build/react/router-routes-moved.d.ts",
|
|
96
|
+
"import": "./dist/build/react/router-routes-moved.js"
|
|
69
97
|
},
|
|
70
98
|
"./react-router/preset": {
|
|
71
|
-
"types": "./dist/
|
|
72
|
-
"import": "./dist/
|
|
99
|
+
"types": "./dist/build/react/router-preset-moved.d.ts",
|
|
100
|
+
"import": "./dist/build/react/router-preset-moved.js"
|
|
73
101
|
},
|
|
74
102
|
"./sveltekit": {
|
|
75
|
-
"types": "./dist/
|
|
76
|
-
"import": "./dist/
|
|
103
|
+
"types": "./dist/build/sveltekit/moved.d.ts",
|
|
104
|
+
"import": "./dist/build/sveltekit/moved.js"
|
|
77
105
|
},
|
|
78
106
|
"./sveltekit/components": {
|
|
79
|
-
"types": "./
|
|
80
|
-
"
|
|
81
|
-
"import": "./assets/sveltekit/components/index.js"
|
|
107
|
+
"types": "./dist/build/sveltekit/moved.d.ts",
|
|
108
|
+
"import": "./dist/build/sveltekit/moved.js"
|
|
82
109
|
},
|
|
83
110
|
"./sveltekit/config": {
|
|
84
111
|
"types": "./dist/build/sveltekit/config.d.ts",
|
|
85
112
|
"import": "./dist/build/sveltekit/config.js"
|
|
86
113
|
},
|
|
87
114
|
"./sveltekit/internal": {
|
|
88
|
-
"types": "./dist/
|
|
89
|
-
"import": "./dist/
|
|
115
|
+
"types": "./dist/build/sveltekit/moved.d.ts",
|
|
116
|
+
"import": "./dist/build/sveltekit/moved.js"
|
|
90
117
|
},
|
|
91
118
|
"./sveltekit/vite": {
|
|
92
|
-
"types": "./dist/build/sveltekit/
|
|
93
|
-
"import": "./dist/build/sveltekit/
|
|
119
|
+
"types": "./dist/build/sveltekit/moved.d.ts",
|
|
120
|
+
"import": "./dist/build/sveltekit/moved.js"
|
|
94
121
|
},
|
|
95
122
|
"./paths": {
|
|
96
123
|
"types": "./dist/runtime/paths/index.d.ts",
|
|
@@ -101,8 +128,16 @@
|
|
|
101
128
|
"import": "./dist/runtime/routes/index.js"
|
|
102
129
|
},
|
|
103
130
|
"./vite": {
|
|
104
|
-
"types": "./dist/build/vite
|
|
105
|
-
"import": "./dist/build/vite
|
|
131
|
+
"types": "./dist/build/react/vite-moved.d.ts",
|
|
132
|
+
"import": "./dist/build/react/vite-moved.js"
|
|
133
|
+
},
|
|
134
|
+
"./vite/runtime-env": {
|
|
135
|
+
"types": "./dist/build/vite/runtime-env.d.ts",
|
|
136
|
+
"import": "./dist/build/vite/runtime-env.js"
|
|
137
|
+
},
|
|
138
|
+
"./vite/data-id": {
|
|
139
|
+
"types": "./dist/build/vite/data-id.d.ts",
|
|
140
|
+
"import": "./dist/build/vite/data-id.js"
|
|
106
141
|
},
|
|
107
142
|
"./templates": {
|
|
108
143
|
"types": "./dist/runtime/templates.d.ts",
|
|
@@ -118,7 +153,7 @@
|
|
|
118
153
|
},
|
|
119
154
|
"scripts": {
|
|
120
155
|
"build": "pnpm run clean && tsc -b tsconfig.json && chmod +x dist/cli/index.js",
|
|
121
|
-
"build:bundle": "node scripts/bundle-cli.mjs && node scripts/bundle-routes.mjs
|
|
156
|
+
"build:bundle": "node scripts/bundle-cli.mjs && node scripts/bundle-routes.mjs",
|
|
122
157
|
"check:types": "tsc -b tsconfig.json && tsc -p tsconfig.test.json",
|
|
123
158
|
"start": "tsx src/cli/index.ts",
|
|
124
159
|
"install-cli": "pnpm build && node scripts/install-cli.mjs",
|
|
@@ -138,40 +173,30 @@
|
|
|
138
173
|
"clean": "rm -rf dist *.tsbuildinfo"
|
|
139
174
|
},
|
|
140
175
|
"dependencies": {
|
|
141
|
-
"@astrojs/vercel": "11.0.4",
|
|
142
|
-
"@rollup/pluginutils": "^5.1.0",
|
|
143
|
-
"@vercel/nft": "^1.10.2",
|
|
144
176
|
"change-case": "^5.4.4",
|
|
145
|
-
"esbuild": "^0.28.1",
|
|
146
177
|
"eta": "^3.5.0",
|
|
147
178
|
"oxc-parser": "^0.118.0",
|
|
148
|
-
"react-error-boundary": "^6.0.0",
|
|
149
179
|
"zod": "4.4.3"
|
|
150
180
|
},
|
|
151
181
|
"devDependencies": {
|
|
152
182
|
"@clack/core": "^1.2.0",
|
|
153
183
|
"@clack/prompts": "^1.2.0",
|
|
154
|
-
"@fimo/agents-bundle": "
|
|
155
|
-
"@fimo/api-contracts": "
|
|
156
|
-
"@fimo/cli-kit": "
|
|
157
|
-
"@fimo/framework-detect": "
|
|
158
|
-
"@fimo/mcp": "
|
|
159
|
-
"@fimo/routes": "
|
|
160
|
-
"@fimo/tsconfig": "
|
|
184
|
+
"@fimo/agents-bundle": "0.21.0-experimental.1",
|
|
185
|
+
"@fimo/api-contracts": "0.21.0-experimental.1",
|
|
186
|
+
"@fimo/cli-kit": "0.21.0-experimental.1",
|
|
187
|
+
"@fimo/framework-detect": "0.21.0-experimental.1",
|
|
188
|
+
"@fimo/mcp": "0.21.0-experimental.1",
|
|
189
|
+
"@fimo/routes": "0.21.0-experimental.1",
|
|
190
|
+
"@fimo/tsconfig": "0.21.0-experimental.1",
|
|
161
191
|
"@modelcontextprotocol/sdk": "1.27.1",
|
|
162
|
-
"@sveltejs/adapter-vercel": "6.3.4",
|
|
163
|
-
"@tanstack/react-query": "^5.80.6",
|
|
164
192
|
"@types/node": "^22.15.29",
|
|
165
|
-
"@types/react": "^19.2.14",
|
|
166
|
-
"@types/react-dom": "^19.2.3",
|
|
167
193
|
"agent-install": "^0.0.5",
|
|
194
|
+
"astro": "^7.1.6",
|
|
168
195
|
"better-auth": "1.6.25",
|
|
169
196
|
"cheerio": "^1.0.0",
|
|
170
197
|
"commander": "^13.1.0",
|
|
198
|
+
"esbuild": "^0.25.10",
|
|
171
199
|
"open": "^10.1.2",
|
|
172
|
-
"react": "^19.2.4",
|
|
173
|
-
"react-dom": "^19.2.4",
|
|
174
|
-
"react-router": "^7.15.1",
|
|
175
200
|
"tsx": "^4.19.4",
|
|
176
201
|
"typescript": "7.0.2",
|
|
177
202
|
"vite": "^8.0.13",
|
|
@@ -180,37 +205,13 @@
|
|
|
180
205
|
"yaml": "2.8.2"
|
|
181
206
|
},
|
|
182
207
|
"peerDependencies": {
|
|
183
|
-
"@sveltejs/kit": "^2.0.0",
|
|
184
|
-
"@tanstack/react-query": "^5.80.6",
|
|
185
208
|
"astro": "^5.0.0 || ^6.0.0 || ^7.0.0",
|
|
186
|
-
"react": "^18.2.0 || ^19.0.0",
|
|
187
|
-
"react-dom": "^18.2.0 || ^19.0.0",
|
|
188
|
-
"react-router": "^7.0.0 || ^8.0.0",
|
|
189
|
-
"svelte": "^5.0.0",
|
|
190
209
|
"vite": "^7.0.0 || ^8.0.0"
|
|
191
210
|
},
|
|
192
211
|
"peerDependenciesMeta": {
|
|
193
|
-
"@tanstack/react-query": {
|
|
194
|
-
"optional": true
|
|
195
|
-
},
|
|
196
|
-
"@sveltejs/kit": {
|
|
197
|
-
"optional": true
|
|
198
|
-
},
|
|
199
212
|
"astro": {
|
|
200
213
|
"optional": true
|
|
201
214
|
},
|
|
202
|
-
"react": {
|
|
203
|
-
"optional": true
|
|
204
|
-
},
|
|
205
|
-
"react-dom": {
|
|
206
|
-
"optional": true
|
|
207
|
-
},
|
|
208
|
-
"react-router": {
|
|
209
|
-
"optional": true
|
|
210
|
-
},
|
|
211
|
-
"svelte": {
|
|
212
|
-
"optional": true
|
|
213
|
-
},
|
|
214
215
|
"vite": {
|
|
215
216
|
"optional": true
|
|
216
217
|
}
|
package/release.json
CHANGED
|
@@ -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. Astro reads this configuration directly, keeps the default locale unprefixed, and prefixes the others.
|
|
32
32
|
- Preserve both the unprefixed default pages and the `[locale]` page tree. Astro has no optional single-segment file route, so the paired native pages keep one-locale URLs clean and allow another locale without changing the route shape. Use `Astro.currentLocale` for Fimo content reads, `getLabels`, and document language.
|
|
33
33
|
- Keep `.fimo/config.json#routes` as Studio metadata aligned with Astro's page files. It does not configure Astro routing.
|
|
@@ -9,7 +9,8 @@
|
|
|
9
9
|
"check": "astro sync && astro check"
|
|
10
10
|
},
|
|
11
11
|
"dependencies": {
|
|
12
|
-
"fimo": "
|
|
12
|
+
"fimo": "0.21.0-experimental.1",
|
|
13
|
+
"fimo-astro": "0.21.0-experimental.1"
|
|
13
14
|
},
|
|
14
15
|
"devDependencies": {
|
|
15
16
|
"@astrojs/check": "^0.9.10",
|
|
@@ -18,5 +19,6 @@
|
|
|
18
19
|
},
|
|
19
20
|
"engines": {
|
|
20
21
|
"node": ">=22.22.0"
|
|
21
|
-
}
|
|
22
|
+
},
|
|
23
|
+
"packageManager": "pnpm@10.26.0"
|
|
22
24
|
}
|
|
@@ -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: []
|