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
|
@@ -250,7 +250,7 @@ function wrapField(field, value, source, resolve) {
|
|
|
250
250
|
// instead of `{"value":7}`, but it does NOT fix JSX rendering, and
|
|
251
251
|
// `typeof`/`===`/`Number.isInteger` stay broken either way (boxed
|
|
252
252
|
// primitives never satisfy those). Revisiting this needs a `<Number>`
|
|
253
|
-
// component in `fimo
|
|
253
|
+
// component in `fimo-react` (none exists yet — every other wrapped type has
|
|
254
254
|
// one) plus a migration path for sites already rendering numbers raw.
|
|
255
255
|
default:
|
|
256
256
|
return value;
|
|
@@ -6,10 +6,15 @@ export declare function createContentCore<T extends {
|
|
|
6
6
|
export declare function createSingletonCore<T extends {
|
|
7
7
|
id: string;
|
|
8
8
|
}, TInput extends object>(config: ContentClientConfig, runtime: ContentRuntime): import("./index.js").SingletonContentCore<T, TInput>;
|
|
9
|
+
export { createServerContentClient, createServerSingletonClient } from './client/server-content-client.js';
|
|
10
|
+
export { createCollectionContentCore } from './client/collection-core.js';
|
|
11
|
+
export { createSingletonContentCore } from './client/singleton-core.js';
|
|
12
|
+
export { readCollectionLocale, splitWritePayload, withMutationLocale } from './client/internal.js';
|
|
9
13
|
export type { CollectionContentCore } from './client/collection-core.js';
|
|
10
|
-
export type
|
|
14
|
+
export { requireContentApiUrl, type ContentRuntime } from './client/runtime.js';
|
|
11
15
|
export type { SingletonContentCore } from './client/singleton-core.js';
|
|
12
16
|
export { serializeContent, type SerializedContent, type SerializedMedia } from './serialization.js';
|
|
17
|
+
export { parseCollectionResponse, type CollectionResponse } from './parseCollectionResponse.js';
|
|
13
18
|
export type { CollectionPage, CollectionPageInfo, ContentClientConfig, ContentClientHandle, ContentModuleMeta, ContentModuleRef, ContentReadOptions, ContentResult, ContentSchema, ContentSchemaField, } from './client/core-types.js';
|
|
14
19
|
export { FIMO_PARTS, FIMO_SOURCE, FimoBoolean, FimoDate, FimoMedia, FimoRichText, FimoString, getFimoParts, getFimoSource, hasFimoSource, isFimoDate, isFimoString, type FimoPart, type FimoPolymorphicReference, type FimoReference, type FimoRichTextContent, type FimoSource, } from '../primitives/lib/primitives.js';
|
|
15
20
|
export type { BoolOps, DateOps, Field, Fields, FilterFor, NullOnlyOps, NumberOps, Populate, Populated, PopulatedResult, Projected, ProjectedWithPopulate, Query, ReferenceField, ReferenceMap, ScalarOps, Sort, SortField, StringOps, Where, WithReferences, } from '../primitives/lib/query.js';
|
|
@@ -6,5 +6,11 @@ export function createContentCore(config, runtime) {
|
|
|
6
6
|
export function createSingletonCore(config, runtime) {
|
|
7
7
|
return createSingletonContentCore(config, runtime).client;
|
|
8
8
|
}
|
|
9
|
+
export { createServerContentClient, createServerSingletonClient } from './client/server-content-client.js';
|
|
10
|
+
export { createCollectionContentCore } from './client/collection-core.js';
|
|
11
|
+
export { createSingletonContentCore } from './client/singleton-core.js';
|
|
12
|
+
export { readCollectionLocale, splitWritePayload, withMutationLocale } from './client/internal.js';
|
|
13
|
+
export { requireContentApiUrl } from './client/runtime.js';
|
|
9
14
|
export { serializeContent } from './serialization.js';
|
|
15
|
+
export { parseCollectionResponse } from './parseCollectionResponse.js';
|
|
10
16
|
export { FIMO_PARTS, FIMO_SOURCE, FimoBoolean, FimoDate, FimoMedia, FimoRichText, FimoString, getFimoParts, getFimoSource, hasFimoSource, isFimoDate, isFimoString, } from '../primitives/lib/primitives.js';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { getFimoDefaultLocale, getFimoLocales, resolveFimoLocale, } from './locale.js';
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
export { getSafePreviewNavigationPath, isPreviewRuntimeEnabled } from './bridge.js';
|
|
2
|
+
export { getPreviewLocationChange, getPreviewLocationPath, getPreviewParentOrigin, getDocumentLocale, resolvePreviewParentOrigin, type PreviewBrowserContext, type PreviewLocationChange, type PreviewLocationLike, } from './location.js';
|
|
3
|
+
export { ensurePreviewScript } from './script.js';
|
|
4
|
+
export { getConfigPreviewRoutes, type PreviewRoute } from './routes.js';
|
|
5
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
export { getSafePreviewNavigationPath, isPreviewRuntimeEnabled } from './bridge.js';
|
|
2
|
+
export { getPreviewLocationChange, getPreviewLocationPath, getPreviewParentOrigin, getDocumentLocale, resolvePreviewParentOrigin, } from './location.js';
|
|
3
|
+
export { ensurePreviewScript } from './script.js';
|
|
4
|
+
export { getConfigPreviewRoutes } from './routes.js';
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
/** Load the platform preview script once. Empty configuration keeps preview disabled. */
|
|
2
|
+
export function ensurePreviewScript(src, target = document) {
|
|
3
|
+
if (!src) {
|
|
4
|
+
return false;
|
|
5
|
+
}
|
|
6
|
+
const exists = Array.from(target.scripts).some((script) => script.getAttribute('src') === src);
|
|
7
|
+
if (!exists) {
|
|
8
|
+
const script = target.createElement('script');
|
|
9
|
+
script.src = src;
|
|
10
|
+
script.defer = true;
|
|
11
|
+
target.head.appendChild(script);
|
|
12
|
+
}
|
|
13
|
+
return true;
|
|
14
|
+
}
|
|
@@ -1,4 +1,6 @@
|
|
|
1
1
|
export { FimoString, FimoDate, FimoMedia, FimoBoolean, FimoRichText, type FimoPolymorphicReference, type FimoReference, type FimoSource, type FimoPart, type FimoRichTextContent, FIMO_SOURCE, FIMO_PARTS, isFimoString, isFimoDate, hasFimoSource, getFimoSource, getFimoParts, } from './primitives.js';
|
|
2
2
|
export { fimo } from './template.js';
|
|
3
|
+
export { renderRichTextHtml, renderRichTextHtml as renderRichText } from './render-rich-text.js';
|
|
4
|
+
export { parseImageHostSuffixes, resolveImagePresentation, type ImageFit, type ImageObjectFit, type ImagePresentation, type ImagePresentationOptions, } from './image-optimization.js';
|
|
3
5
|
export type { BoolOps, DateOps, Field, Fields, FilterFor, NullOnlyOps, NumberOps, Populate, Populated, PopulatedResult, ProjectedWithPopulate, Projected, Query, ReferenceField, ReferenceMap, ScalarOps, Sort, SortField, StringOps, Where, WithReferences, } from './query.js';
|
|
4
6
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1,3 +1,5 @@
|
|
|
1
1
|
// Fimo - Source tracking for inline editing
|
|
2
2
|
export { FimoString, FimoDate, FimoMedia, FimoBoolean, FimoRichText, FIMO_SOURCE, FIMO_PARTS, isFimoString, isFimoDate, hasFimoSource, getFimoSource, getFimoParts, } from './primitives.js';
|
|
3
3
|
export { fimo } from './template.js';
|
|
4
|
+
export { renderRichTextHtml, renderRichTextHtml as renderRichText } from './render-rich-text.js';
|
|
5
|
+
export { parseImageHostSuffixes, resolveImagePresentation, } from './image-optimization.js';
|
|
@@ -1,10 +1,2 @@
|
|
|
1
|
-
export * from './buildSeoForPath.js';
|
|
2
|
-
export * from './htmlProps.js';
|
|
3
1
|
export * from './resolver.js';
|
|
4
|
-
export declare function loadFimoMetaData({ request }: {
|
|
5
|
-
request: Request;
|
|
6
|
-
}): Promise<{
|
|
7
|
-
fimoMetaData: Record<string, unknown> | undefined;
|
|
8
|
-
fimoLocale: import("../index.js").FimoLocaleResolution;
|
|
9
|
-
}>;
|
|
10
2
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1,9 +1 @@
|
|
|
1
|
-
import { resolveFimoLocaleForUrl, resolveMetaEntries } from '../app/prefetch.js';
|
|
2
|
-
export * from './buildSeoForPath.js';
|
|
3
|
-
export * from './htmlProps.js';
|
|
4
1
|
export * from './resolver.js';
|
|
5
|
-
export async function loadFimoMetaData({ request }) {
|
|
6
|
-
const fimoMetaData = await resolveMetaEntries(request.url);
|
|
7
|
-
const fimoLocale = resolveFimoLocaleForUrl(request.url);
|
|
8
|
-
return { fimoMetaData, fimoLocale };
|
|
9
|
-
}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
export { getConfigServer, getConfigVersion } from './fimo-config.server.js';
|
|
2
|
+
export { resolveFimoConfigPath } from './fimo-config.server.js';
|
|
3
|
+
export type { FimoConfig, FimoFramework, FimoHostingConfig, FimoI18nConfig, FimoRouteConfig, FimoRuntimeConfig, FimoSEO, RouteSEO, } from './fimo-config.types.js';
|
|
4
|
+
export { getFimoDefaultLocale, getFimoLocales, getFimoTextDirection, normalizeFimoLocale, localizeFimoPath, resolveFimoLocale, toHtmlLang, type FimoLocaleRequestLike, type FimoLocaleResolution, } from '../i18n/locale.js';
|
|
5
|
+
export { findStaleFimoOverride, resolveLocalRuntimeEnv, staleOverrideMessage, type LocalProjectLink, type LocalRuntimeEnv, type LocalRuntimeEnvSource, } from './local-runtime-env.js';
|
|
6
|
+
//# sourceMappingURL=config.d.ts.map
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
export { getConfigServer, getConfigVersion } from './fimo-config.server.js';
|
|
2
|
+
export { resolveFimoConfigPath } from './fimo-config.server.js';
|
|
3
|
+
export { getFimoDefaultLocale, getFimoLocales, getFimoTextDirection, normalizeFimoLocale, localizeFimoPath, resolveFimoLocale, toHtmlLang, } from '../i18n/locale.js';
|
|
4
|
+
export { findStaleFimoOverride, resolveLocalRuntimeEnv, staleOverrideMessage, } from './local-runtime-env.js';
|
|
@@ -12,8 +12,8 @@
|
|
|
12
12
|
* job and is the same everywhere: a variable the user (or the sandbox) already
|
|
13
13
|
* set is left alone; derivation fills the rest, one variable at a time.
|
|
14
14
|
*
|
|
15
|
-
* Shared by the CLI,
|
|
16
|
-
*
|
|
15
|
+
* Shared by the CLI, framework build connectors, and the `fimo-next` server
|
|
16
|
+
* runtime so they cannot disagree about which env the app is calling.
|
|
17
17
|
*/
|
|
18
18
|
export type LocalRuntimeEnvSource = 'branch' | 'fallback';
|
|
19
19
|
export interface LocalRuntimeEnv {
|
|
@@ -12,8 +12,8 @@
|
|
|
12
12
|
* job and is the same everywhere: a variable the user (or the sandbox) already
|
|
13
13
|
* set is left alone; derivation fills the rest, one variable at a time.
|
|
14
14
|
*
|
|
15
|
-
* Shared by the CLI,
|
|
16
|
-
*
|
|
15
|
+
* Shared by the CLI, framework build connectors, and the `fimo-next` server
|
|
16
|
+
* runtime so they cannot disagree about which env the app is calling.
|
|
17
17
|
*/
|
|
18
18
|
import { execFileSync } from 'node:child_process';
|
|
19
19
|
import fs from 'node:fs';
|
|
@@ -87,11 +87,13 @@ export function readLocalEnvFiles(cwd) {
|
|
|
87
87
|
const root = findProjectRoot(cwd) ?? cwd;
|
|
88
88
|
const values = {};
|
|
89
89
|
for (const file of ['.env', '.env.local']) {
|
|
90
|
-
|
|
91
|
-
|
|
90
|
+
// The checkout's env files are read at runtime, never bundled: without
|
|
91
|
+
// the opt-out Turbopack traces the whole project into the server output.
|
|
92
|
+
const filePath = path.join(/* turbopackIgnore: true */ root, file);
|
|
93
|
+
if (!fs.existsSync(/* turbopackIgnore: true */ filePath)) {
|
|
92
94
|
continue;
|
|
93
95
|
}
|
|
94
|
-
for (const line of fs.readFileSync(filePath, 'utf-8').split(/\r?\n/)) {
|
|
96
|
+
for (const line of fs.readFileSync(/* turbopackIgnore: true */ filePath, 'utf-8').split(/\r?\n/)) {
|
|
95
97
|
const trimmed = line.trim();
|
|
96
98
|
if (!trimmed || trimmed.startsWith('#')) {
|
|
97
99
|
continue;
|
|
@@ -82,10 +82,26 @@ interface PkgWithScripts {
|
|
|
82
82
|
*/
|
|
83
83
|
export declare function rewriteFimoValidateCommand(pkg: PkgWithScripts, pin?: string | null): boolean;
|
|
84
84
|
/**
|
|
85
|
-
*
|
|
86
|
-
*
|
|
87
|
-
*
|
|
88
|
-
|
|
85
|
+
* Packages released together with `fimo` at the same version. A project pins
|
|
86
|
+
* only the ones it uses; every pin is derived from the `fimo` pin so the
|
|
87
|
+
* platform keeps a single version selector (FIMO-1635).
|
|
88
|
+
*/
|
|
89
|
+
export declare const FIMO_PACKAGES: readonly ['fimo', 'fimo-sveltekit', 'fimo-astro', 'fimo-vite', 'fimo-react', 'fimo-react-router', 'fimo-next'];
|
|
90
|
+
export type FimoPackage = (typeof FIMO_PACKAGES)[number];
|
|
91
|
+
/**
|
|
92
|
+
* Pin for a companion package given the `fimo` pin. Semver and dist-tags carry
|
|
93
|
+
* over unchanged (fixed-version group). Source checkouts map
|
|
94
|
+
* `file:<checkout>/apps/cli` to `file:<checkout>/packages/<name>`, and R2 dev
|
|
95
|
+
* tarballs `…/cli/fimo-<id>.tgz` to `…/cli/<name>-<id>.tgz`, both of which the
|
|
96
|
+
* publish scripts guarantee to exist side by side. Returns null when the pin
|
|
97
|
+
* has a shape this convention cannot follow.
|
|
98
|
+
*/
|
|
99
|
+
export declare function deriveFimoPackagePin(name: FimoPackage, fimoPin: string): string | null;
|
|
100
|
+
/**
|
|
101
|
+
* Rewrite `fimo` and any companion packages present (in dependencies +
|
|
102
|
+
* devDependencies) to the current pin. Only touches entries that look like a
|
|
103
|
+
* value we own: the template's dist-tag, an old tarball URL, an exact/ranged
|
|
104
|
+
* semver, or a local `file:` dependency. Bespoke values are left alone.
|
|
89
105
|
*
|
|
90
106
|
* Returns true if anything changed.
|
|
91
107
|
*/
|
|
@@ -198,10 +198,46 @@ export function rewriteFimoValidateCommand(pkg, pin = resolveFimoPin()) {
|
|
|
198
198
|
return true;
|
|
199
199
|
}
|
|
200
200
|
/**
|
|
201
|
-
*
|
|
202
|
-
*
|
|
203
|
-
*
|
|
204
|
-
|
|
201
|
+
* Packages released together with `fimo` at the same version. A project pins
|
|
202
|
+
* only the ones it uses; every pin is derived from the `fimo` pin so the
|
|
203
|
+
* platform keeps a single version selector (FIMO-1635).
|
|
204
|
+
*/
|
|
205
|
+
export const FIMO_PACKAGES = [
|
|
206
|
+
'fimo',
|
|
207
|
+
'fimo-sveltekit',
|
|
208
|
+
'fimo-astro',
|
|
209
|
+
'fimo-vite',
|
|
210
|
+
'fimo-react',
|
|
211
|
+
'fimo-react-router',
|
|
212
|
+
'fimo-next',
|
|
213
|
+
];
|
|
214
|
+
/**
|
|
215
|
+
* Pin for a companion package given the `fimo` pin. Semver and dist-tags carry
|
|
216
|
+
* over unchanged (fixed-version group). Source checkouts map
|
|
217
|
+
* `file:<checkout>/apps/cli` to `file:<checkout>/packages/<name>`, and R2 dev
|
|
218
|
+
* tarballs `…/cli/fimo-<id>.tgz` to `…/cli/<name>-<id>.tgz`, both of which the
|
|
219
|
+
* publish scripts guarantee to exist side by side. Returns null when the pin
|
|
220
|
+
* has a shape this convention cannot follow.
|
|
221
|
+
*/
|
|
222
|
+
export function deriveFimoPackagePin(name, fimoPin) {
|
|
223
|
+
if (name === 'fimo') {
|
|
224
|
+
return fimoPin;
|
|
225
|
+
}
|
|
226
|
+
if (fimoPin.startsWith('file:')) {
|
|
227
|
+
const match = fimoPin.slice('file:'.length).match(/^(.*?)([\\/])apps\2cli\2?$/);
|
|
228
|
+
return match ? `file:${match[1]}${match[2]}packages${match[2]}${name}` : null;
|
|
229
|
+
}
|
|
230
|
+
if (/^https?:\/\//.test(fimoPin)) {
|
|
231
|
+
const match = fimoPin.match(/^(.*\/cli\/)fimo-([^/]+\.tgz)$/);
|
|
232
|
+
return match ? `${match[1]}${name}-${match[2]}` : null;
|
|
233
|
+
}
|
|
234
|
+
return fimoPin;
|
|
235
|
+
}
|
|
236
|
+
/**
|
|
237
|
+
* Rewrite `fimo` and any companion packages present (in dependencies +
|
|
238
|
+
* devDependencies) to the current pin. Only touches entries that look like a
|
|
239
|
+
* value we own: the template's dist-tag, an old tarball URL, an exact/ranged
|
|
240
|
+
* semver, or a local `file:` dependency. Bespoke values are left alone.
|
|
205
241
|
*
|
|
206
242
|
* Returns true if anything changed.
|
|
207
243
|
*/
|
|
@@ -215,20 +251,26 @@ export function rewriteFimoDep(pkg, pin = resolveFimoPin()) {
|
|
|
215
251
|
if (!deps) {
|
|
216
252
|
continue;
|
|
217
253
|
}
|
|
218
|
-
const
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
254
|
+
for (const name of FIMO_PACKAGES) {
|
|
255
|
+
const current = deps[name];
|
|
256
|
+
if (typeof current !== 'string') {
|
|
257
|
+
continue;
|
|
258
|
+
}
|
|
259
|
+
const target = deriveFimoPackagePin(name, pin);
|
|
260
|
+
if (!target) {
|
|
261
|
+
continue;
|
|
262
|
+
}
|
|
263
|
+
// Migrate projects still pinned to the retired R2 tarball, repin a semver,
|
|
264
|
+
// rewrite the committed template's dist-tag, or (dev flow) swap a local
|
|
265
|
+
// `file:` build for a published version on deploy.
|
|
266
|
+
const looksLikeLegacyR2 = current.includes(`r2.dev/cli/${name}-`);
|
|
267
|
+
const looksLikeLocalFile = current.startsWith('file:');
|
|
268
|
+
const looksLikeSemver = /^[\^~]?\d+\.\d+\.\d+/.test(current);
|
|
269
|
+
const looksLikeOwnedDistTag = current === 'latest' || current === 'staging' || current === 'experimental';
|
|
270
|
+
if ((looksLikeLegacyR2 || looksLikeLocalFile || looksLikeSemver || looksLikeOwnedDistTag) && current !== target) {
|
|
271
|
+
deps[name] = target;
|
|
272
|
+
changed = true;
|
|
273
|
+
}
|
|
232
274
|
}
|
|
233
275
|
}
|
|
234
276
|
return changed;
|
|
@@ -48,7 +48,10 @@ function extractFromModule(filePath, code, parsePath = filePath) {
|
|
|
48
48
|
const declarations = [];
|
|
49
49
|
const result = parseSync(parsePath, code);
|
|
50
50
|
const ast = result.program;
|
|
51
|
-
const fimoLabelNames =
|
|
51
|
+
const fimoLabelNames = new Set([
|
|
52
|
+
...importedNames(ast.body, 'fimo-react', 'Label'),
|
|
53
|
+
...importedNames(ast.body, 'fimo/ui', 'Label'),
|
|
54
|
+
]);
|
|
52
55
|
function visit(node) {
|
|
53
56
|
if (!node || typeof node !== 'object') {
|
|
54
57
|
return;
|
|
@@ -107,8 +110,10 @@ function extractFromSvelte(filePath, code) {
|
|
|
107
110
|
const markup = code
|
|
108
111
|
.replace(SVELTE_SCRIPT, (_script, contents) => {
|
|
109
112
|
const ast = parseSync(`${filePath}.ts`, contents).program;
|
|
110
|
-
for (const
|
|
111
|
-
|
|
113
|
+
for (const moduleName of ['fimo-sveltekit/components', 'fimo/sveltekit/components']) {
|
|
114
|
+
for (const name of importedNames(ast.body, moduleName, 'Label')) {
|
|
115
|
+
labelNames.add(name);
|
|
116
|
+
}
|
|
112
117
|
}
|
|
113
118
|
declarations.push(...extractFromModule(filePath, contents, `${filePath}.ts`));
|
|
114
119
|
return '';
|
|
@@ -45,8 +45,12 @@ function frameworkFormsTarget(framework) {
|
|
|
45
45
|
return 'sveltekit';
|
|
46
46
|
return null;
|
|
47
47
|
}
|
|
48
|
-
|
|
49
|
-
|
|
48
|
+
/** `<package>` or `<package>/<subpath>`, as it would be written in an import. */
|
|
49
|
+
function hasPackageExport(cwd, entry) {
|
|
50
|
+
const slash = entry.indexOf('/');
|
|
51
|
+
const name = slash === -1 ? entry : entry.slice(0, slash);
|
|
52
|
+
const subpath = slash === -1 ? '.' : `.${entry.slice(slash)}`;
|
|
53
|
+
const packagePath = join(cwd, 'node_modules', name, 'package.json');
|
|
50
54
|
if (!existsSync(packagePath))
|
|
51
55
|
return false;
|
|
52
56
|
try {
|
|
@@ -57,25 +61,33 @@ function hasPackageExport(cwd, subpath) {
|
|
|
57
61
|
return false;
|
|
58
62
|
}
|
|
59
63
|
}
|
|
64
|
+
function requiredFormEntries(target) {
|
|
65
|
+
if (target === 'next')
|
|
66
|
+
return ['fimo/forms', 'fimo-next', 'fimo-next/client'];
|
|
67
|
+
// SvelteKit's runtime ships as its own package (FIMO-1635); `fimo/forms`
|
|
68
|
+
// still types the client the generated module accepts.
|
|
69
|
+
if (target === 'sveltekit')
|
|
70
|
+
return ['fimo/forms', 'fimo-sveltekit'];
|
|
71
|
+
return ['fimo/forms', `fimo/${target}`];
|
|
72
|
+
}
|
|
60
73
|
function assertFrameworkRuntime(cwd, target) {
|
|
61
|
-
const
|
|
62
|
-
const missing = requiredExports.filter((subpath) => !hasPackageExport(cwd, subpath));
|
|
74
|
+
const missing = requiredFormEntries(target).filter((entry) => !hasPackageExport(cwd, entry));
|
|
63
75
|
if (missing.length === 0)
|
|
64
76
|
return;
|
|
65
|
-
throw new Error(`Cannot generate ${target} form clients because the project
|
|
66
|
-
'Install the current
|
|
77
|
+
throw new Error(`Cannot generate ${target} form clients because the project cannot resolve ${missing.join(', ')}. ` +
|
|
78
|
+
'Install the current Fimo packages, then run `fimo validate` again. No generated files were changed.');
|
|
67
79
|
}
|
|
68
80
|
function generatedFormFiles(target) {
|
|
69
81
|
if (target === 'next') {
|
|
70
82
|
return [
|
|
71
|
-
{ suffix: '.ts', runtimeImport: 'fimo
|
|
72
|
-
{ suffix: '.client.ts', runtimeImport: 'fimo
|
|
83
|
+
{ suffix: '.ts', runtimeImport: 'fimo-next' },
|
|
84
|
+
{ suffix: '.client.ts', runtimeImport: 'fimo-next/client', clientDirective: "'use client';" },
|
|
73
85
|
];
|
|
74
86
|
}
|
|
75
87
|
if (target === 'astro')
|
|
76
88
|
return [{ suffix: '.ts', runtimeImport: 'fimo/astro' }];
|
|
77
89
|
if (target === 'sveltekit')
|
|
78
|
-
return [{ suffix: '.ts', runtimeImport: 'fimo
|
|
90
|
+
return [{ suffix: '.ts', runtimeImport: 'fimo-sveltekit' }];
|
|
79
91
|
return [];
|
|
80
92
|
}
|
|
81
93
|
export function syncForms(options = {}) {
|