@aihu/css-engine 0.2.5 → 0.4.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 +27 -22
- package/crates/aihu-css-core/src/apply.rs +314 -0
- package/crates/aihu-css-core/src/bin/main.rs +8 -7
- package/crates/aihu-css-core/src/cache.rs +8 -5
- package/crates/aihu-css-core/src/emit.rs +195 -36
- package/crates/aihu-css-core/src/lib.rs +15 -2
- package/crates/aihu-css-core/src/palette.rs +301 -0
- package/crates/aihu-css-core/src/style_parser.rs +587 -0
- package/crates/aihu-css-core/src/theme.rs +14 -0
- package/crates/aihu-css-core/src/tokens.rs +1196 -29
- package/crates/aihu-css-core/src/variants.rs +251 -3
- package/crates/aihu-css-core/tests/apply.rs +203 -0
- package/crates/aihu-css-core/tests/apply_regression.rs +150 -0
- package/crates/aihu-css-core/tests/binary_error.rs +61 -0
- package/crates/aihu-css-core/tests/cache.rs +8 -8
- package/crates/aihu-css-core/tests/emit.rs +284 -17
- package/crates/aihu-css-core/tests/parity.rs +274 -0
- package/crates/aihu-css-core/tests/progressive_snapshot.rs +8 -8
- package/crates/aihu-css-core/tests/scoped_snapshot.rs +80 -8
- package/crates/aihu-css-core/tests/snapshots/apply__apply_inside_nested_rule.snap +11 -0
- package/crates/aihu-css-core/tests/snapshots/apply__arbitrary_value_utility_in_apply.snap +8 -0
- package/crates/aihu-css-core/tests/snapshots/apply__arbitrary_value_variant_in_apply.snap +10 -0
- package/crates/aihu-css-core/tests/snapshots/apply__base_utility_inlines_declarations.snap +9 -0
- package/crates/aihu-css-core/tests/snapshots/apply__dark_variant_cascade_in_apply.snap +10 -0
- package/crates/aihu-css-core/tests/snapshots/apply__data_attribute_variant.snap +10 -0
- package/crates/aihu-css-core/tests/snapshots/apply__multi_token_apply.snap +11 -0
- package/crates/aihu-css-core/tests/snapshots/apply__multiple_apply_directives_per_rule.snap +12 -0
- package/crates/aihu-css-core/tests/snapshots/apply__responsive_variant_wraps_media.snap +12 -0
- package/crates/aihu-css-core/tests/snapshots/apply__single_variant_lifts_to_nested_rule.snap +10 -0
- package/crates/aihu-css-core/tests/snapshots/progressive_snapshot__anchor_snapshot.snap +1 -0
- package/crates/aihu-css-core/tests/snapshots/progressive_snapshot__popover_snapshot.snap +1 -0
- package/crates/aihu-css-core/tests/snapshots/progressive_snapshot__text_balance_snapshot.snap +1 -0
- package/crates/aihu-css-core/tests/snapshots/progressive_snapshot__view_transition_snapshot.snap +1 -0
- package/crates/aihu-css-core/tests/snapshots/scoped_snapshot__scoped_animate_spin_hoists_keyframes.snap +25 -0
- package/crates/aihu-css-core/tests/snapshots/scoped_snapshot__scoped_divide_y_nested_rule.snap +24 -0
- package/crates/aihu-css-core/tests/snapshots/scoped_snapshot__scoped_output_for_sfc.snap +1 -0
- package/crates/aihu-css-core/tests/snapshots/scoped_snapshot__scoped_space_y_nested_rule.snap +24 -0
- package/crates/aihu-css-core/tests/snapshots/scoped_snapshot__scoped_transition_and_transform.snap +26 -0
- package/crates/aihu-css-core/tests/snapshots/scoped_snapshot__scoped_with_authored_style_block.snap +6 -2
- package/crates/aihu-css-core/tests/snapshots/scoped_snapshot__scoped_with_global_style_block.snap +5 -2
- package/crates/aihu-css-core/tests/snapshots/scoped_snapshot__standard_variants.snap +1 -0
- package/crates/aihu-css-core/tests/snapshots/scoped_snapshot__theme_default_vs_override.snap +2 -0
- package/crates/aihu-css-core/tests/snapshots/scoped_snapshot__wc_native_variants.snap +1 -0
- package/crates/aihu-css-core/tests/style_parser.rs +257 -0
- package/crates/aihu-css-core/tests/tokens.rs +526 -7
- package/dist/index.d.ts +0 -9
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +26 -18
- package/dist/index.js.map +1 -1
- package/dist/runtime/cn.js +13 -0
- package/dist/runtime/cn.js.map +1 -1
- package/package.json +6 -6
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":[],"sources":["../src/index.ts"],"sourcesContent":["import { execFileSync } from 'node:child_process'\nimport { accessSync, constants, existsSync, statSync } from 'node:fs'\nimport { createRequire } from 'node:module'\nimport { dirname, join, resolve } from 'node:path'\nimport { fileURLToPath } from 'node:url'\nimport { compileToAst } from '@aihu/compiler'\n\nexport {\n defineStylePack,\n type StylePack,\n type StylePackInput,\n type TokenMap,\n} from './define-style-pack.ts'\n\nconst __dirname = dirname(fileURLToPath(import.meta.url))\n\n// ---------------------------------------------------------------------------\n// Platform support matrix\n// ---------------------------------------------------------------------------\n//\n// Maps process.platform + process.arch to the per-platform npm package that\n// ships the prebuilt `aihu-css-compile` executable, plus the binary's filename\n// inside that package. Mirrors @aihu/server/src/native.ts detectPlatform() and\n// the package directory names under packages/css-engine/npm/<platform>/.\n//\n// Unlike @aihu/server (a napi `.node` addon loaded via require), the css engine\n// invokes `aihu-css-compile` as a CLI SUBPROCESS (execFileSync against the\n// executable on disk). So the platform package exposes a raw executable file,\n// and we resolve its absolute PATH — we never `require()` the binary itself.\n\ninterface PlatformDescriptor {\n readonly platformId: string\n readonly packageName: string\n /** Executable filename inside the platform package. */\n readonly binFile: string\n}\n\nfunction detectPlatform(): PlatformDescriptor | null {\n if (typeof process === 'undefined' || !process.platform || !process.arch) {\n return null\n }\n const key = `${process.platform}-${process.arch}`\n switch (key) {\n case 'darwin-arm64':\n return {\n platformId: 'darwin-arm64',\n packageName: '@aihu/css-engine-darwin-arm64',\n binFile: 'aihu-css-compile',\n }\n case 'darwin-x64':\n return {\n platformId: 'darwin-x64',\n packageName: '@aihu/css-engine-darwin-x64',\n binFile: 'aihu-css-compile',\n }\n case 'linux-x64':\n // We only ship glibc; musl users fall through to the dev/source path.\n return {\n platformId: 'linux-x64-gnu',\n packageName: '@aihu/css-engine-linux-x64-gnu',\n binFile: 'aihu-css-compile',\n }\n case 'win32-x64':\n return {\n platformId: 'win32-x64-msvc',\n packageName: '@aihu/css-engine-win32-x64-msvc',\n binFile: 'aihu-css-compile.exe',\n }\n default:\n return null\n }\n}\n\nlet _binPath: string | null = null\n\n/**\n * Whether `candidate` is a usable `aihu-css-compile` executable — NOT merely a\n * present file.\n *\n * The per-platform packages (`@aihu/css-engine-<platform>`) carry a placeholder\n * `aihu-css-compile` in source; the real prebuilt binary is only injected by\n * the release CI. Once those packages become resolvable in the workspace (e.g.\n * after a `bun.lock` refresh that pins them as optionalDependencies), a bare\n * `existsSync` would happily return the non-executable placeholder, which then\n * blows up with EACCES inside `spawnSync`/`execFileSync`. So we must verify the\n * candidate is actually runnable before accepting it.\n *\n * POSIX: require the execute bit (X_OK). A zero-byte/text placeholder without\n * +x fails here and we fall through to the dev `target/` fallback.\n *\n * Windows: there is no execute bit — `accessSync(_, X_OK)` is effectively\n * always true — so we additionally require a non-empty regular file, which\n * still rejects a zero-byte placeholder.\n */\nexport function isUsableExecutable(candidate: string): boolean {\n try {\n const st = statSync(candidate)\n if (!st.isFile() || st.size === 0) return false\n accessSync(candidate, constants.X_OK)\n return true\n } catch {\n return false\n }\n}\n\n/**\n * Resolve the absolute path to the `aihu-css-compile` executable.\n *\n * Resolution order:\n * 1. The per-platform optionalDependency package\n * (`@aihu/css-engine-<platform>`) shipped to npm consumers — resolved via\n * `createRequire(...).resolve('<pkg>/package.json')` so it works in both\n * ESM and CJS and respects the consumer's node_modules layout.\n * 2. Dev fallback: the monorepo workspace `target/release|debug/` — only\n * present in a dev clone with a Rust toolchain (`cargo build --release -p\n * aihu-css-core`). Kept so in-repo builds + tests work without publishing.\n *\n * If the current platform is SUPPORTED but neither path yields a binary, throws\n * a structured error pointing at the missing optionalDependency (mirrors\n * @aihu/server's failure-loud contract). If the platform is UNSUPPORTED, the\n * error lists the dev fallback so source builds still have a clear remedy.\n */\nfunction resolveBinary(): string {\n if (_binPath !== null) return _binPath\n\n const descriptor = detectPlatform()\n\n // 1. Per-platform optionalDependency package (the published-consumer path).\n //\n // Accept the candidate ONLY if it is a usable executable. A present-but-\n // non-executable placeholder (the in-source stub that becomes resolvable once\n // the per-platform packages are pinned in the lockfile) must NOT be returned —\n // doing so spawns a non-executable file and fails with EACCES. In that case we\n // deliberately fall THROUGH to the dev `target/` fallback below.\n if (descriptor) {\n const requireFn = createRequire(import.meta.url)\n try {\n const pkgJson = requireFn.resolve(`${descriptor.packageName}/package.json`)\n const candidate = join(dirname(pkgJson), descriptor.binFile)\n if (isUsableExecutable(candidate)) {\n _binPath = candidate\n return _binPath\n }\n } catch {\n // Package not installed (optionalDependency skipped for this platform, or\n // a partial install). Fall through to the dev/source path, then error.\n }\n }\n\n // 2. Dev fallback: monorepo workspace target/. Only exists in a dev clone.\n const ext = process.platform === 'win32' ? '.exe' : ''\n const devCandidates = [\n resolve(__dirname, '../../../target/release', `aihu-css-compile${ext}`),\n resolve(__dirname, '../../../target/debug', `aihu-css-compile${ext}`),\n ]\n for (const c of devCandidates) {\n if (existsSync(c)) {\n _binPath = c\n return _binPath\n }\n }\n\n throw buildMissingBinaryError(descriptor, devCandidates)\n}\n\nfunction buildMissingBinaryError(\n descriptor: PlatformDescriptor | null,\n devCandidates: string[],\n): Error {\n if (descriptor === null) {\n return new Error(\n `[@aihu/css-engine] No prebuilt aihu-css-compile binary for this platform.\\n\\n` +\n ` Platform: ${typeof process !== 'undefined' ? `${process.platform}-${process.arch}` : 'unknown'}\\n\\n` +\n ` @aihu/css-engine ships prebuilt binaries for darwin-arm64, darwin-x64,\\n` +\n ` linux-x64-gnu (glibc) and win32-x64-msvc. Your platform is not in that set.\\n\\n` +\n ` To build from source you need a Rust toolchain, then run from the repo root:\\n` +\n ` cargo build --release -p aihu-css-core\\n\\n` +\n ` Checked dev fallback paths: ${devCandidates.join(', ')}`,\n )\n }\n return new Error(\n `[@aihu/css-engine] Native CSS compiler binary not found for this platform.\\n\\n` +\n ` Platform: ${descriptor.platformId}\\n` +\n ` Expected package: ${descriptor.packageName}\\n` +\n ` Expected file: ${descriptor.packageName}/${descriptor.binFile}\\n\\n` +\n ` This binary is distributed as an optionalDependency of @aihu/css-engine.\\n` +\n ` Your package manager may have skipped it (optionalDependencies are\\n` +\n ` silently dropped on install failure).\\n\\n` +\n ` To reinstall:\\n` +\n ` npm install @aihu/css-engine\\n` +\n ` # or: pnpm install or: bun install\\n\\n` +\n ` If you are working in the aihu monorepo, build from source instead:\\n` +\n ` cargo build --release -p aihu-css-core\\n` +\n ` Checked dev fallback paths: ${devCandidates.join(', ')}`,\n )\n}\n\n/**\n * Compile a list of utility class names to CSS.\n *\n * Plan 1 bootstrap — supports a hardcoded subset; see crates/aihu-css-core/src/tokens.rs.\n * Plan 2 wires the AST scanner so callers pass `.aihu` SFC ASTs instead of raw class lists.\n *\n * @param classes - utility class names like `['bg-primary', 'p-4']`\n * @returns CSS string with one rule per known class\n */\nexport function compile(classes: string[]): string {\n if (classes.length === 0) return ''\n\n const bin = resolveBinary()\n const input = classes.join('\\n')\n const result = execFileSync(bin, [], {\n input,\n encoding: 'utf-8',\n stdio: ['pipe', 'pipe', 'inherit'],\n })\n return result\n}\n\n/**\n * Compile a `.aihu` SFC source string to scoped, shadow-DOM-embedded CSS.\n *\n * Pipeline (Plan 2 Task 9): `compileToAst(source)` (from `@aihu/compiler`)\n * → AST JSON → `aihu-css-compile --ast-json` → scoped CSS. The output is the\n * per-SFC stylesheet the compiler folds into the component's shadow `<style>`:\n * `:host`-level theme tokens, variant-resolved utility rules, and the folded\n * authored `@style` block. There is NO global utility stylesheet.\n *\n * @param source - the `.aihu` SFC source text\n * @param id - optional file path/id (used to derive the tag stem + `@route` checks)\n * @returns the scoped CSS string for the SFC\n */\nexport function compileSfc(source: string, id?: string): string {\n const ast = compileToAst(source, id)\n const bin = resolveBinary()\n return execFileSync(bin, ['--ast-json'], {\n input: JSON.stringify(ast),\n encoding: 'utf-8',\n stdio: ['pipe', 'pipe', 'inherit'],\n })\n}\n"],"mappings":";;;;;;;;AAcA,MAAM,YAAY,QAAQ,cAAc,OAAO,KAAK,IAAI,CAAC;AAuBzD,SAAS,iBAA4C;CACnD,IAAI,OAAO,YAAY,eAAe,C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,MACjB,uBAAO,IAAI,MACT,mGACwB,OAAO,YAAY,cAAc,GAAG,QAAQ,SAAS,GAAG,QAAQ,SAAS,UAAU,6TAKxE,cAAc,KAAK,KAAK,GAC5D;CAEH,uBAAO,IAAI,MACT,qGACyB,WAAW,WAAW,wBACtB,WAAW,YAAY,wBACvB,WAAW,YAAY,GAAG,WAAW,QAAQ,mbASnC,cAAc,KAAK,KAAK,GAC5D;;;;;;;;;;;AAYH,SAAgB,QAAQ,SAA2B;CACjD,IAAI,QAAQ,WAAW,GAAG,OAAO;CASjC,OALe,aAFH,eAEmB,EAAE,EAAE,EAAE;EACnC,OAFY,QAAQ,KAAK,KAEpB;EACL,UAAU;EACV,OAAO;GAAC;GAAQ;GAAQ;GAAU;EACnC,CACY;;;;;;;;;;;;;;;AAgBf,SAAgB,WAAW,QAAgB,IAAqB;CAC9D,MAAM,MAAM,aAAa,QAAQ,GAAG;CAEpC,OAAO,aADK,eACW,EAAE,CAAC,aAAa,EAAE;EACvC,OAAO,KAAK,UAAU,IAAI;EAC1B,UAAU;EACV,OAAO;GAAC;GAAQ;GAAQ;GAAU;EACnC,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.js","names":[],"sources":["../src/index.ts"],"sourcesContent":["import { execFileSync } from 'node:child_process'\nimport { accessSync, constants, existsSync, statSync } from 'node:fs'\nimport { createRequire } from 'node:module'\nimport { dirname, join, resolve } from 'node:path'\nimport { fileURLToPath } from 'node:url'\nimport { compileToAst } from '@aihu/compiler'\n\nexport {\n defineStylePack,\n type StylePack,\n type StylePackInput,\n type TokenMap,\n} from './define-style-pack.ts'\n\nconst __dirname = dirname(fileURLToPath(import.meta.url))\n\n// ---------------------------------------------------------------------------\n// Platform support matrix\n// ---------------------------------------------------------------------------\n//\n// Maps process.platform + process.arch to the per-platform npm package that\n// ships the prebuilt `aihu-css-compile` executable, plus the binary's filename\n// inside that package. Mirrors @aihu/server/src/native.ts detectPlatform() and\n// the package directory names under packages/css-engine/npm/<platform>/.\n//\n// Unlike @aihu/server (a napi `.node` addon loaded via require), the css engine\n// invokes `aihu-css-compile` as a CLI SUBPROCESS (execFileSync against the\n// executable on disk). So the platform package exposes a raw executable file,\n// and we resolve its absolute PATH — we never `require()` the binary itself.\n\ninterface PlatformDescriptor {\n readonly platformId: string\n readonly packageName: string\n /** Executable filename inside the platform package. */\n readonly binFile: string\n}\n\nfunction detectPlatform(): PlatformDescriptor | null {\n if (typeof process === 'undefined' || !process.platform || !process.arch) {\n return null\n }\n const key = `${process.platform}-${process.arch}`\n switch (key) {\n case 'darwin-arm64':\n return {\n platformId: 'darwin-arm64',\n packageName: '@aihu/css-engine-darwin-arm64',\n binFile: 'aihu-css-compile',\n }\n case 'darwin-x64':\n return {\n platformId: 'darwin-x64',\n packageName: '@aihu/css-engine-darwin-x64',\n binFile: 'aihu-css-compile',\n }\n case 'linux-x64':\n // We only ship glibc; musl users fall through to the dev/source path.\n return {\n platformId: 'linux-x64-gnu',\n packageName: '@aihu/css-engine-linux-x64-gnu',\n binFile: 'aihu-css-compile',\n }\n case 'win32-x64':\n return {\n platformId: 'win32-x64-msvc',\n packageName: '@aihu/css-engine-win32-x64-msvc',\n binFile: 'aihu-css-compile.exe',\n }\n default:\n return null\n }\n}\n\nlet _binPath: string | null = null\n\n/**\n * Whether `candidate` is a usable `aihu-css-compile` executable — NOT merely a\n * present file.\n *\n * The per-platform packages (`@aihu/css-engine-<platform>`) carry a placeholder\n * `aihu-css-compile` in source; the real prebuilt binary is only injected by\n * the release CI. Once those packages become resolvable in the workspace (e.g.\n * after a `bun.lock` refresh that pins them as optionalDependencies), a bare\n * `existsSync` would happily return the non-executable placeholder, which then\n * blows up with EACCES inside `spawnSync`/`execFileSync`. So we must verify the\n * candidate is actually runnable before accepting it.\n *\n * POSIX: require the execute bit (X_OK). A zero-byte/text placeholder without\n * +x fails here and we fall through to the dev `target/` fallback.\n *\n * Windows: there is no execute bit — `accessSync(_, X_OK)` is effectively\n * always true — so we additionally require a non-empty regular file, which\n * still rejects a zero-byte placeholder.\n */\nexport function isUsableExecutable(candidate: string): boolean {\n try {\n const st = statSync(candidate)\n if (!st.isFile() || st.size === 0) return false\n accessSync(candidate, constants.X_OK)\n return true\n } catch {\n return false\n }\n}\n\n/**\n * Resolve the absolute path to the `aihu-css-compile` executable.\n *\n * Resolution order:\n * 1. The per-platform optionalDependency package\n * (`@aihu/css-engine-<platform>`) shipped to npm consumers — resolved via\n * `createRequire(...).resolve('<pkg>/package.json')` so it works in both\n * ESM and CJS and respects the consumer's node_modules layout.\n * 2. Dev fallback: the monorepo workspace `target/release|debug/` — only\n * present in a dev clone with a Rust toolchain (`cargo build --release -p\n * aihu-css-core`). Kept so in-repo builds + tests work without publishing.\n *\n * If the current platform is SUPPORTED but neither path yields a binary, throws\n * a structured error pointing at the missing optionalDependency (mirrors\n * @aihu/server's failure-loud contract). If the platform is UNSUPPORTED, the\n * error lists the dev fallback so source builds still have a clear remedy.\n */\nfunction resolveBinary(): string {\n if (_binPath !== null) return _binPath\n\n const descriptor = detectPlatform()\n\n // 1. Per-platform optionalDependency package (the published-consumer path).\n //\n // Accept the candidate ONLY if it is a usable executable. A present-but-\n // non-executable placeholder (the in-source stub that becomes resolvable once\n // the per-platform packages are pinned in the lockfile) must NOT be returned —\n // doing so spawns a non-executable file and fails with EACCES. In that case we\n // deliberately fall THROUGH to the dev `target/` fallback below.\n if (descriptor) {\n const requireFn = createRequire(import.meta.url)\n try {\n const pkgJson = requireFn.resolve(`${descriptor.packageName}/package.json`)\n const candidate = join(dirname(pkgJson), descriptor.binFile)\n if (isUsableExecutable(candidate)) {\n _binPath = candidate\n return _binPath\n }\n } catch {\n // Package not installed (optionalDependency skipped for this platform, or\n // a partial install). Fall through to the dev/source path, then error.\n }\n }\n\n // 2. Dev fallback: monorepo workspace target/. Only exists in a dev clone.\n const ext = process.platform === 'win32' ? '.exe' : ''\n const devCandidates = [\n resolve(__dirname, '../../../target/release', `aihu-css-compile${ext}`),\n resolve(__dirname, '../../../target/debug', `aihu-css-compile${ext}`),\n ]\n for (const c of devCandidates) {\n if (existsSync(c)) {\n _binPath = c\n return _binPath\n }\n }\n\n throw buildMissingBinaryError(descriptor, devCandidates)\n}\n\nfunction buildMissingBinaryError(\n descriptor: PlatformDescriptor | null,\n devCandidates: string[],\n): Error {\n if (descriptor === null) {\n return new Error(\n `[@aihu/css-engine] No prebuilt aihu-css-compile binary for this platform.\\n\\n` +\n ` Platform: ${typeof process !== 'undefined' ? `${process.platform}-${process.arch}` : 'unknown'}\\n\\n` +\n ` @aihu/css-engine ships prebuilt binaries for darwin-arm64, darwin-x64,\\n` +\n ` linux-x64-gnu (glibc) and win32-x64-msvc. Your platform is not in that set.\\n\\n` +\n ` To build from source you need a Rust toolchain, then run from the repo root:\\n` +\n ` cargo build --release -p aihu-css-core\\n\\n` +\n ` Checked dev fallback paths: ${devCandidates.join(', ')}`,\n )\n }\n return new Error(\n `[@aihu/css-engine] Native CSS compiler binary not found for this platform.\\n\\n` +\n ` Platform: ${descriptor.platformId}\\n` +\n ` Expected package: ${descriptor.packageName}\\n` +\n ` Expected file: ${descriptor.packageName}/${descriptor.binFile}\\n\\n` +\n ` This binary is distributed as an optionalDependency of @aihu/css-engine.\\n` +\n ` Your package manager may have skipped it (optionalDependencies are\\n` +\n ` silently dropped on install failure).\\n\\n` +\n ` To reinstall:\\n` +\n ` npm install @aihu/css-engine\\n` +\n ` # or: pnpm install or: bun install\\n\\n` +\n ` If you are working in the aihu monorepo, build from source instead:\\n` +\n ` cargo build --release -p aihu-css-core\\n` +\n ` Checked dev fallback paths: ${devCandidates.join(', ')}`,\n )\n}\n\n/**\n * Compile a list of utility class names to CSS.\n *\n * Plan 1 bootstrap — supports a hardcoded subset; see crates/aihu-css-core/src/tokens.rs.\n * Plan 2 wires the AST scanner so callers pass `.aihu` SFC ASTs instead of raw class lists.\n *\n * @param classes - utility class names like `['bg-primary', 'p-4']`\n * @returns CSS string with one rule per known class\n */\n/**\n * Spawn the native compiler, returning stdout on success. On a non-zero exit\n * (the binary's R-RESULT error path) throw an `Error` carrying the binary's\n * stderr message rather than letting `execFileSync`'s opaque status error\n * surface. stderr is PIPED (not inherited) so the message lands in the thrown\n * error instead of the parent's console.\n */\nfunction runBinary(bin: string, args: string[], input: string): string {\n try {\n return execFileSync(bin, args, {\n input,\n encoding: 'utf-8',\n stdio: ['pipe', 'pipe', 'pipe'],\n })\n } catch (err) {\n const e = err as { stderr?: Buffer | string; message?: string }\n const stderr =\n typeof e.stderr === 'string'\n ? e.stderr\n : e.stderr instanceof Buffer\n ? e.stderr.toString('utf-8')\n : ''\n const detail = stderr.trim() || e.message || 'unknown error'\n throw new Error(`[@aihu/css-engine] CSS compile failed: ${detail}`)\n }\n}\n\nexport function compile(classes: string[]): string {\n if (classes.length === 0) return ''\n\n const bin = resolveBinary()\n const input = classes.join('\\n')\n return runBinary(bin, [], input)\n}\n\n/**\n * Compile a `.aihu` SFC source string to scoped, shadow-DOM-embedded CSS.\n *\n * Pipeline (Plan 2 Task 9): `compileToAst(source)` (from `@aihu/compiler`)\n * → AST JSON → `aihu-css-compile --ast-json` → scoped CSS. The output is the\n * per-SFC stylesheet the compiler folds into the component's shadow `<style>`:\n * `:host`-level theme tokens, variant-resolved utility rules, and the folded\n * authored `@style` block. There is NO global utility stylesheet.\n *\n * @param source - the `.aihu` SFC source text\n * @param id - optional file path/id (used to derive the tag stem + `@route` checks)\n * @returns the scoped CSS string for the SFC\n */\nexport function compileSfc(source: string, id?: string): string {\n const ast = compileToAst(source, id)\n const bin = resolveBinary()\n return runBinary(bin, ['--ast-json'], JSON.stringify(ast))\n}\n"],"mappings":";;;;;;;;AAcA,MAAM,YAAY,QAAQ,cAAc,OAAO,KAAK,IAAI,CAAC;AAuBzD,SAAS,iBAA4C;CACnD,IAAI,OAAO,YAAY,eAAe,CAAC,QAAQ,YAAY,CAAC,QAAQ,MAClE,OAAO;CAGT,QAAQ,GADO,QAAQ,SAAS,GAAG,QAAQ,QAC3C;EACE,KAAK,gBACH,OAA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KAAK,GAC5D;CAEH,uBAAO,IAAI,MACT,qGACyB,WAAW,WAAW,wBACtB,WAAW,YAAY,wBACvB,WAAW,YAAY,GAAG,WAAW,QAAQ,mbASnC,cAAc,KAAK,KAAK,GAC5D;;;;;;;;;;;;;;;;;;AAmBH,SAAS,UAAU,KAAa,MAAgB,OAAuB;CACrE,IAAI;EACF,OAAO,aAAa,KAAK,MAAM;GAC7B;GACA,UAAU;GACV,OAAO;IAAC;IAAQ;IAAQ;IAAO;GAChC,CAAC;UACK,KAAK;EACZ,MAAM,IAAI;EAOV,MAAM,UALJ,OAAO,EAAE,WAAW,WAChB,EAAE,SACF,EAAE,kBAAkB,SAClB,EAAE,OAAO,SAAS,QAAQ,GAC1B,IACc,MAAM,IAAI,EAAE,WAAW;EAC7C,MAAM,IAAI,MAAM,0CAA0C,SAAS;;;AAIvE,SAAgB,QAAQ,SAA2B;CACjD,IAAI,QAAQ,WAAW,GAAG,OAAO;CAIjC,OAAO,UAFK,eAEQ,EAAE,EAAE,EADV,QAAQ,KAAK,KACI,CAAC;;;;;;;;;;;;;;;AAgBlC,SAAgB,WAAW,QAAgB,IAAqB;CAC9D,MAAM,MAAM,aAAa,QAAQ,GAAG;CAEpC,OAAO,UADK,eACQ,EAAE,CAAC,aAAa,EAAE,KAAK,UAAU,IAAI,CAAC"}
|
package/dist/runtime/cn.js
CHANGED
|
@@ -1,18 +1,31 @@
|
|
|
1
1
|
//#region src/runtime/cn-conflict-map.generated.ts
|
|
2
2
|
/** Prefix → conflict-group key, sorted longest-prefix-first. */
|
|
3
3
|
const CONFLICT_GROUPS = {
|
|
4
|
+
"translate-x": "translate",
|
|
5
|
+
"translate-y": "translate",
|
|
6
|
+
"grid-cols": "grid-template-columns",
|
|
7
|
+
"grid-rows": "grid-template-rows",
|
|
8
|
+
"col-span": "grid-column",
|
|
9
|
+
"row-span": "grid-row",
|
|
10
|
+
duration: "transition-duration",
|
|
11
|
+
"space-x": "space-x",
|
|
12
|
+
"space-y": "space-y",
|
|
4
13
|
outline: "outline-color",
|
|
5
14
|
opacity: "opacity",
|
|
6
15
|
rounded: "border-radius",
|
|
16
|
+
"scale-x": "scale",
|
|
17
|
+
"scale-y": "scale",
|
|
7
18
|
border: "border-color",
|
|
8
19
|
stroke: "stroke",
|
|
9
20
|
shadow: "box-shadow",
|
|
21
|
+
rotate: "rotate",
|
|
10
22
|
"gap-x": "column-gap",
|
|
11
23
|
"gap-y": "row-gap",
|
|
12
24
|
"min-w": "min-width",
|
|
13
25
|
"max-w": "max-width",
|
|
14
26
|
"min-h": "min-height",
|
|
15
27
|
"max-h": "max-height",
|
|
28
|
+
scale: "scale",
|
|
16
29
|
text: "color",
|
|
17
30
|
fill: "fill",
|
|
18
31
|
ring: "--tw-ring-color",
|
package/dist/runtime/cn.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cn.js","names":[],"sources":["../../src/runtime/cn-conflict-map.generated.ts","../../src/runtime/cn.ts"],"sourcesContent":["// AUTO-GENERATED by scripts/gen-cn-conflict-map.ts — DO NOT EDIT.\n// Source of truth: aihu-css-core `tokens::conflict_groups()` (the utility\n// registry). Regenerate with `bun run gen:cn-map`. Hand-edits will be lost.\n//\n// Maps a utility class PREFIX to the CSS property group it controls. Two\n// classes conflict (last wins) when they resolve to the same group.\n\n/** Prefix → conflict-group key, sorted longest-prefix-first. */\nexport const CONFLICT_GROUPS: Record<string, string> = {\n outline: 'outline-color',\n opacity: 'opacity',\n rounded: 'border-radius',\n border: 'border-color',\n stroke: 'stroke',\n shadow: 'box-shadow',\n 'gap-x': 'column-gap',\n 'gap-y': 'row-gap',\n 'min-w': 'min-width',\n 'max-w': 'max-width',\n 'min-h': 'min-height',\n 'max-h': 'max-height',\n text: 'color',\n fill: 'fill',\n ring: '--tw-ring-color',\n font: 'font-weight',\n gap: 'gap',\n px: 'padding-inline',\n py: 'padding-block',\n pt: 'padding-top',\n pr: 'padding-right',\n pb: 'padding-bottom',\n pl: 'padding-left',\n mx: 'margin-inline',\n my: 'margin-block',\n mt: 'margin-top',\n mr: 'margin-right',\n mb: 'margin-bottom',\n ml: 'margin-left',\n bg: 'background-color',\n p: 'padding',\n m: 'margin',\n w: 'width',\n h: 'height',\n z: 'z-index',\n}\n","/**\n * `@aihu/css-engine/runtime/cn` — the class-merge runtime helper (Plan 3 Task 9).\n *\n * `cn(...inputs)` merges class strings / arrays / conditionals into a single\n * deduplicated class string, resolving Tailwind-style conflicts last-wins per\n * property group (`cn('p-2', 'p-4')` → `'p-4'`).\n *\n * The conflict map (`CONFLICT_GROUPS`) is GENERATED at engine build time from\n * the utility registry (`scripts/gen-cn-conflict-map.ts` → Rust\n * `tokens::conflict_groups()`), NOT hand-maintained — so it never drifts from\n * the utility table. Separate < 1 KB gz sub-export from `runtime/progressive`\n * (Risk #4 size-split).\n *\n * This is the runtime-merge helper for consumer-provided overrides (spec §9.3):\n * recipes use static utility strings at compile time; `cn()` is only for the\n * runtime override case.\n */\nimport { CONFLICT_GROUPS } from './cn-conflict-map.generated.ts'\n\n/** A class value: string, falsy (dropped), or a nested array of the same. */\nexport type ClassValue = string | number | null | undefined | false | ClassValue[]\n\n/** Flatten the (possibly nested / conditional) inputs into a token list. */\nfunction tokens(inputs: ClassValue[], out: string[]): void {\n for (const input of inputs) {\n if (!input) continue\n if (Array.isArray(input)) {\n tokens(input, out)\n } else {\n for (const t of String(input).split(' ')) {\n if (t) out.push(t)\n }\n }\n }\n}\n\n/**\n * The conflict-group key for a class, or the class itself when it belongs to no\n * known group (so unrelated classes always coexist). Strips variant prefixes\n * (`md:`, `hover:`, …) so `hover:p-2` and `hover:p-4` still conflict, while\n * `p-2` and `hover:p-4` do not (different variant scope).\n */\nfunction groupKey(cls: string): string {\n const colon = cls.lastIndexOf(':')\n const variant = colon === -1 ? '' : cls.slice(0, colon + 1)\n const base = colon === -1 ? cls : cls.slice(colon + 1)\n const dash = base.indexOf('-')\n // The prefix is the segment before the first dash (`bg-red-500` → `bg`); for\n // dashless bases (`flex`) there is no group, so the class keys to itself.\n const prefix = dash === -1 ? base : base.slice(0, dash)\n const group = CONFLICT_GROUPS[prefix]\n return group ? `${variant}${group}` : cls\n}\n\n/**\n * Merge class values, resolving last-wins conflicts per property group.\n *\n * @example cn('p-2', 'p-4') // 'p-4'\n * @example cn('a', false && 'b', ['c']) // 'a c'\n * @example cn('bg-red-500', 'bg-blue-500') // 'bg-blue-500'\n */\nexport function cn(...inputs: ClassValue[]): string {\n const flat: string[] = []\n tokens(inputs, flat)\n\n // Last occurrence per group key wins; preserve final order by re-scanning.\n const winner = new Map<string, string>()\n for (const t of flat) winner.set(groupKey(t), t)\n\n const seen = new Set<string>()\n const result: string[] = []\n for (const t of flat) {\n const key = groupKey(t)\n if (winner.get(key) === t && !seen.has(t)) {\n seen.add(t)\n result.push(t)\n }\n }\n return result.join(' ')\n}\n"],"mappings":";;AAQA,MAAa,kBAA0C;CACrD,SAAS;CACT,SAAS;CACT,SAAS;CACT,QAAQ;CACR,QAAQ;CACR,QAAQ;CACR,SAAS;CACT,SAAS;CACT,SAAS;CACT,SAAS;CACT,SAAS;CACT,SAAS;CACT,MAAM;CACN,MAAM;CACN,MAAM;CACN,MAAM;CACN,KAAK;CACL,IAAI;CACJ,IAAI;CACJ,IAAI;CACJ,IAAI;CACJ,IAAI;CACJ,IAAI;CACJ,IAAI;CACJ,IAAI;CACJ,IAAI;CACJ,IAAI;CACJ,IAAI;CACJ,IAAI;CACJ,IAAI;CACJ,GAAG;CACH,GAAG;CACH,GAAG;CACH,GAAG;CACH,GAAG;CACJ;;;;;;;;;;;;;;;;;;;;;
|
|
1
|
+
{"version":3,"file":"cn.js","names":[],"sources":["../../src/runtime/cn-conflict-map.generated.ts","../../src/runtime/cn.ts"],"sourcesContent":["// AUTO-GENERATED by scripts/gen-cn-conflict-map.ts — DO NOT EDIT.\n// Source of truth: aihu-css-core `tokens::conflict_groups()` (the utility\n// registry). Regenerate with `bun run gen:cn-map`. Hand-edits will be lost.\n//\n// Maps a utility class PREFIX to the CSS property group it controls. Two\n// classes conflict (last wins) when they resolve to the same group.\n\n/** Prefix → conflict-group key, sorted longest-prefix-first. */\nexport const CONFLICT_GROUPS: Record<string, string> = {\n 'translate-x': 'translate',\n 'translate-y': 'translate',\n 'grid-cols': 'grid-template-columns',\n 'grid-rows': 'grid-template-rows',\n 'col-span': 'grid-column',\n 'row-span': 'grid-row',\n duration: 'transition-duration',\n 'space-x': 'space-x',\n 'space-y': 'space-y',\n outline: 'outline-color',\n opacity: 'opacity',\n rounded: 'border-radius',\n 'scale-x': 'scale',\n 'scale-y': 'scale',\n border: 'border-color',\n stroke: 'stroke',\n shadow: 'box-shadow',\n rotate: 'rotate',\n 'gap-x': 'column-gap',\n 'gap-y': 'row-gap',\n 'min-w': 'min-width',\n 'max-w': 'max-width',\n 'min-h': 'min-height',\n 'max-h': 'max-height',\n scale: 'scale',\n text: 'color',\n fill: 'fill',\n ring: '--tw-ring-color',\n font: 'font-weight',\n gap: 'gap',\n px: 'padding-inline',\n py: 'padding-block',\n pt: 'padding-top',\n pr: 'padding-right',\n pb: 'padding-bottom',\n pl: 'padding-left',\n mx: 'margin-inline',\n my: 'margin-block',\n mt: 'margin-top',\n mr: 'margin-right',\n mb: 'margin-bottom',\n ml: 'margin-left',\n bg: 'background-color',\n p: 'padding',\n m: 'margin',\n w: 'width',\n h: 'height',\n z: 'z-index',\n}\n","/**\n * `@aihu/css-engine/runtime/cn` — the class-merge runtime helper (Plan 3 Task 9).\n *\n * `cn(...inputs)` merges class strings / arrays / conditionals into a single\n * deduplicated class string, resolving Tailwind-style conflicts last-wins per\n * property group (`cn('p-2', 'p-4')` → `'p-4'`).\n *\n * The conflict map (`CONFLICT_GROUPS`) is GENERATED at engine build time from\n * the utility registry (`scripts/gen-cn-conflict-map.ts` → Rust\n * `tokens::conflict_groups()`), NOT hand-maintained — so it never drifts from\n * the utility table. Separate < 1 KB gz sub-export from `runtime/progressive`\n * (Risk #4 size-split).\n *\n * This is the runtime-merge helper for consumer-provided overrides (spec §9.3):\n * recipes use static utility strings at compile time; `cn()` is only for the\n * runtime override case.\n */\nimport { CONFLICT_GROUPS } from './cn-conflict-map.generated.ts'\n\n/** A class value: string, falsy (dropped), or a nested array of the same. */\nexport type ClassValue = string | number | null | undefined | false | ClassValue[]\n\n/** Flatten the (possibly nested / conditional) inputs into a token list. */\nfunction tokens(inputs: ClassValue[], out: string[]): void {\n for (const input of inputs) {\n if (!input) continue\n if (Array.isArray(input)) {\n tokens(input, out)\n } else {\n for (const t of String(input).split(' ')) {\n if (t) out.push(t)\n }\n }\n }\n}\n\n/**\n * The conflict-group key for a class, or the class itself when it belongs to no\n * known group (so unrelated classes always coexist). Strips variant prefixes\n * (`md:`, `hover:`, …) so `hover:p-2` and `hover:p-4` still conflict, while\n * `p-2` and `hover:p-4` do not (different variant scope).\n */\nfunction groupKey(cls: string): string {\n const colon = cls.lastIndexOf(':')\n const variant = colon === -1 ? '' : cls.slice(0, colon + 1)\n const base = colon === -1 ? cls : cls.slice(colon + 1)\n const dash = base.indexOf('-')\n // The prefix is the segment before the first dash (`bg-red-500` → `bg`); for\n // dashless bases (`flex`) there is no group, so the class keys to itself.\n const prefix = dash === -1 ? base : base.slice(0, dash)\n const group = CONFLICT_GROUPS[prefix]\n return group ? `${variant}${group}` : cls\n}\n\n/**\n * Merge class values, resolving last-wins conflicts per property group.\n *\n * @example cn('p-2', 'p-4') // 'p-4'\n * @example cn('a', false && 'b', ['c']) // 'a c'\n * @example cn('bg-red-500', 'bg-blue-500') // 'bg-blue-500'\n */\nexport function cn(...inputs: ClassValue[]): string {\n const flat: string[] = []\n tokens(inputs, flat)\n\n // Last occurrence per group key wins; preserve final order by re-scanning.\n const winner = new Map<string, string>()\n for (const t of flat) winner.set(groupKey(t), t)\n\n const seen = new Set<string>()\n const result: string[] = []\n for (const t of flat) {\n const key = groupKey(t)\n if (winner.get(key) === t && !seen.has(t)) {\n seen.add(t)\n result.push(t)\n }\n }\n return result.join(' ')\n}\n"],"mapp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AAM,OAAiB,EAAE;CACzB,OAAO,QAAQ,KAAK;CAGpB,MAAM,yBAAS,IAAI,KAAqB;CACxC,KAAK,MAAM,KAAK,MAAM,OAAO,IAAI,SAAS,EAAE,EAAE,EAAE;CAEhD,MAAM,uBAAO,IAAI,KAAa;CAC9B,MAAM,SAAmB,EAAE;CAC3B,KAAK,MAAM,KAAK,MAAM;EACpB,MAAM,MAAM,SAAS,EAAE;EACvB,IAAI,OAAO,IAAI,IAAI,KAAK,KAAK,CAAC,KAAK,IAAI,EAAE,EAAE;GACzC,KAAK,IAAI,EAAE;GACX,OAAO,KAAK,EAAE;;;CAGlB,OAAO,OAAO,KAAK,IAAI"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@aihu/css-engine",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.4.0",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/index.js",
|
|
@@ -37,13 +37,13 @@
|
|
|
37
37
|
],
|
|
38
38
|
"sideEffects": false,
|
|
39
39
|
"dependencies": {
|
|
40
|
-
"@aihu/compiler": "^0.
|
|
40
|
+
"@aihu/compiler": "^0.6.0"
|
|
41
41
|
},
|
|
42
42
|
"optionalDependencies": {
|
|
43
|
-
"@aihu/css-engine-darwin-arm64": "0.1.
|
|
44
|
-
"@aihu/css-engine-darwin-x64": "0.1.
|
|
45
|
-
"@aihu/css-engine-linux-x64-gnu": "0.1.
|
|
46
|
-
"@aihu/css-engine-win32-x64-msvc": "0.1.
|
|
43
|
+
"@aihu/css-engine-darwin-arm64": "0.1.3",
|
|
44
|
+
"@aihu/css-engine-darwin-x64": "0.1.3",
|
|
45
|
+
"@aihu/css-engine-linux-x64-gnu": "0.1.3",
|
|
46
|
+
"@aihu/css-engine-win32-x64-msvc": "0.1.3"
|
|
47
47
|
},
|
|
48
48
|
"scripts": {
|
|
49
49
|
"build": "bun run gen:style-packs && rolldown -c",
|