Skip to content
Closed
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
7 changes: 6 additions & 1 deletion apps/docs/scripts/generate-props.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
// `export const notes` adds authored defaults and descriptions.
//
// Writes apps/docs/.generated/props.json. Requires `pnpm build:kit` first.
import { mkdirSync, readdirSync, readFileSync, writeFileSync } from 'node:fs';
import { existsSync, mkdirSync, readdirSync, readFileSync, writeFileSync } from 'node:fs';
import path from 'node:path';
import { fileURLToPath, pathToFileURL } from 'node:url';
import { createGenerator } from 'fumadocs-typescript';
Expand Down Expand Up @@ -93,6 +93,11 @@ for (const file of readdirSync(kitSrc, { recursive: true }).filter(f => /\.tsx?$
}
const aliasLink = (type) => aliases.get(/^(?:keyof )?(\w+)$/.exec(type)?.[1]);

if (!existsSync(path.resolve(docsDir, '../../packages/kit/dist/types'))) {
console.error('packages/kit/dist is missing. Run `pnpm build:kit` first.');
process.exit(1);
}

const generator = createGenerator({ tsconfigPath: path.resolve(propsDir, '../../tsconfig.json') });
const tables = {};
const errors = [];
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
"author": "riccardoperra",
"contributors": [],
"scripts": {
"dev": "turbo run dev --parallel",
"dev": "pnpm build:kit && turbo run dev --parallel",
"build": "turbo run build",
"api:update": "node tools/api-snapshot.mjs --update",
"api:check": "node tools/api-snapshot.mjs",
Expand Down
4 changes: 3 additions & 1 deletion packages/kit/rollup.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,9 @@ const entries = Object.values(manifest.exports)
entry.solid.default.replace("./dist/source/", "src/").replace(/\.js(x?)$/, ".ts$1"),
);

rmSync("dist", { recursive: true, force: true });
// A watch run keeps the existing dist, so tools that read it (the docs props generator) never see it empty.
const watching = process.argv.some(arg => arg === "-w" || arg === "--watch");
if (!watching) rmSync("dist", { recursive: true, force: true });

function tsTypes() {
return {
Expand Down