tailwind-styled-v4 5.1.7 → 5.1.9

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.
Files changed (119) hide show
  1. package/dist/analyzer.js +1 -1
  2. package/dist/analyzer.js.map +1 -1
  3. package/dist/analyzer.mjs +1 -1
  4. package/dist/analyzer.mjs.map +1 -1
  5. package/dist/animate.js +1 -1
  6. package/dist/animate.js.map +1 -1
  7. package/dist/animate.mjs +1 -1
  8. package/dist/animate.mjs.map +1 -1
  9. package/dist/atomic.js +1 -1
  10. package/dist/atomic.js.map +1 -1
  11. package/dist/atomic.mjs +1 -1
  12. package/dist/atomic.mjs.map +1 -1
  13. package/dist/cli.js +1 -1
  14. package/dist/cli.js.map +1 -1
  15. package/dist/cli.mjs +1 -1
  16. package/dist/cli.mjs.map +1 -1
  17. package/dist/compiler.js +1 -1
  18. package/dist/compiler.js.map +1 -1
  19. package/dist/compiler.mjs +1 -1
  20. package/dist/compiler.mjs.map +1 -1
  21. package/dist/dashboard.js +1 -1
  22. package/dist/dashboard.js.map +1 -1
  23. package/dist/dashboard.mjs +1 -2
  24. package/dist/dashboard.mjs.map +1 -1
  25. package/dist/devtools.js +1 -1
  26. package/dist/devtools.js.map +1 -1
  27. package/dist/devtools.mjs +1 -1
  28. package/dist/devtools.mjs.map +1 -1
  29. package/dist/engine.js +1 -1
  30. package/dist/engine.js.map +1 -1
  31. package/dist/engine.mjs +1 -1
  32. package/dist/engine.mjs.map +1 -1
  33. package/dist/index.browser.mjs +1 -1
  34. package/dist/index.browser.mjs.map +1 -1
  35. package/dist/index.js +3 -1
  36. package/dist/index.js.map +1 -1
  37. package/dist/index.mjs +3 -1
  38. package/dist/index.mjs.map +1 -1
  39. package/dist/next.js +1 -1
  40. package/dist/next.js.map +1 -1
  41. package/dist/next.mjs +1 -1
  42. package/dist/next.mjs.map +1 -1
  43. package/dist/plugin-api.js +1 -1
  44. package/dist/plugin-api.js.map +1 -1
  45. package/dist/plugin-api.mjs +1 -2
  46. package/dist/plugin-api.mjs.map +1 -1
  47. package/dist/plugin-registry.js +1 -1
  48. package/dist/plugin-registry.js.map +1 -1
  49. package/dist/plugin-registry.mjs +1 -1
  50. package/dist/plugin-registry.mjs.map +1 -1
  51. package/dist/plugin.js +1 -1
  52. package/dist/plugin.js.map +1 -1
  53. package/dist/plugin.mjs +1 -2
  54. package/dist/plugin.mjs.map +1 -1
  55. package/dist/preset.js +1 -1
  56. package/dist/preset.js.map +1 -1
  57. package/dist/preset.mjs +1 -2
  58. package/dist/preset.mjs.map +1 -1
  59. package/dist/rspack.js +1 -1
  60. package/dist/rspack.js.map +1 -1
  61. package/dist/rspack.mjs +1 -1
  62. package/dist/rspack.mjs.map +1 -1
  63. package/dist/runtime-css.js +3 -1
  64. package/dist/runtime-css.js.map +1 -1
  65. package/dist/runtime-css.mjs +2 -1
  66. package/dist/runtime-css.mjs.map +1 -1
  67. package/dist/runtime.js +3 -1
  68. package/dist/runtime.js.map +1 -1
  69. package/dist/runtime.mjs +2 -1
  70. package/dist/runtime.mjs.map +1 -1
  71. package/dist/scanner.js +1 -1
  72. package/dist/scanner.js.map +1 -1
  73. package/dist/scanner.mjs +1 -1
  74. package/dist/scanner.mjs.map +1 -1
  75. package/dist/shared.js +1 -1
  76. package/dist/shared.js.map +1 -1
  77. package/dist/shared.mjs +1 -1
  78. package/dist/shared.mjs.map +1 -1
  79. package/dist/storybook-addon.js +1 -1
  80. package/dist/storybook-addon.js.map +1 -1
  81. package/dist/storybook-addon.mjs +1 -2
  82. package/dist/storybook-addon.mjs.map +1 -1
  83. package/dist/svelte.js +1 -1
  84. package/dist/svelte.js.map +1 -1
  85. package/dist/svelte.mjs +1 -1
  86. package/dist/svelte.mjs.map +1 -1
  87. package/dist/syntax.js +1 -1
  88. package/dist/syntax.js.map +1 -1
  89. package/dist/syntax.mjs +1 -2
  90. package/dist/syntax.mjs.map +1 -1
  91. package/dist/testing.js +1 -1
  92. package/dist/testing.js.map +1 -1
  93. package/dist/testing.mjs +1 -2
  94. package/dist/testing.mjs.map +1 -1
  95. package/dist/theme.js +3 -1
  96. package/dist/theme.js.map +1 -1
  97. package/dist/theme.mjs +3 -1
  98. package/dist/theme.mjs.map +1 -1
  99. package/dist/turbopackLoader.js +1 -1
  100. package/dist/turbopackLoader.js.map +1 -1
  101. package/dist/turbopackLoader.mjs +1 -1
  102. package/dist/turbopackLoader.mjs.map +1 -1
  103. package/dist/tw.js +1 -1
  104. package/dist/tw.js.map +1 -1
  105. package/dist/tw.mjs +1 -1
  106. package/dist/tw.mjs.map +1 -1
  107. package/dist/vite.js +1 -1
  108. package/dist/vite.js.map +1 -1
  109. package/dist/vite.mjs +1 -1
  110. package/dist/vite.mjs.map +1 -1
  111. package/dist/vue.js +1 -1
  112. package/dist/vue.js.map +1 -1
  113. package/dist/vue.mjs +1 -1
  114. package/dist/vue.mjs.map +1 -1
  115. package/dist/webpackLoader.js +1 -1
  116. package/dist/webpackLoader.js.map +1 -1
  117. package/dist/webpackLoader.mjs +1 -1
  118. package/dist/webpackLoader.mjs.map +1 -1
  119. package/package.json +8 -7
