tailwind-styled-v4 5.0.9 → 5.0.10
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/CHANGELOG.md +15 -1
- package/dist/{analyzeWorkspace-DuJKh7Ty.d.mts → analyzeWorkspace-BS5O4rhC.d.mts} +47 -2
- package/dist/{analyzeWorkspace-Ct_NTAWt.d.ts → analyzeWorkspace-DDOQdzzI.d.ts} +47 -2
- package/dist/analyzer.d.mts +5 -3
- package/dist/analyzer.d.ts +5 -3
- package/dist/analyzer.js +563 -468
- package/dist/analyzer.js.map +1 -1
- package/dist/analyzer.mjs +562 -467
- package/dist/analyzer.mjs.map +1 -1
- package/dist/animate.d.mts +4 -7
- package/dist/animate.d.ts +4 -7
- package/dist/animate.js +171 -265
- package/dist/animate.js.map +1 -1
- package/dist/animate.mjs +165 -264
- package/dist/animate.mjs.map +1 -1
- package/dist/atomic.d.mts +22 -1
- package/dist/atomic.d.ts +22 -1
- package/dist/atomic.js +221 -165
- package/dist/atomic.js.map +1 -1
- package/dist/atomic.mjs +200 -165
- package/dist/atomic.mjs.map +1 -1
- package/dist/cli.d.mts +60 -1
- package/dist/cli.d.ts +60 -1
- package/dist/cli.js +1261 -1517
- package/dist/cli.js.map +1 -1
- package/dist/cli.mjs +1238 -1513
- package/dist/cli.mjs.map +1 -1
- package/dist/compiler.d.mts +38 -7
- package/dist/compiler.d.ts +38 -7
- package/dist/compiler.js +174 -197
- package/dist/compiler.js.map +1 -1
- package/dist/compiler.mjs +151 -194
- package/dist/compiler.mjs.map +1 -1
- package/dist/devtools.js +7 -31
- package/dist/devtools.js.map +1 -1
- package/dist/devtools.mjs +7 -31
- package/dist/devtools.mjs.map +1 -1
- package/dist/engine.d.mts +134 -63
- package/dist/engine.d.ts +134 -63
- package/dist/engine.js +2863 -2482
- package/dist/engine.js.map +1 -1
- package/dist/engine.mjs +2852 -2485
- package/dist/engine.mjs.map +1 -1
- package/dist/{index-eWAocnD2.d.mts → index-NDINUhLN.d.mts} +3 -1
- package/dist/{index-eWAocnD2.d.ts → index-NDINUhLN.d.ts} +3 -1
- package/dist/index.d.mts +45 -32
- package/dist/index.d.ts +45 -32
- package/dist/index.js +271 -158
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +251 -158
- package/dist/index.mjs.map +1 -1
- package/dist/{liveTokenEngine-DSUk88P6.d.ts → liveTokenEngine-CN9ian1R.d.ts} +1 -1
- package/dist/{liveTokenEngine-CX5_0c4q.d.mts → liveTokenEngine-DKoWRtqH.d.mts} +1 -1
- package/dist/next.js +20 -39
- package/dist/next.js.map +1 -1
- package/dist/next.mjs +18 -37
- package/dist/next.mjs.map +1 -1
- package/dist/plugin-api.d.mts +8 -2
- package/dist/plugin-api.d.ts +8 -2
- package/dist/plugin-api.js +14 -2
- package/dist/plugin-api.js.map +1 -1
- package/dist/plugin-api.mjs +14 -3
- package/dist/plugin-api.mjs.map +1 -1
- package/dist/plugin-registry.js +51 -11
- package/dist/plugin-registry.js.map +1 -1
- package/dist/plugin-registry.mjs +51 -11
- package/dist/plugin-registry.mjs.map +1 -1
- package/dist/plugin.d.mts +5 -7
- package/dist/plugin.d.ts +5 -7
- package/dist/plugin.js +16 -15
- package/dist/plugin.js.map +1 -1
- package/dist/plugin.mjs +16 -16
- package/dist/plugin.mjs.map +1 -1
- package/dist/rspack.js +17 -38
- package/dist/rspack.js.map +1 -1
- package/dist/rspack.mjs +15 -36
- package/dist/rspack.mjs.map +1 -1
- package/dist/runtime.d.mts +2 -2
- package/dist/runtime.d.ts +2 -2
- package/dist/scanner.d.mts +10 -1
- package/dist/scanner.d.ts +10 -1
- package/dist/scanner.js +298 -124
- package/dist/scanner.js.map +1 -1
- package/dist/scanner.mjs +296 -124
- package/dist/scanner.mjs.map +1 -1
- package/dist/shared.d.mts +1 -1
- package/dist/shared.d.ts +1 -1
- package/dist/shared.js +104 -176
- package/dist/shared.js.map +1 -1
- package/dist/shared.mjs +85 -176
- package/dist/shared.mjs.map +1 -1
- package/dist/storybook-addon.d.mts +1 -1
- package/dist/storybook-addon.d.ts +1 -1
- package/dist/svelte.d.mts +1 -1
- package/dist/svelte.d.ts +1 -1
- package/dist/svelte.js +166 -3
- package/dist/svelte.js.map +1 -1
- package/dist/svelte.mjs +143 -1
- package/dist/svelte.mjs.map +1 -1
- package/dist/syntax.js +21 -21
- package/dist/syntax.js.map +1 -1
- package/dist/syntax.mjs +21 -21
- package/dist/syntax.mjs.map +1 -1
- package/dist/testing.js +9 -1
- package/dist/testing.js.map +1 -1
- package/dist/testing.mjs +9 -1
- package/dist/testing.mjs.map +1 -1
- package/dist/theme.d.mts +2 -2
- package/dist/theme.d.ts +2 -2
- package/dist/theme.js +40 -112
- package/dist/theme.js.map +1 -1
- package/dist/theme.mjs +37 -110
- package/dist/theme.mjs.map +1 -1
- package/dist/turbopackLoader.js +79 -124
- package/dist/turbopackLoader.js.map +1 -1
- package/dist/turbopackLoader.mjs +63 -122
- package/dist/turbopackLoader.mjs.map +1 -1
- package/dist/tw.js +1256 -1517
- package/dist/tw.js.map +1 -1
- package/dist/tw.mjs +1236 -1513
- package/dist/tw.mjs.map +1 -1
- package/dist/vite.js +1783 -823
- package/dist/vite.js.map +1 -1
- package/dist/vite.mjs +1767 -821
- package/dist/vite.mjs.map +1 -1
- package/dist/vue.d.mts +1 -1
- package/dist/vue.d.ts +1 -1
- package/dist/vue.js +165 -4
- package/dist/vue.js.map +1 -1
- package/dist/vue.mjs +141 -1
- package/dist/vue.mjs.map +1 -1
- package/dist/webpackLoader.js +65 -108
- package/dist/webpackLoader.js.map +1 -1
- package/dist/webpackLoader.mjs +45 -104
- package/dist/webpackLoader.mjs.map +1 -1
- package/native/tailwind-styled-native.node +0 -0
- package/package.json +22 -24
package/dist/scanner.js
CHANGED
|
@@ -1,29 +1,25 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
require('crypto');
|
|
4
|
+
var fs3 = require('fs');
|
|
5
|
+
var path5 = require('path');
|
|
4
6
|
var url = require('url');
|
|
5
|
-
var fs = require('fs');
|
|
6
7
|
var module$1 = require('module');
|
|
7
8
|
var worker_threads = require('worker_threads');
|
|
9
|
+
var os = require('os');
|
|
8
10
|
var zod = require('zod');
|
|
9
11
|
|
|
10
12
|
var _documentCurrentScript = typeof document !== 'undefined' ? document.currentScript : null;
|
|
11
13
|
function _interopDefault (e) { return e && e.__esModule ? e : { default: e }; }
|
|
12
14
|
|
|
13
|
-
var
|
|
14
|
-
var
|
|
15
|
+
var fs3__default = /*#__PURE__*/_interopDefault(fs3);
|
|
16
|
+
var path5__default = /*#__PURE__*/_interopDefault(path5);
|
|
15
17
|
|
|
16
18
|
/* tailwind-styled-v4 v5.0.4 | MIT | https://github.com/dictionar32/tailwind-styled-v4 */
|
|
17
19
|
var __defProp = Object.defineProperty;
|
|
18
20
|
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
19
21
|
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
20
22
|
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
21
|
-
var __require = /* @__PURE__ */ ((x) => typeof require !== "undefined" ? require : typeof Proxy !== "undefined" ? new Proxy(x, {
|
|
22
|
-
get: (a, b) => (typeof require !== "undefined" ? require : a)[b]
|
|
23
|
-
}) : x)(function(x) {
|
|
24
|
-
if (typeof require !== "undefined") return require.apply(this, arguments);
|
|
25
|
-
throw Error('Dynamic require of "' + x + '" is not supported');
|
|
26
|
-
});
|
|
27
23
|
var __esm = (fn, res) => function __init() {
|
|
28
24
|
return fn && (res = (0, fn[__getOwnPropNames(fn)[0]])(fn = 0)), res;
|
|
29
25
|
};
|
|
@@ -40,34 +36,6 @@ var __copyProps = (to, from, except, desc) => {
|
|
|
40
36
|
return to;
|
|
41
37
|
};
|
|
42
38
|
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
43
|
-
|
|
44
|
-
// packages/domain/shared/src/index.ts
|
|
45
|
-
function getNodeModuleRef() {
|
|
46
|
-
if (isBrowser) return null;
|
|
47
|
-
if (nodeModuleRef !== null) return nodeModuleRef;
|
|
48
|
-
try {
|
|
49
|
-
const test = typeof __require === "function" ? __require("module") : null;
|
|
50
|
-
nodeModuleRef = test;
|
|
51
|
-
return test;
|
|
52
|
-
} catch {
|
|
53
|
-
nodeModuleRef = null;
|
|
54
|
-
return null;
|
|
55
|
-
}
|
|
56
|
-
}
|
|
57
|
-
function getNodeFs() {
|
|
58
|
-
if (isBrowser) throw new Error("node:fs not available in browser");
|
|
59
|
-
const nodeRequire = getNodeModuleRef();
|
|
60
|
-
if (!nodeRequire) throw new Error("require not available");
|
|
61
|
-
if (!_nodeFs) _nodeFs = nodeRequire.createRequire((typeof document === 'undefined' ? require('u' + 'rl').pathToFileURL(__filename).href : (_documentCurrentScript && _documentCurrentScript.tagName.toUpperCase() === 'SCRIPT' && _documentCurrentScript.src || new URL('scanner.js', document.baseURI).href)))("node:fs");
|
|
62
|
-
return _nodeFs;
|
|
63
|
-
}
|
|
64
|
-
function getNodePath() {
|
|
65
|
-
if (isBrowser) throw new Error("node:path not available in browser");
|
|
66
|
-
const nodeRequire = getNodeModuleRef();
|
|
67
|
-
if (!nodeRequire) throw new Error("require not available");
|
|
68
|
-
if (!_nodePath) _nodePath = nodeRequire.createRequire((typeof document === 'undefined' ? require('u' + 'rl').pathToFileURL(__filename).href : (_documentCurrentScript && _documentCurrentScript.tagName.toUpperCase() === 'SCRIPT' && _documentCurrentScript.src || new URL('scanner.js', document.baseURI).href)))("node:path");
|
|
69
|
-
return _nodePath;
|
|
70
|
-
}
|
|
71
39
|
function createLogger(namespace) {
|
|
72
40
|
const prefix = `[${namespace}]`;
|
|
73
41
|
return {
|
|
@@ -97,24 +65,19 @@ function createDebugLogger(namespace, label) {
|
|
|
97
65
|
}
|
|
98
66
|
};
|
|
99
67
|
}
|
|
100
|
-
function formatIssuePath(
|
|
101
|
-
if (!
|
|
102
|
-
return
|
|
68
|
+
function formatIssuePath(path6) {
|
|
69
|
+
if (!path6 || path6.length === 0) return "(root)";
|
|
70
|
+
return path6.map(
|
|
103
71
|
(segment) => typeof segment === "symbol" ? segment.description ?? segment.toString() : String(segment)
|
|
104
72
|
).join(".");
|
|
105
73
|
}
|
|
106
74
|
function loadNativeBinding(options) {
|
|
107
|
-
if (isBrowser) {
|
|
108
|
-
return { binding: null, loadErrors: [{ path: "", message: "Native bindings not available in browser" }] };
|
|
109
|
-
}
|
|
110
75
|
const { runtimeDir, candidates, isValid } = options;
|
|
111
76
|
const loadErrors = [];
|
|
112
|
-
const path4 = getNodePath();
|
|
113
|
-
const fs2 = getNodeFs();
|
|
114
77
|
for (const candidate of candidates) {
|
|
115
|
-
const candidatePath =
|
|
78
|
+
const candidatePath = path5__default.default.resolve(runtimeDir, candidate);
|
|
116
79
|
try {
|
|
117
|
-
if (!
|
|
80
|
+
if (!fs3__default.default.existsSync(candidatePath) && !fs3__default.default.existsSync(candidatePath + ".node")) {
|
|
118
81
|
continue;
|
|
119
82
|
}
|
|
120
83
|
const mod = requireNativeModule(candidatePath);
|
|
@@ -128,62 +91,48 @@ function loadNativeBinding(options) {
|
|
|
128
91
|
}
|
|
129
92
|
return { binding: null, loadErrors };
|
|
130
93
|
}
|
|
131
|
-
function
|
|
132
|
-
|
|
133
|
-
throw new Error("require not available in browser");
|
|
134
|
-
});
|
|
135
|
-
const nodeRequire = getNodeModuleRef();
|
|
136
|
-
if (!nodeRequire) return (() => {
|
|
137
|
-
throw new Error("require not available");
|
|
138
|
-
});
|
|
139
|
-
return nodeRequire.createRequire((typeof document === 'undefined' ? require('u' + 'rl').pathToFileURL(__filename).href : (_documentCurrentScript && _documentCurrentScript.tagName.toUpperCase() === 'SCRIPT' && _documentCurrentScript.src || new URL('scanner.js', document.baseURI).href)));
|
|
140
|
-
}
|
|
141
|
-
function requireNativeModule(path4) {
|
|
142
|
-
return _require(path4);
|
|
94
|
+
function requireNativeModule(p) {
|
|
95
|
+
return _require(p);
|
|
143
96
|
}
|
|
144
97
|
function resolveNativeBindingCandidates(options) {
|
|
145
|
-
|
|
146
|
-
|
|
98
|
+
const {
|
|
99
|
+
envVarNames = ["TW_NATIVE_PATH", "TWS_NATIVE_PATH"],
|
|
100
|
+
includeDefaultCandidates = true,
|
|
101
|
+
enforceNodeExtensionForEnvPath = false
|
|
102
|
+
} = options;
|
|
103
|
+
const runtimeDir = options.runtimeDir || process.cwd();
|
|
147
104
|
const candidates = [];
|
|
148
|
-
const path4 = getNodePath();
|
|
149
|
-
const fs2 = getNodeFs();
|
|
150
105
|
for (const envVar of envVarNames) {
|
|
151
106
|
const envPath = process.env[envVar];
|
|
152
107
|
if (envPath) {
|
|
153
|
-
|
|
154
|
-
candidates.push(envPath + ".node");
|
|
155
|
-
} else {
|
|
156
|
-
candidates.push(envPath);
|
|
157
|
-
}
|
|
108
|
+
candidates.push(enforceNodeExtensionForEnvPath && !envPath.endsWith(".node") ? envPath + ".node" : envPath);
|
|
158
109
|
}
|
|
159
110
|
}
|
|
160
111
|
if (!includeDefaultCandidates) return candidates;
|
|
161
|
-
if (
|
|
112
|
+
if (fs3__default.default.existsSync(runtimeDir)) {
|
|
162
113
|
try {
|
|
163
|
-
const
|
|
164
|
-
|
|
165
|
-
if (entry.endsWith(".node")) {
|
|
166
|
-
candidates.push(entry);
|
|
167
|
-
}
|
|
114
|
+
for (const entry of fs3__default.default.readdirSync(runtimeDir)) {
|
|
115
|
+
if (entry.endsWith(".node")) candidates.push(entry);
|
|
168
116
|
}
|
|
169
117
|
} catch {
|
|
170
118
|
}
|
|
171
119
|
}
|
|
172
|
-
const
|
|
173
|
-
const
|
|
174
|
-
const
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
120
|
+
const BINARY_NAMES = ["tailwind-styled-native", "tailwind_styled_parser"];
|
|
121
|
+
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
|
+
for (const bin of BINARY_NAMES) {
|
|
123
|
+
candidates.push(path5__default.default.resolve(runtimeDir, `${bin}.node`));
|
|
124
|
+
candidates.push(path5__default.default.resolve(runtimeDir, `${bin}.${napiPlatform}.node`));
|
|
125
|
+
candidates.push(path5__default.default.resolve(runtimeDir, "..", "..", "..", "..", "native", `${bin}.node`));
|
|
126
|
+
candidates.push(path5__default.default.resolve(runtimeDir, "..", "..", "..", "..", "native", `${bin}.${napiPlatform}.node`));
|
|
127
|
+
candidates.push(path5__default.default.resolve(runtimeDir, "..", "..", "..", "native", `${bin}.node`));
|
|
128
|
+
candidates.push(path5__default.default.resolve(process.cwd(), "native", `${bin}.node`));
|
|
129
|
+
candidates.push(path5__default.default.resolve(process.cwd(), "native", `${bin}.${napiPlatform}.node`));
|
|
130
|
+
}
|
|
178
131
|
return Array.from(new Set(candidates));
|
|
179
132
|
}
|
|
180
|
-
var
|
|
133
|
+
var TwError, _require;
|
|
181
134
|
var init_src = __esm({
|
|
182
135
|
"packages/domain/shared/src/index.ts"() {
|
|
183
|
-
isBrowser = typeof window !== "undefined" || typeof document !== "undefined";
|
|
184
|
-
nodeModuleRef = null;
|
|
185
|
-
_nodeFs = null;
|
|
186
|
-
_nodePath = null;
|
|
187
136
|
TwError = class _TwError extends Error {
|
|
188
137
|
/** @deprecated Gunakan source */
|
|
189
138
|
domain;
|
|
@@ -217,8 +166,8 @@ var init_src = __esm({
|
|
|
217
166
|
/** Buat TwError dari ZodError — dukung shape Zod v3 (`errors`) dan v4 (`issues`). */
|
|
218
167
|
static fromZod(err) {
|
|
219
168
|
const first = err.issues?.[0] ?? err.errors?.[0];
|
|
220
|
-
const
|
|
221
|
-
const message = first ? `${
|
|
169
|
+
const path6 = formatIssuePath(first?.path);
|
|
170
|
+
const message = first ? `${path6}: ${first.message}` : "Schema validation failed";
|
|
222
171
|
return new _TwError("validation", "SCHEMA_VALIDATION_FAILED", message, err);
|
|
223
172
|
}
|
|
224
173
|
static wrap(source, code, err) {
|
|
@@ -236,21 +185,33 @@ var init_src = __esm({
|
|
|
236
185
|
return `[${this.source.toUpperCase()}:${this.code}] ${this.message}`;
|
|
237
186
|
}
|
|
238
187
|
};
|
|
239
|
-
_require =
|
|
188
|
+
_require = module$1.createRequire((typeof document === 'undefined' ? require('u' + 'rl').pathToFileURL(__filename).href : (_documentCurrentScript && _documentCurrentScript.tagName.toUpperCase() === 'SCRIPT' && _documentCurrentScript.src || new URL('scanner.js', document.baseURI).href)));
|
|
240
189
|
}
|
|
241
190
|
});
|
|
242
191
|
|
|
243
192
|
// packages/domain/scanner/src/native-bridge.ts
|
|
244
193
|
var native_bridge_exports = {};
|
|
245
194
|
__export(native_bridge_exports, {
|
|
195
|
+
batchExtractClassesNative: () => batchExtractClassesNative,
|
|
246
196
|
cachePriorityNative: () => cachePriorityNative,
|
|
247
197
|
cacheReadNative: () => cacheReadNative,
|
|
248
198
|
cacheWriteNative: () => cacheWriteNative,
|
|
199
|
+
collectFilesNative: () => collectFilesNative,
|
|
200
|
+
computeCacheStatsNative: () => computeCacheStatsNative,
|
|
249
201
|
extractClassesNative: () => extractClassesNative,
|
|
202
|
+
generateSubComponentTypesNative: () => generateSubComponentTypesNative,
|
|
250
203
|
hasNativeScannerBinding: () => hasNativeScannerBinding,
|
|
251
204
|
hashContentNative: () => hashContentNative,
|
|
252
205
|
isRustCacheAvailable: () => isRustCacheAvailable,
|
|
206
|
+
pruneStaleEntriesNative: () => pruneStaleEntriesNative,
|
|
207
|
+
rebuildWorkspaceResultNative: () => rebuildWorkspaceResultNative,
|
|
253
208
|
resetScannerBridgeCache: () => resetScannerBridgeCache,
|
|
209
|
+
scanCacheGet: () => scanCacheGet,
|
|
210
|
+
scanCacheInvalidate: () => scanCacheInvalidate,
|
|
211
|
+
scanCachePut: () => scanCachePut,
|
|
212
|
+
scanCacheStats: () => scanCacheStats,
|
|
213
|
+
scanFileNative: () => scanFileNative,
|
|
214
|
+
scanFilesBatchNative: () => scanFilesBatchNative,
|
|
254
215
|
scanWorkspaceNative: () => scanWorkspaceNative
|
|
255
216
|
});
|
|
256
217
|
function getDirname() {
|
|
@@ -258,7 +219,7 @@ function getDirname() {
|
|
|
258
219
|
return __dirname;
|
|
259
220
|
}
|
|
260
221
|
if (typeof ({ url: (typeof document === 'undefined' ? require('u' + 'rl').pathToFileURL(__filename).href : (_documentCurrentScript && _documentCurrentScript.tagName.toUpperCase() === 'SCRIPT' && _documentCurrentScript.src || new URL('scanner.js', document.baseURI).href)) }) !== "undefined" && (typeof document === 'undefined' ? require('u' + 'rl').pathToFileURL(__filename).href : (_documentCurrentScript && _documentCurrentScript.tagName.toUpperCase() === 'SCRIPT' && _documentCurrentScript.src || new URL('scanner.js', document.baseURI).href))) {
|
|
261
|
-
return
|
|
222
|
+
return path5__default.default.dirname(url.fileURLToPath((typeof document === 'undefined' ? require('u' + 'rl').pathToFileURL(__filename).href : (_documentCurrentScript && _documentCurrentScript.tagName.toUpperCase() === 'SCRIPT' && _documentCurrentScript.src || new URL('scanner.js', document.baseURI).href))));
|
|
262
223
|
}
|
|
263
224
|
return process.cwd();
|
|
264
225
|
}
|
|
@@ -339,6 +300,95 @@ function cachePriorityNative(mtimeMs, size, cachedMtimeMs, cachedSize, cachedHit
|
|
|
339
300
|
}
|
|
340
301
|
return result;
|
|
341
302
|
}
|
|
303
|
+
function batchExtractClassesNative(filePaths) {
|
|
304
|
+
const binding = scannerGetBinding();
|
|
305
|
+
if (!binding.batchExtractClasses) {
|
|
306
|
+
throw new Error("FATAL: Native binding 'batchExtractClasses' is required but not available.");
|
|
307
|
+
}
|
|
308
|
+
return binding.batchExtractClasses(filePaths) ?? [];
|
|
309
|
+
}
|
|
310
|
+
function scanCacheGet(filePath, contentHash) {
|
|
311
|
+
const binding = scannerGetBinding();
|
|
312
|
+
if (!binding.scanCacheGet) {
|
|
313
|
+
throw new Error("FATAL: Native binding 'scanCacheGet' is required but not available.");
|
|
314
|
+
}
|
|
315
|
+
return binding.scanCacheGet(filePath, contentHash) ?? null;
|
|
316
|
+
}
|
|
317
|
+
function scanCachePut(filePath, contentHash, classes, mtimeMs, size) {
|
|
318
|
+
const binding = scannerGetBinding();
|
|
319
|
+
if (!binding.scanCachePut) {
|
|
320
|
+
throw new Error("FATAL: Native binding 'scanCachePut' is required but not available.");
|
|
321
|
+
}
|
|
322
|
+
binding.scanCachePut(filePath, contentHash, classes, mtimeMs, size);
|
|
323
|
+
}
|
|
324
|
+
function scanCacheInvalidate(filePath) {
|
|
325
|
+
const binding = scannerGetBinding();
|
|
326
|
+
if (!binding.scanCacheInvalidate) {
|
|
327
|
+
throw new Error("FATAL: Native binding 'scanCacheInvalidate' is required but not available.");
|
|
328
|
+
}
|
|
329
|
+
binding.scanCacheInvalidate(filePath);
|
|
330
|
+
}
|
|
331
|
+
function scanCacheStats() {
|
|
332
|
+
const binding = scannerGetBinding();
|
|
333
|
+
if (!binding.scanCacheStats) {
|
|
334
|
+
throw new Error("FATAL: Native binding 'scanCacheStats' is required but not available.");
|
|
335
|
+
}
|
|
336
|
+
return binding.scanCacheStats();
|
|
337
|
+
}
|
|
338
|
+
function scanFileNative(filePath) {
|
|
339
|
+
const binding = scannerGetBinding();
|
|
340
|
+
if (!binding.scanFile) {
|
|
341
|
+
throw new Error("FATAL: Native binding 'scanFile' is required but not available.");
|
|
342
|
+
}
|
|
343
|
+
return binding.scanFile(filePath);
|
|
344
|
+
}
|
|
345
|
+
function collectFilesNative(root, extensions, ignoreDirs) {
|
|
346
|
+
const binding = scannerGetBinding();
|
|
347
|
+
if (!binding.collectFiles) return null;
|
|
348
|
+
return binding.collectFiles(root, extensions, ignoreDirs);
|
|
349
|
+
}
|
|
350
|
+
function scanFilesBatchNative(filePaths) {
|
|
351
|
+
const binding = scannerGetBinding();
|
|
352
|
+
if (!binding.scanFilesBatch) {
|
|
353
|
+
return filePaths.map((fp) => {
|
|
354
|
+
try {
|
|
355
|
+
const r = binding.scanFile?.(fp);
|
|
356
|
+
return r ? { file: r.file, classes: r.classes, hash: r.hash ?? "" } : { file: fp, classes: [], hash: "" };
|
|
357
|
+
} catch {
|
|
358
|
+
return { file: fp, classes: [], hash: "" };
|
|
359
|
+
}
|
|
360
|
+
});
|
|
361
|
+
}
|
|
362
|
+
return binding.scanFilesBatch(filePaths);
|
|
363
|
+
}
|
|
364
|
+
function generateSubComponentTypesNative(root, outputPath) {
|
|
365
|
+
const binding = scannerGetBinding();
|
|
366
|
+
if (!binding.generateSubComponentTypes) return null;
|
|
367
|
+
return binding.generateSubComponentTypes(root, outputPath ?? null);
|
|
368
|
+
}
|
|
369
|
+
function pruneStaleEntriesNative(entries, maxAgeMs, checkExists) {
|
|
370
|
+
const binding = scannerGetBinding();
|
|
371
|
+
if (!binding.pruneStaleEntries) return null;
|
|
372
|
+
return binding.pruneStaleEntries(
|
|
373
|
+
entries.map((e) => ({ file: e.file, lastSeenMs: e.lastSeenMs ?? 0 })),
|
|
374
|
+
maxAgeMs ?? null,
|
|
375
|
+
checkExists ?? null
|
|
376
|
+
);
|
|
377
|
+
}
|
|
378
|
+
function rebuildWorkspaceResultNative(files) {
|
|
379
|
+
const binding = scannerBridgeLoader.get();
|
|
380
|
+
if (!binding?.rebuildWorkspaceResult) return null;
|
|
381
|
+
try {
|
|
382
|
+
return binding.rebuildWorkspaceResult(files);
|
|
383
|
+
} catch {
|
|
384
|
+
return null;
|
|
385
|
+
}
|
|
386
|
+
}
|
|
387
|
+
function computeCacheStatsNative(filesClasses, sizes, top) {
|
|
388
|
+
const binding = scannerGetBinding();
|
|
389
|
+
if (!binding.computeCacheStats) return null;
|
|
390
|
+
return binding.computeCacheStats(filesClasses, sizes, top ?? null);
|
|
391
|
+
}
|
|
342
392
|
var log, isValidScannerBinding, createScannerBridgeLoader, scannerBridgeLoader, scannerGetBinding, resetScannerBridgeCache;
|
|
343
393
|
var init_native_bridge = __esm({
|
|
344
394
|
"packages/domain/scanner/src/native-bridge.ts"() {
|
|
@@ -429,8 +479,8 @@ init_src();
|
|
|
429
479
|
// packages/domain/scanner/src/cache-native.ts
|
|
430
480
|
init_native_bridge();
|
|
431
481
|
function defaultCachePath(rootDir, cacheDir) {
|
|
432
|
-
const dir = cacheDir ?
|
|
433
|
-
return
|
|
482
|
+
const dir = cacheDir ? path5__default.default.resolve(rootDir, cacheDir) : path5__default.default.join(process.cwd(), ".cache", "tailwind-styled");
|
|
483
|
+
return path5__default.default.join(dir, "scanner-cache.json");
|
|
434
484
|
}
|
|
435
485
|
function readCache(rootDir, cacheDir) {
|
|
436
486
|
const cachePath = defaultCachePath(rootDir, cacheDir);
|
|
@@ -469,15 +519,110 @@ function filePriority(mtimeMs, size, cached, nowMs = Date.now()) {
|
|
|
469
519
|
|
|
470
520
|
// packages/domain/scanner/src/index.ts
|
|
471
521
|
init_native_bridge();
|
|
522
|
+
init_native_bridge();
|
|
523
|
+
var PARALLEL_THRESHOLD = 50;
|
|
524
|
+
var DEFAULT_CHUNK_SIZE = 150;
|
|
525
|
+
function collectFiles(rootDir, extensions, ignoreDirs) {
|
|
526
|
+
const native = collectFilesNative(rootDir, extensions, ignoreDirs);
|
|
527
|
+
if (native !== null) return native;
|
|
528
|
+
const files = [];
|
|
529
|
+
function walk(dir) {
|
|
530
|
+
let entries;
|
|
531
|
+
try {
|
|
532
|
+
entries = fs3__default.default.readdirSync(dir, { withFileTypes: true });
|
|
533
|
+
} catch {
|
|
534
|
+
return;
|
|
535
|
+
}
|
|
536
|
+
for (const entry of entries) {
|
|
537
|
+
const fullPath = path5__default.default.join(dir, entry.name);
|
|
538
|
+
const rel = path5__default.default.relative(rootDir, fullPath);
|
|
539
|
+
if (entry.isDirectory()) {
|
|
540
|
+
const ignored = ignoreDirs.some((d) => entry.name === d || rel.startsWith(d + path5__default.default.sep));
|
|
541
|
+
if (!ignored) walk(fullPath);
|
|
542
|
+
} else if (isScannableFile(entry.name, extensions)) {
|
|
543
|
+
files.push(fullPath);
|
|
544
|
+
}
|
|
545
|
+
}
|
|
546
|
+
}
|
|
547
|
+
walk(rootDir);
|
|
548
|
+
return files;
|
|
549
|
+
}
|
|
550
|
+
function mergeResults(batchResults) {
|
|
551
|
+
const files = batchResults.map((r) => ({
|
|
552
|
+
file: r.file,
|
|
553
|
+
classes: r.classes,
|
|
554
|
+
hash: r.content_hash
|
|
555
|
+
}));
|
|
556
|
+
const native = rebuildWorkspaceResultNative(files);
|
|
557
|
+
if (native) return native;
|
|
558
|
+
const unique = new Set(files.flatMap((f) => f.classes));
|
|
559
|
+
return { files, totalFiles: files.length, uniqueClasses: Array.from(unique).sort() };
|
|
560
|
+
}
|
|
561
|
+
if (!worker_threads.isMainThread && worker_threads.parentPort) {
|
|
562
|
+
const { filePaths } = worker_threads.workerData;
|
|
563
|
+
try {
|
|
564
|
+
const results = batchExtractClassesNative(filePaths);
|
|
565
|
+
const msg = { ok: true, results };
|
|
566
|
+
worker_threads.parentPort.postMessage(msg);
|
|
567
|
+
} catch (error) {
|
|
568
|
+
const msg = {
|
|
569
|
+
ok: false,
|
|
570
|
+
error: error instanceof Error ? error.message : String(error)
|
|
571
|
+
};
|
|
572
|
+
worker_threads.parentPort.postMessage(msg);
|
|
573
|
+
}
|
|
574
|
+
}
|
|
575
|
+
var _workerFilename = typeof __filename !== "undefined" ? __filename : url.fileURLToPath((typeof document === 'undefined' ? require('u' + 'rl').pathToFileURL(__filename).href : (_documentCurrentScript && _documentCurrentScript.tagName.toUpperCase() === 'SCRIPT' && _documentCurrentScript.src || new URL('scanner.js', document.baseURI).href)));
|
|
576
|
+
function runChunkInWorker(filePaths) {
|
|
577
|
+
return new Promise((resolve, reject) => {
|
|
578
|
+
const worker = new worker_threads.Worker(_workerFilename, {
|
|
579
|
+
workerData: { filePaths }
|
|
580
|
+
});
|
|
581
|
+
worker.once("message", (payload) => {
|
|
582
|
+
if (payload.ok) {
|
|
583
|
+
resolve(payload.results);
|
|
584
|
+
} else {
|
|
585
|
+
reject(new Error(payload.error ?? "parallel-scanner worker failed"));
|
|
586
|
+
}
|
|
587
|
+
});
|
|
588
|
+
worker.once("error", reject);
|
|
589
|
+
worker.once("exit", (code) => {
|
|
590
|
+
if (code !== 0) reject(new Error(`parallel-scanner worker exited with code ${code}`));
|
|
591
|
+
});
|
|
592
|
+
});
|
|
593
|
+
}
|
|
594
|
+
async function scanWorkspaceParallel(rootDir, options = {}) {
|
|
595
|
+
const {
|
|
596
|
+
extensions = DEFAULT_EXTENSIONS,
|
|
597
|
+
ignoreDirs = DEFAULT_IGNORES,
|
|
598
|
+
maxWorkers = Math.max(1, os.availableParallelism() - 1),
|
|
599
|
+
chunkSize = DEFAULT_CHUNK_SIZE
|
|
600
|
+
} = options;
|
|
601
|
+
const files = collectFiles(path5__default.default.resolve(rootDir), extensions, ignoreDirs);
|
|
602
|
+
if (files.length < PARALLEL_THRESHOLD) {
|
|
603
|
+
return mergeResults(batchExtractClassesNative(files));
|
|
604
|
+
}
|
|
605
|
+
const chunks = [];
|
|
606
|
+
for (let i = 0; i < files.length; i += chunkSize) {
|
|
607
|
+
chunks.push(files.slice(i, i + chunkSize));
|
|
608
|
+
}
|
|
609
|
+
const allResults = [];
|
|
610
|
+
for (let i = 0; i < chunks.length; i += maxWorkers) {
|
|
611
|
+
const batch = chunks.slice(i, i + maxWorkers);
|
|
612
|
+
const batchResults = await Promise.all(batch.map(runChunkInWorker));
|
|
613
|
+
allResults.push(...batchResults.flat());
|
|
614
|
+
}
|
|
615
|
+
return mergeResults(allResults);
|
|
616
|
+
}
|
|
472
617
|
|
|
473
618
|
// packages/domain/scanner/src/schemas.ts
|
|
474
619
|
init_src();
|
|
475
|
-
var formatIssuePath2 = (
|
|
620
|
+
var formatIssuePath2 = (path6) => path6.length > 0 ? path6.map(
|
|
476
621
|
(segment) => typeof segment === "symbol" ? segment.description ?? segment.toString() : String(segment)
|
|
477
622
|
).join(".") : "<root>";
|
|
478
623
|
var formatIssues = (error) => error.issues.map((issue) => {
|
|
479
|
-
const
|
|
480
|
-
return `${
|
|
624
|
+
const path6 = formatIssuePath2(issue.path);
|
|
625
|
+
return `${path6}: ${issue.message}`;
|
|
481
626
|
}).join("; ");
|
|
482
627
|
var parseWithSchema = (schema, data, label) => {
|
|
483
628
|
const parsed = schema.safeParse(data);
|
|
@@ -532,6 +677,7 @@ var parseScanWorkspaceResult = (result) => parseWithSchema(ScanWorkspaceResultSc
|
|
|
532
677
|
var parseScannerWorkerMessage = (message) => parseWithSchema(ScannerWorkerMessageSchema, message, "scanner worker message is invalid");
|
|
533
678
|
|
|
534
679
|
// packages/domain/scanner/src/index.ts
|
|
680
|
+
init_native_bridge();
|
|
535
681
|
var log2 = createLogger("scanner");
|
|
536
682
|
var SCAN_WORKER_TIMEOUT_MS = 12e4;
|
|
537
683
|
function getRuntimeDir() {
|
|
@@ -539,7 +685,7 @@ function getRuntimeDir() {
|
|
|
539
685
|
return __dirname;
|
|
540
686
|
}
|
|
541
687
|
if (typeof ({ url: (typeof document === 'undefined' ? require('u' + 'rl').pathToFileURL(__filename).href : (_documentCurrentScript && _documentCurrentScript.tagName.toUpperCase() === 'SCRIPT' && _documentCurrentScript.src || new URL('scanner.js', document.baseURI).href)) }) !== "undefined" && (typeof document === 'undefined' ? require('u' + 'rl').pathToFileURL(__filename).href : (_documentCurrentScript && _documentCurrentScript.tagName.toUpperCase() === 'SCRIPT' && _documentCurrentScript.src || new URL('scanner.js', document.baseURI).href))) {
|
|
542
|
-
return
|
|
688
|
+
return path5__default.default.dirname(url.fileURLToPath((typeof document === 'undefined' ? require('u' + 'rl').pathToFileURL(__filename).href : (_documentCurrentScript && _documentCurrentScript.tagName.toUpperCase() === 'SCRIPT' && _documentCurrentScript.src || new URL('scanner.js', document.baseURI).href))));
|
|
543
689
|
}
|
|
544
690
|
return process.cwd();
|
|
545
691
|
}
|
|
@@ -554,12 +700,25 @@ var createNativeParserLoader = () => {
|
|
|
554
700
|
const loadNativeParserBinding = () => {
|
|
555
701
|
if (_state.binding !== void 0) return _state.binding;
|
|
556
702
|
const runtimeDir = getRuntimeDir();
|
|
557
|
-
const req = module$1.createRequire(
|
|
703
|
+
const req = module$1.createRequire(path5__default.default.join(runtimeDir, "noop.cjs"));
|
|
558
704
|
const candidates = [
|
|
559
|
-
|
|
560
|
-
|
|
561
|
-
|
|
562
|
-
|
|
705
|
+
// ── binaryName baru: tailwind-styled-native (napi-rs naming) ──
|
|
706
|
+
// cwd = repo root saat run dari root, atau package dir saat workspaces
|
|
707
|
+
path5__default.default.resolve(process.cwd(), "native", "tailwind-styled-native.node"),
|
|
708
|
+
path5__default.default.resolve(process.cwd(), "native", `tailwind-styled-native.${process.platform}-${process.arch}.node`),
|
|
709
|
+
path5__default.default.resolve(process.cwd(), "native", `tailwind-styled-native.${process.platform}-${process.arch}-gnu.node`),
|
|
710
|
+
// runtimeDir = dist/ → naik 4 level ke repo root
|
|
711
|
+
path5__default.default.resolve(runtimeDir, "..", "..", "..", "..", "native", "tailwind-styled-native.node"),
|
|
712
|
+
path5__default.default.resolve(runtimeDir, "..", "..", "..", "..", "native", `tailwind-styled-native.${process.platform}-${process.arch}-gnu.node`),
|
|
713
|
+
// 3 level fallback (jika package di-nest lebih dangkal)
|
|
714
|
+
path5__default.default.resolve(runtimeDir, "..", "..", "..", "native", "tailwind-styled-native.node"),
|
|
715
|
+
path5__default.default.resolve(runtimeDir, "..", "..", "..", "native", `tailwind-styled-native.${process.platform}-${process.arch}-gnu.node`),
|
|
716
|
+
// ── binaryName lama: tailwind_styled_parser (backward compat) ──
|
|
717
|
+
path5__default.default.resolve(process.cwd(), "native/tailwind_styled_parser.node"),
|
|
718
|
+
path5__default.default.resolve(process.cwd(), "native/build/Release/tailwind_styled_parser.node"),
|
|
719
|
+
path5__default.default.resolve(runtimeDir, "..", "..", "..", "..", "native", "tailwind_styled_parser.node"),
|
|
720
|
+
path5__default.default.resolve(runtimeDir, "..", "..", "..", "native", "tailwind_styled_parser.node"),
|
|
721
|
+
path5__default.default.resolve(
|
|
563
722
|
runtimeDir,
|
|
564
723
|
"..",
|
|
565
724
|
"..",
|
|
@@ -571,7 +730,7 @@ var createNativeParserLoader = () => {
|
|
|
571
730
|
)
|
|
572
731
|
];
|
|
573
732
|
for (const fullPath of candidates) {
|
|
574
|
-
if (!
|
|
733
|
+
if (!fs3__default.default.existsSync(fullPath)) continue;
|
|
575
734
|
try {
|
|
576
735
|
const required = req(fullPath);
|
|
577
736
|
if (required && (typeof required.extractClassesFromSource === "function" || typeof required.parseClasses === "function" || typeof required.parse_classes === "function")) {
|
|
@@ -607,17 +766,17 @@ function resolveScannerWorkerModulePath() {
|
|
|
607
766
|
return __dirname;
|
|
608
767
|
}
|
|
609
768
|
if (typeof ({ url: (typeof document === 'undefined' ? require('u' + 'rl').pathToFileURL(__filename).href : (_documentCurrentScript && _documentCurrentScript.tagName.toUpperCase() === 'SCRIPT' && _documentCurrentScript.src || new URL('scanner.js', document.baseURI).href)) }) !== "undefined" && (typeof document === 'undefined' ? require('u' + 'rl').pathToFileURL(__filename).href : (_documentCurrentScript && _documentCurrentScript.tagName.toUpperCase() === 'SCRIPT' && _documentCurrentScript.src || new URL('scanner.js', document.baseURI).href))) {
|
|
610
|
-
return
|
|
769
|
+
return path5__default.default.dirname(url.fileURLToPath((typeof document === 'undefined' ? require('u' + 'rl').pathToFileURL(__filename).href : (_documentCurrentScript && _documentCurrentScript.tagName.toUpperCase() === 'SCRIPT' && _documentCurrentScript.src || new URL('scanner.js', document.baseURI).href))));
|
|
611
770
|
}
|
|
612
771
|
return process.cwd();
|
|
613
772
|
})();
|
|
614
773
|
const candidates = [
|
|
615
|
-
|
|
616
|
-
|
|
617
|
-
|
|
774
|
+
path5__default.default.resolve(runtimeDir, "worker.cjs"),
|
|
775
|
+
path5__default.default.resolve(runtimeDir, "worker.js"),
|
|
776
|
+
path5__default.default.resolve(runtimeDir, "worker.ts")
|
|
618
777
|
];
|
|
619
778
|
for (const candidate of candidates) {
|
|
620
|
-
if (
|
|
779
|
+
if (fs3__default.default.existsSync(candidate)) return candidate;
|
|
621
780
|
}
|
|
622
781
|
return null;
|
|
623
782
|
}
|
|
@@ -674,19 +833,19 @@ function collectCandidates(rootDir, ignoreDirectories, extensionSet) {
|
|
|
674
833
|
if (!currentDir) continue;
|
|
675
834
|
const entries = (() => {
|
|
676
835
|
try {
|
|
677
|
-
return
|
|
836
|
+
return fs3__default.default.readdirSync(currentDir, { withFileTypes: true });
|
|
678
837
|
} catch {
|
|
679
838
|
return [];
|
|
680
839
|
}
|
|
681
840
|
})();
|
|
682
841
|
for (const entry of entries) {
|
|
683
|
-
const fullPath =
|
|
842
|
+
const fullPath = path5__default.default.join(currentDir, entry.name);
|
|
684
843
|
if (entry.isDirectory()) {
|
|
685
844
|
if (!ignoreDirectories.has(entry.name)) directories.push(fullPath);
|
|
686
845
|
continue;
|
|
687
846
|
}
|
|
688
847
|
if (!entry.isFile()) continue;
|
|
689
|
-
if (!extensionSet.has(
|
|
848
|
+
if (!extensionSet.has(path5__default.default.extname(entry.name))) continue;
|
|
690
849
|
candidates.push(fullPath);
|
|
691
850
|
}
|
|
692
851
|
}
|
|
@@ -700,9 +859,12 @@ function toCacheSize(size) {
|
|
|
700
859
|
function scanSource(source) {
|
|
701
860
|
const nativeBinding = nativeParserLoader.get();
|
|
702
861
|
if (nativeBinding?.extractClassesFromSource) {
|
|
703
|
-
const
|
|
704
|
-
if (Array.isArray(
|
|
705
|
-
return Array.from(new Set(
|
|
862
|
+
const result = nativeBinding.extractClassesFromSource(source);
|
|
863
|
+
if (Array.isArray(result)) {
|
|
864
|
+
return Array.from(new Set(result.filter(Boolean)));
|
|
865
|
+
}
|
|
866
|
+
if (result !== null && result !== void 0 && Array.isArray(result.classes)) {
|
|
867
|
+
return Array.from(new Set(result.classes.filter(Boolean)));
|
|
706
868
|
}
|
|
707
869
|
}
|
|
708
870
|
throw new Error(
|
|
@@ -710,15 +872,18 @@ function scanSource(source) {
|
|
|
710
872
|
);
|
|
711
873
|
}
|
|
712
874
|
function isScannableFile(filePath, includeExtensions = DEFAULT_EXTENSIONS) {
|
|
713
|
-
return includeExtensions.includes(
|
|
875
|
+
return includeExtensions.includes(path5__default.default.extname(filePath));
|
|
714
876
|
}
|
|
715
877
|
function scanFile(filePath) {
|
|
716
|
-
const
|
|
717
|
-
const
|
|
878
|
+
const { scanFileNative: scanFileNative2 } = (init_native_bridge(), __toCommonJS(native_bridge_exports));
|
|
879
|
+
const result = scanFileNative2(filePath);
|
|
880
|
+
if (!result.ok) {
|
|
881
|
+
throw new Error(`scanFile failed for ${filePath}: ${result.error ?? "unknown error"}`);
|
|
882
|
+
}
|
|
718
883
|
return {
|
|
719
|
-
file:
|
|
720
|
-
classes:
|
|
721
|
-
...hash ? { hash } : {}
|
|
884
|
+
file: result.file,
|
|
885
|
+
classes: result.classes,
|
|
886
|
+
...result.hash ? { hash: result.hash } : {}
|
|
722
887
|
};
|
|
723
888
|
}
|
|
724
889
|
function scanWorkspace(rootDir, options = {}) {
|
|
@@ -767,7 +932,7 @@ function scanWorkspace(rootDir, options = {}) {
|
|
|
767
932
|
for (const filePath of candidates) {
|
|
768
933
|
const stat = (() => {
|
|
769
934
|
try {
|
|
770
|
-
return
|
|
935
|
+
return fs3__default.default.statSync(filePath);
|
|
771
936
|
} catch {
|
|
772
937
|
return null;
|
|
773
938
|
}
|
|
@@ -793,7 +958,7 @@ function scanWorkspace(rootDir, options = {}) {
|
|
|
793
958
|
for (const { filePath, stat, size, cached } of ranked) {
|
|
794
959
|
const content = (() => {
|
|
795
960
|
try {
|
|
796
|
-
return
|
|
961
|
+
return fs3__default.default.readFileSync(filePath, "utf8");
|
|
797
962
|
} catch {
|
|
798
963
|
return null;
|
|
799
964
|
}
|
|
@@ -855,14 +1020,21 @@ function scanWorkspace(rootDir, options = {}) {
|
|
|
855
1020
|
}
|
|
856
1021
|
async function scanWorkspaceAsync(rootDir, options = {}) {
|
|
857
1022
|
const normalizedOptions = parseScanWorkspaceOptions(options);
|
|
858
|
-
|
|
859
|
-
return
|
|
1023
|
+
try {
|
|
1024
|
+
return await scanWorkspaceParallel(rootDir, {
|
|
1025
|
+
extensions: normalizedOptions.includeExtensions,
|
|
1026
|
+
ignoreDirs: normalizedOptions.ignoreDirectories
|
|
1027
|
+
});
|
|
1028
|
+
} catch (parallelError) {
|
|
1029
|
+
log2.debug(
|
|
1030
|
+
`parallel scan failed, retrying with single worker: ${parallelError instanceof Error ? parallelError.message : String(parallelError)}`
|
|
1031
|
+
);
|
|
860
1032
|
}
|
|
861
1033
|
try {
|
|
862
1034
|
return await scanWorkspaceInWorker(rootDir, normalizedOptions);
|
|
863
1035
|
} catch (error) {
|
|
864
1036
|
log2.debug(
|
|
865
|
-
`worker scan failed,
|
|
1037
|
+
`worker scan failed, retrying with sync native scanner: ${error instanceof Error ? error.message : String(error)}`
|
|
866
1038
|
);
|
|
867
1039
|
return scanWorkspace(rootDir, normalizedOptions);
|
|
868
1040
|
}
|
|
@@ -870,6 +1042,8 @@ async function scanWorkspaceAsync(rootDir, options = {}) {
|
|
|
870
1042
|
|
|
871
1043
|
exports.DEFAULT_EXTENSIONS = DEFAULT_EXTENSIONS;
|
|
872
1044
|
exports.DEFAULT_IGNORES = DEFAULT_IGNORES;
|
|
1045
|
+
exports.batchExtractClassesNative = batchExtractClassesNative;
|
|
1046
|
+
exports.extractClassesNative = extractClassesNative;
|
|
873
1047
|
exports.isScannableFile = isScannableFile;
|
|
874
1048
|
exports.parseScanWorkspaceOptions = parseScanWorkspaceOptions;
|
|
875
1049
|
exports.parseScanWorkspaceResult = parseScanWorkspaceResult;
|