@fumadocs/cli 0.0.4 → 0.0.6
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/dist/index.js +12 -11
- package/package.json +6 -6
package/dist/index.js
CHANGED
|
@@ -421,7 +421,7 @@ function localResolver(dir) {
|
|
|
421
421
|
import picocolors3 from "picocolors";
|
|
422
422
|
|
|
423
423
|
// src/generated.js
|
|
424
|
-
var generated = { "
|
|
424
|
+
var generated = { "app/docs-og/[...slug]/route": "import { generateOGImage } from 'fumadocs-ui/og';\nimport { metadataImage } from '@/lib/metadata';\n\nexport const GET = metadataImage.createAPI((page) => {\n return generateOGImage({\n title: page.data.title,\n description: page.data.description,\n site: 'My App',\n });\n});\n\nexport function generateStaticParams() {\n return metadataImage.generateParams();\n}\n", "lib/i18n": "import type { I18nConfig } from 'fumadocs-core/i18n';\n\nexport const i18n: I18nConfig = {\n defaultLanguage: 'en',\n languages: ['en', 'cn'],\n};\n", "middleware": "import { createI18nMiddleware } from 'fumadocs-core/i18n';\nimport { i18n } from '@/lib/i18n';\n\nexport default createI18nMiddleware(i18n);\n\nexport const config = {\n // Matcher ignoring `/_next/` and `/api/`\n matcher: ['/((?!api|_next/static|_next/image|favicon.ico).*)'],\n};\n", "scripts/generate-docs": "import * as OpenAPI from 'fumadocs-openapi';\nimport { rimrafSync } from 'rimraf';\n\nconst out = './content/docs/(api)';\n\n// clean generated files\nrimrafSync(out, {\n filter(v) {\n return !v.endsWith('index.mdx') && !v.endsWith('meta.json');\n },\n});\n\nvoid OpenAPI.generateFiles({\n // input files\n input: ['./openapi.json'],\n output: out,\n groupBy: 'tag',\n});\n", "lib/metadata": "import { createMetadataImage } from 'fumadocs-core/server';\nimport { source } from '@/lib/source';\n\nexport const metadataImage = createMetadataImage({\n imageRoute: '/docs-og',\n source,\n});\n" };
|
|
425
425
|
|
|
426
426
|
// src/plugins/og-image.ts
|
|
427
427
|
function isI18nEnabled(ctx) {
|
|
@@ -619,7 +619,7 @@ function runTransform(sourceFile) {
|
|
|
619
619
|
if (parent) {
|
|
620
620
|
const inner = parent.getJsxChildren().map((v) => v.getFullText()).filter((v) => v.length > 0).join("\n");
|
|
621
621
|
parent.setBodyText(
|
|
622
|
-
`<I18nProvider locale={params.lang} locales={[
|
|
622
|
+
`<I18nProvider locale={(await params).lang} locales={[
|
|
623
623
|
{ locale: 'en', name: 'English' }
|
|
624
624
|
]}>
|
|
625
625
|
${inner.trim()}
|
|
@@ -632,8 +632,9 @@ function runTransform(sourceFile) {
|
|
|
632
632
|
});
|
|
633
633
|
}
|
|
634
634
|
const func = sourceFile.getDescendantsOfKind(SyntaxKind3.FunctionDeclaration).find((v) => v.isDefaultExport());
|
|
635
|
+
func?.toggleModifier("async", true);
|
|
635
636
|
const param = func?.getParameters().at(0);
|
|
636
|
-
param?.setType(`{ params: { lang: string }
|
|
637
|
+
param?.setType(`{ params: Promise<{ lang: string }>, children: ReactNode }`);
|
|
637
638
|
param?.set({
|
|
638
639
|
name: `{ params, children }`
|
|
639
640
|
});
|
|
@@ -655,10 +656,10 @@ var i18nPlugin = {
|
|
|
655
656
|
type: "code",
|
|
656
657
|
title: "page.tsx",
|
|
657
658
|
code: `
|
|
658
|
-
export default function Page({
|
|
659
|
+
export default async function Page({
|
|
659
660
|
params,
|
|
660
661
|
}: {
|
|
661
|
-
${picocolors4.underline(picocolors4.bold("params: { lang: string; slug?: string[] }
|
|
662
|
+
${picocolors4.underline(picocolors4.bold("params: Promise<{ lang: string; slug?: string[] }>"))}
|
|
662
663
|
})
|
|
663
664
|
`.trim()
|
|
664
665
|
},
|
|
@@ -894,7 +895,7 @@ async function runTree(args) {
|
|
|
894
895
|
// package.json
|
|
895
896
|
var package_default = {
|
|
896
897
|
name: "@fumadocs/cli",
|
|
897
|
-
version: "0.0.
|
|
898
|
+
version: "0.0.6",
|
|
898
899
|
description: "The CLI tool for Fumadocs",
|
|
899
900
|
keywords: [
|
|
900
901
|
"NextJs",
|
|
@@ -928,17 +929,17 @@ var package_default = {
|
|
|
928
929
|
"types:check": "tsc --noEmit"
|
|
929
930
|
},
|
|
930
931
|
dependencies: {
|
|
931
|
-
"@clack/prompts": "^0.
|
|
932
|
+
"@clack/prompts": "^0.9.0",
|
|
932
933
|
commander: "^12.1.0",
|
|
933
|
-
execa: "^9.5.
|
|
934
|
-
"package-manager-detector": "^0.2.
|
|
934
|
+
execa: "^9.5.2",
|
|
935
|
+
"package-manager-detector": "^0.2.8",
|
|
935
936
|
picocolors: "^1.1.1",
|
|
936
937
|
"ts-morph": "^24.0.0"
|
|
937
938
|
},
|
|
938
939
|
devDependencies: {
|
|
939
940
|
"@types/cross-spawn": "^6.0.6",
|
|
940
|
-
"@types/node": "22.
|
|
941
|
-
"@types/react": "^
|
|
941
|
+
"@types/node": "22.10.2",
|
|
942
|
+
"@types/react": "^19.0.2",
|
|
942
943
|
"eslint-config-custom": "workspace:*",
|
|
943
944
|
"fast-glob": "^3.3.1",
|
|
944
945
|
tsconfig: "workspace:*",
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@fumadocs/cli",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.6",
|
|
4
4
|
"description": "The CLI tool for Fumadocs",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"NextJs",
|
|
@@ -26,17 +26,17 @@
|
|
|
26
26
|
"dist/*"
|
|
27
27
|
],
|
|
28
28
|
"dependencies": {
|
|
29
|
-
"@clack/prompts": "^0.
|
|
29
|
+
"@clack/prompts": "^0.9.0",
|
|
30
30
|
"commander": "^12.1.0",
|
|
31
|
-
"execa": "^9.5.
|
|
32
|
-
"package-manager-detector": "^0.2.
|
|
31
|
+
"execa": "^9.5.2",
|
|
32
|
+
"package-manager-detector": "^0.2.8",
|
|
33
33
|
"picocolors": "^1.1.1",
|
|
34
34
|
"ts-morph": "^24.0.0"
|
|
35
35
|
},
|
|
36
36
|
"devDependencies": {
|
|
37
37
|
"@types/cross-spawn": "^6.0.6",
|
|
38
|
-
"@types/node": "22.
|
|
39
|
-
"@types/react": "^
|
|
38
|
+
"@types/node": "22.10.2",
|
|
39
|
+
"@types/react": "^19.0.2",
|
|
40
40
|
"fast-glob": "^3.3.1",
|
|
41
41
|
"tsx": "^4.19.2",
|
|
42
42
|
"eslint-config-custom": "0.0.0",
|