Initial push of Plunk Next

This commit is contained in:
Dries Augustyns
2025-12-01 09:56:56 +01:00
parent 07cea20262
commit ff1876d580
566 changed files with 89036 additions and 28423 deletions
+5
View File
@@ -0,0 +1,5 @@
import {createOpenAPI} from 'fumadocs-openapi/server';
export const openapi = createOpenAPI({
input: ['./openapi.local.json'],
});
+25
View File
@@ -0,0 +1,25 @@
import { visit } from 'unist-util-visit';
// Default URLs that will be replaced at container startup by sed
const API_URL = process.env.NEXT_PUBLIC_API_URI || 'https://api.useplunk.com';
const DASHBOARD_URL = process.env.NEXT_PUBLIC_DASHBOARD_URI || 'https://app.useplunk.com';
export function remarkReplaceEnv() {
return (tree) => {
visit(tree, ['code', 'inlineCode', 'text', 'link'], (node) => {
// Replace in text values
if (node.value && typeof node.value === 'string') {
node.value = node.value
.replace(/\{\{API_URL\}\}/g, API_URL)
.replace(/\{\{DASHBOARD_URL\}\}/g, DASHBOARD_URL);
}
// Replace in link URLs
if (node.url && typeof node.url === 'string') {
node.url = node.url
.replace(/\{\{API_URL\}\}/g, API_URL)
.replace(/\{\{DASHBOARD_URL\}\}/g, DASHBOARD_URL);
}
});
};
}
+19
View File
@@ -0,0 +1,19 @@
import {loader} from 'fumadocs-core/source';
import {icons} from 'lucide-react';
import {createElement} from 'react';
import {docs} from '@/.source';
// See https://fumadocs.vercel.app/docs/headless/source-api for more info
export const source = loader({
// it assigns a URL to your pages
baseUrl: '/',
source: docs.toFumadocsSource(),
icon(icon) {
if (!icon) {
// You may set a default icon
return;
}
if (icon in icons) return createElement(icons[icon as keyof typeof icons]);
},
});