@tamagui/static-sync 2.0.0-rc.4 → 2.0.0-rc.40

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 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, __hasOwnProp = Object.prototype.hasOwnProperty;
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: !0 });
9
- }, __copyProps = (to, from, except, desc) => {
10
- if (from && typeof from == "object" || typeof from == "function")
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 && __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
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: !0 }) : target,
24
+ isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
21
25
  mod
22
- )), __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: !0 }), mod);
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"), import_node_url = require("node:url"), import_meta = {}, getWorkerPath = () => typeof import_meta < "u" && import_meta.url ? (0, import_node_url.fileURLToPath)(import_meta.resolve("@tamagui/static/worker")).replace(/\.mjs$/, ".js") : require.resolve("@tamagui/static/worker").replace(/\.mjs$/, ".js"), runTaskSync = (0, import_synckit.createSyncFn)(getWorkerPath(), {
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
- }), getPragmaOptions = (props) => {
37
- let { default: Static } = require("@tamagui/static");
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
- let { source, sourcePath = "", options, shouldPrintDebug = !1 } = params;
42
- if (typeof source != "string")
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
- let result = runTaskSync({
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
- let errorMessage = [
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
- let result = runTaskSync({
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
- let errorMessage = [
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
- let { default: Static } = require("@tamagui/static");
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.4",
3
+ "version": "2.0.0-rc.40",
4
4
  "license": "MIT",
5
5
  "source": "src/index.ts",
6
6
  "files": [
@@ -15,9 +15,10 @@
15
15
  "./package.json": "./package.json",
16
16
  ".": {
17
17
  "types": "./types/index.d.ts",
18
- "require": "./dist/index.cjs",
18
+ "browser": "./dist/index.cjs",
19
19
  "module": "./dist/index.cjs",
20
- "import": "./dist/index.cjs"
20
+ "import": "./dist/index.cjs",
21
+ "require": "./dist/index.cjs"
21
22
  }
22
23
  },
23
24
  "publishConfig": {
@@ -31,11 +32,11 @@
31
32
  },
32
33
  "dependencies": {
33
34
  "@babel/core": "^7.25.2",
34
- "@tamagui/static": "2.0.0-rc.4",
35
- "@tamagui/types": "2.0.0-rc.4",
35
+ "@tamagui/static": "2.0.0-rc.40",
36
+ "@tamagui/types": "2.0.0-rc.40",
36
37
  "synckit": "^0.9.2"
37
38
  },
38
39
  "devDependencies": {
39
- "@tamagui/build": "2.0.0-rc.4"
40
+ "@tamagui/build": "2.0.0-rc.40"
40
41
  }
41
42
  }
package/dist/index.js DELETED
@@ -1,95 +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
-
24
- // src/index.ts
25
- var index_exports = {};
26
- __export(index_exports, {
27
- extractToClassNamesSync: () => extractToClassNamesSync,
28
- extractToNativeSync: () => extractToNativeSync,
29
- getBabelPlugin: () => getBabelPlugin,
30
- getPragmaOptions: () => getPragmaOptions
31
- });
32
- module.exports = __toCommonJS(index_exports);
33
- var import_synckit = require("synckit"), import_node_url = require("node:url"), import_meta = {}, getWorkerPath = () => typeof import_meta < "u" && import_meta.url ? (0, import_node_url.fileURLToPath)(import_meta.resolve("@tamagui/static/worker")).replace(/\.mjs$/, ".js") : require.resolve("@tamagui/static/worker").replace(/\.mjs$/, ".js"), runTaskSync = (0, import_synckit.createSyncFn)(getWorkerPath(), {
34
- timeout: 6e4
35
- // 60s timeout for sync operations
36
- }), getPragmaOptions = (props) => {
37
- let { default: Static } = require("@tamagui/static");
38
- return Static.getPragmaOptions(props);
39
- };
40
- function extractToClassNamesSync(params) {
41
- let { source, sourcePath = "", options, shouldPrintDebug = !1 } = params;
42
- if (typeof source != "string")
43
- throw new Error("`source` must be a string of javascript");
44
- let result = runTaskSync({
45
- type: "extractToClassNames",
46
- source,
47
- sourcePath,
48
- options,
49
- shouldPrintDebug
50
- });
51
- if (!result.success) {
52
- let errorMessage = [
53
- `[tamagui-extract] Error processing file: ${sourcePath || "(unknown)"}`,
54
- "",
55
- result.error,
56
- result.stack ? `
57
- ${result.stack}` : ""
58
- ].filter(Boolean).join(`
59
- `);
60
- throw new Error(errorMessage);
61
- }
62
- return result.data;
63
- }
64
- function extractToNativeSync(sourceFileName, sourceCode, options) {
65
- let result = runTaskSync({
66
- type: "extractToNative",
67
- sourceFileName,
68
- sourceCode,
69
- options
70
- });
71
- if (!result.success) {
72
- let errorMessage = [
73
- `[tamagui-extract] Error processing file: ${sourceFileName || "(unknown)"}`,
74
- "",
75
- result.error,
76
- result.stack ? `
77
- ${result.stack}` : ""
78
- ].filter(Boolean).join(`
79
- `);
80
- throw new Error(errorMessage);
81
- }
82
- return result.data;
83
- }
84
- function getBabelPlugin() {
85
- let { default: Static } = require("@tamagui/static");
86
- return Static.getBabelPlugin();
87
- }
88
- // Annotate the CommonJS export names for ESM import in node:
89
- 0 && (module.exports = {
90
- extractToClassNamesSync,
91
- extractToNativeSync,
92
- getBabelPlugin,
93
- getPragmaOptions
94
- });
95
- //# sourceMappingURL=index.js.map
package/dist/index.js.map DELETED
@@ -1,6 +0,0 @@
1
- {
2
- "version": 3,
3
- "sources": ["../src/index.ts"],
4
- "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAYA,qBAA6B,oBAC7B,kBAA8B,qBAb9B,kBAmBM,gBAAgB,MAEhB,OAAO,cAAgB,OAAe,YAAY,UACjC,+BAAc,YAAY,QAAQ,wBAAwB,CAAC,EAE5D,QAAQ,UAAU,KAAK,IAIpC,gBAAgB,wBAAwB,EAAE,QAAQ,UAAU,KAAK,GAIpE,kBAAc,6BAAa,cAAc,GAAG;AAAA,EAChD,SAAS;AAAA;AACX,CAAC,GAEY,mBAAmB,CAAC,UAA4C;AAE3E,MAAM,EAAE,SAAS,OAAO,IAAI,QAAQ,iBAAiB;AACrD,SAAO,OAAO,iBAAiB,KAAK;AACtC;AAKO,SAAS,wBAAwB,QAKhC;AACN,MAAM,EAAE,QAAQ,aAAa,IAAI,SAAS,mBAAmB,GAAM,IAAI;AAEvE,MAAI,OAAO,UAAW;AACpB,UAAM,IAAI,MAAM,yCAAyC;AAW3D,MAAM,SAAS,YARF;AAAA,IACX,MAAM;AAAA,IACN;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,EACF,CAE+B;AAE/B,MAAI,CAAC,OAAO,SAAS;AACnB,QAAM,eAAe;AAAA,MACnB,4CAA4C,cAAc,WAAW;AAAA,MACrE;AAAA,MACA,OAAO;AAAA,MACP,OAAO,QAAQ;AAAA,EAAK,OAAO,KAAK,KAAK;AAAA,IACvC,EACG,OAAO,OAAO,EACd,KAAK;AAAA,CAAI;AAEZ,UAAM,IAAI,MAAM,YAAY;AAAA,EAC9B;AAEA,SAAO,OAAO;AAChB;AAKO,SAAS,oBACd,gBACA,YACA,SACiB;AAQjB,MAAM,SAAS,YAPF;AAAA,IACX,MAAM;AAAA,IACN;AAAA,IACA;AAAA,IACA;AAAA,EACF,CAE+B;AAE/B,MAAI,CAAC,OAAO,SAAS;AACnB,QAAM,eAAe;AAAA,MACnB,4CAA4C,kBAAkB,WAAW;AAAA,MACzE;AAAA,MACA,OAAO;AAAA,MACP,OAAO,QAAQ;AAAA,EAAK,OAAO,KAAK,KAAK;AAAA,IACvC,EACG,OAAO,OAAO,EACd,KAAK;AAAA,CAAI;AAEZ,UAAM,IAAI,MAAM,YAAY;AAAA,EAC9B;AAEA,SAAO,OAAO;AAChB;AAKO,SAAS,iBAAiB;AAE/B,MAAM,EAAE,SAAS,OAAO,IAAI,QAAQ,iBAAiB;AACrD,SAAO,OAAO,eAAe;AAC/B;",
5
- "names": []
6
- }