import { join } from "path";
import { parseColorTokens } from "./tokens/color-parser.js";
import { parseSpacingTokens } from "./tokens/spacing-parser.js";
import { parseShadowTokens } from "./tokens/shadow-parser.js";
import { parseBorderTokens } from "./tokens/border-parser.js";
import { parseScreenTokens } from "./tokens/screen-parser.js";
import { parseTypographyTokens } from "./tokens/typography-parser.js";
import { parseGridTokens } from "./tokens/grid-parser.js";
export async function parseTokens(tokensPath, stylesPath) {
    const allTokens = [];
    // Determine styles path if not provided
    const effectiveStylesPath = stylesPath || join(tokensPath, "..", "styles");
    console.log("  Parsing color tokens...");
    const colorTokens = await parseColorTokens(tokensPath);
    allTokens.push(...colorTokens);
    console.log(`    ✓ ${colorTokens.length} color tokens`);
    console.log("  Parsing spacing tokens...");
    const spacingTokens = await parseSpacingTokens(effectiveStylesPath);
    allTokens.push(...spacingTokens);
    console.log(`    ✓ ${spacingTokens.length} spacing tokens`);
    console.log("  Parsing shadow tokens...");
    const shadowTokens = await parseShadowTokens(tokensPath);
    allTokens.push(...shadowTokens);
    console.log(`    ✓ ${shadowTokens.length} shadow tokens`);
    console.log("  Parsing border/radius tokens...");
    const borderTokens = await parseBorderTokens(tokensPath);
    allTokens.push(...borderTokens);
    console.log(`    ✓ ${borderTokens.length} border/radius tokens`);
    console.log("  Parsing screen tokens...");
    const screenTokens = await parseScreenTokens(tokensPath);
    allTokens.push(...screenTokens);
    console.log(`    ✓ ${screenTokens.length} screen tokens`);
    console.log("  Parsing typography tokens...");
    const typographyTokens = await parseTypographyTokens(tokensPath);
    allTokens.push(...typographyTokens);
    console.log(`    ✓ ${typographyTokens.length} typography tokens`);
    console.log("  Parsing grid tokens...");
    const gridTokens = await parseGridTokens(tokensPath);
    allTokens.push(...gridTokens);
    console.log(`    ✓ ${gridTokens.length} grid tokens`);
    return allTokens;
}
// Category mapping for token queries
export const TOKEN_CATEGORIES = {
    colors: ["color"],
    typography: ["typography"],
    spacing: ["spacing"],
    shadows: ["shadow"],
    borders: ["border", "radius"],
    screens: ["screen"],
    grid: ["grid"],
};
export function mapCategoryToDbCategories(category) {
    const mapping = TOKEN_CATEGORIES[category];
    return mapping ? [...mapping] : [category];
}
//# sourceMappingURL=tokens-parser.js.map