@vxrn/compiler 1.1.397

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.
Files changed (98) hide show
  1. package/LICENSE +45 -0
  2. package/dist/cjs/configure.cjs +34 -0
  3. package/dist/cjs/configure.js +29 -0
  4. package/dist/cjs/configure.js.map +6 -0
  5. package/dist/cjs/configure.native.js +35 -0
  6. package/dist/cjs/configure.native.js.map +6 -0
  7. package/dist/cjs/constants.cjs +65 -0
  8. package/dist/cjs/constants.js +34 -0
  9. package/dist/cjs/constants.js.map +6 -0
  10. package/dist/cjs/constants.native.js +65 -0
  11. package/dist/cjs/constants.native.js.map +6 -0
  12. package/dist/cjs/index.cjs +124 -0
  13. package/dist/cjs/index.js +113 -0
  14. package/dist/cjs/index.js.map +6 -0
  15. package/dist/cjs/index.native.js +123 -0
  16. package/dist/cjs/index.native.js.map +6 -0
  17. package/dist/cjs/refresh-runtime.cjs +295 -0
  18. package/dist/cjs/refresh-runtime.js +296 -0
  19. package/dist/cjs/refresh-runtime.js.map +6 -0
  20. package/dist/cjs/refresh-runtime.native.js +316 -0
  21. package/dist/cjs/refresh-runtime.native.js.map +6 -0
  22. package/dist/cjs/transformBabel.cjs +111 -0
  23. package/dist/cjs/transformBabel.js +116 -0
  24. package/dist/cjs/transformBabel.js.map +6 -0
  25. package/dist/cjs/transformBabel.native.js +152 -0
  26. package/dist/cjs/transformBabel.native.js.map +6 -0
  27. package/dist/cjs/transformSWC.cjs +261 -0
  28. package/dist/cjs/transformSWC.js +256 -0
  29. package/dist/cjs/transformSWC.js.map +6 -0
  30. package/dist/cjs/transformSWC.native.js +275 -0
  31. package/dist/cjs/transformSWC.native.js.map +6 -0
  32. package/dist/cjs/types.cjs +16 -0
  33. package/dist/cjs/types.js +14 -0
  34. package/dist/cjs/types.js.map +6 -0
  35. package/dist/cjs/types.native.js +15 -0
  36. package/dist/cjs/types.native.js.map +6 -0
  37. package/dist/esm/configure.js +13 -0
  38. package/dist/esm/configure.js.map +6 -0
  39. package/dist/esm/configure.mjs +10 -0
  40. package/dist/esm/configure.mjs.map +1 -0
  41. package/dist/esm/configure.native.js +13 -0
  42. package/dist/esm/configure.native.js.map +6 -0
  43. package/dist/esm/constants.js +18 -0
  44. package/dist/esm/constants.js.map +6 -0
  45. package/dist/esm/constants.mjs +38 -0
  46. package/dist/esm/constants.mjs.map +1 -0
  47. package/dist/esm/constants.native.js +41 -0
  48. package/dist/esm/constants.native.js.map +6 -0
  49. package/dist/esm/index.js +102 -0
  50. package/dist/esm/index.js.map +6 -0
  51. package/dist/esm/index.mjs +99 -0
  52. package/dist/esm/index.mjs.map +1 -0
  53. package/dist/esm/index.native.js +104 -0
  54. package/dist/esm/index.native.js.map +6 -0
  55. package/dist/esm/refresh-runtime.js +280 -0
  56. package/dist/esm/refresh-runtime.js.map +6 -0
  57. package/dist/esm/refresh-runtime.mjs +266 -0
  58. package/dist/esm/refresh-runtime.mjs.map +1 -0
  59. package/dist/esm/refresh-runtime.native.js +290 -0
  60. package/dist/esm/refresh-runtime.native.js.map +6 -0
  61. package/dist/esm/transformBabel.js +95 -0
  62. package/dist/esm/transformBabel.js.map +6 -0
  63. package/dist/esm/transformBabel.mjs +76 -0
  64. package/dist/esm/transformBabel.mjs.map +1 -0
  65. package/dist/esm/transformBabel.native.js +125 -0
  66. package/dist/esm/transformBabel.native.js.map +6 -0
  67. package/dist/esm/transformSWC.js +246 -0
  68. package/dist/esm/transformSWC.js.map +6 -0
  69. package/dist/esm/transformSWC.mjs +237 -0
  70. package/dist/esm/transformSWC.mjs.map +1 -0
  71. package/dist/esm/transformSWC.native.js +257 -0
  72. package/dist/esm/transformSWC.native.js.map +6 -0
  73. package/dist/esm/types.js +1 -0
  74. package/dist/esm/types.js.map +6 -0
  75. package/dist/esm/types.mjs +2 -0
  76. package/dist/esm/types.mjs.map +1 -0
  77. package/dist/esm/types.native.js +1 -0
  78. package/dist/esm/types.native.js.map +6 -0
  79. package/package.json +54 -0
  80. package/src/configure.ts +17 -0
  81. package/src/constants.ts +21 -0
  82. package/src/index.ts +166 -0
  83. package/src/refresh-runtime.js +619 -0
  84. package/src/transformBabel.ts +218 -0
  85. package/src/transformSWC.ts +381 -0
  86. package/src/types.ts +36 -0
  87. package/types/configure.d.ts +10 -0
  88. package/types/configure.d.ts.map +1 -0
  89. package/types/constants.d.ts +9 -0
  90. package/types/constants.d.ts.map +1 -0
  91. package/types/index.d.ts +12 -0
  92. package/types/index.d.ts.map +1 -0
  93. package/types/transformBabel.d.ts +12 -0
  94. package/types/transformBabel.d.ts.map +1 -0
  95. package/types/transformSWC.d.ts +7 -0
  96. package/types/transformSWC.d.ts.map +1 -0
  97. package/types/types.d.ts +29 -0
  98. package/types/types.d.ts.map +1 -0
