tailwind-styled-v4 5.0.36 → 5.0.38
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.d.mts +152 -5
- package/dist/analyzer.d.ts +152 -5
- package/dist/analyzer.js +213 -161
- package/dist/analyzer.js.map +1 -1
- package/dist/analyzer.mjs +118 -82
- package/dist/analyzer.mjs.map +1 -1
- package/dist/animate.d.mts +30 -3
- package/dist/animate.d.ts +30 -3
- package/dist/animate.js +131 -87
- package/dist/animate.js.map +1 -1
- package/dist/animate.mjs +28 -14
- package/dist/animate.mjs.map +1 -1
- package/dist/atomic.js +105 -68
- package/dist/atomic.js.map +1 -1
- package/dist/atomic.mjs +40 -13
- package/dist/atomic.mjs.map +1 -1
- package/dist/cli.js +577 -426
- package/dist/cli.js.map +1 -1
- package/dist/cli.mjs +466 -304
- package/dist/cli.mjs.map +1 -1
- package/dist/compiler.d.mts +5 -0
- package/dist/compiler.d.ts +5 -0
- package/dist/compiler.js +826 -508
- package/dist/compiler.js.map +1 -1
- package/dist/compiler.mjs +287 -29
- package/dist/compiler.mjs.map +1 -1
- package/dist/dashboard.js +71 -41
- package/dist/dashboard.js.map +1 -1
- package/dist/dashboard.mjs +12 -6
- package/dist/dashboard.mjs.map +1 -1
- package/dist/devtools.d.mts +88 -2
- package/dist/devtools.d.ts +88 -2
- package/dist/devtools.js +333 -289
- package/dist/devtools.js.map +1 -1
- package/dist/devtools.mjs +26 -11
- package/dist/devtools.mjs.map +1 -1
- package/dist/engine.d.mts +557 -6
- package/dist/engine.d.ts +557 -6
- package/dist/engine.js +679 -502
- package/dist/engine.js.map +1 -1
- package/dist/engine.mjs +467 -307
- package/dist/engine.mjs.map +1 -1
- package/dist/index.d.mts +180 -127
- package/dist/index.d.ts +180 -127
- package/dist/index.js +1329 -7441
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +1266 -7385
- package/dist/index.mjs.map +1 -1
- package/dist/next.js +318 -243
- package/dist/next.js.map +1 -1
- package/dist/next.mjs +256 -181
- package/dist/next.mjs.map +1 -1
- package/dist/plugin-api.d.mts +4 -2
- package/dist/plugin-api.d.ts +4 -2
- package/dist/plugin-api.js +93 -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 +103 -62
- package/dist/plugin-registry.js.map +1 -1
- package/dist/plugin-registry.mjs +53 -35
- package/dist/plugin-registry.mjs.map +1 -1
- package/dist/plugin.d.mts +165 -5
- package/dist/plugin.d.ts +165 -5
- package/dist/plugin.js +115 -50
- package/dist/plugin.js.map +1 -1
- package/dist/plugin.mjs +44 -6
- package/dist/plugin.mjs.map +1 -1
- package/dist/preset.js +47 -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 +82 -50
- package/dist/rspack.js.map +1 -1
- package/dist/rspack.mjs +20 -12
- package/dist/rspack.mjs.map +1 -1
- package/dist/runtime-css.js +62 -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.d.mts +38 -3
- package/dist/runtime.d.ts +38 -3
- package/dist/runtime.js +97 -44
- package/dist/runtime.js.map +1 -1
- package/dist/runtime.mjs +31 -8
- package/dist/runtime.mjs.map +1 -1
- package/dist/scanner.d.mts +58 -4
- package/dist/scanner.d.ts +58 -4
- package/dist/scanner.js +163 -120
- package/dist/scanner.js.map +1 -1
- package/dist/scanner.mjs +67 -39
- package/dist/scanner.mjs.map +1 -1
- package/dist/shared.d.mts +185 -3
- package/dist/shared.d.ts +185 -3
- package/dist/shared.js +441 -295
- package/dist/shared.js.map +1 -1
- package/dist/shared.mjs +253 -122
- package/dist/shared.mjs.map +1 -1
- package/dist/storybook-addon.d.mts +2 -2
- package/dist/storybook-addon.d.ts +2 -2
- package/dist/storybook-addon.js +39 -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.d.mts +2 -1
- package/dist/svelte.d.ts +2 -1
- package/dist/svelte.js +88 -64
- package/dist/svelte.js.map +1 -1
- package/dist/svelte.mjs +28 -13
- package/dist/svelte.mjs.map +1 -1
- package/dist/syntax.js +68 -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 +55 -18
- package/dist/testing.js.map +1 -1
- package/dist/testing.mjs +16 -3
- package/dist/testing.mjs.map +1 -1
- package/dist/theme.d.mts +38 -3
- package/dist/theme.d.ts +38 -3
- package/dist/theme.js +131 -74
- package/dist/theme.js.map +1 -1
- package/dist/theme.mjs +42 -13
- package/dist/theme.mjs.map +1 -1
- package/dist/turbopackLoader.js +150 -116
- package/dist/turbopackLoader.js.map +1 -1
- package/dist/turbopackLoader.mjs +124 -81
- package/dist/turbopackLoader.mjs.map +1 -1
- package/dist/tw.js +560 -421
- package/dist/tw.js.map +1 -1
- package/dist/tw.mjs +460 -302
- package/dist/tw.mjs.map +1 -1
- package/dist/vite.js +561 -446
- package/dist/vite.js.map +1 -1
- package/dist/vite.mjs +433 -321
- package/dist/vite.mjs.map +1 -1
- package/dist/vue.d.mts +4 -1
- package/dist/vue.d.ts +4 -1
- package/dist/vue.js +95 -70
- package/dist/vue.js.map +1 -1
- package/dist/vue.mjs +30 -14
- package/dist/vue.mjs.map +1 -1
- package/dist/webpackLoader.js +110 -78
- package/dist/webpackLoader.js.map +1 -1
- package/dist/webpackLoader.mjs +45 -17
- 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/analyzeWorkspace-B1_XRfdl.d.ts +0 -134
- package/dist/analyzeWorkspace-hYfu4Hg3.d.mts +0 -134
- package/dist/index-DQI6O24n.d.mts +0 -464
- package/dist/index-NDINUhLN.d.mts +0 -90
- package/dist/index-NDINUhLN.d.ts +0 -90
- package/dist/index-UkYbyBkR.d.ts +0 -464
- package/dist/liveTokenEngine-CN9ian1R.d.ts +0 -38
- package/dist/liveTokenEngine-DKoWRtqH.d.mts +0 -38
- package/dist/schemas-DR-SLxZZ.d.mts +0 -59
- package/dist/schemas-DR-SLxZZ.d.ts +0 -59
- package/dist/trace-Dz4vmZdy.d.mts +0 -96
- package/dist/trace-Dz4vmZdy.d.ts +0 -96
- package/dist/types-DXr2PmGP.d.mts +0 -31
- package/dist/types-DXr2PmGP.d.ts +0 -31
package/dist/shared.mjs
CHANGED
|
@@ -1,12 +1,3 @@
|
|
|
1
|
-
import { z } from 'zod';
|
|
2
|
-
import { createRequire } from 'module';
|
|
3
|
-
import * as fs3 from 'fs';
|
|
4
|
-
import fs3__default from 'fs';
|
|
5
|
-
import * as path from 'path';
|
|
6
|
-
import path__default from 'path';
|
|
7
|
-
import { createHash } from 'crypto';
|
|
8
|
-
import { fileURLToPath } from 'url';
|
|
9
|
-
|
|
10
1
|
/* tailwind-styled-v4 v5.0.4 | MIT | https://github.com/dictionar32/tailwind-styled-v4 */
|
|
11
2
|
var __defProp = Object.defineProperty;
|
|
12
3
|
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
@@ -127,6 +118,7 @@ function getPipelinePercentages(metrics) {
|
|
|
127
118
|
}
|
|
128
119
|
var init_trace = __esm({
|
|
129
120
|
"packages/domain/shared/src/trace.ts"() {
|
|
121
|
+
"use strict";
|
|
130
122
|
}
|
|
131
123
|
});
|
|
132
124
|
|
|
@@ -141,6 +133,7 @@ function formatErrorCode(code) {
|
|
|
141
133
|
var ERROR_CODES, ERROR_SUGGESTIONS;
|
|
142
134
|
var init_error_codes = __esm({
|
|
143
135
|
"packages/domain/shared/src/error-codes.ts"() {
|
|
136
|
+
"use strict";
|
|
144
137
|
ERROR_CODES = {
|
|
145
138
|
// E0xx — Native binding
|
|
146
139
|
NATIVE_NOT_FOUND: "E001",
|
|
@@ -207,8 +200,12 @@ function isTailwindV4() {
|
|
|
207
200
|
}
|
|
208
201
|
var init_compatibility = __esm({
|
|
209
202
|
"packages/domain/shared/src/compatibility.ts"() {
|
|
203
|
+
"use strict";
|
|
210
204
|
}
|
|
211
205
|
});
|
|
206
|
+
|
|
207
|
+
// packages/domain/shared/src/native-schemas.ts
|
|
208
|
+
import { z } from "zod";
|
|
212
209
|
function safeParseNative(schema, data, fallback) {
|
|
213
210
|
const result = schema.safeParse(data);
|
|
214
211
|
return result.success ? result.data : fallback;
|
|
@@ -224,9 +221,10 @@ function parseNative(schema, data, context) {
|
|
|
224
221
|
}
|
|
225
222
|
return result.data;
|
|
226
223
|
}
|
|
227
|
-
var NativeScanFileSchema, NativeScanResultSchema, NativeClassUsageSchema, NativeAnalyzerReportSchema, NativeTransformResultSchema, NativeCssCompileResultSchema, NativeWatchResultSchema, NativeCacheEntrySchema, NativeCacheReadResultSchema;
|
|
224
|
+
var NativeScanFileSchema, NativeScanResultSchema, NativeClassUsageSchema, NativeAnalyzerReportSchema, NativeTransformResultSchema, NativeCssCompileResultSchema, NativeWatchEventSchema, NativeWatchResultSchema, NativeCacheEntrySchema, NativeCacheReadResultSchema;
|
|
228
225
|
var init_native_schemas = __esm({
|
|
229
226
|
"packages/domain/shared/src/native-schemas.ts"() {
|
|
227
|
+
"use strict";
|
|
230
228
|
NativeScanFileSchema = z.object({
|
|
231
229
|
file: z.string().min(1, "file path cannot be empty"),
|
|
232
230
|
classes: z.array(z.string()),
|
|
@@ -266,7 +264,7 @@ var init_native_schemas = __esm({
|
|
|
266
264
|
resolvedClasses: z.array(z.string()),
|
|
267
265
|
unresolvedClasses: z.array(z.string()).optional()
|
|
268
266
|
});
|
|
269
|
-
z.object({
|
|
267
|
+
NativeWatchEventSchema = z.object({
|
|
270
268
|
type: z.enum(["change", "unlink", "create"]),
|
|
271
269
|
path: z.string()
|
|
272
270
|
});
|
|
@@ -372,6 +370,7 @@ function resolveNativeNodePath(importMetaUrl, ...relativeSegments) {
|
|
|
372
370
|
var isBrowser, nodeModuleRef, _nodePath, _nodeUrl, _nodeFs;
|
|
373
371
|
var init_esmHelpers = __esm({
|
|
374
372
|
"packages/domain/shared/src/esmHelpers.ts"() {
|
|
373
|
+
"use strict";
|
|
375
374
|
isBrowser = typeof window !== "undefined" || typeof document !== "undefined";
|
|
376
375
|
nodeModuleRef = null;
|
|
377
376
|
_nodePath = null;
|
|
@@ -422,6 +421,7 @@ function createBuildTimer() {
|
|
|
422
421
|
var RING_BUFFER_SIZE, TelemetryCollector, _globalCollector;
|
|
423
422
|
var init_telemetry = __esm({
|
|
424
423
|
"packages/domain/shared/src/telemetry.ts"() {
|
|
424
|
+
"use strict";
|
|
425
425
|
RING_BUFFER_SIZE = 100;
|
|
426
426
|
TelemetryCollector = class {
|
|
427
427
|
data = [];
|
|
@@ -488,6 +488,9 @@ var init_telemetry = __esm({
|
|
|
488
488
|
_globalCollector = null;
|
|
489
489
|
}
|
|
490
490
|
});
|
|
491
|
+
|
|
492
|
+
// packages/domain/shared/src/configSchemas.ts
|
|
493
|
+
import { z as z2 } from "zod";
|
|
491
494
|
function parseJsonWithSchema(jsonString, schema, sourceName) {
|
|
492
495
|
let parsed;
|
|
493
496
|
try {
|
|
@@ -521,67 +524,68 @@ function parseJsonFileWithSchema(filePath, schema) {
|
|
|
521
524
|
var ScanCacheClassEntrySchema, ScanCacheSchema, TailwindContentItemSchema, TailwindConfigSchema, RegistryPluginEntrySchema, RegistryFileSchema, PackageJsonSchema;
|
|
522
525
|
var init_configSchemas = __esm({
|
|
523
526
|
"packages/domain/shared/src/configSchemas.ts"() {
|
|
524
|
-
|
|
525
|
-
|
|
526
|
-
|
|
527
|
-
|
|
528
|
-
|
|
529
|
-
|
|
527
|
+
"use strict";
|
|
528
|
+
ScanCacheClassEntrySchema = z2.object({
|
|
529
|
+
name: z2.string().min(1),
|
|
530
|
+
usedIn: z2.array(z2.string()),
|
|
531
|
+
risk: z2.enum(["low", "medium", "high"]).default("low"),
|
|
532
|
+
bundleContribution: z2.number().nonnegative().default(0),
|
|
533
|
+
variants: z2.array(z2.string()).default([])
|
|
530
534
|
});
|
|
531
|
-
ScanCacheSchema =
|
|
532
|
-
version:
|
|
533
|
-
generatedAt:
|
|
534
|
-
root:
|
|
535
|
-
classNames:
|
|
536
|
-
totalFiles:
|
|
537
|
-
uniqueCount:
|
|
535
|
+
ScanCacheSchema = z2.object({
|
|
536
|
+
version: z2.string().default("1"),
|
|
537
|
+
generatedAt: z2.string(),
|
|
538
|
+
root: z2.string(),
|
|
539
|
+
classNames: z2.array(ScanCacheClassEntrySchema),
|
|
540
|
+
totalFiles: z2.number().int().nonnegative(),
|
|
541
|
+
uniqueCount: z2.number().int().nonnegative()
|
|
538
542
|
});
|
|
539
|
-
TailwindContentItemSchema =
|
|
540
|
-
|
|
541
|
-
|
|
542
|
-
raw:
|
|
543
|
-
extension:
|
|
543
|
+
TailwindContentItemSchema = z2.union([
|
|
544
|
+
z2.string(),
|
|
545
|
+
z2.object({
|
|
546
|
+
raw: z2.string(),
|
|
547
|
+
extension: z2.string().optional()
|
|
544
548
|
}),
|
|
545
|
-
|
|
546
|
-
files:
|
|
547
|
-
transform:
|
|
549
|
+
z2.object({
|
|
550
|
+
files: z2.array(z2.string()),
|
|
551
|
+
transform: z2.record(z2.string(), z2.unknown()).optional()
|
|
548
552
|
})
|
|
549
553
|
]);
|
|
550
|
-
TailwindConfigSchema =
|
|
551
|
-
content:
|
|
552
|
-
theme:
|
|
553
|
-
plugins:
|
|
554
|
-
darkMode:
|
|
555
|
-
prefix:
|
|
556
|
-
safelist:
|
|
557
|
-
blocklist:
|
|
554
|
+
TailwindConfigSchema = z2.object({
|
|
555
|
+
content: z2.array(TailwindContentItemSchema).optional(),
|
|
556
|
+
theme: z2.record(z2.string(), z2.unknown()).optional(),
|
|
557
|
+
plugins: z2.array(z2.unknown()).optional(),
|
|
558
|
+
darkMode: z2.union([z2.literal("class"), z2.literal("media"), z2.literal(false)]).optional(),
|
|
559
|
+
prefix: z2.string().optional(),
|
|
560
|
+
safelist: z2.array(z2.union([z2.string(), z2.object({ pattern: z2.instanceof(RegExp) })])).optional(),
|
|
561
|
+
blocklist: z2.array(z2.string()).optional()
|
|
558
562
|
}).passthrough();
|
|
559
|
-
RegistryPluginEntrySchema =
|
|
560
|
-
name:
|
|
561
|
-
description:
|
|
562
|
-
version:
|
|
563
|
-
tags:
|
|
564
|
-
official:
|
|
565
|
-
docs:
|
|
566
|
-
install:
|
|
567
|
-
integrity:
|
|
563
|
+
RegistryPluginEntrySchema = z2.object({
|
|
564
|
+
name: z2.string().min(1),
|
|
565
|
+
description: z2.string(),
|
|
566
|
+
version: z2.string(),
|
|
567
|
+
tags: z2.array(z2.string()).default([]),
|
|
568
|
+
official: z2.boolean().default(false),
|
|
569
|
+
docs: z2.string().url().optional(),
|
|
570
|
+
install: z2.string().optional(),
|
|
571
|
+
integrity: z2.string().optional()
|
|
568
572
|
});
|
|
569
|
-
RegistryFileSchema =
|
|
570
|
-
version:
|
|
571
|
-
official:
|
|
572
|
-
community:
|
|
573
|
+
RegistryFileSchema = z2.object({
|
|
574
|
+
version: z2.string(),
|
|
575
|
+
official: z2.array(RegistryPluginEntrySchema).default([]),
|
|
576
|
+
community: z2.array(RegistryPluginEntrySchema).default([])
|
|
573
577
|
});
|
|
574
|
-
PackageJsonSchema =
|
|
575
|
-
name:
|
|
576
|
-
version:
|
|
577
|
-
scripts:
|
|
578
|
-
dependencies:
|
|
579
|
-
devDependencies:
|
|
580
|
-
peerDependencies:
|
|
581
|
-
main:
|
|
582
|
-
module:
|
|
583
|
-
exports:
|
|
584
|
-
type:
|
|
578
|
+
PackageJsonSchema = z2.object({
|
|
579
|
+
name: z2.string(),
|
|
580
|
+
version: z2.string(),
|
|
581
|
+
scripts: z2.record(z2.string(), z2.string()).optional(),
|
|
582
|
+
dependencies: z2.record(z2.string(), z2.string()).optional(),
|
|
583
|
+
devDependencies: z2.record(z2.string(), z2.string()).optional(),
|
|
584
|
+
peerDependencies: z2.record(z2.string(), z2.string()).optional(),
|
|
585
|
+
main: z2.string().optional(),
|
|
586
|
+
module: z2.string().optional(),
|
|
587
|
+
exports: z2.unknown().optional(),
|
|
588
|
+
type: z2.enum(["module", "commonjs"]).optional()
|
|
585
589
|
}).passthrough();
|
|
586
590
|
}
|
|
587
591
|
});
|
|
@@ -669,6 +673,7 @@ function resolveLoaderPath(loaderBasename, importMetaUrl) {
|
|
|
669
673
|
var isBrowser2, NODE_URL, NODE_FS, NODE_PATH;
|
|
670
674
|
var init_workerResolver = __esm({
|
|
671
675
|
"packages/domain/shared/src/workerResolver.ts"() {
|
|
676
|
+
"use strict";
|
|
672
677
|
isBrowser2 = typeof window !== "undefined" || typeof document !== "undefined";
|
|
673
678
|
NODE_URL = typeof window === "undefined" || typeof document === "undefined" ? "node:url" : null;
|
|
674
679
|
NODE_FS = typeof window === "undefined" || typeof document === "undefined" ? "node:fs" : null;
|
|
@@ -818,13 +823,13 @@ function generateClassRenameCodemod(renames, opts = {}) {
|
|
|
818
823
|
}
|
|
819
824
|
return lines.join("\n");
|
|
820
825
|
}
|
|
821
|
-
function generateBarrelFile(exports
|
|
826
|
+
function generateBarrelFile(exports, dir, opts = {}) {
|
|
822
827
|
const { includeTypes = true } = opts;
|
|
823
828
|
const lines = [];
|
|
824
829
|
lines.push(`// Auto-generated barrel file for ${dir}`);
|
|
825
830
|
lines.push(`// Run: npx tsx scripts/generate-barrel.ts to regenerate`);
|
|
826
831
|
lines.push(``);
|
|
827
|
-
for (const name of exports
|
|
832
|
+
for (const name of exports) {
|
|
828
833
|
lines.push(`export { default as ${name}, type ${name}Props } from "./${name}"`);
|
|
829
834
|
if (includeTypes) {
|
|
830
835
|
lines.push(`export type * from "./${name}"`);
|
|
@@ -834,8 +839,14 @@ function generateBarrelFile(exports$1, dir, opts = {}) {
|
|
|
834
839
|
}
|
|
835
840
|
var init_codegen = __esm({
|
|
836
841
|
"packages/domain/shared/src/codegen.ts"() {
|
|
842
|
+
"use strict";
|
|
837
843
|
}
|
|
838
844
|
});
|
|
845
|
+
|
|
846
|
+
// packages/domain/shared/src/native-resolution.ts
|
|
847
|
+
import { createRequire } from "module";
|
|
848
|
+
import * as fs from "fs";
|
|
849
|
+
import * as path from "path";
|
|
839
850
|
function platformKey() {
|
|
840
851
|
if (isBrowser3) return "browser";
|
|
841
852
|
return `${process.platform}-${process.arch}`;
|
|
@@ -851,7 +862,7 @@ function resolveNativeBinary(runtimeDir) {
|
|
|
851
862
|
}
|
|
852
863
|
const envPath = process.env.TW_NATIVE_PATH?.trim();
|
|
853
864
|
if (envPath) {
|
|
854
|
-
if (
|
|
865
|
+
if (fs.existsSync(envPath)) {
|
|
855
866
|
return { path: envPath, source: "env", platform, tried };
|
|
856
867
|
}
|
|
857
868
|
tried.push(`env:${envPath} (not found)`);
|
|
@@ -860,7 +871,7 @@ function resolveNativeBinary(runtimeDir) {
|
|
|
860
871
|
for (const pkg of prebuiltPkgs) {
|
|
861
872
|
try {
|
|
862
873
|
const candidate = _require.resolve(`${pkg}/tailwind_styled_parser.node`);
|
|
863
|
-
if (
|
|
874
|
+
if (fs.existsSync(candidate)) {
|
|
864
875
|
return { path: candidate, source: "prebuilt", platform, tried };
|
|
865
876
|
}
|
|
866
877
|
tried.push(`prebuilt:${pkg} (resolved but missing)`);
|
|
@@ -877,7 +888,7 @@ function resolveNativeBinary(runtimeDir) {
|
|
|
877
888
|
for (const suffix of ["", `.${platform}`, `.${napiPlatform}`]) {
|
|
878
889
|
const candidate = path.resolve(pkgRoot, "native", `${bin}${suffix}.node`);
|
|
879
890
|
tried.push(`self-bundled:${candidate}`);
|
|
880
|
-
if (
|
|
891
|
+
if (fs.existsSync(candidate)) {
|
|
881
892
|
return { path: candidate, source: "prebuilt", platform, tried };
|
|
882
893
|
}
|
|
883
894
|
}
|
|
@@ -911,7 +922,7 @@ function resolveNativeBinary(runtimeDir) {
|
|
|
911
922
|
}
|
|
912
923
|
for (const candidate of localCandidates) {
|
|
913
924
|
tried.push(`local:${candidate}`);
|
|
914
|
-
if (
|
|
925
|
+
if (fs.existsSync(candidate)) {
|
|
915
926
|
return { path: candidate, source: "local", platform, tried };
|
|
916
927
|
}
|
|
917
928
|
}
|
|
@@ -934,6 +945,7 @@ function formatNativeNotFoundError(result) {
|
|
|
934
945
|
var isBrowser3, _require, PLATFORM_MAP;
|
|
935
946
|
var init_native_resolution = __esm({
|
|
936
947
|
"packages/domain/shared/src/native-resolution.ts"() {
|
|
948
|
+
"use strict";
|
|
937
949
|
isBrowser3 = typeof window !== "undefined" || typeof document !== "undefined";
|
|
938
950
|
_require = typeof __require !== "undefined" ? __require : createRequire(import.meta.url);
|
|
939
951
|
PLATFORM_MAP = {
|
|
@@ -981,6 +993,7 @@ function createObservabilityClient(opts = {}) {
|
|
|
981
993
|
}
|
|
982
994
|
var init_observability = __esm({
|
|
983
995
|
"packages/domain/shared/src/observability.ts"() {
|
|
996
|
+
"use strict";
|
|
984
997
|
}
|
|
985
998
|
});
|
|
986
999
|
|
|
@@ -988,6 +1001,7 @@ var init_observability = __esm({
|
|
|
988
1001
|
var _loadNative, log, NATIVE_UNAVAILABLE_MESSAGE, nativeBridge, bridgeLoadAttempted, bridgeLoadError, isValidNativeBridge, getNativeBridge, adaptNativeResult;
|
|
989
1002
|
var init_nativeBridge = __esm({
|
|
990
1003
|
"packages/domain/compiler/src/nativeBridge.ts"() {
|
|
1004
|
+
"use strict";
|
|
991
1005
|
init_src2();
|
|
992
1006
|
_loadNative = (path6) => __require(path6);
|
|
993
1007
|
log = (...args) => {
|
|
@@ -1127,6 +1141,7 @@ function resetCacheStats() {
|
|
|
1127
1141
|
}
|
|
1128
1142
|
var init_cssGeneratorNative = __esm({
|
|
1129
1143
|
"packages/domain/compiler/src/compiler/cssGeneratorNative.ts"() {
|
|
1144
|
+
"use strict";
|
|
1130
1145
|
init_nativeBridge();
|
|
1131
1146
|
}
|
|
1132
1147
|
});
|
|
@@ -1199,6 +1214,7 @@ function atomicRegistrySize() {
|
|
|
1199
1214
|
}
|
|
1200
1215
|
var init_compilationNative = __esm({
|
|
1201
1216
|
"packages/domain/compiler/src/compiler/compilationNative.ts"() {
|
|
1217
|
+
"use strict";
|
|
1202
1218
|
init_nativeBridge();
|
|
1203
1219
|
}
|
|
1204
1220
|
});
|
|
@@ -1342,6 +1358,7 @@ function twMergeRaw(classLists) {
|
|
|
1342
1358
|
}
|
|
1343
1359
|
var init_cssCompilationNative = __esm({
|
|
1344
1360
|
"packages/domain/compiler/src/compiler/cssCompilationNative.ts"() {
|
|
1361
|
+
"use strict";
|
|
1345
1362
|
init_nativeBridge();
|
|
1346
1363
|
}
|
|
1347
1364
|
});
|
|
@@ -1441,6 +1458,7 @@ function idRegistryImport(importedData) {
|
|
|
1441
1458
|
}
|
|
1442
1459
|
var init_idRegistryNative = __esm({
|
|
1443
1460
|
"packages/domain/compiler/src/compiler/idRegistryNative.ts"() {
|
|
1461
|
+
"use strict";
|
|
1444
1462
|
init_nativeBridge();
|
|
1445
1463
|
}
|
|
1446
1464
|
});
|
|
@@ -1582,9 +1600,13 @@ function scanFilesBatchNative(filesJson) {
|
|
|
1582
1600
|
}
|
|
1583
1601
|
var init_streamingNative = __esm({
|
|
1584
1602
|
"packages/domain/compiler/src/compiler/streamingNative.ts"() {
|
|
1603
|
+
"use strict";
|
|
1585
1604
|
init_nativeBridge();
|
|
1586
1605
|
}
|
|
1587
1606
|
});
|
|
1607
|
+
|
|
1608
|
+
// packages/domain/compiler/src/tailwindEngine.ts
|
|
1609
|
+
import { createRequire as createRequire2 } from "module";
|
|
1588
1610
|
function loadTailwindEngine() {
|
|
1589
1611
|
if (_twEngine) return _twEngine;
|
|
1590
1612
|
if (_twEngineError) throw _twEngineError;
|
|
@@ -1604,10 +1626,10 @@ async function generateRawCss(classes, cssEntryContent, root) {
|
|
|
1604
1626
|
if (classes.length === 0) return "";
|
|
1605
1627
|
const tw = loadTailwindEngine();
|
|
1606
1628
|
const input = cssEntryContent ?? "@import 'tailwindcss';";
|
|
1607
|
-
const { readFileSync, existsSync: existsSync3 } = await import(
|
|
1608
|
-
const { dirname, resolve: resolve2 } = await import(
|
|
1629
|
+
const { readFileSync, existsSync: existsSync3 } = await import("fs");
|
|
1630
|
+
const { dirname, resolve: resolve2 } = await import("path");
|
|
1609
1631
|
const projectRoot = root ?? process.cwd();
|
|
1610
|
-
const req =
|
|
1632
|
+
const req = createRequire2(resolve2(projectRoot, "package.json"));
|
|
1611
1633
|
const loadStylesheet = async (id, base) => {
|
|
1612
1634
|
try {
|
|
1613
1635
|
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;
|
|
@@ -1627,10 +1649,12 @@ async function generateRawCss(classes, cssEntryContent, root) {
|
|
|
1627
1649
|
const compiler = await Promise.resolve(tw.compile(input, { loadStylesheet }));
|
|
1628
1650
|
return compiler.build(classes);
|
|
1629
1651
|
}
|
|
1630
|
-
var require2, _twEngine, _twEngineError;
|
|
1652
|
+
var require2, MAX_CACHE_MEMORY, _twEngine, _twEngineError;
|
|
1631
1653
|
var init_tailwindEngine = __esm({
|
|
1632
1654
|
"packages/domain/compiler/src/tailwindEngine.ts"() {
|
|
1633
|
-
|
|
1655
|
+
"use strict";
|
|
1656
|
+
require2 = createRequire2(import.meta.url);
|
|
1657
|
+
MAX_CACHE_MEMORY = 256 * 1024;
|
|
1634
1658
|
_twEngine = null;
|
|
1635
1659
|
_twEngineError = null;
|
|
1636
1660
|
}
|
|
@@ -1645,6 +1669,7 @@ __export(tailwindEngine_exports, {
|
|
|
1645
1669
|
runCssPipeline: () => runCssPipeline,
|
|
1646
1670
|
runCssPipelineSync: () => runCssPipelineSync
|
|
1647
1671
|
});
|
|
1672
|
+
import { createRequire as createRequire3 } from "module";
|
|
1648
1673
|
function _getCacheKey(classes, minify, cssEntry, root) {
|
|
1649
1674
|
const sorted = [...classes].sort().join(",");
|
|
1650
1675
|
const flags = `${minify ? "1" : "0"}${cssEntry ? "1" : "0"}${root ? "1" : "0"}`;
|
|
@@ -1811,24 +1836,27 @@ function processTailwindCssWithTargets(css, targets) {
|
|
|
1811
1836
|
}
|
|
1812
1837
|
return result.css;
|
|
1813
1838
|
}
|
|
1814
|
-
var _cssCache, _cacheHits, _cacheMisses, MAX_CACHE_SIZE;
|
|
1839
|
+
var require3, _cssCache, _cacheHits, _cacheMisses, MAX_CACHE_SIZE, MAX_CACHE_MEMORY2;
|
|
1815
1840
|
var init_tailwindEngine2 = __esm({
|
|
1816
1841
|
"packages/domain/compiler/src/compiler/tailwindEngine.ts"() {
|
|
1842
|
+
"use strict";
|
|
1817
1843
|
init_nativeBridge();
|
|
1818
1844
|
init_cssGeneratorNative();
|
|
1819
1845
|
init_cssCompilationNative();
|
|
1820
1846
|
init_tailwindEngine();
|
|
1821
|
-
|
|
1847
|
+
require3 = createRequire3(import.meta.url);
|
|
1822
1848
|
_cssCache = /* @__PURE__ */ new Map();
|
|
1823
1849
|
_cacheHits = 0;
|
|
1824
1850
|
_cacheMisses = 0;
|
|
1825
1851
|
MAX_CACHE_SIZE = 100;
|
|
1852
|
+
MAX_CACHE_MEMORY2 = 256 * 1024;
|
|
1826
1853
|
}
|
|
1827
1854
|
});
|
|
1828
1855
|
|
|
1829
1856
|
// packages/domain/compiler/src/compiler/index.ts
|
|
1830
1857
|
var init_compiler = __esm({
|
|
1831
1858
|
"packages/domain/compiler/src/compiler/index.ts"() {
|
|
1859
|
+
"use strict";
|
|
1832
1860
|
init_cssGeneratorNative();
|
|
1833
1861
|
init_compilationNative();
|
|
1834
1862
|
init_cssCompilationNative();
|
|
@@ -1841,6 +1869,7 @@ var init_compiler = __esm({
|
|
|
1841
1869
|
var parseClasses, parseClass, extractAllClasses, extractClassesFromSource, astExtractClasses, normalizeClasses, mergeClassesStatic, normalizeAndDedupClasses, extractComponentUsage, batchExtractClasses, checkAgainstSafelist, diffClassLists;
|
|
1842
1870
|
var init_parser = __esm({
|
|
1843
1871
|
"packages/domain/compiler/src/parser/index.ts"() {
|
|
1872
|
+
"use strict";
|
|
1844
1873
|
init_nativeBridge();
|
|
1845
1874
|
parseClasses = (raw) => {
|
|
1846
1875
|
const native = getNativeBridge();
|
|
@@ -2019,6 +2048,7 @@ function resetMemoryStats() {
|
|
|
2019
2048
|
}
|
|
2020
2049
|
var init_analyzerNative = __esm({
|
|
2021
2050
|
"packages/domain/compiler/src/analyzer/analyzerNative.ts"() {
|
|
2051
|
+
"use strict";
|
|
2022
2052
|
init_nativeBridge();
|
|
2023
2053
|
}
|
|
2024
2054
|
});
|
|
@@ -2112,6 +2142,7 @@ function resolveSimpleVariants(configJson) {
|
|
|
2112
2142
|
}
|
|
2113
2143
|
var init_themeResolutionNative = __esm({
|
|
2114
2144
|
"packages/domain/compiler/src/analyzer/themeResolutionNative.ts"() {
|
|
2145
|
+
"use strict";
|
|
2115
2146
|
init_nativeBridge();
|
|
2116
2147
|
}
|
|
2117
2148
|
});
|
|
@@ -2159,6 +2190,7 @@ function generateSubComponentTypes(root, outputPath) {
|
|
|
2159
2190
|
}
|
|
2160
2191
|
var init_scannerNative = __esm({
|
|
2161
2192
|
"packages/domain/compiler/src/analyzer/scannerNative.ts"() {
|
|
2193
|
+
"use strict";
|
|
2162
2194
|
init_nativeBridge();
|
|
2163
2195
|
}
|
|
2164
2196
|
});
|
|
@@ -2166,6 +2198,7 @@ var init_scannerNative = __esm({
|
|
|
2166
2198
|
// packages/domain/compiler/src/analyzer/index.ts
|
|
2167
2199
|
var init_analyzer = __esm({
|
|
2168
2200
|
"packages/domain/compiler/src/analyzer/index.ts"() {
|
|
2201
|
+
"use strict";
|
|
2169
2202
|
init_analyzerNative();
|
|
2170
2203
|
init_themeResolutionNative();
|
|
2171
2204
|
init_scannerNative();
|
|
@@ -2354,6 +2387,7 @@ function resetResolverPoolStats() {
|
|
|
2354
2387
|
}
|
|
2355
2388
|
var init_cacheNative = __esm({
|
|
2356
2389
|
"packages/domain/compiler/src/cache/cacheNative.ts"() {
|
|
2390
|
+
"use strict";
|
|
2357
2391
|
init_nativeBridge();
|
|
2358
2392
|
}
|
|
2359
2393
|
});
|
|
@@ -2361,6 +2395,7 @@ var init_cacheNative = __esm({
|
|
|
2361
2395
|
// packages/domain/compiler/src/cache/index.ts
|
|
2362
2396
|
var init_cache = __esm({
|
|
2363
2397
|
"packages/domain/compiler/src/cache/index.ts"() {
|
|
2398
|
+
"use strict";
|
|
2364
2399
|
init_cacheNative();
|
|
2365
2400
|
}
|
|
2366
2401
|
});
|
|
@@ -2609,6 +2644,7 @@ function redisDiagnose() {
|
|
|
2609
2644
|
}
|
|
2610
2645
|
var init_redisNative = __esm({
|
|
2611
2646
|
"packages/domain/compiler/src/redis/redisNative.ts"() {
|
|
2647
|
+
"use strict";
|
|
2612
2648
|
init_nativeBridge();
|
|
2613
2649
|
}
|
|
2614
2650
|
});
|
|
@@ -2616,6 +2652,7 @@ var init_redisNative = __esm({
|
|
|
2616
2652
|
// packages/domain/compiler/src/redis/index.ts
|
|
2617
2653
|
var init_redis = __esm({
|
|
2618
2654
|
"packages/domain/compiler/src/redis/index.ts"() {
|
|
2655
|
+
"use strict";
|
|
2619
2656
|
init_redisNative();
|
|
2620
2657
|
}
|
|
2621
2658
|
});
|
|
@@ -2754,6 +2791,7 @@ function getCompilerDiagnostics() {
|
|
|
2754
2791
|
}
|
|
2755
2792
|
var init_watchSystemNative = __esm({
|
|
2756
2793
|
"packages/domain/compiler/src/watch/watchSystemNative.ts"() {
|
|
2794
|
+
"use strict";
|
|
2757
2795
|
init_nativeBridge();
|
|
2758
2796
|
}
|
|
2759
2797
|
});
|
|
@@ -2761,9 +2799,15 @@ var init_watchSystemNative = __esm({
|
|
|
2761
2799
|
// packages/domain/compiler/src/watch/index.ts
|
|
2762
2800
|
var init_watch = __esm({
|
|
2763
2801
|
"packages/domain/compiler/src/watch/index.ts"() {
|
|
2802
|
+
"use strict";
|
|
2764
2803
|
init_watchSystemNative();
|
|
2765
2804
|
}
|
|
2766
2805
|
});
|
|
2806
|
+
|
|
2807
|
+
// packages/domain/compiler/src/index.ts
|
|
2808
|
+
import fs2 from "fs";
|
|
2809
|
+
import path2 from "path";
|
|
2810
|
+
import { createRequire as createRequire4 } from "module";
|
|
2767
2811
|
function _layoutClassesToCss(classes) {
|
|
2768
2812
|
const native = getNativeBridge();
|
|
2769
2813
|
if (!native?.layoutClassesToCss) {
|
|
@@ -2801,6 +2845,7 @@ function extractContainerCssFromSource(source) {
|
|
|
2801
2845
|
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;
|
|
2802
2846
|
var init_src = __esm({
|
|
2803
2847
|
"packages/domain/compiler/src/index.ts"() {
|
|
2848
|
+
"use strict";
|
|
2804
2849
|
init_nativeBridge();
|
|
2805
2850
|
init_compiler();
|
|
2806
2851
|
init_parser();
|
|
@@ -2808,7 +2853,7 @@ var init_src = __esm({
|
|
|
2808
2853
|
init_cache();
|
|
2809
2854
|
init_redis();
|
|
2810
2855
|
init_watch();
|
|
2811
|
-
_require2 =
|
|
2856
|
+
_require2 = createRequire4(import.meta.url);
|
|
2812
2857
|
transformSource = (source, opts) => {
|
|
2813
2858
|
const native = getNativeBridge();
|
|
2814
2859
|
if (!native?.transformSource) {
|
|
@@ -2900,7 +2945,7 @@ var init_src = __esm({
|
|
|
2900
2945
|
};
|
|
2901
2946
|
scanProjectUsage = (dirs, cwd) => {
|
|
2902
2947
|
const { batchExtractClasses: batchExtractClasses2 } = _require2("./parser");
|
|
2903
|
-
const files = dirs.map((dir) =>
|
|
2948
|
+
const files = dirs.map((dir) => path2.resolve(cwd, dir));
|
|
2904
2949
|
const results = batchExtractClasses2(files) || [];
|
|
2905
2950
|
const combined = {};
|
|
2906
2951
|
for (const result of results) {
|
|
@@ -2917,13 +2962,13 @@ var init_src = __esm({
|
|
|
2917
2962
|
const classes = scanProjectUsage(scanDirs, cwd || process.cwd());
|
|
2918
2963
|
const allClasses = Object.keys(classes).sort();
|
|
2919
2964
|
if (outputPath) {
|
|
2920
|
-
|
|
2965
|
+
fs2.writeFileSync(outputPath, JSON.stringify(allClasses, null, 2));
|
|
2921
2966
|
}
|
|
2922
2967
|
return allClasses;
|
|
2923
2968
|
};
|
|
2924
2969
|
loadSafelist = (safelistPath) => {
|
|
2925
2970
|
try {
|
|
2926
|
-
const content =
|
|
2971
|
+
const content = fs2.readFileSync(safelistPath, "utf-8");
|
|
2927
2972
|
return JSON.parse(content);
|
|
2928
2973
|
} catch {
|
|
2929
2974
|
return [];
|
|
@@ -2937,8 +2982,8 @@ var init_src = __esm({
|
|
|
2937
2982
|
"tailwind.config.cjs"
|
|
2938
2983
|
];
|
|
2939
2984
|
for (const file of configFiles) {
|
|
2940
|
-
const fullPath =
|
|
2941
|
-
if (
|
|
2985
|
+
const fullPath = path2.join(cwd, file);
|
|
2986
|
+
if (fs2.existsSync(fullPath)) {
|
|
2942
2987
|
const mod = __require(fullPath);
|
|
2943
2988
|
return mod.default || mod;
|
|
2944
2989
|
}
|
|
@@ -2948,9 +2993,9 @@ var init_src = __esm({
|
|
|
2948
2993
|
getContentPaths = (cwd = process.cwd()) => {
|
|
2949
2994
|
return {
|
|
2950
2995
|
content: [
|
|
2951
|
-
|
|
2952
|
-
|
|
2953
|
-
|
|
2996
|
+
path2.join(cwd, "src/**/*.{js,ts,jsx,tsx}"),
|
|
2997
|
+
path2.join(cwd, "app/**/*.{js,ts,jsx,tsx}"),
|
|
2998
|
+
path2.join(cwd, "pages/**/*.{js,ts,jsx,tsx}")
|
|
2954
2999
|
]
|
|
2955
3000
|
};
|
|
2956
3001
|
};
|
|
@@ -3364,6 +3409,7 @@ __export(internal_exports, {
|
|
|
3364
3409
|
});
|
|
3365
3410
|
var init_internal = __esm({
|
|
3366
3411
|
"packages/domain/compiler/src/internal.ts"() {
|
|
3412
|
+
"use strict";
|
|
3367
3413
|
init_src();
|
|
3368
3414
|
init_tailwindEngine2();
|
|
3369
3415
|
init_compiler();
|
|
@@ -3374,6 +3420,10 @@ var init_internal = __esm({
|
|
|
3374
3420
|
init_watch();
|
|
3375
3421
|
}
|
|
3376
3422
|
});
|
|
3423
|
+
|
|
3424
|
+
// packages/domain/shared/src/staticStateExtractor.ts
|
|
3425
|
+
import fs3 from "fs";
|
|
3426
|
+
import path3 from "path";
|
|
3377
3427
|
function getNative() {
|
|
3378
3428
|
if (_native) return _native;
|
|
3379
3429
|
try {
|
|
@@ -3403,17 +3453,17 @@ function getNative() {
|
|
|
3403
3453
|
function* walkSourceFiles(dir) {
|
|
3404
3454
|
let entries;
|
|
3405
3455
|
try {
|
|
3406
|
-
entries =
|
|
3456
|
+
entries = fs3.readdirSync(dir, { withFileTypes: true });
|
|
3407
3457
|
} catch {
|
|
3408
3458
|
return;
|
|
3409
3459
|
}
|
|
3410
3460
|
for (const entry of entries) {
|
|
3411
|
-
const fullPath =
|
|
3461
|
+
const fullPath = path3.join(dir, entry.name);
|
|
3412
3462
|
if (entry.isDirectory()) {
|
|
3413
3463
|
if (IGNORE_PATTERNS.some((p) => entry.name === p || entry.name.startsWith(p))) continue;
|
|
3414
3464
|
yield* walkSourceFiles(fullPath);
|
|
3415
3465
|
} else if (entry.isFile()) {
|
|
3416
|
-
const ext =
|
|
3466
|
+
const ext = path3.extname(entry.name);
|
|
3417
3467
|
if (SOURCE_EXTENSIONS.has(ext)) yield fullPath;
|
|
3418
3468
|
}
|
|
3419
3469
|
}
|
|
@@ -3477,7 +3527,7 @@ function extractStaticStateCss(srcDir, options = {}) {
|
|
|
3477
3527
|
allConfigs.push(...configs);
|
|
3478
3528
|
if (verbose) {
|
|
3479
3529
|
process.stderr.write(
|
|
3480
|
-
`[tw:static-state] ${
|
|
3530
|
+
`[tw:static-state] ${path3.relative(srcDir, filePath)}: ${configs.length} komponen
|
|
3481
3531
|
`
|
|
3482
3532
|
);
|
|
3483
3533
|
}
|
|
@@ -3488,7 +3538,7 @@ function extractStaticStateCss(srcDir, options = {}) {
|
|
|
3488
3538
|
if (filesScanned >= maxFiles) break;
|
|
3489
3539
|
let source;
|
|
3490
3540
|
try {
|
|
3491
|
-
source =
|
|
3541
|
+
source = fs3.readFileSync(filePath, "utf-8");
|
|
3492
3542
|
} catch {
|
|
3493
3543
|
continue;
|
|
3494
3544
|
}
|
|
@@ -3501,7 +3551,7 @@ function extractStaticStateCss(srcDir, options = {}) {
|
|
|
3501
3551
|
allConfigs.push(...configs);
|
|
3502
3552
|
if (verbose) {
|
|
3503
3553
|
process.stderr.write(
|
|
3504
|
-
`[tw:static-state] ${
|
|
3554
|
+
`[tw:static-state] ${path3.relative(srcDir, filePath)}: ${configs.length} komponen
|
|
3505
3555
|
`
|
|
3506
3556
|
);
|
|
3507
3557
|
}
|
|
@@ -3595,12 +3645,12 @@ function appendStaticStateCssToSafelist(srcDir, safelistPath, options = {}) {
|
|
|
3595
3645
|
resolvedCss: options.resolvedCss || ""
|
|
3596
3646
|
// ← ensure always passed
|
|
3597
3647
|
});
|
|
3598
|
-
const twClassesDir =
|
|
3599
|
-
|
|
3600
|
-
const stateFilePath =
|
|
3648
|
+
const twClassesDir = path3.join(path3.dirname(safelistPath), "tw-classes");
|
|
3649
|
+
fs3.mkdirSync(twClassesDir, { recursive: true });
|
|
3650
|
+
const stateFilePath = path3.join(twClassesDir, TW_STATE_STATIC_FILENAME);
|
|
3601
3651
|
if (result.rulesGenerated === 0) {
|
|
3602
3652
|
try {
|
|
3603
|
-
|
|
3653
|
+
fs3.writeFileSync(
|
|
3604
3654
|
stateFilePath,
|
|
3605
3655
|
"/* tw-state-static.css \u2014 tidak ada state rules yang di-generate */\n",
|
|
3606
3656
|
"utf-8"
|
|
@@ -3610,7 +3660,7 @@ function appendStaticStateCssToSafelist(srcDir, safelistPath, options = {}) {
|
|
|
3610
3660
|
return `[tw:static-state] tidak ada state rules yang di-generate (${result.filesScanned} files di-scan)`;
|
|
3611
3661
|
}
|
|
3612
3662
|
try {
|
|
3613
|
-
|
|
3663
|
+
fs3.writeFileSync(stateFilePath, result.generatedCss, "utf-8");
|
|
3614
3664
|
return [
|
|
3615
3665
|
`[tw:static-state] ${result.rulesGenerated} static state rules di-generate`,
|
|
3616
3666
|
` \u2192 ${result.filesScanned} files scanned, ${result.filesWithStates} dengan states`,
|
|
@@ -3625,12 +3675,17 @@ function appendStaticStateCssToSafelist(srcDir, safelistPath, options = {}) {
|
|
|
3625
3675
|
var SOURCE_EXTENSIONS, IGNORE_PATTERNS, _native, TW_STATE_STATIC_FILENAME;
|
|
3626
3676
|
var init_staticStateExtractor = __esm({
|
|
3627
3677
|
"packages/domain/shared/src/staticStateExtractor.ts"() {
|
|
3678
|
+
"use strict";
|
|
3628
3679
|
SOURCE_EXTENSIONS = /* @__PURE__ */ new Set([".ts", ".tsx", ".js", ".jsx", ".mts", ".mjs"]);
|
|
3629
3680
|
IGNORE_PATTERNS = ["node_modules", ".next", "dist", "build", ".git", "coverage", "__tests__"];
|
|
3630
3681
|
_native = null;
|
|
3631
3682
|
TW_STATE_STATIC_FILENAME = "_tw-state-static.css";
|
|
3632
3683
|
}
|
|
3633
3684
|
});
|
|
3685
|
+
|
|
3686
|
+
// packages/domain/shared/src/logger.ts
|
|
3687
|
+
import fs4 from "fs";
|
|
3688
|
+
import path4 from "path";
|
|
3634
3689
|
function getEnvLevel() {
|
|
3635
3690
|
const env = process.env.TWS_LOG_LEVEL?.toLowerCase();
|
|
3636
3691
|
if (env && env in LEVELS) return env;
|
|
@@ -3640,8 +3695,8 @@ function setGlobalLogFile(filePath) {
|
|
|
3640
3695
|
_globalLogFile = filePath;
|
|
3641
3696
|
_logFileInitialized = false;
|
|
3642
3697
|
try {
|
|
3643
|
-
|
|
3644
|
-
|
|
3698
|
+
fs4.mkdirSync(path4.dirname(filePath), { recursive: true });
|
|
3699
|
+
fs4.writeFileSync(
|
|
3645
3700
|
filePath,
|
|
3646
3701
|
`# tailwind-styled build log \u2014 ${(/* @__PURE__ */ new Date()).toISOString()}
|
|
3647
3702
|
`,
|
|
@@ -3654,13 +3709,13 @@ function setGlobalLogFile(filePath) {
|
|
|
3654
3709
|
function writeToFile(line) {
|
|
3655
3710
|
if (!_globalLogFile || !_logFileInitialized) return;
|
|
3656
3711
|
try {
|
|
3657
|
-
|
|
3712
|
+
fs4.appendFileSync(_globalLogFile, line);
|
|
3658
3713
|
} catch {
|
|
3659
3714
|
}
|
|
3660
3715
|
}
|
|
3661
3716
|
function createLogger(prefix, level) {
|
|
3662
3717
|
const loggerState = {
|
|
3663
|
-
currentLevel: getEnvLevel(),
|
|
3718
|
+
currentLevel: level ?? getEnvLevel(),
|
|
3664
3719
|
setLevel(l) {
|
|
3665
3720
|
this.currentLevel = l;
|
|
3666
3721
|
}
|
|
@@ -3681,15 +3736,23 @@ function createLogger(prefix, level) {
|
|
|
3681
3736
|
setLogFile: (filePath) => setGlobalLogFile(filePath)
|
|
3682
3737
|
};
|
|
3683
3738
|
}
|
|
3684
|
-
var LEVELS, _globalLogFile, _logFileInitialized;
|
|
3739
|
+
var LEVELS, _globalLogFile, _logFileInitialized, logger;
|
|
3685
3740
|
var init_logger = __esm({
|
|
3686
3741
|
"packages/domain/shared/src/logger.ts"() {
|
|
3742
|
+
"use strict";
|
|
3687
3743
|
LEVELS = { silent: 0, error: 1, warn: 2, info: 3, debug: 4 };
|
|
3688
3744
|
_globalLogFile = null;
|
|
3689
3745
|
_logFileInitialized = false;
|
|
3690
|
-
createLogger("tailwind-styled");
|
|
3746
|
+
logger = createLogger("tailwind-styled");
|
|
3691
3747
|
}
|
|
3692
3748
|
});
|
|
3749
|
+
|
|
3750
|
+
// packages/domain/shared/src/index.ts
|
|
3751
|
+
import { createHash } from "crypto";
|
|
3752
|
+
import fs5 from "fs";
|
|
3753
|
+
import path5 from "path";
|
|
3754
|
+
import { fileURLToPath } from "url";
|
|
3755
|
+
import { createRequire as createRequire5 } from "module";
|
|
3693
3756
|
function createLogger2(namespace) {
|
|
3694
3757
|
const prefix = `[${namespace}]`;
|
|
3695
3758
|
return {
|
|
@@ -3735,9 +3798,9 @@ function loadNativeBinding(options) {
|
|
|
3735
3798
|
const { runtimeDir, candidates, isValid } = options;
|
|
3736
3799
|
const loadErrors = [];
|
|
3737
3800
|
for (const candidate of candidates) {
|
|
3738
|
-
const candidatePath =
|
|
3801
|
+
const candidatePath = path5.resolve(runtimeDir, candidate);
|
|
3739
3802
|
try {
|
|
3740
|
-
if (!
|
|
3803
|
+
if (!fs5.existsSync(candidatePath) && !fs5.existsSync(candidatePath + ".node")) {
|
|
3741
3804
|
continue;
|
|
3742
3805
|
}
|
|
3743
3806
|
const mod = requireNativeModule(candidatePath);
|
|
@@ -3769,9 +3832,9 @@ function resolveNativeBindingCandidates(options) {
|
|
|
3769
3832
|
}
|
|
3770
3833
|
}
|
|
3771
3834
|
if (!includeDefaultCandidates) return candidates;
|
|
3772
|
-
if (
|
|
3835
|
+
if (fs5.existsSync(runtimeDir)) {
|
|
3773
3836
|
try {
|
|
3774
|
-
for (const entry of
|
|
3837
|
+
for (const entry of fs5.readdirSync(runtimeDir)) {
|
|
3775
3838
|
if (entry.endsWith(".node")) candidates.push(entry);
|
|
3776
3839
|
}
|
|
3777
3840
|
} catch {
|
|
@@ -3780,22 +3843,22 @@ function resolveNativeBindingCandidates(options) {
|
|
|
3780
3843
|
const BINARY_NAMES = ["tailwind-styled-native", "tailwind_styled_parser"];
|
|
3781
3844
|
const napiPlatform = process.platform === "linux" && process.arch === "x64" ? "linux-x64-gnu" : process.platform === "linux" && process.arch === "arm64" ? "linux-arm64-gnu" : `${process.platform}-${process.arch}`;
|
|
3782
3845
|
for (const bin of BINARY_NAMES) {
|
|
3783
|
-
candidates.push(
|
|
3784
|
-
candidates.push(
|
|
3785
|
-
candidates.push(
|
|
3786
|
-
candidates.push(
|
|
3787
|
-
candidates.push(
|
|
3788
|
-
candidates.push(
|
|
3789
|
-
candidates.push(
|
|
3790
|
-
candidates.push(
|
|
3791
|
-
candidates.push(
|
|
3846
|
+
candidates.push(path5.resolve(runtimeDir, `${bin}.node`));
|
|
3847
|
+
candidates.push(path5.resolve(runtimeDir, `${bin}.${napiPlatform}.node`));
|
|
3848
|
+
candidates.push(path5.resolve(runtimeDir, "..", "native", `${bin}.node`));
|
|
3849
|
+
candidates.push(path5.resolve(runtimeDir, "..", "native", `${bin}.${napiPlatform}.node`));
|
|
3850
|
+
candidates.push(path5.resolve(process.cwd(), "native", `${bin}.node`));
|
|
3851
|
+
candidates.push(path5.resolve(process.cwd(), "native", `${bin}.${napiPlatform}.node`));
|
|
3852
|
+
candidates.push(path5.resolve(runtimeDir, "..", "..", "..", "..", "native", `${bin}.node`));
|
|
3853
|
+
candidates.push(path5.resolve(runtimeDir, "..", "..", "..", "..", "native", `${bin}.${napiPlatform}.node`));
|
|
3854
|
+
candidates.push(path5.resolve(runtimeDir, "..", "..", "..", "native", `${bin}.node`));
|
|
3792
3855
|
}
|
|
3793
3856
|
return Array.from(new Set(candidates));
|
|
3794
3857
|
}
|
|
3795
3858
|
function resolveRuntimeDir(dir, importMetaUrl) {
|
|
3796
|
-
if (dir) return
|
|
3859
|
+
if (dir) return path5.resolve(dir);
|
|
3797
3860
|
try {
|
|
3798
|
-
return
|
|
3861
|
+
return path5.dirname(fileURLToPath(importMetaUrl));
|
|
3799
3862
|
} catch {
|
|
3800
3863
|
return process.cwd();
|
|
3801
3864
|
}
|
|
@@ -3812,6 +3875,7 @@ function formatErrorMessage(error) {
|
|
|
3812
3875
|
var TwError, _require3, LRUCache;
|
|
3813
3876
|
var init_src2 = __esm({
|
|
3814
3877
|
"packages/domain/shared/src/index.ts"() {
|
|
3878
|
+
"use strict";
|
|
3815
3879
|
init_trace();
|
|
3816
3880
|
init_error_codes();
|
|
3817
3881
|
init_compatibility();
|
|
@@ -3877,7 +3941,7 @@ var init_src2 = __esm({
|
|
|
3877
3941
|
return `[${this.source.toUpperCase()}:${this.code}] ${this.message}`;
|
|
3878
3942
|
}
|
|
3879
3943
|
};
|
|
3880
|
-
_require3 =
|
|
3944
|
+
_require3 = createRequire5(import.meta.url);
|
|
3881
3945
|
LRUCache = class {
|
|
3882
3946
|
capacity;
|
|
3883
3947
|
cache;
|
|
@@ -3924,7 +3988,74 @@ var init_src2 = __esm({
|
|
|
3924
3988
|
|
|
3925
3989
|
// src/umbrella/shared.ts
|
|
3926
3990
|
init_src2();
|
|
3927
|
-
|
|
3928
|
-
|
|
3929
|
-
|
|
3991
|
+
export {
|
|
3992
|
+
ERROR_CODES,
|
|
3993
|
+
LRUCache,
|
|
3994
|
+
NativeAnalyzerReportSchema,
|
|
3995
|
+
NativeCacheEntrySchema,
|
|
3996
|
+
NativeCacheReadResultSchema,
|
|
3997
|
+
NativeCssCompileResultSchema,
|
|
3998
|
+
NativeScanFileSchema,
|
|
3999
|
+
NativeScanResultSchema,
|
|
4000
|
+
NativeTransformResultSchema,
|
|
4001
|
+
NativeWatchResultSchema,
|
|
4002
|
+
PackageJsonSchema,
|
|
4003
|
+
RegistryFileSchema,
|
|
4004
|
+
RegistryPluginEntrySchema,
|
|
4005
|
+
ScanCacheClassEntrySchema,
|
|
4006
|
+
ScanCacheSchema,
|
|
4007
|
+
TW_STATE_STATIC_FILENAME,
|
|
4008
|
+
TailwindConfigSchema,
|
|
4009
|
+
TelemetryCollector,
|
|
4010
|
+
TwError,
|
|
4011
|
+
appendStaticStateCssToSafelist,
|
|
4012
|
+
assertTailwindV4,
|
|
4013
|
+
calculateHealth,
|
|
4014
|
+
createBuildTimer,
|
|
4015
|
+
createDebugLogger,
|
|
4016
|
+
createEsmRequire,
|
|
4017
|
+
createLogger2 as createLogger,
|
|
4018
|
+
createObservabilityClient,
|
|
4019
|
+
createTraceSnapshot,
|
|
4020
|
+
detectTailwind,
|
|
4021
|
+
extractStaticStateCss,
|
|
4022
|
+
formatDuration,
|
|
4023
|
+
formatErrorCode,
|
|
4024
|
+
formatErrorMessage,
|
|
4025
|
+
formatMemory,
|
|
4026
|
+
formatNativeNotFoundError,
|
|
4027
|
+
generateBarrelFile,
|
|
4028
|
+
generateClassRenameCodemod,
|
|
4029
|
+
generateComponentCode,
|
|
4030
|
+
generateStorybookStory,
|
|
4031
|
+
getBuildTimeColor,
|
|
4032
|
+
getDirname,
|
|
4033
|
+
getFilename,
|
|
4034
|
+
getGlobalTelemetry,
|
|
4035
|
+
getHealthColor,
|
|
4036
|
+
getMemoryColor,
|
|
4037
|
+
getModeColor,
|
|
4038
|
+
getPipelinePercentages,
|
|
4039
|
+
getSuggestion,
|
|
4040
|
+
getTailwindVersion,
|
|
4041
|
+
hashContent2 as hashContent,
|
|
4042
|
+
isTailwindV4,
|
|
4043
|
+
isTwError,
|
|
4044
|
+
loadNativeBinding,
|
|
4045
|
+
parseJsonFileWithSchema,
|
|
4046
|
+
parseJsonWithSchema,
|
|
4047
|
+
parseNative,
|
|
4048
|
+
resetGlobalTelemetry,
|
|
4049
|
+
resolveFromRoot,
|
|
4050
|
+
resolveLoaderPath,
|
|
4051
|
+
resolveNativeBinary,
|
|
4052
|
+
resolveNativeBindingCandidates,
|
|
4053
|
+
resolveNativeNodePath,
|
|
4054
|
+
resolveRuntimeDir,
|
|
4055
|
+
resolveWorkerPath,
|
|
4056
|
+
safeParseNative,
|
|
4057
|
+
setGlobalLogFile,
|
|
4058
|
+
tryRequire,
|
|
4059
|
+
wrapUnknownError
|
|
4060
|
+
};
|
|
3930
4061
|
//# sourceMappingURL=shared.mjs.map
|