@hanzogui/static-worker 8.3.1 → 8.3.3

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.
@@ -0,0 +1,7 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.worker = exports.url = void 0;
4
+ const node_url_1 = require("node:url");
5
+ exports.url = (0, node_url_1.pathToFileURL)(__filename).href;
6
+ exports.worker = require.resolve('@hanzogui/static/worker');
7
+ //# sourceMappingURL=here.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"here.cjs.js","sourceRoot":"","sources":["../../src/here.cjs.ts"],"names":[],"mappings":";;;AAAA,uCAAwC;AAE3B,QAAA,GAAG,GAAG,IAAA,wBAAa,EAAC,UAAU,CAAC,CAAC,IAAI,CAAA;AAEpC,QAAA,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC,yBAAyB,CAAC,CAAA"}
@@ -0,0 +1,362 @@
1
+ "use strict";
2
+ /**
3
+ * @hanzogui/static-worker
4
+ *
5
+ * Pure worker-based API for Gui static extraction.
6
+ * All operations run in a worker thread for better performance and isolation.
7
+ *
8
+ * This package provides a clean async API that wraps @hanzogui/static's worker
9
+ * implementation without exposing any sync/legacy APIs.
10
+ */
11
+ Object.defineProperty(exports, "__esModule", { value: true });
12
+ exports.getPragmaOptions = exports.isExtractable = exports.installedPackageOf = exports.DEFAULT_EXTRACT_PACKAGES = void 0;
13
+ exports.loadGui = loadGui;
14
+ exports.loadGuiBuildConfig = loadGuiBuildConfig;
15
+ exports.extractToClassNames = extractToClassNames;
16
+ exports.extractToNative = extractToNative;
17
+ exports.watchGuiConfig = watchGuiConfig;
18
+ exports.clearWorkerCache = clearWorkerCache;
19
+ exports.destroyPool = destroyPool;
20
+ exports.getPoolStats = getPoolStats;
21
+ const tslib_1 = require("tslib");
22
+ const piscina_1 = tslib_1.__importDefault(require("piscina"));
23
+ const here_ts_1 = require("./here.js");
24
+ /**
25
+ * Which files the compiler may read styles out of. Pure path logic, so it is
26
+ * handed straight across rather than run in the worker: a bundler plugin needs
27
+ * the answer before it decides whether a round-trip is worth making, and the
28
+ * extractor needs the same answer for real.
29
+ *
30
+ * @hanzogui/static is CJS-only, and Node's lexer does not find named exports
31
+ * through esbuild's `__export` wrapper, so an ESM `export { x } from` of the
32
+ * subpath throws at load. The namespace always carries `default` —
33
+ * module.exports — in both of this package's builds, so read the names off it
34
+ * once, here, instead of teaching every caller the same trick.
35
+ */
36
+ const extractablePathModule = tslib_1.__importStar(require("@hanzogui/static/extractablePath"));
37
+ const extractablePath = extractablePathModule.default ?? extractablePathModule;
38
+ ({ DEFAULT_EXTRACT_PACKAGES: exports.DEFAULT_EXTRACT_PACKAGES, installedPackageOf: exports.installedPackageOf, isExtractable: exports.isExtractable } = extractablePath);
39
+ const getPragmaOptions = async (props) => {
40
+ const { default: Static } = await Promise.resolve().then(() => tslib_1.__importStar(require('@hanzogui/static')));
41
+ return Static.getPragmaOptions(props);
42
+ };
43
+ exports.getPragmaOptions = getPragmaOptions;
44
+ // The worker file, by this package's own resolution of it.
45
+ const getWorkerPath = () => here_ts_1.worker;
46
+ // Use globalThis to share pool across module instances (Vite environments)
47
+ const POOL_KEY = '__hanzogui_piscina_pool__';
48
+ const CLOSING_KEY = '__hanzogui_piscina_closing__';
49
+ const TASK_COUNT_KEY = '__hanzogui_piscina_task_count__';
50
+ const RECYCLING_KEY = '__hanzogui_piscina_recycling__';
51
+ // recycle worker after this many tasks to prevent RSS bloat from V8 memory fragmentation
52
+ // Node.js worker threads don't release memory properly - see https://github.com/nodejs/node/issues/51868
53
+ // set high enough that builds (typically 200-400 files) never trigger a recycle,
54
+ // but long-running dev servers still get memory relief eventually
55
+ const MAX_TASKS_BEFORE_RECYCLE = 1000;
56
+ function getSharedPool() {
57
+ return globalThis[POOL_KEY] ?? null;
58
+ }
59
+ function setSharedPool(pool) {
60
+ ;
61
+ globalThis[POOL_KEY] = pool;
62
+ }
63
+ function isClosing() {
64
+ return globalThis[CLOSING_KEY] === true;
65
+ }
66
+ function setClosing(value) {
67
+ ;
68
+ globalThis[CLOSING_KEY] = value;
69
+ }
70
+ function isRecycling() {
71
+ return globalThis[RECYCLING_KEY] === true;
72
+ }
73
+ function setRecycling(value) {
74
+ ;
75
+ globalThis[RECYCLING_KEY] = value;
76
+ }
77
+ function getTaskCount() {
78
+ return globalThis[TASK_COUNT_KEY] ?? 0;
79
+ }
80
+ function incrementTaskCount() {
81
+ const count = getTaskCount() + 1;
82
+ globalThis[TASK_COUNT_KEY] = count;
83
+ return count;
84
+ }
85
+ function resetTaskCount() {
86
+ ;
87
+ globalThis[TASK_COUNT_KEY] = 0;
88
+ }
89
+ /**
90
+ * Create a new Piscina pool instance
91
+ */
92
+ function createPool() {
93
+ const pool = new piscina_1.default({
94
+ filename: getWorkerPath(),
95
+ // each worker loads and caches config independently
96
+ minThreads: 2,
97
+ maxThreads: 2,
98
+ // Never terminate due to idle - worker stays alive until close() or process exit
99
+ // This prevents "Terminating worker thread" errors from Piscina during idle
100
+ idleTimeout: Number.POSITIVE_INFINITY,
101
+ // no resourceLimits - we rely on task-based recycling instead
102
+ // V8 resourceLimits cause "Terminating worker thread" messages when hit
103
+ });
104
+ // Handle error events to prevent uncaught exceptions during pool destruction
105
+ pool.on('error', (err) => {
106
+ if (isClosing() || isRecycling())
107
+ return;
108
+ const message = err && typeof err === 'object' && 'message' in err ? String(err.message) : '';
109
+ // Suppress termination errors (can still occur during explicit close/destroy)
110
+ if (message.includes('Terminating worker thread'))
111
+ return;
112
+ console.error('[hanzogui] Worker pool error:', err);
113
+ });
114
+ return pool;
115
+ }
116
+ /**
117
+ * Get or create the Piscina worker pool
118
+ */
119
+ function getPool() {
120
+ let pool = getSharedPool();
121
+ if (!pool) {
122
+ pool = createPool();
123
+ setSharedPool(pool);
124
+ }
125
+ return pool;
126
+ }
127
+ /**
128
+ * Load Gui configuration in worker
129
+ * Sends a warmup task to trigger config loading
130
+ * bundleConfig auto-detects if files exist and skips rebuild
131
+ */
132
+ async function loadGui(options) {
133
+ const pool = getPool();
134
+ // use extractToClassNames with a dummy request to trigger config loading
135
+ // the worker will cache the config for subsequent requests
136
+ const task = {
137
+ type: 'extractToClassNames',
138
+ source: '// dummy',
139
+ sourcePath: '__dummy__.tsx',
140
+ options: {
141
+ components: ['@hanzo/gui'],
142
+ ...options,
143
+ },
144
+ shouldPrintDebug: false,
145
+ };
146
+ try {
147
+ await pool.run(task, { name: 'runTask' });
148
+ return { success: true };
149
+ }
150
+ catch (error) {
151
+ console.error('[static-worker] Error loading Gui config:', error);
152
+ throw error;
153
+ }
154
+ }
155
+ /**
156
+ * Recycle the worker pool to release RSS memory
157
+ * Creates new pool, swaps immediately, then destroys old pool
158
+ * V8 doesn't return memory to OS, so we need to restart the worker periodically
159
+ */
160
+ async function recyclePool(options) {
161
+ if (isClosing() || isRecycling())
162
+ return;
163
+ const oldPool = getSharedPool();
164
+ if (!oldPool)
165
+ return;
166
+ setRecycling(true);
167
+ const start = Date.now();
168
+ try {
169
+ // suppress "Terminating worker thread" messages during recycle
170
+ const originalStderr = process.stderr.write.bind(process.stderr);
171
+ const originalStdout = process.stdout.write.bind(process.stdout);
172
+ const filter = (chunk, ...args) => {
173
+ const str = typeof chunk === 'string' ? chunk : chunk?.toString?.() || '';
174
+ if (str.includes('Terminating worker thread'))
175
+ return true;
176
+ return false;
177
+ };
178
+ process.stderr.write = ((chunk, ...args) => {
179
+ if (filter(chunk))
180
+ return true;
181
+ return originalStderr(chunk, ...args);
182
+ });
183
+ process.stdout.write = ((chunk, ...args) => {
184
+ if (filter(chunk))
185
+ return true;
186
+ return originalStdout(chunk, ...args);
187
+ });
188
+ // create new pool and swap immediately
189
+ const newPool = createPool();
190
+ setSharedPool(newPool);
191
+ // warm up new pool with config (this caches it in the new worker)
192
+ const warmupTask = {
193
+ type: 'extractToClassNames',
194
+ source: '// warmup',
195
+ sourcePath: '__warmup__.tsx',
196
+ options: {
197
+ ...options,
198
+ // skip the "built config" log on warmup since it's a recycle
199
+ _skipBuildLog: true,
200
+ },
201
+ shouldPrintDebug: false,
202
+ };
203
+ await newPool.run(warmupTask, { name: 'runTask' });
204
+ // destroy old pool - pending tasks will be rejected
205
+ oldPool.removeAllListeners();
206
+ oldPool.destroy().catch(() => { });
207
+ // restore stderr/stdout after a delay
208
+ setTimeout(() => {
209
+ process.stderr.write = originalStderr;
210
+ process.stdout.write = originalStdout;
211
+ });
212
+ console.log(` ♻️ [hanzogui] recycled worker pool (${Date.now() - start}ms)`);
213
+ }
214
+ finally {
215
+ setRecycling(false);
216
+ }
217
+ }
218
+ /**
219
+ * Load Gui build configuration asynchronously
220
+ * Uses esbuild-wasm to avoid EPIPE errors from native esbuild service lifecycle
221
+ */
222
+ async function loadGuiBuildConfig(hanzoguiOptions) {
223
+ const { default: Static } = await Promise.resolve().then(() => tslib_1.__importStar(require('@hanzogui/static')));
224
+ return Static.loadGuiBuildConfigAsync(hanzoguiOptions);
225
+ }
226
+ /**
227
+ * Extract Gui components to className-based CSS for web
228
+ */
229
+ async function extractToClassNames(params) {
230
+ const { source, sourcePath = '', options, shouldPrintDebug = false } = params;
231
+ if (typeof source !== 'string') {
232
+ throw new Error('`source` must be a string of javascript');
233
+ }
234
+ const task = {
235
+ type: 'extractToClassNames',
236
+ source,
237
+ sourcePath,
238
+ options,
239
+ shouldPrintDebug,
240
+ };
241
+ const pool = getPool();
242
+ const result = (await pool.run(task, { name: 'runTask' }));
243
+ if (!result.success) {
244
+ const errorMessage = [
245
+ `[hanzogui-extract] Error processing file: ${sourcePath || '(unknown)'}`,
246
+ ``,
247
+ result.error,
248
+ result.stack ? `\n${result.stack}` : '',
249
+ ]
250
+ .filter(Boolean)
251
+ .join('\n');
252
+ throw new Error(errorMessage);
253
+ }
254
+ // check if we need to recycle the worker to prevent RSS bloat
255
+ const count = incrementTaskCount();
256
+ if (count >= MAX_TASKS_BEFORE_RECYCLE) {
257
+ resetTaskCount();
258
+ // recycle asynchronously with hot-swap to not block current request
259
+ recyclePool(options).catch(() => { });
260
+ }
261
+ return result.data;
262
+ }
263
+ /**
264
+ * Extract Gui components to React Native StyleSheet format
265
+ */
266
+ async function extractToNative(sourceFileName, sourceCode, options) {
267
+ const task = {
268
+ type: 'extractToNative',
269
+ sourceFileName,
270
+ sourceCode,
271
+ options,
272
+ };
273
+ const pool = getPool();
274
+ const result = (await pool.run(task, { name: 'runTask' }));
275
+ if (!result.success) {
276
+ const errorMessage = [
277
+ `[hanzogui-extract] Error processing file: ${sourceFileName || '(unknown)'}`,
278
+ ``,
279
+ result.error,
280
+ result.stack ? `\n${result.stack}` : '',
281
+ ]
282
+ .filter(Boolean)
283
+ .join('\n');
284
+ throw new Error(errorMessage);
285
+ }
286
+ // check if we need to recycle the worker to prevent RSS bloat
287
+ const count = incrementTaskCount();
288
+ if (count >= MAX_TASKS_BEFORE_RECYCLE) {
289
+ resetTaskCount();
290
+ // recycle asynchronously with hot-swap to not block current request
291
+ recyclePool(options).catch(() => { });
292
+ }
293
+ return result.data;
294
+ }
295
+ /**
296
+ * Watch Gui config for changes and reload when it changes
297
+ */
298
+ async function watchGuiConfig(options) {
299
+ // For now, we'll use the static package's watcher directly
300
+ // This could be improved to use worker-based watching
301
+ const { default: Static } = await Promise.resolve().then(() => tslib_1.__importStar(require('@hanzogui/static')));
302
+ const watcher = await Static.watchGuiConfig(options);
303
+ if (!watcher) {
304
+ return;
305
+ }
306
+ // Wrap the dispose to also clear worker cache
307
+ const originalDispose = watcher.dispose;
308
+ return {
309
+ dispose: () => {
310
+ originalDispose();
311
+ if (getSharedPool()) {
312
+ // Fire and forget - errors are handled internally
313
+ clearWorkerCache();
314
+ }
315
+ },
316
+ };
317
+ }
318
+ /**
319
+ * Clear the worker's config cache
320
+ * Call this when config files change
321
+ */
322
+ async function clearWorkerCache() {
323
+ const pool = getSharedPool();
324
+ if (!pool || isClosing())
325
+ return;
326
+ const task = { type: 'clearCache' };
327
+ await pool.run(task, { name: 'runTask' });
328
+ }
329
+ /**
330
+ * Clean up the worker pool on exit
331
+ * Should be called when the build process completes
332
+ */
333
+ async function destroyPool() {
334
+ const pool = getSharedPool();
335
+ if (pool) {
336
+ setClosing(true);
337
+ try {
338
+ await pool.close();
339
+ }
340
+ finally {
341
+ setSharedPool(null);
342
+ setClosing(false);
343
+ }
344
+ }
345
+ }
346
+ /**
347
+ * Get pool statistics for debugging
348
+ */
349
+ function getPoolStats() {
350
+ const pool = getSharedPool();
351
+ if (!pool) {
352
+ return null;
353
+ }
354
+ return {
355
+ threads: pool.threads.length,
356
+ queueSize: pool.queueSize,
357
+ completed: pool.completed,
358
+ duration: pool.duration,
359
+ utilization: pool.utilization,
360
+ };
361
+ }
362
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":";AAAA;;;;;;;;GAQG;;;;;;;;;;;;AAGH,8DAA6B;AAC7B,uCAAkC;AAKlC;;;;;;;;;;;GAWG;AACH,MAAY,qBAAqB,qEAAwC;AAEzE,MAAM,eAAe,GAClB,qBAA6B,CAAC,OAAO,IAAI,qBAAqB,CAAA;AAEjE,CAAa,EAAE,wBAAwB,EAAxB,QAAA,wBAAwB,EAAE,kBAAkB,EAAlB,QAAA,kBAAkB,EAAE,aAAa,EAAb,QAAA,aAAa,EAAE,GAC1E,eAAe,EAAA;AAEV,MAAM,gBAAgB,GAAG,KAAK,EAAE,KAAuC,EAAE,EAAE;IAChF,MAAM,EAAE,OAAO,EAAE,MAAM,EAAE,GAAG,gEAAa,kBAAkB,GAAC,CAAA;IAC5D,OAAO,MAAM,CAAC,gBAAgB,CAAC,KAAK,CAAC,CAAA;AACvC,CAAC,CAAA;AAHY,QAAA,gBAAgB,GAAhB,gBAAgB,CAG5B;AAED,2DAA2D;AAC3D,MAAM,aAAa,GAAG,GAAG,EAAE,CAAC,gBAAM,CAAA;AAElC,2EAA2E;AAC3E,MAAM,QAAQ,GAAG,2BAA2B,CAAA;AAC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AAO,EAAE,IAAI,CAAC,OAAO,CAAC,MAAM;QAC5B,SAAS,EAAE,IAAI,CAAC,SAAS;QACzB,SAAS,EAAE,IAAI,CAAC,SAAS;QACzB,QAAQ,EAAE,IAAI,CAAC,QAAQ;QACvB,WAAW,EAAE,IAAI,CAAC,WAAW;KAC9B,CAAA;AACH,CAAC"}
@@ -0,0 +1 @@
1
+ { "type": "commonjs" }
@@ -0,0 +1,6 @@
1
+ import { fileURLToPath } from 'node:url';
2
+ // This module's own URL. A require made from it resolves from this package.
3
+ export const url = import.meta.url;
4
+ // The worker file of the same kind as this emit, so an ESM host runs the ESM worker.
5
+ export const worker = fileURLToPath(import.meta.resolve('@hanzogui/static/worker'));
6
+ //# sourceMappingURL=here.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"here.js","sourceRoot":"","sources":["../../src/here.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,UAAU,CAAA;AAExC,4EAA4E;AAC5E,MAAM,CAAC,MAAM,GAAG,GAAG,OAAO,IAAI,CAAC,GAAG,CAAA;AAElC,qFAAqF;AACrF,MAAM,CAAC,MAAM,MAAM,GAAG,aAAa,CAAC,OAAO,IAAI,CAAC,OAAO,CAAC,yBAAyB,CAAC,CAAC,CAAA"}