fimo 0.15.0-staging.2 → 0.15.0-staging.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (67) hide show
  1. package/README.md +1 -0
  2. package/assets/content-templates/forms/framework.eta +90 -0
  3. package/assets/content-templates/forms/react.eta +42 -21
  4. package/assets/skills/fimo-cli/references/forms.md +2 -2
  5. package/assets/skills/fimo-cli/references/init.md +10 -8
  6. package/assets/skills/fimo-cli/references/projects.md +1 -1
  7. package/assets/skills/fimo-cli/references/schedules.md +5 -2
  8. package/assets/skills/fimo-code/references/forms.md +24 -10
  9. package/assets/skills/fimo-code/references/frameworks/astro.md +9 -0
  10. package/assets/skills/fimo-code/references/frameworks/next.md +25 -0
  11. package/assets/skills/fimo-code/references/frameworks/sveltekit.md +33 -5
  12. package/assets/skills/fimo-code/references/labels.md +1 -1
  13. package/dist/build/sveltekit/config.d.ts +2 -1
  14. package/dist/build/sveltekit/config.js +15 -5
  15. package/dist/build/sveltekit/files/edge.js +68 -0
  16. package/dist/build/sveltekit/files/serverless.js +42 -0
  17. package/dist/cli/bundle.json +1 -1
  18. package/dist/cli/index.js +31 -21
  19. package/dist/runtime/astro/server.d.ts +2 -0
  20. package/dist/runtime/astro/server.js +2 -0
  21. package/dist/runtime/forms/client.d.ts +13 -0
  22. package/dist/runtime/forms/client.js +83 -0
  23. package/dist/runtime/forms/index.d.ts +2 -0
  24. package/dist/runtime/forms/index.js +1 -0
  25. package/dist/runtime/index.d.ts +2 -0
  26. package/dist/runtime/index.js +4 -0
  27. package/dist/runtime/next/client.d.ts +2 -0
  28. package/dist/runtime/next/client.js +2 -0
  29. package/dist/runtime/next/server.d.ts +2 -0
  30. package/dist/runtime/next/server.js +2 -0
  31. package/dist/runtime/react-router/index.d.ts +1 -0
  32. package/dist/runtime/react-router/index.js +1 -0
  33. package/dist/runtime/sveltekit/forms.d.ts +15 -0
  34. package/dist/runtime/sveltekit/forms.js +15 -0
  35. package/dist/runtime/sveltekit/index.d.ts +2 -0
  36. package/dist/runtime/sveltekit/index.js +1 -0
  37. package/dist/runtime/sveltekit/labels.d.ts +7 -3
  38. package/dist/runtime/sveltekit/labels.js +1 -1
  39. package/dist/runtime/sveltekit/runtime.d.ts +2 -1
  40. package/dist/runtime/sveltekit/runtime.js +8 -2
  41. package/dist/runtime/templates.d.ts +1 -1
  42. package/dist/runtime/templates.js +1 -1
  43. package/dist/scripts/sync-forms.d.ts +1 -0
  44. package/dist/scripts/sync-forms.js +78 -26
  45. package/package.json +9 -4
  46. package/templates/astro/.fimo/config.json +21 -0
  47. package/templates/astro/AGENTS.md +37 -0
  48. package/templates/astro/CLAUDE.md +5 -0
  49. package/templates/astro/_gitignore +15 -0
  50. package/templates/astro/astro.config.mjs +7 -0
  51. package/templates/astro/package.json +22 -0
  52. package/templates/astro/pnpm-workspace.yaml +7 -0
  53. package/templates/astro/src/components/ProjectOverview.astro +42 -0
  54. package/templates/astro/src/env.d.ts +1 -0
  55. package/templates/astro/src/layouts/Base.astro +81 -0
  56. package/templates/astro/src/pages/index.astro +10 -0
  57. package/templates/astro/src/pages/projects/[slug].astro +26 -0
  58. package/templates/astro/src/pages/projects/index.astro +10 -0
  59. package/templates/astro/src/schemas/Project.json +9 -0
  60. package/templates/astro/src/schemas/Project.ts +29 -0
  61. package/templates/astro/src/schemas/Project.types.ts +70 -0
  62. package/templates/astro/src/schemas/SiteSettings.json +10 -0
  63. package/templates/astro/src/schemas/SiteSettings.ts +31 -0
  64. package/templates/astro/src/schemas/SiteSettings.types.ts +69 -0
  65. package/templates/astro/tsconfig.json +5 -0
  66. package/templates/react-router/package.json +1 -1
  67. package/templates/sveltekit/src/routes/+layout.server.ts +1 -2
