diff --git a/apps/docs/content/docs/fmdapi/quick-start.mdx b/apps/docs/content/docs/fmdapi/quick-start.mdx index b4d67a51..9aca62bb 100644 --- a/apps/docs/content/docs/fmdapi/quick-start.mdx +++ b/apps/docs/content/docs/fmdapi/quick-start.mdx @@ -4,6 +4,7 @@ title: Quick Start - Typegen import { Tabs, Tab } from "fumadocs-ui/components/tabs"; import { Steps, Step } from "fumadocs-ui/components/steps"; +import { AgentCommand } from "@/components/AgentCommand"; The typegen tool is the best way to interact with this library, as it will automatically generate layout-specific clients and get autocomplete hints in your IDE with your actual field names from your solution @@ -12,19 +13,25 @@ The typegen tool is the best way to interact with this library, as it will autom ### Install the required packages ```package-install - @proofkit/fmdapi zod + @proofkit/fmdapi@beta zod ``` Zod is used by the typegen tool by default, but it can be excluded if you set `validator` to `false` in the typegen config. + #### AI Agent Integration + + If you use an AI coding agent, run this command to map ProofKit's built-in skills to your project. See the [TanStack Intent docs](https://tanstack.com/intent/latest/docs/getting-started/quick-start-consumers) for more details. + + + ### Create a typegen config file in your project ```sh - npx @proofkit/typegen + npx @proofkit/typegen@beta ``` @@ -73,7 +80,7 @@ The typegen tool is the best way to interact with this library, as it will autom Run this command any time you make changes to your config file, any of the referenced FileMaker layouts, or any field names/types that are on the layouts. ```sh - npx @proofkit/typegen + npx @proofkit/typegen@beta ``` @@ -83,7 +90,7 @@ The typegen tool is the best way to interact with this library, as it will autom { "scripts": { // ... - "typegen": "npx @proofkit/typegen" + "typegen": "npx @proofkit/typegen@beta" } } ``` @@ -122,4 +129,4 @@ If you run into any limitations from the generated code, there are many ways to How to configure the typegen tool for your use case. Customize the shape of the data returned from your database. - \ No newline at end of file + diff --git a/apps/docs/content/docs/fmodata/cli.mdx b/apps/docs/content/docs/fmodata/cli.mdx index 6dd61817..38b1f749 100644 --- a/apps/docs/content/docs/fmodata/cli.mdx +++ b/apps/docs/content/docs/fmodata/cli.mdx @@ -5,6 +5,7 @@ description: Run fmodata operations from the command line — queries, scripts, import { Callout } from "fumadocs-ui/components/callout"; import { Tab, Tabs } from "fumadocs-ui/components/tabs"; +import { PackageInstall } from "@/components/PackageInstall"; The `@proofkit/fmodata` package ships a built-in CLI binary called **`fmodata`**. It exposes every library operation — querying records, running scripts, managing webhooks, inspecting metadata, and modifying schema — as a non-interactive command suitable for scripting, CI pipelines, and quick one-off database operations. @@ -12,17 +13,11 @@ The `@proofkit/fmodata` package ships a built-in CLI binary called **`fmodata`** The binary is included automatically when you install the package: -```bash -pnpm add @proofkit/fmodata -# or -npm install @proofkit/fmodata -``` + If you want it available globally: -```bash -pnpm add -g @proofkit/fmodata -``` + ## Connection Configuration diff --git a/apps/docs/content/docs/fmodata/index.mdx b/apps/docs/content/docs/fmodata/index.mdx index 60d73341..13c05d2e 100644 --- a/apps/docs/content/docs/fmodata/index.mdx +++ b/apps/docs/content/docs/fmodata/index.mdx @@ -5,7 +5,6 @@ description: "@proofkit/fmodata" import { Callout } from "fumadocs-ui/components/callout"; import { Card, Cards } from "fumadocs-ui/components/card"; -import { CliCommand } from "@/components/CliCommand"; This library is in beta status. We don't expect the method names or arguments to change further, but please submit feedback or report issues on the [community forum](https://community.ottomatic.cloud/c/proofkit/13) or on [GitHub](https://github.com/proofgeist/proofkit/issues). @@ -33,12 +32,6 @@ To use this library you need: - (if using OttoFMS) a Data API key setup for your FileMaker account with OData enabled -## AI Agent Integration - -If you use an AI coding agent, install ProofKit skills for better code generation after installing the package: - - - ## When to Use OData vs Data API Claris has given signals that OData is the future of data access for FileMaker. It's much faster and more powerful than the Data API since it does not require the server to spin up a server-side client or maintain a session for each request. However, it's a new paradigm for thinking about how we can interact with the FileMaker server and may take some adjustment. You should not worry about continuing to use the Data API if needed, but we suggest trying OData for new projects. diff --git a/apps/docs/content/docs/fmodata/meta.json b/apps/docs/content/docs/fmodata/meta.json index 4b79ab69..7491b9bd 100644 --- a/apps/docs/content/docs/fmodata/meta.json +++ b/apps/docs/content/docs/fmodata/meta.json @@ -20,9 +20,8 @@ "entity-ids", "extra-properties", "custom-fetch-handlers", - "---CLI---", - "cli", "---Reference---", + "cli", "errors", "methods" ], diff --git a/apps/docs/content/docs/fmodata/quick-start.mdx b/apps/docs/content/docs/fmodata/quick-start.mdx index dd19a5fd..758398a5 100644 --- a/apps/docs/content/docs/fmodata/quick-start.mdx +++ b/apps/docs/content/docs/fmodata/quick-start.mdx @@ -12,6 +12,7 @@ import { import { Callout } from "fumadocs-ui/components/callout"; import { Card } from "fumadocs-ui/components/card"; import { CliCommand } from "@/components/CliCommand"; +import { AgentCommand } from "@/components/AgentCommand"; import { PackageInstall } from "@/components/PackageInstall"; import { Badge } from "@/components/ui/badge"; @@ -25,9 +26,9 @@ Here's a minimal example to get you started with `@proofkit/fmodata`: #### AI Agent Integration - If you use an AI coding agent, install ProofKit skills for better code generation: + If you use an AI coding agent, run this command to map ProofKit's built-in skills to your project. See the [TanStack Intent docs](https://tanstack.com/intent/latest/docs/getting-started/quick-start-consumers) for more details. - + diff --git a/apps/docs/src/app/docs/(docs)/layout.tsx b/apps/docs/src/app/docs/(docs)/layout.tsx index 32198203..a82397a6 100644 --- a/apps/docs/src/app/docs/(docs)/layout.tsx +++ b/apps/docs/src/app/docs/(docs)/layout.tsx @@ -8,6 +8,9 @@ export default function Layout({ children }: { children: ReactNode }) { diff --git a/apps/docs/src/app/docs/templates/layout.tsx b/apps/docs/src/app/docs/templates/layout.tsx index ab2acfbd..b8f41e52 100644 --- a/apps/docs/src/app/docs/templates/layout.tsx +++ b/apps/docs/src/app/docs/templates/layout.tsx @@ -77,6 +77,9 @@ export default async function Layout({ children }: { children: ReactNode }) { { + navigator.clipboard.writeText(command); + setCopied(true); + setTimeout(() => setCopied(false), 2000); + }, [command]); + + return ( +
+
+
+ {label} + +
+
+ + {command} +
+
+
+ ); +} + +export default AgentCommand; diff --git a/apps/docs/src/components/CliCommand.tsx b/apps/docs/src/components/CliCommand.tsx index 5cbe67f7..90976d54 100644 --- a/apps/docs/src/components/CliCommand.tsx +++ b/apps/docs/src/components/CliCommand.tsx @@ -42,7 +42,15 @@ export function CliCommand({ execPackage?: string; packageName?: string; }) { - const pkg = execPackage ?? `${packageName}@${cliVersion}`; + const hasVersionSpecifier = (pkg: string) => { + if (pkg.startsWith("@")) { + const slash = pkg.indexOf("/"); + return slash !== -1 && pkg.indexOf("@", slash + 1) !== -1; + } + return pkg.includes("@"); + }; + const shouldAppendVersion = packageName.startsWith("@proofkit/") && !hasVersionSpecifier(packageName); + const pkg = execPackage ?? (shouldAppendVersion ? `${packageName}@${cliVersion}` : packageName); return ( m.label)} persist> {MANAGERS.map((manager) => ( diff --git a/apps/docs/src/components/PackageInstall.tsx b/apps/docs/src/components/PackageInstall.tsx index a72401f0..293e5cc1 100644 --- a/apps/docs/src/components/PackageInstall.tsx +++ b/apps/docs/src/components/PackageInstall.tsx @@ -4,10 +4,10 @@ import { Tab, Tabs } from "fumadocs-ui/components/tabs"; import { cliVersion } from "@/lib/constants"; const MANAGERS = [ - { key: "npm", label: "npm", prefix: "npm install" }, - { key: "pnpm", label: "pnpm", prefix: "pnpm add" }, - { key: "yarn", label: "yarn", prefix: "yarn add" }, - { key: "bun", label: "bun", prefix: "bun add" }, + { key: "npm", label: "npm", prefix: "npm install", globalPrefix: "npm install -g" }, + { key: "pnpm", label: "pnpm", prefix: "pnpm add", globalPrefix: "pnpm add -g" }, + { key: "yarn", label: "yarn", prefix: "yarn add", globalPrefix: "yarn global add" }, + { key: "bun", label: "bun", prefix: "bun add", globalPrefix: "bun add -g" }, ]; const WHITESPACE_RE = /\s+/; @@ -16,7 +16,7 @@ const WHITESPACE_RE = /\s+/; * Renders a tabbed package install command. * Automatically appends @{cliVersion} to @proofkit/* packages unless version is already specified. */ -export function PackageInstall({ packages }: { packages: string }) { +export function PackageInstall({ packages, global: isGlobal }: { packages: string; global?: boolean }) { const pkgs = packages .trim() .split(WHITESPACE_RE) @@ -33,7 +33,7 @@ export function PackageInstall({ packages }: { packages: string }) { m.label)} persist> {MANAGERS.map((manager) => ( - + ))}