@@ -0,0 +1,290 @@
1
+ /*! Copyright (c) Meta Platforms, Inc. and affiliates. **/
2
+ var REACT_FORWARD_REF_TYPE = Symbol.for("react.forward_ref"), REACT_MEMO_TYPE = Symbol.for("react.memo"), allFamiliesByID = /* @__PURE__ */ new Map(), allFamiliesByType = /* @__PURE__ */ new WeakMap(), allSignaturesByType = /* @__PURE__ */ new WeakMap(), updatedFamiliesByType = /* @__PURE__ */ new WeakMap(), pendingUpdates = [], helpersByRendererID = /* @__PURE__ */ new Map(), helpersByRoot = /* @__PURE__ */ new Map(), mountedRoots = /* @__PURE__ */ new Set(), failedRoots = /* @__PURE__ */ new Set(), rootElements = /* @__PURE__ */ new WeakMap(), isPerformingRefresh = !1;
3
+ function computeFullKey(signature) {
4
+ if (signature.fullKey !== null)
5
+ return signature.fullKey;
6
+ var fullKey = signature.ownKey, hooks2;
7
+ try {
8
+ hooks2 = signature.getCustomHooks();
9
+ } catch {
10
+ return signature.forceReset = !0, signature.fullKey = fullKey, fullKey;
11
+ }
12
+ for (var i = 0; i < hooks2.length; i++) {
13
+ var hook = hooks2[i];
14
+ if (typeof hook != "function")
15
+ return signature.forceReset = !0, signature.fullKey = fullKey, fullKey;
16
+ var nestedHookSignature = allSignaturesByType.get(hook);
17
+ if (nestedHookSignature !== void 0) {
18
+ var nestedHookKey = computeFullKey(nestedHookSignature);
19
+ nestedHookSignature.forceReset && (signature.forceReset = !0), fullKey += `
20
+ ---
21
+ ` + nestedHookKey;
22
+ }
23
+ }
24
+ return signature.fullKey = fullKey, fullKey;
25
+ }
26
+ function haveEqualSignatures(prevType, nextType) {
27
+ var prevSignature = allSignaturesByType.get(prevType), nextSignature = allSignaturesByType.get(nextType);
28
+ return prevSignature === void 0 && nextSignature === void 0 ? !0 : !(prevSignature === void 0 || nextSignature === void 0 || computeFullKey(prevSignature) !== computeFullKey(nextSignature) || nextSignature.forceReset);
29
+ }
30
+ function isReactClass(type) {
31
+ return type.prototype && type.prototype.isReactComponent;
32
+ }
33
+ function canPreserveStateBetween(prevType, nextType) {
34
+ return isReactClass(prevType) || isReactClass(nextType) ? !1 : !!haveEqualSignatures(prevType, nextType);
35
+ }
36
+ function resolveFamily(type) {
37
+ return updatedFamiliesByType.get(type);
38
+ }
39
+ function getProperty(object, property) {
40
+ try {
41
+ return object[property];
42
+ } catch {
43
+ return;
44
+ }
45
+ }
46
+ function performReactRefresh() {
47
+ if (pendingUpdates.length === 0 || isPerformingRefresh)
48
+ return null;
49
+ isPerformingRefresh = !0;
50
+ try {
51
+ var staleFamilies = /* @__PURE__ */ new Set(), updatedFamilies = /* @__PURE__ */ new Set(), updates = pendingUpdates;
52
+ pendingUpdates = [], updates.forEach(function(param) {
53
+ var [family, nextType] = param, prevType = family.current;
54
+ updatedFamiliesByType.set(prevType, family), updatedFamiliesByType.set(nextType, family), family.current = nextType, canPreserveStateBetween(prevType, nextType) ? updatedFamilies.add(family) : staleFamilies.add(family);
55
+ });
56
+ var update = {
57
+ updatedFamilies,
58
+ // Families that will re-render preserving state
59
+ staleFamilies
60
+ };
61
+ helpersByRendererID.forEach(function(helpers) {
62
+ helpers.setRefreshHandler(resolveFamily);
63
+ });
64
+ var didError = !1, firstError = null, failedRootsSnapshot = new Set(failedRoots), mountedRootsSnapshot = new Set(mountedRoots), helpersByRootSnapshot = new Map(helpersByRoot);
65
+ if (failedRootsSnapshot.forEach(function(root) {
66
+ var helpers = helpersByRootSnapshot.get(root);
67
+ if (helpers === void 0)
68
+ throw new Error("Could not find helpers for a root. This is a bug in React Refresh.");
69
+ if (failedRoots.has(root), rootElements !== null && rootElements.has(root)) {
70
+ var element = rootElements.get(root);
71
+ try {
72
+ helpers.scheduleRoot(root, element);
73
+ } catch (err) {
74
+ didError || (didError = !0, firstError = err);
75
+ }
76
+ }
77
+ }), mountedRootsSnapshot.forEach(function(root) {
78
+ var helpers = helpersByRootSnapshot.get(root);
79
+ if (helpers === void 0)
80
+ throw new Error("Could not find helpers for a root. This is a bug in React Refresh.");
81
+ mountedRoots.has(root);
82
+ try {
83
+ helpers.scheduleRefresh(root, update);
84
+ } catch (err) {
85
+ didError || (didError = !0, firstError = err);
86
+ }
87
+ }), didError)
88
+ throw firstError;
89
+ return update;
90
+ } finally {
91
+ isPerformingRefresh = !1;
92
+ }
93
+ }
94
+ function register(type, id) {
95
+ if (type !== null && !(typeof type != "function" && typeof type != "object") && !allFamiliesByType.has(type)) {
96
+ var family = allFamiliesByID.get(id);
97
+ if (family === void 0 ? (family = {
98
+ current: type
99
+ }, allFamiliesByID.set(id, family)) : pendingUpdates.push([
100
+ family,
101
+ type
102
+ ]), allFamiliesByType.set(type, family), typeof type == "object" && type !== null)
103
+ switch (getProperty(type, "$$typeof")) {
104
+ case REACT_FORWARD_REF_TYPE:
105
+ register(type.render, id + "$render");
106
+ break;
107
+ case REACT_MEMO_TYPE:
108
+ register(type.type, id + "$type");
109
+ break;
110
+ }
111
+ }
112
+ }
113
+ function setSignature(type, key, forceReset, getCustomHooks) {
114
+ if (allSignaturesByType.has(type) || allSignaturesByType.set(type, {
115
+ forceReset,
116
+ ownKey: key,
117
+ fullKey: null,
118
+ getCustomHooks: getCustomHooks || function() {
119
+ return [];
120
+ }
121
+ }), typeof type == "object" && type !== null)
122
+ switch (getProperty(type, "$$typeof")) {
123
+ case REACT_FORWARD_REF_TYPE:
124
+ setSignature(type.render, key, forceReset, getCustomHooks);
125
+ break;
126
+ case REACT_MEMO_TYPE:
127
+ setSignature(type.type, key, forceReset, getCustomHooks);
128
+ break;
129
+ }
130
+ }
131
+ function collectCustomHooksForSignature(type) {
132
+ var signature = allSignaturesByType.get(type);
133
+ signature !== void 0 && computeFullKey(signature);
134
+ }
135
+ function injectIntoGlobalHook(globalObject) {
136
+ var hook = globalObject.__REACT_DEVTOOLS_GLOBAL_HOOK__;
137
+ if (hook === void 0) {
138
+ var nextID = 0;
139
+ globalObject.__REACT_DEVTOOLS_GLOBAL_HOOK__ = hook = {
140
+ renderers: /* @__PURE__ */ new Map(),
141
+ supportsFiber: !0,
142
+ inject: function(injected) {
143
+ return nextID++;
144
+ },
145
+ onScheduleFiberRoot: function(id, root, children) {
146
+ },
147
+ onCommitFiberRoot: function(id, root, maybePriorityLevel, didError) {
148
+ },
149
+ onCommitFiberUnmount() {
150
+ }
151
+ };
152
+ }
153
+ if (hook.isDisabled) {
154
+ console.warn("Something has shimmed the React DevTools global hook (__REACT_DEVTOOLS_GLOBAL_HOOK__). Fast Refresh is not compatible with this shim and will be disabled.");
155
+ return;
156
+ }
157
+ var oldInject = hook.inject;
158
+ hook.inject = function(injected) {
159
+ var id = oldInject.apply(this, arguments);
160
+ return typeof injected.scheduleRefresh == "function" && typeof injected.setRefreshHandler == "function" && helpersByRendererID.set(id, injected), id;
161
+ }, hook.renderers.forEach(function(injected, id) {
162
+ typeof injected.scheduleRefresh == "function" && typeof injected.setRefreshHandler == "function" && helpersByRendererID.set(id, injected);
163
+ });
164
+ var oldOnCommitFiberRoot = hook.onCommitFiberRoot, oldOnScheduleFiberRoot = hook.onScheduleFiberRoot || function() {
165
+ };
166
+ hook.onScheduleFiberRoot = function(id, root, children) {
167
+ return isPerformingRefresh || (failedRoots.delete(root), rootElements !== null && rootElements.set(root, children)), oldOnScheduleFiberRoot.apply(this, arguments);
168
+ }, hook.onCommitFiberRoot = function(id, root, maybePriorityLevel, didError) {
169
+ var helpers = helpersByRendererID.get(id);
170
+ if (helpers !== void 0) {
171
+ helpersByRoot.set(root, helpers);
172
+ var current = root.current, alternate = current.alternate;
173
+ if (alternate !== null) {
174
+ var wasMounted = alternate.memoizedState != null && alternate.memoizedState.element != null && mountedRoots.has(root), isMounted = current.memoizedState != null && current.memoizedState.element != null;
175
+ !wasMounted && isMounted ? (mountedRoots.add(root), failedRoots.delete(root)) : wasMounted && isMounted || (wasMounted && !isMounted ? (mountedRoots.delete(root), didError ? failedRoots.add(root) : helpersByRoot.delete(root)) : !wasMounted && !isMounted && didError && failedRoots.add(root));
176
+ } else
177
+ mountedRoots.add(root);
178
+ }
179
+ return oldOnCommitFiberRoot.apply(this, arguments);
180
+ };
181
+ }
182
+ function createSignatureFunctionForTransform() {
183
+ var savedType, hasCustomHooks, didCollectHooks = !1;
184
+ return function(type, key, forceReset, getCustomHooks) {
185
+ if (typeof key == "string")
186
+ return savedType || (savedType = type, hasCustomHooks = typeof getCustomHooks == "function"), type != null && (typeof type == "function" || typeof type == "object") && setSignature(type, key, forceReset, getCustomHooks), type;
187
+ !didCollectHooks && hasCustomHooks && (didCollectHooks = !0, collectCustomHooksForSignature(savedType));
188
+ };
189
+ }
190
+ function isLikelyComponentType(type) {
191
+ switch (typeof type) {
192
+ case "function": {
193
+ if (type.prototype != null) {
194
+ if (type.prototype.isReactComponent)
195
+ return !0;
196
+ var ownNames = Object.getOwnPropertyNames(type.prototype);
197
+ if (ownNames.length > 1 || ownNames[0] !== "constructor" || type.prototype.__proto__ !== Object.prototype)
198
+ return !1;
199
+ }
200
+ var name = type.name || type.displayName;
201
+ return typeof name == "string" && /^[A-Z]/.test(name);
202
+ }
203
+ case "object": {
204
+ if (type != null)
205
+ switch (getProperty(type, "$$typeof")) {
206
+ case REACT_FORWARD_REF_TYPE:
207
+ case REACT_MEMO_TYPE:
208
+ return !0;
209
+ default:
210
+ return !1;
211
+ }
212
+ return !1;
213
+ }
214
+ default:
215
+ return !1;
216
+ }
217
+ }
218
+ function getRefreshReg(filename) {
219
+ return function(type, id) {
220
+ return register(type, filename + " " + id);
221
+ };
222
+ }
223
+ function registerExportsForReactRefresh(filename, moduleExports) {
224
+ for (var key in moduleExports)
225
+ if (key !== "__esModule") {
226
+ var exportValue = moduleExports[key];
227
+ isLikelyComponentType(exportValue) && register(exportValue, filename + " export " + key);
228
+ }
229
+ }
230
+ function debounce(fn, delay) {
231
+ var handle;
232
+ return function() {
233
+ clearTimeout(handle), handle = setTimeout(fn, delay);
234
+ };
235
+ }
236
+ var hooks = [];
237
+ window.__registerBeforePerformReactRefresh = function(cb) {
238
+ hooks.push(cb);
239
+ };
240
+ var enqueueUpdate = debounce(async function() {
241
+ hooks.length && await Promise.all(hooks.map(function(cb) {
242
+ return cb();
243
+ })), performReactRefresh();
244
+ }, 16);
245
+ function validateRefreshBoundaryAndEnqueueUpdate(id, prevExports, nextExports) {
246
+ var _window___getReactRefreshIgnoredExports, _window, _window___getReactRefreshIgnoredExports1, ignoredExports = (_window___getReactRefreshIgnoredExports1 = (_window___getReactRefreshIgnoredExports = (_window = window).__getReactRefreshIgnoredExports) === null || _window___getReactRefreshIgnoredExports === void 0 ? void 0 : _window___getReactRefreshIgnoredExports.call(_window, {
247
+ id
248
+ })) !== null && _window___getReactRefreshIgnoredExports1 !== void 0 ? _window___getReactRefreshIgnoredExports1 : [];
249
+ if (predicateOnExport(ignoredExports, prevExports, function(key) {
250
+ return key in nextExports;
251
+ }) !== !0)
252
+ return "Could not Fast Refresh (export removed)";
253
+ if (predicateOnExport(ignoredExports, nextExports, function(key) {
254
+ return key in prevExports;
255
+ }) !== !0)
256
+ return "Could not Fast Refresh (new export)";
257
+ var hasExports = !1, allExportsAreComponentsOrUnchanged = predicateOnExport(ignoredExports, nextExports, function(key, value) {
258
+ return hasExports = !0, isLikelyComponentType(value) ? !0 : prevExports[key] === nextExports[key];
259
+ });
260
+ if (hasExports && allExportsAreComponentsOrUnchanged === !0)
261
+ enqueueUpdate();
262
+ else
263
+ return `Could not Fast Refresh ("${allExportsAreComponentsOrUnchanged}" export is incompatible). Learn more at https://github.com/vitejs/vite-plugin-react-swc#consistent-components-exports`;
264
+ }
265
+ function predicateOnExport(ignoredExports, moduleExports, predicate) {
266
+ for (var key in moduleExports)
267
+ if (key !== "__esModule" && !ignoredExports.includes(key)) {
268
+ var desc = Object.getOwnPropertyDescriptor(moduleExports, key);
269
+ if (desc && desc.get || !predicate(key, moduleExports[key])) return key;
270
+ }
271
+ return !0;
272
+ }
273
+ var __hmr_import = function(module) {
274
+ return import(
275
+ /* @vite-ignore */
276
+ module
277
+ );
278
+ }, refresh_runtime_default = {
279
+ injectIntoGlobalHook
280
+ };
281
+ export {
282
+ __hmr_import,
283
+ createSignatureFunctionForTransform,
284
+ refresh_runtime_default as default,
285
+ getRefreshReg,
286
+ injectIntoGlobalHook,
287
+ registerExportsForReactRefresh,
288
+ validateRefreshBoundaryAndEnqueueUpdate
289
+ };
290
+ //# sourceMappingURL=refresh-runtime.js.map
@@ -0,0 +1,6 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../src/Users/n8/one/packages/compiler/src/refresh-runtime.js"],
4
+ "mappings": "AAAA;AAOA,IAAMA,yBAAyBC,OAAOC,IAAI,mBAAA,GACpCC,kBAAkBF,OAAOC,IAAI,YAAA,GAI/BE,kBAAkB,oBAAIC,IAAAA,GACtBC,oBAAoB,oBAAIC,QAAAA,GACxBC,sBAAsB,oBAAID,QAAAA,GAIxBE,wBAAwB,oBAAIF,QAAAA,GAI9BG,iBAAiB,CAAA,GAGfC,sBAAsB,oBAAIN,IAAAA,GAE1BO,gBAAgB,oBAAIP,IAAAA,GAGpBQ,eAAe,oBAAIC,IAAAA,GAEnBC,cAAc,oBAAID,IAAAA,GAKpBE,eAAe,oBAAIT,QAAAA,GACnBU,sBAAsB;AAE1B,SAASC,eAAeC,WAAS;AAC/B,MAAIA,UAAUC,YAAY;AAC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,QAAAA;SAAW;;IAA0BA;;GAGlE,0BAAe;EAAErE;AAAqB;",
5
+ "names": ["REACT_FORWARD_REF_TYPE", "Symbol", "for", "REACT_MEMO_TYPE", "allFamiliesByID", "Map", "allFamiliesByType", "WeakMap", "allSignaturesByType", "updatedFamiliesByType", "pendingUpdates", "helpersByRendererID", "helpersByRoot", "mountedRoots", "Set", "failedRoots", "rootElements", "isPerformingRefresh", "computeFullKey", "signature", "fullKey", "ownKey", "hooks", "getCustomHooks", "forceReset", "i", "length", "hook", "nestedHookSignature", "get", "undefined", "nestedHookKey", "haveEqualSignatures", "prevType", "nextType", "prevSignature", "nextSignature", "isReactClass", "type", "prototype", "isReactComponent", "canPreserveStateBetween", "resolveFamily", "getProperty", "object", "property", "performReactRefresh", "staleFamilies", "updatedFamilies", "updates", "forEach", "family", "current", "set", "add", "update", "helpers", "setRefreshHandler", "didError", "firstError", "failedRootsSnapshot", "mountedRootsSnapshot", "helpersByRootSnapshot", "root", "Error", "has", "element", "scheduleRoot", "err", "scheduleRefresh", "register", "id", "push", "render", "setSignature", "key", "collectCustomHooksForSignature", "injectIntoGlobalHook", "globalObject", "__REACT_DEVTOOLS_GLOBAL_HOOK__", "nextID", "renderers", "supportsFiber", "inject", "injected", "onScheduleFiberRoot", "children", "onCommitFiberRoot", "maybePriorityLevel", "onCommitFiberUnmount", "isDisabled", "console", "oldInject", "apply", "arguments", "oldOnCommitFiberRoot", "oldOnScheduleFiberRoot", "delete", "alternate", "wasMounted", "memoizedState", "isMounted", "createSignatureFunctionForTransform", "savedType", "hasCustomHooks", "didCollectHooks", "isLikelyComponentType", "ownNames", "Object", "getOwnPropertyNames", "__proto__", "name", "displayName", "test", "getRefreshReg", "filename", "registerExportsForReactRefresh", "moduleExports", "exportValue", "debounce", "fn", "delay", "handle", "clearTimeout", "setTimeout", "window", "__registerBeforePerformReactRefresh", "cb", "enqueueUpdate", "Promise", "all", "map", "validateRefreshBoundaryAndEnqueueUpdate", "prevExports", "nextExports", "ignoredExports", "__getReactRefreshIgnoredExports", "predicateOnExport", "hasExports", "allExportsAreComponentsOrUnchanged", "value", "predicate", "includes", "desc", "getOwnPropertyDescriptor", "__hmr_import", "module"]
6
+ }
@@ -0,0 +1,95 @@
1
+ import babel from "@babel/core";
2
+ import { relative } from "node:path";
3
+ import { configuration } from "./configure";
4
+ import { asyncGeneratorRegex, debug } from "./constants";
5
+ function getBabelOptions(props) {
6
+ if (props.userSetting === "babel")
7
+ return {
8
+ plugins: getPlugins(props, !0)
9
+ };
10
+ if (typeof props.userSetting > "u" || typeof props.userSetting == "object" && props.userSetting.transform === "babel") {
11
+ if (props.userSetting?.excludeDefaultPlugins)
12
+ return props.userSetting;
13
+ const plugins = getPlugins(props);
14
+ if (plugins.length)
15
+ return {
16
+ plugins
17
+ };
18
+ }
19
+ return null;
20
+ }
21
+ const getPlugins = (props, force = !1) => {
22
+ let plugins = [];
23
+ return (force || shouldBabelGenerators(props)) && (plugins = getBasePlugins(props)), shouldBabelReanimated(props) && (debug?.("Using babel reanimated on file"), plugins.push("react-native-reanimated/plugin")), shouldBabelReactCompiler(props) && (debug?.("Using babel react compiler on file"), plugins.push(getBabelReactCompilerPlugin(props))), shouldBabelReactNativeCodegen(props) && (debug?.("Using babel @react-native/babel-plugin-codegen on file"), plugins.push("@react-native/babel-plugin-codegen")), plugins;
24
+ };
25
+ async function transformBabel(id, code, options) {
26
+ const compilerPlugin = options.plugins?.find((x) => x && x[0] === "babel-plugin-react-compiler"), out = await new Promise((res, rej) => {
27
+ babel.transform(
28
+ code,
29
+ {
30
+ filename: id,
31
+ compact: !1,
32
+ minified: !1,
33
+ presets: ["@babel/preset-typescript"],
34
+ ...options
35
+ },
36
+ (err, result) => {
37
+ if (!result || err)
38
+ return rej(err || "no res");
39
+ res(result.code);
40
+ }
41
+ );
42
+ });
43
+ return compilerPlugin && out.includes(compilerPlugin[1] === "18" ? "react-compiler-runtime" : "react/compiler-runtime") && console.info(` \u{1FA84} [compiler] ${relative(process.cwd(), id)}`), out;
44
+ }
45
+ const getBasePlugins = ({ development }) => [
46
+ ["@babel/plugin-transform-destructuring"],
47
+ ["@babel/plugin-transform-react-jsx", { development }],
48
+ ["@babel/plugin-transform-async-generator-functions"],
49
+ ["@babel/plugin-transform-async-to-generator"],
50
+ [
51
+ "@babel/plugin-transform-runtime",
52
+ {
53
+ helpers: !0,
54
+ // NOTE THIS WAS SPELLED WRONG BEFOER THIS COMMIT MAYBE IT WAS UNINTENTIONALLY WORKING
55
+ regenerator: !1
56
+ }
57
+ ]
58
+ ], NATIVE_COMPONENT_RE = /NativeComponent\.[jt]sx?$/, SPEC_FILE_RE = /[\/\\]specs?[\/\\]/, shouldBabelReactNativeCodegen = ({ id, environment }) => (environment === "ios" || environment === "android") && (NATIVE_COMPONENT_RE.test(id) || SPEC_FILE_RE.test(id)), shouldBabelReactCompiler = (props) => !(!configuration.enableCompiler || Array.isArray(configuration.enableCompiler) && !configuration.enableCompiler.includes(props.environment) || !/.*(.tsx?)$/.test(props.id) || props.code.startsWith("// disable-compiler")), getBabelReactCompilerPlugin = (props) => ["babel-plugin-react-compiler", { target: props.reactForRNVersion === "18" && (props.environment === "ios" || props.environment === "android") ? "18" : "19" }];
59
+ function shouldBabelGenerators({ code }) {
60
+ if (process.env.VXRN_USE_BABEL_FOR_GENERATORS)
61
+ return asyncGeneratorRegex.test(code);
62
+ }
63
+ const REANIMATED_AUTOWORKLETIZATION_KEYWORDS = [
64
+ "worklet",
65
+ "useAnimatedGestureHandler",
66
+ "useAnimatedScrollHandler",
67
+ "useFrameCallback",
68
+ "useAnimatedStyle",
69
+ "useAnimatedProps",
70
+ "createAnimatedPropAdapter",
71
+ "useDerivedValue",
72
+ "useAnimatedReaction",
73
+ "useWorkletCallback",
74
+ "withTiming",
75
+ "withSpring",
76
+ "withDecay",
77
+ "withRepeat",
78
+ "runOnUI",
79
+ "executeOnUIRuntimeSync"
80
+ ], REANIMATED_REGEX = new RegExp(REANIMATED_AUTOWORKLETIZATION_KEYWORDS.join("|")), REANIMATED_IGNORED_PATHS = [
81
+ // React and React Native libraries are not likely to use reanimated.
82
+ // This can also avoid the "[BABEL] Note: The code generator has deoptimised the styling of ... as it exceeds the max of 500KB" warning since the react-native source code also contains `useAnimatedProps`.
83
+ "react-native-prebuilt",
84
+ "node_modules/.vxrn/react-native"
85
+ ], REANIMATED_IGNORED_PATHS_REGEX = new RegExp(
86
+ REANIMATED_IGNORED_PATHS.map((s) => s.replace(/\//g, "/")).join("|")
87
+ );
88
+ function shouldBabelReanimated({ code, id }) {
89
+ return configuration.enableReanimated ? !!(!REANIMATED_IGNORED_PATHS_REGEX.test(id) && REANIMATED_REGEX.test(code)) : !1;
90
+ }
91
+ export {
92
+ getBabelOptions,
93
+ transformBabel
94
+ };
95
+ //# sourceMappingURL=transformBabel.js.map
@@ -0,0 +1,6 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../src/transformBabel.ts"],
4
+ "mappings": "AAAA,OAAO,WAAW;AAClB,SAAS,gBAAgB;AACzB,SAAS,qBAAqB;AAC9B,SAAS,qBAAqB,aAAa;AAOpC,SAAS,gBAAgB,OAA6C;AAC3E,MAAI,MAAM,gBAAgB;AACxB,WAAO;AAAA,MACL,SAAS,WAAW,OAAO,EAAI;AAAA,IACjC;AAEF,MACE,OAAO,MAAM,cAAgB,OAC5B,OAAO,MAAM,eAAgB,YAAY,MAAM,YAAY,cAAc,SAC1E;AACA,QAAI,MAAM,aAAa;AACrB,aAAO,MAAM;AAEf,UAAM,UAAU,WAAW,KAAK;AAChC,QAAI,QAAQ;AACV,aAAO;AAAA,QACL;AAAA,MACF;AAAA,EAEJ;AACA,SAAO;AACT;AAEA,MAAM,aAAa,CAAC,OAAc,QAAQ,OAAU;AAClD,MAAI,UAA8B,CAAC;AAEnC,UAAI,SAAS,sBAAsB,KAAK,OACtC,UAAU,eAAe,KAAK,IAG5B,sBAAsB,KAAK,MAC7B,QAAQ,gCAAgC,GACxC,QAAQ,KAAK,gCAAgC,IAG3C,yB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,cAAc,kBAGf,MAAM,QAAQ,cAAc,cAAc,KACxC,CAAC,cAAc,eAAe,SAAS,MAAM,WAAW,KAI1D,CAAC,aAAa,KAAK,MAAM,EAAE,KAC3B,MAAM,KAAK,WAAW,qBAAqB,IAK3C,8BAA8B,CAAC,UAO5B,CAAC,+BAA+B,EAAE,QALvC,MAAM,sBAAsB,SAC3B,MAAM,gBAAgB,SAAS,MAAM,gBAAgB,aAClD,OACA,KAE0C,CAAC;AAOnD,SAAS,sBAAsB,EAAE,KAAK,GAAU;AAC9C,MAAI,QAAQ,IAAI;AACd,WAAO,oBAAoB,KAAK,IAAI;AAExC;AASA,MAAM,yCAAyC;AAAA,EAC7C;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACF,GAKM,mBAAmB,IAAI,OAAO,uCAAuC,KAAK,GAAG,CAAC,GAE9E,2BAA2B;AAAA;AAAA;AAAA,EAG/B;AAAA,EACA;AACF,GAEM,iCAAiC,IAAI;AAAA,EACzC,yBAAyB,IAAI,CAAC,MAAM,EAAE,QAAQ,OAAO,GAAG,CAAC,EAAE,KAAK,GAAG;AACrE;AAEA,SAAS,sBAAsB,EAAE,MAAM,GAAG,GAAU;AAClD,SAAK,cAAc,mBAGf,IAAC,+BAA+B,KAAK,EAAE,KAAK,iBAAiB,KAAK,IAAI,KAFjE;AAOX;",
5
+ "names": []
6
+ }
@@ -0,0 +1,76 @@
1
+ import babel from "@babel/core";
2
+ import { relative } from "node:path";
3
+ import { configuration } from "./configure.mjs";
4
+ import { asyncGeneratorRegex, debug } from "./constants.mjs";
5
+ function getBabelOptions(props) {
6
+ if (props.userSetting === "babel") return {
7
+ plugins: getPlugins(props, !0)
8
+ };
9
+ if (typeof props.userSetting > "u" || typeof props.userSetting == "object" && props.userSetting.transform === "babel") {
10
+ if (props.userSetting?.excludeDefaultPlugins) return props.userSetting;
11
+ const plugins = getPlugins(props);
12
+ if (plugins.length) return {
13
+ plugins
14
+ };
15
+ }
16
+ return null;
17
+ }
18
+ const getPlugins = (props, force = !1) => {
19
+ let plugins = [];
20
+ return (force || shouldBabelGenerators(props)) && (plugins = getBasePlugins(props)), shouldBabelReanimated(props) && (debug?.("Using babel reanimated on file"), plugins.push("react-native-reanimated/plugin")), shouldBabelReactCompiler(props) && (debug?.("Using babel react compiler on file"), plugins.push(getBabelReactCompilerPlugin(props))), shouldBabelReactNativeCodegen(props) && (debug?.("Using babel @react-native/babel-plugin-codegen on file"), plugins.push("@react-native/babel-plugin-codegen")), plugins;
21
+ };
22
+ async function transformBabel(id, code, options) {
23
+ const compilerPlugin = options.plugins?.find(x => x && x[0] === "babel-plugin-react-compiler"),
24
+ out = await new Promise((res, rej) => {
25
+ babel.transform(code, {
26
+ filename: id,
27
+ compact: !1,
28
+ minified: !1,
29
+ presets: ["@babel/preset-typescript"],
30
+ ...options
31
+ }, (err, result) => {
32
+ if (!result || err) return rej(err || "no res");
33
+ res(result.code);
34
+ });
35
+ });
36
+ return compilerPlugin && out.includes(compilerPlugin[1] === "18" ? "react-compiler-runtime" : "react/compiler-runtime") && console.info(` \u{1FA84} [compiler] ${relative(process.cwd(), id)}`), out;
37
+ }
38
+ const getBasePlugins = ({
39
+ development
40
+ }) => [["@babel/plugin-transform-destructuring"], ["@babel/plugin-transform-react-jsx", {
41
+ development
42
+ }], ["@babel/plugin-transform-async-generator-functions"], ["@babel/plugin-transform-async-to-generator"], ["@babel/plugin-transform-runtime", {
43
+ helpers: !0,
44
+ // NOTE THIS WAS SPELLED WRONG BEFOER THIS COMMIT MAYBE IT WAS UNINTENTIONALLY WORKING
45
+ regenerator: !1
46
+ }]],
47
+ NATIVE_COMPONENT_RE = /NativeComponent\.[jt]sx?$/,
48
+ SPEC_FILE_RE = /[\/\\]specs?[\/\\]/,
49
+ shouldBabelReactNativeCodegen = ({
50
+ id,
51
+ environment
52
+ }) => (environment === "ios" || environment === "android") && (NATIVE_COMPONENT_RE.test(id) || SPEC_FILE_RE.test(id)),
53
+ shouldBabelReactCompiler = props => !(!configuration.enableCompiler || Array.isArray(configuration.enableCompiler) && !configuration.enableCompiler.includes(props.environment) || !/.*(.tsx?)$/.test(props.id) || props.code.startsWith("// disable-compiler")),
54
+ getBabelReactCompilerPlugin = props => ["babel-plugin-react-compiler", {
55
+ target: props.reactForRNVersion === "18" && (props.environment === "ios" || props.environment === "android") ? "18" : "19"
56
+ }];
57
+ function shouldBabelGenerators({
58
+ code
59
+ }) {
60
+ if (process.env.VXRN_USE_BABEL_FOR_GENERATORS) return asyncGeneratorRegex.test(code);
61
+ }
62
+ const REANIMATED_AUTOWORKLETIZATION_KEYWORDS = ["worklet", "useAnimatedGestureHandler", "useAnimatedScrollHandler", "useFrameCallback", "useAnimatedStyle", "useAnimatedProps", "createAnimatedPropAdapter", "useDerivedValue", "useAnimatedReaction", "useWorkletCallback", "withTiming", "withSpring", "withDecay", "withRepeat", "runOnUI", "executeOnUIRuntimeSync"],
63
+ REANIMATED_REGEX = new RegExp(REANIMATED_AUTOWORKLETIZATION_KEYWORDS.join("|")),
64
+ REANIMATED_IGNORED_PATHS = [
65
+ // React and React Native libraries are not likely to use reanimated.
66
+ // This can also avoid the "[BABEL] Note: The code generator has deoptimised the styling of ... as it exceeds the max of 500KB" warning since the react-native source code also contains `useAnimatedProps`.
67
+ "react-native-prebuilt", "node_modules/.vxrn/react-native"],
68
+ REANIMATED_IGNORED_PATHS_REGEX = new RegExp(REANIMATED_IGNORED_PATHS.map(s => s.replace(/\//g, "/")).join("|"));
69
+ function shouldBabelReanimated({
70
+ code,
71
+ id
72
+ }) {
73
+ return configuration.enableReanimated ? !!(!REANIMATED_IGNORED_PATHS_REGEX.test(id) && REANIMATED_REGEX.test(code)) : !1;
74
+ }
75
+ export { getBabelOptions, transformBabel };
76
+ //# sourceMappingURL=transformBabel.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["babel","relative","configuration","asyncGeneratorRegex","debug","getBabelOptions","props","userSetting","plugins","getPlugins","transform","excludeDefaultPlugins","length","force","shouldBabelGenerators","getBasePlugins","shouldBabelReanimated","push","shouldBabelReactCompiler","getBabelReactCompilerPlugin","shouldBabelReactNativeCodegen","transformBabel","id","code","options","compilerPlugin","find","x","out","Promise","res","rej","filename","compact","minified","presets","err","result","includes","console","info","process","cwd","development","helpers","regenerator","NATIVE_COMPONENT_RE","SPEC_FILE_RE","environment","test","enableCompiler","Array","isArray","startsWith","target","reactForRNVersion","env","VXRN_USE_BABEL_FOR_GENERATORS","REANIMATED_AUTOWORKLETIZATION_KEYWORDS","REANIMATED_REGEX","RegExp","join","REANIMATED_IGNORED_PATHS","REANIMATED_IGNORED_PATHS_REGEX","map","s","replace","enableReanimated"],"sources":["../../src/transformBabel.ts"],"sourcesContent":[null],"mappings":"AAAA,OAAOA,KAAA,MAAW;AAClB,SAASC,QAAA,QAAgB;AACzB,SAASC,aAAA,QAAqB;AAC9B,SAASC,mBAAA,EAAqBC,KAAA,QAAa;AAOpC,SAASC,gBAAgBC,KAAA,EAA6C;EAC3E,IAAIA,KAAA,CAAMC,WAAA,KAAgB,SACxB,OAAO;IACLC,OAAA,EAASC,UAAA,CAAWH,KAAA,EAAO,EAAI;EACjC;EAEF,IACE,OAAOA,KAAA,CAAMC,WAAA,GAAgB,OAC5B,OAAOD,KAAA,CAAMC,WAAA,IAAgB,YAAYD,KAAA,CAAMC,WAAA,CAAYG,SAAA,KAAc,SAC1E;IACA,IAAIJ,KAAA,CAAMC,WAAA,EAAaI,qBAAA,EACrB,OAAOL,KAAA,CAAMC,WAAA;IAEf,MAAMC,OAAA,GAAUC,UAAA,CAAWH,KAAK;IAChC,IAAIE,OAAA,CAAQI,MAAA,EACV,OAAO;MACLJ;IACF;EAEJ;EACA,OAAO;AACT;AAEA,MAAMC,UAAA,GAAaA,CAACH,KAAA,EAAcO,KAAA,GAAQ,OA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ACA,oBACA,oBACA,oBACA,6BACA,mBACA,uBACA,sBACA,cACA,cACA,aACA,cACA,WACA,yBACF;EAKMC,gBAAA,GAAmB,IAAIC,MAAA,CAAOF,sCAAA,CAAuCG,IAAA,CAAK,GAAG,CAAC;EAE9EC,wBAAA,GAA2B;EAAA;EAAA;EAG/B,yBACA,kCACF;EAEMC,8BAAA,GAAiC,IAAIH,MAAA,CACzCE,wBAAA,CAAyBE,GAAA,CAAKC,CAAA,IAAMA,CAAA,CAAEC,OAAA,CAAQ,OAAO,GAAG,CAAC,EAAEL,IAAA,CAAK,GAAG,CACrE;AAEA,SAAS7C,sBAAsB;EAAEO,IAAA;EAAMD;AAAG,GAAU;EAClD,OAAKpB,aAAA,CAAciE,gBAAA,GAGf,IAACJ,8BAAA,CAA+Bd,IAAA,CAAK3B,EAAE,KAAKqC,gBAAA,CAAiBV,IAAA,CAAK1B,IAAI,KAFjE;AAOX","ignoreList":[]}
@@ -0,0 +1,125 @@
1
+ import babel from "@babel/core";
2
+ import { relative } from "node:path";
3
+ import { configuration } from "./configure";
4
+ import { asyncGeneratorRegex, debug } from "./constants";
5
+ function getBabelOptions(props) {
6
+ if (props.userSetting === "babel")
7
+ return {
8
+ plugins: getPlugins(props, !0)
9
+ };
10
+ if (typeof props.userSetting > "u" || typeof props.userSetting == "object" && props.userSetting.transform === "babel") {
11
+ var _props_userSetting;
12
+ if (!((_props_userSetting = props.userSetting) === null || _props_userSetting === void 0) && _props_userSetting.excludeDefaultPlugins)
13
+ return props.userSetting;
14
+ var plugins = getPlugins(props);
15
+ if (plugins.length)
16
+ return {
17
+ plugins
18
+ };
19
+ }
20
+ return null;
21
+ }
22
+ var getPlugins = function(props) {
23
+ var force = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : !1, plugins = [];
24
+ return (force || shouldBabelGenerators(props)) && (plugins = getBasePlugins(props)), shouldBabelReanimated(props) && (debug === null || debug === void 0 || debug("Using babel reanimated on file"), plugins.push("react-native-reanimated/plugin")), shouldBabelReactCompiler(props) && (debug === null || debug === void 0 || debug("Using babel react compiler on file"), plugins.push(getBabelReactCompilerPlugin(props))), shouldBabelReactNativeCodegen(props) && (debug === null || debug === void 0 || debug("Using babel @react-native/babel-plugin-codegen on file"), plugins.push("@react-native/babel-plugin-codegen")), plugins;
25
+ };
26
+ async function transformBabel(id, code, options) {
27
+ var _options_plugins, compilerPlugin = (_options_plugins = options.plugins) === null || _options_plugins === void 0 ? void 0 : _options_plugins.find(function(x) {
28
+ return x && x[0] === "babel-plugin-react-compiler";
29
+ }), out = await new Promise(function(res, rej) {
30
+ babel.transform(code, {
31
+ filename: id,
32
+ compact: !1,
33
+ minified: !1,
34
+ presets: [
35
+ "@babel/preset-typescript"
36
+ ],
37
+ ...options
38
+ }, function(err, result) {
39
+ if (!result || err)
40
+ return rej(err || "no res");
41
+ res(result.code);
42
+ });
43
+ });
44
+ return compilerPlugin && out.includes(compilerPlugin[1] === "18" ? "react-compiler-runtime" : "react/compiler-runtime") && console.info(` \u{1FA84} [compiler] ${relative(process.cwd(), id)}`), out;
45
+ }
46
+ var getBasePlugins = function(param) {
47
+ var { development } = param;
48
+ return [
49
+ [
50
+ "@babel/plugin-transform-destructuring"
51
+ ],
52
+ [
53
+ "@babel/plugin-transform-react-jsx",
54
+ {
55
+ development
56
+ }
57
+ ],
58
+ [
59
+ "@babel/plugin-transform-async-generator-functions"
60
+ ],
61
+ [
62
+ "@babel/plugin-transform-async-to-generator"
63
+ ],
64
+ [
65
+ "@babel/plugin-transform-runtime",
66
+ {
67
+ helpers: !0,
68
+ // NOTE THIS WAS SPELLED WRONG BEFOER THIS COMMIT MAYBE IT WAS UNINTENTIONALLY WORKING
69
+ regenerator: !1
70
+ }
71
+ ]
72
+ ];
73
+ }, NATIVE_COMPONENT_RE = /NativeComponent\.[jt]sx?$/, SPEC_FILE_RE = /[\/\\]specs?[\/\\]/, shouldBabelReactNativeCodegen = function(param) {
74
+ var { id, environment } = param;
75
+ return (environment === "ios" || environment === "android") && (NATIVE_COMPONENT_RE.test(id) || SPEC_FILE_RE.test(id));
76
+ }, shouldBabelReactCompiler = function(props) {
77
+ return !(!configuration.enableCompiler || Array.isArray(configuration.enableCompiler) && !configuration.enableCompiler.includes(props.environment) || !/.*(.tsx?)$/.test(props.id) || props.code.startsWith("// disable-compiler"));
78
+ }, getBabelReactCompilerPlugin = function(props) {
79
+ var target = props.reactForRNVersion === "18" && (props.environment === "ios" || props.environment === "android") ? "18" : "19";
80
+ return [
81
+ "babel-plugin-react-compiler",
82
+ {
83
+ target
84
+ }
85
+ ];
86
+ };
87
+ function shouldBabelGenerators(param) {
88
+ var { code } = param;
89
+ if (process.env.VXRN_USE_BABEL_FOR_GENERATORS)
90
+ return asyncGeneratorRegex.test(code);
91
+ }
92
+ var REANIMATED_AUTOWORKLETIZATION_KEYWORDS = [
93
+ "worklet",
94
+ "useAnimatedGestureHandler",
95
+ "useAnimatedScrollHandler",
96
+ "useFrameCallback",
97
+ "useAnimatedStyle",
98
+ "useAnimatedProps",
99
+ "createAnimatedPropAdapter",
100
+ "useDerivedValue",
101
+ "useAnimatedReaction",
102
+ "useWorkletCallback",
103
+ "withTiming",
104
+ "withSpring",
105
+ "withDecay",
106
+ "withRepeat",
107
+ "runOnUI",
108
+ "executeOnUIRuntimeSync"
109
+ ], REANIMATED_REGEX = new RegExp(REANIMATED_AUTOWORKLETIZATION_KEYWORDS.join("|")), REANIMATED_IGNORED_PATHS = [
110
+ // React and React Native libraries are not likely to use reanimated.
111
+ // This can also avoid the "[BABEL] Note: The code generator has deoptimised the styling of ... as it exceeds the max of 500KB" warning since the react-native source code also contains `useAnimatedProps`.
112
+ "react-native-prebuilt",
113
+ "node_modules/.vxrn/react-native"
114
+ ], REANIMATED_IGNORED_PATHS_REGEX = new RegExp(REANIMATED_IGNORED_PATHS.map(function(s) {
115
+ return s.replace(/\//g, "/");
116
+ }).join("|"));
117
+ function shouldBabelReanimated(param) {
118
+ var { code, id } = param;
119
+ return configuration.enableReanimated ? !!(!REANIMATED_IGNORED_PATHS_REGEX.test(id) && REANIMATED_REGEX.test(code)) : !1;
120
+ }
121
+ export {
122
+ getBabelOptions,
123
+ transformBabel
124
+ };
125
+ //# sourceMappingURL=transformBabel.js.map
@@ -0,0 +1,6 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../src/Users/n8/one/packages/compiler/src/transformBabel.ts"],
4
+ "mappings": "AAAA,OAAOA,WAAW;AAClB,SAASC,gBAAgB;AACzB,SAASC,qBAAqB;AAC9B,SAASC,qBAAqBC,aAAa;AAOpC,SAASC,gBAAgBC,OAAY;AAC1C,MAAIA,MAAMC,gBAAgB;AACxB,WAAO;MACLC,SAASC,WAAWH,OAAO,EAAA;IAC7B;AAEF,MACE,OAAOA,MAAMC,cAAgB,OAC5B,OAAOD,MAAMC,eAAgB,YAAYD,MAAMC,YAAYG,cAAc,SAC1E;QACIJ;AAAJ,QAAIA,wBAAAA,MAAMC,iBAAW,QAAjBD,uBAAAA,WAAAA,mBAAmBK;AACrB,aAAOL,MAAMC;AAEf,QAAMC,UAAUC,WAAWH,KAAAA;AAC3B,QAAIE,QAAQI;AACV,aAAO;QACLJ;MACF;EAEJ;AACA,SAAO;AACT;AAEA,IAAMC,aAAa,SAACH,OAAAA;MAAcO,QAAAA,UAAAA,SAAAA,KAAAA,UAAAA,CAAAA,MAAAA,SAAAA,UAAAA,CAAAA,IAAQ,IACpCL,UAA8B,CAAA;AAElC,UAAIK,SAASC,sBAAsBR,KAAAA,OACjCE,UAAUO,eAAeT,KAAAA,IAGvBU,sBAAsBV,KAAAA,MACxBF,UAAAA,QAAAA,UAAAA,UAAAA,MAAQ,gCAAgC,GACxCI,QAAQS,KAAK,gCAAA,IAGXC,yBAAyBZ,KAAAA,MAC3BF,UAAAA,QAAAA,UAAAA,UAAAA,MAAQ,oCAAoC,GAC5CI,QAAQS,KAAKE,4BAA4Bb,KAAAA,CAAAA,IAGvCc,8BAA8Bd,KAAAA,MAChCF,UAAAA,QAAAA,UAAAA,U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C,WAAW,KAI1D,CAAC,aAAaC,KAAK3C,MAAMgB,EAAE,KAC3BhB,MAAMiB,KAAK8B,WAAW,qBAAA;AAG5B,GAEMlC,8BAA8B,SAACb,OAAAA;AACnC,MAAMgD,SACJhD,MAAMiD,sBAAsB,SAC3BjD,MAAM0C,gBAAgB,SAAS1C,MAAM0C,gBAAgB,aAClD,OACA;AAEN,SAAO;IAAC;IAA+B;MAAEM;IAAO;;AAClD;AAMA,SAASxC,sBAAsB,OAAe;MAAf,EAAES,KAAI,IAAN;AAC7B,MAAIkB,QAAQe,IAAIC;AACd,WAAOtD,oBAAoB8C,KAAK1B,IAAAA;AAEpC;AASA,IAAMmC,yCAAyC;EAC7C;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;GAMIC,mBAAmB,IAAIC,OAAOF,uCAAuCG,KAAK,GAAA,CAAA,GAE1EC,2BAA2B;;;EAG/B;EACA;GAGIC,iCAAiC,IAAIH,OACzCE,yBAAyBE,IAAI,SAACC,GAAAA;SAAMA,EAAEC,QAAQ,OAAO,GAAA;GAAML,KAAK,GAAA,CAAA;AAGlE,SAAS7C,sBAAsB,OAAmB;MAAnB,EAAEO,MAAMD,GAAE,IAAV;AAC7B,SAAKpB,cAAciE,mBAGf,IAACJ,+BAA+Bd,KAAK3B,EAAAA,KAAOqC,iBAAiBV,KAAK1B,IAAAA,KAF7D;AAOX;",
5
+ "names": ["babel", "relative", "configuration", "asyncGeneratorRegex", "debug", "getBabelOptions", "props", "userSetting", "plugins", "getPlugins", "transform", "excludeDefaultPlugins", "length", "force", "shouldBabelGenerators", "getBasePlugins", "shouldBabelReanimated", "push", "shouldBabelReactCompiler", "getBabelReactCompilerPlugin", "shouldBabelReactNativeCodegen", "transformBabel", "id", "code", "options", "compilerPlugin", "find", "x", "out", "Promise", "res", "rej", "filename", "compact", "minified", "presets", "err", "result", "includes", "console", "info", "process", "cwd", "development", "helpers", "regenerator", "NATIVE_COMPONENT_RE", "SPEC_FILE_RE", "environment", "test", "enableCompiler", "Array", "isArray", "startsWith", "target", "reactForRNVersion", "env", "VXRN_USE_BABEL_FOR_GENERATORS", "REANIMATED_AUTOWORKLETIZATION_KEYWORDS", "REANIMATED_REGEX", "RegExp", "join", "REANIMATED_IGNORED_PATHS", "REANIMATED_IGNORED_PATHS_REGEX", "map", "s", "replace", "enableReanimated"]
6
+ }