@@ -1 +1 @@
1
- {"version":3,"sources":["../node_modules/tsup/assets/cjs_shims.js","../packages/domain/shared/src/esmHelpers.ts","../packages/domain/shared/src/index.ts","../src/umbrella/rspack.ts","../packages/presentation/rspack/src/index.ts","../packages/presentation/rspack/src/schemas.ts"],"sourcesContent":["// Shim globals in cjs bundle\n// There's a weird bug that esbuild will always inject importMetaUrl\n// if we export it as `const importMetaUrl = ... __filename ...`\n// But using a function will not cause this issue\n\nconst getImportMetaUrl = () => \n typeof document === \"undefined\" \n ? new URL(`file:${__filename}`).href \n : (document.currentScript && document.currentScript.tagName.toUpperCase() === 'SCRIPT') \n ? document.currentScript.src \n : new URL(\"main.js\", document.baseURI).href;\n\nexport const importMetaUrl = /* @__PURE__ */ getImportMetaUrl()\n","/**\n * ESM-safe runtime helpers untuk monorepo.\n *\n * Menggantikan pola fragile seperti:\n * - `createRequire(import.meta.url)` → gunakan `createEsmRequire()`\n * - `__dirname` → gunakan `getDirname(import.meta.url)`\n * - `__filename` → gunakan `getFilename(import.meta.url)`\n *\n * Semua helper ini bekerja di ESM dan CJS.\n *\n * @module @tailwind-styled/shared/esmHelpers\n */\n\nconst isBrowser = typeof window !== \"undefined\" || typeof document !== \"undefined\"\n\n// Safe check for require availability - works in both CJS and ESM\nlet nodeModuleRef: typeof import(\"node:module\") | null = null\nfunction getNodeModuleRef(): typeof import(\"node:module\") | null {\n if (isBrowser) return null\n if (nodeModuleRef !== null) return nodeModuleRef\n try {\n const test = typeof require === 'function' ? (require('node:module') as typeof import(\"node:module\")) : null\n nodeModuleRef = test\n return test\n } catch {\n nodeModuleRef = null\n return null\n }\n}\n\nlet _nodePath: typeof import(\"node:path\") | null = null\nlet _nodeUrl: typeof import(\"node:url\") | null = null\nlet _nodeFs: typeof import(\"node:fs\") | null = null\nlet _nodeCrypto: typeof import(\"node:crypto\") | null = null\nlet _nodeOs: typeof import(\"node:os\") | null = null\n\n/**\n * Get current file URL in a way that works in both ESM and CJS.\n * In ESM: uses import.meta.url\n * In CJS: uses __filename converted to file URL\n */\nfunction getCurrentFileUrl(): string {\n // In CJS builds, import.meta.url is replaced by esbuild with __importMetaUrl\n // which is set via the banner polyfill. In ESM it's the real URL.\n if (import.meta.url) {\n return import.meta.url\n }\n // Fallback: __filename is available in bare CJS (not bundled)\n if (typeof __filename !== \"undefined\") {\n return `file://${__filename.replace(/\\\\/g, \"/\")}`\n }\n return \"file://unknown\"\n}\n\nfunction getNodePath(): typeof import(\"node:path\") {\n if (isBrowser) throw new Error(\"node:path not available in browser\")\n if (!_nodePath) {\n if (typeof require === \"function\") {\n _nodePath = require(\"node:path\") as typeof import(\"node:path\")\n } else {\n const nodeRequire = getNodeModuleRef()\n if (!nodeRequire) throw new Error(\"require not available\")\n _nodePath = nodeRequire.createRequire(getCurrentFileUrl())(\"node:path\") as typeof import(\"node:path\")\n }\n }\n return _nodePath!\n}\nfunction getNodeUrl(): typeof import(\"node:url\") {\n if (isBrowser) throw new Error(\"node:url not available in browser\")\n if (!_nodeUrl) {\n if (typeof require === \"function\") {\n _nodeUrl = require(\"node:url\") as typeof import(\"node:url\")\n } else {\n const nodeRequire = getNodeModuleRef()\n if (!nodeRequire) throw new Error(\"require not available\")\n _nodeUrl = nodeRequire.createRequire(getCurrentFileUrl())(\"node:url\") as typeof import(\"node:url\")\n }\n }\n return _nodeUrl!\n}\nfunction getNodeFs(): typeof import(\"node:fs\") {\n if (isBrowser) throw new Error(\"node:fs not available in browser\")\n if (!_nodeFs) {\n if (typeof require === \"function\") {\n _nodeFs = require(\"node:fs\") as typeof import(\"node:fs\")\n } else {\n const nodeRequire = getNodeModuleRef()\n if (!nodeRequire) throw new Error(\"require not available\")\n _nodeFs = nodeRequire.createRequire(getCurrentFileUrl())(\"node:fs\") as typeof import(\"node:fs\")\n }\n }\n return _nodeFs!\n}\nfunction getNodeCrypto(): typeof import(\"node:crypto\") {\n if (isBrowser) throw new Error(\"node:crypto not available in browser\")\n if (!_nodeCrypto) {\n if (typeof require === \"function\") {\n _nodeCrypto = require(\"node:crypto\") as typeof import(\"node:crypto\")\n } else {\n const nodeRequire = getNodeModuleRef()\n if (!nodeRequire) throw new Error(\"require not available\")\n _nodeCrypto = nodeRequire.createRequire(getCurrentFileUrl())(\"node:crypto\") as typeof import(\"node:crypto\")\n }\n }\n return _nodeCrypto!\n}\nfunction getNodeOs(): typeof import(\"node:os\") {\n if (isBrowser) throw new Error(\"node:os not available in browser\")\n if (!_nodeOs) {\n if (typeof require === \"function\") {\n _nodeOs = require(\"node:os\") as typeof import(\"node:os\")\n } else {\n const nodeRequire = getNodeModuleRef()\n if (!nodeRequire) throw new Error(\"require not available\")\n _nodeOs = nodeRequire.createRequire(getCurrentFileUrl())(\"node:os\") as typeof import(\"node:os\")\n }\n }\n return _nodeOs!\n}\n\n/**\n * Buat `require()` function yang relative terhadap sebuah ESM module.\n *\n * @example\n * const req = createEsmRequire(import.meta.url)\n * const mod = req(\"some-pkg\")\n */\nexport function createEsmRequire(importMetaUrl: string): NodeRequire {\n if (isBrowser) throw new Error(\"require not available in browser\")\n // CJS: require is already available globally\n if (typeof require === \"function\") return require\n const nodeRequire = getNodeModuleRef()\n if (!nodeRequire) throw new Error(\"require not available\")\n return nodeRequire.createRequire(importMetaUrl)\n}\n\n/**\n * Dapat `__dirname` dari `import.meta.url`.\n *\n * @example\n * const dir = getDirname(import.meta.url)\n */\nexport function getDirname(importMetaUrl: string): string {\n if (isBrowser) return \"\"\n // CJS: __dirname is directly available\n if (typeof __dirname !== \"undefined\") return __dirname\n const nodePath = getNodePath()\n const nodeUrl = getNodeUrl()\n return nodePath.dirname(nodeUrl.fileURLToPath(importMetaUrl))\n}\n\n/**\n * Dapat `__filename` dari `import.meta.url`.\n */\nexport function getFilename(importMetaUrl: string): string {\n if (isBrowser) return \"\"\n // CJS: __filename is directly available\n if (typeof __filename !== \"undefined\") return __filename\n return getNodeUrl().fileURLToPath(importMetaUrl)\n}\n\n/**\n * Resolve path dari root monorepo (bukan CWD).\n */\nexport function resolveFromRoot(...segments: string[]): string {\n if (isBrowser) return segments.join(\"/\")\n\n const nodePath = getNodePath()\n const nodeFs = getNodeFs()\n\n // Use __dirname in CJS, or getDirname with current file URL in ESM\n let dir = typeof __dirname !== \"undefined\"\n ? __dirname\n : getDirname(getCurrentFileUrl())\n\n for (let i = 0; i < 10; i++) {\n const pkgPath = nodePath.join(dir, \"package.json\")\n try {\n const pkg = JSON.parse(nodeFs.readFileSync(pkgPath, \"utf-8\"))\n if (pkg.workspaces) {\n return nodePath.resolve(dir, ...segments)\n }\n } catch { /* intentionally silent */ }\n dir = nodePath.dirname(dir)\n }\n return nodePath.resolve(process.cwd(), ...segments)\n}\n\n/**\n * Require sebuah module dengan fallback ke null jika tidak tersedia.\n */\nexport function tryRequire<T = unknown>(\n moduleName: string,\n importMetaUrl: string\n): T | null {\n if (isBrowser) return null\n try {\n return createEsmRequire(importMetaUrl)(moduleName) as T\n } catch { /* intentionally silent — optional dep */ }\n return null\n}\n\n/**\n * Resolve .node binary path yang cross-platform dan ESM-safe.\n */\nexport function resolveNativeNodePath(\n importMetaUrl: string,\n ...relativeSegments: string[]\n): string {\n if (isBrowser) return relativeSegments.join(\"/\")\n return getNodePath().resolve(getDirname(importMetaUrl), ...relativeSegments)\n}\n","import { createHash } from \"node:crypto\"\nimport fs from \"node:fs\"\nimport path from \"node:path\"\nimport { fileURLToPath } from \"node:url\"\nimport { createRequire } from \"node:module\"\n\n// Native-only: Node.js is always available. No browser fallback.\n\n// ─────────────────────────────────────────────────────────────────────────────\n// Types\n// ─────────────────────────────────────────────────────────────────────────────\n\nexport type TokenMap = Record<string, string>\n\nexport type VariantValue = string | number | boolean | undefined\n\nexport type VariantProps = Record<string, VariantValue>\n\nexport type HtmlTagName = keyof HTMLElementTagNameMap\n\nexport type CompoundCondition = Record<string, string | number | boolean>\n\nexport type VariantMatrix = Record<string, Array<string | number | boolean>>\n\n// ─────────────────────────────────────────────────────────────────────────────\n// Logging\n// ─────────────────────────────────────────────────────────────────────────────\n\nexport interface Logger {\n warn(...args: unknown[]): void\n debug(...args: unknown[]): void\n error(...args: unknown[]): void\n log(...args: unknown[]): void\n}\n\nexport function createLogger(namespace: string): Logger {\n const prefix = `[${namespace}]`\n return {\n warn(...args: unknown[]) {\n process.stderr.write(`${prefix} ${args.map(a => typeof a === \"string\" ? a : String(a)).join(\" \")}\\n`)\n },\n debug(...args: unknown[]) {\n process.stderr.write(`${prefix} ${args.map(a => typeof a === \"string\" ? a : String(a)).join(\" \")}\\n`)\n },\n error(...args: unknown[]) {\n process.stderr.write(`${prefix} ${args.map(a => typeof a === \"string\" ? a : String(a)).join(\" \")}\\n`)\n },\n log(...args: unknown[]) {\n process.stderr.write(`${prefix} ${args.map(a => typeof a === \"string\" ? a : String(a)).join(\" \")}\\n`)\n },\n }\n}\n\nexport function createDebugLogger(namespace: string, label?: string): (msg: string) => void {\n const prefix = label ? `[${namespace}:${label}]` : `[${namespace}]`\n return (msg: string) => {\n if (process.env.DEBUG?.includes(namespace) || process.env.TW_DEBUG) {\n console.debug(prefix, msg)\n }\n }\n}\n\n// ─────────────────────────────────────────────────────────────────────────────\n// Error handling\n// ─────────────────────────────────────────────────────────────────────────────\n\nexport type ErrorSource = \"rust\" | \"validation\" | \"compile\" | \"io\" | \"config\" | \"unknown\"\n\ntype ZodLikeIssue = {\n path?: readonly PropertyKey[]\n message?: string\n}\n\nfunction formatIssuePath(path?: readonly PropertyKey[]): string {\n if (!path || path.length === 0) return \"(root)\"\n return path\n .map((segment) =>\n typeof segment === \"symbol\" ? segment.description ?? segment.toString() : String(segment)\n )\n .join(\".\")\n}\n\nexport class TwError extends Error {\n /** @deprecated Gunakan source */\n public readonly domain: string\n public readonly source: ErrorSource\n public readonly code: string\n public readonly originalCause?: unknown\n\n constructor(domainOrSource: string, code: string, message: string, cause?: unknown) {\n super(message)\n this.name = \"TwError\"\n this.domain = domainOrSource\n this.source = domainOrSource as ErrorSource\n this.code = code\n this.originalCause = cause\n if (Error.captureStackTrace) Error.captureStackTrace(this, TwError)\n }\n\n static fromIo(code: string, message: string): TwError {\n return new TwError(\"io\", code, message)\n }\n\n static fromCompile(code: string, message: string): TwError {\n return new TwError(\"compile\", code, message)\n }\n\n static fromRust(err: { code?: string; message?: string } | Error | unknown): TwError {\n if (err instanceof TwError) return err\n if (err instanceof Error) return new TwError(\"rust\", \"RUST_ERROR\", err.message, err)\n if (err && typeof err === \"object\") {\n const e = err as { code?: string; message?: string }\n return new TwError(\"rust\", e.code ?? \"RUST_ERROR\", e.message ?? String(err), err)\n }\n return new TwError(\"rust\", \"RUST_ERROR\", String(err), err)\n }\n\n /** Buat TwError dari ZodError — dukung shape Zod v3 (`errors`) dan v4 (`issues`). */\n static fromZod(err: { issues?: ZodLikeIssue[]; errors?: ZodLikeIssue[] }): TwError {\n const first = err.issues?.[0] ?? err.errors?.[0]\n const path = formatIssuePath(first?.path)\n const message = first ? `${path}: ${first.message}` : \"Schema validation failed\"\n return new TwError(\"validation\", \"SCHEMA_VALIDATION_FAILED\", message, err)\n }\n\n static wrap(source: string, code: string, err: unknown): TwError {\n if (err instanceof TwError) return err\n if (err instanceof Error) return new TwError(source, code, err.message, err)\n return new TwError(source, code, String(err), err)\n }\n\n override toString(): string {\n return `TwError [${this.source}:${this.code}] ${this.message}`\n }\n\n toJSON(): { name: string; source: string; code: string; message: string } {\n return { name: this.name, source: this.source, code: this.code, message: this.message }\n }\n\n toCliMessage(): string {\n return `[${this.source.toUpperCase()}:${this.code}] ${this.message}`\n }\n}\n\nexport function wrapUnknownError(domain: string, code: string, error: unknown): TwError {\n return TwError.wrap(domain, code, error)\n}\n\nexport function isTwError(err: unknown): err is TwError {\n return err instanceof TwError\n}\n\n// ─────────────────────────────────────────────────────────────────────────────\n// Native binding resolution\n// ─────────────────────────────────────────────────────────────────────────────\n\nexport interface LoadNativeBindingOptions<T> {\n runtimeDir: string\n candidates: string[]\n isValid: (module: unknown) => module is T\n invalidExportMessage: string\n}\n\nexport interface LoadNativeBindingResult<T> {\n binding: T | null\n loadErrors: Array<{ path: string; message: string }>\n loadedPath?: string\n}\n\nexport function loadNativeBinding<T>(options: LoadNativeBindingOptions<T>): LoadNativeBindingResult<T> {\n const { runtimeDir, candidates, isValid } = options\n const loadErrors: Array<{ path: string; message: string }> = []\n\n for (const candidate of candidates) {\n const candidatePath = path.resolve(runtimeDir, candidate)\n try {\n if (!fs.existsSync(candidatePath) && !fs.existsSync(candidatePath + \".node\")) {\n continue\n }\n const mod = requireNativeModule(candidatePath)\n if (mod && isValid(mod)) {\n return { binding: mod, loadErrors, loadedPath: candidatePath }\n }\n loadErrors.push({ path: candidatePath, message: options.invalidExportMessage })\n } catch (e) {\n loadErrors.push({ path: candidatePath, message: e instanceof Error ? e.message : String(e) })\n }\n }\n\n return { binding: null, loadErrors }\n}\n\nconst _require = createRequire(\n typeof __filename !== \"undefined\"\n ? `file://${__filename}`\n : (import.meta.url ?? \"file://unknown\")\n)\n\nfunction requireNativeModule(p: string): unknown {\n return _require(p)\n}\n\nexport interface ResolveCandidatesOptions {\n runtimeDir?: string\n envVarNames?: string[]\n includeDefaultCandidates?: boolean\n enforceNodeExtensionForEnvPath?: boolean\n /** @deprecated — ignored, kept for backward compat */\n packageName?: string\n}\n\nexport function resolveNativeBindingCandidates(options: ResolveCandidatesOptions): string[] {\n const {\n envVarNames = [\"TW_NATIVE_PATH\", \"TWS_NATIVE_PATH\"],\n includeDefaultCandidates = true,\n enforceNodeExtensionForEnvPath = false,\n } = options\n // Default ke cwd kalau runtimeDir tidak disediakan\n const runtimeDir = options.runtimeDir || process.cwd()\n const candidates: string[] = []\n\n for (const envVar of envVarNames) {\n const envPath = process.env[envVar]\n if (envPath) {\n candidates.push(enforceNodeExtensionForEnvPath && !envPath.endsWith(\".node\") ? envPath + \".node\" : envPath)\n }\n }\n\n if (!includeDefaultCandidates) return candidates\n\n if (fs.existsSync(runtimeDir)) {\n try {\n for (const entry of fs.readdirSync(runtimeDir)) {\n if (entry.endsWith(\".node\")) candidates.push(entry)\n }\n } catch { /* ignore read errors */ }\n }\n\n const BINARY_NAMES = [\"tailwind-styled-native\", \"tailwind_styled_parser\"]\n const napiPlatform = process.platform === \"linux\" && process.arch === \"x64\" ? \"linux-x64-gnu\"\n : process.platform === \"linux\" && process.arch === \"arm64\" ? \"linux-arm64-gnu\"\n : `${process.platform}-${process.arch}`\n\n for (const bin of BINARY_NAMES) {\n candidates.push(path.resolve(runtimeDir, `${bin}.node`))\n candidates.push(path.resolve(runtimeDir, `${bin}.${napiPlatform}.node`))\n // 1 level: dist/ → package-root/native/ (published npm package)\n candidates.push(path.resolve(runtimeDir, \"..\", \"native\", `${bin}.node`))\n candidates.push(path.resolve(runtimeDir, \"..\", \"native\", `${bin}.${napiPlatform}.node`))\n // cwd fallback (user project root)\n candidates.push(path.resolve(process.cwd(), \"native\", `${bin}.node`))\n candidates.push(path.resolve(process.cwd(), \"native\", `${bin}.${napiPlatform}.node`))\n // 4 level: dist/ → package/ → domain/ → packages/ → repo-root/ (monorepo dev)\n candidates.push(path.resolve(runtimeDir, \"..\", \"..\", \"..\", \"..\", \"native\", `${bin}.node`))\n candidates.push(path.resolve(runtimeDir, \"..\", \"..\", \"..\", \"..\", \"native\", `${bin}.${napiPlatform}.node`))\n // 3 level fallback\n candidates.push(path.resolve(runtimeDir, \"..\", \"..\", \"..\", \"native\", `${bin}.node`))\n }\n\n return Array.from(new Set(candidates))\n}\n\nexport function resolveRuntimeDir(dir: string | undefined, importMetaUrl: string): string {\n if (dir) return path.resolve(dir)\n try {\n return path.dirname(fileURLToPath(importMetaUrl))\n } catch {\n return process.cwd()\n }\n}\n\n// ─────────────────────────────────────────────────────────────────────────────\n// Hashing\n// ─────────────────────────────────────────────────────────────────────────────\n\nexport function hashContent(content: string, algorithm: string = \"md5\", length?: number): string {\n const hash = createHash(algorithm).update(content).digest(\"hex\")\n return length ? hash.slice(0, length) : hash\n}\n\n// ─────────────────────────────────────────────────────────────────────────────\n// Error formatting\n// ─────────────────────────────────────────────────────────────────────────────\n\nexport function formatErrorMessage(error: unknown): string {\n if (error instanceof TwError) return error.toString()\n if (error instanceof Error) return error.message\n return String(error)\n}\n\n// ─────────────────────────────────────────────────────────────────────────────\n// LRU Cache\n// ─────────────────────────────────────────────────────────────────────────────\n\nexport class LRUCache<K, V> {\n private capacity: number\n private cache: Map<K, V>\n\n constructor(capacity: number) {\n this.capacity = capacity\n this.cache = new Map()\n }\n\n get(key: K): V | undefined {\n if (!this.cache.has(key)) return undefined\n const value = this.cache.get(key)!\n this.cache.delete(key)\n this.cache.set(key, value)\n return value\n }\n\n set(key: K, value: V): void {\n if (this.cache.has(key)) {\n this.cache.delete(key)\n } else if (this.cache.size >= this.capacity) {\n const firstKey = this.cache.keys().next().value\n if (firstKey !== undefined) {\n this.cache.delete(firstKey)\n }\n }\n this.cache.set(key, value)\n }\n\n delete(key: K): boolean {\n return this.cache.delete(key)\n }\n\n has(key: K): boolean {\n return this.cache.has(key)\n }\n\n clear(): void {\n this.cache.clear()\n }\n\n entries(): IterableIterator<[K, V]> {\n return this.cache.entries()\n }\n\n get size(): number {\n return this.cache.size\n }\n}\n\n// ─────────────────────────────────────────────────────────────────────────────\n// Trace Utilities\n// ─────────────────────────────────────────────────────────────────────────────\n\nexport type { TraceSnapshot, TraceSummary } from \"./trace\"\nexport {\n getHealthColor,\n getModeColor,\n formatMemory,\n formatDuration,\n calculateHealth,\n getBuildTimeColor,\n getMemoryColor,\n createTraceSnapshot,\n getPipelinePercentages,\n} from \"./trace\"\n\n// ─────────────────────────────────────────────────────────────────────────────\n// Performance Telemetry\n// ─────────────────────────────────────────────────────────────────────────────\n\n\n\n// ─────────────────────────────────────────────────────────────────────────────\n// Error Codes\n// ─────────────────────────────────────────────────────────────────────────────\n\nexport type { ErrorCode } from \"./error-codes\"\nexport { ERROR_CODES, getSuggestion, formatErrorCode } from \"./error-codes\"\n\n// ─────────────────────────────────────────────────────────────────────────────\n// Tailwind Compatibility\n// ─────────────────────────────────────────────────────────────────────────────\n\nexport type { TailwindInfo } from \"./compatibility\"\nexport { detectTailwind, assertTailwindV4, getTailwindVersion, isTailwindV4 } from \"./compatibility\"\n\n// ── Native binding schemas (Zod boundary validation)\nexport {\n NativeScanFileSchema, NativeScanResultSchema,\n NativeAnalyzerReportSchema, NativeTransformResultSchema,\n NativeCssCompileResultSchema, NativeWatchResultSchema,\n NativeCacheEntrySchema, NativeCacheReadResultSchema,\n safeParseNative, parseNative,\n} from './native-schemas'\n\n// ── ESM-safe runtime helpers ──────────────────────────────────────────────\nexport {\n createEsmRequire,\n getDirname,\n getFilename,\n resolveFromRoot,\n tryRequire,\n resolveNativeNodePath,\n} from \"./esmHelpers\"\n\n// ── Performance telemetry ────────────────────────────────────────────────────\nexport {\n TelemetryCollector,\n getGlobalTelemetry,\n resetGlobalTelemetry,\n createBuildTimer,\n type BuildTelemetry,\n type TelemetrySummary,\n type BuildPhases,\n} from \"./telemetry\"\n\n// ── Config/JSON schema validation ─────────────────────────────────────────────\nexport {\n ScanCacheSchema,\n ScanCacheClassEntrySchema,\n TailwindConfigSchema,\n RegistryPluginEntrySchema,\n RegistryFileSchema,\n PackageJsonSchema,\n parseJsonWithSchema,\n parseJsonFileWithSchema,\n type ScanCache,\n type ScanCacheClassEntry,\n type TailwindConfig,\n type RegistryPluginEntry,\n type RegistryFile,\n type PackageJson,\n} from \"./configSchemas\"\n\n// ── Worker/bootstrap path resolution ─────────────────────────────────────────\nexport {\n resolveWorkerPath,\n resolveLoaderPath,\n type WorkerPathOptions,\n type WorkerPathResult,\n} from \"./workerResolver\"\n\n// ── Codegen helpers ───────────────────────────────────────────────────────────\nexport {\n generateComponentCode,\n generateStorybookStory,\n generateClassRenameCodemod,\n generateBarrelFile,\n type ComponentCodegenOptions,\n} from \"./codegen\"\n\n// ── Native binary resolution (QA #1) ─────────────────────────────────────────\nexport {\n resolveNativeBinary,\n formatNativeNotFoundError,\n type NativeResolutionResult,\n} from \"./native-resolution\"\n\n// ── Shared observability contract ────────────────────────────────────────────\nexport {\n createObservabilityClient,\n type ClassInspection,\n type ClassProperty,\n type ClassUsageLocation,\n type BuildTrace,\n type BuildPhaseTrace,\n type DashboardMetrics,\n type DashboardSummary,\n type ObservabilityClient,\n} from \"./observability\"\n\nexport {\n TW_STATE_STATIC_FILENAME,\n extractStaticStateCss,\n appendStaticStateCssToSafelist,\n type TwStateConfigEntry,\n type StaticStateCssInput,\n type GeneratedStateRule,\n type StaticStateExtractionResult,\n} from \"./staticStateExtractor\"\nexport { setGlobalLogFile } from \"./logger\"","export * from \"@tailwind-styled/rspack\"\n","/**\n * tailwind-styled-v4 - Rspack Plugin v5 (stable)\n *\n * Usage:\n * import { tailwindStyledRspackPlugin } from \"@tailwind-styled/rspack\"\n *\n * export default defineConfig({\n * plugins: [tailwindStyledRspackPlugin()],\n * })\n *\n * v5:\n * - Simplified API\n * - Mode always zero-runtime\n */\n\nimport fs from \"node:fs\"\nimport path from \"node:path\"\nimport { getDirname as getEsmDirname } from \"@tailwind-styled/shared\"\n\nimport { parseRspackPluginOptions } from \"./schemas\"\n\nfunction getDirname(): string {\n if (typeof __dirname !== \"undefined\") {\n return __dirname\n }\n if (typeof import.meta !== \"undefined\" && import.meta.url) {\n return getEsmDirname(import.meta.url)\n }\n return process.cwd()\n}\n\nfunction resolveLoaderPath(basename: string): string {\n const runtimeDir = getDirname()\n const preferredExtensions =\n typeof __dirname !== \"undefined\" && __dirname.length > 0 ? [\".cjs\", \".js\"] : [\".js\", \".cjs\"]\n\n for (const ext of preferredExtensions) {\n const candidate = path.resolve(runtimeDir, `${basename}${ext}`)\n if (fs.existsSync(candidate)) return candidate\n }\n\n return path.resolve(runtimeDir, `${basename}.js`)\n}\n\ninterface RspackRule {\n _tailwindStyledRspackMarker?: boolean\n test?: RegExp\n exclude?: RegExp\n use?: Array<{\n loader: string\n options: {\n mode: \"zero-runtime\"\n addDataAttr: boolean\n preserveImports: boolean\n safelistPath?: string\n }\n }>\n}\n\ninterface RspackCompiler {\n options: {\n mode?: string\n module?: {\n rules?: RspackRule[]\n }\n }\n}\n\nexport interface RspackPluginOptions {\n /** File patterns to include. Default: /\\.[jt]sx?$/ */\n include?: RegExp\n /** File patterns to exclude. Default: /node_modules/ */\n exclude?: RegExp\n /** Add data-tw debug attributes in dev. Default: true in dev */\n addDataAttr?: boolean\n /** Enable analyzer. Default: false */\n analyze?: boolean\n /**\n * Path ke safelist CSS file.\n * `_tw-state-static.css` ditulis di direktori yang sama.\n * Default: `<cwd>/__tw_safelist.css`\n */\n safelistPath?: string\n}\n\nexport class TailwindStyledRspackPlugin {\n private opts: RspackPluginOptions\n\n constructor(opts: RspackPluginOptions = {}) {\n this.opts = parseRspackPluginOptions(opts)\n }\n\n apply(compiler: RspackCompiler): void {\n const isDev = compiler.options.mode !== \"production\"\n const loaderPath = resolveLoaderPath(\"loader\")\n const existing = compiler.options.module?.rules ?? []\n const alreadyRegistered = existing.some(\n (rule) =>\n typeof rule === \"object\" && rule !== null && rule._tailwindStyledRspackMarker === true\n )\n\n if (alreadyRegistered) return\n\n const safelistPath =\n this.opts.safelistPath ?? path.join(process.cwd(), \"__tw_safelist.css\")\n\n // Tulis placeholder agar @import di CSS entry tidak error saat cold start\n const stateStaticPath = path.join(path.dirname(safelistPath), \"_tw-state-static.css\")\n if (!fs.existsSync(stateStaticPath)) {\n try {\n fs.mkdirSync(path.dirname(stateStaticPath), { recursive: true })\n fs.writeFileSync(\n stateStaticPath,\n `/* _tw-state-static.css — Auto-generated by tailwind-styled-v4. DO NOT EDIT.\\n` +\n ` * Import di CSS entry: @import \"./_tw-state-static.css\";\\n` +\n ` */\\n`,\n \"utf-8\"\n )\n } catch { /* non-fatal */ }\n }\n\n const rule: RspackRule = {\n _tailwindStyledRspackMarker: true,\n test: this.opts.include ?? /\\.[jt]sx?$/,\n exclude: this.opts.exclude ?? /node_modules/,\n use: [\n {\n loader: loaderPath,\n options: {\n mode: \"zero-runtime\",\n addDataAttr: this.opts.addDataAttr ?? isDev,\n preserveImports: true,\n safelistPath,\n },\n },\n ],\n }\n\n compiler.options.module = {\n ...(compiler.options.module ?? {}),\n rules: [rule, ...existing],\n }\n }\n}\n\nexport function tailwindStyledRspackPlugin(\n opts: RspackPluginOptions = {}\n): TailwindStyledRspackPlugin {\n return new TailwindStyledRspackPlugin(opts)\n}\n\nexport default tailwindStyledRspackPlugin\n\nexport {\n parseRspackPluginOptions,\n type RspackPluginOptionsInput,\n RspackPluginOptionsSchema,\n} from \"./schemas\"\n","import { z } from \"zod\"\nimport { TwError } from \"@tailwind-styled/shared\"\n\nconst formatIssuePath = (path: readonly PropertyKey[]): string =>\n path.length > 0\n ? path\n .map((segment) =>\n typeof segment === \"symbol\" ? segment.description ?? segment.toString() : String(segment)\n )\n .join(\".\")\n : \"<root>\"\n\nconst formatIssues = (error: z.ZodError): string =>\n error.issues\n .map((issue) => {\n const p = formatIssuePath(issue.path)\n return `${p}: ${issue.message}`\n })\n .join(\"; \")\n\nconst parseWithSchema = <T>(schema: z.ZodType<T>, data: unknown, label: string): T => {\n const parsed = schema.safeParse(data)\n if (parsed.success) return parsed.data\n const details = formatIssues(parsed.error)\n throw new TwError(\n \"validation\",\n \"SCHEMA_VALIDATION_FAILED\",\n details ? `${label}: ${details}` : label,\n parsed.error\n )\n}\n\nexport const RspackPluginOptionsSchema = z.object({\n include: z.instanceof(RegExp).optional(),\n exclude: z.instanceof(RegExp).optional(),\n addDataAttr: z.boolean().optional(),\n analyze: z.boolean().optional(),\n cssEntry: z.string().optional(),\n /** Path ke safelist CSS file. Default: <cwd>/__tw_safelist.css */\n safelistPath: z.string().optional(),\n})\n\nexport type RspackPluginOptionsInput = z.infer<typeof RspackPluginOptionsSchema>\n\nexport const parseRspackPluginOptions = (options: unknown) =>\n parseWithSchema(RspackPluginOptionsSchema, options ?? {}, \"rspack plugin options are invalid\")\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,IAKM,kBAOO;AAZb;AAAA;AAAA;AAKA,IAAM,mBAAmB,MACvB,OAAO,aAAa,cAChB,IAAI,IAAI,QAAQ,UAAU,EAAE,EAAE,OAC7B,SAAS,iBAAiB,SAAS,cAAc,QAAQ,YAAY,MAAM,WAC1E,SAAS,cAAc,MACvB,IAAI,IAAI,WAAW,SAAS,OAAO,EAAE;AAEtC,IAAM,gBAAgC,iCAAiB;AAAA;AAAA;;;ACK9D,SAAS,mBAAwD;AAC/D,MAAI,UAAW,QAAO;AACtB,MAAI,kBAAkB,KAAM,QAAO;AACnC,MAAI;AACF,UAAM,OAAO,OAAO,YAAY,aAAc,QAAQ,QAAa,IAAqC;AACxG,oBAAgB;AAChB,WAAO;AAAA,EACT,QAAQ;AACN,oBAAgB;AAChB,WAAO;AAAA,EACT;AACF;AAaA,SAAS,oBAA4B;AAGnC,MAAI,eAAiB;AACnB,WAAO;AAAA,EACT;AAEA,MAAI,OAAO,eAAe,aAAa;AACrC,WAAO,UAAU,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;AAEA,aAAS,QAAQ,SAAS;AAAA,MACxB,GAAI,SAAS,QAAQ,UAAU,CAAC;AAAA,MAChC,OAAO,CAAC,MAAM,GAAG,QAAQ;AAAA,IAC3B;AAAA,EACF;AACF;AAEO,SAAS,2BACd,OAA4B,CAAC,GACD;AAC5B,SAAO,IAAI,2BAA2B,IAAI;AAC5C;","names":["importMetaUrl","path","import_node_fs","import_node_path","formatIssuePath","path","getDirname","path","fs","rule"]}
1
+ {"version":3,"sources":["../node_modules/tsup/assets/cjs_shims.js","../packages/domain/shared/src/esmHelpers.ts","../packages/domain/shared/src/index.ts","../src/umbrella/rspack.ts","../packages/presentation/rspack/src/index.ts","../packages/presentation/rspack/src/schemas.ts"],"sourcesContent":["// Shim globals in cjs bundle\n// There's a weird bug that esbuild will always inject importMetaUrl\n// if we export it as `const importMetaUrl = ... __filename ...`\n// But using a function will not cause this issue\n\nconst getImportMetaUrl = () => \n typeof document === \"undefined\" \n ? new URL(`file:${__filename}`).href \n : (document.currentScript && document.currentScript.tagName.toUpperCase() === 'SCRIPT') \n ? document.currentScript.src \n : new URL(\"main.js\", document.baseURI).href;\n\nexport const importMetaUrl = /* @__PURE__ */ getImportMetaUrl()\n","/**\n * ESM-safe runtime helpers untuk monorepo.\n *\n * Menggantikan pola fragile seperti:\n * - `createRequire(import.meta.url)` → gunakan `createEsmRequire()`\n * - `__dirname` → gunakan `getDirname(import.meta.url)`\n * - `__filename` → gunakan `getFilename(import.meta.url)`\n *\n * Semua helper ini bekerja di ESM dan CJS.\n *\n * @module @tailwind-styled/shared/esmHelpers\n */\n\nconst isBrowser = typeof window !== \"undefined\" || typeof document !== \"undefined\"\n\n// Safe check for require availability - works in both CJS and ESM\nlet nodeModuleRef: typeof import(\"node:module\") | null = null\nfunction getNodeModuleRef(): typeof import(\"node:module\") | null {\n if (isBrowser) return null\n if (nodeModuleRef !== null) return nodeModuleRef\n try {\n const test = typeof require === 'function' ? (require('node:module') as typeof import(\"node:module\")) : null\n nodeModuleRef = test\n return test\n } catch {\n nodeModuleRef = null\n return null\n }\n}\n\nlet _nodePath: typeof import(\"node:path\") | null = null\nlet _nodeUrl: typeof import(\"node:url\") | null = null\nlet _nodeFs: typeof import(\"node:fs\") | null = null\nlet _nodeCrypto: typeof import(\"node:crypto\") | null = null\nlet _nodeOs: typeof import(\"node:os\") | null = null\n\n/**\n * Get current file URL in a way that works in both ESM and CJS.\n * In ESM: uses import.meta.url\n * In CJS: uses __filename converted to file URL\n */\nfunction getCurrentFileUrl(): string {\n // In CJS builds, import.meta.url is replaced by esbuild with __importMetaUrl\n // which is set via the banner polyfill. In ESM it's the real URL.\n if (import.meta.url) {\n return import.meta.url\n }\n // Fallback: __filename is available in bare CJS (not bundled)\n if (typeof __filename !== \"undefined\") {\n return `file://${__filename.replace(/\\\\/g, \"/\")}`\n }\n return \"file://unknown\"\n}\n\nfunction getNodePath(): typeof import(\"node:path\") {\n if (isBrowser) throw new Error(\"node:path not available in browser\")\n if (!_nodePath) {\n if (typeof require === \"function\") {\n _nodePath = require(\"node:path\") as typeof import(\"node:path\")\n } else {\n const nodeRequire = getNodeModuleRef()\n if (!nodeRequire) throw new Error(\"require not available\")\n _nodePath = nodeRequire.createRequire(getCurrentFileUrl())(\"node:path\") as typeof import(\"node:path\")\n }\n }\n return _nodePath!\n}\nfunction getNodeUrl(): typeof import(\"node:url\") {\n if (isBrowser) throw new Error(\"node:url not available in browser\")\n if (!_nodeUrl) {\n if (typeof require === \"function\") {\n _nodeUrl = require(\"node:url\") as typeof import(\"node:url\")\n } else {\n const nodeRequire = getNodeModuleRef()\n if (!nodeRequire) throw new Error(\"require not available\")\n _nodeUrl = nodeRequire.createRequire(getCurrentFileUrl())(\"node:url\") as typeof import(\"node:url\")\n }\n }\n return _nodeUrl!\n}\nfunction getNodeFs(): typeof import(\"node:fs\") {\n if (isBrowser) throw new Error(\"node:fs not available in browser\")\n if (!_nodeFs) {\n if (typeof require === \"function\") {\n _nodeFs = require(\"node:fs\") as typeof import(\"node:fs\")\n } else {\n const nodeRequire = getNodeModuleRef()\n if (!nodeRequire) throw new Error(\"require not available\")\n _nodeFs = nodeRequire.createRequire(getCurrentFileUrl())(\"node:fs\") as typeof import(\"node:fs\")\n }\n }\n return _nodeFs!\n}\nfunction getNodeCrypto(): typeof import(\"node:crypto\") {\n if (isBrowser) throw new Error(\"node:crypto not available in browser\")\n if (!_nodeCrypto) {\n if (typeof require === \"function\") {\n _nodeCrypto = require(\"node:crypto\") as typeof import(\"node:crypto\")\n } else {\n const nodeRequire = getNodeModuleRef()\n if (!nodeRequire) throw new Error(\"require not available\")\n _nodeCrypto = nodeRequire.createRequire(getCurrentFileUrl())(\"node:crypto\") as typeof import(\"node:crypto\")\n }\n }\n return _nodeCrypto!\n}\nfunction getNodeOs(): typeof import(\"node:os\") {\n if (isBrowser) throw new Error(\"node:os not available in browser\")\n if (!_nodeOs) {\n if (typeof require === \"function\") {\n _nodeOs = require(\"node:os\") as typeof import(\"node:os\")\n } else {\n const nodeRequire = getNodeModuleRef()\n if (!nodeRequire) throw new Error(\"require not available\")\n _nodeOs = nodeRequire.createRequire(getCurrentFileUrl())(\"node:os\") as typeof import(\"node:os\")\n }\n }\n return _nodeOs!\n}\n\n/**\n * Buat `require()` function yang relative terhadap sebuah ESM module.\n *\n * @example\n * const req = createEsmRequire(import.meta.url)\n * const mod = req(\"some-pkg\")\n */\nexport function createEsmRequire(importMetaUrl: string): NodeRequire {\n if (isBrowser) throw new Error(\"require not available in browser\")\n // CJS: require is already available globally\n if (typeof require === \"function\") return require\n const nodeRequire = getNodeModuleRef()\n if (!nodeRequire) throw new Error(\"require not available\")\n return nodeRequire.createRequire(importMetaUrl)\n}\n\n/**\n * Dapat `__dirname` dari `import.meta.url`.\n *\n * @example\n * const dir = getDirname(import.meta.url)\n */\nexport function getDirname(importMetaUrl: string): string {\n if (isBrowser) return \"\"\n // CJS: __dirname is directly available\n if (typeof __dirname !== \"undefined\") return __dirname\n const nodePath = getNodePath()\n const nodeUrl = getNodeUrl()\n return nodePath.dirname(nodeUrl.fileURLToPath(importMetaUrl))\n}\n\n/**\n * Dapat `__filename` dari `import.meta.url`.\n */\nexport function getFilename(importMetaUrl: string): string {\n if (isBrowser) return \"\"\n // CJS: __filename is directly available\n if (typeof __filename !== \"undefined\") return __filename\n return getNodeUrl().fileURLToPath(importMetaUrl)\n}\n\n/**\n * Resolve path dari root monorepo (bukan CWD).\n */\nexport function resolveFromRoot(...segments: string[]): string {\n if (isBrowser) return segments.join(\"/\")\n\n const nodePath = getNodePath()\n const nodeFs = getNodeFs()\n\n // Use __dirname in CJS, or getDirname with current file URL in ESM\n let dir = typeof __dirname !== \"undefined\"\n ? __dirname\n : getDirname(getCurrentFileUrl())\n\n for (let i = 0; i < 10; i++) {\n const pkgPath = nodePath.join(dir, \"package.json\")\n try {\n const pkg = JSON.parse(nodeFs.readFileSync(pkgPath, \"utf-8\"))\n if (pkg.workspaces) {\n return nodePath.resolve(dir, ...segments)\n }\n } catch { /* intentionally silent */ }\n dir = nodePath.dirname(dir)\n }\n return nodePath.resolve(process.cwd(), ...segments)\n}\n\n/**\n * Require sebuah module dengan fallback ke null jika tidak tersedia.\n */\nexport function tryRequire<T = unknown>(\n moduleName: string,\n importMetaUrl: string\n): T | null {\n if (isBrowser) return null\n try {\n return createEsmRequire(importMetaUrl)(moduleName) as T\n } catch { /* intentionally silent — optional dep */ }\n return null\n}\n\n/**\n * Resolve .node binary path yang cross-platform dan ESM-safe.\n */\nexport function resolveNativeNodePath(\n importMetaUrl: string,\n ...relativeSegments: string[]\n): string {\n if (isBrowser) return relativeSegments.join(\"/\")\n return getNodePath().resolve(getDirname(importMetaUrl), ...relativeSegments)\n}\n","import { createHash } from \"node:crypto\"\nimport fs from \"node:fs\"\nimport path from \"node:path\"\nimport { fileURLToPath } from \"node:url\"\nimport { createRequire } from \"node:module\"\n\n// Native-only: Node.js is always available. No browser fallback.\n\n// ─────────────────────────────────────────────────────────────────────────────\n// Types\n// ─────────────────────────────────────────────────────────────────────────────\n\nexport type TokenMap = Record<string, string>\n\nexport type VariantValue = string | number | boolean | undefined\n\nexport type VariantProps = Record<string, VariantValue>\n\nexport type HtmlTagName = keyof HTMLElementTagNameMap\n\nexport type CompoundCondition = Record<string, string | number | boolean>\n\nexport type VariantMatrix = Record<string, Array<string | number | boolean>>\n\n// ─────────────────────────────────────────────────────────────────────────────\n// Logging\n// ─────────────────────────────────────────────────────────────────────────────\n\nexport interface Logger {\n warn(...args: unknown[]): void\n debug(...args: unknown[]): void\n error(...args: unknown[]): void\n log(...args: unknown[]): void\n}\n\nexport function createLogger(namespace: string): Logger {\n const prefix = `[${namespace}]`\n return {\n warn(...args: unknown[]) {\n process.stderr.write(`${prefix} ${args.map(a => typeof a === \"string\" ? a : String(a)).join(\" \")}\\n`)\n },\n debug(...args: unknown[]) {\n process.stderr.write(`${prefix} ${args.map(a => typeof a === \"string\" ? a : String(a)).join(\" \")}\\n`)\n },\n error(...args: unknown[]) {\n process.stderr.write(`${prefix} ${args.map(a => typeof a === \"string\" ? a : String(a)).join(\" \")}\\n`)\n },\n log(...args: unknown[]) {\n process.stderr.write(`${prefix} ${args.map(a => typeof a === \"string\" ? a : String(a)).join(\" \")}\\n`)\n },\n }\n}\n\nexport function createDebugLogger(namespace: string, label?: string): (msg: string) => void {\n const prefix = label ? `[${namespace}:${label}]` : `[${namespace}]`\n return (msg: string) => {\n if (process.env.DEBUG?.includes(namespace) || process.env.TW_DEBUG) {\n console.debug(prefix, msg)\n }\n }\n}\n\n// ─────────────────────────────────────────────────────────────────────────────\n// Error handling\n// ─────────────────────────────────────────────────────────────────────────────\n\nexport type ErrorSource = \"rust\" | \"validation\" | \"compile\" | \"io\" | \"config\" | \"unknown\"\n\ntype ZodLikeIssue = {\n path?: readonly PropertyKey[]\n message?: string\n}\n\nfunction formatIssuePath(path?: readonly PropertyKey[]): string {\n if (!path || path.length === 0) return \"(root)\"\n return path\n .map((segment) =>\n typeof segment === \"symbol\" ? segment.description ?? segment.toString() : String(segment)\n )\n .join(\".\")\n}\n\nexport class TwError extends Error {\n /** @deprecated Gunakan source */\n public readonly domain: string\n public readonly source: ErrorSource\n public readonly code: string\n public readonly originalCause?: unknown\n\n constructor(domainOrSource: string, code: string, message: string, cause?: unknown) {\n super(message)\n this.name = \"TwError\"\n this.domain = domainOrSource\n this.source = domainOrSource as ErrorSource\n this.code = code\n this.originalCause = cause\n if (Error.captureStackTrace) Error.captureStackTrace(this, TwError)\n }\n\n static fromIo(code: string, message: string): TwError {\n return new TwError(\"io\", code, message)\n }\n\n static fromCompile(code: string, message: string): TwError {\n return new TwError(\"compile\", code, message)\n }\n\n static fromRust(err: { code?: string; message?: string } | Error | unknown): TwError {\n if (err instanceof TwError) return err\n if (err instanceof Error) return new TwError(\"rust\", \"RUST_ERROR\", err.message, err)\n if (err && typeof err === \"object\") {\n const e = err as { code?: string; message?: string }\n return new TwError(\"rust\", e.code ?? \"RUST_ERROR\", e.message ?? String(err), err)\n }\n return new TwError(\"rust\", \"RUST_ERROR\", String(err), err)\n }\n\n /** Buat TwError dari ZodError — dukung shape Zod v3 (`errors`) dan v4 (`issues`). */\n static fromZod(err: { issues?: ZodLikeIssue[]; errors?: ZodLikeIssue[] }): TwError {\n const first = err.issues?.[0] ?? err.errors?.[0]\n const path = formatIssuePath(first?.path)\n const message = first ? `${path}: ${first.message}` : \"Schema validation failed\"\n return new TwError(\"validation\", \"SCHEMA_VALIDATION_FAILED\", message, err)\n }\n\n static wrap(source: string, code: string, err: unknown): TwError {\n if (err instanceof TwError) return err\n if (err instanceof Error) return new TwError(source, code, err.message, err)\n return new TwError(source, code, String(err), err)\n }\n\n override toString(): string {\n return `TwError [${this.source}:${this.code}] ${this.message}`\n }\n\n toJSON(): { name: string; source: string; code: string; message: string } {\n return { name: this.name, source: this.source, code: this.code, message: this.message }\n }\n\n toCliMessage(): string {\n return `[${this.source.toUpperCase()}:${this.code}] ${this.message}`\n }\n}\n\nexport function wrapUnknownError(domain: string, code: string, error: unknown): TwError {\n return TwError.wrap(domain, code, error)\n}\n\nexport function isTwError(err: unknown): err is TwError {\n return err instanceof TwError\n}\n\n// ─────────────────────────────────────────────────────────────────────────────\n// Native binding resolution\n// ─────────────────────────────────────────────────────────────────────────────\n\nexport interface LoadNativeBindingOptions<T> {\n runtimeDir: string\n candidates: string[]\n isValid: (module: unknown) => module is T\n invalidExportMessage: string\n}\n\nexport interface LoadNativeBindingResult<T> {\n binding: T | null\n loadErrors: Array<{ path: string; message: string }>\n loadedPath?: string\n}\n\nexport function loadNativeBinding<T>(options: LoadNativeBindingOptions<T>): LoadNativeBindingResult<T> {\n const { runtimeDir, candidates, isValid } = options\n const loadErrors: Array<{ path: string; message: string }> = []\n\n for (const candidate of candidates) {\n const candidatePath = path.resolve(runtimeDir, candidate)\n try {\n if (!fs.existsSync(candidatePath) && !fs.existsSync(candidatePath + \".node\")) {\n continue\n }\n const mod = requireNativeModule(candidatePath)\n if (mod && isValid(mod)) {\n return { binding: mod, loadErrors, loadedPath: candidatePath }\n }\n loadErrors.push({ path: candidatePath, message: options.invalidExportMessage })\n } catch (e) {\n loadErrors.push({ path: candidatePath, message: e instanceof Error ? e.message : String(e) })\n }\n }\n\n return { binding: null, loadErrors }\n}\n\nconst _require = createRequire(\n typeof __filename !== \"undefined\"\n ? `file://${__filename}`\n : (import.meta.url ?? \"file://unknown\")\n)\n\nfunction requireNativeModule(p: string): unknown {\n return _require(p)\n}\n\nexport interface ResolveCandidatesOptions {\n runtimeDir?: string\n envVarNames?: string[]\n includeDefaultCandidates?: boolean\n enforceNodeExtensionForEnvPath?: boolean\n /** @deprecated — ignored, kept for backward compat */\n packageName?: string\n}\n\nexport function resolveNativeBindingCandidates(options: ResolveCandidatesOptions): string[] {\n const {\n envVarNames = [\"TW_NATIVE_PATH\", \"TWS_NATIVE_PATH\"],\n includeDefaultCandidates = true,\n enforceNodeExtensionForEnvPath = false,\n } = options\n // Default ke cwd kalau runtimeDir tidak disediakan\n const runtimeDir = options.runtimeDir || process.cwd()\n const candidates: string[] = []\n\n for (const envVar of envVarNames) {\n const envPath = process.env[envVar]\n if (envPath) {\n candidates.push(enforceNodeExtensionForEnvPath && !envPath.endsWith(\".node\") ? envPath + \".node\" : envPath)\n }\n }\n\n if (!includeDefaultCandidates) return candidates\n\n if (fs.existsSync(runtimeDir)) {\n try {\n for (const entry of fs.readdirSync(runtimeDir)) {\n if (entry.endsWith(\".node\")) candidates.push(entry)\n }\n } catch { /* ignore read errors */ }\n }\n\n const BINARY_NAMES = [\"tailwind-styled-native\", \"tailwind_styled_parser\"]\n const napiPlatform = process.platform === \"linux\" && process.arch === \"x64\" ? \"linux-x64-gnu\"\n : process.platform === \"linux\" && process.arch === \"arm64\" ? \"linux-arm64-gnu\"\n : `${process.platform}-${process.arch}`\n\n for (const bin of BINARY_NAMES) {\n candidates.push(path.resolve(runtimeDir, `${bin}.node`))\n candidates.push(path.resolve(runtimeDir, `${bin}.${napiPlatform}.node`))\n // 1 level: dist/ → package-root/native/ (published npm package)\n candidates.push(path.resolve(runtimeDir, \"..\", \"native\", `${bin}.node`))\n candidates.push(path.resolve(runtimeDir, \"..\", \"native\", `${bin}.${napiPlatform}.node`))\n // cwd fallback (user project root)\n candidates.push(path.resolve(process.cwd(), \"native\", `${bin}.node`))\n candidates.push(path.resolve(process.cwd(), \"native\", `${bin}.${napiPlatform}.node`))\n // 4 level: dist/ → package/ → domain/ → packages/ → repo-root/ (monorepo dev)\n candidates.push(path.resolve(runtimeDir, \"..\", \"..\", \"..\", \"..\", \"native\", `${bin}.node`))\n candidates.push(path.resolve(runtimeDir, \"..\", \"..\", \"..\", \"..\", \"native\", `${bin}.${napiPlatform}.node`))\n // 3 level fallback\n candidates.push(path.resolve(runtimeDir, \"..\", \"..\", \"..\", \"native\", `${bin}.node`))\n }\n\n return Array.from(new Set(candidates))\n}\n\nexport function resolveRuntimeDir(dir: string | undefined, importMetaUrl: string): string {\n if (dir) return path.resolve(dir)\n try {\n return path.dirname(fileURLToPath(importMetaUrl))\n } catch {\n return process.cwd()\n }\n}\n\n// ─────────────────────────────────────────────────────────────────────────────\n// Hashing\n// ─────────────────────────────────────────────────────────────────────────────\n\nexport function hashContent(content: string, algorithm: string = \"md5\", length?: number): string {\n const hash = createHash(algorithm).update(content).digest(\"hex\")\n return length ? hash.slice(0, length) : hash\n}\n\n// ─────────────────────────────────────────────────────────────────────────────\n// Error formatting\n// ─────────────────────────────────────────────────────────────────────────────\n\nexport function formatErrorMessage(error: unknown): string {\n if (error instanceof TwError) return error.toString()\n if (error instanceof Error) return error.message\n return String(error)\n}\n\n// ─────────────────────────────────────────────────────────────────────────────\n// LRU Cache\n// ─────────────────────────────────────────────────────────────────────────────\n\nexport class LRUCache<K, V> {\n private capacity: number\n private cache: Map<K, V>\n\n constructor(capacity: number) {\n this.capacity = capacity\n this.cache = new Map()\n }\n\n get(key: K): V | undefined {\n if (!this.cache.has(key)) return undefined\n const value = this.cache.get(key)!\n this.cache.delete(key)\n this.cache.set(key, value)\n return value\n }\n\n set(key: K, value: V): void {\n if (this.cache.has(key)) {\n this.cache.delete(key)\n } else if (this.cache.size >= this.capacity) {\n const firstKey = this.cache.keys().next().value\n if (firstKey !== undefined) {\n this.cache.delete(firstKey)\n }\n }\n this.cache.set(key, value)\n }\n\n delete(key: K): boolean {\n return this.cache.delete(key)\n }\n\n has(key: K): boolean {\n return this.cache.has(key)\n }\n\n clear(): void {\n this.cache.clear()\n }\n\n entries(): IterableIterator<[K, V]> {\n return this.cache.entries()\n }\n\n get size(): number {\n return this.cache.size\n }\n}\n\n// ─────────────────────────────────────────────────────────────────────────────\n// Trace Utilities\n// ─────────────────────────────────────────────────────────────────────────────\n\nexport type { TraceSnapshot, TraceSummary } from \"./trace\"\nexport {\n getHealthColor,\n getModeColor,\n formatMemory,\n formatDuration,\n calculateHealth,\n getBuildTimeColor,\n getMemoryColor,\n createTraceSnapshot,\n getPipelinePercentages,\n} from \"./trace\"\n\n// ─────────────────────────────────────────────────────────────────────────────\n// Performance Telemetry\n// ─────────────────────────────────────────────────────────────────────────────\n\n\n\n// ─────────────────────────────────────────────────────────────────────────────\n// Error Codes\n// ─────────────────────────────────────────────────────────────────────────────\n\nexport type { ErrorCode } from \"./error-codes\"\nexport { ERROR_CODES, getSuggestion, formatErrorCode } from \"./error-codes\"\n\n// ─────────────────────────────────────────────────────────────────────────────\n// Tailwind Compatibility\n// ─────────────────────────────────────────────────────────────────────────────\n\nexport type { TailwindInfo } from \"./compatibility\"\nexport { detectTailwind, assertTailwindV4, getTailwindVersion, isTailwindV4 } from \"./compatibility\"\n\n// ── Native binding schemas (Zod boundary validation)\nexport {\n NativeScanFileSchema, NativeScanResultSchema,\n NativeAnalyzerReportSchema, NativeTransformResultSchema,\n NativeCssCompileResultSchema, NativeWatchResultSchema,\n NativeCacheEntrySchema, NativeCacheReadResultSchema,\n safeParseNative, parseNative,\n} from './native-schemas'\n\n// ── ESM-safe runtime helpers ──────────────────────────────────────────────\nexport {\n createEsmRequire,\n getDirname,\n getFilename,\n resolveFromRoot,\n tryRequire,\n resolveNativeNodePath,\n} from \"./esmHelpers\"\n\n// ── Performance telemetry ────────────────────────────────────────────────────\nexport {\n TelemetryCollector,\n getGlobalTelemetry,\n resetGlobalTelemetry,\n createBuildTimer,\n type BuildTelemetry,\n type TelemetrySummary,\n type BuildPhases,\n} from \"./telemetry\"\n\n// ── Config/JSON schema validation ─────────────────────────────────────────────\nexport {\n ScanCacheSchema,\n ScanCacheClassEntrySchema,\n TailwindConfigSchema,\n RegistryPluginEntrySchema,\n RegistryFileSchema,\n PackageJsonSchema,\n parseJsonWithSchema,\n parseJsonFileWithSchema,\n type ScanCache,\n type ScanCacheClassEntry,\n type TailwindConfig,\n type RegistryPluginEntry,\n type RegistryFile,\n type PackageJson,\n} from \"./configSchemas\"\n\n// ── Worker/bootstrap path resolution ─────────────────────────────────────────\nexport {\n resolveWorkerPath,\n resolveLoaderPath,\n type WorkerPathOptions,\n type WorkerPathResult,\n} from \"./workerResolver\"\n\n// ── Codegen helpers ───────────────────────────────────────────────────────────\nexport {\n generateComponentCode,\n generateStorybookStory,\n generateClassRenameCodemod,\n generateBarrelFile,\n type ComponentCodegenOptions,\n} from \"./codegen\"\n\n// ── Native binary resolution (QA #1) ─────────────────────────────────────────\nexport {\n resolveNativeBinary,\n formatNativeNotFoundError,\n type NativeResolutionResult,\n} from \"./native-resolution\"\n\n// ── Shared observability contract ────────────────────────────────────────────\nexport {\n createObservabilityClient,\n type ClassInspection,\n type ClassProperty,\n type ClassUsageLocation,\n type BuildTrace,\n type BuildPhaseTrace,\n type DashboardMetrics,\n type DashboardSummary,\n type ObservabilityClient,\n} from \"./observability\"\n\nexport {\n TW_STATE_STATIC_FILENAME,\n extractStaticStateCss,\n appendStaticStateCssToSafelist,\n type TwStateConfigEntry,\n type StaticStateCssInput,\n type GeneratedStateRule,\n type StaticStateExtractionResult,\n} from \"./staticStateExtractor\"\nexport { setGlobalLogFile } from \"./logger\"","export * from \"@tailwind-styled/rspack\"\n","/**\n * tailwind-styled-v4 - Rspack Plugin v5 (stable)\n *\n * Usage:\n * import { tailwindStyledRspackPlugin } from \"@tailwind-styled/rspack\"\n *\n * export default defineConfig({\n * plugins: [tailwindStyledRspackPlugin()],\n * })\n *\n * v5:\n * - Simplified API\n * - Mode always zero-runtime\n */\n\nimport fs from \"node:fs\"\nimport path from \"node:path\"\nimport { getDirname as getEsmDirname } from \"@tailwind-styled/shared\"\n\nimport { parseRspackPluginOptions } from \"./schemas\"\n\nfunction getDirname(): string {\n if (typeof __dirname !== \"undefined\") {\n return __dirname\n }\n if (typeof import.meta !== \"undefined\" && import.meta.url) {\n return getEsmDirname(import.meta.url)\n }\n return process.cwd()\n}\n\nfunction resolveLoaderPath(basename: string): string {\n const runtimeDir = getDirname()\n const preferredExtensions =\n typeof __dirname !== \"undefined\" && __dirname.length > 0 ? [\".cjs\", \".js\"] : [\".js\", \".cjs\"]\n\n for (const ext of preferredExtensions) {\n const candidate = path.resolve(runtimeDir, `${basename}${ext}`)\n if (fs.existsSync(candidate)) return candidate\n }\n\n return path.resolve(runtimeDir, `${basename}.js`)\n}\n\ninterface RspackRule {\n _tailwindStyledRspackMarker?: boolean\n test?: RegExp\n exclude?: RegExp\n use?: Array<{\n loader: string\n options: {\n mode: \"zero-runtime\"\n addDataAttr: boolean\n preserveImports: boolean\n safelistPath?: string\n }\n }>\n}\n\ninterface RspackCompiler {\n options: {\n mode?: string\n module?: {\n rules?: RspackRule[]\n }\n }\n}\n\nexport interface RspackPluginOptions {\n /** File patterns to include. Default: /\\.[jt]sx?$/ */\n include?: RegExp\n /** File patterns to exclude. Default: /node_modules/ */\n exclude?: RegExp\n /** Add data-tw debug attributes in dev. Default: true in dev */\n addDataAttr?: boolean\n /** Enable analyzer. Default: false */\n analyze?: boolean\n /**\n * Path ke safelist CSS file.\n * `_tw-state-static.css` ditulis di direktori yang sama.\n * Default: `<cwd>/__tw_safelist.css`\n */\n safelistPath?: string\n}\n\nexport class TailwindStyledRspackPlugin {\n private opts: RspackPluginOptions\n\n constructor(opts: RspackPluginOptions = {}) {\n this.opts = parseRspackPluginOptions(opts)\n }\n\n apply(compiler: RspackCompiler): void {\n const isDev = compiler.options.mode !== \"production\"\n const loaderPath = resolveLoaderPath(\"loader\")\n const existing = compiler.options.module?.rules ?? []\n const alreadyRegistered = existing.some(\n (rule) =>\n typeof rule === \"object\" && rule !== null && rule._tailwindStyledRspackMarker === true\n )\n\n if (alreadyRegistered) return\n\n const safelistPath =\n this.opts.safelistPath ?? path.join(process.cwd(), \"__tw_safelist.css\")\n\n // Tulis placeholder agar @import di CSS entry tidak error saat cold start\n const stateStaticPath = path.join(path.dirname(safelistPath), \"_tw-state-static.css\")\n if (!fs.existsSync(stateStaticPath)) {\n try {\n fs.mkdirSync(path.dirname(stateStaticPath), { recursive: true })\n fs.writeFileSync(\n stateStaticPath,\n `/* _tw-state-static.css — Auto-generated by tailwind-styled-v4. DO NOT EDIT.\\n` +\n ` * Import di CSS entry: @import \"./_tw-state-static.css\";\\n` +\n ` */\\n`,\n \"utf-8\"\n )\n } catch { /* non-fatal */ }\n }\n\n const rule: RspackRule = {\n _tailwindStyledRspackMarker: true,\n test: this.opts.include ?? /\\.[jt]sx?$/,\n exclude: this.opts.exclude ?? /node_modules/,\n use: [\n {\n loader: loaderPath,\n options: {\n mode: \"zero-runtime\",\n addDataAttr: this.opts.addDataAttr ?? isDev,\n preserveImports: true,\n safelistPath,\n },\n },\n ],\n }\n\n compiler.options.module = {\n ...(compiler.options.module ?? {}),\n rules: [rule, ...existing],\n }\n }\n}\n\nexport function tailwindStyledRspackPlugin(\n opts: RspackPluginOptions = {}\n): TailwindStyledRspackPlugin {\n return new TailwindStyledRspackPlugin(opts)\n}\n\nexport default tailwindStyledRspackPlugin\n\nexport {\n parseRspackPluginOptions,\n type RspackPluginOptionsInput,\n RspackPluginOptionsSchema,\n} from \"./schemas\"\n","import { z } from \"zod\"\nimport { TwError } from \"@tailwind-styled/shared\"\n\nconst formatIssuePath = (path: readonly PropertyKey[]): string =>\n path.length > 0\n ? path\n .map((segment) =>\n typeof segment === \"symbol\" ? segment.description ?? segment.toString() : String(segment)\n )\n .join(\".\")\n : \"<root>\"\n\nconst formatIssues = (error: z.ZodError): string =>\n error.issues\n .map((issue) => {\n const p = formatIssuePath(issue.path)\n return `${p}: ${issue.message}`\n })\n .join(\"; \")\n\nconst parseWithSchema = <T>(schema: z.ZodType<T>, data: unknown, label: string): T => {\n const parsed = schema.safeParse(data)\n if (parsed.success) return parsed.data\n const details = formatIssues(parsed.error)\n throw new TwError(\n \"validation\",\n \"SCHEMA_VALIDATION_FAILED\",\n details ? `${label}: ${details}` : label,\n parsed.error\n )\n}\n\nexport const RspackPluginOptionsSchema = z.object({\n include: z.instanceof(RegExp).optional(),\n exclude: z.instanceof(RegExp).optional(),\n addDataAttr: z.boolean().optional(),\n analyze: z.boolean().optional(),\n cssEntry: z.string().optional(),\n /** Path ke safelist CSS file. Default: <cwd>/__tw_safelist.css */\n safelistPath: z.string().optional(),\n})\n\nexport type RspackPluginOptionsInput = z.infer<typeof RspackPluginOptionsSchema>\n\nexport const parseRspackPluginOptions = (options: unknown) =>\n parseWithSchema(RspackPluginOptionsSchema, options ?? {}, \"rspack plugin options are invalid\")\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,IAKM,kBAOO;AAZb;AAAA;AAAA;AAKA,IAAM,mBAAmB,MACvB,OAAO,aAAa,cAChB,IAAI,IAAI,QAAQ,UAAU,EAAE,EAAE,OAC7B,SAAS,iBAAiB,SAAS,cAAc,QAAQ,YAAY,MAAM,WAC1E,SAAS,cAAc,MACvB,IAAI,IAAI,WAAW,SAAS,OAAO,EAAE;AAEtC,IAAM,gBAAgC,iCAAiB;AAAA;AAAA;;;ACK9D,SAAS,mBAAwD;AAC/D,MAAI,UAAW,QAAO;AACtB,MAAI,kBAAkB,KAAM,QAAO;AACnC,MAAI;AACF,UAAM,OAAO,OAAO,YAAY,aAAc,QAAQ,QAAa,IAAqC;AACxG,oBAAgB;AAChB,WAAO;AAAA,EACT,QAAQ;AACN,oBAAgB;AAChB,WAAO;AAAA,EACT;AACF;AAaA,SAAS,oBAA4B;AAGnC,MAAI,eAAiB;AACnB,WAAO;AAAA,EACT;AAEA,MAAI,OAAO,eAAe,aAAa;AACrC,WAAO,UAAU,WAAW,QAAQ,OAAO,GAAG,CAAC;AAAA,EACjD;AACA,SAAO;AACT;AAEA,SAAS,cAA0C;AACjD,MAAI,UAAW,OAAM,IAAI,MAAM,oCAAoC;AACnE,MAAI,CAAC,WAAW;AACd,QAAI,OAAO,YAAY,YAAY;AACjC,kBAAY,QAAQ,MAAW;AAAA,IACjC,OAAO;AACL,YAAM,cAAc,iBAAiB;AACrC,UAAI,CAAC,YAAa,OAAM,IAAI,MAAM,uBAAuB;AACzD,kBAAY,YAAY,cAAc,kBAAkB,CAAC,EAAE,WAAW;AAAA,IACxE;AAAA,EACF;AACA,SAAO;AACT;AACA,SAAS,aAAwC;AAC/C,MAAI,UAA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AAS,QAAQA,MAAK,gCAAgC;AAAA,IACtF;AAEA,QAAI,kBAAmB;AAEvB,UAAM,eACJ,KAAK,KAAK,gBAAgB,kBAAAF,QAAK,KAAK,QAAQ,IAAI,GAAG,mBAAmB;AAGxE,UAAM,kBAAkB,kBAAAA,QAAK,KAAK,kBAAAA,QAAK,QAAQ,YAAY,GAAG,sBAAsB;AACpF,QAAI,CAAC,gBAAAC,QAAG,WAAW,eAAe,GAAG;AACnC,UAAI;AACF,wBAAAA,QAAG,UAAU,kBAAAD,QAAK,QAAQ,eAAe,GAAG,EAAE,WAAW,KAAK,CAAC;AAC/D,wBAAAC,QAAG;AAAA,UACD;AAAA,UACA;AAAA;AAAA;AAAA;AAAA,UAGA;AAAA,QACF;AAAA,MACF,QAAQ;AAAA,MAAkB;AAAA,IAC5B;AAEA,UAAM,OAAmB;AAAA,MACvB,6BAA6B;AAAA,MAC7B,MAAM,KAAK,KAAK,WAAW;AAAA,MAC3B,SAAS,KAAK,KAAK,WAAW;AAAA,MAC9B,KAAK;AAAA,QACH;AAAA,UACE,QAAQ;AAAA,UACR,SAAS;AAAA,YACP,MAAM;AAAA,YACN,aAAa,KAAK,KAAK,eAAe;AAAA,YACtC,iBAAiB;AAAA,YACjB;AAAA,UACF;AAAA,QACF;AAAA,MACF;AAAA,IACF;AAEA,aAAS,QAAQ,SAAS;AAAA,MACxB,GAAI,SAAS,QAAQ,UAAU,CAAC;AAAA,MAChC,OAAO,CAAC,MAAM,GAAG,QAAQ;AAAA,IAC3B;AAAA,EACF;AACF;AAEO,SAAS,2BACd,OAA4B,CAAC,GACD;AAC5B,SAAO,IAAI,2BAA2B,IAAI;AAC5C;","names":["importMetaUrl","path","import_node_fs","import_node_path","formatIssuePath","path","getDirname","path","fs","rule"]}
package/dist/rspack.mjs CHANGED
@@ -1,4 +1,3 @@
1
- /* tailwind-styled-v4 v5.0.4 | MIT | https://github.com/dictionar32/tailwind-styled-v4 */
2
1
  var __getOwnPropNames = Object.getOwnPropertyNames;
3
2
  var __require = /* @__PURE__ */ ((x) => typeof require !== "undefined" ? require : typeof Proxy !== "undefined" ? new Proxy(x, {
4
3
  get: (a, b) => (typeof require !== "undefined" ? require : a)[b]
@@ -288,4 +287,5 @@ export {
288
287
  parseRspackPluginOptions,
289
288
  tailwindStyledRspackPlugin
290
289
  };
290
+ /* tailwind-styled-v4 v5.1.9 | MIT | https://github.com/dictionar32/tailwind-styled-v4 */
291
291
  //# sourceMappingURL=rspack.mjs.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../node_modules/tsup/assets/esm_shims.js","../packages/domain/shared/src/esmHelpers.ts","../packages/domain/shared/src/index.ts","../src/umbrella/rspack.ts","../packages/presentation/rspack/src/index.ts","../packages/presentation/rspack/src/schemas.ts"],"sourcesContent":["// Shim globals in esm bundle\nimport path from 'node:path'\nimport { fileURLToPath } from 'node:url'\n\nconst getFilename = () => fileURLToPath(import.meta.url)\nconst getDirname = () => path.dirname(getFilename())\n\nexport const __dirname = /* @__PURE__ */ getDirname()\nexport const __filename = /* @__PURE__ */ getFilename()\n","/**\n * ESM-safe runtime helpers untuk monorepo.\n *\n * Menggantikan pola fragile seperti:\n * - `createRequire(import.meta.url)` → gunakan `createEsmRequire()`\n * - `__dirname` → gunakan `getDirname(import.meta.url)`\n * - `__filename` → gunakan `getFilename(import.meta.url)`\n *\n * Semua helper ini bekerja di ESM dan CJS.\n *\n * @module @tailwind-styled/shared/esmHelpers\n */\n\nconst isBrowser = typeof window !== \"undefined\" || typeof document !== \"undefined\"\n\n// Safe check for require availability - works in both CJS and ESM\nlet nodeModuleRef: typeof import(\"node:module\") | null = null\nfunction getNodeModuleRef(): typeof import(\"node:module\") | null {\n if (isBrowser) return null\n if (nodeModuleRef !== null) return nodeModuleRef\n try {\n const test = typeof require === 'function' ? (require('node:module') as typeof import(\"node:module\")) : null\n nodeModuleRef = test\n return test\n } catch {\n nodeModuleRef = null\n return null\n }\n}\n\nlet _nodePath: typeof import(\"node:path\") | null = null\nlet _nodeUrl: typeof import(\"node:url\") | null = null\nlet _nodeFs: typeof import(\"node:fs\") | null = null\nlet _nodeCrypto: typeof import(\"node:crypto\") | null = null\nlet _nodeOs: typeof import(\"node:os\") | null = null\n\n/**\n * Get current file URL in a way that works in both ESM and CJS.\n * In ESM: uses import.meta.url\n * In CJS: uses __filename converted to file URL\n */\nfunction getCurrentFileUrl(): string {\n // In CJS builds, import.meta.url is replaced by esbuild with __importMetaUrl\n // which is set via the banner polyfill. In ESM it's the real URL.\n if (import.meta.url) {\n return import.meta.url\n }\n // Fallback: __filename is available in bare CJS (not bundled)\n if (typeof __filename !== \"undefined\") {\n return `file://${__filename.replace(/\\\\/g, \"/\")}`\n }\n return \"file://unknown\"\n}\n\nfunction getNodePath(): typeof import(\"node:path\") {\n if (isBrowser) throw new Error(\"node:path not available in browser\")\n if (!_nodePath) {\n if (typeof require === \"function\") {\n _nodePath = require(\"node:path\") as typeof import(\"node:path\")\n } else {\n const nodeRequire = getNodeModuleRef()\n if (!nodeRequire) throw new Error(\"require not available\")\n _nodePath = nodeRequire.createRequire(getCurrentFileUrl())(\"node:path\") as typeof import(\"node:path\")\n }\n }\n return _nodePath!\n}\nfunction getNodeUrl(): typeof import(\"node:url\") {\n if (isBrowser) throw new Error(\"node:url not available in browser\")\n if (!_nodeUrl) {\n if (typeof require === \"function\") {\n _nodeUrl = require(\"node:url\") as typeof import(\"node:url\")\n } else {\n const nodeRequire = getNodeModuleRef()\n if (!nodeRequire) throw new Error(\"require not available\")\n _nodeUrl = nodeRequire.createRequire(getCurrentFileUrl())(\"node:url\") as typeof import(\"node:url\")\n }\n }\n return _nodeUrl!\n}\nfunction getNodeFs(): typeof import(\"node:fs\") {\n if (isBrowser) throw new Error(\"node:fs not available in browser\")\n if (!_nodeFs) {\n if (typeof require === \"function\") {\n _nodeFs = require(\"node:fs\") as typeof import(\"node:fs\")\n } else {\n const nodeRequire = getNodeModuleRef()\n if (!nodeRequire) throw new Error(\"require not available\")\n _nodeFs = nodeRequire.createRequire(getCurrentFileUrl())(\"node:fs\") as typeof import(\"node:fs\")\n }\n }\n return _nodeFs!\n}\nfunction getNodeCrypto(): typeof import(\"node:crypto\") {\n if (isBrowser) throw new Error(\"node:crypto not available in browser\")\n if (!_nodeCrypto) {\n if (typeof require === \"function\") {\n _nodeCrypto = require(\"node:crypto\") as typeof import(\"node:crypto\")\n } else {\n const nodeRequire = getNodeModuleRef()\n if (!nodeRequire) throw new Error(\"require not available\")\n _nodeCrypto = nodeRequire.createRequire(getCurrentFileUrl())(\"node:crypto\") as typeof import(\"node:crypto\")\n }\n }\n return _nodeCrypto!\n}\nfunction getNodeOs(): typeof import(\"node:os\") {\n if (isBrowser) throw new Error(\"node:os not available in browser\")\n if (!_nodeOs) {\n if (typeof require === \"function\") {\n _nodeOs = require(\"node:os\") as typeof import(\"node:os\")\n } else {\n const nodeRequire = getNodeModuleRef()\n if (!nodeRequire) throw new Error(\"require not available\")\n _nodeOs = nodeRequire.createRequire(getCurrentFileUrl())(\"node:os\") as typeof import(\"node:os\")\n }\n }\n return _nodeOs!\n}\n\n/**\n * Buat `require()` function yang relative terhadap sebuah ESM module.\n *\n * @example\n * const req = createEsmRequire(import.meta.url)\n * const mod = req(\"some-pkg\")\n */\nexport function createEsmRequire(importMetaUrl: string): NodeRequire {\n if (isBrowser) throw new Error(\"require not available in browser\")\n // CJS: require is already available globally\n if (typeof require === \"function\") return require\n const nodeRequire = getNodeModuleRef()\n if (!nodeRequire) throw new Error(\"require not available\")\n return nodeRequire.createRequire(importMetaUrl)\n}\n\n/**\n * Dapat `__dirname` dari `import.meta.url`.\n *\n * @example\n * const dir = getDirname(import.meta.url)\n */\nexport function getDirname(importMetaUrl: string): string {\n if (isBrowser) return \"\"\n // CJS: __dirname is directly available\n if (typeof __dirname !== \"undefined\") return __dirname\n const nodePath = getNodePath()\n const nodeUrl = getNodeUrl()\n return nodePath.dirname(nodeUrl.fileURLToPath(importMetaUrl))\n}\n\n/**\n * Dapat `__filename` dari `import.meta.url`.\n */\nexport function getFilename(importMetaUrl: string): string {\n if (isBrowser) return \"\"\n // CJS: __filename is directly available\n if (typeof __filename !== \"undefined\") return __filename\n return getNodeUrl().fileURLToPath(importMetaUrl)\n}\n\n/**\n * Resolve path dari root monorepo (bukan CWD).\n */\nexport function resolveFromRoot(...segments: string[]): string {\n if (isBrowser) return segments.join(\"/\")\n\n const nodePath = getNodePath()\n const nodeFs = getNodeFs()\n\n // Use __dirname in CJS, or getDirname with current file URL in ESM\n let dir = typeof __dirname !== \"undefined\"\n ? __dirname\n : getDirname(getCurrentFileUrl())\n\n for (let i = 0; i < 10; i++) {\n const pkgPath = nodePath.join(dir, \"package.json\")\n try {\n const pkg = JSON.parse(nodeFs.readFileSync(pkgPath, \"utf-8\"))\n if (pkg.workspaces) {\n return nodePath.resolve(dir, ...segments)\n }\n } catch { /* intentionally silent */ }\n dir = nodePath.dirname(dir)\n }\n return nodePath.resolve(process.cwd(), ...segments)\n}\n\n/**\n * Require sebuah module dengan fallback ke null jika tidak tersedia.\n */\nexport function tryRequire<T = unknown>(\n moduleName: string,\n importMetaUrl: string\n): T | null {\n if (isBrowser) return null\n try {\n return createEsmRequire(importMetaUrl)(moduleName) as T\n } catch { /* intentionally silent — optional dep */ }\n return null\n}\n\n/**\n * Resolve .node binary path yang cross-platform dan ESM-safe.\n */\nexport function resolveNativeNodePath(\n importMetaUrl: string,\n ...relativeSegments: string[]\n): string {\n if (isBrowser) return relativeSegments.join(\"/\")\n return getNodePath().resolve(getDirname(importMetaUrl), ...relativeSegments)\n}\n","import { createHash } from \"node:crypto\"\nimport fs from \"node:fs\"\nimport path from \"node:path\"\nimport { fileURLToPath } from \"node:url\"\nimport { createRequire } from \"node:module\"\n\n// Native-only: Node.js is always available. No browser fallback.\n\n// ─────────────────────────────────────────────────────────────────────────────\n// Types\n// ─────────────────────────────────────────────────────────────────────────────\n\nexport type TokenMap = Record<string, string>\n\nexport type VariantValue = string | number | boolean | undefined\n\nexport type VariantProps = Record<string, VariantValue>\n\nexport type HtmlTagName = keyof HTMLElementTagNameMap\n\nexport type CompoundCondition = Record<string, string | number | boolean>\n\nexport type VariantMatrix = Record<string, Array<string | number | boolean>>\n\n// ─────────────────────────────────────────────────────────────────────────────\n// Logging\n// ─────────────────────────────────────────────────────────────────────────────\n\nexport interface Logger {\n warn(...args: unknown[]): void\n debug(...args: unknown[]): void\n error(...args: unknown[]): void\n log(...args: unknown[]): void\n}\n\nexport function createLogger(namespace: string): Logger {\n const prefix = `[${namespace}]`\n return {\n warn(...args: unknown[]) {\n process.stderr.write(`${prefix} ${args.map(a => typeof a === \"string\" ? a : String(a)).join(\" \")}\\n`)\n },\n debug(...args: unknown[]) {\n process.stderr.write(`${prefix} ${args.map(a => typeof a === \"string\" ? a : String(a)).join(\" \")}\\n`)\n },\n error(...args: unknown[]) {\n process.stderr.write(`${prefix} ${args.map(a => typeof a === \"string\" ? a : String(a)).join(\" \")}\\n`)\n },\n log(...args: unknown[]) {\n process.stderr.write(`${prefix} ${args.map(a => typeof a === \"string\" ? a : String(a)).join(\" \")}\\n`)\n },\n }\n}\n\nexport function createDebugLogger(namespace: string, label?: string): (msg: string) => void {\n const prefix = label ? `[${namespace}:${label}]` : `[${namespace}]`\n return (msg: string) => {\n if (process.env.DEBUG?.includes(namespace) || process.env.TW_DEBUG) {\n console.debug(prefix, msg)\n }\n }\n}\n\n// ─────────────────────────────────────────────────────────────────────────────\n// Error handling\n// ─────────────────────────────────────────────────────────────────────────────\n\nexport type ErrorSource = \"rust\" | \"validation\" | \"compile\" | \"io\" | \"config\" | \"unknown\"\n\ntype ZodLikeIssue = {\n path?: readonly PropertyKey[]\n message?: string\n}\n\nfunction formatIssuePath(path?: readonly PropertyKey[]): string {\n if (!path || path.length === 0) return \"(root)\"\n return path\n .map((segment) =>\n typeof segment === \"symbol\" ? segment.description ?? segment.toString() : String(segment)\n )\n .join(\".\")\n}\n\nexport class TwError extends Error {\n /** @deprecated Gunakan source */\n public readonly domain: string\n public readonly source: ErrorSource\n public readonly code: string\n public readonly originalCause?: unknown\n\n constructor(domainOrSource: string, code: string, message: string, cause?: unknown) {\n super(message)\n this.name = \"TwError\"\n this.domain = domainOrSource\n this.source = domainOrSource as ErrorSource\n this.code = code\n this.originalCause = cause\n if (Error.captureStackTrace) Error.captureStackTrace(this, TwError)\n }\n\n static fromIo(code: string, message: string): TwError {\n return new TwError(\"io\", code, message)\n }\n\n static fromCompile(code: string, message: string): TwError {\n return new TwError(\"compile\", code, message)\n }\n\n static fromRust(err: { code?: string; message?: string } | Error | unknown): TwError {\n if (err instanceof TwError) return err\n if (err instanceof Error) return new TwError(\"rust\", \"RUST_ERROR\", err.message, err)\n if (err && typeof err === \"object\") {\n const e = err as { code?: string; message?: string }\n return new TwError(\"rust\", e.code ?? \"RUST_ERROR\", e.message ?? String(err), err)\n }\n return new TwError(\"rust\", \"RUST_ERROR\", String(err), err)\n }\n\n /** Buat TwError dari ZodError — dukung shape Zod v3 (`errors`) dan v4 (`issues`). */\n static fromZod(err: { issues?: ZodLikeIssue[]; errors?: ZodLikeIssue[] }): TwError {\n const first = err.issues?.[0] ?? err.errors?.[0]\n const path = formatIssuePath(first?.path)\n const message = first ? `${path}: ${first.message}` : \"Schema validation failed\"\n return new TwError(\"validation\", \"SCHEMA_VALIDATION_FAILED\", message, err)\n }\n\n static wrap(source: string, code: string, err: unknown): TwError {\n if (err instanceof TwError) return err\n if (err instanceof Error) return new TwError(source, code, err.message, err)\n return new TwError(source, code, String(err), err)\n }\n\n override toString(): string {\n return `TwError [${this.source}:${this.code}] ${this.message}`\n }\n\n toJSON(): { name: string; source: string; code: string; message: string } {\n return { name: this.name, source: this.source, code: this.code, message: this.message }\n }\n\n toCliMessage(): string {\n return `[${this.source.toUpperCase()}:${this.code}] ${this.message}`\n }\n}\n\nexport function wrapUnknownError(domain: string, code: string, error: unknown): TwError {\n return TwError.wrap(domain, code, error)\n}\n\nexport function isTwError(err: unknown): err is TwError {\n return err instanceof TwError\n}\n\n// ─────────────────────────────────────────────────────────────────────────────\n// Native binding resolution\n// ─────────────────────────────────────────────────────────────────────────────\n\nexport interface LoadNativeBindingOptions<T> {\n runtimeDir: string\n candidates: string[]\n isValid: (module: unknown) => module is T\n invalidExportMessage: string\n}\n\nexport interface LoadNativeBindingResult<T> {\n binding: T | null\n loadErrors: Array<{ path: string; message: string }>\n loadedPath?: string\n}\n\nexport function loadNativeBinding<T>(options: LoadNativeBindingOptions<T>): LoadNativeBindingResult<T> {\n const { runtimeDir, candidates, isValid } = options\n const loadErrors: Array<{ path: string; message: string }> = []\n\n for (const candidate of candidates) {\n const candidatePath = path.resolve(runtimeDir, candidate)\n try {\n if (!fs.existsSync(candidatePath) && !fs.existsSync(candidatePath + \".node\")) {\n continue\n }\n const mod = requireNativeModule(candidatePath)\n if (mod && isValid(mod)) {\n return { binding: mod, loadErrors, loadedPath: candidatePath }\n }\n loadErrors.push({ path: candidatePath, message: options.invalidExportMessage })\n } catch (e) {\n loadErrors.push({ path: candidatePath, message: e instanceof Error ? e.message : String(e) })\n }\n }\n\n return { binding: null, loadErrors }\n}\n\nconst _require = createRequire(\n typeof __filename !== \"undefined\"\n ? `file://${__filename}`\n : (import.meta.url ?? \"file://unknown\")\n)\n\nfunction requireNativeModule(p: string): unknown {\n return _require(p)\n}\n\nexport interface ResolveCandidatesOptions {\n runtimeDir?: string\n envVarNames?: string[]\n includeDefaultCandidates?: boolean\n enforceNodeExtensionForEnvPath?: boolean\n /** @deprecated — ignored, kept for backward compat */\n packageName?: string\n}\n\nexport function resolveNativeBindingCandidates(options: ResolveCandidatesOptions): string[] {\n const {\n envVarNames = [\"TW_NATIVE_PATH\", \"TWS_NATIVE_PATH\"],\n includeDefaultCandidates = true,\n enforceNodeExtensionForEnvPath = false,\n } = options\n // Default ke cwd kalau runtimeDir tidak disediakan\n const runtimeDir = options.runtimeDir || process.cwd()\n const candidates: string[] = []\n\n for (const envVar of envVarNames) {\n const envPath = process.env[envVar]\n if (envPath) {\n candidates.push(enforceNodeExtensionForEnvPath && !envPath.endsWith(\".node\") ? envPath + \".node\" : envPath)\n }\n }\n\n if (!includeDefaultCandidates) return candidates\n\n if (fs.existsSync(runtimeDir)) {\n try {\n for (const entry of fs.readdirSync(runtimeDir)) {\n if (entry.endsWith(\".node\")) candidates.push(entry)\n }\n } catch { /* ignore read errors */ }\n }\n\n const BINARY_NAMES = [\"tailwind-styled-native\", \"tailwind_styled_parser\"]\n const napiPlatform = process.platform === \"linux\" && process.arch === \"x64\" ? \"linux-x64-gnu\"\n : process.platform === \"linux\" && process.arch === \"arm64\" ? \"linux-arm64-gnu\"\n : `${process.platform}-${process.arch}`\n\n for (const bin of BINARY_NAMES) {\n candidates.push(path.resolve(runtimeDir, `${bin}.node`))\n candidates.push(path.resolve(runtimeDir, `${bin}.${napiPlatform}.node`))\n // 1 level: dist/ → package-root/native/ (published npm package)\n candidates.push(path.resolve(runtimeDir, \"..\", \"native\", `${bin}.node`))\n candidates.push(path.resolve(runtimeDir, \"..\", \"native\", `${bin}.${napiPlatform}.node`))\n // cwd fallback (user project root)\n candidates.push(path.resolve(process.cwd(), \"native\", `${bin}.node`))\n candidates.push(path.resolve(process.cwd(), \"native\", `${bin}.${napiPlatform}.node`))\n // 4 level: dist/ → package/ → domain/ → packages/ → repo-root/ (monorepo dev)\n candidates.push(path.resolve(runtimeDir, \"..\", \"..\", \"..\", \"..\", \"native\", `${bin}.node`))\n candidates.push(path.resolve(runtimeDir, \"..\", \"..\", \"..\", \"..\", \"native\", `${bin}.${napiPlatform}.node`))\n // 3 level fallback\n candidates.push(path.resolve(runtimeDir, \"..\", \"..\", \"..\", \"native\", `${bin}.node`))\n }\n\n return Array.from(new Set(candidates))\n}\n\nexport function resolveRuntimeDir(dir: string | undefined, importMetaUrl: string): string {\n if (dir) return path.resolve(dir)\n try {\n return path.dirname(fileURLToPath(importMetaUrl))\n } catch {\n return process.cwd()\n }\n}\n\n// ─────────────────────────────────────────────────────────────────────────────\n// Hashing\n// ─────────────────────────────────────────────────────────────────────────────\n\nexport function hashContent(content: string, algorithm: string = \"md5\", length?: number): string {\n const hash = createHash(algorithm).update(content).digest(\"hex\")\n return length ? hash.slice(0, length) : hash\n}\n\n// ─────────────────────────────────────────────────────────────────────────────\n// Error formatting\n// ─────────────────────────────────────────────────────────────────────────────\n\nexport function formatErrorMessage(error: unknown): string {\n if (error instanceof TwError) return error.toString()\n if (error instanceof Error) return error.message\n return String(error)\n}\n\n// ─────────────────────────────────────────────────────────────────────────────\n// LRU Cache\n// ─────────────────────────────────────────────────────────────────────────────\n\nexport class LRUCache<K, V> {\n private capacity: number\n private cache: Map<K, V>\n\n constructor(capacity: number) {\n this.capacity = capacity\n this.cache = new Map()\n }\n\n get(key: K): V | undefined {\n if (!this.cache.has(key)) return undefined\n const value = this.cache.get(key)!\n this.cache.delete(key)\n this.cache.set(key, value)\n return value\n }\n\n set(key: K, value: V): void {\n if (this.cache.has(key)) {\n this.cache.delete(key)\n } else if (this.cache.size >= this.capacity) {\n const firstKey = this.cache.keys().next().value\n if (firstKey !== undefined) {\n this.cache.delete(firstKey)\n }\n }\n this.cache.set(key, value)\n }\n\n delete(key: K): boolean {\n return this.cache.delete(key)\n }\n\n has(key: K): boolean {\n return this.cache.has(key)\n }\n\n clear(): void {\n this.cache.clear()\n }\n\n entries(): IterableIterator<[K, V]> {\n return this.cache.entries()\n }\n\n get size(): number {\n return this.cache.size\n }\n}\n\n// ─────────────────────────────────────────────────────────────────────────────\n// Trace Utilities\n// ─────────────────────────────────────────────────────────────────────────────\n\nexport type { TraceSnapshot, TraceSummary } from \"./trace\"\nexport {\n getHealthColor,\n getModeColor,\n formatMemory,\n formatDuration,\n calculateHealth,\n getBuildTimeColor,\n getMemoryColor,\n createTraceSnapshot,\n getPipelinePercentages,\n} from \"./trace\"\n\n// ─────────────────────────────────────────────────────────────────────────────\n// Performance Telemetry\n// ─────────────────────────────────────────────────────────────────────────────\n\n\n\n// ─────────────────────────────────────────────────────────────────────────────\n// Error Codes\n// ─────────────────────────────────────────────────────────────────────────────\n\nexport type { ErrorCode } from \"./error-codes\"\nexport { ERROR_CODES, getSuggestion, formatErrorCode } from \"./error-codes\"\n\n// ─────────────────────────────────────────────────────────────────────────────\n// Tailwind Compatibility\n// ─────────────────────────────────────────────────────────────────────────────\n\nexport type { TailwindInfo } from \"./compatibility\"\nexport { detectTailwind, assertTailwindV4, getTailwindVersion, isTailwindV4 } from \"./compatibility\"\n\n// ── Native binding schemas (Zod boundary validation)\nexport {\n NativeScanFileSchema, NativeScanResultSchema,\n NativeAnalyzerReportSchema, NativeTransformResultSchema,\n NativeCssCompileResultSchema, NativeWatchResultSchema,\n NativeCacheEntrySchema, NativeCacheReadResultSchema,\n safeParseNative, parseNative,\n} from './native-schemas'\n\n// ── ESM-safe runtime helpers ──────────────────────────────────────────────\nexport {\n createEsmRequire,\n getDirname,\n getFilename,\n resolveFromRoot,\n tryRequire,\n resolveNativeNodePath,\n} from \"./esmHelpers\"\n\n// ── Performance telemetry ────────────────────────────────────────────────────\nexport {\n TelemetryCollector,\n getGlobalTelemetry,\n resetGlobalTelemetry,\n createBuildTimer,\n type BuildTelemetry,\n type TelemetrySummary,\n type BuildPhases,\n} from \"./telemetry\"\n\n// ── Config/JSON schema validation ─────────────────────────────────────────────\nexport {\n ScanCacheSchema,\n ScanCacheClassEntrySchema,\n TailwindConfigSchema,\n RegistryPluginEntrySchema,\n RegistryFileSchema,\n PackageJsonSchema,\n parseJsonWithSchema,\n parseJsonFileWithSchema,\n type ScanCache,\n type ScanCacheClassEntry,\n type TailwindConfig,\n type RegistryPluginEntry,\n type RegistryFile,\n type PackageJson,\n} from \"./configSchemas\"\n\n// ── Worker/bootstrap path resolution ─────────────────────────────────────────\nexport {\n resolveWorkerPath,\n resolveLoaderPath,\n type WorkerPathOptions,\n type WorkerPathResult,\n} from \"./workerResolver\"\n\n// ── Codegen helpers ───────────────────────────────────────────────────────────\nexport {\n generateComponentCode,\n generateStorybookStory,\n generateClassRenameCodemod,\n generateBarrelFile,\n type ComponentCodegenOptions,\n} from \"./codegen\"\n\n// ── Native binary resolution (QA #1) ─────────────────────────────────────────\nexport {\n resolveNativeBinary,\n formatNativeNotFoundError,\n type NativeResolutionResult,\n} from \"./native-resolution\"\n\n// ── Shared observability contract ────────────────────────────────────────────\nexport {\n createObservabilityClient,\n type ClassInspection,\n type ClassProperty,\n type ClassUsageLocation,\n type BuildTrace,\n type BuildPhaseTrace,\n type DashboardMetrics,\n type DashboardSummary,\n type ObservabilityClient,\n} from \"./observability\"\n\nexport {\n TW_STATE_STATIC_FILENAME,\n extractStaticStateCss,\n appendStaticStateCssToSafelist,\n type TwStateConfigEntry,\n type StaticStateCssInput,\n type GeneratedStateRule,\n type StaticStateExtractionResult,\n} from \"./staticStateExtractor\"\nexport { setGlobalLogFile } from \"./logger\"","export * from \"@tailwind-styled/rspack\"\n","/**\n * tailwind-styled-v4 - Rspack Plugin v5 (stable)\n *\n * Usage:\n * import { tailwindStyledRspackPlugin } from \"@tailwind-styled/rspack\"\n *\n * export default defineConfig({\n * plugins: [tailwindStyledRspackPlugin()],\n * })\n *\n * v5:\n * - Simplified API\n * - Mode always zero-runtime\n */\n\nimport fs from \"node:fs\"\nimport path from \"node:path\"\nimport { getDirname as getEsmDirname } from \"@tailwind-styled/shared\"\n\nimport { parseRspackPluginOptions } from \"./schemas\"\n\nfunction getDirname(): string {\n if (typeof __dirname !== \"undefined\") {\n return __dirname\n }\n if (typeof import.meta !== \"undefined\" && import.meta.url) {\n return getEsmDirname(import.meta.url)\n }\n return process.cwd()\n}\n\nfunction resolveLoaderPath(basename: string): string {\n const runtimeDir = getDirname()\n const preferredExtensions =\n typeof __dirname !== \"undefined\" && __dirname.length > 0 ? [\".cjs\", \".js\"] : [\".js\", \".cjs\"]\n\n for (const ext of preferredExtensions) {\n const candidate = path.resolve(runtimeDir, `${basename}${ext}`)\n if (fs.existsSync(candidate)) return candidate\n }\n\n return path.resolve(runtimeDir, `${basename}.js`)\n}\n\ninterface RspackRule {\n _tailwindStyledRspackMarker?: boolean\n test?: RegExp\n exclude?: RegExp\n use?: Array<{\n loader: string\n options: {\n mode: \"zero-runtime\"\n addDataAttr: boolean\n preserveImports: boolean\n safelistPath?: string\n }\n }>\n}\n\ninterface RspackCompiler {\n options: {\n mode?: string\n module?: {\n rules?: RspackRule[]\n }\n }\n}\n\nexport interface RspackPluginOptions {\n /** File patterns to include. Default: /\\.[jt]sx?$/ */\n include?: RegExp\n /** File patterns to exclude. Default: /node_modules/ */\n exclude?: RegExp\n /** Add data-tw debug attributes in dev. Default: true in dev */\n addDataAttr?: boolean\n /** Enable analyzer. Default: false */\n analyze?: boolean\n /**\n * Path ke safelist CSS file.\n * `_tw-state-static.css` ditulis di direktori yang sama.\n * Default: `<cwd>/__tw_safelist.css`\n */\n safelistPath?: string\n}\n\nexport class TailwindStyledRspackPlugin {\n private opts: RspackPluginOptions\n\n constructor(opts: RspackPluginOptions = {}) {\n this.opts = parseRspackPluginOptions(opts)\n }\n\n apply(compiler: RspackCompiler): void {\n const isDev = compiler.options.mode !== \"production\"\n const loaderPath = resolveLoaderPath(\"loader\")\n const existing = compiler.options.module?.rules ?? []\n const alreadyRegistered = existing.some(\n (rule) =>\n typeof rule === \"object\" && rule !== null && rule._tailwindStyledRspackMarker === true\n )\n\n if (alreadyRegistered) return\n\n const safelistPath =\n this.opts.safelistPath ?? path.join(process.cwd(), \"__tw_safelist.css\")\n\n // Tulis placeholder agar @import di CSS entry tidak error saat cold start\n const stateStaticPath = path.join(path.dirname(safelistPath), \"_tw-state-static.css\")\n if (!fs.existsSync(stateStaticPath)) {\n try {\n fs.mkdirSync(path.dirname(stateStaticPath), { recursive: true })\n fs.writeFileSync(\n stateStaticPath,\n `/* _tw-state-static.css — Auto-generated by tailwind-styled-v4. DO NOT EDIT.\\n` +\n ` * Import di CSS entry: @import \"./_tw-state-static.css\";\\n` +\n ` */\\n`,\n \"utf-8\"\n )\n } catch { /* non-fatal */ }\n }\n\n const rule: RspackRule = {\n _tailwindStyledRspackMarker: true,\n test: this.opts.include ?? /\\.[jt]sx?$/,\n exclude: this.opts.exclude ?? /node_modules/,\n use: [\n {\n loader: loaderPath,\n options: {\n mode: \"zero-runtime\",\n addDataAttr: this.opts.addDataAttr ?? isDev,\n preserveImports: true,\n safelistPath,\n },\n },\n ],\n }\n\n compiler.options.module = {\n ...(compiler.options.module ?? {}),\n rules: [rule, ...existing],\n }\n }\n}\n\nexport function tailwindStyledRspackPlugin(\n opts: RspackPluginOptions = {}\n): TailwindStyledRspackPlugin {\n return new TailwindStyledRspackPlugin(opts)\n}\n\nexport default tailwindStyledRspackPlugin\n\nexport {\n parseRspackPluginOptions,\n type RspackPluginOptionsInput,\n RspackPluginOptionsSchema,\n} from \"./schemas\"\n","import { z } from \"zod\"\nimport { TwError } from \"@tailwind-styled/shared\"\n\nconst formatIssuePath = (path: readonly PropertyKey[]): string =>\n path.length > 0\n ? path\n .map((segment) =>\n typeof segment === \"symbol\" ? segment.description ?? segment.toString() : String(segment)\n )\n .join(\".\")\n : \"<root>\"\n\nconst formatIssues = (error: z.ZodError): string =>\n error.issues\n .map((issue) => {\n const p = formatIssuePath(issue.path)\n return `${p}: ${issue.message}`\n })\n .join(\"; \")\n\nconst parseWithSchema = <T>(schema: z.ZodType<T>, data: unknown, label: string): T => {\n const parsed = schema.safeParse(data)\n if (parsed.success) return parsed.data\n const details = formatIssues(parsed.error)\n throw new TwError(\n \"validation\",\n \"SCHEMA_VALIDATION_FAILED\",\n details ? `${label}: ${details}` : label,\n parsed.error\n )\n}\n\nexport const RspackPluginOptionsSchema = z.object({\n include: z.instanceof(RegExp).optional(),\n exclude: z.instanceof(RegExp).optional(),\n addDataAttr: z.boolean().optional(),\n analyze: z.boolean().optional(),\n cssEntry: z.string().optional(),\n /** Path ke safelist CSS file. Default: <cwd>/__tw_safelist.css */\n safelistPath: z.string().optional(),\n})\n\nexport type RspackPluginOptionsInput = z.infer<typeof RspackPluginOptionsSchema>\n\nexport const parseRspackPluginOptions = (options: unknown) =>\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AAQ,YAAY,GAAG,sBAAsB;AACpF,QAAI,CAACC,IAAG,WAAW,eAAe,GAAG;AACnC,UAAI;AACF,QAAAA,IAAG,UAAUD,MAAK,QAAQ,eAAe,GAAG,EAAE,WAAW,KAAK,CAAC;AAC/D,QAAAC,IAAG;AAAA,UACD;AAAA,UACA;AAAA;AAAA;AAAA;AAAA,UAGA;AAAA,QACF;AAAA,MACF,QAAQ;AAAA,MAAkB;AAAA,IAC5B;AAEA,UAAM,OAAmB;AAAA,MACvB,6BAA6B;AAAA,MAC7B,MAAM,KAAK,KAAK,WAAW;AAAA,MAC3B,SAAS,KAAK,KAAK,WAAW;AAAA,MAC9B,KAAK;AAAA,QACH;AAAA,UACE,QAAQ;AAAA,UACR,SAAS;AAAA,YACP,MAAM;AAAA,YACN,aAAa,KAAK,KAAK,eAAe;AAAA,YACtC,iBAAiB;AAAA,YACjB;AAAA,UACF;AAAA,QACF;AAAA,MACF;AAAA,IACF;AAEA,aAAS,QAAQ,SAAS;AAAA,MACxB,GAAI,SAAS,QAAQ,UAAU,CAAC;AAAA,MAChC,OAAO,CAAC,MAAM,GAAG,QAAQ;AAAA,IAC3B;AAAA,EACF;AACF;AAEO,SAAS,2BACd,OAA4B,CAAC,GACD;AAC5B,SAAO,IAAI,2BAA2B,IAAI;AAC5C;","names":["getDirname","path","fileURLToPath","fs","path","formatIssuePath","path","getDirname","path","fs","rule"]}
1
+ {"version":3,"sources":["../node_modules/tsup/assets/esm_shims.js","../packages/domain/shared/src/esmHelpers.ts","../packages/domain/shared/src/index.ts","../src/umbrella/rspack.ts","../packages/presentation/rspack/src/index.ts","../packages/presentation/rspack/src/schemas.ts"],"sourcesContent":["// Shim globals in esm bundle\nimport path from 'node:path'\nimport { fileURLToPath } from 'node:url'\n\nconst getFilename = () => fileURLToPath(import.meta.url)\nconst getDirname = () => path.dirname(getFilename())\n\nexport const __dirname = /* @__PURE__ */ getDirname()\nexport const __filename = /* @__PURE__ */ getFilename()\n","/**\n * ESM-safe runtime helpers untuk monorepo.\n *\n * Menggantikan pola fragile seperti:\n * - `createRequire(import.meta.url)` → gunakan `createEsmRequire()`\n * - `__dirname` → gunakan `getDirname(import.meta.url)`\n * - `__filename` → gunakan `getFilename(import.meta.url)`\n *\n * Semua helper ini bekerja di ESM dan CJS.\n *\n * @module @tailwind-styled/shared/esmHelpers\n */\n\nconst isBrowser = typeof window !== \"undefined\" || typeof document !== \"undefined\"\n\n// Safe check for require availability - works in both CJS and ESM\nlet nodeModuleRef: typeof import(\"node:module\") | null = null\nfunction getNodeModuleRef(): typeof import(\"node:module\") | null {\n if (isBrowser) return null\n if (nodeModuleRef !== null) return nodeModuleRef\n try {\n const test = typeof require === 'function' ? (require('node:module') as typeof import(\"node:module\")) : null\n nodeModuleRef = test\n return test\n } catch {\n nodeModuleRef = null\n return null\n }\n}\n\nlet _nodePath: typeof import(\"node:path\") | null = null\nlet _nodeUrl: typeof import(\"node:url\") | null = null\nlet _nodeFs: typeof import(\"node:fs\") | null = null\nlet _nodeCrypto: typeof import(\"node:crypto\") | null = null\nlet _nodeOs: typeof import(\"node:os\") | null = null\n\n/**\n * Get current file URL in a way that works in both ESM and CJS.\n * In ESM: uses import.meta.url\n * In CJS: uses __filename converted to file URL\n */\nfunction getCurrentFileUrl(): string {\n // In CJS builds, import.meta.url is replaced by esbuild with __importMetaUrl\n // which is set via the banner polyfill. In ESM it's the real URL.\n if (import.meta.url) {\n return import.meta.url\n }\n // Fallback: __filename is available in bare CJS (not bundled)\n if (typeof __filename !== \"undefined\") {\n return `file://${__filename.replace(/\\\\/g, \"/\")}`\n }\n return \"file://unknown\"\n}\n\nfunction getNodePath(): typeof import(\"node:path\") {\n if (isBrowser) throw new Error(\"node:path not available in browser\")\n if (!_nodePath) {\n if (typeof require === \"function\") {\n _nodePath = require(\"node:path\") as typeof import(\"node:path\")\n } else {\n const nodeRequire = getNodeModuleRef()\n if (!nodeRequire) throw new Error(\"require not available\")\n _nodePath = nodeRequire.createRequire(getCurrentFileUrl())(\"node:path\") as typeof import(\"node:path\")\n }\n }\n return _nodePath!\n}\nfunction getNodeUrl(): typeof import(\"node:url\") {\n if (isBrowser) throw new Error(\"node:url not available in browser\")\n if (!_nodeUrl) {\n if (typeof require === \"function\") {\n _nodeUrl = require(\"node:url\") as typeof import(\"node:url\")\n } else {\n const nodeRequire = getNodeModuleRef()\n if (!nodeRequire) throw new Error(\"require not available\")\n _nodeUrl = nodeRequire.createRequire(getCurrentFileUrl())(\"node:url\") as typeof import(\"node:url\")\n }\n }\n return _nodeUrl!\n}\nfunction getNodeFs(): typeof import(\"node:fs\") {\n if (isBrowser) throw new Error(\"node:fs not available in browser\")\n if (!_nodeFs) {\n if (typeof require === \"function\") {\n _nodeFs = require(\"node:fs\") as typeof import(\"node:fs\")\n } else {\n const nodeRequire = getNodeModuleRef()\n if (!nodeRequire) throw new Error(\"require not available\")\n _nodeFs = nodeRequire.createRequire(getCurrentFileUrl())(\"node:fs\") as typeof import(\"node:fs\")\n }\n }\n return _nodeFs!\n}\nfunction getNodeCrypto(): typeof import(\"node:crypto\") {\n if (isBrowser) throw new Error(\"node:crypto not available in browser\")\n if (!_nodeCrypto) {\n if (typeof require === \"function\") {\n _nodeCrypto = require(\"node:crypto\") as typeof import(\"node:crypto\")\n } else {\n const nodeRequire = getNodeModuleRef()\n if (!nodeRequire) throw new Error(\"require not available\")\n _nodeCrypto = nodeRequire.createRequire(getCurrentFileUrl())(\"node:crypto\") as typeof import(\"node:crypto\")\n }\n }\n return _nodeCrypto!\n}\nfunction getNodeOs(): typeof import(\"node:os\") {\n if (isBrowser) throw new Error(\"node:os not available in browser\")\n if (!_nodeOs) {\n if (typeof require === \"function\") {\n _nodeOs = require(\"node:os\") as typeof import(\"node:os\")\n } else {\n const nodeRequire = getNodeModuleRef()\n if (!nodeRequire) throw new Error(\"require not available\")\n _nodeOs = nodeRequire.createRequire(getCurrentFileUrl())(\"node:os\") as typeof import(\"node:os\")\n }\n }\n return _nodeOs!\n}\n\n/**\n * Buat `require()` function yang relative terhadap sebuah ESM module.\n *\n * @example\n * const req = createEsmRequire(import.meta.url)\n * const mod = req(\"some-pkg\")\n */\nexport function createEsmRequire(importMetaUrl: string): NodeRequire {\n if (isBrowser) throw new Error(\"require not available in browser\")\n // CJS: require is already available globally\n if (typeof require === \"function\") return require\n const nodeRequire = getNodeModuleRef()\n if (!nodeRequire) throw new Error(\"require not available\")\n return nodeRequire.createRequire(importMetaUrl)\n}\n\n/**\n * Dapat `__dirname` dari `import.meta.url`.\n *\n * @example\n * const dir = getDirname(import.meta.url)\n */\nexport function getDirname(importMetaUrl: string): string {\n if (isBrowser) return \"\"\n // CJS: __dirname is directly available\n if (typeof __dirname !== \"undefined\") return __dirname\n const nodePath = getNodePath()\n const nodeUrl = getNodeUrl()\n return nodePath.dirname(nodeUrl.fileURLToPath(importMetaUrl))\n}\n\n/**\n * Dapat `__filename` dari `import.meta.url`.\n */\nexport function getFilename(importMetaUrl: string): string {\n if (isBrowser) return \"\"\n // CJS: __filename is directly available\n if (typeof __filename !== \"undefined\") return __filename\n return getNodeUrl().fileURLToPath(importMetaUrl)\n}\n\n/**\n * Resolve path dari root monorepo (bukan CWD).\n */\nexport function resolveFromRoot(...segments: string[]): string {\n if (isBrowser) return segments.join(\"/\")\n\n const nodePath = getNodePath()\n const nodeFs = getNodeFs()\n\n // Use __dirname in CJS, or getDirname with current file URL in ESM\n let dir = typeof __dirname !== \"undefined\"\n ? __dirname\n : getDirname(getCurrentFileUrl())\n\n for (let i = 0; i < 10; i++) {\n const pkgPath = nodePath.join(dir, \"package.json\")\n try {\n const pkg = JSON.parse(nodeFs.readFileSync(pkgPath, \"utf-8\"))\n if (pkg.workspaces) {\n return nodePath.resolve(dir, ...segments)\n }\n } catch { /* intentionally silent */ }\n dir = nodePath.dirname(dir)\n }\n return nodePath.resolve(process.cwd(), ...segments)\n}\n\n/**\n * Require sebuah module dengan fallback ke null jika tidak tersedia.\n */\nexport function tryRequire<T = unknown>(\n moduleName: string,\n importMetaUrl: string\n): T | null {\n if (isBrowser) return null\n try {\n return createEsmRequire(importMetaUrl)(moduleName) as T\n } catch { /* intentionally silent — optional dep */ }\n return null\n}\n\n/**\n * Resolve .node binary path yang cross-platform dan ESM-safe.\n */\nexport function resolveNativeNodePath(\n importMetaUrl: string,\n ...relativeSegments: string[]\n): string {\n if (isBrowser) return relativeSegments.join(\"/\")\n return getNodePath().resolve(getDirname(importMetaUrl), ...relativeSegments)\n}\n","import { createHash } from \"node:crypto\"\nimport fs from \"node:fs\"\nimport path from \"node:path\"\nimport { fileURLToPath } from \"node:url\"\nimport { createRequire } from \"node:module\"\n\n// Native-only: Node.js is always available. No browser fallback.\n\n// ─────────────────────────────────────────────────────────────────────────────\n// Types\n// ─────────────────────────────────────────────────────────────────────────────\n\nexport type TokenMap = Record<string, string>\n\nexport type VariantValue = string | number | boolean | undefined\n\nexport type VariantProps = Record<string, VariantValue>\n\nexport type HtmlTagName = keyof HTMLElementTagNameMap\n\nexport type CompoundCondition = Record<string, string | number | boolean>\n\nexport type VariantMatrix = Record<string, Array<string | number | boolean>>\n\n// ─────────────────────────────────────────────────────────────────────────────\n// Logging\n// ─────────────────────────────────────────────────────────────────────────────\n\nexport interface Logger {\n warn(...args: unknown[]): void\n debug(...args: unknown[]): void\n error(...args: unknown[]): void\n log(...args: unknown[]): void\n}\n\nexport function createLogger(namespace: string): Logger {\n const prefix = `[${namespace}]`\n return {\n warn(...args: unknown[]) {\n process.stderr.write(`${prefix} ${args.map(a => typeof a === \"string\" ? a : String(a)).join(\" \")}\\n`)\n },\n debug(...args: unknown[]) {\n process.stderr.write(`${prefix} ${args.map(a => typeof a === \"string\" ? a : String(a)).join(\" \")}\\n`)\n },\n error(...args: unknown[]) {\n process.stderr.write(`${prefix} ${args.map(a => typeof a === \"string\" ? a : String(a)).join(\" \")}\\n`)\n },\n log(...args: unknown[]) {\n process.stderr.write(`${prefix} ${args.map(a => typeof a === \"string\" ? a : String(a)).join(\" \")}\\n`)\n },\n }\n}\n\nexport function createDebugLogger(namespace: string, label?: string): (msg: string) => void {\n const prefix = label ? `[${namespace}:${label}]` : `[${namespace}]`\n return (msg: string) => {\n if (process.env.DEBUG?.includes(namespace) || process.env.TW_DEBUG) {\n console.debug(prefix, msg)\n }\n }\n}\n\n// ─────────────────────────────────────────────────────────────────────────────\n// Error handling\n// ─────────────────────────────────────────────────────────────────────────────\n\nexport type ErrorSource = \"rust\" | \"validation\" | \"compile\" | \"io\" | \"config\" | \"unknown\"\n\ntype ZodLikeIssue = {\n path?: readonly PropertyKey[]\n message?: string\n}\n\nfunction formatIssuePath(path?: readonly PropertyKey[]): string {\n if (!path || path.length === 0) return \"(root)\"\n return path\n .map((segment) =>\n typeof segment === \"symbol\" ? segment.description ?? segment.toString() : String(segment)\n )\n .join(\".\")\n}\n\nexport class TwError extends Error {\n /** @deprecated Gunakan source */\n public readonly domain: string\n public readonly source: ErrorSource\n public readonly code: string\n public readonly originalCause?: unknown\n\n constructor(domainOrSource: string, code: string, message: string, cause?: unknown) {\n super(message)\n this.name = \"TwError\"\n this.domain = domainOrSource\n this.source = domainOrSource as ErrorSource\n this.code = code\n this.originalCause = cause\n if (Error.captureStackTrace) Error.captureStackTrace(this, TwError)\n }\n\n static fromIo(code: string, message: string): TwError {\n return new TwError(\"io\", code, message)\n }\n\n static fromCompile(code: string, message: string): TwError {\n return new TwError(\"compile\", code, message)\n }\n\n static fromRust(err: { code?: string; message?: string } | Error | unknown): TwError {\n if (err instanceof TwError) return err\n if (err instanceof Error) return new TwError(\"rust\", \"RUST_ERROR\", err.message, err)\n if (err && typeof err === \"object\") {\n const e = err as { code?: string; message?: string }\n return new TwError(\"rust\", e.code ?? \"RUST_ERROR\", e.message ?? String(err), err)\n }\n return new TwError(\"rust\", \"RUST_ERROR\", String(err), err)\n }\n\n /** Buat TwError dari ZodError — dukung shape Zod v3 (`errors`) dan v4 (`issues`). */\n static fromZod(err: { issues?: ZodLikeIssue[]; errors?: ZodLikeIssue[] }): TwError {\n const first = err.issues?.[0] ?? err.errors?.[0]\n const path = formatIssuePath(first?.path)\n const message = first ? `${path}: ${first.message}` : \"Schema validation failed\"\n return new TwError(\"validation\", \"SCHEMA_VALIDATION_FAILED\", message, err)\n }\n\n static wrap(source: string, code: string, err: unknown): TwError {\n if (err instanceof TwError) return err\n if (err instanceof Error) return new TwError(source, code, err.message, err)\n return new TwError(source, code, String(err), err)\n }\n\n override toString(): string {\n return `TwError [${this.source}:${this.code}] ${this.message}`\n }\n\n toJSON(): { name: string; source: string; code: string; message: string } {\n return { name: this.name, source: this.source, code: this.code, message: this.message }\n }\n\n toCliMessage(): string {\n return `[${this.source.toUpperCase()}:${this.code}] ${this.message}`\n }\n}\n\nexport function wrapUnknownError(domain: string, code: string, error: unknown): TwError {\n return TwError.wrap(domain, code, error)\n}\n\nexport function isTwError(err: unknown): err is TwError {\n return err instanceof TwError\n}\n\n// ─────────────────────────────────────────────────────────────────────────────\n// Native binding resolution\n// ─────────────────────────────────────────────────────────────────────────────\n\nexport interface LoadNativeBindingOptions<T> {\n runtimeDir: string\n candidates: string[]\n isValid: (module: unknown) => module is T\n invalidExportMessage: string\n}\n\nexport interface LoadNativeBindingResult<T> {\n binding: T | null\n loadErrors: Array<{ path: string; message: string }>\n loadedPath?: string\n}\n\nexport function loadNativeBinding<T>(options: LoadNativeBindingOptions<T>): LoadNativeBindingResult<T> {\n const { runtimeDir, candidates, isValid } = options\n const loadErrors: Array<{ path: string; message: string }> = []\n\n for (const candidate of candidates) {\n const candidatePath = path.resolve(runtimeDir, candidate)\n try {\n if (!fs.existsSync(candidatePath) && !fs.existsSync(candidatePath + \".node\")) {\n continue\n }\n const mod = requireNativeModule(candidatePath)\n if (mod && isValid(mod)) {\n return { binding: mod, loadErrors, loadedPath: candidatePath }\n }\n loadErrors.push({ path: candidatePath, message: options.invalidExportMessage })\n } catch (e) {\n loadErrors.push({ path: candidatePath, message: e instanceof Error ? e.message : String(e) })\n }\n }\n\n return { binding: null, loadErrors }\n}\n\nconst _require = createRequire(\n typeof __filename !== \"undefined\"\n ? `file://${__filename}`\n : (import.meta.url ?? \"file://unknown\")\n)\n\nfunction requireNativeModule(p: string): unknown {\n return _require(p)\n}\n\nexport interface ResolveCandidatesOptions {\n runtimeDir?: string\n envVarNames?: string[]\n includeDefaultCandidates?: boolean\n enforceNodeExtensionForEnvPath?: boolean\n /** @deprecated — ignored, kept for backward compat */\n packageName?: string\n}\n\nexport function resolveNativeBindingCandidates(options: ResolveCandidatesOptions): string[] {\n const {\n envVarNames = [\"TW_NATIVE_PATH\", \"TWS_NATIVE_PATH\"],\n includeDefaultCandidates = true,\n enforceNodeExtensionForEnvPath = false,\n } = options\n // Default ke cwd kalau runtimeDir tidak disediakan\n const runtimeDir = options.runtimeDir || process.cwd()\n const candidates: string[] = []\n\n for (const envVar of envVarNames) {\n const envPath = process.env[envVar]\n if (envPath) {\n candidates.push(enforceNodeExtensionForEnvPath && !envPath.endsWith(\".node\") ? envPath + \".node\" : envPath)\n }\n }\n\n if (!includeDefaultCandidates) return candidates\n\n if (fs.existsSync(runtimeDir)) {\n try {\n for (const entry of fs.readdirSync(runtimeDir)) {\n if (entry.endsWith(\".node\")) candidates.push(entry)\n }\n } catch { /* ignore read errors */ }\n }\n\n const BINARY_NAMES = [\"tailwind-styled-native\", \"tailwind_styled_parser\"]\n const napiPlatform = process.platform === \"linux\" && process.arch === \"x64\" ? \"linux-x64-gnu\"\n : process.platform === \"linux\" && process.arch === \"arm64\" ? \"linux-arm64-gnu\"\n : `${process.platform}-${process.arch}`\n\n for (const bin of BINARY_NAMES) {\n candidates.push(path.resolve(runtimeDir, `${bin}.node`))\n candidates.push(path.resolve(runtimeDir, `${bin}.${napiPlatform}.node`))\n // 1 level: dist/ → package-root/native/ (published npm package)\n candidates.push(path.resolve(runtimeDir, \"..\", \"native\", `${bin}.node`))\n candidates.push(path.resolve(runtimeDir, \"..\", \"native\", `${bin}.${napiPlatform}.node`))\n // cwd fallback (user project root)\n candidates.push(path.resolve(process.cwd(), \"native\", `${bin}.node`))\n candidates.push(path.resolve(process.cwd(), \"native\", `${bin}.${napiPlatform}.node`))\n // 4 level: dist/ → package/ → domain/ → packages/ → repo-root/ (monorepo dev)\n candidates.push(path.resolve(runtimeDir, \"..\", \"..\", \"..\", \"..\", \"native\", `${bin}.node`))\n candidates.push(path.resolve(runtimeDir, \"..\", \"..\", \"..\", \"..\", \"native\", `${bin}.${napiPlatform}.node`))\n // 3 level fallback\n candidates.push(path.resolve(runtimeDir, \"..\", \"..\", \"..\", \"native\", `${bin}.node`))\n }\n\n return Array.from(new Set(candidates))\n}\n\nexport function resolveRuntimeDir(dir: string | undefined, importMetaUrl: string): string {\n if (dir) return path.resolve(dir)\n try {\n return path.dirname(fileURLToPath(importMetaUrl))\n } catch {\n return process.cwd()\n }\n}\n\n// ─────────────────────────────────────────────────────────────────────────────\n// Hashing\n// ─────────────────────────────────────────────────────────────────────────────\n\nexport function hashContent(content: string, algorithm: string = \"md5\", length?: number): string {\n const hash = createHash(algorithm).update(content).digest(\"hex\")\n return length ? hash.slice(0, length) : hash\n}\n\n// ─────────────────────────────────────────────────────────────────────────────\n// Error formatting\n// ─────────────────────────────────────────────────────────────────────────────\n\nexport function formatErrorMessage(error: unknown): string {\n if (error instanceof TwError) return error.toString()\n if (error instanceof Error) return error.message\n return String(error)\n}\n\n// ─────────────────────────────────────────────────────────────────────────────\n// LRU Cache\n// ─────────────────────────────────────────────────────────────────────────────\n\nexport class LRUCache<K, V> {\n private capacity: number\n private cache: Map<K, V>\n\n constructor(capacity: number) {\n this.capacity = capacity\n this.cache = new Map()\n }\n\n get(key: K): V | undefined {\n if (!this.cache.has(key)) return undefined\n const value = this.cache.get(key)!\n this.cache.delete(key)\n this.cache.set(key, value)\n return value\n }\n\n set(key: K, value: V): void {\n if (this.cache.has(key)) {\n this.cache.delete(key)\n } else if (this.cache.size >= this.capacity) {\n const firstKey = this.cache.keys().next().value\n if (firstKey !== undefined) {\n this.cache.delete(firstKey)\n }\n }\n this.cache.set(key, value)\n }\n\n delete(key: K): boolean {\n return this.cache.delete(key)\n }\n\n has(key: K): boolean {\n return this.cache.has(key)\n }\n\n clear(): void {\n this.cache.clear()\n }\n\n entries(): IterableIterator<[K, V]> {\n return this.cache.entries()\n }\n\n get size(): number {\n return this.cache.size\n }\n}\n\n// ─────────────────────────────────────────────────────────────────────────────\n// Trace Utilities\n// ─────────────────────────────────────────────────────────────────────────────\n\nexport type { TraceSnapshot, TraceSummary } from \"./trace\"\nexport {\n getHealthColor,\n getModeColor,\n formatMemory,\n formatDuration,\n calculateHealth,\n getBuildTimeColor,\n getMemoryColor,\n createTraceSnapshot,\n getPipelinePercentages,\n} from \"./trace\"\n\n// ─────────────────────────────────────────────────────────────────────────────\n// Performance Telemetry\n// ─────────────────────────────────────────────────────────────────────────────\n\n\n\n// ─────────────────────────────────────────────────────────────────────────────\n// Error Codes\n// ─────────────────────────────────────────────────────────────────────────────\n\nexport type { ErrorCode } from \"./error-codes\"\nexport { ERROR_CODES, getSuggestion, formatErrorCode } from \"./error-codes\"\n\n// ─────────────────────────────────────────────────────────────────────────────\n// Tailwind Compatibility\n// ─────────────────────────────────────────────────────────────────────────────\n\nexport type { TailwindInfo } from \"./compatibility\"\nexport { detectTailwind, assertTailwindV4, getTailwindVersion, isTailwindV4 } from \"./compatibility\"\n\n// ── Native binding schemas (Zod boundary validation)\nexport {\n NativeScanFileSchema, NativeScanResultSchema,\n NativeAnalyzerReportSchema, NativeTransformResultSchema,\n NativeCssCompileResultSchema, NativeWatchResultSchema,\n NativeCacheEntrySchema, NativeCacheReadResultSchema,\n safeParseNative, parseNative,\n} from './native-schemas'\n\n// ── ESM-safe runtime helpers ──────────────────────────────────────────────\nexport {\n createEsmRequire,\n getDirname,\n getFilename,\n resolveFromRoot,\n tryRequire,\n resolveNativeNodePath,\n} from \"./esmHelpers\"\n\n// ── Performance telemetry ────────────────────────────────────────────────────\nexport {\n TelemetryCollector,\n getGlobalTelemetry,\n resetGlobalTelemetry,\n createBuildTimer,\n type BuildTelemetry,\n type TelemetrySummary,\n type BuildPhases,\n} from \"./telemetry\"\n\n// ── Config/JSON schema validation ─────────────────────────────────────────────\nexport {\n ScanCacheSchema,\n ScanCacheClassEntrySchema,\n TailwindConfigSchema,\n RegistryPluginEntrySchema,\n RegistryFileSchema,\n PackageJsonSchema,\n parseJsonWithSchema,\n parseJsonFileWithSchema,\n type ScanCache,\n type ScanCacheClassEntry,\n type TailwindConfig,\n type RegistryPluginEntry,\n type RegistryFile,\n type PackageJson,\n} from \"./configSchemas\"\n\n// ── Worker/bootstrap path resolution ─────────────────────────────────────────\nexport {\n resolveWorkerPath,\n resolveLoaderPath,\n type WorkerPathOptions,\n type WorkerPathResult,\n} from \"./workerResolver\"\n\n// ── Codegen helpers ───────────────────────────────────────────────────────────\nexport {\n generateComponentCode,\n generateStorybookStory,\n generateClassRenameCodemod,\n generateBarrelFile,\n type ComponentCodegenOptions,\n} from \"./codegen\"\n\n// ── Native binary resolution (QA #1) ─────────────────────────────────────────\nexport {\n resolveNativeBinary,\n formatNativeNotFoundError,\n type NativeResolutionResult,\n} from \"./native-resolution\"\n\n// ── Shared observability contract ────────────────────────────────────────────\nexport {\n createObservabilityClient,\n type ClassInspection,\n type ClassProperty,\n type ClassUsageLocation,\n type BuildTrace,\n type BuildPhaseTrace,\n type DashboardMetrics,\n type DashboardSummary,\n type ObservabilityClient,\n} from \"./observability\"\n\nexport {\n TW_STATE_STATIC_FILENAME,\n extractStaticStateCss,\n appendStaticStateCssToSafelist,\n type TwStateConfigEntry,\n type StaticStateCssInput,\n type GeneratedStateRule,\n type StaticStateExtractionResult,\n} from \"./staticStateExtractor\"\nexport { setGlobalLogFile } from \"./logger\"","export * from \"@tailwind-styled/rspack\"\n","/**\n * tailwind-styled-v4 - Rspack Plugin v5 (stable)\n *\n * Usage:\n * import { tailwindStyledRspackPlugin } from \"@tailwind-styled/rspack\"\n *\n * export default defineConfig({\n * plugins: [tailwindStyledRspackPlugin()],\n * })\n *\n * v5:\n * - Simplified API\n * - Mode always zero-runtime\n */\n\nimport fs from \"node:fs\"\nimport path from \"node:path\"\nimport { getDirname as getEsmDirname } from \"@tailwind-styled/shared\"\n\nimport { parseRspackPluginOptions } from \"./schemas\"\n\nfunction getDirname(): string {\n if (typeof __dirname !== \"undefined\") {\n return __dirname\n }\n if (typeof import.meta !== \"undefined\" && import.meta.url) {\n return getEsmDirname(import.meta.url)\n }\n return process.cwd()\n}\n\nfunction resolveLoaderPath(basename: string): string {\n const runtimeDir = getDirname()\n const preferredExtensions =\n typeof __dirname !== \"undefined\" && __dirname.length > 0 ? [\".cjs\", \".js\"] : [\".js\", \".cjs\"]\n\n for (const ext of preferredExtensions) {\n const candidate = path.resolve(runtimeDir, `${basename}${ext}`)\n if (fs.existsSync(candidate)) return candidate\n }\n\n return path.resolve(runtimeDir, `${basename}.js`)\n}\n\ninterface RspackRule {\n _tailwindStyledRspackMarker?: boolean\n test?: RegExp\n exclude?: RegExp\n use?: Array<{\n loader: string\n options: {\n mode: \"zero-runtime\"\n addDataAttr: boolean\n preserveImports: boolean\n safelistPath?: string\n }\n }>\n}\n\ninterface RspackCompiler {\n options: {\n mode?: string\n module?: {\n rules?: RspackRule[]\n }\n }\n}\n\nexport interface RspackPluginOptions {\n /** File patterns to include. Default: /\\.[jt]sx?$/ */\n include?: RegExp\n /** File patterns to exclude. Default: /node_modules/ */\n exclude?: RegExp\n /** Add data-tw debug attributes in dev. Default: true in dev */\n addDataAttr?: boolean\n /** Enable analyzer. Default: false */\n analyze?: boolean\n /**\n * Path ke safelist CSS file.\n * `_tw-state-static.css` ditulis di direktori yang sama.\n * Default: `<cwd>/__tw_safelist.css`\n */\n safelistPath?: string\n}\n\nexport class TailwindStyledRspackPlugin {\n private opts: RspackPluginOptions\n\n constructor(opts: RspackPluginOptions = {}) {\n this.opts = parseRspackPluginOptions(opts)\n }\n\n apply(compiler: RspackCompiler): void {\n const isDev = compiler.options.mode !== \"production\"\n const loaderPath = resolveLoaderPath(\"loader\")\n const existing = compiler.options.module?.rules ?? []\n const alreadyRegistered = existing.some(\n (rule) =>\n typeof rule === \"object\" && rule !== null && rule._tailwindStyledRspackMarker === true\n )\n\n if (alreadyRegistered) return\n\n const safelistPath =\n this.opts.safelistPath ?? path.join(process.cwd(), \"__tw_safelist.css\")\n\n // Tulis placeholder agar @import di CSS entry tidak error saat cold start\n const stateStaticPath = path.join(path.dirname(safelistPath), \"_tw-state-static.css\")\n if (!fs.existsSync(stateStaticPath)) {\n try {\n fs.mkdirSync(path.dirname(stateStaticPath), { recursive: true })\n fs.writeFileSync(\n stateStaticPath,\n `/* _tw-state-static.css — Auto-generated by tailwind-styled-v4. DO NOT EDIT.\\n` +\n ` * Import di CSS entry: @import \"./_tw-state-static.css\";\\n` +\n ` */\\n`,\n \"utf-8\"\n )\n } catch { /* non-fatal */ }\n }\n\n const rule: RspackRule = {\n _tailwindStyledRspackMarker: true,\n test: this.opts.include ?? /\\.[jt]sx?$/,\n exclude: this.opts.exclude ?? /node_modules/,\n use: [\n {\n loader: loaderPath,\n options: {\n mode: \"zero-runtime\",\n addDataAttr: this.opts.addDataAttr ?? isDev,\n preserveImports: true,\n safelistPath,\n },\n },\n ],\n }\n\n compiler.options.module = {\n ...(compiler.options.module ?? {}),\n rules: [rule, ...existing],\n }\n }\n}\n\nexport function tailwindStyledRspackPlugin(\n opts: RspackPluginOptions = {}\n): TailwindStyledRspackPlugin {\n return new TailwindStyledRspackPlugin(opts)\n}\n\nexport default tailwindStyledRspackPlugin\n\nexport {\n parseRspackPluginOptions,\n type RspackPluginOptionsInput,\n RspackPluginOptionsSchema,\n} from \"./schemas\"\n","import { z } from \"zod\"\nimport { TwError } from \"@tailwind-styled/shared\"\n\nconst formatIssuePath = (path: readonly PropertyKey[]): string =>\n path.length > 0\n ? path\n .map((segment) =>\n typeof segment === \"symbol\" ? segment.description ?? segment.toString() : String(segment)\n )\n .join(\".\")\n : \"<root>\"\n\nconst formatIssues = (error: z.ZodError): string =>\n error.issues\n .map((issue) => {\n const p = formatIssuePath(issue.path)\n return `${p}: ${issue.message}`\n })\n .join(\"; \")\n\nconst parseWithSchema = <T>(schema: z.ZodType<T>, data: unknown, label: string): T => {\n const parsed = schema.safeParse(data)\n if (parsed.success) return parsed.data\n const details = formatIssues(parsed.error)\n throw new TwError(\n \"validation\",\n \"SCHEMA_VALIDATION_FAILED\",\n details ? `${label}: ${details}` : label,\n parsed.error\n )\n}\n\nexport const RspackPluginOptionsSchema = z.object({\n include: z.instanceof(RegExp).optional(),\n exclude: z.instanceof(RegExp).optional(),\n addDataAttr: z.boolean().optional(),\n analyze: z.boolean().optional(),\n cssEntry: z.string().optional(),\n /** Path ke safelist CSS file. Default: <cwd>/__tw_safelist.css */\n safelistPath: z.string().optional(),\n})\n\nexport type RspackPluginOptionsInput = z.infer<typeof RspackPluginOptionsSchema>\n\nexport const parseRspackPluginOptions = (options: unknown) =>\n parseWithSchema(RspackPluginOptionsSchema, options ?? {}, \"rspack plugin options are invalid\")\n"],"mappings":";;;;;;;;;;;;AACA,OAAO,UAAU;AACjB,SAAS,qBAAqB;AAF9B,IAIM,aACA,YAEO,WACA;AARb;AAAA;AAAA;AAIA,IAAM,cAAc,MAAM,cAAc,YAAY,GAAG;AACvD,IAAM,aAAa,MAAM,KAAK,QAAQ,YAAY,CAAC;AAE5C,IAAM,YAA4B,2BAAW;AAC7C,IAAM,aAA6B,4BAAY;AAAA;AAAA;;;ACStD,SAAS,mBAAwD;AAC/D,MAAI,UAAW,QAAO;AACtB,MAAI,kBAAkB,KAAM,QAAO;AACnC,MAAI;AACF,UAAM,OAAO,OAAO,cAAY,aAAc,UAAQ,QAAa,IAAqC;AACxG,oBAAgB;AAChB,WAAO;AAAA,EACT,QAAQ;AACN,oBAAgB;AAChB,WAAO;AAAA,EACT;AACF;AAaA,SAAS,oBAA4B;AAGnC,MAAI,YAAY,KAAK;AACnB,WAAO,YAAY;AAAA,EACrB;AAEA,MAAI,OAAO,eAAe,aAAa;AACrC,WAAO,UAA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AAC,MAAM,GAAG,QAAQ;AAAA,IAC3B;AAAA,EACF;AACF;AAEO,SAAS,2BACd,OAA4B,CAAC,GACD;AAC5B,SAAO,IAAI,2BAA2B,IAAI;AAC5C;","names":["getDirname","path","fileURLToPath","fs","path","formatIssuePath","path","getDirname","path","fs","rule"]}
@@ -1,4 +1,5 @@
1
- /* tailwind-styled-v4 v5.0.4 | MIT | https://github.com/dictionar32/tailwind-styled-v4 */
1
+ "use client"
2
+
2
3
  "use strict";
3
4
  var __create = Object.create;
4
5
  var __defProp = Object.defineProperty;
@@ -190,4 +191,5 @@ function minifyCss(css) {
190
191
  syncInject,
191
192
  useTwClasses
192
193
  });
194
+ /* tailwind-styled-v4 v5.1.9 | MIT | https://github.com/dictionar32/tailwind-styled-v4 */
193
195
  //# sourceMappingURL=runtime-css.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/umbrella/runtime-css.ts","../packages/domain/runtime-css/src/batchedInjector.ts","../packages/domain/runtime-css/src/CssInjector.tsx"],"sourcesContent":["export * from \"@tailwind-styled/runtime-css\"\n","\"use client\"\n\n/**\n * tailwind-styled-v5 — Batched CSS Injector (Client Runtime)\n *\n * Menggantikan pattern inject-per-komponen yang menyebabkan banyak\n * style recalculation saat banyak komponen mount bersamaan.\n *\n * Cara kerja:\n * - Semua CSS rules dari render cycle yang sama dikumpulkan\n * - Satu requestAnimationFrame = satu DOM style update\n * - Deduplication via Set<string> — rule yang sama tidak diinjeksi dua kali\n * - Injection via CSSStyleSheet.insertRule() — TIDAK menghapus rules yang ada\n * - Fallback ke textContent += jika CSSOM API tidak tersedia\n *\n * PENTING — Kenapa insertRule() bukan textContent +=:\n * `el.textContent += css` terlihat additive tapi sebenarnya:\n * 1. Browser baca semua textContent yang ada\n * 2. HAPUS semua rules dari stylesheet\n * 3. Concat string baru\n * 4. Parse ulang dan re-add semua rules\n * Di step 2-3, ada window singkat dimana SEMUA styles hilang → FLICKER.\n *\n * `sheet.insertRule()` benar-benar additive — hanya menambah rule baru\n * tanpa menyentuh rules yang sudah ada. Zero flicker.\n *\n * Usage (internal, dipakai oleh stateEngine dan containerQuery):\n * import { batchedInject, flushBatchedCss } from \"./batchedInjector\"\n *\n * // Queue a rule\n * batchedInject(\".tw-s-abc123[data-active=\\\"true\\\"]{opacity:0.5}\")\n *\n * // Force flush (biasanya tidak perlu — RAF melakukan ini otomatis)\n * flushBatchedCss()\n */\n\n// ─────────────────────────────────────────────────────────────────────────────\n// Singleton state\n// ─────────────────────────────────────────────────────────────────────────────\n\n/** All injected rules (deduplication registry) */\nconst injected = new Set<string>()\n\n/** Pending rules for current RAF batch */\nconst pending: string[] = []\n\n/** RAF handle and style element state */\nconst _state = {\n rafHandle: null as ReturnType<typeof requestAnimationFrame> | null,\n styleEl: null as HTMLStyleElement | null,\n}\n\nfunction getStyleElement(): HTMLStyleElement {\n if (_state.styleEl && document.head.contains(_state.styleEl)) return _state.styleEl\n\n _state.styleEl = document.createElement(\"style\")\n _state.styleEl.id = \"__tw-runtime-css\"\n _state.styleEl.setAttribute(\"data-tw-batched\", \"true\")\n // Harus diappend ke DOM sebelum .sheet bisa diakses\n document.head.appendChild(_state.styleEl)\n return _state.styleEl\n}\n\n/**\n * Inject satu CSS rule via CSSStyleSheet.insertRule().\n *\n * Ini benar-benar additive — tidak menyentuh rules yang sudah ada.\n * Fallback ke textContent append jika sheet belum siap (edge case).\n *\n * @internal\n */\nfunction insertRuleToSheet(cssRule: string): void {\n const trimmed = cssRule.trim()\n if (!trimmed) return\n\n const el = getStyleElement()\n const sheet = el.sheet\n\n if (sheet) {\n try {\n // insertRule() di akhir — urutan tidak kritis untuk utility CSS\n sheet.insertRule(trimmed, sheet.cssRules.length)\n return\n } catch {\n // insertRule() bisa throw jika:\n // 1. Rule syntax tidak valid\n // 2. Multi-rule string (insertRule() hanya terima satu rule)\n // Fallback ke textContent append untuk kasus ini.\n if (process.env.NODE_ENV === \"development\") {\n console.warn(\"[tw] insertRule failed, falling back to textContent append for rule:\", trimmed.slice(0, 80))\n }\n }\n }\n\n // Fallback: textContent append.\n // Lebih jarang terjadi sekarang karena stateEngine sudah loop per-rule,\n // tapi tetap perlu sebagai safety net.\n el.textContent = (el.textContent ?? \"\") + `\\n${trimmed}`\n}\n\n// ─────────────────────────────────────────────────────────────────────────────\n// Core API\n// ─────────────────────────────────────────────────────────────────────────────\n\n/**\n * Queue a CSS rule for batched injection.\n * Multiple rules accumulated during one event loop tick are flushed together\n * in one requestAnimationFrame → one style recalculation.\n *\n * Rules diinjeksi via insertRule() — zero flicker, truly additive.\n */\nexport function batchedInject(cssRule: string): void {\n if (typeof window === \"undefined\") return // SSR — no-op\n if (!cssRule || injected.has(cssRule)) return\n\n injected.add(cssRule)\n pending.push(cssRule)\n\n if (_state.rafHandle === null) {\n _state.rafHandle = requestAnimationFrame(flushBatchedCss)\n }\n}\n\n/**\n * Immediately flush all pending CSS rules to the DOM.\n * Called automatically by RAF each frame. Can also be called manually\n * after synchronous component setup where RAF timing is too late.\n *\n * Setiap rule diinjeksi secara individual via insertRule() — tidak ada\n * window dimana existing rules hilang.\n */\nexport function flushBatchedCss(): void {\n _state.rafHandle = null\n\n if (pending.length === 0 || typeof document === \"undefined\") return\n\n // Flush semua rules sekaligus — satu per satu via insertRule()\n // insertRule() atomic per-rule: rule lama tidak pernah dihapus\n const rules = pending.splice(0)\n for (const rule of rules) {\n insertRuleToSheet(rule)\n }\n}\n\n/**\n * Synchronous inject — skips batching.\n * Use for SSR / critical path where RAF is not available.\n *\n * Menggunakan insertRule() — tidak ada flicker meskipun dipanggil\n * di tengah render cycle.\n */\nexport function syncInject(cssRule: string): void {\n if (typeof document === \"undefined\") return\n if (!cssRule || injected.has(cssRule)) return\n\n injected.add(cssRule)\n insertRuleToSheet(cssRule)\n}\n\n/**\n * Check if a rule has already been injected (deduplication check).\n */\nexport function isInjected(cssRule: string): boolean {\n return injected.has(cssRule)\n}\n\n/**\n * Clear all injected rules and remove the style element.\n * Useful for testing / SSR resets. Not for production use.\n */\nexport function resetBatchedCss(): void {\n injected.clear()\n pending.length = 0\n\n if (_state.rafHandle !== null) {\n cancelAnimationFrame(_state.rafHandle)\n _state.rafHandle = null\n }\n\n // Guard: document tidak tersedia di SSR / Node test environment\n if (typeof document !== \"undefined\" && _state.styleEl && document.head.contains(_state.styleEl)) {\n document.head.removeChild(_state.styleEl)\n _state.styleEl = null\n } else {\n _state.styleEl = null\n }\n}\n\n/**\n * Get stats about the current injection state (for devtools).\n */\nexport function getBatchedCssStats(): {\n totalInjected: number\n pendingCount: number\n hasBatchScheduled: boolean\n} {\n return {\n totalInjected: injected.size,\n pendingCount: pending.length,\n hasBatchScheduled: _state.rafHandle !== null,\n }\n}","/**\n * tailwind-styled-v4 — TwCssInjector\n *\n * React Server Component — inject route-specific CSS ke <head>.\n * Zero client JS, no hydration overhead, streaming-friendly.\n *\n * Pipeline:\n * 1. withTailwindStyled webpack plugin emit CSS manifest ke .next/static/css/tw/\n * 2. TwCssInjector baca manifest → inject <style> inline per route\n *\n * Usage:\n * // app/layout.tsx\n * import { TwCssInjector } from \"tailwind-styled-v4/runtime-css\"\n *\n * export default function Layout({ children }) {\n * return (\n * <html>\n * <head><TwCssInjector /></head>\n * <body>{children}</body>\n * </html>\n * )\n * }\n */\n\nimport React from \"react\"\n\ninterface CssInjectorProps {\n /** Route spesifik. Default: auto-detect */\n route?: string\n /** Inject global CSS juga. Default: true */\n includeGlobal?: boolean\n /** Minify inline CSS. Default: true */\n minify?: boolean\n /** CSS directory. Default: .next/static/css/tw */\n cssDir?: string\n}\n\n/**\n * Server Component — inject CSS per route ke <head>.\n * Baca dari manifest yang di-emit oleh TwCssManifestPlugin.\n */\nexport async function TwCssInjector(props: CssInjectorProps = {}): Promise<React.ReactElement> {\n const { route, includeGlobal = true, minify = true, cssDir } = props\n\n // Dynamic import fs — hanya jalan di server\n let fs: typeof import(\"node:fs\") | null = null\n let path: typeof import(\"node:path\") | null = null\n try {\n fs = await import(\"node:fs\")\n path = await import(\"node:path\")\n } catch {\n return React.createElement(React.Fragment, null)\n }\n\n const resolvedDir = cssDir\n ?? path.join(process.cwd(), \".next\", \"static\", \"css\", \"tw\")\n\n const manifestPath = path.join(resolvedDir, \"css-manifest.json\")\n\n // Baca manifest\n let manifest: { routes?: Record<string, string> } = {}\n try {\n if (fs.existsSync(manifestPath)) {\n manifest = JSON.parse(fs.readFileSync(manifestPath, \"utf-8\"))\n }\n } catch {\n // Manifest tidak ada — mungkin belum build atau native binding belum ready\n return React.createElement(React.Fragment, null)\n }\n\n const cssChunks: string[] = []\n\n // Global CSS (_global.css)\n if (includeGlobal && manifest.routes?.[\"__global\"]) {\n const globalPath = path.join(resolvedDir, manifest.routes[\"__global\"])\n const css = readFile(fs, globalPath)\n if (css) cssChunks.push(css)\n }\n\n // Route-specific CSS\n const targetRoute = route ?? \"/\"\n if (manifest.routes?.[targetRoute]) {\n const routePath = path.join(resolvedDir, manifest.routes[targetRoute])\n const css = readFile(fs, routePath)\n if (css) cssChunks.push(css)\n }\n\n if (cssChunks.length === 0) return React.createElement(React.Fragment, null)\n\n const combined = cssChunks.join(\"\\n\")\n const final = minify ? minifyCss(combined) : combined\n\n return React.createElement(\"style\", {\n dangerouslySetInnerHTML: { __html: final },\n \"data-tw-route\": targetRoute,\n \"data-tw-injector\": \"true\",\n })\n}\n\n/**\n * Hook untuk client components — CSS sudah di-handle TwCssInjector di server.\n */\nexport function useTwClasses(classes: string): string {\n return classes\n}\n\n// Helpers\nfunction readFile(fs: typeof import(\"node:fs\"), filepath: string): string | null {\n try {\n if (fs.existsSync(filepath)) return fs.readFileSync(filepath, \"utf-8\")\n } catch {}\n return null\n}\n\nfunction minifyCss(css: string): string {\n return css\n .replace(/\\/\\*[^*]*\\*+([^/*][^*]*\\*+)*\\//g, \"\")\n .replace(/\\s+/g, \" \")\n .replace(/\\s*{\\s*/g, \"{\")\n .replace(/\\s*}\\s*/g, \"}\")\n .replace(/\\s*;\\s*/g, \";\")\n .trim()\n}"],"mappings":";;;;;;;;;;;;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Q,GAAG,EACnB,QAAQ,YAAY,GAAG,EACvB,QAAQ,YAAY,GAAG,EACvB,QAAQ,YAAY,GAAG,EACvB,KAAK;AACV;","names":["React"]}
1
+ {"version":3,"sources":["../src/umbrella/runtime-css.ts","../packages/domain/runtime-css/src/batchedInjector.ts","../packages/domain/runtime-css/src/CssInjector.tsx"],"sourcesContent":["export * from \"@tailwind-styled/runtime-css\"\n","\"use client\"\n\n/**\n * tailwind-styled-v5 — Batched CSS Injector (Client Runtime)\n *\n * Menggantikan pattern inject-per-komponen yang menyebabkan banyak\n * style recalculation saat banyak komponen mount bersamaan.\n *\n * Cara kerja:\n * - Semua CSS rules dari render cycle yang sama dikumpulkan\n * - Satu requestAnimationFrame = satu DOM style update\n * - Deduplication via Set<string> — rule yang sama tidak diinjeksi dua kali\n * - Injection via CSSStyleSheet.insertRule() — TIDAK menghapus rules yang ada\n * - Fallback ke textContent += jika CSSOM API tidak tersedia\n *\n * PENTING — Kenapa insertRule() bukan textContent +=:\n * `el.textContent += css` terlihat additive tapi sebenarnya:\n * 1. Browser baca semua textContent yang ada\n * 2. HAPUS semua rules dari stylesheet\n * 3. Concat string baru\n * 4. Parse ulang dan re-add semua rules\n * Di step 2-3, ada window singkat dimana SEMUA styles hilang → FLICKER.\n *\n * `sheet.insertRule()` benar-benar additive — hanya menambah rule baru\n * tanpa menyentuh rules yang sudah ada. Zero flicker.\n *\n * Usage (internal, dipakai oleh stateEngine dan containerQuery):\n * import { batchedInject, flushBatchedCss } from \"./batchedInjector\"\n *\n * // Queue a rule\n * batchedInject(\".tw-s-abc123[data-active=\\\"true\\\"]{opacity:0.5}\")\n *\n * // Force flush (biasanya tidak perlu — RAF melakukan ini otomatis)\n * flushBatchedCss()\n */\n\n// ─────────────────────────────────────────────────────────────────────────────\n// Singleton state\n// ─────────────────────────────────────────────────────────────────────────────\n\n/** All injected rules (deduplication registry) */\nconst injected = new Set<string>()\n\n/** Pending rules for current RAF batch */\nconst pending: string[] = []\n\n/** RAF handle and style element state */\nconst _state = {\n rafHandle: null as ReturnType<typeof requestAnimationFrame> | null,\n styleEl: null as HTMLStyleElement | null,\n}\n\nfunction getStyleElement(): HTMLStyleElement {\n if (_state.styleEl && document.head.contains(_state.styleEl)) return _state.styleEl\n\n _state.styleEl = document.createElement(\"style\")\n _state.styleEl.id = \"__tw-runtime-css\"\n _state.styleEl.setAttribute(\"data-tw-batched\", \"true\")\n // Harus diappend ke DOM sebelum .sheet bisa diakses\n document.head.appendChild(_state.styleEl)\n return _state.styleEl\n}\n\n/**\n * Inject satu CSS rule via CSSStyleSheet.insertRule().\n *\n * Ini benar-benar additive — tidak menyentuh rules yang sudah ada.\n * Fallback ke textContent append jika sheet belum siap (edge case).\n *\n * @internal\n */\nfunction insertRuleToSheet(cssRule: string): void {\n const trimmed = cssRule.trim()\n if (!trimmed) return\n\n const el = getStyleElement()\n const sheet = el.sheet\n\n if (sheet) {\n try {\n // insertRule() di akhir — urutan tidak kritis untuk utility CSS\n sheet.insertRule(trimmed, sheet.cssRules.length)\n return\n } catch {\n // insertRule() bisa throw jika:\n // 1. Rule syntax tidak valid\n // 2. Multi-rule string (insertRule() hanya terima satu rule)\n // Fallback ke textContent append untuk kasus ini.\n if (process.env.NODE_ENV === \"development\") {\n console.warn(\"[tw] insertRule failed, falling back to textContent append for rule:\", trimmed.slice(0, 80))\n }\n }\n }\n\n // Fallback: textContent append.\n // Lebih jarang terjadi sekarang karena stateEngine sudah loop per-rule,\n // tapi tetap perlu sebagai safety net.\n el.textContent = (el.textContent ?? \"\") + `\\n${trimmed}`\n}\n\n// ─────────────────────────────────────────────────────────────────────────────\n// Core API\n// ─────────────────────────────────────────────────────────────────────────────\n\n/**\n * Queue a CSS rule for batched injection.\n * Multiple rules accumulated during one event loop tick are flushed together\n * in one requestAnimationFrame → one style recalculation.\n *\n * Rules diinjeksi via insertRule() — zero flicker, truly additive.\n */\nexport function batchedInject(cssRule: string): void {\n if (typeof window === \"undefined\") return // SSR — no-op\n if (!cssRule || injected.has(cssRule)) return\n\n injected.add(cssRule)\n pending.push(cssRule)\n\n if (_state.rafHandle === null) {\n _state.rafHandle = requestAnimationFrame(flushBatchedCss)\n }\n}\n\n/**\n * Immediately flush all pending CSS rules to the DOM.\n * Called automatically by RAF each frame. Can also be called manually\n * after synchronous component setup where RAF timing is too late.\n *\n * Setiap rule diinjeksi secara individual via insertRule() — tidak ada\n * window dimana existing rules hilang.\n */\nexport function flushBatchedCss(): void {\n _state.rafHandle = null\n\n if (pending.length === 0 || typeof document === \"undefined\") return\n\n // Flush semua rules sekaligus — satu per satu via insertRule()\n // insertRule() atomic per-rule: rule lama tidak pernah dihapus\n const rules = pending.splice(0)\n for (const rule of rules) {\n insertRuleToSheet(rule)\n }\n}\n\n/**\n * Synchronous inject — skips batching.\n * Use for SSR / critical path where RAF is not available.\n *\n * Menggunakan insertRule() — tidak ada flicker meskipun dipanggil\n * di tengah render cycle.\n */\nexport function syncInject(cssRule: string): void {\n if (typeof document === \"undefined\") return\n if (!cssRule || injected.has(cssRule)) return\n\n injected.add(cssRule)\n insertRuleToSheet(cssRule)\n}\n\n/**\n * Check if a rule has already been injected (deduplication check).\n */\nexport function isInjected(cssRule: string): boolean {\n return injected.has(cssRule)\n}\n\n/**\n * Clear all injected rules and remove the style element.\n * Useful for testing / SSR resets. Not for production use.\n */\nexport function resetBatchedCss(): void {\n injected.clear()\n pending.length = 0\n\n if (_state.rafHandle !== null) {\n cancelAnimationFrame(_state.rafHandle)\n _state.rafHandle = null\n }\n\n // Guard: document tidak tersedia di SSR / Node test environment\n if (typeof document !== \"undefined\" && _state.styleEl && document.head.contains(_state.styleEl)) {\n document.head.removeChild(_state.styleEl)\n _state.styleEl = null\n } else {\n _state.styleEl = null\n }\n}\n\n/**\n * Get stats about the current injection state (for devtools).\n */\nexport function getBatchedCssStats(): {\n totalInjected: number\n pendingCount: number\n hasBatchScheduled: boolean\n} {\n return {\n totalInjected: injected.size,\n pendingCount: pending.length,\n hasBatchScheduled: _state.rafHandle !== null,\n }\n}","/**\n * tailwind-styled-v4 — TwCssInjector\n *\n * React Server Component — inject route-specific CSS ke <head>.\n * Zero client JS, no hydration overhead, streaming-friendly.\n *\n * Pipeline:\n * 1. withTailwindStyled webpack plugin emit CSS manifest ke .next/static/css/tw/\n * 2. TwCssInjector baca manifest → inject <style> inline per route\n *\n * Usage:\n * // app/layout.tsx\n * import { TwCssInjector } from \"tailwind-styled-v4/runtime-css\"\n *\n * export default function Layout({ children }) {\n * return (\n * <html>\n * <head><TwCssInjector /></head>\n * <body>{children}</body>\n * </html>\n * )\n * }\n */\n\nimport React from \"react\"\n\ninterface CssInjectorProps {\n /** Route spesifik. Default: auto-detect */\n route?: string\n /** Inject global CSS juga. Default: true */\n includeGlobal?: boolean\n /** Minify inline CSS. Default: true */\n minify?: boolean\n /** CSS directory. Default: .next/static/css/tw */\n cssDir?: string\n}\n\n/**\n * Server Component — inject CSS per route ke <head>.\n * Baca dari manifest yang di-emit oleh TwCssManifestPlugin.\n */\nexport async function TwCssInjector(props: CssInjectorProps = {}): Promise<React.ReactElement> {\n const { route, includeGlobal = true, minify = true, cssDir } = props\n\n // Dynamic import fs — hanya jalan di server\n let fs: typeof import(\"node:fs\") | null = null\n let path: typeof import(\"node:path\") | null = null\n try {\n fs = await import(\"node:fs\")\n path = await import(\"node:path\")\n } catch {\n return React.createElement(React.Fragment, null)\n }\n\n const resolvedDir = cssDir\n ?? path.join(process.cwd(), \".next\", \"static\", \"css\", \"tw\")\n\n const manifestPath = path.join(resolvedDir, \"css-manifest.json\")\n\n // Baca manifest\n let manifest: { routes?: Record<string, string> } = {}\n try {\n if (fs.existsSync(manifestPath)) {\n manifest = JSON.parse(fs.readFileSync(manifestPath, \"utf-8\"))\n }\n } catch {\n // Manifest tidak ada — mungkin belum build atau native binding belum ready\n return React.createElement(React.Fragment, null)\n }\n\n const cssChunks: string[] = []\n\n // Global CSS (_global.css)\n if (includeGlobal && manifest.routes?.[\"__global\"]) {\n const globalPath = path.join(resolvedDir, manifest.routes[\"__global\"])\n const css = readFile(fs, globalPath)\n if (css) cssChunks.push(css)\n }\n\n // Route-specific CSS\n const targetRoute = route ?? \"/\"\n if (manifest.routes?.[targetRoute]) {\n const routePath = path.join(resolvedDir, manifest.routes[targetRoute])\n const css = readFile(fs, routePath)\n if (css) cssChunks.push(css)\n }\n\n if (cssChunks.length === 0) return React.createElement(React.Fragment, null)\n\n const combined = cssChunks.join(\"\\n\")\n const final = minify ? minifyCss(combined) : combined\n\n return React.createElement(\"style\", {\n dangerouslySetInnerHTML: { __html: final },\n \"data-tw-route\": targetRoute,\n \"data-tw-injector\": \"true\",\n })\n}\n\n/**\n * Hook untuk client components — CSS sudah di-handle TwCssInjector di server.\n */\nexport function useTwClasses(classes: string): string {\n return classes\n}\n\n// Helpers\nfunction readFile(fs: typeof import(\"node:fs\"), filepath: string): string | null {\n try {\n if (fs.existsSync(filepath)) return fs.readFileSync(filepath, \"utf-8\")\n } catch {}\n return null\n}\n\nfunction minifyCss(css: string): string {\n return css\n .replace(/\\/\\*[^*]*\\*+([^/*][^*]*\\*+)*\\//g, \"\")\n .replace(/\\s+/g, \" \")\n .replace(/\\s*{\\s*/g, \"{\")\n .replace(/\\s*}\\s*/g, \"}\")\n .replace(/\\s*;\\s*/g, \";\")\n .trim()\n}"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;;ACyCA,IAAM,WAAW,oBAAI,IAAY;AAGjC,IAAM,UAAoB,CAAC;AAG3B,IAAM,SAAS;AAAA,EACb,WAAW;AAAA,EACX,SAAS;AACX;AAEA,SAAS,kBAAoC;AAC3C,MAAI,OAAO,WAAW,SAAS,KAAK,SAAS,OAAO,OAAO,EAAG,QAAO,OAAO;AAE5E,SAAO,UAAU,SAAS,cAAc,OAAO;AAC/C,SAAO,QAAQ,KAAK;AACpB,SAAO,QAAQ,aAAa,mBAAmB,MAAM;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KAAK,GAAG;AAAA,EAC7B;AAGA,QAAM,cAAc,SAAS;AAC7B,MAAI,SAAS,SAAS,WAAW,GAAG;AAClC,UAAM,YAAY,KAAK,KAAK,aAAa,SAAS,OAAO,WAAW,CAAC;AACrE,UAAM,MAAM,SAAS,IAAI,SAAS;AAClC,QAAI,IAAK,WAAU,KAAK,GAAG;AAAA,EAC7B;AAEA,MAAI,UAAU,WAAW,EAAG,QAAO,aAAAA,QAAM,cAAc,aAAAA,QAAM,UAAU,IAAI;AAE3E,QAAM,WAAW,UAAU,KAAK,IAAI;AACpC,QAAM,QAAQ,SAAS,UAAU,QAAQ,IAAI;AAE7C,SAAO,aAAAA,QAAM,cAAc,SAAS;AAAA,IAClC,yBAAyB,EAAE,QAAQ,MAAM;AAAA,IACzC,iBAAiB;AAAA,IACjB,oBAAoB;AAAA,EACtB,CAAC;AACH;AAKO,SAAS,aAAa,SAAyB;AACpD,SAAO;AACT;AAGA,SAAS,SAAS,IAA8B,UAAiC;AAC/E,MAAI;AACF,QAAI,GAAG,WAAW,QAAQ,EAAG,QAAO,GAAG,aAAa,UAAU,OAAO;AAAA,EACvE,QAAQ;AAAA,EAAC;AACT,SAAO;AACT;AAEA,SAAS,UAAU,KAAqB;AACtC,SAAO,IACJ,QAAQ,mCAAmC,EAAE,EAC7C,QAAQ,QAAQ,GAAG,EACnB,QAAQ,YAAY,GAAG,EACvB,QAAQ,YAAY,GAAG,EACvB,QAAQ,YAAY,GAAG,EACvB,KAAK;AACV;","names":["React"]}
@@ -1,4 +1,4 @@
1
- /* tailwind-styled-v4 v5.0.4 | MIT | https://github.com/dictionar32/tailwind-styled-v4 */
1
+ "use client"
2
2
 
3
3
  // packages/domain/runtime-css/src/batchedInjector.ts
4
4
  var injected = /* @__PURE__ */ new Set();
@@ -147,4 +147,5 @@ export {
147
147
  syncInject,
148
148
  useTwClasses
149
149
  };
150
+ /* tailwind-styled-v4 v5.1.9 | MIT | https://github.com/dictionar32/tailwind-styled-v4 */
150
151
  //# sourceMappingURL=runtime-css.mjs.map