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/scanner.js
CHANGED
|
@@ -1,24 +1,10 @@
|
|
|
1
|
-
'use strict';
|
|
2
|
-
|
|
3
|
-
require('crypto');
|
|
4
|
-
var fs3 = require('fs');
|
|
5
|
-
var path5 = require('path');
|
|
6
|
-
var url = require('url');
|
|
7
|
-
var module$1 = require('module');
|
|
8
|
-
var worker_threads = require('worker_threads');
|
|
9
|
-
var os = require('os');
|
|
10
|
-
var zod = require('zod');
|
|
11
|
-
|
|
12
|
-
var _documentCurrentScript = typeof document !== 'undefined' ? document.currentScript : null;
|
|
13
|
-
function _interopDefault (e) { return e && e.__esModule ? e : { default: e }; }
|
|
14
|
-
|
|
15
|
-
var fs3__default = /*#__PURE__*/_interopDefault(fs3);
|
|
16
|
-
var path5__default = /*#__PURE__*/_interopDefault(path5);
|
|
17
|
-
|
|
18
1
|
/* tailwind-styled-v4 v5.0.4 | MIT | https://github.com/dictionar32/tailwind-styled-v4 */
|
|
2
|
+
"use strict";
|
|
3
|
+
var __create = Object.create;
|
|
19
4
|
var __defProp = Object.defineProperty;
|
|
20
5
|
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
21
6
|
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
7
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
22
8
|
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
23
9
|
var __esm = (fn, res) => function __init() {
|
|
24
10
|
return fn && (res = (0, fn[__getOwnPropNames(fn)[0]])(fn = 0)), res;
|
|
@@ -35,7 +21,17 @@ var __copyProps = (to, from, except, desc) => {
|
|
|
35
21
|
}
|
|
36
22
|
return to;
|
|
37
23
|
};
|
|
24
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
25
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
|
26
|
+
// file that has been converted to a CommonJS file using a Babel-
|
|
27
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
28
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
29
|
+
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
30
|
+
mod
|
|
31
|
+
));
|
|
38
32
|
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
33
|
+
|
|
34
|
+
// packages/domain/shared/src/index.ts
|
|
39
35
|
function createLogger(namespace) {
|
|
40
36
|
const prefix = `[${namespace}]`;
|
|
41
37
|
return {
|
|
@@ -58,7 +54,7 @@ function createLogger(namespace) {
|
|
|
58
54
|
};
|
|
59
55
|
}
|
|
60
56
|
function createDebugLogger(namespace, label) {
|
|
61
|
-
const prefix = `[${namespace}]`;
|
|
57
|
+
const prefix = label ? `[${namespace}:${label}]` : `[${namespace}]`;
|
|
62
58
|
return (msg) => {
|
|
63
59
|
if (process.env.DEBUG?.includes(namespace) || process.env.TW_DEBUG) {
|
|
64
60
|
console.debug(prefix, msg);
|
|
@@ -75,9 +71,9 @@ function loadNativeBinding(options) {
|
|
|
75
71
|
const { runtimeDir, candidates, isValid } = options;
|
|
76
72
|
const loadErrors = [];
|
|
77
73
|
for (const candidate of candidates) {
|
|
78
|
-
const candidatePath =
|
|
74
|
+
const candidatePath = import_node_path.default.resolve(runtimeDir, candidate);
|
|
79
75
|
try {
|
|
80
|
-
if (!
|
|
76
|
+
if (!import_node_fs.default.existsSync(candidatePath) && !import_node_fs.default.existsSync(candidatePath + ".node")) {
|
|
81
77
|
continue;
|
|
82
78
|
}
|
|
83
79
|
const mod = requireNativeModule(candidatePath);
|
|
@@ -109,9 +105,9 @@ function resolveNativeBindingCandidates(options) {
|
|
|
109
105
|
}
|
|
110
106
|
}
|
|
111
107
|
if (!includeDefaultCandidates) return candidates;
|
|
112
|
-
if (
|
|
108
|
+
if (import_node_fs.default.existsSync(runtimeDir)) {
|
|
113
109
|
try {
|
|
114
|
-
for (const entry of
|
|
110
|
+
for (const entry of import_node_fs.default.readdirSync(runtimeDir)) {
|
|
115
111
|
if (entry.endsWith(".node")) candidates.push(entry);
|
|
116
112
|
}
|
|
117
113
|
} catch {
|
|
@@ -120,21 +116,28 @@ function resolveNativeBindingCandidates(options) {
|
|
|
120
116
|
const BINARY_NAMES = ["tailwind-styled-native", "tailwind_styled_parser"];
|
|
121
117
|
const napiPlatform = process.platform === "linux" && process.arch === "x64" ? "linux-x64-gnu" : process.platform === "linux" && process.arch === "arm64" ? "linux-arm64-gnu" : `${process.platform}-${process.arch}`;
|
|
122
118
|
for (const bin of BINARY_NAMES) {
|
|
123
|
-
candidates.push(
|
|
124
|
-
candidates.push(
|
|
125
|
-
candidates.push(
|
|
126
|
-
candidates.push(
|
|
127
|
-
candidates.push(
|
|
128
|
-
candidates.push(
|
|
129
|
-
candidates.push(
|
|
130
|
-
candidates.push(
|
|
131
|
-
candidates.push(
|
|
119
|
+
candidates.push(import_node_path.default.resolve(runtimeDir, `${bin}.node`));
|
|
120
|
+
candidates.push(import_node_path.default.resolve(runtimeDir, `${bin}.${napiPlatform}.node`));
|
|
121
|
+
candidates.push(import_node_path.default.resolve(runtimeDir, "..", "native", `${bin}.node`));
|
|
122
|
+
candidates.push(import_node_path.default.resolve(runtimeDir, "..", "native", `${bin}.${napiPlatform}.node`));
|
|
123
|
+
candidates.push(import_node_path.default.resolve(process.cwd(), "native", `${bin}.node`));
|
|
124
|
+
candidates.push(import_node_path.default.resolve(process.cwd(), "native", `${bin}.${napiPlatform}.node`));
|
|
125
|
+
candidates.push(import_node_path.default.resolve(runtimeDir, "..", "..", "..", "..", "native", `${bin}.node`));
|
|
126
|
+
candidates.push(import_node_path.default.resolve(runtimeDir, "..", "..", "..", "..", "native", `${bin}.${napiPlatform}.node`));
|
|
127
|
+
candidates.push(import_node_path.default.resolve(runtimeDir, "..", "..", "..", "native", `${bin}.node`));
|
|
132
128
|
}
|
|
133
129
|
return Array.from(new Set(candidates));
|
|
134
130
|
}
|
|
135
|
-
var TwError, _require;
|
|
131
|
+
var import_node_crypto, import_node_fs, import_node_path, import_node_url, import_node_module, import_meta, TwError, _require;
|
|
136
132
|
var init_src = __esm({
|
|
137
133
|
"packages/domain/shared/src/index.ts"() {
|
|
134
|
+
"use strict";
|
|
135
|
+
import_node_crypto = require("crypto");
|
|
136
|
+
import_node_fs = __toESM(require("fs"));
|
|
137
|
+
import_node_path = __toESM(require("path"));
|
|
138
|
+
import_node_url = require("url");
|
|
139
|
+
import_node_module = require("module");
|
|
140
|
+
import_meta = {};
|
|
138
141
|
TwError = class _TwError extends Error {
|
|
139
142
|
/** @deprecated Gunakan source */
|
|
140
143
|
domain;
|
|
@@ -187,7 +190,7 @@ var init_src = __esm({
|
|
|
187
190
|
return `[${this.source.toUpperCase()}:${this.code}] ${this.message}`;
|
|
188
191
|
}
|
|
189
192
|
};
|
|
190
|
-
_require =
|
|
193
|
+
_require = (0, import_node_module.createRequire)(import_meta.url);
|
|
191
194
|
}
|
|
192
195
|
});
|
|
193
196
|
|
|
@@ -224,8 +227,8 @@ function getDirname() {
|
|
|
224
227
|
if (typeof __dirname !== "undefined") {
|
|
225
228
|
return __dirname;
|
|
226
229
|
}
|
|
227
|
-
if (typeof
|
|
228
|
-
return
|
|
230
|
+
if (typeof import_meta2 !== "undefined" && import_meta2.url) {
|
|
231
|
+
return import_node_path2.default.dirname((0, import_node_url2.fileURLToPath)(import_meta2.url));
|
|
229
232
|
}
|
|
230
233
|
return process.cwd();
|
|
231
234
|
}
|
|
@@ -430,13 +433,17 @@ function hasNativeWatchBinding() {
|
|
|
430
433
|
return false;
|
|
431
434
|
}
|
|
432
435
|
}
|
|
433
|
-
var log, isValidScannerBinding, createScannerBridgeLoader, scannerBridgeLoader, scannerGetBinding, resetScannerBridgeCache;
|
|
436
|
+
var import_node_path2, import_node_url2, import_meta2, log, isValidScannerBinding, createScannerBridgeLoader, scannerBridgeLoader, scannerGetBinding, resetScannerBridgeCache;
|
|
434
437
|
var init_native_bridge = __esm({
|
|
435
438
|
"packages/domain/scanner/src/native-bridge.ts"() {
|
|
439
|
+
"use strict";
|
|
440
|
+
import_node_path2 = __toESM(require("path"), 1);
|
|
441
|
+
import_node_url2 = require("url");
|
|
436
442
|
init_src();
|
|
443
|
+
import_meta2 = {};
|
|
437
444
|
log = createDebugLogger("scanner:native");
|
|
438
|
-
isValidScannerBinding = (
|
|
439
|
-
const candidate =
|
|
445
|
+
isValidScannerBinding = (module2) => {
|
|
446
|
+
const candidate = module2;
|
|
440
447
|
return !!(candidate && (candidate.scanWorkspace || candidate.extractClassesFromSource || candidate.hashFileContent || candidate.cacheRead || candidate.cacheWrite));
|
|
441
448
|
};
|
|
442
449
|
createScannerBridgeLoader = () => {
|
|
@@ -514,18 +521,44 @@ var init_native_bridge = __esm({
|
|
|
514
521
|
}
|
|
515
522
|
});
|
|
516
523
|
|
|
524
|
+
// src/umbrella/scanner.ts
|
|
525
|
+
var scanner_exports = {};
|
|
526
|
+
__export(scanner_exports, {
|
|
527
|
+
DEFAULT_EXTENSIONS: () => DEFAULT_EXTENSIONS,
|
|
528
|
+
DEFAULT_IGNORES: () => DEFAULT_IGNORES,
|
|
529
|
+
batchExtractClassesNative: () => batchExtractClassesNative,
|
|
530
|
+
extractClassesNative: () => extractClassesNative,
|
|
531
|
+
isScannableFile: () => isScannableFile2,
|
|
532
|
+
parseScanWorkspaceOptions: () => parseScanWorkspaceOptions,
|
|
533
|
+
parseScanWorkspaceResult: () => parseScanWorkspaceResult,
|
|
534
|
+
parseScannerWorkerMessage: () => parseScannerWorkerMessage,
|
|
535
|
+
scanFile: () => scanFile,
|
|
536
|
+
scanSource: () => scanSource,
|
|
537
|
+
scanWorkspace: () => scanWorkspace,
|
|
538
|
+
scanWorkspaceAsync: () => scanWorkspaceAsync
|
|
539
|
+
});
|
|
540
|
+
module.exports = __toCommonJS(scanner_exports);
|
|
541
|
+
|
|
517
542
|
// packages/domain/scanner/src/index.ts
|
|
543
|
+
var import_node_fs3 = __toESM(require("fs"), 1);
|
|
544
|
+
var import_node_module2 = require("module");
|
|
545
|
+
var import_node_path5 = __toESM(require("path"), 1);
|
|
546
|
+
var import_node_url4 = require("url");
|
|
547
|
+
var import_node_worker_threads2 = require("worker_threads");
|
|
518
548
|
init_src();
|
|
519
549
|
|
|
520
550
|
// packages/domain/scanner/src/cache-native.ts
|
|
551
|
+
var import_node_fs2 = __toESM(require("fs"), 1);
|
|
552
|
+
var import_node_path3 = __toESM(require("path"), 1);
|
|
521
553
|
init_native_bridge();
|
|
522
554
|
function defaultCachePath(rootDir, cacheDir) {
|
|
523
|
-
const dir = cacheDir ?
|
|
524
|
-
return
|
|
555
|
+
const dir = cacheDir ? import_node_path3.default.resolve(rootDir, cacheDir) : import_node_path3.default.join(process.cwd(), ".cache", "tailwind-styled");
|
|
556
|
+
return import_node_path3.default.join(dir, "scanner-cache.json");
|
|
525
557
|
}
|
|
558
|
+
var STALE_THRESHOLD_MS = 7 * 24 * 60 * 60 * 1e3;
|
|
526
559
|
function readCache(rootDir, cacheDir) {
|
|
527
560
|
const cachePath = defaultCachePath(rootDir, cacheDir);
|
|
528
|
-
|
|
561
|
+
import_node_fs2.default.mkdirSync(import_node_path3.default.dirname(cachePath), { recursive: true });
|
|
529
562
|
const result = cacheReadNative(cachePath);
|
|
530
563
|
if (!result) return [];
|
|
531
564
|
return result.entries.map((e) => ({
|
|
@@ -540,7 +573,7 @@ function readCache(rootDir, cacheDir) {
|
|
|
540
573
|
}
|
|
541
574
|
function writeCache(rootDir, entries, cacheDir) {
|
|
542
575
|
const cachePath = defaultCachePath(rootDir, cacheDir);
|
|
543
|
-
|
|
576
|
+
import_node_fs2.default.mkdirSync(import_node_path3.default.dirname(cachePath), { recursive: true });
|
|
544
577
|
const success = cacheWriteNative(cachePath, entries);
|
|
545
578
|
if (!success) {
|
|
546
579
|
throw new Error(
|
|
@@ -562,7 +595,14 @@ function filePriority(mtimeMs, size, cached, nowMs = Date.now()) {
|
|
|
562
595
|
|
|
563
596
|
// packages/domain/scanner/src/index.ts
|
|
564
597
|
init_native_bridge();
|
|
598
|
+
|
|
599
|
+
// packages/domain/scanner/src/parallel-scanner.ts
|
|
600
|
+
var import_node_worker_threads = require("worker_threads");
|
|
601
|
+
var import_node_path4 = __toESM(require("path"), 1);
|
|
602
|
+
var import_node_os = require("os");
|
|
603
|
+
var import_node_url3 = require("url");
|
|
565
604
|
init_native_bridge();
|
|
605
|
+
var import_meta3 = {};
|
|
566
606
|
var PARALLEL_THRESHOLD = 50;
|
|
567
607
|
var DEFAULT_CHUNK_SIZE = 150;
|
|
568
608
|
function collectFiles(rootDir, extensions, ignoreDirs) {
|
|
@@ -580,24 +620,24 @@ function mergeResults(batchResults) {
|
|
|
580
620
|
if (native) return native;
|
|
581
621
|
throw new Error("FATAL: Native binding 'rebuildWorkspaceResult' is required but not available.");
|
|
582
622
|
}
|
|
583
|
-
if (!
|
|
584
|
-
const { filePaths } =
|
|
623
|
+
if (!import_node_worker_threads.isMainThread && import_node_worker_threads.parentPort) {
|
|
624
|
+
const { filePaths } = import_node_worker_threads.workerData;
|
|
585
625
|
try {
|
|
586
626
|
const results = batchExtractClassesNative(filePaths);
|
|
587
627
|
const msg = { ok: true, results };
|
|
588
|
-
|
|
628
|
+
import_node_worker_threads.parentPort.postMessage(msg);
|
|
589
629
|
} catch (error) {
|
|
590
630
|
const msg = {
|
|
591
631
|
ok: false,
|
|
592
632
|
error: error instanceof Error ? error.message : String(error)
|
|
593
633
|
};
|
|
594
|
-
|
|
634
|
+
import_node_worker_threads.parentPort.postMessage(msg);
|
|
595
635
|
}
|
|
596
636
|
}
|
|
597
|
-
var _workerFilename = typeof __filename !== "undefined" ? __filename :
|
|
637
|
+
var _workerFilename = typeof __filename !== "undefined" ? __filename : (0, import_node_url3.fileURLToPath)(import_meta3.url);
|
|
598
638
|
function runChunkInWorker(filePaths) {
|
|
599
639
|
return new Promise((resolve, reject) => {
|
|
600
|
-
const worker = new
|
|
640
|
+
const worker = new import_node_worker_threads.Worker(_workerFilename, {
|
|
601
641
|
workerData: { filePaths }
|
|
602
642
|
});
|
|
603
643
|
worker.once("message", (payload) => {
|
|
@@ -617,10 +657,10 @@ async function scanWorkspaceParallel(rootDir, options = {}) {
|
|
|
617
657
|
const {
|
|
618
658
|
extensions = DEFAULT_EXTENSIONS,
|
|
619
659
|
ignoreDirs = DEFAULT_IGNORES,
|
|
620
|
-
maxWorkers = Math.max(1,
|
|
660
|
+
maxWorkers = Math.max(1, (0, import_node_os.availableParallelism)() - 1),
|
|
621
661
|
chunkSize = DEFAULT_CHUNK_SIZE
|
|
622
662
|
} = options;
|
|
623
|
-
const files = collectFiles(
|
|
663
|
+
const files = collectFiles(import_node_path4.default.resolve(rootDir), extensions, ignoreDirs);
|
|
624
664
|
if (files.length < PARALLEL_THRESHOLD) {
|
|
625
665
|
return mergeResults(batchExtractClassesNative(files));
|
|
626
666
|
}
|
|
@@ -638,6 +678,7 @@ async function scanWorkspaceParallel(rootDir, options = {}) {
|
|
|
638
678
|
}
|
|
639
679
|
|
|
640
680
|
// packages/domain/scanner/src/schemas.ts
|
|
681
|
+
var import_zod = require("zod");
|
|
641
682
|
init_src();
|
|
642
683
|
var formatIssuePath2 = (path6) => path6.length > 0 ? path6.map(
|
|
643
684
|
(segment) => typeof segment === "symbol" ? segment.description ?? segment.toString() : String(segment)
|
|
@@ -657,40 +698,40 @@ var parseWithSchema = (schema, data, label) => {
|
|
|
657
698
|
parsed.error
|
|
658
699
|
);
|
|
659
700
|
};
|
|
660
|
-
var NonNegativeIntegerSchema =
|
|
661
|
-
var ScanWorkspaceOptionsSchema =
|
|
662
|
-
includeExtensions:
|
|
663
|
-
ignoreDirectories:
|
|
664
|
-
useCache:
|
|
665
|
-
cacheDir:
|
|
666
|
-
smartInvalidation:
|
|
701
|
+
var NonNegativeIntegerSchema = import_zod.z.number().int().min(0);
|
|
702
|
+
var ScanWorkspaceOptionsSchema = import_zod.z.object({
|
|
703
|
+
includeExtensions: import_zod.z.array(import_zod.z.string()).optional(),
|
|
704
|
+
ignoreDirectories: import_zod.z.array(import_zod.z.string()).optional(),
|
|
705
|
+
useCache: import_zod.z.boolean().optional(),
|
|
706
|
+
cacheDir: import_zod.z.string().min(1).optional(),
|
|
707
|
+
smartInvalidation: import_zod.z.boolean().optional()
|
|
667
708
|
});
|
|
668
|
-
var ScanFileResultSchema =
|
|
669
|
-
file:
|
|
670
|
-
classes:
|
|
671
|
-
hash:
|
|
709
|
+
var ScanFileResultSchema = import_zod.z.object({
|
|
710
|
+
file: import_zod.z.string(),
|
|
711
|
+
classes: import_zod.z.array(import_zod.z.string()),
|
|
712
|
+
hash: import_zod.z.string().optional()
|
|
672
713
|
});
|
|
673
|
-
var ScanWorkspaceResultSchema =
|
|
674
|
-
files:
|
|
714
|
+
var ScanWorkspaceResultSchema = import_zod.z.object({
|
|
715
|
+
files: import_zod.z.array(ScanFileResultSchema),
|
|
675
716
|
totalFiles: NonNegativeIntegerSchema,
|
|
676
|
-
uniqueClasses:
|
|
717
|
+
uniqueClasses: import_zod.z.array(import_zod.z.string())
|
|
677
718
|
}).refine((value) => value.totalFiles === value.files.length, {
|
|
678
719
|
message: "scan result totalFiles must match files.length",
|
|
679
720
|
path: ["totalFiles"]
|
|
680
721
|
});
|
|
681
|
-
|
|
682
|
-
rootDir:
|
|
722
|
+
var ScannerWorkerRequestSchema = import_zod.z.object({
|
|
723
|
+
rootDir: import_zod.z.string().min(1),
|
|
683
724
|
options: ScanWorkspaceOptionsSchema.optional()
|
|
684
725
|
});
|
|
685
|
-
var ScannerWorkerSuccessMessageSchema =
|
|
686
|
-
ok:
|
|
726
|
+
var ScannerWorkerSuccessMessageSchema = import_zod.z.object({
|
|
727
|
+
ok: import_zod.z.literal(true),
|
|
687
728
|
result: ScanWorkspaceResultSchema
|
|
688
729
|
});
|
|
689
|
-
var ScannerWorkerErrorMessageSchema =
|
|
690
|
-
ok:
|
|
691
|
-
error:
|
|
730
|
+
var ScannerWorkerErrorMessageSchema = import_zod.z.object({
|
|
731
|
+
ok: import_zod.z.literal(false),
|
|
732
|
+
error: import_zod.z.string().optional()
|
|
692
733
|
});
|
|
693
|
-
var ScannerWorkerMessageSchema =
|
|
734
|
+
var ScannerWorkerMessageSchema = import_zod.z.union([
|
|
694
735
|
ScannerWorkerSuccessMessageSchema,
|
|
695
736
|
ScannerWorkerErrorMessageSchema
|
|
696
737
|
]);
|
|
@@ -700,14 +741,15 @@ var parseScannerWorkerMessage = (message) => parseWithSchema(ScannerWorkerMessag
|
|
|
700
741
|
|
|
701
742
|
// packages/domain/scanner/src/index.ts
|
|
702
743
|
init_native_bridge();
|
|
744
|
+
var import_meta4 = {};
|
|
703
745
|
var log2 = createLogger("scanner");
|
|
704
746
|
var SCAN_WORKER_TIMEOUT_MS = 12e4;
|
|
705
747
|
function getRuntimeDir() {
|
|
706
748
|
if (typeof __dirname !== "undefined" && __dirname.length > 0) {
|
|
707
749
|
return __dirname;
|
|
708
750
|
}
|
|
709
|
-
if (typeof
|
|
710
|
-
return
|
|
751
|
+
if (typeof import_meta4 !== "undefined" && import_meta4.url) {
|
|
752
|
+
return import_node_path5.default.dirname((0, import_node_url4.fileURLToPath)(import_meta4.url));
|
|
711
753
|
}
|
|
712
754
|
return process.cwd();
|
|
713
755
|
}
|
|
@@ -722,7 +764,7 @@ var createNativeParserLoader = () => {
|
|
|
722
764
|
const loadNativeParserBinding = () => {
|
|
723
765
|
if (_state.binding !== void 0) return _state.binding;
|
|
724
766
|
const runtimeDir = getRuntimeDir();
|
|
725
|
-
const req =
|
|
767
|
+
const req = (0, import_node_module2.createRequire)(import_node_path5.default.join(runtimeDir, "noop.cjs"));
|
|
726
768
|
const _platform = process.platform;
|
|
727
769
|
const _arch = process.arch;
|
|
728
770
|
const _platformArch = `${_platform}-${_arch}`;
|
|
@@ -730,27 +772,27 @@ var createNativeParserLoader = () => {
|
|
|
730
772
|
const candidates = [
|
|
731
773
|
// ── binaryName baru: tailwind-styled-native (napi-rs naming) ──
|
|
732
774
|
// cwd = repo root saat run dari root, atau package dir saat workspaces
|
|
733
|
-
|
|
734
|
-
|
|
735
|
-
|
|
775
|
+
import_node_path5.default.resolve(process.cwd(), "native", "tailwind-styled-native.node"),
|
|
776
|
+
import_node_path5.default.resolve(process.cwd(), "native", `tailwind-styled-native.${_platformArch}.node`),
|
|
777
|
+
import_node_path5.default.resolve(process.cwd(), "native", `tailwind-styled-native.${_platformArchGnu}.node`),
|
|
736
778
|
// runtimeDir = dist/ → naik 1 level ke package root (npm install case)
|
|
737
779
|
// e.g. node_modules/tailwind-styled-v4/dist/ → node_modules/tailwind-styled-v4/native/
|
|
738
|
-
|
|
739
|
-
|
|
740
|
-
|
|
780
|
+
import_node_path5.default.resolve(runtimeDir, "..", "native", "tailwind-styled-native.node"),
|
|
781
|
+
import_node_path5.default.resolve(runtimeDir, "..", "native", `tailwind-styled-native.${_platformArch}.node`),
|
|
782
|
+
import_node_path5.default.resolve(runtimeDir, "..", "native", `tailwind-styled-native.${_platformArchGnu}.node`),
|
|
741
783
|
// runtimeDir = dist/ → naik 4 level ke repo root (monorepo dev case)
|
|
742
|
-
|
|
743
|
-
|
|
784
|
+
import_node_path5.default.resolve(runtimeDir, "..", "..", "..", "..", "native", "tailwind-styled-native.node"),
|
|
785
|
+
import_node_path5.default.resolve(runtimeDir, "..", "..", "..", "..", "native", `tailwind-styled-native.${_platformArchGnu}.node`),
|
|
744
786
|
// 3 level fallback (jika package di-nest lebih dangkal)
|
|
745
|
-
|
|
746
|
-
|
|
787
|
+
import_node_path5.default.resolve(runtimeDir, "..", "..", "..", "native", "tailwind-styled-native.node"),
|
|
788
|
+
import_node_path5.default.resolve(runtimeDir, "..", "..", "..", "native", `tailwind-styled-native.${_platformArchGnu}.node`),
|
|
747
789
|
// ── binaryName lama: tailwind_styled_parser (backward compat) ──
|
|
748
|
-
|
|
749
|
-
|
|
750
|
-
|
|
751
|
-
|
|
752
|
-
|
|
753
|
-
|
|
790
|
+
import_node_path5.default.resolve(process.cwd(), "native/tailwind_styled_parser.node"),
|
|
791
|
+
import_node_path5.default.resolve(process.cwd(), "native/build/Release/tailwind_styled_parser.node"),
|
|
792
|
+
import_node_path5.default.resolve(runtimeDir, "..", "native", "tailwind_styled_parser.node"),
|
|
793
|
+
import_node_path5.default.resolve(runtimeDir, "..", "..", "..", "..", "native", "tailwind_styled_parser.node"),
|
|
794
|
+
import_node_path5.default.resolve(runtimeDir, "..", "..", "..", "native", "tailwind_styled_parser.node"),
|
|
795
|
+
import_node_path5.default.resolve(
|
|
754
796
|
runtimeDir,
|
|
755
797
|
"..",
|
|
756
798
|
"..",
|
|
@@ -762,7 +804,7 @@ var createNativeParserLoader = () => {
|
|
|
762
804
|
)
|
|
763
805
|
];
|
|
764
806
|
for (const fullPath of candidates) {
|
|
765
|
-
if (!
|
|
807
|
+
if (!import_node_fs3.default.existsSync(fullPath)) continue;
|
|
766
808
|
try {
|
|
767
809
|
const required = req(fullPath);
|
|
768
810
|
if (required && (typeof required.extractClassesFromSource === "function" || typeof required.parseClasses === "function" || typeof required.parse_classes === "function")) {
|
|
@@ -797,18 +839,18 @@ function resolveScannerWorkerModulePath() {
|
|
|
797
839
|
if (typeof __dirname !== "undefined" && __dirname.length > 0) {
|
|
798
840
|
return __dirname;
|
|
799
841
|
}
|
|
800
|
-
if (typeof
|
|
801
|
-
return
|
|
842
|
+
if (typeof import_meta4 !== "undefined" && import_meta4.url) {
|
|
843
|
+
return import_node_path5.default.dirname((0, import_node_url4.fileURLToPath)(import_meta4.url));
|
|
802
844
|
}
|
|
803
845
|
return process.cwd();
|
|
804
846
|
})();
|
|
805
847
|
const candidates = [
|
|
806
|
-
|
|
807
|
-
|
|
808
|
-
|
|
848
|
+
import_node_path5.default.resolve(runtimeDir, "worker.cjs"),
|
|
849
|
+
import_node_path5.default.resolve(runtimeDir, "worker.js"),
|
|
850
|
+
import_node_path5.default.resolve(runtimeDir, "worker.ts")
|
|
809
851
|
];
|
|
810
852
|
for (const candidate of candidates) {
|
|
811
|
-
if (
|
|
853
|
+
if (import_node_fs3.default.existsSync(candidate)) return candidate;
|
|
812
854
|
}
|
|
813
855
|
return null;
|
|
814
856
|
}
|
|
@@ -820,7 +862,7 @@ function scanWorkspaceInWorker(rootDir, options) {
|
|
|
820
862
|
}
|
|
821
863
|
return new Promise((resolve, reject) => {
|
|
822
864
|
const settleState = { settled: false };
|
|
823
|
-
const worker = new
|
|
865
|
+
const worker = new import_node_worker_threads2.Worker(modulePath, { workerData: { rootDir, options: normalizedOptions } });
|
|
824
866
|
const timeout = setTimeout(() => {
|
|
825
867
|
if (!settleState.settled) {
|
|
826
868
|
settleState.settled = true;
|
|
@@ -865,19 +907,19 @@ function collectCandidates(rootDir, ignoreDirectories, extensionSet) {
|
|
|
865
907
|
if (!currentDir) continue;
|
|
866
908
|
const entries = (() => {
|
|
867
909
|
try {
|
|
868
|
-
return
|
|
910
|
+
return import_node_fs3.default.readdirSync(currentDir, { withFileTypes: true });
|
|
869
911
|
} catch {
|
|
870
912
|
return [];
|
|
871
913
|
}
|
|
872
914
|
})();
|
|
873
915
|
for (const entry of entries) {
|
|
874
|
-
const fullPath =
|
|
916
|
+
const fullPath = import_node_path5.default.join(currentDir, entry.name);
|
|
875
917
|
if (entry.isDirectory()) {
|
|
876
918
|
if (!ignoreDirectories.has(entry.name)) directories.push(fullPath);
|
|
877
919
|
continue;
|
|
878
920
|
}
|
|
879
921
|
if (!entry.isFile()) continue;
|
|
880
|
-
if (!extensionSet.has(
|
|
922
|
+
if (!extensionSet.has(import_node_path5.default.extname(entry.name))) continue;
|
|
881
923
|
candidates.push(fullPath);
|
|
882
924
|
}
|
|
883
925
|
}
|
|
@@ -904,7 +946,7 @@ function scanSource(source) {
|
|
|
904
946
|
);
|
|
905
947
|
}
|
|
906
948
|
function isScannableFile2(filePath, includeExtensions = DEFAULT_EXTENSIONS) {
|
|
907
|
-
return includeExtensions.includes(
|
|
949
|
+
return includeExtensions.includes(import_node_path5.default.extname(filePath));
|
|
908
950
|
}
|
|
909
951
|
function scanFile(filePath) {
|
|
910
952
|
const { scanFileNative: scanFileNative2 } = (init_native_bridge(), __toCommonJS(native_bridge_exports));
|
|
@@ -924,7 +966,7 @@ function scanWorkspace(rootDir, options = {}) {
|
|
|
924
966
|
const extensionSet = buildExtensionSet(includeExtensions);
|
|
925
967
|
const ignoreDirectories = new Set(normalizedOptions.ignoreDirectories ?? DEFAULT_IGNORES);
|
|
926
968
|
const useCache = normalizedOptions.useCache ?? true;
|
|
927
|
-
normalizedOptions.smartInvalidation ?? true;
|
|
969
|
+
const _smartInvalidation = normalizedOptions.smartInvalidation ?? true;
|
|
928
970
|
const files = [];
|
|
929
971
|
const unique = /* @__PURE__ */ new Set();
|
|
930
972
|
const candidates = collectCandidates(rootDir, ignoreDirectories, extensionSet);
|
|
@@ -964,7 +1006,7 @@ function scanWorkspace(rootDir, options = {}) {
|
|
|
964
1006
|
for (const filePath of candidates) {
|
|
965
1007
|
const stat = (() => {
|
|
966
1008
|
try {
|
|
967
|
-
return
|
|
1009
|
+
return import_node_fs3.default.statSync(filePath);
|
|
968
1010
|
} catch {
|
|
969
1011
|
return null;
|
|
970
1012
|
}
|
|
@@ -990,7 +1032,7 @@ function scanWorkspace(rootDir, options = {}) {
|
|
|
990
1032
|
for (const { filePath, stat, size, cached } of ranked) {
|
|
991
1033
|
const content = (() => {
|
|
992
1034
|
try {
|
|
993
|
-
return
|
|
1035
|
+
return import_node_fs3.default.readFileSync(filePath, "utf8");
|
|
994
1036
|
} catch {
|
|
995
1037
|
return null;
|
|
996
1038
|
}
|
|
@@ -1071,18 +1113,19 @@ async function scanWorkspaceAsync(rootDir, options = {}) {
|
|
|
1071
1113
|
return scanWorkspace(rootDir, normalizedOptions);
|
|
1072
1114
|
}
|
|
1073
1115
|
}
|
|
1074
|
-
|
|
1075
|
-
exports
|
|
1076
|
-
|
|
1077
|
-
|
|
1078
|
-
|
|
1079
|
-
|
|
1080
|
-
|
|
1081
|
-
|
|
1082
|
-
|
|
1083
|
-
|
|
1084
|
-
|
|
1085
|
-
|
|
1086
|
-
|
|
1087
|
-
|
|
1116
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
1117
|
+
0 && (module.exports = {
|
|
1118
|
+
DEFAULT_EXTENSIONS,
|
|
1119
|
+
DEFAULT_IGNORES,
|
|
1120
|
+
batchExtractClassesNative,
|
|
1121
|
+
extractClassesNative,
|
|
1122
|
+
isScannableFile,
|
|
1123
|
+
parseScanWorkspaceOptions,
|
|
1124
|
+
parseScanWorkspaceResult,
|
|
1125
|
+
parseScannerWorkerMessage,
|
|
1126
|
+
scanFile,
|
|
1127
|
+
scanSource,
|
|
1128
|
+
scanWorkspace,
|
|
1129
|
+
scanWorkspaceAsync
|
|
1130
|
+
});
|
|
1088
1131
|
//# sourceMappingURL=scanner.js.map
|