fimo 2.0.0 → 2.0.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/assets/skills/fimo-code/references/frameworks/compatibility.md +6 -0
- package/dist/cli/bundle.json +2 -2
- package/dist/cli/index.js +5 -5
- package/dist/scripts/sync-schemas.js +17 -3
- package/package.json +7 -7
- package/templates/astro/package.json +2 -2
- package/templates/nextjs/package.json +3 -3
- package/templates/react-router/package.json +4 -4
- package/templates/sveltekit/package.json +2 -2
- package/templates/vite/package.json +4 -4
|
@@ -17,6 +17,8 @@ const GENERATED_REGISTRY_MARKER = '// AUTO-GENERATED by `fimo` from src/schemas/
|
|
|
17
17
|
// Before 0.7, generated schema clients contained their own runtime. Keep using
|
|
18
18
|
// those projects' bundled templates instead of generating imports they cannot satisfy.
|
|
19
19
|
const MINIMUM_THIN_CONTENT_CLIENT_RUNTIME_VERSION = '0.7.0';
|
|
20
|
+
// Companion packages first shipped in 0.21 prereleases, before the 1.0 stable release.
|
|
21
|
+
const MINIMUM_FRAMEWORK_COMPANION_RUNTIME_VERSION = '0.21.0-0';
|
|
20
22
|
const CONTENT_CLIENT_RUNTIME_UPGRADE_COMMAND = 'npm install fimo@latest';
|
|
21
23
|
const SCHEMA_DEFINITION_SCHEMA = z.object({
|
|
22
24
|
uid: z.string().min(1),
|
|
@@ -140,6 +142,7 @@ function resolveProjectRuntime(cwd) {
|
|
|
140
142
|
return {
|
|
141
143
|
packageRoot: dirname(packagePath),
|
|
142
144
|
version,
|
|
145
|
+
providesLegacyReactRuntime: packageExportsSubpath(packageJson, './ui'),
|
|
143
146
|
providesReactRuntime: packageExportsSubpath(readProjectPackage(cwd, 'fimo-react'), '.'),
|
|
144
147
|
providesNextRuntime: packageExportsSubpath(readProjectPackage(cwd, 'fimo-next'), '.') &&
|
|
145
148
|
packageExportsSubpath(readProjectPackage(cwd, 'fimo-next'), './client'),
|
|
@@ -149,7 +152,7 @@ function resolveProjectRuntime(cwd) {
|
|
|
149
152
|
providesSvelteKitRuntime: packageExportsSubpath(readProjectPackage(cwd, 'fimo-sveltekit'), '.'),
|
|
150
153
|
};
|
|
151
154
|
}
|
|
152
|
-
function contentRuntimeImportFor(framework) {
|
|
155
|
+
function contentRuntimeImportFor(framework, runtime) {
|
|
153
156
|
if (framework === 'nextjs') {
|
|
154
157
|
return 'fimo-next';
|
|
155
158
|
}
|
|
@@ -162,7 +165,7 @@ function contentRuntimeImportFor(framework) {
|
|
|
162
165
|
if (framework === 'sveltekit' || framework === 'sveltekit-1') {
|
|
163
166
|
return 'fimo-sveltekit';
|
|
164
167
|
}
|
|
165
|
-
return 'fimo-react';
|
|
168
|
+
return isVersionAtLeast(runtime.version, MINIMUM_FRAMEWORK_COMPANION_RUNTIME_VERSION) ? 'fimo-react' : 'fimo/ui';
|
|
166
169
|
}
|
|
167
170
|
function templatePath(runtime, templateName) {
|
|
168
171
|
const template = CONTENT_TEMPLATE_PATHS[templateName];
|
|
@@ -173,6 +176,17 @@ function templatePath(runtime, templateName) {
|
|
|
173
176
|
return assetPath('content-templates', template.current);
|
|
174
177
|
}
|
|
175
178
|
function resolveSchemaGenerationTarget(runtimeImport, runtime) {
|
|
179
|
+
if (runtimeImport === 'fimo/ui' &&
|
|
180
|
+
isVersionAtLeast(runtime.version, MINIMUM_THIN_CONTENT_CLIENT_RUNTIME_VERSION) &&
|
|
181
|
+
!runtime.providesLegacyReactRuntime) {
|
|
182
|
+
throw new Error(`Cannot generate schema clients because project-local fimo@${runtime.version} does not provide the ` +
|
|
183
|
+
'legacy fimo/ui export required by this React project. ' +
|
|
184
|
+
`Run \`${CONTENT_CLIENT_RUNTIME_UPGRADE_COMMAND}\` in the project, then run \`npx fimo@latest validate\` again. ` +
|
|
185
|
+
'No generated files were changed.');
|
|
186
|
+
}
|
|
187
|
+
if (runtimeImport === 'fimo/ui') {
|
|
188
|
+
return 'react';
|
|
189
|
+
}
|
|
176
190
|
if (runtimeImport === 'fimo-react' && !runtime.providesReactRuntime) {
|
|
177
191
|
throw new Error(`Cannot generate schema clients because the project does not provide the ` +
|
|
178
192
|
'fimo-react package required by this React project. ' +
|
|
@@ -476,7 +490,7 @@ export function syncSchemas(options) {
|
|
|
476
490
|
const schemas = loadSchemas(schemaFiles);
|
|
477
491
|
const generatedFilesOnDisk = getGeneratedFiles(schemasDir);
|
|
478
492
|
const runtime = schemas.length > 0 || generatedFilesOnDisk.length > 0 ? resolveProjectRuntime(cwd) : null;
|
|
479
|
-
const runtimeImport = contentRuntimeImportFor(options.framework);
|
|
493
|
+
const runtimeImport = runtime ? contentRuntimeImportFor(options.framework, runtime) : 'fimo-react';
|
|
480
494
|
const generationTarget = runtime ? resolveSchemaGenerationTarget(runtimeImport, runtime) : null;
|
|
481
495
|
const needsContentRegistry = (generationTarget === 'next' || generationTarget === 'sveltekit') && schemas.length > 0;
|
|
482
496
|
const ownsExistingRegistry = existsSync(registryPath) && readFileSync(registryPath, 'utf-8').startsWith(GENERATED_REGISTRY_MARKER);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "fimo",
|
|
3
|
-
"version": "2.0.
|
|
3
|
+
"version": "2.0.1",
|
|
4
4
|
"description": "Fimo CLI - create, deploy, and manage Fimo projects",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"astro-component"
|
|
@@ -184,12 +184,12 @@
|
|
|
184
184
|
"devDependencies": {
|
|
185
185
|
"@clack/core": "^1.2.0",
|
|
186
186
|
"@clack/prompts": "^1.2.0",
|
|
187
|
-
"@fimo/agents-bundle": "2.0.
|
|
188
|
-
"@fimo/api-contracts": "2.0.
|
|
189
|
-
"@fimo/cli-kit": "2.0.
|
|
190
|
-
"@fimo/framework-detect": "2.0.
|
|
191
|
-
"@fimo/routes": "2.0.
|
|
192
|
-
"@fimo/tsconfig": "2.0.
|
|
187
|
+
"@fimo/agents-bundle": "2.0.1",
|
|
188
|
+
"@fimo/api-contracts": "2.0.1",
|
|
189
|
+
"@fimo/cli-kit": "2.0.1",
|
|
190
|
+
"@fimo/framework-detect": "2.0.1",
|
|
191
|
+
"@fimo/routes": "2.0.1",
|
|
192
|
+
"@fimo/tsconfig": "2.0.1",
|
|
193
193
|
"@types/node": "22.18.6",
|
|
194
194
|
"agent-install": "^0.0.5",
|
|
195
195
|
"astro": "^7.1.6",
|
|
@@ -12,9 +12,9 @@
|
|
|
12
12
|
},
|
|
13
13
|
"dependencies": {
|
|
14
14
|
"@tanstack/react-query": "^5.80.6",
|
|
15
|
-
"fimo": "2.0.
|
|
16
|
-
"fimo-next": "2.0.
|
|
17
|
-
"fimo-react": "2.0.
|
|
15
|
+
"fimo": "2.0.1",
|
|
16
|
+
"fimo-next": "2.0.1",
|
|
17
|
+
"fimo-react": "2.0.1",
|
|
18
18
|
"next": "^16.3.0",
|
|
19
19
|
"react": "^19.2.7",
|
|
20
20
|
"react-dom": "^19.2.7"
|
|
@@ -21,10 +21,10 @@
|
|
|
21
21
|
"cmdk": "^1.1.1",
|
|
22
22
|
"date-fns": "^4.1.0",
|
|
23
23
|
"embla-carousel-react": "^8.6.0",
|
|
24
|
-
"fimo": "2.0.
|
|
25
|
-
"fimo-react": "2.0.
|
|
26
|
-
"fimo-react-router": "2.0.
|
|
27
|
-
"fimo-vite": "2.0.
|
|
24
|
+
"fimo": "2.0.1",
|
|
25
|
+
"fimo-react": "2.0.1",
|
|
26
|
+
"fimo-react-router": "2.0.1",
|
|
27
|
+
"fimo-vite": "2.0.1",
|
|
28
28
|
"input-otp": "^1.4.2",
|
|
29
29
|
"isbot": "^5",
|
|
30
30
|
"lucide-react": "^0.577.0",
|
|
@@ -11,10 +11,10 @@
|
|
|
11
11
|
},
|
|
12
12
|
"dependencies": {
|
|
13
13
|
"@tanstack/react-query": "^5.80.6",
|
|
14
|
-
"fimo": "2.0.
|
|
15
|
-
"fimo-react": "2.0.
|
|
16
|
-
"fimo-react-router": "2.0.
|
|
17
|
-
"fimo-vite": "2.0.
|
|
14
|
+
"fimo": "2.0.1",
|
|
15
|
+
"fimo-react": "2.0.1",
|
|
16
|
+
"fimo-react-router": "2.0.1",
|
|
17
|
+
"fimo-vite": "2.0.1",
|
|
18
18
|
"react": "^19.2.7",
|
|
19
19
|
"react-dom": "^19.2.7",
|
|
20
20
|
"react-router": "^8.3.0"
|