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/shared.js
CHANGED
|
@@ -1,45 +1,12 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
var zod = require('zod');
|
|
4
|
-
var module$1 = require('module');
|
|
5
|
-
var fs3 = require('fs');
|
|
6
|
-
var path = require('path');
|
|
7
|
-
var crypto = require('crypto');
|
|
8
|
-
var url = require('url');
|
|
9
|
-
|
|
10
|
-
var _documentCurrentScript = typeof document !== 'undefined' ? document.currentScript : null;
|
|
11
|
-
function _interopNamespace(e) {
|
|
12
|
-
if (e && e.__esModule) return e;
|
|
13
|
-
var n = Object.create(null);
|
|
14
|
-
if (e) {
|
|
15
|
-
Object.keys(e).forEach(function (k) {
|
|
16
|
-
if (k !== 'default') {
|
|
17
|
-
var d = Object.getOwnPropertyDescriptor(e, k);
|
|
18
|
-
Object.defineProperty(n, k, d.get ? d : {
|
|
19
|
-
enumerable: true,
|
|
20
|
-
get: function () { return e[k]; }
|
|
21
|
-
});
|
|
22
|
-
}
|
|
23
|
-
});
|
|
24
|
-
}
|
|
25
|
-
n.default = e;
|
|
26
|
-
return Object.freeze(n);
|
|
27
|
-
}
|
|
28
|
-
|
|
29
|
-
var fs3__namespace = /*#__PURE__*/_interopNamespace(fs3);
|
|
30
|
-
var path__namespace = /*#__PURE__*/_interopNamespace(path);
|
|
31
|
-
|
|
1
|
+
const __importMetaUrl = typeof __filename !== "undefined" ? require("node:url").pathToFileURL(__filename).href : "file://unknown";
|
|
32
2
|
/* tailwind-styled-v4 v5.0.4 | MIT | https://github.com/dictionar32/tailwind-styled-v4 */
|
|
3
|
+
"use strict";
|
|
4
|
+
var __create = Object.create;
|
|
33
5
|
var __defProp = Object.defineProperty;
|
|
34
6
|
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
35
7
|
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
8
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
36
9
|
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
37
|
-
var __require = /* @__PURE__ */ ((x) => typeof require !== "undefined" ? require : typeof Proxy !== "undefined" ? new Proxy(x, {
|
|
38
|
-
get: (a, b) => (typeof require !== "undefined" ? require : a)[b]
|
|
39
|
-
}) : x)(function(x) {
|
|
40
|
-
if (typeof require !== "undefined") return require.apply(this, arguments);
|
|
41
|
-
throw Error('Dynamic require of "' + x + '" is not supported');
|
|
42
|
-
});
|
|
43
10
|
var __esm = (fn, res) => function __init() {
|
|
44
11
|
return fn && (res = (0, fn[__getOwnPropNames(fn)[0]])(fn = 0)), res;
|
|
45
12
|
};
|
|
@@ -55,6 +22,14 @@ var __copyProps = (to, from, except, desc) => {
|
|
|
55
22
|
}
|
|
56
23
|
return to;
|
|
57
24
|
};
|
|
25
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
26
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
|
27
|
+
// file that has been converted to a CommonJS file using a Babel-
|
|
28
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
29
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
30
|
+
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
31
|
+
mod
|
|
32
|
+
));
|
|
58
33
|
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
59
34
|
|
|
60
35
|
// packages/domain/shared/src/trace.ts
|
|
@@ -149,6 +124,7 @@ function getPipelinePercentages(metrics) {
|
|
|
149
124
|
}
|
|
150
125
|
var init_trace = __esm({
|
|
151
126
|
"packages/domain/shared/src/trace.ts"() {
|
|
127
|
+
"use strict";
|
|
152
128
|
}
|
|
153
129
|
});
|
|
154
130
|
|
|
@@ -160,10 +136,11 @@ function formatErrorCode(code) {
|
|
|
160
136
|
const prefix = code.startsWith("E") ? "Error" : code.startsWith("W") ? "Warning" : "Code";
|
|
161
137
|
return `[${prefix} ${code}]`;
|
|
162
138
|
}
|
|
163
|
-
|
|
139
|
+
var ERROR_CODES, ERROR_SUGGESTIONS;
|
|
164
140
|
var init_error_codes = __esm({
|
|
165
141
|
"packages/domain/shared/src/error-codes.ts"() {
|
|
166
|
-
|
|
142
|
+
"use strict";
|
|
143
|
+
ERROR_CODES = {
|
|
167
144
|
// E0xx — Native binding
|
|
168
145
|
NATIVE_NOT_FOUND: "E001",
|
|
169
146
|
NATIVE_LOAD_FAILED: "E002",
|
|
@@ -204,8 +181,8 @@ var init_error_codes = __esm({
|
|
|
204
181
|
// packages/domain/shared/src/compatibility.ts
|
|
205
182
|
function detectTailwind() {
|
|
206
183
|
try {
|
|
207
|
-
const pkgPath =
|
|
208
|
-
const { version } =
|
|
184
|
+
const pkgPath = require.resolve("tailwindcss/package.json");
|
|
185
|
+
const { version } = require(pkgPath);
|
|
209
186
|
const major = Number.parseInt(version.split(".")[0], 10);
|
|
210
187
|
return { version, major, supported: major >= 4, path: pkgPath };
|
|
211
188
|
} catch {
|
|
@@ -229,8 +206,11 @@ function isTailwindV4() {
|
|
|
229
206
|
}
|
|
230
207
|
var init_compatibility = __esm({
|
|
231
208
|
"packages/domain/shared/src/compatibility.ts"() {
|
|
209
|
+
"use strict";
|
|
232
210
|
}
|
|
233
211
|
});
|
|
212
|
+
|
|
213
|
+
// packages/domain/shared/src/native-schemas.ts
|
|
234
214
|
function safeParseNative(schema, data, fallback) {
|
|
235
215
|
const result = schema.safeParse(data);
|
|
236
216
|
return result.success ? result.data : fallback;
|
|
@@ -246,67 +226,69 @@ function parseNative(schema, data, context) {
|
|
|
246
226
|
}
|
|
247
227
|
return result.data;
|
|
248
228
|
}
|
|
249
|
-
|
|
229
|
+
var import_zod, NativeScanFileSchema, NativeScanResultSchema, NativeClassUsageSchema, NativeAnalyzerReportSchema, NativeTransformResultSchema, NativeCssCompileResultSchema, NativeWatchEventSchema, NativeWatchResultSchema, NativeCacheEntrySchema, NativeCacheReadResultSchema;
|
|
250
230
|
var init_native_schemas = __esm({
|
|
251
231
|
"packages/domain/shared/src/native-schemas.ts"() {
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
232
|
+
"use strict";
|
|
233
|
+
import_zod = require("zod");
|
|
234
|
+
NativeScanFileSchema = import_zod.z.object({
|
|
235
|
+
file: import_zod.z.string().min(1, "file path cannot be empty"),
|
|
236
|
+
classes: import_zod.z.array(import_zod.z.string()),
|
|
237
|
+
hash: import_zod.z.string().optional()
|
|
256
238
|
});
|
|
257
|
-
|
|
258
|
-
files:
|
|
259
|
-
totalFiles:
|
|
260
|
-
uniqueClasses:
|
|
239
|
+
NativeScanResultSchema = import_zod.z.object({
|
|
240
|
+
files: import_zod.z.array(NativeScanFileSchema),
|
|
241
|
+
totalFiles: import_zod.z.number().int().nonnegative(),
|
|
242
|
+
uniqueClasses: import_zod.z.array(import_zod.z.string())
|
|
261
243
|
});
|
|
262
|
-
NativeClassUsageSchema =
|
|
263
|
-
name:
|
|
264
|
-
count:
|
|
265
|
-
files:
|
|
244
|
+
NativeClassUsageSchema = import_zod.z.object({
|
|
245
|
+
name: import_zod.z.string(),
|
|
246
|
+
count: import_zod.z.number().int().nonnegative(),
|
|
247
|
+
files: import_zod.z.array(import_zod.z.string()).optional()
|
|
266
248
|
});
|
|
267
|
-
|
|
268
|
-
root:
|
|
269
|
-
topClasses:
|
|
270
|
-
safelist:
|
|
271
|
-
css:
|
|
272
|
-
conflicts:
|
|
273
|
-
unusedClasses:
|
|
274
|
-
durationMs:
|
|
249
|
+
NativeAnalyzerReportSchema = import_zod.z.object({
|
|
250
|
+
root: import_zod.z.string(),
|
|
251
|
+
topClasses: import_zod.z.array(NativeClassUsageSchema).optional(),
|
|
252
|
+
safelist: import_zod.z.array(import_zod.z.string()).optional(),
|
|
253
|
+
css: import_zod.z.string().optional(),
|
|
254
|
+
conflicts: import_zod.z.array(import_zod.z.unknown()).optional(),
|
|
255
|
+
unusedClasses: import_zod.z.array(import_zod.z.string()).optional(),
|
|
256
|
+
durationMs: import_zod.z.number().nonnegative().optional()
|
|
275
257
|
});
|
|
276
|
-
|
|
277
|
-
code:
|
|
278
|
-
classes:
|
|
279
|
-
changed:
|
|
280
|
-
rsc:
|
|
281
|
-
isServer:
|
|
282
|
-
needsClientDirective:
|
|
283
|
-
clientReasons:
|
|
258
|
+
NativeTransformResultSchema = import_zod.z.object({
|
|
259
|
+
code: import_zod.z.string(),
|
|
260
|
+
classes: import_zod.z.array(import_zod.z.string()),
|
|
261
|
+
changed: import_zod.z.boolean(),
|
|
262
|
+
rsc: import_zod.z.object({
|
|
263
|
+
isServer: import_zod.z.boolean(),
|
|
264
|
+
needsClientDirective: import_zod.z.boolean(),
|
|
265
|
+
clientReasons: import_zod.z.array(import_zod.z.string())
|
|
284
266
|
}).optional()
|
|
285
267
|
});
|
|
286
|
-
|
|
287
|
-
css:
|
|
288
|
-
resolvedClasses:
|
|
289
|
-
unresolvedClasses:
|
|
268
|
+
NativeCssCompileResultSchema = import_zod.z.object({
|
|
269
|
+
css: import_zod.z.string(),
|
|
270
|
+
resolvedClasses: import_zod.z.array(import_zod.z.string()),
|
|
271
|
+
unresolvedClasses: import_zod.z.array(import_zod.z.string()).optional()
|
|
290
272
|
});
|
|
291
|
-
|
|
292
|
-
type:
|
|
293
|
-
path:
|
|
273
|
+
NativeWatchEventSchema = import_zod.z.object({
|
|
274
|
+
type: import_zod.z.enum(["change", "unlink", "create"]),
|
|
275
|
+
path: import_zod.z.string()
|
|
294
276
|
});
|
|
295
|
-
|
|
296
|
-
status:
|
|
297
|
-
handleId:
|
|
298
|
-
error:
|
|
277
|
+
NativeWatchResultSchema = import_zod.z.object({
|
|
278
|
+
status: import_zod.z.enum(["ok", "error"]),
|
|
279
|
+
handleId: import_zod.z.string().optional(),
|
|
280
|
+
error: import_zod.z.string().optional()
|
|
299
281
|
});
|
|
300
|
-
|
|
301
|
-
file:
|
|
302
|
-
hash:
|
|
303
|
-
classes:
|
|
304
|
-
timestamp:
|
|
305
|
-
size:
|
|
282
|
+
NativeCacheEntrySchema = import_zod.z.object({
|
|
283
|
+
file: import_zod.z.string(),
|
|
284
|
+
hash: import_zod.z.string(),
|
|
285
|
+
classes: import_zod.z.array(import_zod.z.string()),
|
|
286
|
+
timestamp: import_zod.z.number(),
|
|
287
|
+
size: import_zod.z.number().optional()
|
|
306
288
|
});
|
|
307
|
-
|
|
308
|
-
entries:
|
|
309
|
-
version:
|
|
289
|
+
NativeCacheReadResultSchema = import_zod.z.object({
|
|
290
|
+
entries: import_zod.z.array(NativeCacheEntrySchema),
|
|
291
|
+
version: import_zod.z.string().optional()
|
|
310
292
|
});
|
|
311
293
|
}
|
|
312
294
|
});
|
|
@@ -316,7 +298,7 @@ function getNodeModuleRef() {
|
|
|
316
298
|
if (isBrowser) return null;
|
|
317
299
|
if (nodeModuleRef !== null) return nodeModuleRef;
|
|
318
300
|
try {
|
|
319
|
-
const test = typeof
|
|
301
|
+
const test = typeof require === "function" ? require("module") : null;
|
|
320
302
|
nodeModuleRef = test;
|
|
321
303
|
return test;
|
|
322
304
|
} catch {
|
|
@@ -324,48 +306,78 @@ function getNodeModuleRef() {
|
|
|
324
306
|
return null;
|
|
325
307
|
}
|
|
326
308
|
}
|
|
309
|
+
function getCurrentFileUrl() {
|
|
310
|
+
if (__importMetaUrl) {
|
|
311
|
+
return __importMetaUrl;
|
|
312
|
+
}
|
|
313
|
+
if (typeof __filename !== "undefined") {
|
|
314
|
+
return `file://${__filename.replace(/\\/g, "/")}`;
|
|
315
|
+
}
|
|
316
|
+
return "file://unknown";
|
|
317
|
+
}
|
|
327
318
|
function getNodePath() {
|
|
328
319
|
if (isBrowser) throw new Error("node:path not available in browser");
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
320
|
+
if (!_nodePath) {
|
|
321
|
+
if (typeof require === "function") {
|
|
322
|
+
_nodePath = require("path");
|
|
323
|
+
} else {
|
|
324
|
+
const nodeRequire = getNodeModuleRef();
|
|
325
|
+
if (!nodeRequire) throw new Error("require not available");
|
|
326
|
+
_nodePath = nodeRequire.createRequire(getCurrentFileUrl())("node:path");
|
|
327
|
+
}
|
|
328
|
+
}
|
|
332
329
|
return _nodePath;
|
|
333
330
|
}
|
|
334
331
|
function getNodeUrl() {
|
|
335
332
|
if (isBrowser) throw new Error("node:url not available in browser");
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
333
|
+
if (!_nodeUrl) {
|
|
334
|
+
if (typeof require === "function") {
|
|
335
|
+
_nodeUrl = require("url");
|
|
336
|
+
} else {
|
|
337
|
+
const nodeRequire = getNodeModuleRef();
|
|
338
|
+
if (!nodeRequire) throw new Error("require not available");
|
|
339
|
+
_nodeUrl = nodeRequire.createRequire(getCurrentFileUrl())("node:url");
|
|
340
|
+
}
|
|
341
|
+
}
|
|
339
342
|
return _nodeUrl;
|
|
340
343
|
}
|
|
341
344
|
function getNodeFs() {
|
|
342
345
|
if (isBrowser) throw new Error("node:fs not available in browser");
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
+
if (!_nodeFs) {
|
|
347
|
+
if (typeof require === "function") {
|
|
348
|
+
_nodeFs = require("fs");
|
|
349
|
+
} else {
|
|
350
|
+
const nodeRequire = getNodeModuleRef();
|
|
351
|
+
if (!nodeRequire) throw new Error("require not available");
|
|
352
|
+
_nodeFs = nodeRequire.createRequire(getCurrentFileUrl())("node:fs");
|
|
353
|
+
}
|
|
354
|
+
}
|
|
346
355
|
return _nodeFs;
|
|
347
356
|
}
|
|
348
357
|
function createEsmRequire(importMetaUrl) {
|
|
349
358
|
if (isBrowser) throw new Error("require not available in browser");
|
|
359
|
+
if (typeof require === "function") return require;
|
|
350
360
|
const nodeRequire = getNodeModuleRef();
|
|
351
361
|
if (!nodeRequire) throw new Error("require not available");
|
|
352
362
|
return nodeRequire.createRequire(importMetaUrl);
|
|
353
363
|
}
|
|
354
364
|
function getDirname(importMetaUrl) {
|
|
355
365
|
if (isBrowser) return "";
|
|
366
|
+
if (typeof __dirname !== "undefined") return __dirname;
|
|
356
367
|
const nodePath = getNodePath();
|
|
357
368
|
const nodeUrl = getNodeUrl();
|
|
358
369
|
return nodePath.dirname(nodeUrl.fileURLToPath(importMetaUrl));
|
|
359
370
|
}
|
|
360
371
|
function getFilename(importMetaUrl) {
|
|
361
372
|
if (isBrowser) return "";
|
|
373
|
+
if (typeof __filename !== "undefined") return __filename;
|
|
362
374
|
return getNodeUrl().fileURLToPath(importMetaUrl);
|
|
363
375
|
}
|
|
364
376
|
function resolveFromRoot(...segments) {
|
|
365
377
|
if (isBrowser) return segments.join("/");
|
|
366
378
|
const nodePath = getNodePath();
|
|
367
379
|
const nodeFs = getNodeFs();
|
|
368
|
-
let dir =
|
|
380
|
+
let dir = typeof __dirname !== "undefined" ? __dirname : getDirname(getCurrentFileUrl());
|
|
369
381
|
for (let i = 0; i < 10; i++) {
|
|
370
382
|
const pkgPath = nodePath.join(dir, "package.json");
|
|
371
383
|
try {
|
|
@@ -394,6 +406,7 @@ function resolveNativeNodePath(importMetaUrl, ...relativeSegments) {
|
|
|
394
406
|
var isBrowser, nodeModuleRef, _nodePath, _nodeUrl, _nodeFs;
|
|
395
407
|
var init_esmHelpers = __esm({
|
|
396
408
|
"packages/domain/shared/src/esmHelpers.ts"() {
|
|
409
|
+
"use strict";
|
|
397
410
|
isBrowser = typeof window !== "undefined" || typeof document !== "undefined";
|
|
398
411
|
nodeModuleRef = null;
|
|
399
412
|
_nodePath = null;
|
|
@@ -405,7 +418,7 @@ var init_esmHelpers = __esm({
|
|
|
405
418
|
// packages/domain/shared/src/telemetry.ts
|
|
406
419
|
function getGlobalTelemetry() {
|
|
407
420
|
if (!_globalCollector) {
|
|
408
|
-
_globalCollector = new
|
|
421
|
+
_globalCollector = new TelemetryCollector();
|
|
409
422
|
}
|
|
410
423
|
return _globalCollector;
|
|
411
424
|
}
|
|
@@ -441,11 +454,12 @@ function createBuildTimer() {
|
|
|
441
454
|
}
|
|
442
455
|
};
|
|
443
456
|
}
|
|
444
|
-
var RING_BUFFER_SIZE
|
|
457
|
+
var RING_BUFFER_SIZE, TelemetryCollector, _globalCollector;
|
|
445
458
|
var init_telemetry = __esm({
|
|
446
459
|
"packages/domain/shared/src/telemetry.ts"() {
|
|
460
|
+
"use strict";
|
|
447
461
|
RING_BUFFER_SIZE = 100;
|
|
448
|
-
|
|
462
|
+
TelemetryCollector = class {
|
|
449
463
|
data = [];
|
|
450
464
|
enabled;
|
|
451
465
|
constructor(enabled) {
|
|
@@ -510,6 +524,8 @@ var init_telemetry = __esm({
|
|
|
510
524
|
_globalCollector = null;
|
|
511
525
|
}
|
|
512
526
|
});
|
|
527
|
+
|
|
528
|
+
// packages/domain/shared/src/configSchemas.ts
|
|
513
529
|
function parseJsonWithSchema(jsonString, schema, sourceName) {
|
|
514
530
|
let parsed;
|
|
515
531
|
try {
|
|
@@ -528,8 +544,8 @@ ${issues}`);
|
|
|
528
544
|
return result.data;
|
|
529
545
|
}
|
|
530
546
|
function parseJsonFileWithSchema(filePath, schema) {
|
|
531
|
-
const { readFileSync } =
|
|
532
|
-
const { basename } =
|
|
547
|
+
const { readFileSync } = require("fs");
|
|
548
|
+
const { basename } = require("path");
|
|
533
549
|
let content;
|
|
534
550
|
try {
|
|
535
551
|
content = readFileSync(filePath, "utf-8");
|
|
@@ -540,70 +556,72 @@ function parseJsonFileWithSchema(filePath, schema) {
|
|
|
540
556
|
}
|
|
541
557
|
return parseJsonWithSchema(content, schema, basename(filePath));
|
|
542
558
|
}
|
|
543
|
-
|
|
559
|
+
var import_zod2, ScanCacheClassEntrySchema, ScanCacheSchema, TailwindContentItemSchema, TailwindConfigSchema, RegistryPluginEntrySchema, RegistryFileSchema, PackageJsonSchema;
|
|
544
560
|
var init_configSchemas = __esm({
|
|
545
561
|
"packages/domain/shared/src/configSchemas.ts"() {
|
|
546
|
-
|
|
547
|
-
|
|
548
|
-
|
|
549
|
-
|
|
550
|
-
|
|
551
|
-
|
|
562
|
+
"use strict";
|
|
563
|
+
import_zod2 = require("zod");
|
|
564
|
+
ScanCacheClassEntrySchema = import_zod2.z.object({
|
|
565
|
+
name: import_zod2.z.string().min(1),
|
|
566
|
+
usedIn: import_zod2.z.array(import_zod2.z.string()),
|
|
567
|
+
risk: import_zod2.z.enum(["low", "medium", "high"]).default("low"),
|
|
568
|
+
bundleContribution: import_zod2.z.number().nonnegative().default(0),
|
|
569
|
+
variants: import_zod2.z.array(import_zod2.z.string()).default([])
|
|
552
570
|
});
|
|
553
|
-
|
|
554
|
-
version:
|
|
555
|
-
generatedAt:
|
|
556
|
-
root:
|
|
557
|
-
classNames:
|
|
558
|
-
totalFiles:
|
|
559
|
-
uniqueCount:
|
|
571
|
+
ScanCacheSchema = import_zod2.z.object({
|
|
572
|
+
version: import_zod2.z.string().default("1"),
|
|
573
|
+
generatedAt: import_zod2.z.string(),
|
|
574
|
+
root: import_zod2.z.string(),
|
|
575
|
+
classNames: import_zod2.z.array(ScanCacheClassEntrySchema),
|
|
576
|
+
totalFiles: import_zod2.z.number().int().nonnegative(),
|
|
577
|
+
uniqueCount: import_zod2.z.number().int().nonnegative()
|
|
560
578
|
});
|
|
561
|
-
TailwindContentItemSchema =
|
|
562
|
-
|
|
563
|
-
|
|
564
|
-
raw:
|
|
565
|
-
extension:
|
|
579
|
+
TailwindContentItemSchema = import_zod2.z.union([
|
|
580
|
+
import_zod2.z.string(),
|
|
581
|
+
import_zod2.z.object({
|
|
582
|
+
raw: import_zod2.z.string(),
|
|
583
|
+
extension: import_zod2.z.string().optional()
|
|
566
584
|
}),
|
|
567
|
-
|
|
568
|
-
files:
|
|
569
|
-
transform:
|
|
585
|
+
import_zod2.z.object({
|
|
586
|
+
files: import_zod2.z.array(import_zod2.z.string()),
|
|
587
|
+
transform: import_zod2.z.record(import_zod2.z.string(), import_zod2.z.unknown()).optional()
|
|
570
588
|
})
|
|
571
589
|
]);
|
|
572
|
-
|
|
573
|
-
content:
|
|
574
|
-
theme:
|
|
575
|
-
plugins:
|
|
576
|
-
darkMode:
|
|
577
|
-
prefix:
|
|
578
|
-
safelist:
|
|
579
|
-
blocklist:
|
|
590
|
+
TailwindConfigSchema = import_zod2.z.object({
|
|
591
|
+
content: import_zod2.z.array(TailwindContentItemSchema).optional(),
|
|
592
|
+
theme: import_zod2.z.record(import_zod2.z.string(), import_zod2.z.unknown()).optional(),
|
|
593
|
+
plugins: import_zod2.z.array(import_zod2.z.unknown()).optional(),
|
|
594
|
+
darkMode: import_zod2.z.union([import_zod2.z.literal("class"), import_zod2.z.literal("media"), import_zod2.z.literal(false)]).optional(),
|
|
595
|
+
prefix: import_zod2.z.string().optional(),
|
|
596
|
+
safelist: import_zod2.z.array(import_zod2.z.union([import_zod2.z.string(), import_zod2.z.object({ pattern: import_zod2.z.instanceof(RegExp) })])).optional(),
|
|
597
|
+
blocklist: import_zod2.z.array(import_zod2.z.string()).optional()
|
|
580
598
|
}).passthrough();
|
|
581
|
-
|
|
582
|
-
name:
|
|
583
|
-
description:
|
|
584
|
-
version:
|
|
585
|
-
tags:
|
|
586
|
-
official:
|
|
587
|
-
docs:
|
|
588
|
-
install:
|
|
589
|
-
integrity:
|
|
599
|
+
RegistryPluginEntrySchema = import_zod2.z.object({
|
|
600
|
+
name: import_zod2.z.string().min(1),
|
|
601
|
+
description: import_zod2.z.string(),
|
|
602
|
+
version: import_zod2.z.string(),
|
|
603
|
+
tags: import_zod2.z.array(import_zod2.z.string()).default([]),
|
|
604
|
+
official: import_zod2.z.boolean().default(false),
|
|
605
|
+
docs: import_zod2.z.string().url().optional(),
|
|
606
|
+
install: import_zod2.z.string().optional(),
|
|
607
|
+
integrity: import_zod2.z.string().optional()
|
|
590
608
|
});
|
|
591
|
-
|
|
592
|
-
version:
|
|
593
|
-
official:
|
|
594
|
-
community:
|
|
609
|
+
RegistryFileSchema = import_zod2.z.object({
|
|
610
|
+
version: import_zod2.z.string(),
|
|
611
|
+
official: import_zod2.z.array(RegistryPluginEntrySchema).default([]),
|
|
612
|
+
community: import_zod2.z.array(RegistryPluginEntrySchema).default([])
|
|
595
613
|
});
|
|
596
|
-
|
|
597
|
-
name:
|
|
598
|
-
version:
|
|
599
|
-
scripts:
|
|
600
|
-
dependencies:
|
|
601
|
-
devDependencies:
|
|
602
|
-
peerDependencies:
|
|
603
|
-
main:
|
|
604
|
-
module:
|
|
605
|
-
exports:
|
|
606
|
-
type:
|
|
614
|
+
PackageJsonSchema = import_zod2.z.object({
|
|
615
|
+
name: import_zod2.z.string(),
|
|
616
|
+
version: import_zod2.z.string(),
|
|
617
|
+
scripts: import_zod2.z.record(import_zod2.z.string(), import_zod2.z.string()).optional(),
|
|
618
|
+
dependencies: import_zod2.z.record(import_zod2.z.string(), import_zod2.z.string()).optional(),
|
|
619
|
+
devDependencies: import_zod2.z.record(import_zod2.z.string(), import_zod2.z.string()).optional(),
|
|
620
|
+
peerDependencies: import_zod2.z.record(import_zod2.z.string(), import_zod2.z.string()).optional(),
|
|
621
|
+
main: import_zod2.z.string().optional(),
|
|
622
|
+
module: import_zod2.z.string().optional(),
|
|
623
|
+
exports: import_zod2.z.unknown().optional(),
|
|
624
|
+
type: import_zod2.z.enum(["module", "commonjs"]).optional()
|
|
607
625
|
}).passthrough();
|
|
608
626
|
}
|
|
609
627
|
});
|
|
@@ -613,8 +631,8 @@ function getDirnameFromUrl(importMetaUrl) {
|
|
|
613
631
|
if (!importMetaUrl) return "";
|
|
614
632
|
if (isBrowser2) return "";
|
|
615
633
|
try {
|
|
616
|
-
const nodeUrl =
|
|
617
|
-
const nodePath =
|
|
634
|
+
const nodeUrl = require(NODE_URL);
|
|
635
|
+
const nodePath = require(NODE_PATH);
|
|
618
636
|
return nodePath.dirname(nodeUrl.fileURLToPath(importMetaUrl));
|
|
619
637
|
} catch {
|
|
620
638
|
if (importMetaUrl.startsWith("file://")) {
|
|
@@ -628,7 +646,7 @@ function getDirnameFromUrl(importMetaUrl) {
|
|
|
628
646
|
function resolvePath(...segments) {
|
|
629
647
|
if (isBrowser2) return segments.join("/").replace(/\/+/g, "/");
|
|
630
648
|
try {
|
|
631
|
-
const nodePath =
|
|
649
|
+
const nodePath = require(NODE_PATH);
|
|
632
650
|
return nodePath.resolve(...segments);
|
|
633
651
|
} catch {
|
|
634
652
|
return segments.join("/").replace(/\/+/g, "/");
|
|
@@ -637,7 +655,7 @@ function resolvePath(...segments) {
|
|
|
637
655
|
function existsSync(path6) {
|
|
638
656
|
if (isBrowser2) return false;
|
|
639
657
|
try {
|
|
640
|
-
const nodeFs =
|
|
658
|
+
const nodeFs = require(NODE_FS);
|
|
641
659
|
return nodeFs.existsSync(path6);
|
|
642
660
|
} catch {
|
|
643
661
|
return false;
|
|
@@ -691,6 +709,7 @@ function resolveLoaderPath(loaderBasename, importMetaUrl) {
|
|
|
691
709
|
var isBrowser2, NODE_URL, NODE_FS, NODE_PATH;
|
|
692
710
|
var init_workerResolver = __esm({
|
|
693
711
|
"packages/domain/shared/src/workerResolver.ts"() {
|
|
712
|
+
"use strict";
|
|
694
713
|
isBrowser2 = typeof window !== "undefined" || typeof document !== "undefined";
|
|
695
714
|
NODE_URL = typeof window === "undefined" || typeof document === "undefined" ? "node:url" : null;
|
|
696
715
|
NODE_FS = typeof window === "undefined" || typeof document === "undefined" ? "node:fs" : null;
|
|
@@ -840,13 +859,13 @@ function generateClassRenameCodemod(renames, opts = {}) {
|
|
|
840
859
|
}
|
|
841
860
|
return lines.join("\n");
|
|
842
861
|
}
|
|
843
|
-
function generateBarrelFile(
|
|
862
|
+
function generateBarrelFile(exports2, dir, opts = {}) {
|
|
844
863
|
const { includeTypes = true } = opts;
|
|
845
864
|
const lines = [];
|
|
846
865
|
lines.push(`// Auto-generated barrel file for ${dir}`);
|
|
847
866
|
lines.push(`// Run: npx tsx scripts/generate-barrel.ts to regenerate`);
|
|
848
867
|
lines.push(``);
|
|
849
|
-
for (const name of
|
|
868
|
+
for (const name of exports2) {
|
|
850
869
|
lines.push(`export { default as ${name}, type ${name}Props } from "./${name}"`);
|
|
851
870
|
if (includeTypes) {
|
|
852
871
|
lines.push(`export type * from "./${name}"`);
|
|
@@ -856,8 +875,11 @@ function generateBarrelFile(exports$1, dir, opts = {}) {
|
|
|
856
875
|
}
|
|
857
876
|
var init_codegen = __esm({
|
|
858
877
|
"packages/domain/shared/src/codegen.ts"() {
|
|
878
|
+
"use strict";
|
|
859
879
|
}
|
|
860
880
|
});
|
|
881
|
+
|
|
882
|
+
// packages/domain/shared/src/native-resolution.ts
|
|
861
883
|
function platformKey() {
|
|
862
884
|
if (isBrowser3) return "browser";
|
|
863
885
|
return `${process.platform}-${process.arch}`;
|
|
@@ -873,7 +895,7 @@ function resolveNativeBinary(runtimeDir) {
|
|
|
873
895
|
}
|
|
874
896
|
const envPath = process.env.TW_NATIVE_PATH?.trim();
|
|
875
897
|
if (envPath) {
|
|
876
|
-
if (
|
|
898
|
+
if (fs.existsSync(envPath)) {
|
|
877
899
|
return { path: envPath, source: "env", platform, tried };
|
|
878
900
|
}
|
|
879
901
|
tried.push(`env:${envPath} (not found)`);
|
|
@@ -882,7 +904,7 @@ function resolveNativeBinary(runtimeDir) {
|
|
|
882
904
|
for (const pkg of prebuiltPkgs) {
|
|
883
905
|
try {
|
|
884
906
|
const candidate = _require.resolve(`${pkg}/tailwind_styled_parser.node`);
|
|
885
|
-
if (
|
|
907
|
+
if (fs.existsSync(candidate)) {
|
|
886
908
|
return { path: candidate, source: "prebuilt", platform, tried };
|
|
887
909
|
}
|
|
888
910
|
tried.push(`prebuilt:${pkg} (resolved but missing)`);
|
|
@@ -893,13 +915,13 @@ function resolveNativeBinary(runtimeDir) {
|
|
|
893
915
|
const napiPlatform = platform === "linux-x64" ? "linux-x64-gnu" : platform === "linux-arm64" ? "linux-arm64-gnu" : platform;
|
|
894
916
|
const BINARY_NAMES_SELF = ["tailwind-styled-native", "tailwind_styled_parser"];
|
|
895
917
|
if (runtimeDir) {
|
|
896
|
-
for (const depth of ["..",
|
|
897
|
-
const pkgRoot =
|
|
918
|
+
for (const depth of ["..", path.join("..", ".."), path.join("..", "..", "..")]) {
|
|
919
|
+
const pkgRoot = path.resolve(runtimeDir, depth);
|
|
898
920
|
for (const bin of BINARY_NAMES_SELF) {
|
|
899
921
|
for (const suffix of ["", `.${platform}`, `.${napiPlatform}`]) {
|
|
900
|
-
const candidate =
|
|
922
|
+
const candidate = path.resolve(pkgRoot, "native", `${bin}${suffix}.node`);
|
|
901
923
|
tried.push(`self-bundled:${candidate}`);
|
|
902
|
-
if (
|
|
924
|
+
if (fs.existsSync(candidate)) {
|
|
903
925
|
return { path: candidate, source: "prebuilt", platform, tried };
|
|
904
926
|
}
|
|
905
927
|
}
|
|
@@ -911,29 +933,29 @@ function resolveNativeBinary(runtimeDir) {
|
|
|
911
933
|
const BINARY_NAMES = ["tailwind-styled-native", "tailwind_styled_parser"];
|
|
912
934
|
const localCandidates = [];
|
|
913
935
|
for (const bin of BINARY_NAMES) {
|
|
914
|
-
localCandidates.push(
|
|
915
|
-
localCandidates.push(
|
|
916
|
-
localCandidates.push(
|
|
917
|
-
localCandidates.push(
|
|
936
|
+
localCandidates.push(path.resolve(base, `${bin}.node`));
|
|
937
|
+
localCandidates.push(path.resolve(base, "..", `${bin}.node`));
|
|
938
|
+
localCandidates.push(path.resolve(base, `${bin}.${platform}.node`));
|
|
939
|
+
localCandidates.push(path.resolve(base, `${bin}.${napiPlatform}.node`));
|
|
918
940
|
}
|
|
919
941
|
for (const startDir of [cwd, base]) {
|
|
920
942
|
let dir = startDir;
|
|
921
943
|
for (let i = 0; i < 6; i++) {
|
|
922
|
-
const nativeDir =
|
|
944
|
+
const nativeDir = path.resolve(dir, "native");
|
|
923
945
|
for (const bin of BINARY_NAMES) {
|
|
924
|
-
localCandidates.push(
|
|
925
|
-
localCandidates.push(
|
|
926
|
-
localCandidates.push(
|
|
927
|
-
localCandidates.push(
|
|
946
|
+
localCandidates.push(path.resolve(nativeDir, `${bin}.node`));
|
|
947
|
+
localCandidates.push(path.resolve(nativeDir, `${bin}.${platform}.node`));
|
|
948
|
+
localCandidates.push(path.resolve(nativeDir, `${bin}.${napiPlatform}.node`));
|
|
949
|
+
localCandidates.push(path.resolve(nativeDir, "target", "release", `${bin}.node`));
|
|
928
950
|
}
|
|
929
|
-
const parent =
|
|
951
|
+
const parent = path.resolve(dir, "..");
|
|
930
952
|
if (parent === dir) break;
|
|
931
953
|
dir = parent;
|
|
932
954
|
}
|
|
933
955
|
}
|
|
934
956
|
for (const candidate of localCandidates) {
|
|
935
957
|
tried.push(`local:${candidate}`);
|
|
936
|
-
if (
|
|
958
|
+
if (fs.existsSync(candidate)) {
|
|
937
959
|
return { path: candidate, source: "local", platform, tried };
|
|
938
960
|
}
|
|
939
961
|
}
|
|
@@ -953,11 +975,17 @@ function formatNativeNotFoundError(result) {
|
|
|
953
975
|
];
|
|
954
976
|
return lines.join("\n");
|
|
955
977
|
}
|
|
956
|
-
var isBrowser3, _require, PLATFORM_MAP;
|
|
978
|
+
var import_node_module, fs, path, isBrowser3, _require, PLATFORM_MAP;
|
|
957
979
|
var init_native_resolution = __esm({
|
|
958
980
|
"packages/domain/shared/src/native-resolution.ts"() {
|
|
981
|
+
"use strict";
|
|
982
|
+
import_node_module = require("module");
|
|
983
|
+
fs = __toESM(require("fs"));
|
|
984
|
+
path = __toESM(require("path"));
|
|
959
985
|
isBrowser3 = typeof window !== "undefined" || typeof document !== "undefined";
|
|
960
|
-
_require =
|
|
986
|
+
_require = (0, import_node_module.createRequire)(
|
|
987
|
+
typeof require !== "undefined" ? typeof __filename !== "undefined" ? `file://${__filename}` : "file://unknown" : __importMetaUrl
|
|
988
|
+
);
|
|
961
989
|
PLATFORM_MAP = {
|
|
962
990
|
"linux-x64": ["@tailwind-styled/native-linux-x64-gnu", "@tailwind-styled/native-linux-x64"],
|
|
963
991
|
"linux-arm64": ["@tailwind-styled/native-linux-arm64-gnu", "@tailwind-styled/native-linux-arm64"],
|
|
@@ -1003,6 +1031,7 @@ function createObservabilityClient(opts = {}) {
|
|
|
1003
1031
|
}
|
|
1004
1032
|
var init_observability = __esm({
|
|
1005
1033
|
"packages/domain/shared/src/observability.ts"() {
|
|
1034
|
+
"use strict";
|
|
1006
1035
|
}
|
|
1007
1036
|
});
|
|
1008
1037
|
|
|
@@ -1010,8 +1039,9 @@ var init_observability = __esm({
|
|
|
1010
1039
|
var _loadNative, log, NATIVE_UNAVAILABLE_MESSAGE, nativeBridge, bridgeLoadAttempted, bridgeLoadError, isValidNativeBridge, getNativeBridge, adaptNativeResult;
|
|
1011
1040
|
var init_nativeBridge = __esm({
|
|
1012
1041
|
"packages/domain/compiler/src/nativeBridge.ts"() {
|
|
1042
|
+
"use strict";
|
|
1013
1043
|
init_src2();
|
|
1014
|
-
_loadNative = (path6) =>
|
|
1044
|
+
_loadNative = (path6) => require(path6);
|
|
1015
1045
|
log = (...args) => {
|
|
1016
1046
|
if (process.env.DEBUG?.includes("compiler:native")) {
|
|
1017
1047
|
console.log("[compiler:native]", ...args);
|
|
@@ -1037,7 +1067,7 @@ var init_nativeBridge = __esm({
|
|
|
1037
1067
|
}
|
|
1038
1068
|
bridgeLoadAttempted = true;
|
|
1039
1069
|
try {
|
|
1040
|
-
const runtimeDir = resolveRuntimeDir(void 0,
|
|
1070
|
+
const runtimeDir = resolveRuntimeDir(void 0, __importMetaUrl);
|
|
1041
1071
|
const result = resolveNativeBinary(runtimeDir);
|
|
1042
1072
|
if (result.path && result.path.endsWith(".node")) {
|
|
1043
1073
|
try {
|
|
@@ -1149,6 +1179,7 @@ function resetCacheStats() {
|
|
|
1149
1179
|
}
|
|
1150
1180
|
var init_cssGeneratorNative = __esm({
|
|
1151
1181
|
"packages/domain/compiler/src/compiler/cssGeneratorNative.ts"() {
|
|
1182
|
+
"use strict";
|
|
1152
1183
|
init_nativeBridge();
|
|
1153
1184
|
}
|
|
1154
1185
|
});
|
|
@@ -1221,6 +1252,7 @@ function atomicRegistrySize() {
|
|
|
1221
1252
|
}
|
|
1222
1253
|
var init_compilationNative = __esm({
|
|
1223
1254
|
"packages/domain/compiler/src/compiler/compilationNative.ts"() {
|
|
1255
|
+
"use strict";
|
|
1224
1256
|
init_nativeBridge();
|
|
1225
1257
|
}
|
|
1226
1258
|
});
|
|
@@ -1364,6 +1396,7 @@ function twMergeRaw(classLists) {
|
|
|
1364
1396
|
}
|
|
1365
1397
|
var init_cssCompilationNative = __esm({
|
|
1366
1398
|
"packages/domain/compiler/src/compiler/cssCompilationNative.ts"() {
|
|
1399
|
+
"use strict";
|
|
1367
1400
|
init_nativeBridge();
|
|
1368
1401
|
}
|
|
1369
1402
|
});
|
|
@@ -1463,6 +1496,7 @@ function idRegistryImport(importedData) {
|
|
|
1463
1496
|
}
|
|
1464
1497
|
var init_idRegistryNative = __esm({
|
|
1465
1498
|
"packages/domain/compiler/src/compiler/idRegistryNative.ts"() {
|
|
1499
|
+
"use strict";
|
|
1466
1500
|
init_nativeBridge();
|
|
1467
1501
|
}
|
|
1468
1502
|
});
|
|
@@ -1604,9 +1638,12 @@ function scanFilesBatchNative(filesJson) {
|
|
|
1604
1638
|
}
|
|
1605
1639
|
var init_streamingNative = __esm({
|
|
1606
1640
|
"packages/domain/compiler/src/compiler/streamingNative.ts"() {
|
|
1641
|
+
"use strict";
|
|
1607
1642
|
init_nativeBridge();
|
|
1608
1643
|
}
|
|
1609
1644
|
});
|
|
1645
|
+
|
|
1646
|
+
// packages/domain/compiler/src/tailwindEngine.ts
|
|
1610
1647
|
function loadTailwindEngine() {
|
|
1611
1648
|
if (_twEngine) return _twEngine;
|
|
1612
1649
|
if (_twEngineError) throw _twEngineError;
|
|
@@ -1626,10 +1663,10 @@ async function generateRawCss(classes, cssEntryContent, root) {
|
|
|
1626
1663
|
if (classes.length === 0) return "";
|
|
1627
1664
|
const tw = loadTailwindEngine();
|
|
1628
1665
|
const input = cssEntryContent ?? "@import 'tailwindcss';";
|
|
1629
|
-
const { readFileSync, existsSync: existsSync3 } = await import(
|
|
1630
|
-
const { dirname, resolve: resolve2 } = await import(
|
|
1666
|
+
const { readFileSync, existsSync: existsSync3 } = await import("fs");
|
|
1667
|
+
const { dirname, resolve: resolve2 } = await import("path");
|
|
1631
1668
|
const projectRoot = root ?? process.cwd();
|
|
1632
|
-
const req =
|
|
1669
|
+
const req = (0, import_node_module2.createRequire)(resolve2(projectRoot, "package.json"));
|
|
1633
1670
|
const loadStylesheet = async (id, base) => {
|
|
1634
1671
|
try {
|
|
1635
1672
|
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;
|
|
@@ -1649,10 +1686,16 @@ async function generateRawCss(classes, cssEntryContent, root) {
|
|
|
1649
1686
|
const compiler = await Promise.resolve(tw.compile(input, { loadStylesheet }));
|
|
1650
1687
|
return compiler.build(classes);
|
|
1651
1688
|
}
|
|
1652
|
-
var require2, _twEngine, _twEngineError;
|
|
1689
|
+
var import_node_module2, import_meta, require2, MAX_CACHE_MEMORY, _twEngine, _twEngineError;
|
|
1653
1690
|
var init_tailwindEngine = __esm({
|
|
1654
1691
|
"packages/domain/compiler/src/tailwindEngine.ts"() {
|
|
1655
|
-
|
|
1692
|
+
"use strict";
|
|
1693
|
+
import_node_module2 = require("module");
|
|
1694
|
+
import_meta = {};
|
|
1695
|
+
require2 = (0, import_node_module2.createRequire)(
|
|
1696
|
+
typeof __filename !== "undefined" ? `file://${__filename}` : typeof import_meta !== "undefined" && __importMetaUrl ? __importMetaUrl : "file://unknown"
|
|
1697
|
+
);
|
|
1698
|
+
MAX_CACHE_MEMORY = 256 * 1024;
|
|
1656
1699
|
_twEngine = null;
|
|
1657
1700
|
_twEngineError = null;
|
|
1658
1701
|
}
|
|
@@ -1833,24 +1876,31 @@ function processTailwindCssWithTargets(css, targets) {
|
|
|
1833
1876
|
}
|
|
1834
1877
|
return result.css;
|
|
1835
1878
|
}
|
|
1836
|
-
var _cssCache, _cacheHits, _cacheMisses, MAX_CACHE_SIZE;
|
|
1879
|
+
var import_node_module3, import_meta2, require3, _cssCache, _cacheHits, _cacheMisses, MAX_CACHE_SIZE, MAX_CACHE_MEMORY2;
|
|
1837
1880
|
var init_tailwindEngine2 = __esm({
|
|
1838
1881
|
"packages/domain/compiler/src/compiler/tailwindEngine.ts"() {
|
|
1882
|
+
"use strict";
|
|
1883
|
+
import_node_module3 = require("module");
|
|
1839
1884
|
init_nativeBridge();
|
|
1840
1885
|
init_cssGeneratorNative();
|
|
1841
1886
|
init_cssCompilationNative();
|
|
1842
1887
|
init_tailwindEngine();
|
|
1843
|
-
|
|
1888
|
+
import_meta2 = {};
|
|
1889
|
+
require3 = (0, import_node_module3.createRequire)(
|
|
1890
|
+
typeof __filename !== "undefined" ? `file://${__filename}` : typeof import_meta2 !== "undefined" && __importMetaUrl ? __importMetaUrl : "file://unknown"
|
|
1891
|
+
);
|
|
1844
1892
|
_cssCache = /* @__PURE__ */ new Map();
|
|
1845
1893
|
_cacheHits = 0;
|
|
1846
1894
|
_cacheMisses = 0;
|
|
1847
1895
|
MAX_CACHE_SIZE = 100;
|
|
1896
|
+
MAX_CACHE_MEMORY2 = 256 * 1024;
|
|
1848
1897
|
}
|
|
1849
1898
|
});
|
|
1850
1899
|
|
|
1851
1900
|
// packages/domain/compiler/src/compiler/index.ts
|
|
1852
1901
|
var init_compiler = __esm({
|
|
1853
1902
|
"packages/domain/compiler/src/compiler/index.ts"() {
|
|
1903
|
+
"use strict";
|
|
1854
1904
|
init_cssGeneratorNative();
|
|
1855
1905
|
init_compilationNative();
|
|
1856
1906
|
init_cssCompilationNative();
|
|
@@ -1863,6 +1913,7 @@ var init_compiler = __esm({
|
|
|
1863
1913
|
var parseClasses, parseClass, extractAllClasses, extractClassesFromSource, astExtractClasses, normalizeClasses, mergeClassesStatic, normalizeAndDedupClasses, extractComponentUsage, batchExtractClasses, checkAgainstSafelist, diffClassLists;
|
|
1864
1914
|
var init_parser = __esm({
|
|
1865
1915
|
"packages/domain/compiler/src/parser/index.ts"() {
|
|
1916
|
+
"use strict";
|
|
1866
1917
|
init_nativeBridge();
|
|
1867
1918
|
parseClasses = (raw) => {
|
|
1868
1919
|
const native = getNativeBridge();
|
|
@@ -2041,6 +2092,7 @@ function resetMemoryStats() {
|
|
|
2041
2092
|
}
|
|
2042
2093
|
var init_analyzerNative = __esm({
|
|
2043
2094
|
"packages/domain/compiler/src/analyzer/analyzerNative.ts"() {
|
|
2095
|
+
"use strict";
|
|
2044
2096
|
init_nativeBridge();
|
|
2045
2097
|
}
|
|
2046
2098
|
});
|
|
@@ -2134,6 +2186,7 @@ function resolveSimpleVariants(configJson) {
|
|
|
2134
2186
|
}
|
|
2135
2187
|
var init_themeResolutionNative = __esm({
|
|
2136
2188
|
"packages/domain/compiler/src/analyzer/themeResolutionNative.ts"() {
|
|
2189
|
+
"use strict";
|
|
2137
2190
|
init_nativeBridge();
|
|
2138
2191
|
}
|
|
2139
2192
|
});
|
|
@@ -2181,6 +2234,7 @@ function generateSubComponentTypes(root, outputPath) {
|
|
|
2181
2234
|
}
|
|
2182
2235
|
var init_scannerNative = __esm({
|
|
2183
2236
|
"packages/domain/compiler/src/analyzer/scannerNative.ts"() {
|
|
2237
|
+
"use strict";
|
|
2184
2238
|
init_nativeBridge();
|
|
2185
2239
|
}
|
|
2186
2240
|
});
|
|
@@ -2188,6 +2242,7 @@ var init_scannerNative = __esm({
|
|
|
2188
2242
|
// packages/domain/compiler/src/analyzer/index.ts
|
|
2189
2243
|
var init_analyzer = __esm({
|
|
2190
2244
|
"packages/domain/compiler/src/analyzer/index.ts"() {
|
|
2245
|
+
"use strict";
|
|
2191
2246
|
init_analyzerNative();
|
|
2192
2247
|
init_themeResolutionNative();
|
|
2193
2248
|
init_scannerNative();
|
|
@@ -2376,6 +2431,7 @@ function resetResolverPoolStats() {
|
|
|
2376
2431
|
}
|
|
2377
2432
|
var init_cacheNative = __esm({
|
|
2378
2433
|
"packages/domain/compiler/src/cache/cacheNative.ts"() {
|
|
2434
|
+
"use strict";
|
|
2379
2435
|
init_nativeBridge();
|
|
2380
2436
|
}
|
|
2381
2437
|
});
|
|
@@ -2383,6 +2439,7 @@ var init_cacheNative = __esm({
|
|
|
2383
2439
|
// packages/domain/compiler/src/cache/index.ts
|
|
2384
2440
|
var init_cache = __esm({
|
|
2385
2441
|
"packages/domain/compiler/src/cache/index.ts"() {
|
|
2442
|
+
"use strict";
|
|
2386
2443
|
init_cacheNative();
|
|
2387
2444
|
}
|
|
2388
2445
|
});
|
|
@@ -2631,6 +2688,7 @@ function redisDiagnose() {
|
|
|
2631
2688
|
}
|
|
2632
2689
|
var init_redisNative = __esm({
|
|
2633
2690
|
"packages/domain/compiler/src/redis/redisNative.ts"() {
|
|
2691
|
+
"use strict";
|
|
2634
2692
|
init_nativeBridge();
|
|
2635
2693
|
}
|
|
2636
2694
|
});
|
|
@@ -2638,6 +2696,7 @@ var init_redisNative = __esm({
|
|
|
2638
2696
|
// packages/domain/compiler/src/redis/index.ts
|
|
2639
2697
|
var init_redis = __esm({
|
|
2640
2698
|
"packages/domain/compiler/src/redis/index.ts"() {
|
|
2699
|
+
"use strict";
|
|
2641
2700
|
init_redisNative();
|
|
2642
2701
|
}
|
|
2643
2702
|
});
|
|
@@ -2776,6 +2835,7 @@ function getCompilerDiagnostics() {
|
|
|
2776
2835
|
}
|
|
2777
2836
|
var init_watchSystemNative = __esm({
|
|
2778
2837
|
"packages/domain/compiler/src/watch/watchSystemNative.ts"() {
|
|
2838
|
+
"use strict";
|
|
2779
2839
|
init_nativeBridge();
|
|
2780
2840
|
}
|
|
2781
2841
|
});
|
|
@@ -2783,9 +2843,12 @@ var init_watchSystemNative = __esm({
|
|
|
2783
2843
|
// packages/domain/compiler/src/watch/index.ts
|
|
2784
2844
|
var init_watch = __esm({
|
|
2785
2845
|
"packages/domain/compiler/src/watch/index.ts"() {
|
|
2846
|
+
"use strict";
|
|
2786
2847
|
init_watchSystemNative();
|
|
2787
2848
|
}
|
|
2788
2849
|
});
|
|
2850
|
+
|
|
2851
|
+
// packages/domain/compiler/src/index.ts
|
|
2789
2852
|
function _layoutClassesToCss(classes) {
|
|
2790
2853
|
const native = getNativeBridge();
|
|
2791
2854
|
if (!native?.layoutClassesToCss) {
|
|
@@ -2820,9 +2883,13 @@ function extractContainerCssFromSource(source) {
|
|
|
2820
2883
|
}
|
|
2821
2884
|
return rules.join("\n");
|
|
2822
2885
|
}
|
|
2823
|
-
var _require2, 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;
|
|
2886
|
+
var import_node_fs, import_node_path, import_node_module4, _require2, 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;
|
|
2824
2887
|
var init_src = __esm({
|
|
2825
2888
|
"packages/domain/compiler/src/index.ts"() {
|
|
2889
|
+
"use strict";
|
|
2890
|
+
import_node_fs = __toESM(require("fs"), 1);
|
|
2891
|
+
import_node_path = __toESM(require("path"), 1);
|
|
2892
|
+
import_node_module4 = require("module");
|
|
2826
2893
|
init_nativeBridge();
|
|
2827
2894
|
init_compiler();
|
|
2828
2895
|
init_parser();
|
|
@@ -2830,7 +2897,9 @@ var init_src = __esm({
|
|
|
2830
2897
|
init_cache();
|
|
2831
2898
|
init_redis();
|
|
2832
2899
|
init_watch();
|
|
2833
|
-
_require2 =
|
|
2900
|
+
_require2 = (0, import_node_module4.createRequire)(
|
|
2901
|
+
typeof require !== "undefined" ? typeof __filename !== "undefined" ? `file://${__filename}` : "file://unknown" : __importMetaUrl
|
|
2902
|
+
);
|
|
2834
2903
|
transformSource = (source, opts) => {
|
|
2835
2904
|
const native = getNativeBridge();
|
|
2836
2905
|
if (!native?.transformSource) {
|
|
@@ -2922,7 +2991,7 @@ var init_src = __esm({
|
|
|
2922
2991
|
};
|
|
2923
2992
|
scanProjectUsage = (dirs, cwd) => {
|
|
2924
2993
|
const { batchExtractClasses: batchExtractClasses2 } = _require2("./parser");
|
|
2925
|
-
const files = dirs.map((dir) =>
|
|
2994
|
+
const files = dirs.map((dir) => import_node_path.default.resolve(cwd, dir));
|
|
2926
2995
|
const results = batchExtractClasses2(files) || [];
|
|
2927
2996
|
const combined = {};
|
|
2928
2997
|
for (const result of results) {
|
|
@@ -2939,13 +3008,13 @@ var init_src = __esm({
|
|
|
2939
3008
|
const classes = scanProjectUsage(scanDirs, cwd || process.cwd());
|
|
2940
3009
|
const allClasses = Object.keys(classes).sort();
|
|
2941
3010
|
if (outputPath) {
|
|
2942
|
-
|
|
3011
|
+
import_node_fs.default.writeFileSync(outputPath, JSON.stringify(allClasses, null, 2));
|
|
2943
3012
|
}
|
|
2944
3013
|
return allClasses;
|
|
2945
3014
|
};
|
|
2946
3015
|
loadSafelist = (safelistPath) => {
|
|
2947
3016
|
try {
|
|
2948
|
-
const content =
|
|
3017
|
+
const content = import_node_fs.default.readFileSync(safelistPath, "utf-8");
|
|
2949
3018
|
return JSON.parse(content);
|
|
2950
3019
|
} catch {
|
|
2951
3020
|
return [];
|
|
@@ -2959,9 +3028,9 @@ var init_src = __esm({
|
|
|
2959
3028
|
"tailwind.config.cjs"
|
|
2960
3029
|
];
|
|
2961
3030
|
for (const file of configFiles) {
|
|
2962
|
-
const fullPath =
|
|
2963
|
-
if (
|
|
2964
|
-
const mod =
|
|
3031
|
+
const fullPath = import_node_path.default.join(cwd, file);
|
|
3032
|
+
if (import_node_fs.default.existsSync(fullPath)) {
|
|
3033
|
+
const mod = require(fullPath);
|
|
2965
3034
|
return mod.default || mod;
|
|
2966
3035
|
}
|
|
2967
3036
|
}
|
|
@@ -2970,9 +3039,9 @@ var init_src = __esm({
|
|
|
2970
3039
|
getContentPaths = (cwd = process.cwd()) => {
|
|
2971
3040
|
return {
|
|
2972
3041
|
content: [
|
|
2973
|
-
|
|
2974
|
-
|
|
2975
|
-
|
|
3042
|
+
import_node_path.default.join(cwd, "src/**/*.{js,ts,jsx,tsx}"),
|
|
3043
|
+
import_node_path.default.join(cwd, "app/**/*.{js,ts,jsx,tsx}"),
|
|
3044
|
+
import_node_path.default.join(cwd, "pages/**/*.{js,ts,jsx,tsx}")
|
|
2976
3045
|
]
|
|
2977
3046
|
};
|
|
2978
3047
|
};
|
|
@@ -3386,6 +3455,7 @@ __export(internal_exports, {
|
|
|
3386
3455
|
});
|
|
3387
3456
|
var init_internal = __esm({
|
|
3388
3457
|
"packages/domain/compiler/src/internal.ts"() {
|
|
3458
|
+
"use strict";
|
|
3389
3459
|
init_src();
|
|
3390
3460
|
init_tailwindEngine2();
|
|
3391
3461
|
init_compiler();
|
|
@@ -3396,6 +3466,8 @@ var init_internal = __esm({
|
|
|
3396
3466
|
init_watch();
|
|
3397
3467
|
}
|
|
3398
3468
|
});
|
|
3469
|
+
|
|
3470
|
+
// packages/domain/shared/src/staticStateExtractor.ts
|
|
3399
3471
|
function getNative() {
|
|
3400
3472
|
if (_native) return _native;
|
|
3401
3473
|
try {
|
|
@@ -3425,17 +3497,17 @@ function getNative() {
|
|
|
3425
3497
|
function* walkSourceFiles(dir) {
|
|
3426
3498
|
let entries;
|
|
3427
3499
|
try {
|
|
3428
|
-
entries =
|
|
3500
|
+
entries = import_node_fs2.default.readdirSync(dir, { withFileTypes: true });
|
|
3429
3501
|
} catch {
|
|
3430
3502
|
return;
|
|
3431
3503
|
}
|
|
3432
3504
|
for (const entry of entries) {
|
|
3433
|
-
const fullPath =
|
|
3505
|
+
const fullPath = import_node_path2.default.join(dir, entry.name);
|
|
3434
3506
|
if (entry.isDirectory()) {
|
|
3435
3507
|
if (IGNORE_PATTERNS.some((p) => entry.name === p || entry.name.startsWith(p))) continue;
|
|
3436
3508
|
yield* walkSourceFiles(fullPath);
|
|
3437
3509
|
} else if (entry.isFile()) {
|
|
3438
|
-
const ext =
|
|
3510
|
+
const ext = import_node_path2.default.extname(entry.name);
|
|
3439
3511
|
if (SOURCE_EXTENSIONS.has(ext)) yield fullPath;
|
|
3440
3512
|
}
|
|
3441
3513
|
}
|
|
@@ -3499,7 +3571,7 @@ function extractStaticStateCss(srcDir, options = {}) {
|
|
|
3499
3571
|
allConfigs.push(...configs);
|
|
3500
3572
|
if (verbose) {
|
|
3501
3573
|
process.stderr.write(
|
|
3502
|
-
`[tw:static-state] ${
|
|
3574
|
+
`[tw:static-state] ${import_node_path2.default.relative(srcDir, filePath)}: ${configs.length} komponen
|
|
3503
3575
|
`
|
|
3504
3576
|
);
|
|
3505
3577
|
}
|
|
@@ -3510,7 +3582,7 @@ function extractStaticStateCss(srcDir, options = {}) {
|
|
|
3510
3582
|
if (filesScanned >= maxFiles) break;
|
|
3511
3583
|
let source;
|
|
3512
3584
|
try {
|
|
3513
|
-
source =
|
|
3585
|
+
source = import_node_fs2.default.readFileSync(filePath, "utf-8");
|
|
3514
3586
|
} catch {
|
|
3515
3587
|
continue;
|
|
3516
3588
|
}
|
|
@@ -3523,7 +3595,7 @@ function extractStaticStateCss(srcDir, options = {}) {
|
|
|
3523
3595
|
allConfigs.push(...configs);
|
|
3524
3596
|
if (verbose) {
|
|
3525
3597
|
process.stderr.write(
|
|
3526
|
-
`[tw:static-state] ${
|
|
3598
|
+
`[tw:static-state] ${import_node_path2.default.relative(srcDir, filePath)}: ${configs.length} komponen
|
|
3527
3599
|
`
|
|
3528
3600
|
);
|
|
3529
3601
|
}
|
|
@@ -3617,12 +3689,12 @@ function appendStaticStateCssToSafelist(srcDir, safelistPath, options = {}) {
|
|
|
3617
3689
|
resolvedCss: options.resolvedCss || ""
|
|
3618
3690
|
// ← ensure always passed
|
|
3619
3691
|
});
|
|
3620
|
-
const twClassesDir =
|
|
3621
|
-
|
|
3622
|
-
const stateFilePath =
|
|
3692
|
+
const twClassesDir = import_node_path2.default.join(import_node_path2.default.dirname(safelistPath), "tw-classes");
|
|
3693
|
+
import_node_fs2.default.mkdirSync(twClassesDir, { recursive: true });
|
|
3694
|
+
const stateFilePath = import_node_path2.default.join(twClassesDir, TW_STATE_STATIC_FILENAME);
|
|
3623
3695
|
if (result.rulesGenerated === 0) {
|
|
3624
3696
|
try {
|
|
3625
|
-
|
|
3697
|
+
import_node_fs2.default.writeFileSync(
|
|
3626
3698
|
stateFilePath,
|
|
3627
3699
|
"/* tw-state-static.css \u2014 tidak ada state rules yang di-generate */\n",
|
|
3628
3700
|
"utf-8"
|
|
@@ -3632,27 +3704,32 @@ function appendStaticStateCssToSafelist(srcDir, safelistPath, options = {}) {
|
|
|
3632
3704
|
return `[tw:static-state] tidak ada state rules yang di-generate (${result.filesScanned} files di-scan)`;
|
|
3633
3705
|
}
|
|
3634
3706
|
try {
|
|
3635
|
-
|
|
3707
|
+
import_node_fs2.default.writeFileSync(stateFilePath, result.generatedCss, "utf-8");
|
|
3636
3708
|
return [
|
|
3637
3709
|
`[tw:static-state] ${result.rulesGenerated} static state rules di-generate`,
|
|
3638
3710
|
` \u2192 ${result.filesScanned} files scanned, ${result.filesWithStates} dengan states`,
|
|
3639
3711
|
` \u2192 ${result.componentsFound} components, ${result.rulesSkipped} rules skipped (fallback ke runtime)`,
|
|
3640
|
-
` \u2192 ditulis ke tw-classes/${
|
|
3712
|
+
` \u2192 ditulis ke tw-classes/${TW_STATE_STATIC_FILENAME}`
|
|
3641
3713
|
].join("\n");
|
|
3642
3714
|
} catch (writeErr) {
|
|
3643
3715
|
const msg = writeErr instanceof Error ? writeErr.message : String(writeErr);
|
|
3644
3716
|
return `[tw:static-state] gagal tulis state CSS: ${msg}`;
|
|
3645
3717
|
}
|
|
3646
3718
|
}
|
|
3647
|
-
var SOURCE_EXTENSIONS, IGNORE_PATTERNS, _native
|
|
3719
|
+
var import_node_fs2, import_node_path2, SOURCE_EXTENSIONS, IGNORE_PATTERNS, _native, TW_STATE_STATIC_FILENAME;
|
|
3648
3720
|
var init_staticStateExtractor = __esm({
|
|
3649
3721
|
"packages/domain/shared/src/staticStateExtractor.ts"() {
|
|
3722
|
+
"use strict";
|
|
3723
|
+
import_node_fs2 = __toESM(require("fs"));
|
|
3724
|
+
import_node_path2 = __toESM(require("path"));
|
|
3650
3725
|
SOURCE_EXTENSIONS = /* @__PURE__ */ new Set([".ts", ".tsx", ".js", ".jsx", ".mts", ".mjs"]);
|
|
3651
3726
|
IGNORE_PATTERNS = ["node_modules", ".next", "dist", "build", ".git", "coverage", "__tests__"];
|
|
3652
3727
|
_native = null;
|
|
3653
|
-
|
|
3728
|
+
TW_STATE_STATIC_FILENAME = "_tw-state-static.css";
|
|
3654
3729
|
}
|
|
3655
3730
|
});
|
|
3731
|
+
|
|
3732
|
+
// packages/domain/shared/src/logger.ts
|
|
3656
3733
|
function getEnvLevel() {
|
|
3657
3734
|
const env = process.env.TWS_LOG_LEVEL?.toLowerCase();
|
|
3658
3735
|
if (env && env in LEVELS) return env;
|
|
@@ -3662,8 +3739,8 @@ function setGlobalLogFile(filePath) {
|
|
|
3662
3739
|
_globalLogFile = filePath;
|
|
3663
3740
|
_logFileInitialized = false;
|
|
3664
3741
|
try {
|
|
3665
|
-
|
|
3666
|
-
|
|
3742
|
+
import_node_fs3.default.mkdirSync(import_node_path3.default.dirname(filePath), { recursive: true });
|
|
3743
|
+
import_node_fs3.default.writeFileSync(
|
|
3667
3744
|
filePath,
|
|
3668
3745
|
`# tailwind-styled build log \u2014 ${(/* @__PURE__ */ new Date()).toISOString()}
|
|
3669
3746
|
`,
|
|
@@ -3676,13 +3753,13 @@ function setGlobalLogFile(filePath) {
|
|
|
3676
3753
|
function writeToFile(line) {
|
|
3677
3754
|
if (!_globalLogFile || !_logFileInitialized) return;
|
|
3678
3755
|
try {
|
|
3679
|
-
|
|
3756
|
+
import_node_fs3.default.appendFileSync(_globalLogFile, line);
|
|
3680
3757
|
} catch {
|
|
3681
3758
|
}
|
|
3682
3759
|
}
|
|
3683
3760
|
function createLogger(prefix, level) {
|
|
3684
3761
|
const loggerState = {
|
|
3685
|
-
currentLevel: getEnvLevel(),
|
|
3762
|
+
currentLevel: level ?? getEnvLevel(),
|
|
3686
3763
|
setLevel(l) {
|
|
3687
3764
|
this.currentLevel = l;
|
|
3688
3765
|
}
|
|
@@ -3703,15 +3780,20 @@ function createLogger(prefix, level) {
|
|
|
3703
3780
|
setLogFile: (filePath) => setGlobalLogFile(filePath)
|
|
3704
3781
|
};
|
|
3705
3782
|
}
|
|
3706
|
-
var LEVELS, _globalLogFile, _logFileInitialized;
|
|
3783
|
+
var import_node_fs3, import_node_path3, LEVELS, _globalLogFile, _logFileInitialized, logger;
|
|
3707
3784
|
var init_logger = __esm({
|
|
3708
3785
|
"packages/domain/shared/src/logger.ts"() {
|
|
3786
|
+
"use strict";
|
|
3787
|
+
import_node_fs3 = __toESM(require("fs"));
|
|
3788
|
+
import_node_path3 = __toESM(require("path"));
|
|
3709
3789
|
LEVELS = { silent: 0, error: 1, warn: 2, info: 3, debug: 4 };
|
|
3710
3790
|
_globalLogFile = null;
|
|
3711
3791
|
_logFileInitialized = false;
|
|
3712
|
-
createLogger("tailwind-styled");
|
|
3792
|
+
logger = createLogger("tailwind-styled");
|
|
3713
3793
|
}
|
|
3714
3794
|
});
|
|
3795
|
+
|
|
3796
|
+
// packages/domain/shared/src/index.ts
|
|
3715
3797
|
function createLogger2(namespace) {
|
|
3716
3798
|
const prefix = `[${namespace}]`;
|
|
3717
3799
|
return {
|
|
@@ -3748,18 +3830,18 @@ function formatIssuePath(path6) {
|
|
|
3748
3830
|
).join(".");
|
|
3749
3831
|
}
|
|
3750
3832
|
function wrapUnknownError(domain, code, error) {
|
|
3751
|
-
return
|
|
3833
|
+
return TwError.wrap(domain, code, error);
|
|
3752
3834
|
}
|
|
3753
3835
|
function isTwError(err) {
|
|
3754
|
-
return err instanceof
|
|
3836
|
+
return err instanceof TwError;
|
|
3755
3837
|
}
|
|
3756
3838
|
function loadNativeBinding(options) {
|
|
3757
3839
|
const { runtimeDir, candidates, isValid } = options;
|
|
3758
3840
|
const loadErrors = [];
|
|
3759
3841
|
for (const candidate of candidates) {
|
|
3760
|
-
const candidatePath =
|
|
3842
|
+
const candidatePath = import_node_path4.default.resolve(runtimeDir, candidate);
|
|
3761
3843
|
try {
|
|
3762
|
-
if (!
|
|
3844
|
+
if (!import_node_fs4.default.existsSync(candidatePath) && !import_node_fs4.default.existsSync(candidatePath + ".node")) {
|
|
3763
3845
|
continue;
|
|
3764
3846
|
}
|
|
3765
3847
|
const mod = requireNativeModule(candidatePath);
|
|
@@ -3791,9 +3873,9 @@ function resolveNativeBindingCandidates(options) {
|
|
|
3791
3873
|
}
|
|
3792
3874
|
}
|
|
3793
3875
|
if (!includeDefaultCandidates) return candidates;
|
|
3794
|
-
if (
|
|
3876
|
+
if (import_node_fs4.default.existsSync(runtimeDir)) {
|
|
3795
3877
|
try {
|
|
3796
|
-
for (const entry of
|
|
3878
|
+
for (const entry of import_node_fs4.default.readdirSync(runtimeDir)) {
|
|
3797
3879
|
if (entry.endsWith(".node")) candidates.push(entry);
|
|
3798
3880
|
}
|
|
3799
3881
|
} catch {
|
|
@@ -3802,38 +3884,44 @@ function resolveNativeBindingCandidates(options) {
|
|
|
3802
3884
|
const BINARY_NAMES = ["tailwind-styled-native", "tailwind_styled_parser"];
|
|
3803
3885
|
const napiPlatform = process.platform === "linux" && process.arch === "x64" ? "linux-x64-gnu" : process.platform === "linux" && process.arch === "arm64" ? "linux-arm64-gnu" : `${process.platform}-${process.arch}`;
|
|
3804
3886
|
for (const bin of BINARY_NAMES) {
|
|
3805
|
-
candidates.push(
|
|
3806
|
-
candidates.push(
|
|
3807
|
-
candidates.push(
|
|
3808
|
-
candidates.push(
|
|
3809
|
-
candidates.push(
|
|
3810
|
-
candidates.push(
|
|
3811
|
-
candidates.push(
|
|
3812
|
-
candidates.push(
|
|
3813
|
-
candidates.push(
|
|
3887
|
+
candidates.push(import_node_path4.default.resolve(runtimeDir, `${bin}.node`));
|
|
3888
|
+
candidates.push(import_node_path4.default.resolve(runtimeDir, `${bin}.${napiPlatform}.node`));
|
|
3889
|
+
candidates.push(import_node_path4.default.resolve(runtimeDir, "..", "native", `${bin}.node`));
|
|
3890
|
+
candidates.push(import_node_path4.default.resolve(runtimeDir, "..", "native", `${bin}.${napiPlatform}.node`));
|
|
3891
|
+
candidates.push(import_node_path4.default.resolve(process.cwd(), "native", `${bin}.node`));
|
|
3892
|
+
candidates.push(import_node_path4.default.resolve(process.cwd(), "native", `${bin}.${napiPlatform}.node`));
|
|
3893
|
+
candidates.push(import_node_path4.default.resolve(runtimeDir, "..", "..", "..", "..", "native", `${bin}.node`));
|
|
3894
|
+
candidates.push(import_node_path4.default.resolve(runtimeDir, "..", "..", "..", "..", "native", `${bin}.${napiPlatform}.node`));
|
|
3895
|
+
candidates.push(import_node_path4.default.resolve(runtimeDir, "..", "..", "..", "native", `${bin}.node`));
|
|
3814
3896
|
}
|
|
3815
3897
|
return Array.from(new Set(candidates));
|
|
3816
3898
|
}
|
|
3817
3899
|
function resolveRuntimeDir(dir, importMetaUrl) {
|
|
3818
|
-
if (dir) return
|
|
3900
|
+
if (dir) return import_node_path4.default.resolve(dir);
|
|
3819
3901
|
try {
|
|
3820
|
-
return
|
|
3902
|
+
return import_node_path4.default.dirname((0, import_node_url.fileURLToPath)(importMetaUrl));
|
|
3821
3903
|
} catch {
|
|
3822
3904
|
return process.cwd();
|
|
3823
3905
|
}
|
|
3824
3906
|
}
|
|
3825
3907
|
function hashContent2(content, algorithm = "md5", length) {
|
|
3826
|
-
const hash =
|
|
3908
|
+
const hash = (0, import_node_crypto.createHash)(algorithm).update(content).digest("hex");
|
|
3827
3909
|
return length ? hash.slice(0, length) : hash;
|
|
3828
3910
|
}
|
|
3829
3911
|
function formatErrorMessage(error) {
|
|
3830
|
-
if (error instanceof
|
|
3912
|
+
if (error instanceof TwError) return error.toString();
|
|
3831
3913
|
if (error instanceof Error) return error.message;
|
|
3832
3914
|
return String(error);
|
|
3833
3915
|
}
|
|
3834
|
-
|
|
3916
|
+
var import_node_crypto, import_node_fs4, import_node_path4, import_node_url, import_node_module5, TwError, _require3, LRUCache;
|
|
3835
3917
|
var init_src2 = __esm({
|
|
3836
3918
|
"packages/domain/shared/src/index.ts"() {
|
|
3919
|
+
"use strict";
|
|
3920
|
+
import_node_crypto = require("crypto");
|
|
3921
|
+
import_node_fs4 = __toESM(require("fs"));
|
|
3922
|
+
import_node_path4 = __toESM(require("path"));
|
|
3923
|
+
import_node_url = require("url");
|
|
3924
|
+
import_node_module5 = require("module");
|
|
3837
3925
|
init_trace();
|
|
3838
3926
|
init_error_codes();
|
|
3839
3927
|
init_compatibility();
|
|
@@ -3847,7 +3935,7 @@ var init_src2 = __esm({
|
|
|
3847
3935
|
init_observability();
|
|
3848
3936
|
init_staticStateExtractor();
|
|
3849
3937
|
init_logger();
|
|
3850
|
-
|
|
3938
|
+
TwError = class _TwError extends Error {
|
|
3851
3939
|
/** @deprecated Gunakan source */
|
|
3852
3940
|
domain;
|
|
3853
3941
|
source;
|
|
@@ -3899,8 +3987,10 @@ var init_src2 = __esm({
|
|
|
3899
3987
|
return `[${this.source.toUpperCase()}:${this.code}] ${this.message}`;
|
|
3900
3988
|
}
|
|
3901
3989
|
};
|
|
3902
|
-
_require3 =
|
|
3903
|
-
|
|
3990
|
+
_require3 = (0, import_node_module5.createRequire)(
|
|
3991
|
+
typeof __filename !== "undefined" ? `file://${__filename}` : __importMetaUrl ?? "file://unknown"
|
|
3992
|
+
);
|
|
3993
|
+
LRUCache = class {
|
|
3904
3994
|
capacity;
|
|
3905
3995
|
cache;
|
|
3906
3996
|
constructor(capacity) {
|
|
@@ -3945,56 +4035,148 @@ var init_src2 = __esm({
|
|
|
3945
4035
|
});
|
|
3946
4036
|
|
|
3947
4037
|
// src/umbrella/shared.ts
|
|
4038
|
+
var shared_exports = {};
|
|
4039
|
+
__export(shared_exports, {
|
|
4040
|
+
ERROR_CODES: () => ERROR_CODES,
|
|
4041
|
+
LRUCache: () => LRUCache,
|
|
4042
|
+
NativeAnalyzerReportSchema: () => NativeAnalyzerReportSchema,
|
|
4043
|
+
NativeCacheEntrySchema: () => NativeCacheEntrySchema,
|
|
4044
|
+
NativeCacheReadResultSchema: () => NativeCacheReadResultSchema,
|
|
4045
|
+
NativeCssCompileResultSchema: () => NativeCssCompileResultSchema,
|
|
4046
|
+
NativeScanFileSchema: () => NativeScanFileSchema,
|
|
4047
|
+
NativeScanResultSchema: () => NativeScanResultSchema,
|
|
4048
|
+
NativeTransformResultSchema: () => NativeTransformResultSchema,
|
|
4049
|
+
NativeWatchResultSchema: () => NativeWatchResultSchema,
|
|
4050
|
+
PackageJsonSchema: () => PackageJsonSchema,
|
|
4051
|
+
RegistryFileSchema: () => RegistryFileSchema,
|
|
4052
|
+
RegistryPluginEntrySchema: () => RegistryPluginEntrySchema,
|
|
4053
|
+
ScanCacheClassEntrySchema: () => ScanCacheClassEntrySchema,
|
|
4054
|
+
ScanCacheSchema: () => ScanCacheSchema,
|
|
4055
|
+
TW_STATE_STATIC_FILENAME: () => TW_STATE_STATIC_FILENAME,
|
|
4056
|
+
TailwindConfigSchema: () => TailwindConfigSchema,
|
|
4057
|
+
TelemetryCollector: () => TelemetryCollector,
|
|
4058
|
+
TwError: () => TwError,
|
|
4059
|
+
appendStaticStateCssToSafelist: () => appendStaticStateCssToSafelist,
|
|
4060
|
+
assertTailwindV4: () => assertTailwindV4,
|
|
4061
|
+
calculateHealth: () => calculateHealth,
|
|
4062
|
+
createBuildTimer: () => createBuildTimer,
|
|
4063
|
+
createDebugLogger: () => createDebugLogger,
|
|
4064
|
+
createEsmRequire: () => createEsmRequire,
|
|
4065
|
+
createLogger: () => createLogger2,
|
|
4066
|
+
createObservabilityClient: () => createObservabilityClient,
|
|
4067
|
+
createTraceSnapshot: () => createTraceSnapshot,
|
|
4068
|
+
detectTailwind: () => detectTailwind,
|
|
4069
|
+
extractStaticStateCss: () => extractStaticStateCss,
|
|
4070
|
+
formatDuration: () => formatDuration,
|
|
4071
|
+
formatErrorCode: () => formatErrorCode,
|
|
4072
|
+
formatErrorMessage: () => formatErrorMessage,
|
|
4073
|
+
formatMemory: () => formatMemory,
|
|
4074
|
+
formatNativeNotFoundError: () => formatNativeNotFoundError,
|
|
4075
|
+
generateBarrelFile: () => generateBarrelFile,
|
|
4076
|
+
generateClassRenameCodemod: () => generateClassRenameCodemod,
|
|
4077
|
+
generateComponentCode: () => generateComponentCode,
|
|
4078
|
+
generateStorybookStory: () => generateStorybookStory,
|
|
4079
|
+
getBuildTimeColor: () => getBuildTimeColor,
|
|
4080
|
+
getDirname: () => getDirname,
|
|
4081
|
+
getFilename: () => getFilename,
|
|
4082
|
+
getGlobalTelemetry: () => getGlobalTelemetry,
|
|
4083
|
+
getHealthColor: () => getHealthColor,
|
|
4084
|
+
getMemoryColor: () => getMemoryColor,
|
|
4085
|
+
getModeColor: () => getModeColor,
|
|
4086
|
+
getPipelinePercentages: () => getPipelinePercentages,
|
|
4087
|
+
getSuggestion: () => getSuggestion,
|
|
4088
|
+
getTailwindVersion: () => getTailwindVersion,
|
|
4089
|
+
hashContent: () => hashContent2,
|
|
4090
|
+
isTailwindV4: () => isTailwindV4,
|
|
4091
|
+
isTwError: () => isTwError,
|
|
4092
|
+
loadNativeBinding: () => loadNativeBinding,
|
|
4093
|
+
parseJsonFileWithSchema: () => parseJsonFileWithSchema,
|
|
4094
|
+
parseJsonWithSchema: () => parseJsonWithSchema,
|
|
4095
|
+
parseNative: () => parseNative,
|
|
4096
|
+
resetGlobalTelemetry: () => resetGlobalTelemetry,
|
|
4097
|
+
resolveFromRoot: () => resolveFromRoot,
|
|
4098
|
+
resolveLoaderPath: () => resolveLoaderPath,
|
|
4099
|
+
resolveNativeBinary: () => resolveNativeBinary,
|
|
4100
|
+
resolveNativeBindingCandidates: () => resolveNativeBindingCandidates,
|
|
4101
|
+
resolveNativeNodePath: () => resolveNativeNodePath,
|
|
4102
|
+
resolveRuntimeDir: () => resolveRuntimeDir,
|
|
4103
|
+
resolveWorkerPath: () => resolveWorkerPath,
|
|
4104
|
+
safeParseNative: () => safeParseNative,
|
|
4105
|
+
setGlobalLogFile: () => setGlobalLogFile,
|
|
4106
|
+
tryRequire: () => tryRequire,
|
|
4107
|
+
wrapUnknownError: () => wrapUnknownError
|
|
4108
|
+
});
|
|
4109
|
+
module.exports = __toCommonJS(shared_exports);
|
|
3948
4110
|
init_src2();
|
|
3949
|
-
|
|
3950
|
-
exports
|
|
3951
|
-
|
|
3952
|
-
|
|
3953
|
-
|
|
3954
|
-
|
|
3955
|
-
|
|
3956
|
-
|
|
3957
|
-
|
|
3958
|
-
|
|
3959
|
-
|
|
3960
|
-
|
|
3961
|
-
|
|
3962
|
-
|
|
3963
|
-
|
|
3964
|
-
|
|
3965
|
-
|
|
3966
|
-
|
|
3967
|
-
|
|
3968
|
-
|
|
3969
|
-
|
|
3970
|
-
|
|
3971
|
-
|
|
3972
|
-
|
|
3973
|
-
|
|
3974
|
-
|
|
3975
|
-
|
|
3976
|
-
|
|
3977
|
-
|
|
3978
|
-
|
|
3979
|
-
|
|
3980
|
-
|
|
3981
|
-
|
|
3982
|
-
|
|
3983
|
-
|
|
3984
|
-
|
|
3985
|
-
|
|
3986
|
-
|
|
3987
|
-
|
|
3988
|
-
|
|
3989
|
-
|
|
3990
|
-
|
|
3991
|
-
|
|
3992
|
-
|
|
3993
|
-
|
|
3994
|
-
|
|
3995
|
-
|
|
3996
|
-
|
|
3997
|
-
|
|
3998
|
-
|
|
3999
|
-
|
|
4111
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
4112
|
+
0 && (module.exports = {
|
|
4113
|
+
ERROR_CODES,
|
|
4114
|
+
LRUCache,
|
|
4115
|
+
NativeAnalyzerReportSchema,
|
|
4116
|
+
NativeCacheEntrySchema,
|
|
4117
|
+
NativeCacheReadResultSchema,
|
|
4118
|
+
NativeCssCompileResultSchema,
|
|
4119
|
+
NativeScanFileSchema,
|
|
4120
|
+
NativeScanResultSchema,
|
|
4121
|
+
NativeTransformResultSchema,
|
|
4122
|
+
NativeWatchResultSchema,
|
|
4123
|
+
PackageJsonSchema,
|
|
4124
|
+
RegistryFileSchema,
|
|
4125
|
+
RegistryPluginEntrySchema,
|
|
4126
|
+
ScanCacheClassEntrySchema,
|
|
4127
|
+
ScanCacheSchema,
|
|
4128
|
+
TW_STATE_STATIC_FILENAME,
|
|
4129
|
+
TailwindConfigSchema,
|
|
4130
|
+
TelemetryCollector,
|
|
4131
|
+
TwError,
|
|
4132
|
+
appendStaticStateCssToSafelist,
|
|
4133
|
+
assertTailwindV4,
|
|
4134
|
+
calculateHealth,
|
|
4135
|
+
createBuildTimer,
|
|
4136
|
+
createDebugLogger,
|
|
4137
|
+
createEsmRequire,
|
|
4138
|
+
createLogger,
|
|
4139
|
+
createObservabilityClient,
|
|
4140
|
+
createTraceSnapshot,
|
|
4141
|
+
detectTailwind,
|
|
4142
|
+
extractStaticStateCss,
|
|
4143
|
+
formatDuration,
|
|
4144
|
+
formatErrorCode,
|
|
4145
|
+
formatErrorMessage,
|
|
4146
|
+
formatMemory,
|
|
4147
|
+
formatNativeNotFoundError,
|
|
4148
|
+
generateBarrelFile,
|
|
4149
|
+
generateClassRenameCodemod,
|
|
4150
|
+
generateComponentCode,
|
|
4151
|
+
generateStorybookStory,
|
|
4152
|
+
getBuildTimeColor,
|
|
4153
|
+
getDirname,
|
|
4154
|
+
getFilename,
|
|
4155
|
+
getGlobalTelemetry,
|
|
4156
|
+
getHealthColor,
|
|
4157
|
+
getMemoryColor,
|
|
4158
|
+
getModeColor,
|
|
4159
|
+
getPipelinePercentages,
|
|
4160
|
+
getSuggestion,
|
|
4161
|
+
getTailwindVersion,
|
|
4162
|
+
hashContent,
|
|
4163
|
+
isTailwindV4,
|
|
4164
|
+
isTwError,
|
|
4165
|
+
loadNativeBinding,
|
|
4166
|
+
parseJsonFileWithSchema,
|
|
4167
|
+
parseJsonWithSchema,
|
|
4168
|
+
parseNative,
|
|
4169
|
+
resetGlobalTelemetry,
|
|
4170
|
+
resolveFromRoot,
|
|
4171
|
+
resolveLoaderPath,
|
|
4172
|
+
resolveNativeBinary,
|
|
4173
|
+
resolveNativeBindingCandidates,
|
|
4174
|
+
resolveNativeNodePath,
|
|
4175
|
+
resolveRuntimeDir,
|
|
4176
|
+
resolveWorkerPath,
|
|
4177
|
+
safeParseNative,
|
|
4178
|
+
setGlobalLogFile,
|
|
4179
|
+
tryRequire,
|
|
4180
|
+
wrapUnknownError
|
|
4181
|
+
});
|
|
4000
4182
|
//# sourceMappingURL=shared.js.map
|