tailwind-styled-v4 5.0.37 → 5.0.39
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/dist/analyzer.js +213 -161
- package/dist/analyzer.js.map +1 -1
- package/dist/analyzer.mjs +121 -83
- package/dist/analyzer.mjs.map +1 -1
- package/dist/animate.js +131 -87
- package/dist/animate.js.map +1 -1
- package/dist/animate.mjs +31 -15
- package/dist/animate.mjs.map +1 -1
- package/dist/atomic.js +107 -67
- package/dist/atomic.js.map +1 -1
- package/dist/atomic.mjs +47 -14
- package/dist/atomic.mjs.map +1 -1
- package/dist/cli.js +601 -428
- package/dist/cli.js.map +1 -1
- package/dist/cli.mjs +504 -313
- package/dist/cli.mjs.map +1 -1
- package/dist/compiler.js +833 -508
- package/dist/compiler.js.map +1 -1
- package/dist/compiler.mjs +298 -30
- package/dist/compiler.mjs.map +1 -1
- package/dist/dashboard.js +72 -41
- package/dist/dashboard.js.map +1 -1
- package/dist/dashboard.mjs +12 -6
- package/dist/dashboard.mjs.map +1 -1
- package/dist/devtools.js +335 -289
- package/dist/devtools.js.map +1 -1
- package/dist/devtools.mjs +28 -11
- package/dist/devtools.mjs.map +1 -1
- package/dist/engine.js +719 -506
- package/dist/engine.js.map +1 -1
- package/dist/engine.mjs +520 -318
- package/dist/engine.mjs.map +1 -1
- package/dist/index.d.mts +145 -319
- package/dist/index.d.ts +145 -319
- package/dist/index.js +1337 -7442
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +1275 -7386
- package/dist/index.mjs.map +1 -1
- package/dist/next.js +327 -242
- package/dist/next.js.map +1 -1
- package/dist/next.mjs +272 -184
- package/dist/next.mjs.map +1 -1
- package/dist/plugin-api.js +94 -49
- package/dist/plugin-api.js.map +1 -1
- package/dist/plugin-api.mjs +26 -6
- package/dist/plugin-api.mjs.map +1 -1
- package/dist/plugin-registry.js +68 -40
- package/dist/plugin-registry.js.map +1 -1
- package/dist/plugin-registry.mjs +14 -10
- package/dist/plugin-registry.mjs.map +1 -1
- package/dist/plugin.js +102 -53
- package/dist/plugin.js.map +1 -1
- package/dist/plugin.mjs +30 -6
- package/dist/plugin.mjs.map +1 -1
- package/dist/preset.js +48 -15
- package/dist/preset.js.map +1 -1
- package/dist/preset.mjs +13 -5
- package/dist/preset.mjs.map +1 -1
- package/dist/rspack.js +108 -53
- package/dist/rspack.js.map +1 -1
- package/dist/rspack.mjs +50 -18
- package/dist/rspack.mjs.map +1 -1
- package/dist/runtime-css.js +63 -24
- package/dist/runtime-css.js.map +1 -1
- package/dist/runtime-css.mjs +15 -7
- package/dist/runtime-css.mjs.map +1 -1
- package/dist/runtime.js +98 -44
- package/dist/runtime.js.map +1 -1
- package/dist/runtime.mjs +31 -8
- package/dist/runtime.mjs.map +1 -1
- package/dist/scanner.js +164 -120
- package/dist/scanner.js.map +1 -1
- package/dist/scanner.mjs +70 -40
- package/dist/scanner.mjs.map +1 -1
- package/dist/shared.d.mts +0 -12
- package/dist/shared.d.ts +0 -12
- package/dist/shared.js +481 -299
- package/dist/shared.js.map +1 -1
- package/dist/shared.mjs +304 -133
- package/dist/shared.mjs.map +1 -1
- package/dist/storybook-addon.js +40 -10
- package/dist/storybook-addon.js.map +1 -1
- package/dist/storybook-addon.mjs +8 -3
- package/dist/storybook-addon.mjs.map +1 -1
- package/dist/svelte.js +95 -64
- package/dist/svelte.js.map +1 -1
- package/dist/svelte.mjs +37 -14
- package/dist/svelte.mjs.map +1 -1
- package/dist/syntax.js +69 -37
- package/dist/syntax.js.map +1 -1
- package/dist/syntax.mjs +8 -7
- package/dist/syntax.mjs.map +1 -1
- package/dist/testing.js +56 -18
- package/dist/testing.js.map +1 -1
- package/dist/testing.mjs +16 -3
- package/dist/testing.mjs.map +1 -1
- package/dist/theme.js +133 -74
- package/dist/theme.js.map +1 -1
- package/dist/theme.mjs +45 -14
- package/dist/theme.mjs.map +1 -1
- package/dist/turbopackLoader.js +156 -115
- package/dist/turbopackLoader.js.map +1 -1
- package/dist/turbopackLoader.mjs +135 -82
- package/dist/turbopackLoader.mjs.map +1 -1
- package/dist/tw.js +584 -423
- package/dist/tw.js.map +1 -1
- package/dist/tw.mjs +498 -311
- package/dist/tw.mjs.map +1 -1
- package/dist/vite.js +599 -450
- package/dist/vite.js.map +1 -1
- package/dist/vite.mjs +484 -332
- package/dist/vite.mjs.map +1 -1
- package/dist/vue.js +102 -70
- package/dist/vue.js.map +1 -1
- package/dist/vue.mjs +39 -15
- package/dist/vue.mjs.map +1 -1
- package/dist/webpackLoader.js +112 -77
- package/dist/webpackLoader.js.map +1 -1
- package/dist/webpackLoader.mjs +52 -18
- package/dist/webpackLoader.mjs.map +1 -1
- package/native/tailwind-styled-native.linux-x64-gnu.node +0 -0
- package/native/tailwind-styled-native.node +0 -0
- package/package.json +3 -1
package/dist/turbopackLoader.mjs
CHANGED
|
@@ -1,11 +1,3 @@
|
|
|
1
|
-
import { createRequire } from 'module';
|
|
2
|
-
import * as fs4 from 'fs';
|
|
3
|
-
import fs4__default from 'fs';
|
|
4
|
-
import * as path4 from 'path';
|
|
5
|
-
import path4__default from 'path';
|
|
6
|
-
import 'crypto';
|
|
7
|
-
import { fileURLToPath } from 'url';
|
|
8
|
-
|
|
9
1
|
/* tailwind-styled-v4 v5.0.4 | MIT | https://github.com/dictionar32/tailwind-styled-v4 */
|
|
10
2
|
var __defProp = Object.defineProperty;
|
|
11
3
|
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
@@ -33,6 +25,11 @@ var __copyProps = (to, from, except, desc) => {
|
|
|
33
25
|
return to;
|
|
34
26
|
};
|
|
35
27
|
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
28
|
+
|
|
29
|
+
// packages/domain/shared/src/native-resolution.ts
|
|
30
|
+
import { createRequire } from "module";
|
|
31
|
+
import * as fs from "fs";
|
|
32
|
+
import * as path from "path";
|
|
36
33
|
function platformKey() {
|
|
37
34
|
if (isBrowser) return "browser";
|
|
38
35
|
return `${process.platform}-${process.arch}`;
|
|
@@ -48,7 +45,7 @@ function resolveNativeBinary(runtimeDir) {
|
|
|
48
45
|
}
|
|
49
46
|
const envPath = process.env.TW_NATIVE_PATH?.trim();
|
|
50
47
|
if (envPath) {
|
|
51
|
-
if (
|
|
48
|
+
if (fs.existsSync(envPath)) {
|
|
52
49
|
return { path: envPath, source: "env", platform, tried };
|
|
53
50
|
}
|
|
54
51
|
tried.push(`env:${envPath} (not found)`);
|
|
@@ -57,7 +54,7 @@ function resolveNativeBinary(runtimeDir) {
|
|
|
57
54
|
for (const pkg of prebuiltPkgs) {
|
|
58
55
|
try {
|
|
59
56
|
const candidate = _require.resolve(`${pkg}/tailwind_styled_parser.node`);
|
|
60
|
-
if (
|
|
57
|
+
if (fs.existsSync(candidate)) {
|
|
61
58
|
return { path: candidate, source: "prebuilt", platform, tried };
|
|
62
59
|
}
|
|
63
60
|
tried.push(`prebuilt:${pkg} (resolved but missing)`);
|
|
@@ -68,13 +65,13 @@ function resolveNativeBinary(runtimeDir) {
|
|
|
68
65
|
const napiPlatform = platform === "linux-x64" ? "linux-x64-gnu" : platform === "linux-arm64" ? "linux-arm64-gnu" : platform;
|
|
69
66
|
const BINARY_NAMES_SELF = ["tailwind-styled-native", "tailwind_styled_parser"];
|
|
70
67
|
if (runtimeDir) {
|
|
71
|
-
for (const depth of ["..",
|
|
72
|
-
const pkgRoot =
|
|
68
|
+
for (const depth of ["..", path.join("..", ".."), path.join("..", "..", "..")]) {
|
|
69
|
+
const pkgRoot = path.resolve(runtimeDir, depth);
|
|
73
70
|
for (const bin of BINARY_NAMES_SELF) {
|
|
74
71
|
for (const suffix of ["", `.${platform}`, `.${napiPlatform}`]) {
|
|
75
|
-
const candidate =
|
|
72
|
+
const candidate = path.resolve(pkgRoot, "native", `${bin}${suffix}.node`);
|
|
76
73
|
tried.push(`self-bundled:${candidate}`);
|
|
77
|
-
if (
|
|
74
|
+
if (fs.existsSync(candidate)) {
|
|
78
75
|
return { path: candidate, source: "prebuilt", platform, tried };
|
|
79
76
|
}
|
|
80
77
|
}
|
|
@@ -86,29 +83,29 @@ function resolveNativeBinary(runtimeDir) {
|
|
|
86
83
|
const BINARY_NAMES = ["tailwind-styled-native", "tailwind_styled_parser"];
|
|
87
84
|
const localCandidates = [];
|
|
88
85
|
for (const bin of BINARY_NAMES) {
|
|
89
|
-
localCandidates.push(
|
|
90
|
-
localCandidates.push(
|
|
91
|
-
localCandidates.push(
|
|
92
|
-
localCandidates.push(
|
|
86
|
+
localCandidates.push(path.resolve(base, `${bin}.node`));
|
|
87
|
+
localCandidates.push(path.resolve(base, "..", `${bin}.node`));
|
|
88
|
+
localCandidates.push(path.resolve(base, `${bin}.${platform}.node`));
|
|
89
|
+
localCandidates.push(path.resolve(base, `${bin}.${napiPlatform}.node`));
|
|
93
90
|
}
|
|
94
91
|
for (const startDir of [cwd, base]) {
|
|
95
92
|
let dir = startDir;
|
|
96
93
|
for (let i = 0; i < 6; i++) {
|
|
97
|
-
const nativeDir =
|
|
94
|
+
const nativeDir = path.resolve(dir, "native");
|
|
98
95
|
for (const bin of BINARY_NAMES) {
|
|
99
|
-
localCandidates.push(
|
|
100
|
-
localCandidates.push(
|
|
101
|
-
localCandidates.push(
|
|
102
|
-
localCandidates.push(
|
|
96
|
+
localCandidates.push(path.resolve(nativeDir, `${bin}.node`));
|
|
97
|
+
localCandidates.push(path.resolve(nativeDir, `${bin}.${platform}.node`));
|
|
98
|
+
localCandidates.push(path.resolve(nativeDir, `${bin}.${napiPlatform}.node`));
|
|
99
|
+
localCandidates.push(path.resolve(nativeDir, "target", "release", `${bin}.node`));
|
|
103
100
|
}
|
|
104
|
-
const parent =
|
|
101
|
+
const parent = path.resolve(dir, "..");
|
|
105
102
|
if (parent === dir) break;
|
|
106
103
|
dir = parent;
|
|
107
104
|
}
|
|
108
105
|
}
|
|
109
106
|
for (const candidate of localCandidates) {
|
|
110
107
|
tried.push(`local:${candidate}`);
|
|
111
|
-
if (
|
|
108
|
+
if (fs.existsSync(candidate)) {
|
|
112
109
|
return { path: candidate, source: "local", platform, tried };
|
|
113
110
|
}
|
|
114
111
|
}
|
|
@@ -117,8 +114,11 @@ function resolveNativeBinary(runtimeDir) {
|
|
|
117
114
|
var isBrowser, _require, PLATFORM_MAP;
|
|
118
115
|
var init_native_resolution = __esm({
|
|
119
116
|
"packages/domain/shared/src/native-resolution.ts"() {
|
|
117
|
+
"use strict";
|
|
120
118
|
isBrowser = typeof window !== "undefined" || typeof document !== "undefined";
|
|
121
|
-
_require =
|
|
119
|
+
_require = createRequire(
|
|
120
|
+
typeof __require !== "undefined" ? typeof __filename !== "undefined" ? `file://${__filename}` : "file://unknown" : import.meta.url
|
|
121
|
+
);
|
|
122
122
|
PLATFORM_MAP = {
|
|
123
123
|
"linux-x64": ["@tailwind-styled/native-linux-x64-gnu", "@tailwind-styled/native-linux-x64"],
|
|
124
124
|
"linux-arm64": ["@tailwind-styled/native-linux-arm64-gnu", "@tailwind-styled/native-linux-arm64"],
|
|
@@ -129,17 +129,29 @@ var init_native_resolution = __esm({
|
|
|
129
129
|
};
|
|
130
130
|
}
|
|
131
131
|
});
|
|
132
|
+
|
|
133
|
+
// packages/domain/shared/src/index.ts
|
|
134
|
+
import { createHash } from "crypto";
|
|
135
|
+
import fs2 from "fs";
|
|
136
|
+
import path2 from "path";
|
|
137
|
+
import { fileURLToPath } from "url";
|
|
138
|
+
import { createRequire as createRequire2 } from "module";
|
|
132
139
|
function resolveRuntimeDir(dir, importMetaUrl) {
|
|
140
|
+
if (dir) return path2.resolve(dir);
|
|
133
141
|
try {
|
|
134
|
-
return
|
|
142
|
+
return path2.dirname(fileURLToPath(importMetaUrl));
|
|
135
143
|
} catch {
|
|
136
144
|
return process.cwd();
|
|
137
145
|
}
|
|
138
146
|
}
|
|
147
|
+
var _require2;
|
|
139
148
|
var init_src = __esm({
|
|
140
149
|
"packages/domain/shared/src/index.ts"() {
|
|
150
|
+
"use strict";
|
|
141
151
|
init_native_resolution();
|
|
142
|
-
|
|
152
|
+
_require2 = createRequire2(
|
|
153
|
+
typeof __filename !== "undefined" ? `file://${__filename}` : import.meta.url ?? "file://unknown"
|
|
154
|
+
);
|
|
143
155
|
}
|
|
144
156
|
});
|
|
145
157
|
|
|
@@ -147,6 +159,7 @@ var init_src = __esm({
|
|
|
147
159
|
var _loadNative, log, NATIVE_UNAVAILABLE_MESSAGE, nativeBridge, bridgeLoadAttempted, bridgeLoadError, isValidNativeBridge, getNativeBridge, adaptNativeResult;
|
|
148
160
|
var init_nativeBridge = __esm({
|
|
149
161
|
"packages/domain/compiler/src/nativeBridge.ts"() {
|
|
162
|
+
"use strict";
|
|
150
163
|
init_src();
|
|
151
164
|
_loadNative = (path5) => __require(path5);
|
|
152
165
|
log = (...args) => {
|
|
@@ -286,6 +299,7 @@ function resetCacheStats() {
|
|
|
286
299
|
}
|
|
287
300
|
var init_cssGeneratorNative = __esm({
|
|
288
301
|
"packages/domain/compiler/src/compiler/cssGeneratorNative.ts"() {
|
|
302
|
+
"use strict";
|
|
289
303
|
init_nativeBridge();
|
|
290
304
|
}
|
|
291
305
|
});
|
|
@@ -358,6 +372,7 @@ function atomicRegistrySize() {
|
|
|
358
372
|
}
|
|
359
373
|
var init_compilationNative = __esm({
|
|
360
374
|
"packages/domain/compiler/src/compiler/compilationNative.ts"() {
|
|
375
|
+
"use strict";
|
|
361
376
|
init_nativeBridge();
|
|
362
377
|
}
|
|
363
378
|
});
|
|
@@ -501,6 +516,7 @@ function twMergeRaw(classLists) {
|
|
|
501
516
|
}
|
|
502
517
|
var init_cssCompilationNative = __esm({
|
|
503
518
|
"packages/domain/compiler/src/compiler/cssCompilationNative.ts"() {
|
|
519
|
+
"use strict";
|
|
504
520
|
init_nativeBridge();
|
|
505
521
|
}
|
|
506
522
|
});
|
|
@@ -600,6 +616,7 @@ function idRegistryImport(importedData) {
|
|
|
600
616
|
}
|
|
601
617
|
var init_idRegistryNative = __esm({
|
|
602
618
|
"packages/domain/compiler/src/compiler/idRegistryNative.ts"() {
|
|
619
|
+
"use strict";
|
|
603
620
|
init_nativeBridge();
|
|
604
621
|
}
|
|
605
622
|
});
|
|
@@ -741,9 +758,13 @@ function scanFilesBatchNative(filesJson) {
|
|
|
741
758
|
}
|
|
742
759
|
var init_streamingNative = __esm({
|
|
743
760
|
"packages/domain/compiler/src/compiler/streamingNative.ts"() {
|
|
761
|
+
"use strict";
|
|
744
762
|
init_nativeBridge();
|
|
745
763
|
}
|
|
746
764
|
});
|
|
765
|
+
|
|
766
|
+
// packages/domain/compiler/src/tailwindEngine.ts
|
|
767
|
+
import { createRequire as createRequire3 } from "module";
|
|
747
768
|
function loadTailwindEngine() {
|
|
748
769
|
if (_twEngine) return _twEngine;
|
|
749
770
|
if (_twEngineError) throw _twEngineError;
|
|
@@ -763,10 +784,10 @@ async function generateRawCss(classes, cssEntryContent, root) {
|
|
|
763
784
|
if (classes.length === 0) return "";
|
|
764
785
|
const tw = loadTailwindEngine();
|
|
765
786
|
const input = cssEntryContent ?? "@import 'tailwindcss';";
|
|
766
|
-
const { readFileSync, existsSync: existsSync2 } = await import(
|
|
767
|
-
const { dirname, resolve: resolve2 } = await import(
|
|
787
|
+
const { readFileSync, existsSync: existsSync2 } = await import("fs");
|
|
788
|
+
const { dirname, resolve: resolve2 } = await import("path");
|
|
768
789
|
const projectRoot = root ?? process.cwd();
|
|
769
|
-
const req =
|
|
790
|
+
const req = createRequire3(resolve2(projectRoot, "package.json"));
|
|
770
791
|
const loadStylesheet = async (id, base) => {
|
|
771
792
|
try {
|
|
772
793
|
const cssId = id === "tailwindcss" ? "tailwindcss/index.css" : id === "tailwindcss/preflight" ? "tailwindcss/preflight.css" : id === "tailwindcss/utilities" ? "tailwindcss/utilities.css" : id === "tailwindcss/theme" ? "tailwindcss/theme.css" : id;
|
|
@@ -786,10 +807,14 @@ async function generateRawCss(classes, cssEntryContent, root) {
|
|
|
786
807
|
const compiler = await Promise.resolve(tw.compile(input, { loadStylesheet }));
|
|
787
808
|
return compiler.build(classes);
|
|
788
809
|
}
|
|
789
|
-
var require2, _twEngine, _twEngineError;
|
|
810
|
+
var require2, MAX_CACHE_MEMORY, _twEngine, _twEngineError;
|
|
790
811
|
var init_tailwindEngine = __esm({
|
|
791
812
|
"packages/domain/compiler/src/tailwindEngine.ts"() {
|
|
792
|
-
|
|
813
|
+
"use strict";
|
|
814
|
+
require2 = createRequire3(
|
|
815
|
+
typeof __filename !== "undefined" ? `file://${__filename}` : typeof import.meta !== "undefined" && import.meta.url ? import.meta.url : "file://unknown"
|
|
816
|
+
);
|
|
817
|
+
MAX_CACHE_MEMORY = 256 * 1024;
|
|
793
818
|
_twEngine = null;
|
|
794
819
|
_twEngineError = null;
|
|
795
820
|
}
|
|
@@ -804,6 +829,7 @@ __export(tailwindEngine_exports, {
|
|
|
804
829
|
runCssPipeline: () => runCssPipeline,
|
|
805
830
|
runCssPipelineSync: () => runCssPipelineSync
|
|
806
831
|
});
|
|
832
|
+
import { createRequire as createRequire4 } from "module";
|
|
807
833
|
function _getCacheKey(classes, minify, cssEntry, root) {
|
|
808
834
|
const sorted = [...classes].sort().join(",");
|
|
809
835
|
const flags = `${minify ? "1" : "0"}${cssEntry ? "1" : "0"}${root ? "1" : "0"}`;
|
|
@@ -970,24 +996,29 @@ function processTailwindCssWithTargets(css, targets) {
|
|
|
970
996
|
}
|
|
971
997
|
return result.css;
|
|
972
998
|
}
|
|
973
|
-
var _cssCache, _cacheHits, _cacheMisses, MAX_CACHE_SIZE;
|
|
999
|
+
var require3, _cssCache, _cacheHits, _cacheMisses, MAX_CACHE_SIZE, MAX_CACHE_MEMORY2;
|
|
974
1000
|
var init_tailwindEngine2 = __esm({
|
|
975
1001
|
"packages/domain/compiler/src/compiler/tailwindEngine.ts"() {
|
|
1002
|
+
"use strict";
|
|
976
1003
|
init_nativeBridge();
|
|
977
1004
|
init_cssGeneratorNative();
|
|
978
1005
|
init_cssCompilationNative();
|
|
979
1006
|
init_tailwindEngine();
|
|
980
|
-
|
|
1007
|
+
require3 = createRequire4(
|
|
1008
|
+
typeof __filename !== "undefined" ? `file://${__filename}` : typeof import.meta !== "undefined" && import.meta.url ? import.meta.url : "file://unknown"
|
|
1009
|
+
);
|
|
981
1010
|
_cssCache = /* @__PURE__ */ new Map();
|
|
982
1011
|
_cacheHits = 0;
|
|
983
1012
|
_cacheMisses = 0;
|
|
984
1013
|
MAX_CACHE_SIZE = 100;
|
|
1014
|
+
MAX_CACHE_MEMORY2 = 256 * 1024;
|
|
985
1015
|
}
|
|
986
1016
|
});
|
|
987
1017
|
|
|
988
1018
|
// packages/domain/compiler/src/compiler/index.ts
|
|
989
1019
|
var init_compiler = __esm({
|
|
990
1020
|
"packages/domain/compiler/src/compiler/index.ts"() {
|
|
1021
|
+
"use strict";
|
|
991
1022
|
init_cssGeneratorNative();
|
|
992
1023
|
init_compilationNative();
|
|
993
1024
|
init_cssCompilationNative();
|
|
@@ -1000,6 +1031,7 @@ var init_compiler = __esm({
|
|
|
1000
1031
|
var parseClasses, parseClass, extractAllClasses, extractClassesFromSource, astExtractClasses, normalizeClasses, mergeClassesStatic, normalizeAndDedupClasses, extractComponentUsage, batchExtractClasses, checkAgainstSafelist, diffClassLists;
|
|
1001
1032
|
var init_parser = __esm({
|
|
1002
1033
|
"packages/domain/compiler/src/parser/index.ts"() {
|
|
1034
|
+
"use strict";
|
|
1003
1035
|
init_nativeBridge();
|
|
1004
1036
|
parseClasses = (raw) => {
|
|
1005
1037
|
const native = getNativeBridge();
|
|
@@ -1178,6 +1210,7 @@ function resetMemoryStats() {
|
|
|
1178
1210
|
}
|
|
1179
1211
|
var init_analyzerNative = __esm({
|
|
1180
1212
|
"packages/domain/compiler/src/analyzer/analyzerNative.ts"() {
|
|
1213
|
+
"use strict";
|
|
1181
1214
|
init_nativeBridge();
|
|
1182
1215
|
}
|
|
1183
1216
|
});
|
|
@@ -1271,6 +1304,7 @@ function resolveSimpleVariants(configJson) {
|
|
|
1271
1304
|
}
|
|
1272
1305
|
var init_themeResolutionNative = __esm({
|
|
1273
1306
|
"packages/domain/compiler/src/analyzer/themeResolutionNative.ts"() {
|
|
1307
|
+
"use strict";
|
|
1274
1308
|
init_nativeBridge();
|
|
1275
1309
|
}
|
|
1276
1310
|
});
|
|
@@ -1318,6 +1352,7 @@ function generateSubComponentTypes(root, outputPath) {
|
|
|
1318
1352
|
}
|
|
1319
1353
|
var init_scannerNative = __esm({
|
|
1320
1354
|
"packages/domain/compiler/src/analyzer/scannerNative.ts"() {
|
|
1355
|
+
"use strict";
|
|
1321
1356
|
init_nativeBridge();
|
|
1322
1357
|
}
|
|
1323
1358
|
});
|
|
@@ -1325,6 +1360,7 @@ var init_scannerNative = __esm({
|
|
|
1325
1360
|
// packages/domain/compiler/src/analyzer/index.ts
|
|
1326
1361
|
var init_analyzer = __esm({
|
|
1327
1362
|
"packages/domain/compiler/src/analyzer/index.ts"() {
|
|
1363
|
+
"use strict";
|
|
1328
1364
|
init_analyzerNative();
|
|
1329
1365
|
init_themeResolutionNative();
|
|
1330
1366
|
init_scannerNative();
|
|
@@ -1513,6 +1549,7 @@ function resetResolverPoolStats() {
|
|
|
1513
1549
|
}
|
|
1514
1550
|
var init_cacheNative = __esm({
|
|
1515
1551
|
"packages/domain/compiler/src/cache/cacheNative.ts"() {
|
|
1552
|
+
"use strict";
|
|
1516
1553
|
init_nativeBridge();
|
|
1517
1554
|
}
|
|
1518
1555
|
});
|
|
@@ -1520,6 +1557,7 @@ var init_cacheNative = __esm({
|
|
|
1520
1557
|
// packages/domain/compiler/src/cache/index.ts
|
|
1521
1558
|
var init_cache = __esm({
|
|
1522
1559
|
"packages/domain/compiler/src/cache/index.ts"() {
|
|
1560
|
+
"use strict";
|
|
1523
1561
|
init_cacheNative();
|
|
1524
1562
|
}
|
|
1525
1563
|
});
|
|
@@ -1768,6 +1806,7 @@ function redisDiagnose() {
|
|
|
1768
1806
|
}
|
|
1769
1807
|
var init_redisNative = __esm({
|
|
1770
1808
|
"packages/domain/compiler/src/redis/redisNative.ts"() {
|
|
1809
|
+
"use strict";
|
|
1771
1810
|
init_nativeBridge();
|
|
1772
1811
|
}
|
|
1773
1812
|
});
|
|
@@ -1775,6 +1814,7 @@ var init_redisNative = __esm({
|
|
|
1775
1814
|
// packages/domain/compiler/src/redis/index.ts
|
|
1776
1815
|
var init_redis = __esm({
|
|
1777
1816
|
"packages/domain/compiler/src/redis/index.ts"() {
|
|
1817
|
+
"use strict";
|
|
1778
1818
|
init_redisNative();
|
|
1779
1819
|
}
|
|
1780
1820
|
});
|
|
@@ -1913,6 +1953,7 @@ function getCompilerDiagnostics() {
|
|
|
1913
1953
|
}
|
|
1914
1954
|
var init_watchSystemNative = __esm({
|
|
1915
1955
|
"packages/domain/compiler/src/watch/watchSystemNative.ts"() {
|
|
1956
|
+
"use strict";
|
|
1916
1957
|
init_nativeBridge();
|
|
1917
1958
|
}
|
|
1918
1959
|
});
|
|
@@ -1920,9 +1961,15 @@ var init_watchSystemNative = __esm({
|
|
|
1920
1961
|
// packages/domain/compiler/src/watch/index.ts
|
|
1921
1962
|
var init_watch = __esm({
|
|
1922
1963
|
"packages/domain/compiler/src/watch/index.ts"() {
|
|
1964
|
+
"use strict";
|
|
1923
1965
|
init_watchSystemNative();
|
|
1924
1966
|
}
|
|
1925
1967
|
});
|
|
1968
|
+
|
|
1969
|
+
// packages/domain/compiler/src/index.ts
|
|
1970
|
+
import fs3 from "fs";
|
|
1971
|
+
import path3 from "path";
|
|
1972
|
+
import { createRequire as createRequire5 } from "module";
|
|
1926
1973
|
function _layoutClassesToCss(classes) {
|
|
1927
1974
|
const native = getNativeBridge();
|
|
1928
1975
|
if (!native?.layoutClassesToCss) {
|
|
@@ -1960,6 +2007,7 @@ function extractContainerCssFromSource(source) {
|
|
|
1960
2007
|
var _require3, transformSource, hasTwUsage, isAlreadyTransformed, shouldProcess, compileCssFromClasses, buildStyleTag, generateCssForClasses, eliminateDeadCss, findDeadVariants, runElimination, scanProjectUsage, generateSafelist, loadSafelist, loadTailwindConfig, getContentPaths, _CONTAINER_BREAKPOINTS, runLoaderTransform, shouldSkipFile, fileToRoute, getAllRoutes, getRouteClasses, registerFileClasses, registerGlobalClasses, _incrementalEngineInstance, getIncrementalEngine, resetIncrementalEngine, IncrementalEngine, getBucketEngine, resetBucketEngine, classifyNode, detectConflicts, bucketSort, analyzeFile, analyzeVariantUsage, injectClientDirective, injectServerOnlyComment, analyzeClasses, extractTwStateConfigs, generateStaticStateCss, extractAndGenerateStateCss;
|
|
1961
2008
|
var init_src2 = __esm({
|
|
1962
2009
|
"packages/domain/compiler/src/index.ts"() {
|
|
2010
|
+
"use strict";
|
|
1963
2011
|
init_nativeBridge();
|
|
1964
2012
|
init_compiler();
|
|
1965
2013
|
init_parser();
|
|
@@ -1967,7 +2015,9 @@ var init_src2 = __esm({
|
|
|
1967
2015
|
init_cache();
|
|
1968
2016
|
init_redis();
|
|
1969
2017
|
init_watch();
|
|
1970
|
-
_require3 =
|
|
2018
|
+
_require3 = createRequire5(
|
|
2019
|
+
typeof __require !== "undefined" ? typeof __filename !== "undefined" ? `file://${__filename}` : "file://unknown" : import.meta.url
|
|
2020
|
+
);
|
|
1971
2021
|
transformSource = (source, opts) => {
|
|
1972
2022
|
const native = getNativeBridge();
|
|
1973
2023
|
if (!native?.transformSource) {
|
|
@@ -2059,7 +2109,7 @@ var init_src2 = __esm({
|
|
|
2059
2109
|
};
|
|
2060
2110
|
scanProjectUsage = (dirs, cwd) => {
|
|
2061
2111
|
const { batchExtractClasses: batchExtractClasses2 } = _require3("./parser");
|
|
2062
|
-
const files = dirs.map((dir) =>
|
|
2112
|
+
const files = dirs.map((dir) => path3.resolve(cwd, dir));
|
|
2063
2113
|
const results = batchExtractClasses2(files) || [];
|
|
2064
2114
|
const combined = {};
|
|
2065
2115
|
for (const result of results) {
|
|
@@ -2076,13 +2126,13 @@ var init_src2 = __esm({
|
|
|
2076
2126
|
const classes = scanProjectUsage(scanDirs, cwd || process.cwd());
|
|
2077
2127
|
const allClasses = Object.keys(classes).sort();
|
|
2078
2128
|
if (outputPath) {
|
|
2079
|
-
|
|
2129
|
+
fs3.writeFileSync(outputPath, JSON.stringify(allClasses, null, 2));
|
|
2080
2130
|
}
|
|
2081
2131
|
return allClasses;
|
|
2082
2132
|
};
|
|
2083
2133
|
loadSafelist = (safelistPath) => {
|
|
2084
2134
|
try {
|
|
2085
|
-
const content =
|
|
2135
|
+
const content = fs3.readFileSync(safelistPath, "utf-8");
|
|
2086
2136
|
return JSON.parse(content);
|
|
2087
2137
|
} catch {
|
|
2088
2138
|
return [];
|
|
@@ -2096,8 +2146,8 @@ var init_src2 = __esm({
|
|
|
2096
2146
|
"tailwind.config.cjs"
|
|
2097
2147
|
];
|
|
2098
2148
|
for (const file of configFiles) {
|
|
2099
|
-
const fullPath =
|
|
2100
|
-
if (
|
|
2149
|
+
const fullPath = path3.join(cwd, file);
|
|
2150
|
+
if (fs3.existsSync(fullPath)) {
|
|
2101
2151
|
const mod = __require(fullPath);
|
|
2102
2152
|
return mod.default || mod;
|
|
2103
2153
|
}
|
|
@@ -2107,9 +2157,9 @@ var init_src2 = __esm({
|
|
|
2107
2157
|
getContentPaths = (cwd = process.cwd()) => {
|
|
2108
2158
|
return {
|
|
2109
2159
|
content: [
|
|
2110
|
-
|
|
2111
|
-
|
|
2112
|
-
|
|
2160
|
+
path3.join(cwd, "src/**/*.{js,ts,jsx,tsx}"),
|
|
2161
|
+
path3.join(cwd, "app/**/*.{js,ts,jsx,tsx}"),
|
|
2162
|
+
path3.join(cwd, "pages/**/*.{js,ts,jsx,tsx}")
|
|
2113
2163
|
]
|
|
2114
2164
|
};
|
|
2115
2165
|
};
|
|
@@ -2523,6 +2573,7 @@ __export(internal_exports, {
|
|
|
2523
2573
|
});
|
|
2524
2574
|
var init_internal = __esm({
|
|
2525
2575
|
"packages/domain/compiler/src/internal.ts"() {
|
|
2576
|
+
"use strict";
|
|
2526
2577
|
init_src2();
|
|
2527
2578
|
init_tailwindEngine2();
|
|
2528
2579
|
init_compiler();
|
|
@@ -2536,10 +2587,12 @@ var init_internal = __esm({
|
|
|
2536
2587
|
|
|
2537
2588
|
// packages/presentation/next/src/turbopackLoader.ts
|
|
2538
2589
|
init_internal();
|
|
2590
|
+
import fs4 from "fs";
|
|
2591
|
+
import path4 from "path";
|
|
2539
2592
|
var _writtenRules = /* @__PURE__ */ new Set();
|
|
2540
2593
|
function appendStaticCssToFile(staticCss, safelistPath) {
|
|
2541
2594
|
if (!staticCss.trim() || !safelistPath) return;
|
|
2542
|
-
const stateFilePath =
|
|
2595
|
+
const stateFilePath = path4.join(path4.dirname(safelistPath), "_tw-state-static.css");
|
|
2543
2596
|
const newRules = [];
|
|
2544
2597
|
for (const chunk of staticCss.split(/(?<=\})\s*/)) {
|
|
2545
2598
|
const rule = chunk.trim();
|
|
@@ -2550,9 +2603,9 @@ function appendStaticCssToFile(staticCss, safelistPath) {
|
|
|
2550
2603
|
}
|
|
2551
2604
|
if (newRules.length === 0) return;
|
|
2552
2605
|
try {
|
|
2553
|
-
|
|
2554
|
-
if (!
|
|
2555
|
-
|
|
2606
|
+
fs4.mkdirSync(path4.dirname(stateFilePath), { recursive: true });
|
|
2607
|
+
if (!fs4.existsSync(stateFilePath)) {
|
|
2608
|
+
fs4.writeFileSync(
|
|
2556
2609
|
stateFilePath,
|
|
2557
2610
|
`/* _tw-state-static.css \u2014 Auto-generated by tailwind-styled-v4. DO NOT EDIT.
|
|
2558
2611
|
* Import di globals.css: @import "./_tw-state-static.css";
|
|
@@ -2563,7 +2616,7 @@ function appendStaticCssToFile(staticCss, safelistPath) {
|
|
|
2563
2616
|
"utf-8"
|
|
2564
2617
|
);
|
|
2565
2618
|
}
|
|
2566
|
-
|
|
2619
|
+
fs4.appendFileSync(stateFilePath, newRules.join("\n") + "\n", "utf-8");
|
|
2567
2620
|
} catch {
|
|
2568
2621
|
}
|
|
2569
2622
|
}
|
|
@@ -2602,11 +2655,11 @@ var CYCLE_SENTINEL = "_cycle.txt";
|
|
|
2602
2655
|
var START_SENTINEL = "_start.txt";
|
|
2603
2656
|
var _workerCache = /* @__PURE__ */ new Map();
|
|
2604
2657
|
function getTwClassesDir(safelistPath) {
|
|
2605
|
-
return
|
|
2658
|
+
return path4.join(path4.dirname(safelistPath), "tw-classes");
|
|
2606
2659
|
}
|
|
2607
2660
|
function readSentinel(filePath) {
|
|
2608
2661
|
try {
|
|
2609
|
-
return
|
|
2662
|
+
return fs4.readFileSync(filePath, "utf-8").trim();
|
|
2610
2663
|
} catch {
|
|
2611
2664
|
return "";
|
|
2612
2665
|
}
|
|
@@ -2616,36 +2669,36 @@ function clearAndMarkCycle(twClassesDir, startId) {
|
|
|
2616
2669
|
if (_clearLock) return;
|
|
2617
2670
|
_clearLock = true;
|
|
2618
2671
|
try {
|
|
2619
|
-
if (
|
|
2672
|
+
if (fs4.existsSync(twClassesDir)) {
|
|
2620
2673
|
const tempDir = `${twClassesDir}_clearing_${Date.now()}`;
|
|
2621
2674
|
try {
|
|
2622
|
-
|
|
2623
|
-
|
|
2624
|
-
const startFile =
|
|
2625
|
-
if (
|
|
2626
|
-
|
|
2675
|
+
fs4.renameSync(twClassesDir, tempDir);
|
|
2676
|
+
fs4.mkdirSync(twClassesDir, { recursive: true });
|
|
2677
|
+
const startFile = path4.join(tempDir, START_SENTINEL);
|
|
2678
|
+
if (fs4.existsSync(startFile)) {
|
|
2679
|
+
fs4.copyFileSync(startFile, path4.join(twClassesDir, START_SENTINEL));
|
|
2627
2680
|
}
|
|
2628
|
-
const mergedFile =
|
|
2629
|
-
if (
|
|
2630
|
-
|
|
2681
|
+
const mergedFile = path4.join(tempDir, "_webpack-merged.css");
|
|
2682
|
+
if (fs4.existsSync(mergedFile)) {
|
|
2683
|
+
fs4.copyFileSync(mergedFile, path4.join(twClassesDir, "_webpack-merged.css"));
|
|
2631
2684
|
}
|
|
2632
|
-
|
|
2685
|
+
fs4.writeFileSync(path4.join(twClassesDir, CYCLE_SENTINEL), startId, "utf-8");
|
|
2633
2686
|
_workerCache.set(twClassesDir, startId);
|
|
2634
|
-
|
|
2687
|
+
fs4.rmSync(tempDir, { recursive: true, force: true });
|
|
2635
2688
|
} catch {
|
|
2636
|
-
for (const file of
|
|
2689
|
+
for (const file of fs4.readdirSync(twClassesDir)) {
|
|
2637
2690
|
if (file === START_SENTINEL || file === "_webpack-merged.css") continue;
|
|
2638
2691
|
try {
|
|
2639
|
-
|
|
2692
|
+
fs4.unlinkSync(path4.join(twClassesDir, file));
|
|
2640
2693
|
} catch {
|
|
2641
2694
|
}
|
|
2642
2695
|
}
|
|
2643
|
-
|
|
2696
|
+
fs4.writeFileSync(path4.join(twClassesDir, CYCLE_SENTINEL), startId, "utf-8");
|
|
2644
2697
|
_workerCache.set(twClassesDir, startId);
|
|
2645
2698
|
}
|
|
2646
2699
|
} else {
|
|
2647
|
-
|
|
2648
|
-
|
|
2700
|
+
fs4.mkdirSync(twClassesDir, { recursive: true });
|
|
2701
|
+
fs4.writeFileSync(path4.join(twClassesDir, CYCLE_SENTINEL), startId, "utf-8");
|
|
2649
2702
|
_workerCache.set(twClassesDir, startId);
|
|
2650
2703
|
}
|
|
2651
2704
|
} catch {
|
|
@@ -2656,41 +2709,41 @@ function clearAndMarkCycle(twClassesDir, startId) {
|
|
|
2656
2709
|
function getPerFileSafelistPath(safelistDir, resourcePath) {
|
|
2657
2710
|
const normalized = resourcePath.replace(/\\/g, "/");
|
|
2658
2711
|
const slug = normalized.replace(/^.*\/src\//, "").replace(/\.[tj]sx?$/, "").replace(/[^a-zA-Z0-9]/g, "_").slice(0, 80);
|
|
2659
|
-
return
|
|
2712
|
+
return path4.join(safelistDir, `${slug}.css`);
|
|
2660
2713
|
}
|
|
2661
2714
|
function writePerFileSafelist(safelistPath, resourcePath, classes) {
|
|
2662
2715
|
if (!safelistPath || classes.length === 0) return;
|
|
2663
2716
|
try {
|
|
2664
2717
|
const twClassesDir = getTwClassesDir(safelistPath);
|
|
2665
|
-
const startId = readSentinel(
|
|
2666
|
-
const cachedCycle = _workerCache.get(twClassesDir) ?? readSentinel(
|
|
2718
|
+
const startId = readSentinel(path4.join(twClassesDir, START_SENTINEL));
|
|
2719
|
+
const cachedCycle = _workerCache.get(twClassesDir) ?? readSentinel(path4.join(twClassesDir, CYCLE_SENTINEL));
|
|
2667
2720
|
if (startId && cachedCycle !== startId) {
|
|
2668
2721
|
clearAndMarkCycle(twClassesDir, startId);
|
|
2669
|
-
} else if (!
|
|
2670
|
-
|
|
2722
|
+
} else if (!fs4.existsSync(twClassesDir)) {
|
|
2723
|
+
fs4.mkdirSync(twClassesDir, { recursive: true });
|
|
2671
2724
|
}
|
|
2672
2725
|
const outPath = getPerFileSafelistPath(twClassesDir, resourcePath);
|
|
2673
2726
|
const sorted = [...new Set(classes)].sort();
|
|
2674
2727
|
const css = [
|
|
2675
|
-
`/* tw-safelist: ${
|
|
2728
|
+
`/* tw-safelist: ${path4.basename(resourcePath)} \u2014 auto-generated */`,
|
|
2676
2729
|
"@layer utilities {",
|
|
2677
2730
|
sorted.map((cls) => `.${cls.replace(/([^a-zA-Z0-9_-])/g, "\\$1")} {}`).join("\n"),
|
|
2678
2731
|
"}"
|
|
2679
2732
|
].join("\n");
|
|
2680
2733
|
try {
|
|
2681
|
-
if (
|
|
2734
|
+
if (fs4.readFileSync(outPath, "utf-8") === css) return;
|
|
2682
2735
|
} catch {
|
|
2683
2736
|
}
|
|
2684
2737
|
const tmpPath = `${outPath}.tmp`;
|
|
2685
2738
|
try {
|
|
2686
|
-
|
|
2687
|
-
|
|
2739
|
+
fs4.writeFileSync(tmpPath, css, "utf-8");
|
|
2740
|
+
fs4.renameSync(tmpPath, outPath);
|
|
2688
2741
|
} catch {
|
|
2689
2742
|
try {
|
|
2690
|
-
|
|
2743
|
+
fs4.unlinkSync(tmpPath);
|
|
2691
2744
|
} catch {
|
|
2692
2745
|
}
|
|
2693
|
-
|
|
2746
|
+
fs4.writeFileSync(outPath, css, "utf-8");
|
|
2694
2747
|
}
|
|
2695
2748
|
} catch {
|
|
2696
2749
|
}
|
|
@@ -2704,7 +2757,7 @@ function turbopackLoader(source, options = {}) {
|
|
|
2704
2757
|
const router = detectRouter(this.resourcePath);
|
|
2705
2758
|
const nextMajor = parseNum(options.nextMajor);
|
|
2706
2759
|
const debug = parseBool(options.debug);
|
|
2707
|
-
const filename =
|
|
2760
|
+
const filename = path4.basename(this.resourcePath);
|
|
2708
2761
|
const effective = {
|
|
2709
2762
|
addDataAttr: parseBool(options.addDataAttr),
|
|
2710
2763
|
// App Router: selalu auto-detect client boundary
|
|
@@ -2766,7 +2819,7 @@ function turbopackLoader(source, options = {}) {
|
|
|
2766
2819
|
return source;
|
|
2767
2820
|
}
|
|
2768
2821
|
}
|
|
2769
|
-
|
|
2770
|
-
|
|
2771
|
-
|
|
2822
|
+
export {
|
|
2823
|
+
turbopackLoader as default
|
|
2824
|
+
};
|
|
2772
2825
|
//# sourceMappingURL=turbopackLoader.mjs.map
|