tailwind-styled-v4 5.1.22 → 5.1.23
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +216 -0
- package/dist/atomic.js +34 -4
- package/dist/atomic.js.map +1 -1
- package/dist/atomic.mjs +31 -2
- package/dist/atomic.mjs.map +1 -1
- package/dist/cli.js +132 -97
- package/dist/cli.js.map +1 -1
- package/dist/cli.mjs +129 -95
- package/dist/cli.mjs.map +1 -1
- package/dist/compiler.d.mts +195 -1
- package/dist/compiler.d.ts +195 -1
- package/dist/compiler.js +356 -12
- package/dist/compiler.js.map +1 -1
- package/dist/compiler.mjs +340 -10
- package/dist/compiler.mjs.map +1 -1
- package/dist/engine.js +194 -164
- package/dist/engine.js.map +1 -1
- package/dist/engine.mjs +184 -155
- package/dist/engine.mjs.map +1 -1
- package/dist/index.browser.mjs +144 -14
- package/dist/index.browser.mjs.map +1 -1
- package/dist/index.d.mts +45 -4
- package/dist/index.d.ts +45 -4
- package/dist/index.js +174 -9
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +185 -21
- package/dist/index.mjs.map +1 -1
- package/dist/next.js +489 -158
- package/dist/next.js.map +1 -1
- package/dist/next.mjs +483 -153
- package/dist/next.mjs.map +1 -1
- package/dist/runtime-css.js +1 -1
- package/dist/runtime-css.js.map +1 -1
- package/dist/runtime-css.mjs +1 -1
- package/dist/runtime-css.mjs.map +1 -1
- package/dist/runtime.js +17 -0
- package/dist/runtime.js.map +1 -1
- package/dist/runtime.mjs +23 -0
- package/dist/runtime.mjs.map +1 -1
- package/dist/shared.js +91 -61
- package/dist/shared.js.map +1 -1
- package/dist/shared.mjs +85 -56
- package/dist/shared.mjs.map +1 -1
- package/dist/turbopackLoader.js +79 -49
- package/dist/turbopackLoader.js.map +1 -1
- package/dist/turbopackLoader.mjs +76 -47
- package/dist/turbopackLoader.mjs.map +1 -1
- package/dist/tw.js +132 -97
- package/dist/tw.js.map +1 -1
- package/dist/tw.mjs +129 -95
- package/dist/tw.mjs.map +1 -1
- package/dist/vite.js +157 -127
- package/dist/vite.js.map +1 -1
- package/dist/vite.mjs +150 -121
- package/dist/vite.mjs.map +1 -1
- package/dist/webpackLoader.js +39 -9
- package/dist/webpackLoader.js.map +1 -1
- package/dist/webpackLoader.mjs +36 -7
- package/dist/webpackLoader.mjs.map +1 -1
- package/package.json +1 -1
- package/CHANGELOG.md +0 -182
package/dist/vite.js
CHANGED
|
@@ -230,9 +230,9 @@ function parseNative(schema, data, context) {
|
|
|
230
230
|
const result = schema.safeParse(data);
|
|
231
231
|
if (!result.success) {
|
|
232
232
|
const first = result.error.issues[0];
|
|
233
|
-
const
|
|
233
|
+
const path18 = first?.path?.join(".") ?? "(root)";
|
|
234
234
|
throw new Error(
|
|
235
|
-
`[${context}] Native binding returned unexpected data: ${
|
|
235
|
+
`[${context}] Native binding returned unexpected data: ${path18}: ${first?.message ?? "validation failed"}`
|
|
236
236
|
);
|
|
237
237
|
}
|
|
238
238
|
return result.data;
|
|
@@ -667,11 +667,11 @@ function resolvePath(...segments) {
|
|
|
667
667
|
return segments.join("/").replace(/\/+/g, "/");
|
|
668
668
|
}
|
|
669
669
|
}
|
|
670
|
-
function existsSync(
|
|
670
|
+
function existsSync(path18) {
|
|
671
671
|
if (isBrowser2) return false;
|
|
672
672
|
try {
|
|
673
673
|
const nodeFs = require(NODE_FS);
|
|
674
|
-
return nodeFs.existsSync(
|
|
674
|
+
return nodeFs.existsSync(path18);
|
|
675
675
|
} catch {
|
|
676
676
|
return false;
|
|
677
677
|
}
|
|
@@ -1026,9 +1026,9 @@ var init_native_resolution = __esm({
|
|
|
1026
1026
|
// packages/domain/shared/src/observability.ts
|
|
1027
1027
|
function createObservabilityClient(opts = {}) {
|
|
1028
1028
|
const { baseUrl = "http://localhost:7421", timeoutMs = 3e3 } = opts;
|
|
1029
|
-
async function fetchJson(
|
|
1029
|
+
async function fetchJson(path18) {
|
|
1030
1030
|
try {
|
|
1031
|
-
const res = await fetch(`${baseUrl}${
|
|
1031
|
+
const res = await fetch(`${baseUrl}${path18}`, {
|
|
1032
1032
|
signal: AbortSignal.timeout(timeoutMs)
|
|
1033
1033
|
});
|
|
1034
1034
|
if (!res.ok) return null;
|
|
@@ -3453,9 +3453,9 @@ function createDebugLogger(namespace, label) {
|
|
|
3453
3453
|
}
|
|
3454
3454
|
};
|
|
3455
3455
|
}
|
|
3456
|
-
function formatIssuePath(
|
|
3457
|
-
if (!
|
|
3458
|
-
return
|
|
3456
|
+
function formatIssuePath(path18) {
|
|
3457
|
+
if (!path18 || path18.length === 0) return "(root)";
|
|
3458
|
+
return path18.map(
|
|
3459
3459
|
(segment) => typeof segment === "symbol" ? segment.description ?? segment.toString() : String(segment)
|
|
3460
3460
|
).join(".");
|
|
3461
3461
|
}
|
|
@@ -3599,8 +3599,8 @@ var init_src = __esm({
|
|
|
3599
3599
|
/** Buat TwError dari ZodError — dukung shape Zod v3 (`errors`) dan v4 (`issues`). */
|
|
3600
3600
|
static fromZod(err) {
|
|
3601
3601
|
const first = err.issues?.[0] ?? err.errors?.[0];
|
|
3602
|
-
const
|
|
3603
|
-
const message = first ? `${
|
|
3602
|
+
const path18 = formatIssuePath(first?.path);
|
|
3603
|
+
const message = first ? `${path18}: ${first.message}` : "Schema validation failed";
|
|
3604
3604
|
return new _TwError("validation", "SCHEMA_VALIDATION_FAILED", message, err);
|
|
3605
3605
|
}
|
|
3606
3606
|
static wrap(source, code, err) {
|
|
@@ -3672,7 +3672,7 @@ var init_nativeBridge = __esm({
|
|
|
3672
3672
|
"use strict";
|
|
3673
3673
|
init_cjs_shims();
|
|
3674
3674
|
init_src();
|
|
3675
|
-
_loadNative = (
|
|
3675
|
+
_loadNative = (path18) => require(path18);
|
|
3676
3676
|
log = (...args) => {
|
|
3677
3677
|
if (process.env.DEBUG?.includes("compiler:native")) {
|
|
3678
3678
|
console.log("[compiler:native]", ...args);
|
|
@@ -3786,6 +3786,33 @@ var init_routeGraph = __esm({
|
|
|
3786
3786
|
}
|
|
3787
3787
|
});
|
|
3788
3788
|
|
|
3789
|
+
// packages/domain/compiler/src/semanticComponentAnalyzer.ts
|
|
3790
|
+
var init_semanticComponentAnalyzer = __esm({
|
|
3791
|
+
"packages/domain/compiler/src/semanticComponentAnalyzer.ts"() {
|
|
3792
|
+
"use strict";
|
|
3793
|
+
init_cjs_shims();
|
|
3794
|
+
}
|
|
3795
|
+
});
|
|
3796
|
+
|
|
3797
|
+
// packages/domain/compiler/src/typeGeneratorFromMetadata.ts
|
|
3798
|
+
var init_typeGeneratorFromMetadata = __esm({
|
|
3799
|
+
"packages/domain/compiler/src/typeGeneratorFromMetadata.ts"() {
|
|
3800
|
+
"use strict";
|
|
3801
|
+
init_cjs_shims();
|
|
3802
|
+
}
|
|
3803
|
+
});
|
|
3804
|
+
|
|
3805
|
+
// packages/domain/compiler/src/typeGenerationPlugin.ts
|
|
3806
|
+
var import_node_fs5, import_node_path5;
|
|
3807
|
+
var init_typeGenerationPlugin = __esm({
|
|
3808
|
+
"packages/domain/compiler/src/typeGenerationPlugin.ts"() {
|
|
3809
|
+
"use strict";
|
|
3810
|
+
init_cjs_shims();
|
|
3811
|
+
import_node_fs5 = __toESM(require("fs"), 1);
|
|
3812
|
+
import_node_path5 = __toESM(require("path"), 1);
|
|
3813
|
+
}
|
|
3814
|
+
});
|
|
3815
|
+
|
|
3789
3816
|
// packages/domain/compiler/src/index.ts
|
|
3790
3817
|
function _layoutClassesToCss(classes) {
|
|
3791
3818
|
const native = getNativeBridge();
|
|
@@ -3821,13 +3848,13 @@ function extractContainerCssFromSource(source) {
|
|
|
3821
3848
|
}
|
|
3822
3849
|
return rules.join("\n");
|
|
3823
3850
|
}
|
|
3824
|
-
var
|
|
3851
|
+
var import_node_fs6, import_node_path6, import_node_module5, _require3, transformSource, hasTwUsage, isAlreadyTransformed, shouldProcess, compileCssFromClasses, buildStyleTag, generateCssForClasses, eliminateDeadCss, findDeadVariants, runElimination, scanProjectUsage, generateSafelist, loadSafelist, loadTailwindConfig, getContentPaths, _CONTAINER_BREAKPOINTS, runLoaderTransform, shouldSkipFile, fileToRoute, getAllRoutes, _fileClassesMap, _globalClasses, getRouteClasses, getAllRegisteredClasses, registerFileClasses, registerGlobalClasses, resetRouteClassRegistry, _incrementalEngineInstance, getIncrementalEngine, resetIncrementalEngine, IncrementalEngine, getBucketEngine, resetBucketEngine, classifyNode, detectConflicts, bucketSort, analyzeFile, analyzeVariantUsage, injectClientDirective, injectServerOnlyComment, analyzeClasses, extractTwStateConfigs, generateStaticStateCss, extractAndGenerateStateCss;
|
|
3825
3852
|
var init_src2 = __esm({
|
|
3826
3853
|
"packages/domain/compiler/src/index.ts"() {
|
|
3827
3854
|
"use strict";
|
|
3828
3855
|
init_cjs_shims();
|
|
3829
|
-
|
|
3830
|
-
|
|
3856
|
+
import_node_fs6 = __toESM(require("fs"), 1);
|
|
3857
|
+
import_node_path6 = __toESM(require("path"), 1);
|
|
3831
3858
|
import_node_module5 = require("module");
|
|
3832
3859
|
init_nativeBridge();
|
|
3833
3860
|
init_compiler();
|
|
@@ -3837,6 +3864,9 @@ var init_src2 = __esm({
|
|
|
3837
3864
|
init_redis();
|
|
3838
3865
|
init_watch();
|
|
3839
3866
|
init_routeGraph();
|
|
3867
|
+
init_semanticComponentAnalyzer();
|
|
3868
|
+
init_typeGeneratorFromMetadata();
|
|
3869
|
+
init_typeGenerationPlugin();
|
|
3840
3870
|
_require3 = (0, import_node_module5.createRequire)(
|
|
3841
3871
|
typeof require !== "undefined" ? typeof __filename !== "undefined" ? `file://${__filename}` : "file://unknown" : importMetaUrl
|
|
3842
3872
|
);
|
|
@@ -3931,7 +3961,7 @@ var init_src2 = __esm({
|
|
|
3931
3961
|
};
|
|
3932
3962
|
scanProjectUsage = (dirs, cwd) => {
|
|
3933
3963
|
const { batchExtractClasses: batchExtractClasses2 } = _require3("./parser");
|
|
3934
|
-
const files = dirs.map((dir) =>
|
|
3964
|
+
const files = dirs.map((dir) => import_node_path6.default.resolve(cwd, dir));
|
|
3935
3965
|
const results = batchExtractClasses2(files) || [];
|
|
3936
3966
|
const combined = {};
|
|
3937
3967
|
for (const result of results) {
|
|
@@ -3948,13 +3978,13 @@ var init_src2 = __esm({
|
|
|
3948
3978
|
const classes = scanProjectUsage(scanDirs, cwd || process.cwd());
|
|
3949
3979
|
const allClasses = Object.keys(classes).sort();
|
|
3950
3980
|
if (outputPath) {
|
|
3951
|
-
|
|
3981
|
+
import_node_fs6.default.writeFileSync(outputPath, JSON.stringify(allClasses, null, 2));
|
|
3952
3982
|
}
|
|
3953
3983
|
return allClasses;
|
|
3954
3984
|
};
|
|
3955
3985
|
loadSafelist = (safelistPath) => {
|
|
3956
3986
|
try {
|
|
3957
|
-
const content =
|
|
3987
|
+
const content = import_node_fs6.default.readFileSync(safelistPath, "utf-8");
|
|
3958
3988
|
return JSON.parse(content);
|
|
3959
3989
|
} catch {
|
|
3960
3990
|
return [];
|
|
@@ -3968,8 +3998,8 @@ var init_src2 = __esm({
|
|
|
3968
3998
|
"tailwind.config.cjs"
|
|
3969
3999
|
];
|
|
3970
4000
|
for (const file of configFiles) {
|
|
3971
|
-
const fullPath =
|
|
3972
|
-
if (
|
|
4001
|
+
const fullPath = import_node_path6.default.join(cwd, file);
|
|
4002
|
+
if (import_node_fs6.default.existsSync(fullPath)) {
|
|
3973
4003
|
const mod = require(fullPath);
|
|
3974
4004
|
return mod.default || mod;
|
|
3975
4005
|
}
|
|
@@ -3979,9 +4009,9 @@ var init_src2 = __esm({
|
|
|
3979
4009
|
getContentPaths = (cwd = process.cwd()) => {
|
|
3980
4010
|
return {
|
|
3981
4011
|
content: [
|
|
3982
|
-
|
|
3983
|
-
|
|
3984
|
-
|
|
4012
|
+
import_node_path6.default.join(cwd, "src/**/*.{js,ts,jsx,tsx}"),
|
|
4013
|
+
import_node_path6.default.join(cwd, "app/**/*.{js,ts,jsx,tsx}"),
|
|
4014
|
+
import_node_path6.default.join(cwd, "pages/**/*.{js,ts,jsx,tsx}")
|
|
3985
4015
|
]
|
|
3986
4016
|
};
|
|
3987
4017
|
};
|
|
@@ -4234,7 +4264,7 @@ function getDirname2() {
|
|
|
4234
4264
|
return __dirname;
|
|
4235
4265
|
}
|
|
4236
4266
|
if (typeof import_meta4 !== "undefined" && importMetaUrl) {
|
|
4237
|
-
return
|
|
4267
|
+
return import_node_path7.default.dirname((0, import_node_url2.fileURLToPath)(importMetaUrl));
|
|
4238
4268
|
}
|
|
4239
4269
|
return process.cwd();
|
|
4240
4270
|
}
|
|
@@ -4446,12 +4476,12 @@ function hasNativeWatchBinding() {
|
|
|
4446
4476
|
return false;
|
|
4447
4477
|
}
|
|
4448
4478
|
}
|
|
4449
|
-
var
|
|
4479
|
+
var import_node_path7, import_node_url2, import_meta4, log2, isValidScannerBinding, createScannerBridgeLoader, scannerBridgeLoader, scannerGetBinding, resetScannerBridgeCache;
|
|
4450
4480
|
var init_native_bridge = __esm({
|
|
4451
4481
|
"packages/domain/scanner/src/native-bridge.ts"() {
|
|
4452
4482
|
"use strict";
|
|
4453
4483
|
init_cjs_shims();
|
|
4454
|
-
|
|
4484
|
+
import_node_path7 = __toESM(require("path"), 1);
|
|
4455
4485
|
import_node_url2 = require("url");
|
|
4456
4486
|
init_src();
|
|
4457
4487
|
import_meta4 = {};
|
|
@@ -4541,8 +4571,8 @@ var init_native_bridge = __esm({
|
|
|
4541
4571
|
|
|
4542
4572
|
// packages/domain/scanner/src/cache-native.ts
|
|
4543
4573
|
function defaultCachePath(rootDir, cacheDir) {
|
|
4544
|
-
const dir = cacheDir ?
|
|
4545
|
-
return
|
|
4574
|
+
const dir = cacheDir ? import_node_path8.default.resolve(rootDir, cacheDir) : import_node_path8.default.join(process.cwd(), ".cache", "tailwind-styled");
|
|
4575
|
+
return import_node_path8.default.join(dir, "scanner-cache.json");
|
|
4546
4576
|
}
|
|
4547
4577
|
function metaPathFor(cachePath) {
|
|
4548
4578
|
return cachePath.replace(/\.json$/, ".meta.json");
|
|
@@ -4555,7 +4585,7 @@ function getBinaryFingerprint() {
|
|
|
4555
4585
|
_cachedFingerprint = null;
|
|
4556
4586
|
return null;
|
|
4557
4587
|
}
|
|
4558
|
-
const stat =
|
|
4588
|
+
const stat = import_node_fs7.default.statSync(loadedPath);
|
|
4559
4589
|
_cachedFingerprint = `${stat.mtimeMs}:${stat.size}`;
|
|
4560
4590
|
} catch {
|
|
4561
4591
|
_cachedFingerprint = null;
|
|
@@ -4564,13 +4594,13 @@ function getBinaryFingerprint() {
|
|
|
4564
4594
|
}
|
|
4565
4595
|
function readCache(rootDir, cacheDir) {
|
|
4566
4596
|
const cachePath = defaultCachePath(rootDir, cacheDir);
|
|
4567
|
-
|
|
4597
|
+
import_node_fs7.default.mkdirSync(import_node_path8.default.dirname(cachePath), { recursive: true });
|
|
4568
4598
|
const currentFingerprint = getBinaryFingerprint();
|
|
4569
4599
|
if (currentFingerprint !== null) {
|
|
4570
4600
|
const metaPath = metaPathFor(cachePath);
|
|
4571
4601
|
let storedFingerprint = null;
|
|
4572
4602
|
try {
|
|
4573
|
-
storedFingerprint = JSON.parse(
|
|
4603
|
+
storedFingerprint = JSON.parse(import_node_fs7.default.readFileSync(metaPath, "utf8")).binaryFingerprint ?? null;
|
|
4574
4604
|
} catch {
|
|
4575
4605
|
}
|
|
4576
4606
|
if (storedFingerprint !== currentFingerprint) {
|
|
@@ -4594,7 +4624,7 @@ function readCache(rootDir, cacheDir) {
|
|
|
4594
4624
|
}
|
|
4595
4625
|
function writeCache(rootDir, entries, cacheDir) {
|
|
4596
4626
|
const cachePath = defaultCachePath(rootDir, cacheDir);
|
|
4597
|
-
|
|
4627
|
+
import_node_fs7.default.mkdirSync(import_node_path8.default.dirname(cachePath), { recursive: true });
|
|
4598
4628
|
const success = cacheWriteNative(cachePath, entries);
|
|
4599
4629
|
if (!success) {
|
|
4600
4630
|
throw new Error(
|
|
@@ -4604,7 +4634,7 @@ function writeCache(rootDir, entries, cacheDir) {
|
|
|
4604
4634
|
const currentFingerprint = getBinaryFingerprint();
|
|
4605
4635
|
if (currentFingerprint !== null) {
|
|
4606
4636
|
try {
|
|
4607
|
-
|
|
4637
|
+
import_node_fs7.default.writeFileSync(
|
|
4608
4638
|
metaPathFor(cachePath),
|
|
4609
4639
|
JSON.stringify({ binaryFingerprint: currentFingerprint }),
|
|
4610
4640
|
"utf8"
|
|
@@ -4624,13 +4654,13 @@ function filePriority(mtimeMs, size, cached, nowMs = Date.now()) {
|
|
|
4624
4654
|
nowMs
|
|
4625
4655
|
);
|
|
4626
4656
|
}
|
|
4627
|
-
var
|
|
4657
|
+
var import_node_fs7, import_node_path8, _cachedFingerprint, STALE_THRESHOLD_MS;
|
|
4628
4658
|
var init_cache_native = __esm({
|
|
4629
4659
|
"packages/domain/scanner/src/cache-native.ts"() {
|
|
4630
4660
|
"use strict";
|
|
4631
4661
|
init_cjs_shims();
|
|
4632
|
-
|
|
4633
|
-
|
|
4662
|
+
import_node_fs7 = __toESM(require("fs"), 1);
|
|
4663
|
+
import_node_path8 = __toESM(require("path"), 1);
|
|
4634
4664
|
init_native_bridge();
|
|
4635
4665
|
STALE_THRESHOLD_MS = 7 * 24 * 60 * 60 * 1e3;
|
|
4636
4666
|
}
|
|
@@ -4677,7 +4707,7 @@ async function scanWorkspaceParallel(rootDir, options = {}) {
|
|
|
4677
4707
|
maxWorkers = Math.max(1, (0, import_node_os.availableParallelism)() - 1),
|
|
4678
4708
|
chunkSize = DEFAULT_CHUNK_SIZE
|
|
4679
4709
|
} = options;
|
|
4680
|
-
const files = collectFiles2(
|
|
4710
|
+
const files = collectFiles2(import_node_path9.default.resolve(rootDir), extensions, ignoreDirs);
|
|
4681
4711
|
if (files.length < PARALLEL_THRESHOLD) {
|
|
4682
4712
|
return mergeResults(batchExtractClassesNative2(files));
|
|
4683
4713
|
}
|
|
@@ -4693,13 +4723,13 @@ async function scanWorkspaceParallel(rootDir, options = {}) {
|
|
|
4693
4723
|
}
|
|
4694
4724
|
return mergeResults(allResults);
|
|
4695
4725
|
}
|
|
4696
|
-
var import_node_worker_threads,
|
|
4726
|
+
var import_node_worker_threads, import_node_path9, import_node_os, import_node_url3, PARALLEL_THRESHOLD, DEFAULT_CHUNK_SIZE, _workerFilename;
|
|
4697
4727
|
var init_parallel_scanner = __esm({
|
|
4698
4728
|
"packages/domain/scanner/src/parallel-scanner.ts"() {
|
|
4699
4729
|
"use strict";
|
|
4700
4730
|
init_cjs_shims();
|
|
4701
4731
|
import_node_worker_threads = require("worker_threads");
|
|
4702
|
-
|
|
4732
|
+
import_node_path9 = __toESM(require("path"), 1);
|
|
4703
4733
|
import_node_os = require("os");
|
|
4704
4734
|
import_node_url3 = require("url");
|
|
4705
4735
|
init_src3();
|
|
@@ -4732,12 +4762,12 @@ var init_schemas = __esm({
|
|
|
4732
4762
|
init_cjs_shims();
|
|
4733
4763
|
import_zod3 = require("zod");
|
|
4734
4764
|
init_src();
|
|
4735
|
-
formatIssuePath2 = (
|
|
4765
|
+
formatIssuePath2 = (path18) => path18.length > 0 ? path18.map(
|
|
4736
4766
|
(segment) => typeof segment === "symbol" ? segment.description ?? segment.toString() : String(segment)
|
|
4737
4767
|
).join(".") : "<root>";
|
|
4738
4768
|
formatIssues = (error) => error.issues.map((issue) => {
|
|
4739
|
-
const
|
|
4740
|
-
return `${
|
|
4769
|
+
const path18 = formatIssuePath2(issue.path);
|
|
4770
|
+
return `${path18}: ${issue.message}`;
|
|
4741
4771
|
}).join("; ");
|
|
4742
4772
|
parseWithSchema = (schema, data, label) => {
|
|
4743
4773
|
const parsed = schema.safeParse(data);
|
|
@@ -4814,7 +4844,7 @@ function getRuntimeDir() {
|
|
|
4814
4844
|
return __dirname;
|
|
4815
4845
|
}
|
|
4816
4846
|
if (typeof import_meta5 !== "undefined" && importMetaUrl) {
|
|
4817
|
-
return
|
|
4847
|
+
return import_node_path10.default.dirname((0, import_node_url4.fileURLToPath)(importMetaUrl));
|
|
4818
4848
|
}
|
|
4819
4849
|
return process.cwd();
|
|
4820
4850
|
}
|
|
@@ -4824,17 +4854,17 @@ function resolveScannerWorkerModulePath() {
|
|
|
4824
4854
|
return __dirname;
|
|
4825
4855
|
}
|
|
4826
4856
|
if (typeof import_meta5 !== "undefined" && importMetaUrl) {
|
|
4827
|
-
return
|
|
4857
|
+
return import_node_path10.default.dirname((0, import_node_url4.fileURLToPath)(importMetaUrl));
|
|
4828
4858
|
}
|
|
4829
4859
|
return process.cwd();
|
|
4830
4860
|
})();
|
|
4831
4861
|
const candidates = [
|
|
4832
|
-
|
|
4833
|
-
|
|
4834
|
-
|
|
4862
|
+
import_node_path10.default.resolve(runtimeDir, "worker.cjs"),
|
|
4863
|
+
import_node_path10.default.resolve(runtimeDir, "worker.js"),
|
|
4864
|
+
import_node_path10.default.resolve(runtimeDir, "worker.ts")
|
|
4835
4865
|
];
|
|
4836
4866
|
for (const candidate of candidates) {
|
|
4837
|
-
if (
|
|
4867
|
+
if (import_node_fs8.default.existsSync(candidate)) return candidate;
|
|
4838
4868
|
}
|
|
4839
4869
|
return null;
|
|
4840
4870
|
}
|
|
@@ -4891,19 +4921,19 @@ function collectCandidates(rootDir, ignoreDirectories, extensionSet) {
|
|
|
4891
4921
|
if (!currentDir) continue;
|
|
4892
4922
|
const entries = (() => {
|
|
4893
4923
|
try {
|
|
4894
|
-
return
|
|
4924
|
+
return import_node_fs8.default.readdirSync(currentDir, { withFileTypes: true });
|
|
4895
4925
|
} catch {
|
|
4896
4926
|
return [];
|
|
4897
4927
|
}
|
|
4898
4928
|
})();
|
|
4899
4929
|
for (const entry of entries) {
|
|
4900
|
-
const fullPath =
|
|
4930
|
+
const fullPath = import_node_path10.default.join(currentDir, entry.name);
|
|
4901
4931
|
if (entry.isDirectory()) {
|
|
4902
4932
|
if (!ignoreDirectories.has(entry.name)) directories.push(fullPath);
|
|
4903
4933
|
continue;
|
|
4904
4934
|
}
|
|
4905
4935
|
if (!entry.isFile()) continue;
|
|
4906
|
-
if (!extensionSet.has(
|
|
4936
|
+
if (!extensionSet.has(import_node_path10.default.extname(entry.name))) continue;
|
|
4907
4937
|
candidates.push(fullPath);
|
|
4908
4938
|
}
|
|
4909
4939
|
}
|
|
@@ -4930,7 +4960,7 @@ function scanSource(source) {
|
|
|
4930
4960
|
);
|
|
4931
4961
|
}
|
|
4932
4962
|
function isScannableFile2(filePath, includeExtensions = DEFAULT_EXTENSIONS) {
|
|
4933
|
-
return includeExtensions.includes(
|
|
4963
|
+
return includeExtensions.includes(import_node_path10.default.extname(filePath));
|
|
4934
4964
|
}
|
|
4935
4965
|
function scanFile2(filePath) {
|
|
4936
4966
|
const { scanFileNative: scanFileNative3 } = (init_native_bridge(), __toCommonJS(native_bridge_exports));
|
|
@@ -4990,7 +5020,7 @@ function scanWorkspace2(rootDir, options = {}) {
|
|
|
4990
5020
|
for (const filePath of candidates) {
|
|
4991
5021
|
const stat = (() => {
|
|
4992
5022
|
try {
|
|
4993
|
-
return
|
|
5023
|
+
return import_node_fs8.default.statSync(filePath);
|
|
4994
5024
|
} catch {
|
|
4995
5025
|
return null;
|
|
4996
5026
|
}
|
|
@@ -5016,7 +5046,7 @@ function scanWorkspace2(rootDir, options = {}) {
|
|
|
5016
5046
|
for (const { filePath, stat, size, cached } of ranked) {
|
|
5017
5047
|
const content = (() => {
|
|
5018
5048
|
try {
|
|
5019
|
-
return
|
|
5049
|
+
return import_node_fs8.default.readFileSync(filePath, "utf8");
|
|
5020
5050
|
} catch {
|
|
5021
5051
|
return null;
|
|
5022
5052
|
}
|
|
@@ -5097,14 +5127,14 @@ async function scanWorkspaceAsync(rootDir, options = {}) {
|
|
|
5097
5127
|
return scanWorkspace2(rootDir, normalizedOptions);
|
|
5098
5128
|
}
|
|
5099
5129
|
}
|
|
5100
|
-
var
|
|
5130
|
+
var import_node_fs8, import_node_module6, import_node_path10, import_node_url4, import_node_worker_threads2, import_meta5, log3, SCAN_WORKER_TIMEOUT_MS, createNativeParserLoader, nativeParserLoader, DEFAULT_EXTENSIONS, DEFAULT_IGNORES;
|
|
5101
5131
|
var init_src3 = __esm({
|
|
5102
5132
|
"packages/domain/scanner/src/index.ts"() {
|
|
5103
5133
|
"use strict";
|
|
5104
5134
|
init_cjs_shims();
|
|
5105
|
-
|
|
5135
|
+
import_node_fs8 = __toESM(require("fs"), 1);
|
|
5106
5136
|
import_node_module6 = require("module");
|
|
5107
|
-
|
|
5137
|
+
import_node_path10 = __toESM(require("path"), 1);
|
|
5108
5138
|
import_node_url4 = require("url");
|
|
5109
5139
|
import_node_worker_threads2 = require("worker_threads");
|
|
5110
5140
|
init_src();
|
|
@@ -5128,7 +5158,7 @@ var init_src3 = __esm({
|
|
|
5128
5158
|
const loadNativeParserBinding = () => {
|
|
5129
5159
|
if (_state.binding !== void 0) return _state.binding;
|
|
5130
5160
|
const runtimeDir = getRuntimeDir();
|
|
5131
|
-
const req = (0, import_node_module6.createRequire)(
|
|
5161
|
+
const req = (0, import_node_module6.createRequire)(import_node_path10.default.join(runtimeDir, "noop.cjs"));
|
|
5132
5162
|
const _platform = process.platform;
|
|
5133
5163
|
const _arch = process.arch;
|
|
5134
5164
|
const _platformArch = `${_platform}-${_arch}`;
|
|
@@ -5136,27 +5166,27 @@ var init_src3 = __esm({
|
|
|
5136
5166
|
const candidates = [
|
|
5137
5167
|
// ── binaryName baru: tailwind-styled-native (napi-rs naming) ──
|
|
5138
5168
|
// cwd = repo root saat run dari root, atau package dir saat workspaces
|
|
5139
|
-
|
|
5140
|
-
|
|
5141
|
-
|
|
5169
|
+
import_node_path10.default.resolve(process.cwd(), "native", "tailwind-styled-native.node"),
|
|
5170
|
+
import_node_path10.default.resolve(process.cwd(), "native", `tailwind-styled-native.${_platformArch}.node`),
|
|
5171
|
+
import_node_path10.default.resolve(process.cwd(), "native", `tailwind-styled-native.${_platformArchGnu}.node`),
|
|
5142
5172
|
// runtimeDir = dist/ → naik 1 level ke package root (npm install case)
|
|
5143
5173
|
// e.g. node_modules/tailwind-styled-v4/dist/ → node_modules/tailwind-styled-v4/native/
|
|
5144
|
-
|
|
5145
|
-
|
|
5146
|
-
|
|
5174
|
+
import_node_path10.default.resolve(runtimeDir, "..", "native", "tailwind-styled-native.node"),
|
|
5175
|
+
import_node_path10.default.resolve(runtimeDir, "..", "native", `tailwind-styled-native.${_platformArch}.node`),
|
|
5176
|
+
import_node_path10.default.resolve(runtimeDir, "..", "native", `tailwind-styled-native.${_platformArchGnu}.node`),
|
|
5147
5177
|
// runtimeDir = dist/ → naik 4 level ke repo root (monorepo dev case)
|
|
5148
|
-
|
|
5149
|
-
|
|
5178
|
+
import_node_path10.default.resolve(runtimeDir, "..", "..", "..", "..", "native", "tailwind-styled-native.node"),
|
|
5179
|
+
import_node_path10.default.resolve(runtimeDir, "..", "..", "..", "..", "native", `tailwind-styled-native.${_platformArchGnu}.node`),
|
|
5150
5180
|
// 3 level fallback (jika package di-nest lebih dangkal)
|
|
5151
|
-
|
|
5152
|
-
|
|
5181
|
+
import_node_path10.default.resolve(runtimeDir, "..", "..", "..", "native", "tailwind-styled-native.node"),
|
|
5182
|
+
import_node_path10.default.resolve(runtimeDir, "..", "..", "..", "native", `tailwind-styled-native.${_platformArchGnu}.node`),
|
|
5153
5183
|
// ── binaryName lama: tailwind_styled_parser (backward compat) ──
|
|
5154
|
-
|
|
5155
|
-
|
|
5156
|
-
|
|
5157
|
-
|
|
5158
|
-
|
|
5159
|
-
|
|
5184
|
+
import_node_path10.default.resolve(process.cwd(), "native/tailwind_styled_parser.node"),
|
|
5185
|
+
import_node_path10.default.resolve(process.cwd(), "native/build/Release/tailwind_styled_parser.node"),
|
|
5186
|
+
import_node_path10.default.resolve(runtimeDir, "..", "native", "tailwind_styled_parser.node"),
|
|
5187
|
+
import_node_path10.default.resolve(runtimeDir, "..", "..", "..", "..", "native", "tailwind_styled_parser.node"),
|
|
5188
|
+
import_node_path10.default.resolve(runtimeDir, "..", "..", "..", "native", "tailwind_styled_parser.node"),
|
|
5189
|
+
import_node_path10.default.resolve(
|
|
5160
5190
|
runtimeDir,
|
|
5161
5191
|
"..",
|
|
5162
5192
|
"..",
|
|
@@ -5168,7 +5198,7 @@ var init_src3 = __esm({
|
|
|
5168
5198
|
)
|
|
5169
5199
|
];
|
|
5170
5200
|
for (const fullPath of candidates) {
|
|
5171
|
-
if (!
|
|
5201
|
+
if (!import_node_fs8.default.existsSync(fullPath)) continue;
|
|
5172
5202
|
try {
|
|
5173
5203
|
const required = req(fullPath);
|
|
5174
5204
|
if (required && (typeof required.extractClassesFromSource === "function" || typeof required.parseClasses === "function" || typeof required.parse_classes === "function")) {
|
|
@@ -5306,14 +5336,14 @@ init_cjs_shims();
|
|
|
5306
5336
|
|
|
5307
5337
|
// packages/presentation/vite/src/plugin.ts
|
|
5308
5338
|
init_cjs_shims();
|
|
5309
|
-
var
|
|
5310
|
-
var
|
|
5339
|
+
var import_node_fs14 = __toESM(require("fs"), 1);
|
|
5340
|
+
var import_node_path16 = __toESM(require("path"), 1);
|
|
5311
5341
|
init_src2();
|
|
5312
5342
|
|
|
5313
5343
|
// packages/domain/engine/src/index.ts
|
|
5314
5344
|
init_cjs_shims();
|
|
5315
|
-
var
|
|
5316
|
-
var
|
|
5345
|
+
var import_node_fs13 = __toESM(require("fs"), 1);
|
|
5346
|
+
var import_node_path15 = __toESM(require("path"), 1);
|
|
5317
5347
|
var import_node_url6 = require("url");
|
|
5318
5348
|
|
|
5319
5349
|
// packages/domain/analyzer/src/index.ts
|
|
@@ -5321,7 +5351,7 @@ init_cjs_shims();
|
|
|
5321
5351
|
|
|
5322
5352
|
// packages/domain/analyzer/src/analyzeWorkspace.ts
|
|
5323
5353
|
init_cjs_shims();
|
|
5324
|
-
var
|
|
5354
|
+
var import_node_path12 = __toESM(require("path"), 1);
|
|
5325
5355
|
init_src3();
|
|
5326
5356
|
|
|
5327
5357
|
// packages/domain/analyzer/src/binding.ts
|
|
@@ -5330,7 +5360,7 @@ init_src();
|
|
|
5330
5360
|
|
|
5331
5361
|
// packages/domain/analyzer/src/utils.ts
|
|
5332
5362
|
init_cjs_shims();
|
|
5333
|
-
var
|
|
5363
|
+
var import_node_fs9 = __toESM(require("fs"), 1);
|
|
5334
5364
|
init_src();
|
|
5335
5365
|
var DEFAULT_TOP_LIMIT = 10;
|
|
5336
5366
|
var DEFAULT_FREQUENT_THRESHOLD = 2;
|
|
@@ -5345,7 +5375,7 @@ function isRecord(value) {
|
|
|
5345
5375
|
}
|
|
5346
5376
|
async function pathExists(filePath) {
|
|
5347
5377
|
try {
|
|
5348
|
-
await
|
|
5378
|
+
await import_node_fs9.default.promises.access(filePath, import_node_fs9.default.constants.F_OK);
|
|
5349
5379
|
return true;
|
|
5350
5380
|
} catch {
|
|
5351
5381
|
return false;
|
|
@@ -5446,7 +5476,7 @@ async function requireNativeBinding() {
|
|
|
5446
5476
|
init_cjs_shims();
|
|
5447
5477
|
init_src();
|
|
5448
5478
|
var import_zod4 = require("zod");
|
|
5449
|
-
var formatIssuePath3 = (
|
|
5479
|
+
var formatIssuePath3 = (path18) => path18.length > 0 ? path18.map(
|
|
5450
5480
|
(segment) => typeof segment === "symbol" ? segment.description ?? segment.toString() : String(segment)
|
|
5451
5481
|
).join(".") : "<root>";
|
|
5452
5482
|
var isPlainObject = (value) => {
|
|
@@ -5455,8 +5485,8 @@ var isPlainObject = (value) => {
|
|
|
5455
5485
|
return proto === Object.prototype || proto === null;
|
|
5456
5486
|
};
|
|
5457
5487
|
var formatIssues2 = (error) => error.issues.map((issue) => {
|
|
5458
|
-
const
|
|
5459
|
-
return `${
|
|
5488
|
+
const path18 = formatIssuePath3(issue.path);
|
|
5489
|
+
return `${path18}: ${issue.message}`;
|
|
5460
5490
|
}).join("; ");
|
|
5461
5491
|
var parseWithSchema2 = (schema, data, label) => {
|
|
5462
5492
|
const parsed = schema.safeParse(data);
|
|
@@ -5547,8 +5577,8 @@ var parseNativeReport = (report) => parseWithSchema2(NativeReportSchema, report,
|
|
|
5547
5577
|
|
|
5548
5578
|
// packages/domain/analyzer/src/semantic.ts
|
|
5549
5579
|
init_cjs_shims();
|
|
5550
|
-
var
|
|
5551
|
-
var
|
|
5580
|
+
var import_node_fs10 = __toESM(require("fs"), 1);
|
|
5581
|
+
var import_node_path11 = __toESM(require("path"), 1);
|
|
5552
5582
|
var import_node_url5 = require("url");
|
|
5553
5583
|
var SUPPORTED_TAILWIND_CONFIG_EXTENSIONS = /* @__PURE__ */ new Set([".ts", ".js", ".cjs", ".mjs"]);
|
|
5554
5584
|
var tailwindConfigCache = /* @__PURE__ */ new Map();
|
|
@@ -5569,11 +5599,11 @@ var detectConflicts2 = async (usages) => {
|
|
|
5569
5599
|
};
|
|
5570
5600
|
};
|
|
5571
5601
|
var isSupportedTailwindConfigPath = (configPath) => {
|
|
5572
|
-
return SUPPORTED_TAILWIND_CONFIG_EXTENSIONS.has(
|
|
5602
|
+
return SUPPORTED_TAILWIND_CONFIG_EXTENSIONS.has(import_node_path11.default.extname(configPath).toLowerCase());
|
|
5573
5603
|
};
|
|
5574
5604
|
var resolveTailwindConfigPath = async (root, explicitPath) => {
|
|
5575
5605
|
if (explicitPath) {
|
|
5576
|
-
const resolved =
|
|
5606
|
+
const resolved = import_node_path11.default.resolve(root, explicitPath);
|
|
5577
5607
|
if (!await pathExists(resolved)) return null;
|
|
5578
5608
|
return resolved;
|
|
5579
5609
|
}
|
|
@@ -5584,7 +5614,7 @@ var resolveTailwindConfigPath = async (root, explicitPath) => {
|
|
|
5584
5614
|
"tailwind.config.mjs"
|
|
5585
5615
|
];
|
|
5586
5616
|
for (const candidate of candidates) {
|
|
5587
|
-
const fullPath =
|
|
5617
|
+
const fullPath = import_node_path11.default.resolve(root, candidate);
|
|
5588
5618
|
if (await pathExists(fullPath)) return fullPath;
|
|
5589
5619
|
}
|
|
5590
5620
|
return null;
|
|
@@ -5638,7 +5668,7 @@ var collectCustomUtilities = (config) => {
|
|
|
5638
5668
|
return out;
|
|
5639
5669
|
};
|
|
5640
5670
|
var collectSafelistFromSource = async (configPath) => {
|
|
5641
|
-
const source = await
|
|
5671
|
+
const source = await import_node_fs10.default.promises.readFile(configPath, "utf8");
|
|
5642
5672
|
const { extractClassesNative: extractClassesNative2 } = await Promise.resolve().then(() => (init_src3(), src_exports2));
|
|
5643
5673
|
const allTokens = extractClassesNative2(source);
|
|
5644
5674
|
const hasSafelist = source.includes("safelist");
|
|
@@ -5665,7 +5695,7 @@ var loadTailwindConfig2 = async (root, semanticOption) => {
|
|
|
5665
5695
|
customUtilities: /* @__PURE__ */ new Set()
|
|
5666
5696
|
};
|
|
5667
5697
|
}
|
|
5668
|
-
const configStat = await
|
|
5698
|
+
const configStat = await import_node_fs10.default.promises.stat(configPath).catch(() => null);
|
|
5669
5699
|
if (configStat) {
|
|
5670
5700
|
const cached = tailwindConfigCache.get(configPath);
|
|
5671
5701
|
if (cached && cached.mtimeMs === configStat.mtimeMs && cached.size === configStat.size) {
|
|
@@ -5824,7 +5854,7 @@ async function buildDistribution(usages, native) {
|
|
|
5824
5854
|
}
|
|
5825
5855
|
async function analyzeWorkspace(root, options = {}) {
|
|
5826
5856
|
const startedAtMs = Date.now();
|
|
5827
|
-
const resolvedRoot =
|
|
5857
|
+
const resolvedRoot = import_node_path12.default.resolve(root);
|
|
5828
5858
|
const normalizedOptions = parseAnalyzerOptions(options);
|
|
5829
5859
|
const scan = await (async () => {
|
|
5830
5860
|
const scanStartedAtMs = Date.now();
|
|
@@ -5934,8 +5964,8 @@ init_src();
|
|
|
5934
5964
|
|
|
5935
5965
|
// packages/domain/engine/src/incremental.ts
|
|
5936
5966
|
init_cjs_shims();
|
|
5937
|
-
var
|
|
5938
|
-
var
|
|
5967
|
+
var import_node_fs11 = __toESM(require("fs"), 1);
|
|
5968
|
+
var import_node_path13 = __toESM(require("path"), 1);
|
|
5939
5969
|
init_src3();
|
|
5940
5970
|
init_src();
|
|
5941
5971
|
init_native_bridge2();
|
|
@@ -5971,8 +6001,8 @@ function areClassSetsEqual(a, b) {
|
|
|
5971
6001
|
function applyIncrementalChange(previous, filePath, type, scanner) {
|
|
5972
6002
|
const includeExtensions = scanner?.includeExtensions ?? DEFAULT_EXTENSIONS2;
|
|
5973
6003
|
if (!isScannableFile2(filePath, includeExtensions)) return previous;
|
|
5974
|
-
const byFile = new Map(previous.files.map((f) => [
|
|
5975
|
-
const normalizedPath =
|
|
6004
|
+
const byFile = new Map(previous.files.map((f) => [import_node_path13.default.resolve(f.file), f]));
|
|
6005
|
+
const normalizedPath = import_node_path13.default.resolve(filePath);
|
|
5976
6006
|
const native = getNativeEngineBinding();
|
|
5977
6007
|
if (!native?.processFileChange) {
|
|
5978
6008
|
throw new Error(
|
|
@@ -5988,7 +6018,7 @@ function applyIncrementalChange(previous, filePath, type, scanner) {
|
|
|
5988
6018
|
}
|
|
5989
6019
|
log5.debug(`native change ${normalizedPath}`);
|
|
5990
6020
|
const scanned = scanFile2(normalizedPath);
|
|
5991
|
-
const content =
|
|
6021
|
+
const content = import_node_fs11.default.readFileSync(normalizedPath, "utf8");
|
|
5992
6022
|
const diff = native.processFileChange(normalizedPath, scanned.classes, content);
|
|
5993
6023
|
const existing = byFile.get(normalizedPath);
|
|
5994
6024
|
if (diff && existing) {
|
|
@@ -6054,8 +6084,8 @@ var EngineMetricsCollector = class {
|
|
|
6054
6084
|
|
|
6055
6085
|
// packages/domain/engine/src/metricsWriter.ts
|
|
6056
6086
|
init_cjs_shims();
|
|
6057
|
-
var
|
|
6058
|
-
var
|
|
6087
|
+
var import_node_fs12 = __toESM(require("fs"), 1);
|
|
6088
|
+
var import_node_path14 = __toESM(require("path"), 1);
|
|
6059
6089
|
var import_node_perf_hooks = require("perf_hooks");
|
|
6060
6090
|
init_src();
|
|
6061
6091
|
var _log = createLogger2("tw:metrics");
|
|
@@ -6063,8 +6093,8 @@ var METRICS_FILE_NAME = "metrics.json";
|
|
|
6063
6093
|
var CACHE_DIR = ".tw-cache";
|
|
6064
6094
|
function writeMetrics(metrics, cwd = process.cwd()) {
|
|
6065
6095
|
try {
|
|
6066
|
-
const cacheDir =
|
|
6067
|
-
|
|
6096
|
+
const cacheDir = import_node_path14.default.join(cwd, CACHE_DIR);
|
|
6097
|
+
import_node_fs12.default.mkdirSync(cacheDir, { recursive: true });
|
|
6068
6098
|
const mem = process.memoryUsage();
|
|
6069
6099
|
const data = {
|
|
6070
6100
|
...metrics,
|
|
@@ -6075,7 +6105,7 @@ function writeMetrics(metrics, cwd = process.cwd()) {
|
|
|
6075
6105
|
},
|
|
6076
6106
|
generatedAt: (/* @__PURE__ */ new Date()).toISOString()
|
|
6077
6107
|
};
|
|
6078
|
-
|
|
6108
|
+
import_node_fs12.default.writeFileSync(import_node_path14.default.join(cacheDir, METRICS_FILE_NAME), JSON.stringify(data, null, 2));
|
|
6079
6109
|
} catch {
|
|
6080
6110
|
}
|
|
6081
6111
|
}
|
|
@@ -6280,8 +6310,8 @@ var configState = {
|
|
|
6280
6310
|
var log6 = createLogger2("engine");
|
|
6281
6311
|
async function loadTailwindConfigFromPath(root, tailwindConfigPath) {
|
|
6282
6312
|
if (!tailwindConfigPath) return void 0;
|
|
6283
|
-
const configPath =
|
|
6284
|
-
if (!
|
|
6313
|
+
const configPath = import_node_path15.default.resolve(root, tailwindConfigPath);
|
|
6314
|
+
if (!import_node_fs13.default.existsSync(configPath)) {
|
|
6285
6315
|
throw TwError.fromIo("CONFIG_NOT_FOUND", `tailwindConfigPath not found: ${configPath}`);
|
|
6286
6316
|
}
|
|
6287
6317
|
const imported = await import((0, import_node_url6.pathToFileURL)(configPath).href);
|
|
@@ -6347,11 +6377,11 @@ async function buildFromScan(scan, root, options, tailwindConfig) {
|
|
|
6347
6377
|
};
|
|
6348
6378
|
}
|
|
6349
6379
|
function countWorkspacePackages(root) {
|
|
6350
|
-
const packagesDir =
|
|
6351
|
-
if (!
|
|
6380
|
+
const packagesDir = import_node_path15.default.join(root, "packages");
|
|
6381
|
+
if (!import_node_fs13.default.existsSync(packagesDir)) return 0;
|
|
6352
6382
|
try {
|
|
6353
|
-
return
|
|
6354
|
-
(entry) => entry.isDirectory() &&
|
|
6383
|
+
return import_node_fs13.default.readdirSync(packagesDir, { withFileTypes: true }).filter(
|
|
6384
|
+
(entry) => entry.isDirectory() && import_node_fs13.default.existsSync(import_node_path15.default.join(packagesDir, entry.name, "package.json"))
|
|
6355
6385
|
).length;
|
|
6356
6386
|
} catch (err) {
|
|
6357
6387
|
log6.debug(`countWorkspacePackages: ${err instanceof Error ? err.message : String(err)}`);
|
|
@@ -6388,7 +6418,7 @@ function writeDashboardMetrics(root, mode, result, metrics) {
|
|
|
6388
6418
|
async function createEngine(rawOptions = {}) {
|
|
6389
6419
|
const options = parseEngineOptions(rawOptions);
|
|
6390
6420
|
const root = options.root ?? process.cwd();
|
|
6391
|
-
const resolvedRoot =
|
|
6421
|
+
const resolvedRoot = import_node_path15.default.resolve(root);
|
|
6392
6422
|
const plugins = rawOptions.plugins ?? [];
|
|
6393
6423
|
const getTailwindConfig = async () => {
|
|
6394
6424
|
if (configState.isLoaded()) return configState.getConfig();
|
|
@@ -6535,7 +6565,7 @@ async function createEngine(rawOptions = {}) {
|
|
|
6535
6565
|
const shouldForceFullRescan = (event) => {
|
|
6536
6566
|
if (event.type === "unlink") return false;
|
|
6537
6567
|
try {
|
|
6538
|
-
const stat =
|
|
6568
|
+
const stat = import_node_fs13.default.statSync(event.filePath);
|
|
6539
6569
|
if (stat.size > largeFileThreshold) {
|
|
6540
6570
|
metrics.markSkippedLargeFile();
|
|
6541
6571
|
return true;
|
|
@@ -6657,7 +6687,7 @@ async function createEngine(rawOptions = {}) {
|
|
|
6657
6687
|
init_cjs_shims();
|
|
6658
6688
|
var import_zod6 = require("zod");
|
|
6659
6689
|
init_src();
|
|
6660
|
-
var formatIssuePath4 = (
|
|
6690
|
+
var formatIssuePath4 = (path18) => path18.length > 0 ? path18.map(
|
|
6661
6691
|
(segment) => typeof segment === "symbol" ? segment.description ?? segment.toString() : String(segment)
|
|
6662
6692
|
).join(".") : "<root>";
|
|
6663
6693
|
var formatIssues4 = (error) => error.issues.map((issue) => {
|
|
@@ -6703,14 +6733,14 @@ function warnDeprecated(options, key, message) {
|
|
|
6703
6733
|
}
|
|
6704
6734
|
}
|
|
6705
6735
|
function isInsideDirectory(filePath, directory) {
|
|
6706
|
-
const relative =
|
|
6707
|
-
return relative === "" || !relative.startsWith("..") && !
|
|
6736
|
+
const relative = import_node_path16.default.relative(directory, filePath);
|
|
6737
|
+
return relative === "" || !relative.startsWith("..") && !import_node_path16.default.isAbsolute(relative);
|
|
6708
6738
|
}
|
|
6709
6739
|
function filterScanToDirs(scan, root, scanDirs) {
|
|
6710
|
-
const resolvedDirs = scanDirs.map((dir) =>
|
|
6740
|
+
const resolvedDirs = scanDirs.map((dir) => import_node_path16.default.resolve(root, dir));
|
|
6711
6741
|
if (resolvedDirs.length === 0) return scan;
|
|
6712
6742
|
const files = scan.files.filter((file) => {
|
|
6713
|
-
const absoluteFile =
|
|
6743
|
+
const absoluteFile = import_node_path16.default.resolve(file.file);
|
|
6714
6744
|
return resolvedDirs.some((directory) => isInsideDirectory(absoluteFile, directory));
|
|
6715
6745
|
});
|
|
6716
6746
|
const uniqueClasses = Array.from(new Set(files.flatMap((file) => file.classes))).sort();
|
|
@@ -6721,9 +6751,9 @@ function filterScanToDirs(scan, root, scanDirs) {
|
|
|
6721
6751
|
};
|
|
6722
6752
|
}
|
|
6723
6753
|
function writeJsonArtifact(root, relativePath, value) {
|
|
6724
|
-
const outputPath =
|
|
6725
|
-
|
|
6726
|
-
|
|
6754
|
+
const outputPath = import_node_path16.default.resolve(root, relativePath);
|
|
6755
|
+
import_node_fs14.default.mkdirSync(import_node_path16.default.dirname(outputPath), { recursive: true });
|
|
6756
|
+
import_node_fs14.default.writeFileSync(outputPath, `${JSON.stringify(value, null, 2)}
|
|
6727
6757
|
`);
|
|
6728
6758
|
}
|
|
6729
6759
|
function tailwindStyledPlugin(opts = {}) {
|
|
@@ -6764,7 +6794,7 @@ function tailwindStyledPlugin(opts = {}) {
|
|
|
6764
6794
|
return rules.join("\n");
|
|
6765
6795
|
}
|
|
6766
6796
|
function getStaticCssOutputPath(root, safelistOutputPath) {
|
|
6767
|
-
return
|
|
6797
|
+
return import_node_path16.default.resolve(root, import_node_path16.default.dirname(safelistOutputPath), "_tw-state-static.css");
|
|
6768
6798
|
}
|
|
6769
6799
|
function flushStaticCss(root) {
|
|
6770
6800
|
if (staticCssPerFile.size === 0) return;
|
|
@@ -6773,8 +6803,8 @@ function tailwindStyledPlugin(opts = {}) {
|
|
|
6773
6803
|
if (!deduped.trim()) return;
|
|
6774
6804
|
const outPath = getStaticCssOutputPath(root, safelistOutput);
|
|
6775
6805
|
try {
|
|
6776
|
-
|
|
6777
|
-
|
|
6806
|
+
import_node_fs14.default.mkdirSync(import_node_path16.default.dirname(outPath), { recursive: true });
|
|
6807
|
+
import_node_fs14.default.writeFileSync(
|
|
6778
6808
|
outPath,
|
|
6779
6809
|
`/* _tw-state-static.css \u2014 Auto-generated by tailwind-styled-v4. DO NOT EDIT.
|
|
6780
6810
|
* Import this in globals.css: @import "./_tw-state-static.css";
|
|
@@ -6806,17 +6836,17 @@ ${deduped}
|
|
|
6806
6836
|
"src/style.css"
|
|
6807
6837
|
];
|
|
6808
6838
|
for (const candidate of CSS_CANDIDATES) {
|
|
6809
|
-
const candidatePath =
|
|
6810
|
-
if (!
|
|
6811
|
-
const content =
|
|
6839
|
+
const candidatePath = import_node_path16.default.resolve(config.root, candidate);
|
|
6840
|
+
if (!import_node_fs14.default.existsSync(candidatePath)) continue;
|
|
6841
|
+
const content = import_node_fs14.default.readFileSync(candidatePath, "utf-8");
|
|
6812
6842
|
if (content.includes("_tw-state-static.css")) break;
|
|
6813
|
-
const rel =
|
|
6843
|
+
const rel = import_node_path16.default.relative(import_node_path16.default.dirname(candidatePath), outPath).replace(/\\/g, "/");
|
|
6814
6844
|
const importLine = `@import "./${rel}";`;
|
|
6815
6845
|
const tailwindImportRe = /(@import\s+["']tailwindcss["']\s*;[^\n]*\n?)/;
|
|
6816
6846
|
const updated = tailwindImportRe.test(content) ? content.replace(tailwindImportRe, `$1${importLine}
|
|
6817
6847
|
`) : `${importLine}
|
|
6818
6848
|
${content}`;
|
|
6819
|
-
|
|
6849
|
+
import_node_fs14.default.writeFileSync(candidatePath, updated, "utf-8");
|
|
6820
6850
|
break;
|
|
6821
6851
|
}
|
|
6822
6852
|
} catch {
|