@@ -0,0 +1,7 @@
1
+ import { defineConfig } from 'astro/config';
2
+ import { fimo } from 'fimo/astro/config';
3
+
4
+ export default defineConfig({
5
+ integrations: [fimo()],
6
+ output: 'server',
7
+ });
@@ -0,0 +1,22 @@
1
+ {
2
+ "name": "fimo-template",
3
+ "version": "0.0.0",
4
+ "private": true,
5
+ "type": "module",
6
+ "scripts": {
7
+ "dev": "astro dev",
8
+ "build": "astro build",
9
+ "check": "astro sync && astro check"
10
+ },
11
+ "dependencies": {
12
+ "fimo": "latest"
13
+ },
14
+ "devDependencies": {
15
+ "@astrojs/check": "^0.9.10",
16
+ "astro": "^7.1.6",
17
+ "typescript": "^6.0.3"
18
+ },
19
+ "engines": {
20
+ "node": ">=22.22.0"
21
+ }
22
+ }
@@ -0,0 +1,7 @@
1
+ # Build approval is handled by Fimo-controlled install commands. Do not add a
2
+ # package-level allowlist because Fimo installs with dangerouslyAllowAllBuilds.
3
+
4
+ packages: []
5
+ allowBuilds:
6
+ esbuild: set this to true or false
7
+ fimo: set this to true or false
@@ -0,0 +1,42 @@
1
+ ---
2
+ import { getLabels } from 'fimo/astro';
3
+ import { Text } from 'fimo/astro/components';
4
+
5
+ import * as Project from '../schemas/Project';
6
+ import * as SiteSettings from '../schemas/SiteSettings';
7
+
8
+ interface Props {
9
+ locale: 'en';
10
+ rendering: 'static' | 'server';
11
+ }
12
+
13
+ const { locale, rendering } = Astro.props;
14
+ const [settings, projects, labels] = await Promise.all([
15
+ SiteSettings.get({ locale }),
16
+ Project.list({ locale, limit: 12 }),
17
+ getLabels({ locale }),
18
+ ]);
19
+ ---
20
+
21
+ <main data-framework="astro" data-rendering={rendering} data-locale={locale} data-fimo-starter="projects">
22
+ <nav aria-label="Language">
23
+ <a href="/">English</a>
24
+ </nav>
25
+ <header>
26
+ <Text as="h1" value={settings.studioName} />
27
+ <Text as="p" value={settings.intro} />
28
+ <a href="/projects"><Text as="span" value={labels.t('navigation.projects')} /></a>
29
+ </header>
30
+ <section>
31
+ <Text as="h2" value={labels.t('projects.heading')} />
32
+ {
33
+ projects.items.map((project) => (
34
+ <article data-project-slug={String(project.slug)}>
35
+ <Text as="h3" value={project.title} />
36
+ <Text as="p" value={project.summary} />
37
+ <a href={`/projects/${String(project.slug)}`}><Text as="span" value={project.title} /></a>
38
+ </article>
39
+ ))
40
+ }
41
+ </section>
42
+ </main>
@@ -0,0 +1 @@
1
+ /// <reference types="astro/client" />
@@ -0,0 +1,81 @@
1
+ ---
2
+ interface Props {
3
+ lang: 'en';
4
+ title: string;
5
+ }
6
+
7
+ const { lang, title } = Astro.props;
8
+ ---
9
+
10
+ <!doctype html>
11
+ <html lang={lang}>
12
+ <head>
13
+ <meta charset="UTF-8" />
14
+ <meta name="viewport" content="width=device-width" />
15
+ <meta name="description" content="A new Fimo project built with Astro." />
16
+ <title>{title}</title>
17
+ </head>
18
+ <body>
19
+ <slot />
20
+ </body>
21
+ </html>
22
+
23
+ <style is:global>
24
+ :root {
25
+ color: #181817;
26
+ background: #f6f5f2;
27
+ font-family: Inter, ui-sans-serif, system-ui, sans-serif;
28
+ }
29
+
30
+ body {
31
+ margin: 0;
32
+ }
33
+
34
+ main {
35
+ box-sizing: border-box;
36
+ width: min(100% - 3rem, 52rem);
37
+ min-height: 100vh;
38
+ margin: 0 auto;
39
+ padding: 4rem 0;
40
+ }
41
+
42
+ nav,
43
+ header,
44
+ section,
45
+ article {
46
+ display: grid;
47
+ gap: 0.75rem;
48
+ }
49
+
50
+ nav {
51
+ grid-auto-flow: column;
52
+ justify-content: start;
53
+ margin-bottom: 4rem;
54
+ }
55
+
56
+ section {
57
+ margin-top: 3rem;
58
+ }
59
+
60
+ article {
61
+ padding: 1.5rem 0;
62
+ border-top: 1px solid #d6d3cc;
63
+ }
64
+
65
+ h1,
66
+ h2,
67
+ p {
68
+ margin: 0;
69
+ }
70
+
71
+ h1 {
72
+ max-width: 16ch;
73
+ font-size: clamp(2.75rem, 9vw, 5rem);
74
+ line-height: 0.95;
75
+ letter-spacing: -0.05em;
76
+ }
77
+
78
+ a {
79
+ color: inherit;
80
+ }
81
+ </style>
@@ -0,0 +1,10 @@
1
+ ---
2
+ import ProjectOverview from '../components/ProjectOverview.astro';
3
+ import Base from '../layouts/Base.astro';
4
+
5
+ export const prerender = true;
6
+ ---
7
+
8
+ <Base lang="en" title="Fimo + Astro">
9
+ <ProjectOverview locale="en" rendering="static" />
10
+ </Base>
@@ -0,0 +1,26 @@
1
+ ---
2
+ import { getLabels } from 'fimo/astro';
3
+ import { Text } from 'fimo/astro/components';
4
+
5
+ import Base from '../../layouts/Base.astro';
6
+ import * as Project from '../../schemas/Project';
7
+
8
+ export const prerender = false;
9
+
10
+ const slug = Astro.params.slug ?? '';
11
+ const [project, labels] = await Promise.all([Project.getBySlug(slug, { locale: 'en' }), getLabels({ locale: 'en' })]);
12
+
13
+ if (!project) {
14
+ return Astro.redirect('/404');
15
+ }
16
+ ---
17
+
18
+ <Base lang="en" title={String(project.title)}>
19
+ <main data-framework="astro" data-rendering="server" data-project-slug={slug}>
20
+ <a href="/projects"><Text as="span" value={labels.t('navigation.projects')} /></a>
21
+ <article>
22
+ <Text as="h1" value={project.title} />
23
+ <Text as="p" value={project.summary} />
24
+ </article>
25
+ </main>
26
+ </Base>
@@ -0,0 +1,10 @@
1
+ ---
2
+ import ProjectOverview from '../../components/ProjectOverview.astro';
3
+ import Base from '../../layouts/Base.astro';
4
+
5
+ export const prerender = false;
6
+ ---
7
+
8
+ <Base lang="en" title="Projects">
9
+ <ProjectOverview locale="en" rendering="server" />
10
+ </Base>
@@ -0,0 +1,9 @@
1
+ {
2
+ "uid": "Project",
3
+ "name": "Projects",
4
+ "i18n": { "enabled": true },
5
+ "fields": {
6
+ "title": { "type": "string", "required": true },
7
+ "summary": { "type": "text", "required": true }
8
+ }
9
+ }
@@ -0,0 +1,29 @@
1
+ // AUTO-GENERATED by `fimo` from src/schemas/Project.json - DO NOT EDIT.
2
+ // Runtime implementation lives in the project-local fimo/astro package export.
3
+ import { createContentClient } from 'fimo/astro';
4
+ import type { CollectionContentClient, ContentSchema } from 'fimo/astro';
5
+
6
+ import schema from './Project.json';
7
+ import type { Project, ProjectFields, ProjectInput, ProjectPopulate, ProjectQuery } from './Project.types';
8
+
9
+ export type {
10
+ Project,
11
+ ProjectFields,
12
+ ProjectFimoMeta,
13
+ ProjectInput,
14
+ ProjectPopulate,
15
+ ProjectQuery,
16
+ ProjectReferences,
17
+ ProjectResult,
18
+ ProjectSort,
19
+ ProjectWhere,
20
+ } from './Project.types';
21
+ export type { CollectionPage, CollectionPageInfo } from 'fimo/astro';
22
+
23
+ const client: CollectionContentClient<Project, ProjectInput> = createContentClient<Project, ProjectInput>({
24
+ schema: schema as unknown as ContentSchema,
25
+ });
26
+
27
+ export const { wrapWithSource, meta, getById, getBySlug, getByField, list, get, create, update, remove } = client;
28
+
29
+ export default client;
@@ -0,0 +1,70 @@
1
+ // AUTO-GENERATED ⚠️ – do not edit by hand
2
+ import {
3
+ type Fields,
4
+ type FimoBoolean,
5
+ type FimoMedia,
6
+ type FimoPolymorphicReference,
7
+ type FimoReference,
8
+ type FimoRichText,
9
+ type FimoRichTextContent,
10
+ type FimoString,
11
+ type Populate,
12
+ type PopulatedResult,
13
+ type ProjectedWithPopulate,
14
+ type Query,
15
+ type Sort,
16
+ type Where,
17
+ type WithReferences,
18
+ } from 'fimo/astro';
19
+
20
+ /*───────────────────────────────────────────────────────────────*/
21
+ /* ──────────── 📄 Type definitions ──────────── */
22
+ /*───────────────────────────────────────────────────────────────*/
23
+
24
+ /**
25
+ * Project entity interface
26
+ */
27
+ export interface ProjectFimoMeta {
28
+ contentType: 'Project';
29
+ }
30
+
31
+ export interface Project extends WithReferences<ProjectReferences> {
32
+ id: string;
33
+ entryId: string;
34
+ documentId: string;
35
+ slug: FimoString;
36
+ locale: string;
37
+ createdAt: string;
38
+ updatedAt: string;
39
+ __fimo: ProjectFimoMeta;
40
+ title: FimoString;
41
+ summary: FimoString;
42
+ }
43
+
44
+ export interface ProjectInput {
45
+ slug?: string;
46
+ locale?: string;
47
+ documentId?: string;
48
+ title: string;
49
+ summary: string;
50
+ }
51
+
52
+ export type ProjectReferences = Record<never, never>;
53
+
54
+ export type ProjectPopulate = Populate<Project>;
55
+
56
+ /*───────────────────────────────────────────────────────────────*/
57
+ /* ──────────── 🔎 Query types ──────────── */
58
+ /*───────────────────────────────────────────────────────────────*/
59
+
60
+ export type ProjectWhere = Where<Project>;
61
+ export type ProjectSort = Sort<Project>;
62
+ export type ProjectFields = Fields<Project>;
63
+ export type ProjectQuery<
64
+ TFields extends ProjectFields | undefined = ProjectFields | undefined,
65
+ TPopulate extends ProjectPopulate | undefined = ProjectPopulate | undefined,
66
+ > = Query<Project, TFields, TPopulate>;
67
+ export type ProjectResult<
68
+ TFields extends ProjectFields | undefined = undefined,
69
+ TPopulate extends ProjectPopulate | undefined = undefined,
70
+ > = ProjectedWithPopulate<PopulatedResult<Project, TPopulate>, TFields, TPopulate>;
@@ -0,0 +1,10 @@
1
+ {
2
+ "uid": "SiteSettings",
3
+ "name": "Site settings",
4
+ "isSingleton": true,
5
+ "i18n": { "enabled": true },
6
+ "fields": {
7
+ "studioName": { "type": "string", "required": true },
8
+ "intro": { "type": "text", "required": true }
9
+ }
10
+ }
@@ -0,0 +1,31 @@
1
+ // AUTO-GENERATED by `fimo` from src/schemas/SiteSettings.json - DO NOT EDIT.
2
+ // Runtime implementation lives in the project-local fimo/astro package export.
3
+ import { createSingletonClient } from 'fimo/astro';
4
+ import type { ContentSchema, SingletonContentClient } from 'fimo/astro';
5
+
6
+ import schema from './SiteSettings.json';
7
+ import type { SiteSettings, SiteSettingsInput } from './SiteSettings.types';
8
+
9
+ export type {
10
+ SiteSettings,
11
+ SiteSettingsFields,
12
+ SiteSettingsFimoMeta,
13
+ SiteSettingsInput,
14
+ SiteSettingsPopulate,
15
+ SiteSettingsQuery,
16
+ SiteSettingsReferences,
17
+ SiteSettingsResult,
18
+ SiteSettingsSort,
19
+ SiteSettingsWhere,
20
+ } from './SiteSettings.types';
21
+
22
+ const client: SingletonContentClient<SiteSettings, SiteSettingsInput> = createSingletonClient<
23
+ SiteSettings,
24
+ SiteSettingsInput
25
+ >({
26
+ schema: schema as unknown as ContentSchema,
27
+ });
28
+
29
+ export const { get, update, wrapWithSource, meta } = client;
30
+
31
+ export default client;
@@ -0,0 +1,69 @@
1
+ // AUTO-GENERATED ⚠️ – do not edit by hand
2
+ import {
3
+ type Fields,
4
+ type FimoBoolean,
5
+ type FimoMedia,
6
+ type FimoPolymorphicReference,
7
+ type FimoReference,
8
+ type FimoRichText,
9
+ type FimoRichTextContent,
10
+ type FimoString,
11
+ type Populate,
12
+ type PopulatedResult,
13
+ type ProjectedWithPopulate,
14
+ type Query,
15
+ type Sort,
16
+ type Where,
17
+ type WithReferences,
18
+ } from 'fimo/astro';
19
+
20
+ /*───────────────────────────────────────────────────────────────*/
21
+ /* ──────────── 📄 Type definitions ──────────── */
22
+ /*───────────────────────────────────────────────────────────────*/
23
+
24
+ /**
25
+ * SiteSettings entity interface
26
+ */
27
+ export interface SiteSettingsFimoMeta {
28
+ contentType: 'SiteSettings';
29
+ }
30
+
31
+ export interface SiteSettings extends WithReferences<SiteSettingsReferences> {
32
+ id: string;
33
+ entryId: string;
34
+ documentId: string;
35
+ slug: FimoString;
36
+ locale: string;
37
+ createdAt: string;
38
+ updatedAt: string;
39
+ __fimo: SiteSettingsFimoMeta;
40
+ studioName: FimoString;
41
+ intro: FimoString;
42
+ }
43
+
44
+ export interface SiteSettingsInput {
45
+ slug?: string;
46
+ locale?: string;
47
+ studioName: string;
48
+ intro: string;
49
+ }
50
+
51
+ export type SiteSettingsReferences = Record<never, never>;
52
+
53
+ export type SiteSettingsPopulate = Populate<SiteSettings>;
54
+
55
+ /*───────────────────────────────────────────────────────────────*/
56
+ /* ──────────── 🔎 Query types ──────────── */
57
+ /*───────────────────────────────────────────────────────────────*/
58
+
59
+ export type SiteSettingsWhere = Where<SiteSettings>;
60
+ export type SiteSettingsSort = Sort<SiteSettings>;
61
+ export type SiteSettingsFields = Fields<SiteSettings>;
62
+ export type SiteSettingsQuery<
63
+ TFields extends SiteSettingsFields | undefined = SiteSettingsFields | undefined,
64
+ TPopulate extends SiteSettingsPopulate | undefined = SiteSettingsPopulate | undefined,
65
+ > = Query<SiteSettings, TFields, TPopulate>;
66
+ export type SiteSettingsResult<
67
+ TFields extends SiteSettingsFields | undefined = undefined,
68
+ TPopulate extends SiteSettingsPopulate | undefined = undefined,
69
+ > = ProjectedWithPopulate<PopulatedResult<SiteSettings, TPopulate>, TFields, TPopulate>;
@@ -0,0 +1,5 @@
1
+ {
2
+ "extends": "astro/tsconfigs/strict",
3
+ "include": [".astro/types.d.ts", "**/*"],
4
+ "exclude": ["dist"]
5
+ }
@@ -21,7 +21,7 @@
21
21
  "cmdk": "^1.1.1",
22
22
  "date-fns": "^4.1.0",
23
23
  "embla-carousel-react": "^8.6.0",
24
- "fimo": "0.15.0-staging.2",
24
+ "fimo": "0.15.0-staging.4",
25
25
  "input-otp": "^1.4.2",
26
26
  "isbot": "^5",
27
27
  "lucide-react": "^0.577.0",
@@ -1,8 +1,7 @@
1
- import { env } from '$env/dynamic/public';
2
1
  import { getLabels } from 'fimo/sveltekit';
3
2
 
4
3
  export async function load(event) {
5
4
  return {
6
- labels: await getLabels({ apiUrl: env.PUBLIC_FIMO_API_URL, event, locale: 'en' }),
5
+ labels: await getLabels({ event }),
7
6
  };
8
7
  }