@tamagui/static 1.136.4 → 1.136.6

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/worker.js CHANGED
@@ -20,7 +20,11 @@ __export(worker_exports, {
20
20
  module.exports = __toCommonJS(worker_exports);
21
21
  var import_createExtractor = require("./extractor/createExtractor"), import_extractToClassNames = require("./extractor/extractToClassNames"), import_extractToNative = require("./extractor/extractToNative");
22
22
  const webExtractor = (0, import_createExtractor.createExtractor)({ platform: "web" }), nativeExtractor = (0, import_createExtractor.createExtractor)({ platform: "native" }), configCache = /* @__PURE__ */ new Map();
23
+ let hasLoggedPID = !1;
23
24
  async function runTask(task) {
25
+ hasLoggedPID || (console.info(
26
+ `[tamagui] \u{1F9F5} Worker thread PID: ${process.pid} (parent: ${process.ppid})`
27
+ ), hasLoggedPID = !0);
24
28
  try {
25
29
  if (task.type === "extractToClassNames") {
26
30
  if (!task.options.disableExtraction && !task.options._disableLoadTamagui) {
@@ -49,7 +53,7 @@ async function runTask(task) {
49
53
  task.options
50
54
  ) };
51
55
  }
52
- return task.type === "clearCache" ? (configCache.clear(), { success: !0, data: null }) : {
56
+ return task.type === "clearCache" ? (configCache.clear(), console.info("[tamagui] \u{1F504} Worker cache cleared (config changed)"), { success: !0, data: null }) : {
53
57
  success: !1,
54
58
  error: `Unknown task type: ${task.type}`
55
59
  };
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../src/worker.ts"],
4
- "mappings": ";;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAMA,6BAAgC,wCAKhC,6BAA+D,4CAC/D,yBAAuD;AAIvD,MAAM,mBAAe,wCAAgB,EAAE,UAAU,MAAM,CAAC,GAClD,sBAAkB,wCAAgB,EAAE,UAAU,SAAS,CAAC,GAGxD,cAAyC,oBAAI,IAAI;AAgCvD,eAAsB,QAAQ,MAAyC;AACrE,MAAI;AACF,QAAI,KAAK,SA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AAO,CAAC,GAGrE,MAAM,YAAY,IAAI,QAAQ,GAUvB,EAAE,SAAS,IAAM,UANT,uBAAAC;AAAA,QACb,KAAK;AAAA,QACL,KAAK;AAAA,QACL,KAAK;AAAA,MACP,EAEqC;AAAA,IACvC;AAEA,WAAI,KAAK,SAAS,gBAEhB,YAAY,MAAM,GAClB,QAAQ,KAAK,2DAAoD,GAC1D,EAAE,SAAS,IAAM,MAAM,KAAK,KAG9B;AAAA,MACL,SAAS;AAAA,MACT,OAAO,sBAAuB,KAAa,IAAI;AAAA,IACjD;AAAA,EACF,SAAS,OAAO;AACd,WAAO;AAAA,MACL,SAAS;AAAA,MACT,OAAO,iBAAiB,QAAQ,MAAM,UAAU,OAAO,KAAK;AAAA,MAC5D,OAAO,iBAAiB,QAAQ,MAAM,QAAQ;AAAA,IAChD;AAAA,EACF;AACF;AAMA,IAAO,iBAAQ;",
5
5
  "names": ["extractToClassNamesImpl", "extractToNativeImpl"]
6
6
  }
package/dist/worker.mjs CHANGED
@@ -34,7 +34,9 @@ const webExtractor = (0, import_createExtractor.createExtractor)({
34
34
  platform: "native"
35
35
  }),
36
36
  configCache = /* @__PURE__ */new Map();
37
+ let hasLoggedPID = !1;
37
38
  async function runTask(task) {
39
+ hasLoggedPID || (console.info(`[tamagui] \u{1F9F5} Worker thread PID: ${process.pid} (parent: ${process.ppid})`), hasLoggedPID = !0);
38
40
  try {
39
41
  if (task.type === "extractToClassNames") {
40
42
  if (!task.options.disableExtraction && !task.options._disableLoadTamagui) {
@@ -65,7 +67,7 @@ async function runTask(task) {
65
67
  data: (0, import_extractToNative.extractToNative)(task.sourceFileName, task.sourceCode, task.options)
66
68
  };
67
69
  }
68
- return task.type === "clearCache" ? (configCache.clear(), {
70
+ return task.type === "clearCache" ? (configCache.clear(), console.info("[tamagui] \u{1F504} Worker cache cleared (config changed)"), {
69
71
  success: !0,
70
72
  data: null
71
73
  }) : {
@@ -1 +1 @@
1
- {"version":3,"names":["worker_exports","__export","default","worker_default","runTask","module","exports","__toCommonJS","import_createExtractor","require","import_extractToClassNames","import_extractToNative","webExtractor","createExtractor","platform","nativeExtractor","configCache","Map","task","type","options","disableExtraction","_disableLoadTamagui","cacheKey","JSON","stringify","config","components","has","set","loadTamagui","get","success","data","extractToClassNames","extractor","source","sourcePath","shouldPrintDebug","extractToNative","sourceFileName","sourceCode","clear","error","Error","message","String","stack"],"sources":["../src/worker.ts"],"sourcesContent":[null],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA,IAAAA,cAAA;AAAAC,QAAA,CAAAD,cAAA;EAAAE,OAAA,EAAAA,CAAA,KAAAC,cAAA;EAAAC,OAAA,EAAAA,CAAA,KAAAA;AAAA;AAAAC,MAAA,CAAAC,OAAA,GAAAC,YAAA,CAAAP,cAAA;AAMA,IAAAQ,sBAAA,GAAgCC,OAAA;EAKhCC,0BAAA,GAA+DD,OAAA;EAC/DE,sBAAA,GAAuDF,OAAA;AAIvD,MAAMG,YAAA,OAAeJ,sBAAA,CAAAK,eAAA,EAAgB;IAAEC,QAAA,EAAU;EAAM,CAAC;EAClDC,eAAA,OAAkBP,sBAAA,CAAAK,eAAA,EAAgB;IAAEC,QAAA,EAAU;EAAS,CAAC;EAGxDE,WAAA,GAAyC,mBAAIC,GAAA,CAAI;AAgCvD,eAAsBb,QAAQc,IAAA,EAAyC;EACrE,IAAI;IACF,IAAIA,IAAA,CAAKC,IAAA,KAAS,uBAAuB;MAEvC,IAAI,CAACD,IAAA,CAAKE,OAAA,CAAQC,iBAAA,IAAqB,CAACH,IAAA,CAAKE,OAAA,CAAQE,mBAAA,EAAwB;QAC3E,MAAMC,QAAA,GAAWC,IAAA,CAAKC,SAAA,CAAU;UAC9BC,MAAA,EAAQR,IAAA,CAAKE,OAAA,CAAQM,MAAA;UACrBC,UAAA,EAAYT,IAAA,CAAKE,OAAA,CAAQO;QAC3B,CAAC;QAEIX,WAAA,CAAYY,GAAA,CAAIL,QAAQ,KAC3BP,WAAA,CAAYa,GAAA,CAAIN,QA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MACLX,OAAA,EAAS;MACTW,KAAA,EAAOA,KAAA,YAAiBC,KAAA,GAAQD,KAAA,CAAME,OAAA,GAAUC,MAAA,CAAOH,KAAK;MAC5DI,KAAA,EAAOJ,KAAA,YAAiBC,KAAA,GAAQD,KAAA,CAAMI,KAAA,GAAQ;IAChD;EACF;AACF;AAMA,IAAO5C,cAAA,GAAQC,OAAA","ignoreList":[]}
1
+ {"version":3,"names":["worker_exports","__export","default","worker_default","runTask","module","exports","__toCommonJS","import_createExtractor","require","import_extractToClassNames","import_extractToNative","webExtractor","createExtractor","platform","nativeExtractor","configCache","Map","hasLoggedPID","task","console","info","process","pid","ppid","type","options","disableExtraction","_disableLoadTamagui","cacheKey","JSON","stringify","config","components","has","set","loadTamagui","get","success","data","extractToClassNames","extractor","source","sourcePath","shouldPrintDebug","extractToNative","sourceFileName","sourceCode","clear","error","Error","message","String","stack"],"sources":["../src/worker.ts"],"sourcesContent":[null],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA,IAAAA,cAAA;AAAAC,QAAA,CAAAD,cAAA;EAAAE,OAAA,EAAAA,CAAA,KAAAC,cAAA;EAAAC,OAAA,EAAAA,CAAA,KAAAA;AAAA;AAAAC,MAAA,CAAAC,OAAA,GAAAC,YAAA,CAAAP,cAAA;AAMA,IAAAQ,sBAAA,GAAgCC,OAAA;EAKhCC,0BAAA,GAA+DD,OAAA;EAC/DE,sBAAA,GAAuDF,OAAA;AAIvD,MAAMG,YAAA,OAAeJ,sBAAA,CAAAK,eAAA,EAAgB;IAAEC,QAAA,EAAU;EAAM,CAAC;EAClDC,eAAA,OAAkBP,sBAAA,CAAAK,eAAA,EAAgB;IAAEC,QAAA,EAAU;EAAS,CAAC;EAGxDE,WAAA,GAAyC,mBAAIC,GAAA,CAAI;AA6BvD,IAAIC,YAAA,GAAe;AAMnB,eAAsBd,QAAQe,IAAA,EAAyC;EAChED,YAAA,KACHE,OAAA,CAAQC,IAAA,CACN,0CAAmCC,OAAA,CAAQC,GAAG,a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AAA,CAAKO,OAAO,CAAC,GAGrE,MAAMV,WAAA,CAAYqB,GAAA,CAAIR,QAAQ,GAUvB;QAAES,OAAA,EAAS;QAAMC,IAAA,MANT5B,sBAAA,CAAAkC,eAAA,EACb1B,IAAA,CAAK2B,cAAA,EACL3B,IAAA,CAAK4B,UAAA,EACL5B,IAAA,CAAKO,OACP;MAEqC;IACvC;IAEA,OAAIP,IAAA,CAAKM,IAAA,KAAS,gBAEhBT,WAAA,CAAYgC,KAAA,CAAM,GAClB5B,OAAA,CAAQC,IAAA,CAAK,2DAAoD,GAC1D;MAAEiB,OAAA,EAAS;MAAMC,IAAA,EAAM;IAAK,KAG9B;MACLD,OAAA,EAAS;MACTW,KAAA,EAAO,sBAAuB9B,IAAA,CAAaM,IAAI;IACjD;EACF,SAASwB,KAAA,EAAO;IACd,OAAO;MACLX,OAAA,EAAS;MACTW,KAAA,EAAOA,KAAA,YAAiBC,KAAA,GAAQD,KAAA,CAAME,OAAA,GAAUC,MAAA,CAAOH,KAAK;MAC5DI,KAAA,EAAOJ,KAAA,YAAiBC,KAAA,GAAQD,KAAA,CAAMI,KAAA,GAAQ;IAChD;EACF;AACF;AAMA,IAAOlD,cAAA,GAAQC,OAAA","ignoreList":[]}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tamagui/static",
3
- "version": "1.136.4",
3
+ "version": "1.136.6",
4
4
  "source": "src/index.ts",
5
5
  "types": "./types/index.d.ts",
6
6
  "type": "commonjs",
@@ -24,6 +24,11 @@
24
24
  "types": "./types/index.d.ts",
25
25
  "require": "./dist/index.js",
26
26
  "import": "./dist/index.js"
27
+ },
28
+ "./worker": {
29
+ "types": "./types/worker.d.ts",
30
+ "require": "./dist/worker.js",
31
+ "import": "./dist/worker.mjs"
27
32
  }
28
33
  },
29
34
  "tests": {
@@ -43,19 +48,19 @@
43
48
  "@babel/template": "^7.25.0",
44
49
  "@babel/traverse": "^7.25.4",
45
50
  "@babel/types": "^7.25.4",
46
- "@tamagui/cli-color": "1.136.4",
47
- "@tamagui/config-default": "1.136.4",
48
- "@tamagui/core": "1.136.4",
49
- "@tamagui/fake-react-native": "1.136.4",
50
- "@tamagui/generate-themes": "1.136.4",
51
- "@tamagui/helpers": "1.136.4",
52
- "@tamagui/helpers-node": "1.136.4",
53
- "@tamagui/proxy-worm": "1.136.4",
54
- "@tamagui/react-native-web-internals": "1.136.4",
55
- "@tamagui/react-native-web-lite": "1.136.4",
56
- "@tamagui/shorthands": "1.136.4",
57
- "@tamagui/types": "1.136.4",
58
- "@tamagui/web": "1.136.4",
51
+ "@tamagui/cli-color": "1.136.6",
52
+ "@tamagui/config-default": "1.136.6",
53
+ "@tamagui/core": "1.136.6",
54
+ "@tamagui/fake-react-native": "1.136.6",
55
+ "@tamagui/generate-themes": "1.136.6",
56
+ "@tamagui/helpers": "1.136.6",
57
+ "@tamagui/helpers-node": "1.136.6",
58
+ "@tamagui/proxy-worm": "1.136.6",
59
+ "@tamagui/react-native-web-internals": "1.136.6",
60
+ "@tamagui/react-native-web-lite": "1.136.6",
61
+ "@tamagui/shorthands": "1.136.6",
62
+ "@tamagui/types": "1.136.6",
63
+ "@tamagui/web": "1.136.6",
59
64
  "babel-literal-to-ast": "^2.1.0",
60
65
  "browserslist": "^4.22.2",
61
66
  "check-dependency-version-consistency": "^4.1.0",
@@ -72,7 +77,7 @@
72
77
  "devDependencies": {
73
78
  "@babel/plugin-syntax-typescript": "^7.25.4",
74
79
  "@expo/match-media": "^0.4.0",
75
- "@tamagui/build": "1.136.4",
80
+ "@tamagui/build": "1.136.6",
76
81
  "@types/babel__core": "^7.20.5",
77
82
  "@types/find-root": "^1.1.2",
78
83
  "@types/node": "^22.1.0",
package/src/worker.ts ADDED
@@ -0,0 +1,139 @@
1
+ /**
2
+ * Worker thread implementation for Tamagui extraction
3
+ * Used by both piscina (async) and synckit (sync for babel)
4
+ */
5
+
6
+ import type { BabelFileResult } from '@babel/core'
7
+ import { createExtractor } from './extractor/createExtractor'
8
+ import type {
9
+ ExtractedResponse,
10
+ ExtractToClassNamesProps,
11
+ } from './extractor/extractToClassNames'
12
+ import { extractToClassNames as extractToClassNamesImpl } from './extractor/extractToClassNames'
13
+ import { extractToNative as extractToNativeImpl } from './extractor/extractToNative'
14
+ import type { TamaguiOptions } from './types'
15
+
16
+ // Create extractors for web and native in worker
17
+ const webExtractor = createExtractor({ platform: 'web' })
18
+ const nativeExtractor = createExtractor({ platform: 'native' })
19
+
20
+ // Cache config loading to avoid reloading
21
+ const configCache: Map<string, Promise<any>> = new Map()
22
+
23
+ export interface ExtractToClassNamesTask {
24
+ type: 'extractToClassNames'
25
+ source: string
26
+ sourcePath: string
27
+ options: TamaguiOptions
28
+ shouldPrintDebug: boolean | 'verbose'
29
+ }
30
+
31
+ export interface ExtractToNativeTask {
32
+ type: 'extractToNative'
33
+ sourceFileName: string
34
+ sourceCode: string
35
+ options: TamaguiOptions
36
+ }
37
+
38
+ export interface ClearCacheTask {
39
+ type: 'clearCache'
40
+ }
41
+
42
+ export type WorkerTask = ExtractToClassNamesTask | ExtractToNativeTask | ClearCacheTask
43
+
44
+ export type WorkerResult =
45
+ | { success: true; data: ExtractedResponse | null }
46
+ | { success: true; data: BabelFileResult }
47
+ | { success: false; error: string; stack?: string }
48
+
49
+ // Log worker PID once
50
+ let hasLoggedPID = false
51
+
52
+ /**
53
+ * Main worker function that handles both extraction types
54
+ * This is called by piscina for async usage
55
+ */
56
+ export async function runTask(task: WorkerTask): Promise<WorkerResult> {
57
+ if (!hasLoggedPID) {
58
+ console.info(
59
+ `[tamagui] 🧵 Worker thread PID: ${process.pid} (parent: ${process.ppid})`
60
+ )
61
+ hasLoggedPID = true
62
+ }
63
+
64
+ try {
65
+ if (task.type === 'extractToClassNames') {
66
+ // Load web config if needed (with caching)
67
+ if (!task.options.disableExtraction && !task.options['_disableLoadTamagui']) {
68
+ const cacheKey = JSON.stringify({
69
+ config: task.options.config,
70
+ components: task.options.components,
71
+ })
72
+
73
+ if (!configCache.has(cacheKey)) {
74
+ configCache.set(cacheKey, webExtractor.loadTamagui(task.options))
75
+ }
76
+
77
+ await configCache.get(cacheKey)
78
+ }
79
+
80
+ const result = await extractToClassNamesImpl({
81
+ extractor: webExtractor,
82
+ source: task.source,
83
+ sourcePath: task.sourcePath,
84
+ options: task.options,
85
+ shouldPrintDebug: task.shouldPrintDebug,
86
+ })
87
+
88
+ return { success: true, data: result }
89
+ }
90
+
91
+ if (task.type === 'extractToNative') {
92
+ // Load native config if needed (with caching)
93
+ const cacheKey = JSON.stringify({
94
+ config: task.options.config,
95
+ components: task.options.components,
96
+ })
97
+
98
+ if (!configCache.has(cacheKey)) {
99
+ configCache.set(cacheKey, nativeExtractor.loadTamagui(task.options))
100
+ }
101
+
102
+ await configCache.get(cacheKey)
103
+
104
+ // extractToNative uses its own module-level extractor
105
+ // This is for babel plugin which uses visitor pattern
106
+ const result = extractToNativeImpl(
107
+ task.sourceFileName,
108
+ task.sourceCode,
109
+ task.options
110
+ )
111
+
112
+ return { success: true, data: result }
113
+ }
114
+
115
+ if (task.type === 'clearCache') {
116
+ // Clear config caches when files change
117
+ configCache.clear()
118
+ console.info(`[tamagui] 🔄 Worker cache cleared (config changed)`)
119
+ return { success: true, data: null }
120
+ }
121
+
122
+ return {
123
+ success: false,
124
+ error: `Unknown task type: ${(task as any).type}`,
125
+ }
126
+ } catch (error) {
127
+ return {
128
+ success: false,
129
+ error: error instanceof Error ? error.message : String(error),
130
+ stack: error instanceof Error ? error.stack : undefined,
131
+ }
132
+ }
133
+ }
134
+
135
+ /**
136
+ * For synckit compatibility - exports the runTask as default
137
+ * Synckit will call this function synchronously using worker threads
138
+ */
139
+ export default runTask
@@ -0,0 +1,46 @@
1
+ /**
2
+ * Worker thread implementation for Tamagui extraction
3
+ * Used by both piscina (async) and synckit (sync for babel)
4
+ */
5
+ import type { BabelFileResult } from '@babel/core';
6
+ import type { ExtractedResponse } from './extractor/extractToClassNames';
7
+ import type { TamaguiOptions } from './types';
8
+ export interface ExtractToClassNamesTask {
9
+ type: 'extractToClassNames';
10
+ source: string;
11
+ sourcePath: string;
12
+ options: TamaguiOptions;
13
+ shouldPrintDebug: boolean | 'verbose';
14
+ }
15
+ export interface ExtractToNativeTask {
16
+ type: 'extractToNative';
17
+ sourceFileName: string;
18
+ sourceCode: string;
19
+ options: TamaguiOptions;
20
+ }
21
+ export interface ClearCacheTask {
22
+ type: 'clearCache';
23
+ }
24
+ export type WorkerTask = ExtractToClassNamesTask | ExtractToNativeTask | ClearCacheTask;
25
+ export type WorkerResult = {
26
+ success: true;
27
+ data: ExtractedResponse | null;
28
+ } | {
29
+ success: true;
30
+ data: BabelFileResult;
31
+ } | {
32
+ success: false;
33
+ error: string;
34
+ stack?: string;
35
+ };
36
+ /**
37
+ * Main worker function that handles both extraction types
38
+ * This is called by piscina for async usage
39
+ */
40
+ export declare function runTask(task: WorkerTask): Promise<WorkerResult>;
41
+ /**
42
+ * For synckit compatibility - exports the runTask as default
43
+ * Synckit will call this function synchronously using worker threads
44
+ */
45
+ export default runTask;
46
+ //# sourceMappingURL=worker.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"worker.d.ts","sourceRoot":"","sources":["../src/worker.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,aAAa,CAAA;AAElD,OAAO,KAAK,EACV,iBAAiB,EAElB,MAAM,iCAAiC,CAAA;AAGxC,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,SAAS,CAAA;AAS7C,MAAM,WAAW,uBAAuB;IACtC,IAAI,EAAE,qBAAqB,CAAA;IAC3B,MAAM,EAAE,MAAM,CAAA;IACd,UAAU,EAAE,MAAM,CAAA;IAClB,OAAO,EAAE,cAAc,CAAA;IACvB,gBAAgB,EAAE,OAAO,GAAG,SAAS,CAAA;CACtC;AAED,MAAM,WAAW,mBAAmB;IAClC,IAAI,EAAE,iBAAiB,CAAA;IACvB,cAAc,EAAE,MAAM,CAAA;IAC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ED,MAAM,WAAW,cAAc;IAC7B,IAAI,EAAE,YAAY,CAAA;CACnB;AAED,MAAM,MAAM,UAAU,GAAG,uBAAuB,GAAG,mBAAmB,GAAG,cAAc,CAAA;AAEvF,MAAM,MAAM,YAAY,GACpB;IAAE,OAAO,EAAE,IAAI,CAAC;IAAC,IAAI,EAAE,iBAAiB,GAAG,IAAI,CAAA;CAAE,GACjD;IAAE,OAAO,EAAE,IAAI,CAAC;IAAC,IAAI,EAAE,eAAe,CAAA;CAAE,GACxC;IAAE,OAAO,EAAE,KAAK,CAAC;IAAC,KAAK,EAAE,MAAM,CAAC;IAAC,KAAK,CAAC,EAAE,MAAM,CAAA;CAAE,CAAA;AAKrD;;;GAGG;AACH,wBAAsB,OAAO,CAAC,IAAI,EAAE,UAAU,GAAG,OAAO,CAAC,YAAY,CAAC,CA6ErE;AAED;;;GAGG;AACH,eAAe,OAAO,CAAA"}
@@ -1,98 +0,0 @@
1
- var __create = Object.create;
2
- var __defProp = Object.defineProperty;
3
- var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
- var __getOwnPropNames = Object.getOwnPropertyNames;
5
- var __getProtoOf = Object.getPrototypeOf, __hasOwnProp = Object.prototype.hasOwnProperty;
6
- var __export = (target, all) => {
7
- for (var name in all)
8
- __defProp(target, name, { get: all[name], enumerable: !0 });
9
- }, __copyProps = (to, from, except, desc) => {
10
- if (from && typeof from == "object" || typeof from == "function")
11
- for (let key of __getOwnPropNames(from))
12
- !__hasOwnProp.call(to, key) && key !== except && __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
13
- return to;
14
- };
15
- var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
16
- // If the importer is in node compatibility mode or this is not an ESM
17
- // file that has been converted to a CommonJS file using a Babel-
18
- // compatible transform (i.e. "__esModule" has not been set), then set
19
- // "default" to the CommonJS "module.exports" for node compatibility.
20
- isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: !0 }) : target,
21
- mod
22
- )), __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: !0 }), mod);
23
- var async_wrapper_exports = {};
24
- __export(async_wrapper_exports, {
25
- clearWorkerCache: () => clearWorkerCache,
26
- destroyPool: () => destroyPool,
27
- extractToClassNames: () => extractToClassNames,
28
- extractToNative: () => extractToNative,
29
- getPoolStats: () => getPoolStats
30
- });
31
- module.exports = __toCommonJS(async_wrapper_exports);
32
- var import_piscina = __toESM(require("piscina")), import_node_url = require("node:url"), import_node_path = require("node:path");
33
- const import_meta = {}, getWorkerPath = () => typeof __filename < "u" ? (0, import_node_path.resolve)(__dirname, "worker.js") : typeof import_meta < "u" && import_meta.url ? (0, import_node_path.resolve)((0, import_node_path.dirname)((0, import_node_url.fileURLToPath)(import_meta.url)), "worker.js") : (0, import_node_path.resolve)(__dirname, "worker.js");
34
- let piscinaPool = null;
35
- function getPool() {
36
- return piscinaPool || (piscinaPool = new import_piscina.default({
37
- filename: getWorkerPath(),
38
- // Single worker for state consistency and simpler caching
39
- minThreads: 1,
40
- maxThreads: 1,
41
- idleTimeout: 6e4
42
- // 60s - keep alive for config watching
43
- })), piscinaPool;
44
- }
45
- async function extractToClassNames({
46
- source,
47
- sourcePath = "",
48
- options,
49
- shouldPrintDebug = !1
50
- }) {
51
- if (typeof source != "string")
52
- throw new Error("`source` must be a string of javascript");
53
- const task = {
54
- type: "extractToClassNames",
55
- source,
56
- sourcePath,
57
- options,
58
- shouldPrintDebug
59
- }, result = await getPool().run(task, { name: "runTask" });
60
- if (!result.success)
61
- throw new Error(
62
- `Worker error: ${result.error}${result.stack ? `
63
- ${result.stack}` : ""}`
64
- );
65
- return result.data;
66
- }
67
- async function extractToNative(sourceFileName, sourceCode, options) {
68
- const task = {
69
- type: "extractToNative",
70
- sourceFileName,
71
- sourceCode,
72
- options
73
- }, result = await getPool().run(task, { name: "runTask" });
74
- if (!result.success)
75
- throw new Error(
76
- `Worker error: ${result.error}${result.stack ? `
77
- ${result.stack}` : ""}`
78
- );
79
- return result.data;
80
- }
81
- async function clearWorkerCache() {
82
- if (!piscinaPool) return;
83
- const task = { type: "clearCache" };
84
- await piscinaPool.run(task, { name: "runTask" });
85
- }
86
- async function destroyPool() {
87
- piscinaPool && (await piscinaPool.destroy(), piscinaPool = null);
88
- }
89
- function getPoolStats() {
90
- return piscinaPool ? {
91
- threads: piscinaPool.threads.length,
92
- queueSize: piscinaPool.queueSize,
93
- completed: piscinaPool.completed,
94
- duration: piscinaPool.duration,
95
- utilization: piscinaPool.utilization
96
- } : null;
97
- }
98
- //# sourceMappingURL=async-wrapper.js.map
@@ -1,6 +0,0 @@
1
- {
2
- "version": 3,
3
- "sources": ["../src/async-wrapper.ts"],
4
- "mappings": ";;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAKA,qBAAoB,6BACpB,kBAA8B,qBAC9B,mBAAiC;AAPjC,wBAcM,gBAAgB,MAEhB,OAAO,aAAe,UACjB,0BAAQ,WAAW,WAAW,IAGnC,OAAO,cAAgB,OAAe,YAAY,UAC7C,8BAAQ,8BAAQ,+BAAc,YAAY,GAAG,CAAC,GAAG,WAAW,QAG9D,0BAAQ,WAAW,WAAW;AAGvC,IAAI,cAA8B;AAKlC,SAAS,UAAmB;AAC1B,SAAK,gBACH,cAAc,IAAI,eAAAA,QAAQ;AAAA,IACxB,UAAU,cAAc;AAAA;AAAA,IAExB,YAAY;AAAA,IACZ,YAAY;AAAA,IACZ,aAAa;AAAA;AAAA,EACf,CAAC,IAEI;AACT;AAMA,eAAsB,oBAAoB;AAAA,EACxC;AAAA,EACA,aAAa;AAAA,EACb;AAAA,EACA,mBAAmB;AACrB,GAKsC;AACpC,MAAI,OAAO,UAAW;AACpB,UAAM,IAAI,MAAM,yCAAyC;AAG3D,QAAM,OAAmB;AAAA,IACvB,MAAM;AAAA,IACN;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,EACF,GAGM,SAAU,MADH,QAAQ,EACM,IAAI,MAAM,EAAE,MAAM,UAAU,CAAC;AAExD,MAAI,CAAC,OAAO;AACV,UAAM,IAAI;AAAA,MACR,iBAAiB,OAAO,KAAK,GAAG,OAAO,QAAQ;AAAA,EAAK,OAAO,KAAK,KAAK,EAAE;AAAA,IACzE;AAGF,SAAO,OAAO;AAChB;AAMA,eAAsB,gBACpB,gBACA,YACA,SAC0B;AAC1B,QAAM,OAAmB;AAAA,IACvB,MAAM;AAAA,IACN;AAAA,IACA;AAAA,IACA;AAAA,EACF,GAGM,SAAU,MADH,QAAQ,EACM,IAAI,MAAM,EAAE,MAAM,UAAU,CAAC;AAExD,MAAI,CAAC,OAAO;AACV,UAAM,IAAI;AAAA,MACR,iBAAiB,OAAO,KAAK,GAAG,OAAO,QAAQ;AAAA,EAAK,OAAO,KAAK,KAAK,EAAE;AAAA,IACzE;AAGF,SAAO,OAAO;AAChB;AAMA,eAAsB,mBAAkC;AACtD,MAAI,CAAC,YAAa;AAElB,QAAM,OAAmB,EAAE,MAAM,aAAa;AAC9C,QAAM,YAAY,IAAI,MAAM,EAAE,MAAM,UAAU,CAAC;AACjD;AAMA,eAAsB,cAA6B;AACjD,EAAI,gBACF,MAAM,YAAY,QAAQ,GAC1B,cAAc;AAElB;AAKO,SAAS,eAAe;AAC7B,SAAK,cAGE;AAAA,IACL,SAAS,YAAY,QAAQ;AAAA,IAC7B,WAAW,YAAY;AAAA,IACvB,WAAW,YAAY;AAAA,IACvB,UAAU,YAAY;AAAA,IACtB,aAAa,YAAY;AAAA,EAC3B,IARS;AASX;",
5
- "names": ["Piscina"]
6
- }
@@ -1,113 +0,0 @@
1
- var __create = Object.create;
2
- var __defProp = Object.defineProperty;
3
- var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
- var __getOwnPropNames = Object.getOwnPropertyNames;
5
- var __getProtoOf = Object.getPrototypeOf,
6
- __hasOwnProp = Object.prototype.hasOwnProperty;
7
- var __export = (target, all) => {
8
- for (var name in all) __defProp(target, name, {
9
- get: all[name],
10
- enumerable: !0
11
- });
12
- },
13
- __copyProps = (to, from, except, desc) => {
14
- if (from && typeof from == "object" || typeof from == "function") for (let key of __getOwnPropNames(from)) !__hasOwnProp.call(to, key) && key !== except && __defProp(to, key, {
15
- get: () => from[key],
16
- enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
17
- });
18
- return to;
19
- };
20
- var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
21
- // If the importer is in node compatibility mode or this is not an ESM
22
- // file that has been converted to a CommonJS file using a Babel-
23
- // compatible transform (i.e. "__esModule" has not been set), then set
24
- // "default" to the CommonJS "module.exports" for node compatibility.
25
- isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", {
26
- value: mod,
27
- enumerable: !0
28
- }) : target, mod)),
29
- __toCommonJS = mod => __copyProps(__defProp({}, "__esModule", {
30
- value: !0
31
- }), mod);
32
- var async_wrapper_exports = {};
33
- __export(async_wrapper_exports, {
34
- clearWorkerCache: () => clearWorkerCache,
35
- destroyPool: () => destroyPool,
36
- extractToClassNames: () => extractToClassNames,
37
- extractToNative: () => extractToNative,
38
- getPoolStats: () => getPoolStats
39
- });
40
- module.exports = __toCommonJS(async_wrapper_exports);
41
- var import_piscina = __toESM(require("piscina")),
42
- import_node_url = require("node:url"),
43
- import_node_path = require("node:path");
44
- const import_meta = {},
45
- getWorkerPath = () => typeof __filename < "u" ? (0, import_node_path.resolve)(__dirname, "worker.js") : typeof import_meta < "u" && import_meta.url ? (0, import_node_path.resolve)((0, import_node_path.dirname)((0, import_node_url.fileURLToPath)(import_meta.url)), "worker.js") : (0, import_node_path.resolve)(__dirname, "worker.js");
46
- let piscinaPool = null;
47
- function getPool() {
48
- return piscinaPool || (piscinaPool = new import_piscina.default({
49
- filename: getWorkerPath(),
50
- // Single worker for state consistency and simpler caching
51
- minThreads: 1,
52
- maxThreads: 1,
53
- idleTimeout: 6e4
54
- // 60s - keep alive for config watching
55
- })), piscinaPool;
56
- }
57
- async function extractToClassNames({
58
- source,
59
- sourcePath = "",
60
- options,
61
- shouldPrintDebug = !1
62
- }) {
63
- if (typeof source != "string") throw new Error("`source` must be a string of javascript");
64
- const task = {
65
- type: "extractToClassNames",
66
- source,
67
- sourcePath,
68
- options,
69
- shouldPrintDebug
70
- },
71
- result = await getPool().run(task, {
72
- name: "runTask"
73
- });
74
- if (!result.success) throw new Error(`Worker error: ${result.error}${result.stack ? `
75
- ${result.stack}` : ""}`);
76
- return result.data;
77
- }
78
- async function extractToNative(sourceFileName, sourceCode, options) {
79
- const task = {
80
- type: "extractToNative",
81
- sourceFileName,
82
- sourceCode,
83
- options
84
- },
85
- result = await getPool().run(task, {
86
- name: "runTask"
87
- });
88
- if (!result.success) throw new Error(`Worker error: ${result.error}${result.stack ? `
89
- ${result.stack}` : ""}`);
90
- return result.data;
91
- }
92
- async function clearWorkerCache() {
93
- if (!piscinaPool) return;
94
- const task = {
95
- type: "clearCache"
96
- };
97
- await piscinaPool.run(task, {
98
- name: "runTask"
99
- });
100
- }
101
- async function destroyPool() {
102
- piscinaPool && (await piscinaPool.destroy(), piscinaPool = null);
103
- }
104
- function getPoolStats() {
105
- return piscinaPool ? {
106
- threads: piscinaPool.threads.length,
107
- queueSize: piscinaPool.queueSize,
108
- completed: piscinaPool.completed,
109
- duration: piscinaPool.duration,
110
- utilization: piscinaPool.utilization
111
- } : null;
112
- }
113
- //# sourceMappingURL=async-wrapper.mjs.map
@@ -1 +0,0 @@
1
- {"version":3,"names":["async_wrapper_exports","__export","clearWorkerCache","destroyPool","extractToClassNames","extractToNative","getPoolStats","module","exports","__toCommonJS","import_piscina","__toESM","require","import_node_url","import_node_path","import_meta","getWorkerPath","__filename","resolve","__dirname","url","dirname","fileURLToPath","piscinaPool","getPool","default","filename","minThreads","maxThreads","idleTimeout","source","sourcePath","options","shouldPrintDebug","Error","task","type","result","run","name","success","error","stack","data","sourceFileName","sourceCode","destroy","threads","length","queueSize","completed","duration","utilization"],"sources":["../src/async-wrapper.ts"],"sourcesContent":[null],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,IAAAA,qBAAA;AAAAC,QAAA,CAAAD,qBAAA;EAAAE,gBAAA,EAAAA,CAAA,KAAAA,gBAAA;EAAAC,WAAA,EAAAA,CAAA,KAAAA,WAAA;EAAAC,mBAAA,EAAAA,CAAA,KAAAA,mBAAA;EAAAC,eAAA,EAAAA,CAAA,KAAAA,eAAA;EAAAC,YAAA,EAAAA,CAAA,KAAAA;AAAA;AAAAC,MAAA,CAAAC,OAAA,GAAAC,YAAA,CAAAT,qBAAA;AAKA,IAAAU,cAAA,GAAoBC,OAAA,CAAAC,OAAA;EACpBC,eAAA,GAA8BD,OAAA;EAC9BE,gBAAA,GAAiCF,OAAA;AAPjC,MAAAG,WAAA;EAcMC,aAAA,GAAgBA,CAAA,KAEhB,OAAOC,UAAA,GAAe,UACjBH,gBAAA,CAAAI,OAAA,EAAQC,SAAA,EAAW,WAAW,IAGnC,OAAOJ,WAAA,GAAgB,OAAeA,WAAA,CAAYK,GAAA,OAC7CN,gBAAA,CAAAI,OAAA,MAAQJ,gBAAA,CAAAO,OAAA,MAAQR,eAAA,CAAAS,aAAA,EAAcP,WAAA,CAAYK,GAAG,CAAC,GAAG,WAAW,QAG9DN,gBAAA,CAAAI,OAAA,EAAQC,SAAA,EAAW,WAAW;AAGvC,IAAII,WAAA,GAA8B;AAKlC,SAASC,QAAA,EAAmB;EAC1B,OAAKD,WAAA,KACHA,WAAA,GAAc,IAAIb,cAAA,CAAAe,OAAA,CAAQ;IACxBC,QAAA,EAAUV,aAAA,CAAc;IAAA;IAExBW,UAAA,EAAY;IACZC,UAAA,EAAY;IACZC,WAAA,EAAa;IAAA;EACf,CAAC,IAEIN,WAAA;AACT;AAMA,eAAsBnB,oBAAoB;EACxC0B,MAAA;EACAC,UAAA,GAAa;EACbC,OAAA;EACAC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AAMA,WAAA,CAAYuB,OAAA,CAAQ,GAC1BvB,WAAA,GAAc;AAElB;AAKO,SAASjB,aAAA,EAAe;EAC7B,OAAKiB,WAAA,GAGE;IACLwB,OAAA,EAASxB,WAAA,CAAYwB,OAAA,CAAQC,MAAA;IAC7BC,SAAA,EAAW1B,WAAA,CAAY0B,SAAA;IACvBC,SAAA,EAAW3B,WAAA,CAAY2B,SAAA;IACvBC,QAAA,EAAU5B,WAAA,CAAY4B,QAAA;IACtBC,WAAA,EAAa7B,WAAA,CAAY6B;EAC3B,IARS;AASX","ignoreList":[]}
@@ -1,61 +0,0 @@
1
- var __defProp = Object.defineProperty;
2
- var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
3
- var __getOwnPropNames = Object.getOwnPropertyNames;
4
- var __hasOwnProp = Object.prototype.hasOwnProperty;
5
- var __export = (target, all) => {
6
- for (var name in all)
7
- __defProp(target, name, { get: all[name], enumerable: !0 });
8
- }, __copyProps = (to, from, except, desc) => {
9
- if (from && typeof from == "object" || typeof from == "function")
10
- for (let key of __getOwnPropNames(from))
11
- !__hasOwnProp.call(to, key) && key !== except && __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
12
- return to;
13
- };
14
- var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: !0 }), mod);
15
- var sync_wrapper_exports = {};
16
- __export(sync_wrapper_exports, {
17
- extractToClassNamesSync: () => extractToClassNamesSync,
18
- extractToNativeSync: () => extractToNativeSync
19
- });
20
- module.exports = __toCommonJS(sync_wrapper_exports);
21
- var import_synckit = require("synckit"), import_node_path = require("node:path"), import_node_url = require("node:url");
22
- const import_meta = {}, getWorkerPath = () => typeof __filename < "u" ? (0, import_node_path.resolve)(__dirname, "worker.js") : typeof import_meta < "u" && import_meta.url ? (0, import_node_path.resolve)((0, import_node_path.dirname)((0, import_node_url.fileURLToPath)(import_meta.url)), "worker.js") : (0, import_node_path.resolve)(__dirname, "worker.js"), runTaskSync = (0, import_synckit.createSyncFn)(
23
- getWorkerPath()
24
- );
25
- function extractToClassNamesSync({
26
- source,
27
- sourcePath = "",
28
- options,
29
- shouldPrintDebug = !1
30
- }) {
31
- if (typeof source != "string")
32
- throw new Error("`source` must be a string of javascript");
33
- const result = runTaskSync({
34
- type: "extractToClassNames",
35
- source,
36
- sourcePath,
37
- options,
38
- shouldPrintDebug
39
- });
40
- if (!result.success)
41
- throw new Error(
42
- `Worker error: ${result.error}${result.stack ? `
43
- ${result.stack}` : ""}`
44
- );
45
- return result.data;
46
- }
47
- function extractToNativeSync(sourceFileName, sourceCode, options) {
48
- const result = runTaskSync({
49
- type: "extractToNative",
50
- sourceFileName,
51
- sourceCode,
52
- options
53
- });
54
- if (!result.success)
55
- throw new Error(
56
- `Worker error: ${result.error}${result.stack ? `
57
- ${result.stack}` : ""}`
58
- );
59
- return result.data;
60
- }
61
- //# sourceMappingURL=sync-wrapper.js.map
@@ -1,6 +0,0 @@
1
- {
2
- "version": 3,
3
- "sources": ["../src/sync-wrapper.ts"],
4
- "mappings": ";;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAKA,qBAA6B,oBAC7B,mBAAiC,sBACjC,kBAA8B;AAP9B,wBAcM,gBAAgB,MAEhB,OAAO,aAAe,UACjB,0BAAQ,WAAW,WAAW,IAGnC,OAAO,cAAgB,OAAe,YAAY,UAC7C,8BAAQ,8BAAQ,+BAAc,YAAY,GAAG,CAAC,GAAG,WAAW,QAG9D,0BAAQ,WAAW,WAAW,GAKjC,kBAAc;AAAA,EAClB,cAAc;AAChB;AAMO,SAAS,wBAAwB;AAAA,EACtC;AAAA,EACA,aAAa;AAAA,EACb;AAAA,EACA,mBAAmB;AACrB,GAK6B;AAC3B,MAAI,OAAO,UAAW;AACpB,UAAM,IAAI,MAAM,yCAAyC;AAW3D,QAAM,SAAS,YARU;AAAA,IACvB,MAAM;AAAA,IACN;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,EACF,CAE+B;AAE/B,MAAI,CAAC,OAAO;AACV,UAAM,IAAI;AAAA,MACR,iBAAiB,OAAO,KAAK,GAAG,OAAO,QAAQ;AAAA,EAAK,OAAO,KAAK,KAAK,EAAE;AAAA,IACzE;AAGF,SAAO,OAAO;AAChB;AAMO,SAAS,oBACd,gBACA,YACA,SACiB;AAQjB,QAAM,SAAS,YAPU;AAAA,IACvB,MAAM;AAAA,IACN;AAAA,IACA;AAAA,IACA;AAAA,EACF,CAE+B;AAE/B,MAAI,CAAC,OAAO;AACV,UAAM,IAAI;AAAA,MACR,iBAAiB,OAAO,KAAK,GAAG,OAAO,QAAQ;AAAA,EAAK,OAAO,KAAK,KAAK,EAAE;AAAA,IACzE;AAGF,SAAO,OAAO;AAChB;",
5
- "names": []
6
- }
@@ -1,62 +0,0 @@
1
- var __defProp = Object.defineProperty;
2
- var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
3
- var __getOwnPropNames = Object.getOwnPropertyNames;
4
- var __hasOwnProp = Object.prototype.hasOwnProperty;
5
- var __export = (target, all) => {
6
- for (var name in all) __defProp(target, name, {
7
- get: all[name],
8
- enumerable: !0
9
- });
10
- },
11
- __copyProps = (to, from, except, desc) => {
12
- if (from && typeof from == "object" || typeof from == "function") for (let key of __getOwnPropNames(from)) !__hasOwnProp.call(to, key) && key !== except && __defProp(to, key, {
13
- get: () => from[key],
14
- enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
15
- });
16
- return to;
17
- };
18
- var __toCommonJS = mod => __copyProps(__defProp({}, "__esModule", {
19
- value: !0
20
- }), mod);
21
- var sync_wrapper_exports = {};
22
- __export(sync_wrapper_exports, {
23
- extractToClassNamesSync: () => extractToClassNamesSync,
24
- extractToNativeSync: () => extractToNativeSync
25
- });
26
- module.exports = __toCommonJS(sync_wrapper_exports);
27
- var import_synckit = require("synckit"),
28
- import_node_path = require("node:path"),
29
- import_node_url = require("node:url");
30
- const import_meta = {},
31
- getWorkerPath = () => typeof __filename < "u" ? (0, import_node_path.resolve)(__dirname, "worker.js") : typeof import_meta < "u" && import_meta.url ? (0, import_node_path.resolve)((0, import_node_path.dirname)((0, import_node_url.fileURLToPath)(import_meta.url)), "worker.js") : (0, import_node_path.resolve)(__dirname, "worker.js"),
32
- runTaskSync = (0, import_synckit.createSyncFn)(getWorkerPath());
33
- function extractToClassNamesSync({
34
- source,
35
- sourcePath = "",
36
- options,
37
- shouldPrintDebug = !1
38
- }) {
39
- if (typeof source != "string") throw new Error("`source` must be a string of javascript");
40
- const result = runTaskSync({
41
- type: "extractToClassNames",
42
- source,
43
- sourcePath,
44
- options,
45
- shouldPrintDebug
46
- });
47
- if (!result.success) throw new Error(`Worker error: ${result.error}${result.stack ? `
48
- ${result.stack}` : ""}`);
49
- return result.data;
50
- }
51
- function extractToNativeSync(sourceFileName, sourceCode, options) {
52
- const result = runTaskSync({
53
- type: "extractToNative",
54
- sourceFileName,
55
- sourceCode,
56
- options
57
- });
58
- if (!result.success) throw new Error(`Worker error: ${result.error}${result.stack ? `
59
- ${result.stack}` : ""}`);
60
- return result.data;
61
- }
62
- //# sourceMappingURL=sync-wrapper.mjs.map
@@ -1 +0,0 @@
1
- {"version":3,"names":["sync_wrapper_exports","__export","extractToClassNamesSync","extractToNativeSync","module","exports","__toCommonJS","import_synckit","require","import_node_path","import_node_url","import_meta","getWorkerPath","__filename","resolve","__dirname","url","dirname","fileURLToPath","runTaskSync","createSyncFn","source","sourcePath","options","shouldPrintDebug","Error","result","type","success","error","stack","data","sourceFileName","sourceCode"],"sources":["../src/sync-wrapper.ts"],"sourcesContent":[null],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA,IAAAA,oBAAA;AAAAC,QAAA,CAAAD,oBAAA;EAAAE,uBAAA,EAAAA,CAAA,KAAAA,uBAAA;EAAAC,mBAAA,EAAAA,CAAA,KAAAA;AAAA;AAAAC,MAAA,CAAAC,OAAA,GAAAC,YAAA,CAAAN,oBAAA;AAKA,IAAAO,cAAA,GAA6BC,OAAA;EAC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AA,CAAOG,KAAK,GAAGH,MAAA,CAAOI,KAAA,GAAQ;AAAA,EAAKJ,MAAA,CAAOI,KAAK,KAAK,EAAE,EACzE;EAGF,OAAOJ,MAAA,CAAOK,IAAA;AAChB","ignoreList":[]}
@@ -1 +0,0 @@
1
- {"version":3,"file":"async-wrapper.d.ts","sourceRoot":"","sources":["../src/async-wrapper.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAKH,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,aAAa,CAAA;AAClD,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,iCAAiC,CAAA;AACxE,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,SAAS,CAAA;AAmC7C;;;GAGG;AACH,wBAAsB,mBAAmB,CAAC,EACxC,MAAM,EACN,UAAe,EACf,OAAO,EACP,gBAAwB,GACzB,EAAE;IACD,MAAM,EAAE,MAAM,GAAG,MAAM,CAAA;IACvB,UAAU,CAAC,EAAE,MAAM,CAAA;IACnB,OAAO,EAAE,cAAc,CAAA;IACvB,gBAAgB,CAAC,EAAE,OAAO,GAAG,SAAS,CAAA;CACvC,GAAG,OAAO,CAAC,iBAAiB,GAAG,IAAI,CAAC,CAuBpC;AAED;;;GAGG;AACH,wBAAsB,eAAe,CACnC,cAAc,EAAE,MAAM,EACtB,UAAU,EAAE,MAAM,EAClB,OAAO,EAAE,cAAc,GACtB,OAAO,CAAC,eAAe,CAAC,CAkB1B;AAED;;;GAGG;AACH,wBAAsB,gBAAgB,IAAI,OAAO,CAAC,IAAI,CAAC,CAKtD;AAED;;;GAGG;AACH,wBAAsB,WAAW,IAAI,OAAO,CAAC,IAAI,CAAC,CAKjD;AAED;;GAEG;AACH,wBAAgB,YAAY;;;;;;SAW3B"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"sync-wrapper.d.ts","sourceRoot":"","sources":["../src/sync-wrapper.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAKH,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,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