@bezel-labs/bezel-kit 0.8.0 → 0.9.0
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/README.md +5 -1
- package/dist/agent-skill.cjs +6 -6
- package/dist/agent-skill.cjs.map +1 -1
- package/dist/agent-skill.js +1 -1
- package/dist/{chunk-WHESGLCA.js → chunk-ACUFL3QJ.js} +10 -2
- package/dist/chunk-ACUFL3QJ.js.map +1 -0
- package/dist/chunk-WQRF54FG.js +17 -0
- package/dist/chunk-WQRF54FG.js.map +1 -0
- package/dist/cli.cjs +15 -7
- package/dist/cli.cjs.map +1 -1
- package/dist/cli.js +2 -2
- package/dist/index.cjs +6 -6
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +1 -1
- package/dist/node.cjs +15 -7
- package/dist/node.cjs.map +1 -1
- package/dist/node.d.cts +6 -0
- package/dist/node.d.ts +6 -0
- package/dist/node.js +2 -2
- package/package.json +1 -1
- package/dist/chunk-3XU5AUYB.js +0 -17
- package/dist/chunk-3XU5AUYB.js.map +0 -1
- package/dist/chunk-WHESGLCA.js.map +0 -1
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/node.ts","../src/config.ts","../src/managed-block.ts","../src/gitignore.ts","../src/init.ts"],"sourcesContent":["/**\n * bezel/node — Node entry.\n *\n * Re-exports the full isomorphic core, plus the filesystem conveniences:\n * read a DTCG tokens file and write the generated `variables.css` (and optional\n * `contexts.ts`/`fonts.ts`) to disk. This module imports `node:*` and is not\n * browser-safe; for the pure transform use `bezel`.\n */\nimport { mkdir, readFile, writeFile } from \"node:fs/promises\"\nimport { dirname, relative, sep } from \"node:path\"\nimport { resolveOptions, type BezelOptions, type ResolvedOptions } from \"./config\"\nimport { emitCss } from \"./emit\"\nimport { formatContextsModule, getContexts } from \"./contexts\"\nimport { formatFontsModule, getFonts } from \"./fonts\"\nimport { mergeGitignore } from \"./gitignore\"\nimport type { DtcgNode } from \"./types\"\n\nexport * from \"./index\"\nexport { resolveOptions } from \"./config\"\nexport type { BezelOptions, ResolvedOptions } from \"./config\"\nexport { initConfig, readPackageScripts } from \"./init\"\nexport type { InitOptions, InitResult } from \"./init\"\nexport { DEFAULT_CONFIG_FILE, DEFAULT_OUTPUT_DIR, FALLBACK_OUTPUT_DIR } from \"./defaults\"\n\n/**\n * Generate a scoped `variables.css` from a W3C DTCG tokens file.\n *\n * Reads the tokens file, resolves each configured context (with `$root` fallback\n * and reference resolution), and writes one CSS scope per context — the base\n * context in full, others as override-only blocks. Returns the generated CSS.\n *\n * The tokens file is always read from `design-tokens.json` at the project root\n * (resolved against `cwd`); the name and location are fixed and not configurable.\n *\n * @example\n * // zero-config: ./design-tokens.json → ./src/bezel/variables.css\n * await generateVariablesCss()\n *\n * @example\n * await generateVariablesCss({\n * variablesOutput: \"packages/ui/src/bezel/variables.css\",\n * })\n */\nexport async function generateVariablesCss(options: BezelOptions = {}): Promise<string> {\n const resolved = resolveOptions(options)\n\n let raw: string\n try {\n raw = await readFile(resolved.inputPath, \"utf8\")\n } catch (err) {\n throw new Error(\n `bezel: could not read tokens file at \"${resolved.inputPath}\". ` +\n `A \"design-tokens.json\" file must exist at the project root.\\n${(err as Error).message}`,\n )\n }\n\n let tokens: DtcgNode\n try {\n tokens = JSON.parse(raw) as DtcgNode\n } catch (err) {\n throw new Error(`bezel: \"${resolved.inputPath}\" is not valid JSON.\\n${(err as Error).message}`)\n }\n\n const css = emitCss(tokens, resolved)\n\n if (resolved.write) {\n await mkdir(dirname(resolved.variablesOutputPath), { recursive: true })\n await writeFile(resolved.variablesOutputPath, css, \"utf8\")\n\n if (resolved.contextsOutput) {\n const contextsModule = formatContextsModule(getContexts(tokens))\n await mkdir(dirname(resolved.contextsOutput), { recursive: true })\n await writeFile(resolved.contextsOutput, contextsModule, \"utf8\")\n }\n\n if (resolved.fontsOutput) {\n const fontsModule = formatFontsModule(getFonts(tokens))\n await mkdir(dirname(resolved.fontsOutput), { recursive: true })\n await writeFile(resolved.fontsOutput, fontsModule, \"utf8\")\n }\n\n if (resolved.gitignore) {\n await updateGitignore(resolved)\n }\n }\n\n return css\n}\n\n/**\n * Create or update the project `.gitignore` so the generated outputs are ignored.\n * Outputs are written as paths relative to the `.gitignore`, anchored with a leading\n * `/`. Outputs outside the `.gitignore`'s directory can't be anchored from it and are\n * skipped with a warning. The file is only rewritten when its contents actually change.\n */\nasync function updateGitignore(resolved: ResolvedOptions): Promise<void> {\n const dir = dirname(resolved.gitignorePath)\n const outputs = [\n resolved.variablesOutputPath,\n resolved.contextsOutput,\n resolved.fontsOutput,\n ].filter((p): p is string => p !== null)\n\n const entries: string[] = []\n for (const output of outputs) {\n const rel = relative(dir, output)\n if (rel === \"\" || rel.startsWith(\"..\")) {\n process.stderr.write(\n `bezel: skipping .gitignore entry for \"${output}\" — outside ${resolved.gitignorePath}\\n`,\n )\n continue\n }\n entries.push(`/${rel.split(sep).join(\"/\")}`)\n }\n\n if (entries.length === 0) return\n\n let existing = \"\"\n try {\n existing = await readFile(resolved.gitignorePath, \"utf8\")\n } catch {\n // No existing .gitignore — create one.\n }\n\n const next = mergeGitignore(existing, entries)\n if (next !== existing) {\n await mkdir(dir, { recursive: true })\n await writeFile(resolved.gitignorePath, next, \"utf8\")\n }\n}\n","import { isAbsolute, resolve } from \"node:path\"\nimport { DEFAULT_INPUT, DEFAULT_VARIABLES_OUTPUT } from \"./defaults\"\nimport { resolveCssOptions, type CssOptions } from \"./options\"\n\nexport {\n DEFAULT_CONFIG_FILE,\n DEFAULT_CONTEXTS,\n DEFAULT_INPUT,\n DEFAULT_OUTPUT_DIR,\n DEFAULT_VARIABLES_OUTPUT,\n DEFAULT_NAME_EXTENSION,\n FALLBACK_OUTPUT_DIR,\n} from \"./defaults\"\n\n/**\n * Options for {@link generateVariablesCss} — the Node, file-oriented surface.\n * Extends the pure {@link CssOptions} with input/output paths. All optional;\n * defaults make the zero-config case work.\n */\nexport interface BezelOptions extends CssOptions {\n /**\n * The Bezel project this repo is linked to (a UUID). Read only by the Bezel MCP to\n * know which project to pull `design-tokens.json` from — ignored by `build`.\n */\n projectId?: string\n /**\n * Which tokens the Bezel MCP fetches: `\"latest\"` (the project's latest snapshot) or a\n * published semver like `\"1.4.0\"`. Missing means `\"latest\"`. Ignored by `build`.\n */\n version?: string\n /** Path to write the generated CSS. Default: `\"src/bezel/variables.css\"` (resolved from `cwd`). */\n variablesOutput?: string\n /** Base directory paths are resolved against. Default: `process.cwd()`. */\n cwd?: string\n /**\n * When set, also write a generated TypeScript module exporting `CONTEXTS` (the list of\n * context names derived from the tokens). Path resolved against `cwd`. Default: none.\n */\n contextsOutput?: string\n /**\n * When set, also write a generated TypeScript module exporting `FONTS` (the web fonts\n * derived from the tokens). Path resolved against `cwd`. Default: none.\n */\n fontsOutput?: string\n /** When `false`, return the CSS string without touching the filesystem. Default: `true`. */\n write?: boolean\n /**\n * Create/update a project `.gitignore` so the generated outputs are ignored. The\n * entries live in a marked block, rewritten on each run so renamed outputs are\n * cleaned up. Default: `true`.\n */\n gitignore?: boolean\n /** Path to the `.gitignore` to manage. Default: `\".gitignore\"` (resolved from `cwd`). */\n gitignorePath?: string\n}\n\n/** Fully-resolved options (no `undefined`), produced by {@link resolveOptions}. */\nexport interface ResolvedOptions {\n inputPath: string\n variablesOutputPath: string\n contexts: Record<string, string>\n colorFormat: \"oklch\" | \"hex\"\n dimensionUnit: \"preserve\" | \"rem\"\n nameExtension: string\n includeAll: boolean\n contextsOutput: string | null\n fontsOutput: string | null\n write: boolean\n gitignore: boolean\n gitignorePath: string\n}\n\n/** Apply defaults and resolve input/output paths against `cwd`. */\nexport function resolveOptions(options: BezelOptions = {}): ResolvedOptions {\n const cwd = options.cwd ?? process.cwd()\n const toAbs = (p: string) => (isAbsolute(p) ? p : resolve(cwd, p))\n\n const css = resolveCssOptions(options)\n\n return {\n // The tokens file is always `design-tokens.json` at the project root — not configurable.\n inputPath: toAbs(DEFAULT_INPUT),\n variablesOutputPath: toAbs(options.variablesOutput ?? DEFAULT_VARIABLES_OUTPUT),\n ...css,\n contextsOutput: options.contextsOutput ? toAbs(options.contextsOutput) : null,\n fontsOutput: options.fontsOutput ? toAbs(options.fontsOutput) : null,\n write: options.write ?? true,\n gitignore: options.gitignore ?? true,\n gitignorePath: toAbs(options.gitignorePath ?? \".gitignore\"),\n }\n}\n","/**\n * bezel — managed-block merging for text files Bezel shares with the user.\n *\n * Pure string transforms (no `node:fs`): given a file's existing contents and the\n * lines Bezel wants to own, produce the new contents. Bezel's lines live between a\n * start and end marker so repeated runs rewrite just that span — stale lines drop out,\n * nothing duplicates, and everything the user wrote outside the markers is preserved.\n * `.gitignore` uses `#` comment markers; `AGENTS.md` uses HTML comment markers.\n */\n\nexport interface BlockMarkers {\n /** Opening marker line. */\n start: string\n /** Closing marker line. */\n end: string\n}\n\n/**\n * Merge a managed block into existing file contents.\n *\n * - Empty `existing` → just the block.\n * - An existing block (delimited by the markers) → replaced in place, preserving\n * everything before and after.\n * - No block → appended after the existing content, separated by a blank line.\n *\n * The result always ends with a single trailing newline.\n */\nexport function mergeManagedBlock(\n existing: string,\n lines: string[],\n markers: BlockMarkers,\n): string {\n const block = [markers.start, ...lines, markers.end].join(\"\\n\")\n\n if (existing.trim() === \"\") return `${block}\\n`\n\n const start = existing.indexOf(markers.start)\n if (start !== -1) {\n const endMarker = existing.indexOf(markers.end, start)\n if (endMarker !== -1) {\n const before = existing.slice(0, start).replace(/\\n+$/, \"\")\n const after = existing.slice(endMarker + markers.end.length).replace(/^\\n+/, \"\")\n const head = before === \"\" ? \"\" : `${before}\\n\\n`\n const tail = after === \"\" ? \"\" : `\\n\\n${after.replace(/\\n+$/, \"\")}`\n return `${head}${block}${tail}\\n`\n }\n }\n\n return `${existing.replace(/\\n+$/, \"\")}\\n\\n${block}\\n`\n}\n","/**\n * bezel — `.gitignore` managed-block merging.\n *\n * Given the existing `.gitignore` contents and the list of generated outputs to\n * ignore, produce the new contents. Bezel's entries live inside a marked block so\n * repeated runs rewrite just that span — renamed/removed outputs drop out\n * automatically and entries never duplicate, while the user's own rules outside the\n * markers are preserved. See {@link mergeManagedBlock} for the shared mechanics.\n */\nimport { mergeManagedBlock } from \"./managed-block\"\n\n/** Opening marker for the Bezel-managed block. */\nexport const START = \"# bezel:start (generated — do not edit)\"\n/** Closing marker for the Bezel-managed block. */\nexport const END = \"# bezel:end\"\n\n/**\n * Merge Bezel's managed block into existing `.gitignore` contents.\n *\n * - Empty `existing` → just the block.\n * - An existing block (delimited by {@link START}…{@link END}) → replaced in place,\n * preserving everything before and after.\n * - No block → appended after the existing content, separated by a blank line.\n *\n * The result always ends with a single trailing newline.\n */\nexport function mergeGitignore(existing: string, entries: string[]): string {\n return mergeManagedBlock(existing, entries, { start: START, end: END })\n}\n","/**\n * bezel — `bezel.json` scaffolding.\n *\n * Writes the config file `bezel build` auto-loads, so a project doesn't have to\n * hand-author it. Defaults are derived from the project itself: outputs land in\n * `src/bezel/` when there's a `src/` (otherwise `bezel/`), and the TypeScript\n * modules are only scaffolded for a TypeScript project — `contexts.ts`/`fonts.ts`\n * are emitted as TS (`as const`, `export type`) and would be dead weight in a\n * JavaScript one.\n *\n * Non-destructive: an existing `bezel.json` is never overwritten without `force`.\n * The one exception is the project link: passing `projectId` and/or `version` to an\n * existing config updates just those keys in place, leaving everything else as-is.\n */\nimport { existsSync } from \"node:fs\"\nimport { readFile, writeFile } from \"node:fs/promises\"\nimport { isAbsolute, resolve } from \"node:path\"\nimport type { BezelOptions } from \"./config\"\nimport {\n CONTEXTS_FILE,\n DEFAULT_CONFIG_FILE,\n DEFAULT_INPUT,\n DEFAULT_OUTPUT_DIR,\n FALLBACK_OUTPUT_DIR,\n FONTS_FILE,\n VARIABLES_FILE,\n} from \"./defaults\"\n\n/** Options for {@link initConfig}. All optional — the zero-arg call is the happy path. */\nexport interface InitOptions {\n /** Project root to scaffold into. Default: `process.cwd()`. */\n cwd?: string\n /**\n * Directory for all three outputs, relative to `cwd`. Default: `\"src/bezel\"` when\n * the project has a `src/`, otherwise `\"bezel\"`. Ignored for any output whose path\n * is set explicitly.\n */\n outputDir?: string\n /** Explicit path for the generated CSS. Overrides {@link InitOptions.outputDir}. */\n variablesOutput?: string\n /** Explicit path for the generated contexts module. Implies `contexts: true`. */\n contextsOutput?: string\n /** Explicit path for the generated fonts module. Implies `fonts: true`. */\n fontsOutput?: string\n /** Include `contextsOutput`. Default: true for a TypeScript project. */\n contexts?: boolean\n /** Include `fontsOutput`. Default: true for a TypeScript project. */\n fonts?: boolean\n /** Written to the config only when set — otherwise the build default applies. */\n colorFormat?: \"oklch\" | \"hex\"\n /** Written to the config only when set — otherwise the build default applies. */\n dimensionUnit?: \"preserve\" | \"rem\"\n /** Written to the config only when `true` — otherwise the build default (`false`) applies. */\n includeAll?: boolean\n /** Overwrite an existing `bezel.json`. Default: `false`. */\n force?: boolean\n /**\n * The Bezel project to link this repo to (a UUID). Written as `projectId`; on an\n * existing config it updates just that key without needing `force`.\n */\n projectId?: string\n /**\n * Tokens version the Bezel MCP fetches: `\"latest\"` or a semver like `\"1.4.0\"`.\n * Always written — defaults to `\"latest\"` on a fresh init; on an existing config it\n * updates just that key without needing `force`.\n */\n version?: string\n}\n\n/** Outcome of {@link initConfig}. */\nexport interface InitResult {\n /** Absolute path of the config file. */\n configPath: string\n /** The config that was written — or the one that would have been, when `written` is false. */\n config: BezelOptions\n /** False when an existing `bezel.json` was left untouched (no `force`). */\n written: boolean\n /** Whether a `design-tokens.json` is already present at the project root. */\n hasTokensFile: boolean\n /** Whether the project looks like TypeScript (drives the contexts/fonts defaults). */\n isTypeScript: boolean\n /** True when only `projectId`/`version` were merged into an existing `bezel.json`. */\n updated: boolean\n /** The `projectId` that was in the file before an update, if any. */\n previousProjectId?: string\n /** The `version` that was in the file before an update, if any. */\n previousVersion?: string\n}\n\n/** Whether `value` is a UUID — the shape of a Bezel project id. */\nexport const isUuid = (value: string): boolean =>\n /^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i.test(value)\n\n/** Whether `value` is a valid tokens version: `\"latest\"` or a semver like `1.4.0`. */\nexport const isTokensVersion = (value: string): boolean =>\n value === \"latest\" || /^\\d+\\.\\d+\\.\\d+(-[0-9A-Za-z.-]+)?$/.test(value)\n\n/**\n * Join config path segments with forward slashes.\n *\n * Config values are portable JSON, so they always use `/` — `node:path.join` would\n * emit backslashes on Windows and bake a platform into a committed file.\n */\nconst joinPath = (dir: string, file: string): string =>\n dir === \"\" ? file : `${dir.replace(/\\/+$/, \"\")}/${file}`\n\n/**\n * Create a `bezel.json` in the project root, inferring sensible defaults from the\n * project layout.\n *\n * @example\n * // src/bezel/{variables.css,contexts.ts,fonts.ts} for a TS project with a src/\n * await initConfig()\n *\n * @example\n * await initConfig({ outputDir: \"packages/ui/src/bezel\", fonts: false })\n */\nexport async function initConfig(options: InitOptions = {}): Promise<InitResult> {\n if (options.projectId !== undefined && !isUuid(options.projectId)) {\n throw new Error(`bezel: --project must be a UUID, got \"${options.projectId}\"`)\n }\n if (options.version !== undefined && !isTokensVersion(options.version)) {\n throw new Error(\n `bezel: --tokens-version must be \"latest\" or a semver like 1.4.0, got \"${options.version}\"`,\n )\n }\n\n const cwd = options.cwd ?? process.cwd()\n const toAbs = (p: string) => (isAbsolute(p) ? p : resolve(cwd, p))\n\n const configPath = toAbs(DEFAULT_CONFIG_FILE)\n const hasTokensFile = existsSync(toAbs(DEFAULT_INPUT))\n const isTypeScript = existsSync(toAbs(\"tsconfig.json\"))\n\n const hasSrc = existsSync(toAbs(\"src\"))\n const outputDir = options.outputDir ?? (hasSrc ? DEFAULT_OUTPUT_DIR : FALLBACK_OUTPUT_DIR)\n\n // An explicit path is itself an opt-in; otherwise TypeScript projects get the\n // generated modules and JavaScript ones don't.\n const wantsContexts = options.contextsOutput !== undefined || (options.contexts ?? isTypeScript)\n const wantsFonts = options.fontsOutput !== undefined || (options.fonts ?? isTypeScript)\n\n // Link keys come first so the file reads project → version → outputs.\n const config: BezelOptions = {}\n if (options.projectId !== undefined) config.projectId = options.projectId\n config.version = options.version ?? \"latest\"\n config.variablesOutput = options.variablesOutput ?? joinPath(outputDir, VARIABLES_FILE)\n if (wantsContexts) {\n config.contextsOutput = options.contextsOutput ?? joinPath(outputDir, CONTEXTS_FILE)\n }\n if (wantsFonts) {\n config.fontsOutput = options.fontsOutput ?? joinPath(outputDir, FONTS_FILE)\n }\n // Only persist the transform options that were asked for, so the file stays minimal\n // and keeps tracking the library defaults for everything else.\n if (options.colorFormat) config.colorFormat = options.colorFormat\n if (options.dimensionUnit) config.dimensionUnit = options.dimensionUnit\n if (options.includeAll) config.includeAll = true\n\n if (existsSync(configPath) && !options.force) {\n const wantsLinkUpdate = options.projectId !== undefined || options.version !== undefined\n if (!wantsLinkUpdate) {\n return { configPath, config, written: false, updated: false, hasTokensFile, isTypeScript }\n }\n\n // Link-only update: replace just the two link keys, keep every other key in place.\n const existing = JSON.parse(await readFile(configPath, \"utf8\")) as BezelOptions\n const { projectId: previousProjectId, version: previousVersion, ...rest } = existing\n const merged: BezelOptions = {}\n const projectId = options.projectId ?? previousProjectId\n if (projectId !== undefined) merged.projectId = projectId\n merged.version = options.version ?? previousVersion ?? \"latest\"\n Object.assign(merged, rest)\n\n await writeFile(configPath, `${JSON.stringify(merged, null, 2)}\\n`, \"utf8\")\n\n return {\n configPath,\n config: merged,\n written: true,\n updated: true,\n previousProjectId,\n previousVersion,\n hasTokensFile,\n isTypeScript,\n }\n }\n\n await writeFile(configPath, `${JSON.stringify(config, null, 2)}\\n`, \"utf8\")\n\n return { configPath, config, written: true, updated: false, hasTokensFile, isTypeScript }\n}\n\n/**\n * Read the `\"scripts\"` block of the project's `package.json`, if there is one.\n * Used only to tailor the post-init hint — a missing or unparsable file is not an error.\n */\nexport async function readPackageScripts(cwd: string): Promise<Record<string, string>> {\n try {\n const raw = await readFile(resolve(cwd, \"package.json\"), \"utf8\")\n const parsed = JSON.parse(raw) as { scripts?: Record<string, string> }\n return par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