Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .changeset/use-ultracite-for-new-app-scripts.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@proofkit/cli": patch
---

Update newly scaffolded apps to use Ultracite for linting and formatting by default, including the generated `lint` and `format` scripts and CLI formatting flow.
11 changes: 11 additions & 0 deletions .codex/environments/environment-2.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# THIS IS AUTOGENERATED. DO NOT EDIT MANUALLY
version = 1
name = "proofkit"

[setup]
script = ""

[[actions]]
name = "Run"
icon = "run"
command = "pnpm i"
11 changes: 11 additions & 0 deletions .codex/environments/environment.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# THIS IS AUTOGENERATED. DO NOT EDIT MANUALLY
version = 1
name = "proofkit"

[setup]
script = ""

[[actions]]
name = "Run"
icon = "run"
command = "pnpm i"
22 changes: 11 additions & 11 deletions packages/better-auth/bin/intent.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,17 +4,17 @@
// Commit this file, then add to your package.json:
// "bin": { "intent": "./bin/intent.js" }
try {
await import('@tanstack/intent/intent-library')
await import("@tanstack/intent/intent-library");
} catch (e) {
if (e?.code === 'ERR_MODULE_NOT_FOUND' || e?.code === 'MODULE_NOT_FOUND') {
console.error('@tanstack/intent is not installed.')
console.error('')
console.error('Install it as a dev dependency:')
console.error(' npm add -D @tanstack/intent')
console.error('')
console.error('Or run directly:')
console.error(' npx @tanstack/intent@latest list')
process.exit(1)
if (e?.code === "ERR_MODULE_NOT_FOUND" || e?.code === "MODULE_NOT_FOUND") {
console.error("@tanstack/intent is not installed.");
console.error("");
console.error("Install it as a dev dependency:");
console.error(" npm add -D @tanstack/intent");
console.error("");
console.error("Or run directly:");
console.error(" npx @tanstack/intent@latest list");
process.exit(1);
}
throw e
throw e;
}
12 changes: 9 additions & 3 deletions packages/cli/src/helpers/createProject.ts
Original file line number Diff line number Diff line change
Expand Up @@ -68,8 +68,8 @@ export const createBareProject = async ({
"tw-animate-css",
"zod",
] as AvailableDependencies[];
const SHADCN_BASE_DEV_DEPS = [] as AvailableDependencies[];
const VITE_SHADCN_BASE_DEV_DEPS = ["@proofkit/typegen"] as AvailableDependencies[];
const SHADCN_BASE_DEV_DEPS = ["ultracite"] as AvailableDependencies[];
const VITE_SHADCN_BASE_DEV_DEPS = ["@proofkit/typegen", "ultracite"] as AvailableDependencies[];

const MANTINE_DEPS = [
"@mantine/core",
Expand All @@ -79,7 +79,12 @@ export const createBareProject = async ({
"@mantine/notifications",
"mantine-react-table",
] as AvailableDependencies[];
const MANTINE_DEV_DEPS = ["postcss", "postcss-preset-mantine", "postcss-simple-vars"] as AvailableDependencies[];
const MANTINE_DEV_DEPS = [
"postcss",
"postcss-preset-mantine",
"postcss-simple-vars",
"ultracite",
] as AvailableDependencies[];

if (state.ui === "mantine") {
addPackageDependency({
Expand Down Expand Up @@ -124,6 +129,7 @@ export const createBareProject = async ({
}

replaceTextInFiles(state.projectDir, "__PNPM_COMMAND__", pkgManagerCommand);
replaceTextInFiles(state.projectDir, "__PACKAGE_MANAGER__", pkgManager);

return state.projectDir;
};
3 changes: 3 additions & 0 deletions packages/cli/src/installers/dependencyVersionMap.ts
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,9 @@ export const dependencyVersionMap = {
// Theme utilities
"next-themes": "^0.4.6",

// Linting and formatting
ultracite: "^7.0.8",

// Zod
zod: "^4",
} as const;
Expand Down
8 changes: 4 additions & 4 deletions packages/cli/src/utils/formatting.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,19 +4,19 @@ import type { Project } from "ts-morph";
import { state } from "~/state.js";

/**
* Formats all source files in a ts-morph Project using biome and saves the changes.
* Formats all source files in a ts-morph Project using ultracite and saves the changes.
* @param project The ts-morph Project containing the files to format
*/
export async function formatAndSaveSourceFiles(project: Project) {
await project.save(); // save files first
try {
// Run biome format on the project directory
await execa("npx", ["@biomejs/biome", "format", "--write", state.projectDir], {
// Run ultracite fix on the project directory
await execa("npx", ["ultracite", "fix", "."], {
cwd: state.projectDir,
});
} catch (error) {
if (state.debug) {
console.log("Error formatting files with biome");
console.log("Error formatting files with ultracite");
console.error(error);
}
// Continue even if formatting fails
Expand Down
5 changes: 2 additions & 3 deletions packages/cli/template/nextjs-mantine/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@
"dev": "next dev --turbopack",
"build": "next build",
"start": "next start",
"lint": "biome check",
"format": "biome format --write",
"lint": "ultracite check .",
"format": "ultracite fix .",
"proofkit": "proofkit",
"typegen": "proofkit typegen",
"deploy": "proofkit deploy"
Expand Down Expand Up @@ -35,7 +35,6 @@
"@types/node": "^20",
"@types/react": "npm:types-react@19.0.12",
"@types/react-dom": "npm:types-react-dom@19.0.4",
"@biomejs/biome": "2.3.11",
"postcss": "^8.4.41",
"ultracite": "7.0.8",
"postcss-preset-mantine": "^1.17.0",
Expand Down
7 changes: 3 additions & 4 deletions packages/cli/template/nextjs-shadcn/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@
"build": "next build --turbopack",
"proofkit": "proofkit",
"start": "next start",
"lint": "biome check",
"format": "biome format --write"
"lint": "ultracite check .",
"format": "ultracite fix ."
},
"dependencies": {
"@radix-ui/react-slot": "^1.2.3",
Expand All @@ -25,14 +25,13 @@
"tailwind-merge": "^3.3.1"
},
"devDependencies": {
"@biomejs/biome": "2.3.11",
"@tailwindcss/postcss": "^4",
"@types/node": "^22",
"@types/react": "^19",
"@types/react-dom": "^19",
"tailwindcss": "^4",
"tw-animate-css": "^1.3.7",
"typescript": "^5",
"ultracite": "5.4.5"
"ultracite": "7.0.8"
}
}
18 changes: 18 additions & 0 deletions packages/cli/template/vite-wv/.claude/launch.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
{
"configurations": [
{
"name": "Preview",
"runtimeExecutable": "__PACKAGE_MANAGER__",
"runtimeArgs": ["run", "dev"],
"cwd": "${workspaceFolder}",
"autoPort": true,
"port": 5175
},
{
"name": "Typegen",
"runtimeExecutable": "__PACKAGE_MANAGER__",
"runtimeArgs": ["run", "typegen"],
"cwd": "${workspaceFolder}"
}
]
}
8 changes: 5 additions & 3 deletions packages/cli/template/vite-wv/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,22 +14,24 @@
"typegen": "typegen",
"typegen:ui": "typegen ui",
"upload": "node ./scripts/upload.js",
"lint": "biome check .",
"format": "biome format --write ."
"lint": "ultracite check .",
"format": "ultracite fix ."
},
"dependencies": {
"@tanstack/react-query": "^5.90.21",
"@tanstack/react-router": "^1.167.4",
"react": "^19.2.4",
"react-dom": "^19.2.4"
},
"devDependencies": {
"@biomejs/biome": "2.4.7",
"@proofkit/typegen": "^1.1.0-beta.16",
"@types/react": "^19.2.14",
"@types/react-dom": "^19.2.3",
"@vitejs/plugin-react": "^5.2.0",
"dotenv": "^17.3.1",
"open": "^11.0.0",
"typescript": "^5.9.3",
"ultracite": "7.0.8",
"vite": "^7.3.1",
"vite-plugin-singlefile": "^2.3.2"
}
Expand Down
4 changes: 2 additions & 2 deletions packages/cli/template/vite-wv/src/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ const steps: readonly Step[] = [

export default function App() {
return (
<main className="min-h-screen bg-background text-foreground">
<main>
<div className="mx-auto flex min-h-screen w-full max-w-5xl flex-col px-6 py-10 sm:px-10">
<div className="mb-10 flex-1">
<div className="inline-flex items-center gap-2 rounded-full border border-border bg-card px-3 py-1 text-sm text-muted-foreground shadow-sm">
Expand All @@ -48,7 +48,7 @@ export default function App() {
</h1>
<p className="mt-6 max-w-2xl text-lg leading-8 text-muted-foreground">
This starter stays intentionally small, but it is already ready for Tailwind v4, shadcn component
installs, and later ProofKit typegen output.
installs, hash-based TanStack Router navigation, React Query, and later ProofKit typegen output.
</p>

<div className="mt-8 flex flex-wrap gap-3 text-sm">
Expand Down
10 changes: 8 additions & 2 deletions packages/cli/template/vite-wv/src/main.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,11 @@
import { QueryClient, QueryClientProvider } from "@tanstack/react-query";
import { RouterProvider } from "@tanstack/react-router";
import React from "react";
import ReactDOM from "react-dom/client";
import App from "./App";
import "./index.css";
import { router } from "./router";

const queryClient = new QueryClient();

const rootElement = document.getElementById("root");
if (!rootElement) {
Expand All @@ -10,6 +14,8 @@ if (!rootElement) {

ReactDOM.createRoot(rootElement).render(
<React.StrictMode>
<App />
<QueryClientProvider client={queryClient}>
<RouterProvider router={router} />
</QueryClientProvider>
</React.StrictMode>,
);
57 changes: 57 additions & 0 deletions packages/cli/template/vite-wv/src/router.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
import {
Link,
Outlet,
createHashHistory,
createRootRoute,
createRoute,
createRouter,
} from "@tanstack/react-router";
import App from "./App";
import { QueryDemoPage } from "./routes/query-demo";

const rootRoute = createRootRoute({
component: RootLayout,
});

const indexRoute = createRoute({
getParentRoute: () => rootRoute,
path: "/",
component: App,
});

const queryDemoRoute = createRoute({
getParentRoute: () => rootRoute,
path: "/query",
component: QueryDemoPage,
});

const routeTree = rootRoute.addChildren([indexRoute, queryDemoRoute]);

export const router = createRouter({
routeTree,
history: createHashHistory(),
});

declare module "@tanstack/react-router" {
interface Register {
router: typeof router;
}
}

function RootLayout() {
return (
<div className="min-h-screen bg-background text-foreground">
<header className="border-b border-border bg-card/80">
<nav className="mx-auto flex w-full max-w-5xl items-center gap-4 px-6 py-3 sm:px-10">
<Link className="[&.active]:text-primary text-sm font-medium text-muted-foreground" to="/">
Starter
</Link>
<Link className="[&.active]:text-primary text-sm font-medium text-muted-foreground" to="/query">
Query Demo
</Link>
</nav>
</header>
<Outlet />
</div>
);
}
37 changes: 37 additions & 0 deletions packages/cli/template/vite-wv/src/routes/query-demo.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
import { useQuery } from "@tanstack/react-query";
import { Link } from "@tanstack/react-router";

const getConnectionHint = async (): Promise<string> => {
await new Promise((resolve) => setTimeout(resolve, 180));
return "Use fmFetch or generated clients once your FileMaker file is ready.";
};

export function QueryDemoPage() {
const hintQuery = useQuery({
queryKey: ["starter-connection-hint"],
queryFn: getConnectionHint,
});

return (
<main className="mx-auto w-full max-w-5xl px-6 py-10 sm:px-10">
<section className="rounded-3xl border border-border bg-card p-8 shadow-sm">
<p className="text-sm font-medium uppercase tracking-[0.2em] text-muted-foreground">React Query ready</p>
<h1 className="mt-4 text-3xl font-semibold tracking-tight">TanStack Query is preconfigured</h1>
<p className="mt-4 text-muted-foreground">
This route is rendered by TanStack Router using hash history, which is recommended for FileMaker WebViewer
apps.
</p>

<div className="mt-6 rounded-xl border border-border bg-background p-4 text-sm">
{hintQuery.isLoading ? "Loading starter data..." : hintQuery.data}
</div>

<div className="mt-6">
<Link className="inline-flex rounded-full border border-border bg-card px-4 py-2 text-sm font-medium" to="/">
Back to starter
</Link>
</div>
</section>
</main>
);
}
22 changes: 11 additions & 11 deletions packages/fmdapi/bin/intent.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,17 +4,17 @@
// Commit this file, then add to your package.json:
// "bin": { "intent": "./bin/intent.js" }
try {
await import('@tanstack/intent/intent-library')
await import("@tanstack/intent/intent-library");
} catch (e) {
if (e?.code === 'ERR_MODULE_NOT_FOUND' || e?.code === 'MODULE_NOT_FOUND') {
console.error('@tanstack/intent is not installed.')
console.error('')
console.error('Install it as a dev dependency:')
console.error(' npm add -D @tanstack/intent')
console.error('')
console.error('Or run directly:')
console.error(' npx @tanstack/intent@latest list')
process.exit(1)
if (e?.code === "ERR_MODULE_NOT_FOUND" || e?.code === "MODULE_NOT_FOUND") {
console.error("@tanstack/intent is not installed.");
console.error("");
console.error("Install it as a dev dependency:");
console.error(" npm add -D @tanstack/intent");
console.error("");
console.error("Or run directly:");
console.error(" npx @tanstack/intent@latest list");
process.exit(1);
}
throw e
throw e;
}
Loading
Loading