@tamagui/static-sync 2.0.0-rc.36 → 2.0.0-rc.36-1775243248161
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/index.cjs +42 -25
- package/package.json +4 -4
package/dist/index.cjs
CHANGED
|
@@ -2,14 +2,18 @@ var __create = Object.create;
|
|
|
2
2
|
var __defProp = Object.defineProperty;
|
|
3
3
|
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
4
|
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
-
var __getProtoOf = Object.getPrototypeOf
|
|
5
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
6
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
7
|
var __export = (target, all) => {
|
|
7
8
|
for (var name in all)
|
|
8
|
-
__defProp(target, name, { get: all[name], enumerable:
|
|
9
|
-
}
|
|
10
|
-
|
|
9
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
10
|
+
};
|
|
11
|
+
var __copyProps = (to, from, except, desc) => {
|
|
12
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
11
13
|
for (let key of __getOwnPropNames(from))
|
|
12
|
-
!__hasOwnProp.call(to, key) && key !== except
|
|
14
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
15
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
16
|
+
}
|
|
13
17
|
return to;
|
|
14
18
|
};
|
|
15
19
|
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
@@ -17,9 +21,10 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
|
|
|
17
21
|
// file that has been converted to a CommonJS file using a Babel-
|
|
18
22
|
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
19
23
|
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
20
|
-
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable:
|
|
24
|
+
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
21
25
|
mod
|
|
22
|
-
))
|
|
26
|
+
));
|
|
27
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
23
28
|
|
|
24
29
|
// src/index.ts
|
|
25
30
|
var index_exports = {};
|
|
@@ -30,59 +35,71 @@ __export(index_exports, {
|
|
|
30
35
|
getPragmaOptions: () => getPragmaOptions
|
|
31
36
|
});
|
|
32
37
|
module.exports = __toCommonJS(index_exports);
|
|
33
|
-
var import_synckit = require("synckit")
|
|
38
|
+
var import_synckit = require("synckit");
|
|
39
|
+
var import_node_url = require("node:url");
|
|
40
|
+
var import_meta = {};
|
|
41
|
+
var getWorkerPath = () => {
|
|
42
|
+
if (typeof import_meta !== "undefined" && import_meta.url) {
|
|
43
|
+
const workerPath = (0, import_node_url.fileURLToPath)(import_meta.resolve("@tamagui/static/worker"));
|
|
44
|
+
return workerPath.replace(/\.mjs$/, ".js");
|
|
45
|
+
}
|
|
46
|
+
return require.resolve("@tamagui/static/worker").replace(/\.mjs$/, ".js");
|
|
47
|
+
};
|
|
48
|
+
var runTaskSync = (0, import_synckit.createSyncFn)(getWorkerPath(), {
|
|
34
49
|
timeout: 6e4
|
|
35
50
|
// 60s timeout for sync operations
|
|
36
|
-
})
|
|
37
|
-
|
|
51
|
+
});
|
|
52
|
+
var getPragmaOptions = (props) => {
|
|
53
|
+
const { default: Static } = require("@tamagui/static");
|
|
38
54
|
return Static.getPragmaOptions(props);
|
|
39
55
|
};
|
|
40
56
|
function extractToClassNamesSync(params) {
|
|
41
|
-
|
|
42
|
-
if (typeof source
|
|
57
|
+
const { source, sourcePath = "", options, shouldPrintDebug = false } = params;
|
|
58
|
+
if (typeof source !== "string") {
|
|
43
59
|
throw new Error("`source` must be a string of javascript");
|
|
44
|
-
|
|
60
|
+
}
|
|
61
|
+
const task = {
|
|
45
62
|
type: "extractToClassNames",
|
|
46
63
|
source,
|
|
47
64
|
sourcePath,
|
|
48
65
|
options,
|
|
49
66
|
shouldPrintDebug
|
|
50
|
-
}
|
|
67
|
+
};
|
|
68
|
+
const result = runTaskSync(task);
|
|
51
69
|
if (!result.success) {
|
|
52
|
-
|
|
70
|
+
const errorMessage = [
|
|
53
71
|
`[tamagui-extract] Error processing file: ${sourcePath || "(unknown)"}`,
|
|
54
|
-
|
|
72
|
+
``,
|
|
55
73
|
result.error,
|
|
56
74
|
result.stack ? `
|
|
57
75
|
${result.stack}` : ""
|
|
58
|
-
].filter(Boolean).join(
|
|
59
|
-
`);
|
|
76
|
+
].filter(Boolean).join("\n");
|
|
60
77
|
throw new Error(errorMessage);
|
|
61
78
|
}
|
|
62
79
|
return result.data;
|
|
63
80
|
}
|
|
64
81
|
function extractToNativeSync(sourceFileName, sourceCode, options) {
|
|
65
|
-
|
|
82
|
+
const task = {
|
|
66
83
|
type: "extractToNative",
|
|
67
84
|
sourceFileName,
|
|
68
85
|
sourceCode,
|
|
69
86
|
options
|
|
70
|
-
}
|
|
87
|
+
};
|
|
88
|
+
const result = runTaskSync(task);
|
|
71
89
|
if (!result.success) {
|
|
72
|
-
|
|
90
|
+
const errorMessage = [
|
|
73
91
|
`[tamagui-extract] Error processing file: ${sourceFileName || "(unknown)"}`,
|
|
74
|
-
|
|
92
|
+
``,
|
|
75
93
|
result.error,
|
|
76
94
|
result.stack ? `
|
|
77
95
|
${result.stack}` : ""
|
|
78
|
-
].filter(Boolean).join(
|
|
79
|
-
`);
|
|
96
|
+
].filter(Boolean).join("\n");
|
|
80
97
|
throw new Error(errorMessage);
|
|
81
98
|
}
|
|
82
99
|
return result.data;
|
|
83
100
|
}
|
|
84
101
|
function getBabelPlugin() {
|
|
85
|
-
|
|
102
|
+
const { default: Static } = require("@tamagui/static");
|
|
86
103
|
return Static.getBabelPlugin();
|
|
87
104
|
}
|
|
88
105
|
// Annotate the CommonJS export names for ESM import in node:
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tamagui/static-sync",
|
|
3
|
-
"version": "2.0.0-rc.36",
|
|
3
|
+
"version": "2.0.0-rc.36-1775243248161",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"source": "src/index.ts",
|
|
6
6
|
"files": [
|
|
@@ -32,11 +32,11 @@
|
|
|
32
32
|
},
|
|
33
33
|
"dependencies": {
|
|
34
34
|
"@babel/core": "^7.25.2",
|
|
35
|
-
"@tamagui/static": "2.0.0-rc.36",
|
|
36
|
-
"@tamagui/types": "2.0.0-rc.36",
|
|
35
|
+
"@tamagui/static": "2.0.0-rc.36-1775243248161",
|
|
36
|
+
"@tamagui/types": "2.0.0-rc.36-1775243248161",
|
|
37
37
|
"synckit": "^0.9.2"
|
|
38
38
|
},
|
|
39
39
|
"devDependencies": {
|
|
40
|
-
"@tamagui/build": "2.0.0-rc.36"
|
|
40
|
+
"@tamagui/build": "2.0.0-rc.36-1775243248161"
|
|
41
41
|
}
|
|
42
42
|
}
|