@tamagui/static 1.136.1 → 1.136.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.
- package/dist/async-wrapper.js +98 -0
- package/dist/async-wrapper.js.map +6 -0
- package/dist/async-wrapper.mjs +113 -0
- package/dist/async-wrapper.mjs.map +1 -0
- package/dist/sync-wrapper.js +61 -0
- package/dist/sync-wrapper.js.map +6 -0
- package/dist/sync-wrapper.mjs +62 -0
- package/dist/sync-wrapper.mjs.map +1 -0
- package/dist/worker.js +65 -0
- package/dist/worker.js.map +6 -0
- package/dist/worker.mjs +84 -0
- package/dist/worker.mjs.map +1 -0
- package/package.json +15 -15
- package/types/async-wrapper.d.ts.map +1 -0
- package/types/sync-wrapper.d.ts.map +1 -0
- package/types/worker.d.ts.map +1 -0
|
@@ -0,0 +1,98 @@
|
|
|
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
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
{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,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
|
+
}
|
|
@@ -0,0 +1,113 @@
|
|
|
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
|
|
@@ -0,0 +1 @@
|
|
|
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,EAA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IAGMK,MAAA,GAAU,MADHb,OAAA,CAAQ,EACMc,GAAA,CAAIH,IAAA,EAAM;MAAEI,IAAA,EAAM;IAAU,CAAC;EAExD,IAAI,CAACF,MAAA,CAAOG,OAAA,EACV,MAAM,IAAIN,KAAA,CACR,iBAAiBG,MAAA,CAAOI,KAAK,GAAGJ,MAAA,CAAOK,KAAA,GAAQ;AAAA,EAAKL,MAAA,CAAOK,KAAK,KAAK,EAAE,EACzE;EAGF,OAAOL,MAAA,CAAOM,IAAA;AAChB;AAMA,eAAsBzC,iBAAA,EAAkC;EACtD,IAAI,CAACqB,WAAA,EAAa;EAElB,MAAMY,IAAA,GAAmB;IAAEC,IAAA,EAAM;EAAa;EAC9C,MAAMb,WAAA,CAAYe,GAAA,CAAIH,IAAA,EAAM;IAAEI,IAAA,EAAM;EAAU,CAAC;AACjD;AAMA,eAAsBpC,YAAA,EAA6B;EAC7CoB,WAAA,KACF,MAAMA,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":[]}
|
|
@@ -0,0 +1,61 @@
|
|
|
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
|
|
@@ -0,0 +1,6 @@
|
|
|
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
|
+
}
|
|
@@ -0,0 +1,62 @@
|
|
|
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
|
|
@@ -0,0 +1 @@
|
|
|
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;EAC7BC,gBAAA,GAAiCD,OAAA;EACjCE,eAAA,GAA8BF,OAAA;AAP9B,MAAAG,WAAA;EAcMC,aAAA,GAAgBA,CAAA,KAEhB,OAAOC,UAAA,GAAe,UACjBJ,gBAAA,CAAAK,OAAA,EAAQC,SAAA,EAAW,WAAW,IAGnC,OAAOJ,WAAA,GAAgB,OAAeA,WAAA,CAAYK,GAAA,OAC7CP,gBAAA,CAAAK,OAAA,MAAQL,gBAAA,CAAAQ,OAAA,MAAQP,eAAA,CAAAQ,aAAA,EAAcP,WAAA,CAAYK,GAAG,CAAC,GAAG,WAAW,QAG9DP,gBAAA,CAAAK,OAAA,EAAQC,SAAA,EAAW,WAAW;EAKjCI,WAAA,OAAcZ,cAAA,CAAAa,YAAA,EAClBR,aAAA,CAAc,CAChB;AAMO,SAASV,wBAAwB;EACtCmB,MAAA;EACAC,UAAA,GAAa;EACbC,OAAA;EACAC,gBAAA,GAAmB;AACrB,GAK6B;EAC3B,IAAI,OAAOH,MAAA,IAAW,UACpB,MAAM,IAAII,KAAA,CAAM,yCAAyC;EAW3D,MAAMC,MAAA,GAASP,WAAA,CARU;IACvBQ,IAAA,EAAM;IACNN,MAAA;IACAC,UAAA;IACAC,OAAA;IACAC;EACF,CAE+B;EAE/B,IAAI,CAACE,MAAA,CAAOE,OAAA,EACV,MAAM,IAAIH,KAAA,CACR,iBAAiBC,MAAA,CAAOG,KAAK,GAAGH,MAAA,CAAOI,KAAA,GAAQ;AAAA,EAAKJ,MAAA,CAAOI,KAAK,KAAK,EAAE,EACzE;EAGF,OAAOJ,MAAA,CAAOK,IAAA;AAChB;AAMO,SAAS5B,oBACd6B,cAAA,EACAC,UAAA,EACAV,OAAA,EACiB;EAQjB,MAAMG,MAAA,GAASP,WAAA,CAPU;IACvBQ,IAAA,EAAM;IACNK,cAAA;IACAC,UAAA;IACAV;EACF,CAE+B;EAE/B,IAAI,CAACG,MAAA,CAAOE,OAAA,EACV,MAAM,IAAIH,KAAA,CACR,iBAAiBC,MAAA,CAAOG,KAAK,GAAGH,MAAA,CAAOI,KAAA,GAAQ;AAAA,EAAKJ,MAAA,CAAOI,KAAK,KAAK,EAAE,EACzE;EAGF,OAAOJ,MAAA,CAAOK,IAAA;AAChB","ignoreList":[]}
|
package/dist/worker.js
ADDED
|
@@ -0,0 +1,65 @@
|
|
|
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 worker_exports = {};
|
|
16
|
+
__export(worker_exports, {
|
|
17
|
+
default: () => worker_default,
|
|
18
|
+
runTask: () => runTask
|
|
19
|
+
});
|
|
20
|
+
module.exports = __toCommonJS(worker_exports);
|
|
21
|
+
var import_createExtractor = require("./extractor/createExtractor"), import_extractToClassNames = require("./extractor/extractToClassNames"), import_extractToNative = require("./extractor/extractToNative");
|
|
22
|
+
const webExtractor = (0, import_createExtractor.createExtractor)({ platform: "web" }), nativeExtractor = (0, import_createExtractor.createExtractor)({ platform: "native" }), configCache = /* @__PURE__ */ new Map();
|
|
23
|
+
async function runTask(task) {
|
|
24
|
+
try {
|
|
25
|
+
if (task.type === "extractToClassNames") {
|
|
26
|
+
if (!task.options.disableExtraction && !task.options._disableLoadTamagui) {
|
|
27
|
+
const cacheKey = JSON.stringify({
|
|
28
|
+
config: task.options.config,
|
|
29
|
+
components: task.options.components
|
|
30
|
+
});
|
|
31
|
+
configCache.has(cacheKey) || configCache.set(cacheKey, webExtractor.loadTamagui(task.options)), await configCache.get(cacheKey);
|
|
32
|
+
}
|
|
33
|
+
return { success: !0, data: await (0, import_extractToClassNames.extractToClassNames)({
|
|
34
|
+
extractor: webExtractor,
|
|
35
|
+
source: task.source,
|
|
36
|
+
sourcePath: task.sourcePath,
|
|
37
|
+
options: task.options,
|
|
38
|
+
shouldPrintDebug: task.shouldPrintDebug
|
|
39
|
+
}) };
|
|
40
|
+
}
|
|
41
|
+
if (task.type === "extractToNative") {
|
|
42
|
+
const cacheKey = JSON.stringify({
|
|
43
|
+
config: task.options.config,
|
|
44
|
+
components: task.options.components
|
|
45
|
+
});
|
|
46
|
+
return configCache.has(cacheKey) || configCache.set(cacheKey, nativeExtractor.loadTamagui(task.options)), await configCache.get(cacheKey), { success: !0, data: (0, import_extractToNative.extractToNative)(
|
|
47
|
+
task.sourceFileName,
|
|
48
|
+
task.sourceCode,
|
|
49
|
+
task.options
|
|
50
|
+
) };
|
|
51
|
+
}
|
|
52
|
+
return task.type === "clearCache" ? (configCache.clear(), { success: !0, data: null }) : {
|
|
53
|
+
success: !1,
|
|
54
|
+
error: `Unknown task type: ${task.type}`
|
|
55
|
+
};
|
|
56
|
+
} catch (error) {
|
|
57
|
+
return {
|
|
58
|
+
success: !1,
|
|
59
|
+
error: error instanceof Error ? error.message : String(error),
|
|
60
|
+
stack: error instanceof Error ? error.stack : void 0
|
|
61
|
+
};
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
var worker_default = runTask;
|
|
65
|
+
//# sourceMappingURL=worker.js.map
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 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,SAAS,uBAAuB;AAEvC,UAAI,CAAC,KAAK,QAAQ,qBAAqB,CAAC,KAAK,QAAQ,qBAAwB;AAC3E,cAAM,WAAW,KAAK,UAAU;AAAA,UAC9B,QAAQ,KAAK,QAAQ;AAAA,UACrB,YAAY,KAAK,QAAQ;AAAA,QAC3B,CAAC;AAED,QAAK,YAAY,IAAI,QAAQ,KAC3B,YAAY,IAAI,UAAU,aAAa,YAAY,KAAK,OAAO,CAAC,GAGlE,MAAM,YAAY,IAAI,QAAQ;AAAA,MAChC;AAUA,aAAO,EAAE,SAAS,IAAM,MART,UAAM,2BAAAA,qBAAwB;AAAA,QAC3C,WAAW;AAAA,QACX,QAAQ,KAAK;AAAA,QACb,YAAY,KAAK;AAAA,QACjB,SAAS,KAAK;AAAA,QACd,kBAAkB,KAAK;AAAA,MACzB,CAAC,EAEoC;AAAA,IACvC;AAEA,QAAI,KAAK,SAAS,mBAAmB;AAEnC,YAAM,WAAW,KAAK,UAAU;AAAA,QAC9B,QAAQ,KAAK,QAAQ;AAAA,QACrB,YAAY,KAAK,QAAQ;AAAA,MAC3B,CAAC;AAED,aAAK,YAAY,IAAI,QAAQ,KAC3B,YAAY,IAAI,UAAU,gBAAgB,YAAY,KAAK,OAAO,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,GACX,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
|
+
"names": ["extractToClassNamesImpl", "extractToNativeImpl"]
|
|
6
|
+
}
|
package/dist/worker.mjs
ADDED
|
@@ -0,0 +1,84 @@
|
|
|
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 worker_exports = {};
|
|
22
|
+
__export(worker_exports, {
|
|
23
|
+
default: () => worker_default,
|
|
24
|
+
runTask: () => runTask
|
|
25
|
+
});
|
|
26
|
+
module.exports = __toCommonJS(worker_exports);
|
|
27
|
+
var import_createExtractor = require("./extractor/createExtractor.mjs"),
|
|
28
|
+
import_extractToClassNames = require("./extractor/extractToClassNames.mjs"),
|
|
29
|
+
import_extractToNative = require("./extractor/extractToNative.mjs");
|
|
30
|
+
const webExtractor = (0, import_createExtractor.createExtractor)({
|
|
31
|
+
platform: "web"
|
|
32
|
+
}),
|
|
33
|
+
nativeExtractor = (0, import_createExtractor.createExtractor)({
|
|
34
|
+
platform: "native"
|
|
35
|
+
}),
|
|
36
|
+
configCache = /* @__PURE__ */new Map();
|
|
37
|
+
async function runTask(task) {
|
|
38
|
+
try {
|
|
39
|
+
if (task.type === "extractToClassNames") {
|
|
40
|
+
if (!task.options.disableExtraction && !task.options._disableLoadTamagui) {
|
|
41
|
+
const cacheKey = JSON.stringify({
|
|
42
|
+
config: task.options.config,
|
|
43
|
+
components: task.options.components
|
|
44
|
+
});
|
|
45
|
+
configCache.has(cacheKey) || configCache.set(cacheKey, webExtractor.loadTamagui(task.options)), await configCache.get(cacheKey);
|
|
46
|
+
}
|
|
47
|
+
return {
|
|
48
|
+
success: !0,
|
|
49
|
+
data: await (0, import_extractToClassNames.extractToClassNames)({
|
|
50
|
+
extractor: webExtractor,
|
|
51
|
+
source: task.source,
|
|
52
|
+
sourcePath: task.sourcePath,
|
|
53
|
+
options: task.options,
|
|
54
|
+
shouldPrintDebug: task.shouldPrintDebug
|
|
55
|
+
})
|
|
56
|
+
};
|
|
57
|
+
}
|
|
58
|
+
if (task.type === "extractToNative") {
|
|
59
|
+
const cacheKey = JSON.stringify({
|
|
60
|
+
config: task.options.config,
|
|
61
|
+
components: task.options.components
|
|
62
|
+
});
|
|
63
|
+
return configCache.has(cacheKey) || configCache.set(cacheKey, nativeExtractor.loadTamagui(task.options)), await configCache.get(cacheKey), {
|
|
64
|
+
success: !0,
|
|
65
|
+
data: (0, import_extractToNative.extractToNative)(task.sourceFileName, task.sourceCode, task.options)
|
|
66
|
+
};
|
|
67
|
+
}
|
|
68
|
+
return task.type === "clearCache" ? (configCache.clear(), {
|
|
69
|
+
success: !0,
|
|
70
|
+
data: null
|
|
71
|
+
}) : {
|
|
72
|
+
success: !1,
|
|
73
|
+
error: `Unknown task type: ${task.type}`
|
|
74
|
+
};
|
|
75
|
+
} catch (error) {
|
|
76
|
+
return {
|
|
77
|
+
success: !1,
|
|
78
|
+
error: error instanceof Error ? error.message : String(error),
|
|
79
|
+
stack: error instanceof Error ? error.stack : void 0
|
|
80
|
+
};
|
|
81
|
+
}
|
|
82
|
+
}
|
|
83
|
+
var worker_default = runTask;
|
|
84
|
+
//# sourceMappingURL=worker.mjs.map
|
|
@@ -0,0 +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,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/static",
|
|
3
|
-
"version": "1.136.
|
|
3
|
+
"version": "1.136.3",
|
|
4
4
|
"source": "src/index.ts",
|
|
5
5
|
"types": "./types/index.d.ts",
|
|
6
6
|
"type": "commonjs",
|
|
@@ -43,19 +43,19 @@
|
|
|
43
43
|
"@babel/template": "^7.25.0",
|
|
44
44
|
"@babel/traverse": "^7.25.4",
|
|
45
45
|
"@babel/types": "^7.25.4",
|
|
46
|
-
"@tamagui/cli-color": "1.136.
|
|
47
|
-
"@tamagui/config-default": "1.136.
|
|
48
|
-
"@tamagui/core": "1.136.
|
|
49
|
-
"@tamagui/fake-react-native": "1.136.
|
|
50
|
-
"@tamagui/generate-themes": "1.136.
|
|
51
|
-
"@tamagui/helpers": "1.136.
|
|
52
|
-
"@tamagui/helpers-node": "1.136.
|
|
53
|
-
"@tamagui/proxy-worm": "1.136.
|
|
54
|
-
"@tamagui/react-native-web-internals": "1.136.
|
|
55
|
-
"@tamagui/react-native-web-lite": "1.136.
|
|
56
|
-
"@tamagui/shorthands": "1.136.
|
|
57
|
-
"@tamagui/types": "1.136.
|
|
58
|
-
"@tamagui/web": "1.136.
|
|
46
|
+
"@tamagui/cli-color": "1.136.3",
|
|
47
|
+
"@tamagui/config-default": "1.136.3",
|
|
48
|
+
"@tamagui/core": "1.136.3",
|
|
49
|
+
"@tamagui/fake-react-native": "1.136.3",
|
|
50
|
+
"@tamagui/generate-themes": "1.136.3",
|
|
51
|
+
"@tamagui/helpers": "1.136.3",
|
|
52
|
+
"@tamagui/helpers-node": "1.136.3",
|
|
53
|
+
"@tamagui/proxy-worm": "1.136.3",
|
|
54
|
+
"@tamagui/react-native-web-internals": "1.136.3",
|
|
55
|
+
"@tamagui/react-native-web-lite": "1.136.3",
|
|
56
|
+
"@tamagui/shorthands": "1.136.3",
|
|
57
|
+
"@tamagui/types": "1.136.3",
|
|
58
|
+
"@tamagui/web": "1.136.3",
|
|
59
59
|
"babel-literal-to-ast": "^2.1.0",
|
|
60
60
|
"browserslist": "^4.22.2",
|
|
61
61
|
"check-dependency-version-consistency": "^4.1.0",
|
|
@@ -72,7 +72,7 @@
|
|
|
72
72
|
"devDependencies": {
|
|
73
73
|
"@babel/plugin-syntax-typescript": "^7.25.4",
|
|
74
74
|
"@expo/match-media": "^0.4.0",
|
|
75
|
-
"@tamagui/build": "1.136.
|
|
75
|
+
"@tamagui/build": "1.136.3",
|
|
76
76
|
"@types/babel__core": "^7.20.5",
|
|
77
77
|
"@types/find-root": "^1.1.2",
|
|
78
78
|
"@types/node": "^22.1.0",
|
|
@@ -0,0 +1 @@
|
|
|
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"}
|
|
@@ -0,0 +1 @@
|
|
|
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,aAAa,CAAA;AAClD,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,iCAAiC,CAAA;AACxE,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,SAAS,CAAA;AAuB7C;;;GAGG;AACH,wBAAgB,uBAAuB,CAAC,EACtC,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,iBAAiB,GAAG,IAAI,CAsB3B;AAED;;;GAGG;AACH,wBAAgB,mBAAmB,CACjC,cAAc,EAAE,MAAM,EACtB,UAAU,EAAE,MAAM,EAClB,OAAO,EAAE,cAAc,GACtB,eAAe,CAiBjB"}
|
|
@@ -0,0 +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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