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.mjs
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 path19 = first?.path?.join(".") ?? "(root)";
|
|
234
234
|
throw new Error(
|
|
235
|
-
`[${context}] Native binding returned unexpected data: ${
|
|
235
|
+
`[${context}] Native binding returned unexpected data: ${path19}: ${first?.message ?? "validation failed"}`
|
|
236
236
|
);
|
|
237
237
|
}
|
|
238
238
|
return result.data;
|
|
@@ -666,11 +666,11 @@ function resolvePath(...segments) {
|
|
|
666
666
|
return segments.join("/").replace(/\/+/g, "/");
|
|
667
667
|
}
|
|
668
668
|
}
|
|
669
|
-
function existsSync(
|
|
669
|
+
function existsSync(path19) {
|
|
670
670
|
if (isBrowser2) return false;
|
|
671
671
|
try {
|
|
672
672
|
const nodeFs = __require(NODE_FS);
|
|
673
|
-
return nodeFs.existsSync(
|
|
673
|
+
return nodeFs.existsSync(path19);
|
|
674
674
|
} catch {
|
|
675
675
|
return false;
|
|
676
676
|
}
|
|
@@ -1024,9 +1024,9 @@ var init_native_resolution = __esm({
|
|
|
1024
1024
|
// packages/domain/shared/src/observability.ts
|
|
1025
1025
|
function createObservabilityClient(opts = {}) {
|
|
1026
1026
|
const { baseUrl = "http://localhost:7421", timeoutMs = 3e3 } = opts;
|
|
1027
|
-
async function fetchJson(
|
|
1027
|
+
async function fetchJson(path19) {
|
|
1028
1028
|
try {
|
|
1029
|
-
const res = await fetch(`${baseUrl}${
|
|
1029
|
+
const res = await fetch(`${baseUrl}${path19}`, {
|
|
1030
1030
|
signal: AbortSignal.timeout(timeoutMs)
|
|
1031
1031
|
});
|
|
1032
1032
|
if (!res.ok) return null;
|
|
@@ -3454,9 +3454,9 @@ function createDebugLogger(namespace, label) {
|
|
|
3454
3454
|
}
|
|
3455
3455
|
};
|
|
3456
3456
|
}
|
|
3457
|
-
function formatIssuePath(
|
|
3458
|
-
if (!
|
|
3459
|
-
return
|
|
3457
|
+
function formatIssuePath(path19) {
|
|
3458
|
+
if (!path19 || path19.length === 0) return "(root)";
|
|
3459
|
+
return path19.map(
|
|
3460
3460
|
(segment) => typeof segment === "symbol" ? segment.description ?? segment.toString() : String(segment)
|
|
3461
3461
|
).join(".");
|
|
3462
3462
|
}
|
|
@@ -3595,8 +3595,8 @@ var init_src = __esm({
|
|
|
3595
3595
|
/** Buat TwError dari ZodError — dukung shape Zod v3 (`errors`) dan v4 (`issues`). */
|
|
3596
3596
|
static fromZod(err) {
|
|
3597
3597
|
const first = err.issues?.[0] ?? err.errors?.[0];
|
|
3598
|
-
const
|
|
3599
|
-
const message = first ? `${
|
|
3598
|
+
const path19 = formatIssuePath(first?.path);
|
|
3599
|
+
const message = first ? `${path19}: ${first.message}` : "Schema validation failed";
|
|
3600
3600
|
return new _TwError("validation", "SCHEMA_VALIDATION_FAILED", message, err);
|
|
3601
3601
|
}
|
|
3602
3602
|
static wrap(source, code, err) {
|
|
@@ -3668,7 +3668,7 @@ var init_nativeBridge = __esm({
|
|
|
3668
3668
|
"use strict";
|
|
3669
3669
|
init_esm_shims();
|
|
3670
3670
|
init_src();
|
|
3671
|
-
_loadNative = (
|
|
3671
|
+
_loadNative = (path19) => __require(path19);
|
|
3672
3672
|
log = (...args) => {
|
|
3673
3673
|
if (process.env.DEBUG?.includes("compiler:native")) {
|
|
3674
3674
|
console.log("[compiler:native]", ...args);
|
|
@@ -3781,9 +3781,35 @@ var init_routeGraph = __esm({
|
|
|
3781
3781
|
}
|
|
3782
3782
|
});
|
|
3783
3783
|
|
|
3784
|
-
// packages/domain/compiler/src/
|
|
3784
|
+
// packages/domain/compiler/src/semanticComponentAnalyzer.ts
|
|
3785
|
+
var init_semanticComponentAnalyzer = __esm({
|
|
3786
|
+
"packages/domain/compiler/src/semanticComponentAnalyzer.ts"() {
|
|
3787
|
+
"use strict";
|
|
3788
|
+
init_esm_shims();
|
|
3789
|
+
}
|
|
3790
|
+
});
|
|
3791
|
+
|
|
3792
|
+
// packages/domain/compiler/src/typeGeneratorFromMetadata.ts
|
|
3793
|
+
var init_typeGeneratorFromMetadata = __esm({
|
|
3794
|
+
"packages/domain/compiler/src/typeGeneratorFromMetadata.ts"() {
|
|
3795
|
+
"use strict";
|
|
3796
|
+
init_esm_shims();
|
|
3797
|
+
}
|
|
3798
|
+
});
|
|
3799
|
+
|
|
3800
|
+
// packages/domain/compiler/src/typeGenerationPlugin.ts
|
|
3785
3801
|
import fs6 from "fs";
|
|
3786
3802
|
import path7 from "path";
|
|
3803
|
+
var init_typeGenerationPlugin = __esm({
|
|
3804
|
+
"packages/domain/compiler/src/typeGenerationPlugin.ts"() {
|
|
3805
|
+
"use strict";
|
|
3806
|
+
init_esm_shims();
|
|
3807
|
+
}
|
|
3808
|
+
});
|
|
3809
|
+
|
|
3810
|
+
// packages/domain/compiler/src/index.ts
|
|
3811
|
+
import fs7 from "fs";
|
|
3812
|
+
import path8 from "path";
|
|
3787
3813
|
import { createRequire as createRequire5 } from "module";
|
|
3788
3814
|
function _layoutClassesToCss(classes) {
|
|
3789
3815
|
const native = getNativeBridge();
|
|
@@ -3832,6 +3858,9 @@ var init_src2 = __esm({
|
|
|
3832
3858
|
init_redis();
|
|
3833
3859
|
init_watch();
|
|
3834
3860
|
init_routeGraph();
|
|
3861
|
+
init_semanticComponentAnalyzer();
|
|
3862
|
+
init_typeGeneratorFromMetadata();
|
|
3863
|
+
init_typeGenerationPlugin();
|
|
3835
3864
|
_require3 = createRequire5(
|
|
3836
3865
|
typeof __require !== "undefined" ? typeof __filename !== "undefined" ? `file://${__filename}` : "file://unknown" : import.meta.url
|
|
3837
3866
|
);
|
|
@@ -3926,7 +3955,7 @@ var init_src2 = __esm({
|
|
|
3926
3955
|
};
|
|
3927
3956
|
scanProjectUsage = (dirs, cwd) => {
|
|
3928
3957
|
const { batchExtractClasses: batchExtractClasses2 } = _require3("./parser");
|
|
3929
|
-
const files = dirs.map((dir) =>
|
|
3958
|
+
const files = dirs.map((dir) => path8.resolve(cwd, dir));
|
|
3930
3959
|
const results = batchExtractClasses2(files) || [];
|
|
3931
3960
|
const combined = {};
|
|
3932
3961
|
for (const result of results) {
|
|
@@ -3943,13 +3972,13 @@ var init_src2 = __esm({
|
|
|
3943
3972
|
const classes = scanProjectUsage(scanDirs, cwd || process.cwd());
|
|
3944
3973
|
const allClasses = Object.keys(classes).sort();
|
|
3945
3974
|
if (outputPath) {
|
|
3946
|
-
|
|
3975
|
+
fs7.writeFileSync(outputPath, JSON.stringify(allClasses, null, 2));
|
|
3947
3976
|
}
|
|
3948
3977
|
return allClasses;
|
|
3949
3978
|
};
|
|
3950
3979
|
loadSafelist = (safelistPath) => {
|
|
3951
3980
|
try {
|
|
3952
|
-
const content =
|
|
3981
|
+
const content = fs7.readFileSync(safelistPath, "utf-8");
|
|
3953
3982
|
return JSON.parse(content);
|
|
3954
3983
|
} catch {
|
|
3955
3984
|
return [];
|
|
@@ -3963,8 +3992,8 @@ var init_src2 = __esm({
|
|
|
3963
3992
|
"tailwind.config.cjs"
|
|
3964
3993
|
];
|
|
3965
3994
|
for (const file of configFiles) {
|
|
3966
|
-
const fullPath =
|
|
3967
|
-
if (
|
|
3995
|
+
const fullPath = path8.join(cwd, file);
|
|
3996
|
+
if (fs7.existsSync(fullPath)) {
|
|
3968
3997
|
const mod = __require(fullPath);
|
|
3969
3998
|
return mod.default || mod;
|
|
3970
3999
|
}
|
|
@@ -3974,9 +4003,9 @@ var init_src2 = __esm({
|
|
|
3974
4003
|
getContentPaths = (cwd = process.cwd()) => {
|
|
3975
4004
|
return {
|
|
3976
4005
|
content: [
|
|
3977
|
-
|
|
3978
|
-
|
|
3979
|
-
|
|
4006
|
+
path8.join(cwd, "src/**/*.{js,ts,jsx,tsx}"),
|
|
4007
|
+
path8.join(cwd, "app/**/*.{js,ts,jsx,tsx}"),
|
|
4008
|
+
path8.join(cwd, "pages/**/*.{js,ts,jsx,tsx}")
|
|
3980
4009
|
]
|
|
3981
4010
|
};
|
|
3982
4011
|
};
|
|
@@ -4224,14 +4253,14 @@ __export(native_bridge_exports, {
|
|
|
4224
4253
|
startWatchNative: () => startWatchNative,
|
|
4225
4254
|
stopWatchNative: () => stopWatchNative
|
|
4226
4255
|
});
|
|
4227
|
-
import
|
|
4256
|
+
import path9 from "path";
|
|
4228
4257
|
import { fileURLToPath as fileURLToPath3 } from "url";
|
|
4229
4258
|
function getDirname3() {
|
|
4230
4259
|
if (typeof __dirname !== "undefined") {
|
|
4231
4260
|
return __dirname;
|
|
4232
4261
|
}
|
|
4233
4262
|
if (typeof import.meta !== "undefined" && import.meta.url) {
|
|
4234
|
-
return
|
|
4263
|
+
return path9.dirname(fileURLToPath3(import.meta.url));
|
|
4235
4264
|
}
|
|
4236
4265
|
return process.cwd();
|
|
4237
4266
|
}
|
|
@@ -4534,11 +4563,11 @@ var init_native_bridge = __esm({
|
|
|
4534
4563
|
});
|
|
4535
4564
|
|
|
4536
4565
|
// packages/domain/scanner/src/cache-native.ts
|
|
4537
|
-
import
|
|
4538
|
-
import
|
|
4566
|
+
import fs8 from "fs";
|
|
4567
|
+
import path10 from "path";
|
|
4539
4568
|
function defaultCachePath(rootDir, cacheDir) {
|
|
4540
|
-
const dir = cacheDir ?
|
|
4541
|
-
return
|
|
4569
|
+
const dir = cacheDir ? path10.resolve(rootDir, cacheDir) : path10.join(process.cwd(), ".cache", "tailwind-styled");
|
|
4570
|
+
return path10.join(dir, "scanner-cache.json");
|
|
4542
4571
|
}
|
|
4543
4572
|
function metaPathFor(cachePath) {
|
|
4544
4573
|
return cachePath.replace(/\.json$/, ".meta.json");
|
|
@@ -4551,7 +4580,7 @@ function getBinaryFingerprint() {
|
|
|
4551
4580
|
_cachedFingerprint = null;
|
|
4552
4581
|
return null;
|
|
4553
4582
|
}
|
|
4554
|
-
const stat =
|
|
4583
|
+
const stat = fs8.statSync(loadedPath);
|
|
4555
4584
|
_cachedFingerprint = `${stat.mtimeMs}:${stat.size}`;
|
|
4556
4585
|
} catch {
|
|
4557
4586
|
_cachedFingerprint = null;
|
|
@@ -4560,13 +4589,13 @@ function getBinaryFingerprint() {
|
|
|
4560
4589
|
}
|
|
4561
4590
|
function readCache(rootDir, cacheDir) {
|
|
4562
4591
|
const cachePath = defaultCachePath(rootDir, cacheDir);
|
|
4563
|
-
|
|
4592
|
+
fs8.mkdirSync(path10.dirname(cachePath), { recursive: true });
|
|
4564
4593
|
const currentFingerprint = getBinaryFingerprint();
|
|
4565
4594
|
if (currentFingerprint !== null) {
|
|
4566
4595
|
const metaPath = metaPathFor(cachePath);
|
|
4567
4596
|
let storedFingerprint = null;
|
|
4568
4597
|
try {
|
|
4569
|
-
storedFingerprint = JSON.parse(
|
|
4598
|
+
storedFingerprint = JSON.parse(fs8.readFileSync(metaPath, "utf8")).binaryFingerprint ?? null;
|
|
4570
4599
|
} catch {
|
|
4571
4600
|
}
|
|
4572
4601
|
if (storedFingerprint !== currentFingerprint) {
|
|
@@ -4590,7 +4619,7 @@ function readCache(rootDir, cacheDir) {
|
|
|
4590
4619
|
}
|
|
4591
4620
|
function writeCache(rootDir, entries, cacheDir) {
|
|
4592
4621
|
const cachePath = defaultCachePath(rootDir, cacheDir);
|
|
4593
|
-
|
|
4622
|
+
fs8.mkdirSync(path10.dirname(cachePath), { recursive: true });
|
|
4594
4623
|
const success = cacheWriteNative(cachePath, entries);
|
|
4595
4624
|
if (!success) {
|
|
4596
4625
|
throw new Error(
|
|
@@ -4600,7 +4629,7 @@ function writeCache(rootDir, entries, cacheDir) {
|
|
|
4600
4629
|
const currentFingerprint = getBinaryFingerprint();
|
|
4601
4630
|
if (currentFingerprint !== null) {
|
|
4602
4631
|
try {
|
|
4603
|
-
|
|
4632
|
+
fs8.writeFileSync(
|
|
4604
4633
|
metaPathFor(cachePath),
|
|
4605
4634
|
JSON.stringify({ binaryFingerprint: currentFingerprint }),
|
|
4606
4635
|
"utf8"
|
|
@@ -4632,7 +4661,7 @@ var init_cache_native = __esm({
|
|
|
4632
4661
|
|
|
4633
4662
|
// packages/domain/scanner/src/parallel-scanner.ts
|
|
4634
4663
|
import { Worker, isMainThread, parentPort, workerData } from "worker_threads";
|
|
4635
|
-
import
|
|
4664
|
+
import path11 from "path";
|
|
4636
4665
|
import { availableParallelism } from "os";
|
|
4637
4666
|
import { fileURLToPath as fileURLToPath4 } from "url";
|
|
4638
4667
|
function collectFiles2(rootDir, extensions, ignoreDirs) {
|
|
@@ -4675,7 +4704,7 @@ async function scanWorkspaceParallel(rootDir, options = {}) {
|
|
|
4675
4704
|
maxWorkers = Math.max(1, availableParallelism() - 1),
|
|
4676
4705
|
chunkSize = DEFAULT_CHUNK_SIZE
|
|
4677
4706
|
} = options;
|
|
4678
|
-
const files = collectFiles2(
|
|
4707
|
+
const files = collectFiles2(path11.resolve(rootDir), extensions, ignoreDirs);
|
|
4679
4708
|
if (files.length < PARALLEL_THRESHOLD) {
|
|
4680
4709
|
return mergeResults(batchExtractClassesNative2(files));
|
|
4681
4710
|
}
|
|
@@ -4726,12 +4755,12 @@ var init_schemas = __esm({
|
|
|
4726
4755
|
"use strict";
|
|
4727
4756
|
init_esm_shims();
|
|
4728
4757
|
init_src();
|
|
4729
|
-
formatIssuePath2 = (
|
|
4758
|
+
formatIssuePath2 = (path19) => path19.length > 0 ? path19.map(
|
|
4730
4759
|
(segment) => typeof segment === "symbol" ? segment.description ?? segment.toString() : String(segment)
|
|
4731
4760
|
).join(".") : "<root>";
|
|
4732
4761
|
formatIssues = (error) => error.issues.map((issue) => {
|
|
4733
|
-
const
|
|
4734
|
-
return `${
|
|
4762
|
+
const path19 = formatIssuePath2(issue.path);
|
|
4763
|
+
return `${path19}: ${issue.message}`;
|
|
4735
4764
|
}).join("; ");
|
|
4736
4765
|
parseWithSchema = (schema, data, label) => {
|
|
4737
4766
|
const parsed = schema.safeParse(data);
|
|
@@ -4803,9 +4832,9 @@ __export(src_exports2, {
|
|
|
4803
4832
|
scanWorkspace: () => scanWorkspace2,
|
|
4804
4833
|
scanWorkspaceAsync: () => scanWorkspaceAsync
|
|
4805
4834
|
});
|
|
4806
|
-
import
|
|
4835
|
+
import fs9 from "fs";
|
|
4807
4836
|
import { createRequire as createRequire6 } from "module";
|
|
4808
|
-
import
|
|
4837
|
+
import path12 from "path";
|
|
4809
4838
|
import { fileURLToPath as fileURLToPath5 } from "url";
|
|
4810
4839
|
import { Worker as Worker2 } from "worker_threads";
|
|
4811
4840
|
function getRuntimeDir() {
|
|
@@ -4813,7 +4842,7 @@ function getRuntimeDir() {
|
|
|
4813
4842
|
return __dirname;
|
|
4814
4843
|
}
|
|
4815
4844
|
if (typeof import.meta !== "undefined" && import.meta.url) {
|
|
4816
|
-
return
|
|
4845
|
+
return path12.dirname(fileURLToPath5(import.meta.url));
|
|
4817
4846
|
}
|
|
4818
4847
|
return process.cwd();
|
|
4819
4848
|
}
|
|
@@ -4823,17 +4852,17 @@ function resolveScannerWorkerModulePath() {
|
|
|
4823
4852
|
return __dirname;
|
|
4824
4853
|
}
|
|
4825
4854
|
if (typeof import.meta !== "undefined" && import.meta.url) {
|
|
4826
|
-
return
|
|
4855
|
+
return path12.dirname(fileURLToPath5(import.meta.url));
|
|
4827
4856
|
}
|
|
4828
4857
|
return process.cwd();
|
|
4829
4858
|
})();
|
|
4830
4859
|
const candidates = [
|
|
4831
|
-
|
|
4832
|
-
|
|
4833
|
-
|
|
4860
|
+
path12.resolve(runtimeDir, "worker.cjs"),
|
|
4861
|
+
path12.resolve(runtimeDir, "worker.js"),
|
|
4862
|
+
path12.resolve(runtimeDir, "worker.ts")
|
|
4834
4863
|
];
|
|
4835
4864
|
for (const candidate of candidates) {
|
|
4836
|
-
if (
|
|
4865
|
+
if (fs9.existsSync(candidate)) return candidate;
|
|
4837
4866
|
}
|
|
4838
4867
|
return null;
|
|
4839
4868
|
}
|
|
@@ -4890,19 +4919,19 @@ function collectCandidates(rootDir, ignoreDirectories, extensionSet) {
|
|
|
4890
4919
|
if (!currentDir) continue;
|
|
4891
4920
|
const entries = (() => {
|
|
4892
4921
|
try {
|
|
4893
|
-
return
|
|
4922
|
+
return fs9.readdirSync(currentDir, { withFileTypes: true });
|
|
4894
4923
|
} catch {
|
|
4895
4924
|
return [];
|
|
4896
4925
|
}
|
|
4897
4926
|
})();
|
|
4898
4927
|
for (const entry of entries) {
|
|
4899
|
-
const fullPath =
|
|
4928
|
+
const fullPath = path12.join(currentDir, entry.name);
|
|
4900
4929
|
if (entry.isDirectory()) {
|
|
4901
4930
|
if (!ignoreDirectories.has(entry.name)) directories.push(fullPath);
|
|
4902
4931
|
continue;
|
|
4903
4932
|
}
|
|
4904
4933
|
if (!entry.isFile()) continue;
|
|
4905
|
-
if (!extensionSet.has(
|
|
4934
|
+
if (!extensionSet.has(path12.extname(entry.name))) continue;
|
|
4906
4935
|
candidates.push(fullPath);
|
|
4907
4936
|
}
|
|
4908
4937
|
}
|
|
@@ -4929,7 +4958,7 @@ function scanSource(source) {
|
|
|
4929
4958
|
);
|
|
4930
4959
|
}
|
|
4931
4960
|
function isScannableFile2(filePath, includeExtensions = DEFAULT_EXTENSIONS) {
|
|
4932
|
-
return includeExtensions.includes(
|
|
4961
|
+
return includeExtensions.includes(path12.extname(filePath));
|
|
4933
4962
|
}
|
|
4934
4963
|
function scanFile2(filePath) {
|
|
4935
4964
|
const { scanFileNative: scanFileNative3 } = (init_native_bridge(), __toCommonJS(native_bridge_exports));
|
|
@@ -4989,7 +5018,7 @@ function scanWorkspace2(rootDir, options = {}) {
|
|
|
4989
5018
|
for (const filePath of candidates) {
|
|
4990
5019
|
const stat = (() => {
|
|
4991
5020
|
try {
|
|
4992
|
-
return
|
|
5021
|
+
return fs9.statSync(filePath);
|
|
4993
5022
|
} catch {
|
|
4994
5023
|
return null;
|
|
4995
5024
|
}
|
|
@@ -5015,7 +5044,7 @@ function scanWorkspace2(rootDir, options = {}) {
|
|
|
5015
5044
|
for (const { filePath, stat, size, cached } of ranked) {
|
|
5016
5045
|
const content = (() => {
|
|
5017
5046
|
try {
|
|
5018
|
-
return
|
|
5047
|
+
return fs9.readFileSync(filePath, "utf8");
|
|
5019
5048
|
} catch {
|
|
5020
5049
|
return null;
|
|
5021
5050
|
}
|
|
@@ -5121,7 +5150,7 @@ var init_src3 = __esm({
|
|
|
5121
5150
|
const loadNativeParserBinding = () => {
|
|
5122
5151
|
if (_state.binding !== void 0) return _state.binding;
|
|
5123
5152
|
const runtimeDir = getRuntimeDir();
|
|
5124
|
-
const req = createRequire6(
|
|
5153
|
+
const req = createRequire6(path12.join(runtimeDir, "noop.cjs"));
|
|
5125
5154
|
const _platform = process.platform;
|
|
5126
5155
|
const _arch = process.arch;
|
|
5127
5156
|
const _platformArch = `${_platform}-${_arch}`;
|
|
@@ -5129,27 +5158,27 @@ var init_src3 = __esm({
|
|
|
5129
5158
|
const candidates = [
|
|
5130
5159
|
// ── binaryName baru: tailwind-styled-native (napi-rs naming) ──
|
|
5131
5160
|
// cwd = repo root saat run dari root, atau package dir saat workspaces
|
|
5132
|
-
|
|
5133
|
-
|
|
5134
|
-
|
|
5161
|
+
path12.resolve(process.cwd(), "native", "tailwind-styled-native.node"),
|
|
5162
|
+
path12.resolve(process.cwd(), "native", `tailwind-styled-native.${_platformArch}.node`),
|
|
5163
|
+
path12.resolve(process.cwd(), "native", `tailwind-styled-native.${_platformArchGnu}.node`),
|
|
5135
5164
|
// runtimeDir = dist/ → naik 1 level ke package root (npm install case)
|
|
5136
5165
|
// e.g. node_modules/tailwind-styled-v4/dist/ → node_modules/tailwind-styled-v4/native/
|
|
5137
|
-
|
|
5138
|
-
|
|
5139
|
-
|
|
5166
|
+
path12.resolve(runtimeDir, "..", "native", "tailwind-styled-native.node"),
|
|
5167
|
+
path12.resolve(runtimeDir, "..", "native", `tailwind-styled-native.${_platformArch}.node`),
|
|
5168
|
+
path12.resolve(runtimeDir, "..", "native", `tailwind-styled-native.${_platformArchGnu}.node`),
|
|
5140
5169
|
// runtimeDir = dist/ → naik 4 level ke repo root (monorepo dev case)
|
|
5141
|
-
|
|
5142
|
-
|
|
5170
|
+
path12.resolve(runtimeDir, "..", "..", "..", "..", "native", "tailwind-styled-native.node"),
|
|
5171
|
+
path12.resolve(runtimeDir, "..", "..", "..", "..", "native", `tailwind-styled-native.${_platformArchGnu}.node`),
|
|
5143
5172
|
// 3 level fallback (jika package di-nest lebih dangkal)
|
|
5144
|
-
|
|
5145
|
-
|
|
5173
|
+
path12.resolve(runtimeDir, "..", "..", "..", "native", "tailwind-styled-native.node"),
|
|
5174
|
+
path12.resolve(runtimeDir, "..", "..", "..", "native", `tailwind-styled-native.${_platformArchGnu}.node`),
|
|
5146
5175
|
// ── binaryName lama: tailwind_styled_parser (backward compat) ──
|
|
5147
|
-
|
|
5148
|
-
|
|
5149
|
-
|
|
5150
|
-
|
|
5151
|
-
|
|
5152
|
-
|
|
5176
|
+
path12.resolve(process.cwd(), "native/tailwind_styled_parser.node"),
|
|
5177
|
+
path12.resolve(process.cwd(), "native/build/Release/tailwind_styled_parser.node"),
|
|
5178
|
+
path12.resolve(runtimeDir, "..", "native", "tailwind_styled_parser.node"),
|
|
5179
|
+
path12.resolve(runtimeDir, "..", "..", "..", "..", "native", "tailwind_styled_parser.node"),
|
|
5180
|
+
path12.resolve(runtimeDir, "..", "..", "..", "native", "tailwind_styled_parser.node"),
|
|
5181
|
+
path12.resolve(
|
|
5153
5182
|
runtimeDir,
|
|
5154
5183
|
"..",
|
|
5155
5184
|
"..",
|
|
@@ -5161,7 +5190,7 @@ var init_src3 = __esm({
|
|
|
5161
5190
|
)
|
|
5162
5191
|
];
|
|
5163
5192
|
for (const fullPath of candidates) {
|
|
5164
|
-
if (!
|
|
5193
|
+
if (!fs9.existsSync(fullPath)) continue;
|
|
5165
5194
|
try {
|
|
5166
5195
|
const required = req(fullPath);
|
|
5167
5196
|
if (required && (typeof required.extractClassesFromSource === "function" || typeof required.parseClasses === "function" || typeof required.parse_classes === "function")) {
|
|
@@ -5294,13 +5323,13 @@ init_esm_shims();
|
|
|
5294
5323
|
// packages/presentation/vite/src/plugin.ts
|
|
5295
5324
|
init_esm_shims();
|
|
5296
5325
|
init_src2();
|
|
5297
|
-
import
|
|
5298
|
-
import
|
|
5326
|
+
import fs15 from "fs";
|
|
5327
|
+
import path18 from "path";
|
|
5299
5328
|
|
|
5300
5329
|
// packages/domain/engine/src/index.ts
|
|
5301
5330
|
init_esm_shims();
|
|
5302
|
-
import
|
|
5303
|
-
import
|
|
5331
|
+
import fs14 from "fs";
|
|
5332
|
+
import path17 from "path";
|
|
5304
5333
|
import { pathToFileURL as pathToFileURL2 } from "url";
|
|
5305
5334
|
|
|
5306
5335
|
// packages/domain/analyzer/src/index.ts
|
|
@@ -5309,7 +5338,7 @@ init_esm_shims();
|
|
|
5309
5338
|
// packages/domain/analyzer/src/analyzeWorkspace.ts
|
|
5310
5339
|
init_esm_shims();
|
|
5311
5340
|
init_src3();
|
|
5312
|
-
import
|
|
5341
|
+
import path14 from "path";
|
|
5313
5342
|
|
|
5314
5343
|
// packages/domain/analyzer/src/binding.ts
|
|
5315
5344
|
init_esm_shims();
|
|
@@ -5318,7 +5347,7 @@ init_src();
|
|
|
5318
5347
|
// packages/domain/analyzer/src/utils.ts
|
|
5319
5348
|
init_esm_shims();
|
|
5320
5349
|
init_src();
|
|
5321
|
-
import
|
|
5350
|
+
import fs10 from "fs";
|
|
5322
5351
|
var DEFAULT_TOP_LIMIT = 10;
|
|
5323
5352
|
var DEFAULT_FREQUENT_THRESHOLD = 2;
|
|
5324
5353
|
var DEBUG_NAMESPACE = "tailwind-styled:analyzer";
|
|
@@ -5332,7 +5361,7 @@ function isRecord(value) {
|
|
|
5332
5361
|
}
|
|
5333
5362
|
async function pathExists(filePath) {
|
|
5334
5363
|
try {
|
|
5335
|
-
await
|
|
5364
|
+
await fs10.promises.access(filePath, fs10.constants.F_OK);
|
|
5336
5365
|
return true;
|
|
5337
5366
|
} catch {
|
|
5338
5367
|
return false;
|
|
@@ -5433,7 +5462,7 @@ async function requireNativeBinding() {
|
|
|
5433
5462
|
init_esm_shims();
|
|
5434
5463
|
init_src();
|
|
5435
5464
|
import { z as z4 } from "zod";
|
|
5436
|
-
var formatIssuePath3 = (
|
|
5465
|
+
var formatIssuePath3 = (path19) => path19.length > 0 ? path19.map(
|
|
5437
5466
|
(segment) => typeof segment === "symbol" ? segment.description ?? segment.toString() : String(segment)
|
|
5438
5467
|
).join(".") : "<root>";
|
|
5439
5468
|
var isPlainObject = (value) => {
|
|
@@ -5442,8 +5471,8 @@ var isPlainObject = (value) => {
|
|
|
5442
5471
|
return proto === Object.prototype || proto === null;
|
|
5443
5472
|
};
|
|
5444
5473
|
var formatIssues2 = (error) => error.issues.map((issue) => {
|
|
5445
|
-
const
|
|
5446
|
-
return `${
|
|
5474
|
+
const path19 = formatIssuePath3(issue.path);
|
|
5475
|
+
return `${path19}: ${issue.message}`;
|
|
5447
5476
|
}).join("; ");
|
|
5448
5477
|
var parseWithSchema2 = (schema, data, label) => {
|
|
5449
5478
|
const parsed = schema.safeParse(data);
|
|
@@ -5534,8 +5563,8 @@ var parseNativeReport = (report) => parseWithSchema2(NativeReportSchema, report,
|
|
|
5534
5563
|
|
|
5535
5564
|
// packages/domain/analyzer/src/semantic.ts
|
|
5536
5565
|
init_esm_shims();
|
|
5537
|
-
import
|
|
5538
|
-
import
|
|
5566
|
+
import fs11 from "fs";
|
|
5567
|
+
import path13 from "path";
|
|
5539
5568
|
import { pathToFileURL } from "url";
|
|
5540
5569
|
var SUPPORTED_TAILWIND_CONFIG_EXTENSIONS = /* @__PURE__ */ new Set([".ts", ".js", ".cjs", ".mjs"]);
|
|
5541
5570
|
var tailwindConfigCache = /* @__PURE__ */ new Map();
|
|
@@ -5556,11 +5585,11 @@ var detectConflicts2 = async (usages) => {
|
|
|
5556
5585
|
};
|
|
5557
5586
|
};
|
|
5558
5587
|
var isSupportedTailwindConfigPath = (configPath) => {
|
|
5559
|
-
return SUPPORTED_TAILWIND_CONFIG_EXTENSIONS.has(
|
|
5588
|
+
return SUPPORTED_TAILWIND_CONFIG_EXTENSIONS.has(path13.extname(configPath).toLowerCase());
|
|
5560
5589
|
};
|
|
5561
5590
|
var resolveTailwindConfigPath = async (root, explicitPath) => {
|
|
5562
5591
|
if (explicitPath) {
|
|
5563
|
-
const resolved =
|
|
5592
|
+
const resolved = path13.resolve(root, explicitPath);
|
|
5564
5593
|
if (!await pathExists(resolved)) return null;
|
|
5565
5594
|
return resolved;
|
|
5566
5595
|
}
|
|
@@ -5571,7 +5600,7 @@ var resolveTailwindConfigPath = async (root, explicitPath) => {
|
|
|
5571
5600
|
"tailwind.config.mjs"
|
|
5572
5601
|
];
|
|
5573
5602
|
for (const candidate of candidates) {
|
|
5574
|
-
const fullPath =
|
|
5603
|
+
const fullPath = path13.resolve(root, candidate);
|
|
5575
5604
|
if (await pathExists(fullPath)) return fullPath;
|
|
5576
5605
|
}
|
|
5577
5606
|
return null;
|
|
@@ -5625,7 +5654,7 @@ var collectCustomUtilities = (config) => {
|
|
|
5625
5654
|
return out;
|
|
5626
5655
|
};
|
|
5627
5656
|
var collectSafelistFromSource = async (configPath) => {
|
|
5628
|
-
const source = await
|
|
5657
|
+
const source = await fs11.promises.readFile(configPath, "utf8");
|
|
5629
5658
|
const { extractClassesNative: extractClassesNative2 } = await Promise.resolve().then(() => (init_src3(), src_exports2));
|
|
5630
5659
|
const allTokens = extractClassesNative2(source);
|
|
5631
5660
|
const hasSafelist = source.includes("safelist");
|
|
@@ -5652,7 +5681,7 @@ var loadTailwindConfig2 = async (root, semanticOption) => {
|
|
|
5652
5681
|
customUtilities: /* @__PURE__ */ new Set()
|
|
5653
5682
|
};
|
|
5654
5683
|
}
|
|
5655
|
-
const configStat = await
|
|
5684
|
+
const configStat = await fs11.promises.stat(configPath).catch(() => null);
|
|
5656
5685
|
if (configStat) {
|
|
5657
5686
|
const cached = tailwindConfigCache.get(configPath);
|
|
5658
5687
|
if (cached && cached.mtimeMs === configStat.mtimeMs && cached.size === configStat.size) {
|
|
@@ -5811,7 +5840,7 @@ async function buildDistribution(usages, native) {
|
|
|
5811
5840
|
}
|
|
5812
5841
|
async function analyzeWorkspace(root, options = {}) {
|
|
5813
5842
|
const startedAtMs = Date.now();
|
|
5814
|
-
const resolvedRoot =
|
|
5843
|
+
const resolvedRoot = path14.resolve(root);
|
|
5815
5844
|
const normalizedOptions = parseAnalyzerOptions(options);
|
|
5816
5845
|
const scan = await (async () => {
|
|
5817
5846
|
const scanStartedAtMs = Date.now();
|
|
@@ -5924,8 +5953,8 @@ init_esm_shims();
|
|
|
5924
5953
|
init_src3();
|
|
5925
5954
|
init_src();
|
|
5926
5955
|
init_native_bridge2();
|
|
5927
|
-
import
|
|
5928
|
-
import
|
|
5956
|
+
import fs12 from "fs";
|
|
5957
|
+
import path15 from "path";
|
|
5929
5958
|
var DEFAULT_EXTENSIONS2 = [".js", ".jsx", ".ts", ".tsx", ".mjs", ".cjs"];
|
|
5930
5959
|
var log5 = createLogger2("engine:incremental");
|
|
5931
5960
|
function rebuildWorkspaceResult2(byFile) {
|
|
@@ -5958,8 +5987,8 @@ function areClassSetsEqual(a, b) {
|
|
|
5958
5987
|
function applyIncrementalChange(previous, filePath, type, scanner) {
|
|
5959
5988
|
const includeExtensions = scanner?.includeExtensions ?? DEFAULT_EXTENSIONS2;
|
|
5960
5989
|
if (!isScannableFile2(filePath, includeExtensions)) return previous;
|
|
5961
|
-
const byFile = new Map(previous.files.map((f) => [
|
|
5962
|
-
const normalizedPath =
|
|
5990
|
+
const byFile = new Map(previous.files.map((f) => [path15.resolve(f.file), f]));
|
|
5991
|
+
const normalizedPath = path15.resolve(filePath);
|
|
5963
5992
|
const native = getNativeEngineBinding();
|
|
5964
5993
|
if (!native?.processFileChange) {
|
|
5965
5994
|
throw new Error(
|
|
@@ -5975,7 +6004,7 @@ function applyIncrementalChange(previous, filePath, type, scanner) {
|
|
|
5975
6004
|
}
|
|
5976
6005
|
log5.debug(`native change ${normalizedPath}`);
|
|
5977
6006
|
const scanned = scanFile2(normalizedPath);
|
|
5978
|
-
const content =
|
|
6007
|
+
const content = fs12.readFileSync(normalizedPath, "utf8");
|
|
5979
6008
|
const diff = native.processFileChange(normalizedPath, scanned.classes, content);
|
|
5980
6009
|
const existing = byFile.get(normalizedPath);
|
|
5981
6010
|
if (diff && existing) {
|
|
@@ -6042,16 +6071,16 @@ var EngineMetricsCollector = class {
|
|
|
6042
6071
|
// packages/domain/engine/src/metricsWriter.ts
|
|
6043
6072
|
init_esm_shims();
|
|
6044
6073
|
init_src();
|
|
6045
|
-
import
|
|
6046
|
-
import
|
|
6074
|
+
import fs13 from "fs";
|
|
6075
|
+
import path16 from "path";
|
|
6047
6076
|
import { performance } from "perf_hooks";
|
|
6048
6077
|
var _log = createLogger2("tw:metrics");
|
|
6049
6078
|
var METRICS_FILE_NAME = "metrics.json";
|
|
6050
6079
|
var CACHE_DIR = ".tw-cache";
|
|
6051
6080
|
function writeMetrics(metrics, cwd = process.cwd()) {
|
|
6052
6081
|
try {
|
|
6053
|
-
const cacheDir =
|
|
6054
|
-
|
|
6082
|
+
const cacheDir = path16.join(cwd, CACHE_DIR);
|
|
6083
|
+
fs13.mkdirSync(cacheDir, { recursive: true });
|
|
6055
6084
|
const mem = process.memoryUsage();
|
|
6056
6085
|
const data = {
|
|
6057
6086
|
...metrics,
|
|
@@ -6062,7 +6091,7 @@ function writeMetrics(metrics, cwd = process.cwd()) {
|
|
|
6062
6091
|
},
|
|
6063
6092
|
generatedAt: (/* @__PURE__ */ new Date()).toISOString()
|
|
6064
6093
|
};
|
|
6065
|
-
|
|
6094
|
+
fs13.writeFileSync(path16.join(cacheDir, METRICS_FILE_NAME), JSON.stringify(data, null, 2));
|
|
6066
6095
|
} catch {
|
|
6067
6096
|
}
|
|
6068
6097
|
}
|
|
@@ -6267,8 +6296,8 @@ var configState = {
|
|
|
6267
6296
|
var log6 = createLogger2("engine");
|
|
6268
6297
|
async function loadTailwindConfigFromPath(root, tailwindConfigPath) {
|
|
6269
6298
|
if (!tailwindConfigPath) return void 0;
|
|
6270
|
-
const configPath =
|
|
6271
|
-
if (!
|
|
6299
|
+
const configPath = path17.resolve(root, tailwindConfigPath);
|
|
6300
|
+
if (!fs14.existsSync(configPath)) {
|
|
6272
6301
|
throw TwError.fromIo("CONFIG_NOT_FOUND", `tailwindConfigPath not found: ${configPath}`);
|
|
6273
6302
|
}
|
|
6274
6303
|
const imported = await import(pathToFileURL2(configPath).href);
|
|
@@ -6334,11 +6363,11 @@ async function buildFromScan(scan, root, options, tailwindConfig) {
|
|
|
6334
6363
|
};
|
|
6335
6364
|
}
|
|
6336
6365
|
function countWorkspacePackages(root) {
|
|
6337
|
-
const packagesDir =
|
|
6338
|
-
if (!
|
|
6366
|
+
const packagesDir = path17.join(root, "packages");
|
|
6367
|
+
if (!fs14.existsSync(packagesDir)) return 0;
|
|
6339
6368
|
try {
|
|
6340
|
-
return
|
|
6341
|
-
(entry) => entry.isDirectory() &&
|
|
6369
|
+
return fs14.readdirSync(packagesDir, { withFileTypes: true }).filter(
|
|
6370
|
+
(entry) => entry.isDirectory() && fs14.existsSync(path17.join(packagesDir, entry.name, "package.json"))
|
|
6342
6371
|
).length;
|
|
6343
6372
|
} catch (err) {
|
|
6344
6373
|
log6.debug(`countWorkspacePackages: ${err instanceof Error ? err.message : String(err)}`);
|
|
@@ -6375,7 +6404,7 @@ function writeDashboardMetrics(root, mode, result, metrics) {
|
|
|
6375
6404
|
async function createEngine(rawOptions = {}) {
|
|
6376
6405
|
const options = parseEngineOptions(rawOptions);
|
|
6377
6406
|
const root = options.root ?? process.cwd();
|
|
6378
|
-
const resolvedRoot =
|
|
6407
|
+
const resolvedRoot = path17.resolve(root);
|
|
6379
6408
|
const plugins = rawOptions.plugins ?? [];
|
|
6380
6409
|
const getTailwindConfig = async () => {
|
|
6381
6410
|
if (configState.isLoaded()) return configState.getConfig();
|
|
@@ -6522,7 +6551,7 @@ async function createEngine(rawOptions = {}) {
|
|
|
6522
6551
|
const shouldForceFullRescan = (event) => {
|
|
6523
6552
|
if (event.type === "unlink") return false;
|
|
6524
6553
|
try {
|
|
6525
|
-
const stat =
|
|
6554
|
+
const stat = fs14.statSync(event.filePath);
|
|
6526
6555
|
if (stat.size > largeFileThreshold) {
|
|
6527
6556
|
metrics.markSkippedLargeFile();
|
|
6528
6557
|
return true;
|
|
@@ -6644,7 +6673,7 @@ async function createEngine(rawOptions = {}) {
|
|
|
6644
6673
|
init_esm_shims();
|
|
6645
6674
|
init_src();
|
|
6646
6675
|
import { z as z6 } from "zod";
|
|
6647
|
-
var formatIssuePath4 = (
|
|
6676
|
+
var formatIssuePath4 = (path19) => path19.length > 0 ? path19.map(
|
|
6648
6677
|
(segment) => typeof segment === "symbol" ? segment.description ?? segment.toString() : String(segment)
|
|
6649
6678
|
).join(".") : "<root>";
|
|
6650
6679
|
var formatIssues4 = (error) => error.issues.map((issue) => {
|
|
@@ -6690,14 +6719,14 @@ function warnDeprecated(options, key, message) {
|
|
|
6690
6719
|
}
|
|
6691
6720
|
}
|
|
6692
6721
|
function isInsideDirectory(filePath, directory) {
|
|
6693
|
-
const relative =
|
|
6694
|
-
return relative === "" || !relative.startsWith("..") && !
|
|
6722
|
+
const relative = path18.relative(directory, filePath);
|
|
6723
|
+
return relative === "" || !relative.startsWith("..") && !path18.isAbsolute(relative);
|
|
6695
6724
|
}
|
|
6696
6725
|
function filterScanToDirs(scan, root, scanDirs) {
|
|
6697
|
-
const resolvedDirs = scanDirs.map((dir) =>
|
|
6726
|
+
const resolvedDirs = scanDirs.map((dir) => path18.resolve(root, dir));
|
|
6698
6727
|
if (resolvedDirs.length === 0) return scan;
|
|
6699
6728
|
const files = scan.files.filter((file) => {
|
|
6700
|
-
const absoluteFile =
|
|
6729
|
+
const absoluteFile = path18.resolve(file.file);
|
|
6701
6730
|
return resolvedDirs.some((directory) => isInsideDirectory(absoluteFile, directory));
|
|
6702
6731
|
});
|
|
6703
6732
|
const uniqueClasses = Array.from(new Set(files.flatMap((file) => file.classes))).sort();
|
|
@@ -6708,9 +6737,9 @@ function filterScanToDirs(scan, root, scanDirs) {
|
|
|
6708
6737
|
};
|
|
6709
6738
|
}
|
|
6710
6739
|
function writeJsonArtifact(root, relativePath, value) {
|
|
6711
|
-
const outputPath =
|
|
6712
|
-
|
|
6713
|
-
|
|
6740
|
+
const outputPath = path18.resolve(root, relativePath);
|
|
6741
|
+
fs15.mkdirSync(path18.dirname(outputPath), { recursive: true });
|
|
6742
|
+
fs15.writeFileSync(outputPath, `${JSON.stringify(value, null, 2)}
|
|
6714
6743
|
`);
|
|
6715
6744
|
}
|
|
6716
6745
|
function tailwindStyledPlugin(opts = {}) {
|
|
@@ -6751,7 +6780,7 @@ function tailwindStyledPlugin(opts = {}) {
|
|
|
6751
6780
|
return rules.join("\n");
|
|
6752
6781
|
}
|
|
6753
6782
|
function getStaticCssOutputPath(root, safelistOutputPath) {
|
|
6754
|
-
return
|
|
6783
|
+
return path18.resolve(root, path18.dirname(safelistOutputPath), "_tw-state-static.css");
|
|
6755
6784
|
}
|
|
6756
6785
|
function flushStaticCss(root) {
|
|
6757
6786
|
if (staticCssPerFile.size === 0) return;
|
|
@@ -6760,8 +6789,8 @@ function tailwindStyledPlugin(opts = {}) {
|
|
|
6760
6789
|
if (!deduped.trim()) return;
|
|
6761
6790
|
const outPath = getStaticCssOutputPath(root, safelistOutput);
|
|
6762
6791
|
try {
|
|
6763
|
-
|
|
6764
|
-
|
|
6792
|
+
fs15.mkdirSync(path18.dirname(outPath), { recursive: true });
|
|
6793
|
+
fs15.writeFileSync(
|
|
6765
6794
|
outPath,
|
|
6766
6795
|
`/* _tw-state-static.css \u2014 Auto-generated by tailwind-styled-v4. DO NOT EDIT.
|
|
6767
6796
|
* Import this in globals.css: @import "./_tw-state-static.css";
|
|
@@ -6793,17 +6822,17 @@ ${deduped}
|
|
|
6793
6822
|
"src/style.css"
|
|
6794
6823
|
];
|
|
6795
6824
|
for (const candidate of CSS_CANDIDATES) {
|
|
6796
|
-
const candidatePath =
|
|
6797
|
-
if (!
|
|
6798
|
-
const content =
|
|
6825
|
+
const candidatePath = path18.resolve(config.root, candidate);
|
|
6826
|
+
if (!fs15.existsSync(candidatePath)) continue;
|
|
6827
|
+
const content = fs15.readFileSync(candidatePath, "utf-8");
|
|
6799
6828
|
if (content.includes("_tw-state-static.css")) break;
|
|
6800
|
-
const rel =
|
|
6829
|
+
const rel = path18.relative(path18.dirname(candidatePath), outPath).replace(/\\/g, "/");
|
|
6801
6830
|
const importLine = `@import "./${rel}";`;
|
|
6802
6831
|
const tailwindImportRe = /(@import\s+["']tailwindcss["']\s*;[^\n]*\n?)/;
|
|
6803
6832
|
const updated = tailwindImportRe.test(content) ? content.replace(tailwindImportRe, `$1${importLine}
|
|
6804
6833
|
`) : `${importLine}
|
|
6805
6834
|
${content}`;
|
|
6806
|
-
|
|
6835
|
+
fs15.writeFileSync(candidatePath, updated, "utf-8");
|
|
6807
6836
|
break;
|
|
6808
6837
|
}
|
|
6809
6838
|
} catch {
|