@vxrn/compiler 2.0.0-beta.33.1 → 2.0.0-beta.45.1

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 (94) hide show
  1. package/dist/cjs/cache.cjs +112 -109
  2. package/dist/cjs/configure.cjs +26 -28
  3. package/dist/cjs/constants.cjs +56 -60
  4. package/dist/cjs/index.cjs +420 -438
  5. package/dist/cjs/reactNativeCodegen.cjs +105 -114
  6. package/dist/cjs/reactNativeViewConfig.cjs +362 -381
  7. package/dist/cjs/refresh-runtime.cjs +390 -397
  8. package/dist/cjs/transformBabel.cjs +278 -218
  9. package/dist/cjs/transformHermesAsync.cjs +36 -47
  10. package/dist/cjs/transformHermesLoops.cjs +279 -281
  11. package/dist/cjs/transformSWC.cjs +183 -200
  12. package/dist/cjs/transformWorklets.cjs +107 -95
  13. package/dist/cjs/types.cjs +9 -11
  14. package/dist/cjs/worklets/autoworklet.cjs +277 -222
  15. package/dist/cjs/worklets/globals.cjs +124 -60
  16. package/dist/cjs/worklets/hash.cjs +23 -27
  17. package/dist/cjs/worklets/scope.cjs +338 -359
  18. package/dist/cjs/worklets/serialize.cjs +73 -75
  19. package/dist/cjs/worklets/transform.cjs +217 -222
  20. package/dist/cjs/worklets/types.cjs +9 -11
  21. package/dist/esm/cache.mjs +96 -89
  22. package/dist/esm/cache.mjs.map +1 -1
  23. package/dist/esm/configure.mjs +11 -10
  24. package/dist/esm/configure.mjs.map +1 -1
  25. package/dist/esm/constants.mjs +41 -41
  26. package/dist/esm/constants.mjs.map +1 -1
  27. package/dist/esm/index.js +417 -420
  28. package/dist/esm/index.js.map +1 -1
  29. package/dist/esm/index.mjs +417 -420
  30. package/dist/esm/index.mjs.map +1 -1
  31. package/dist/esm/reactNativeCodegen.mjs +90 -88
  32. package/dist/esm/reactNativeCodegen.mjs.map +1 -1
  33. package/dist/esm/reactNativeViewConfig.mjs +347 -362
  34. package/dist/esm/reactNativeViewConfig.mjs.map +1 -1
  35. package/dist/esm/refresh-runtime.mjs +372 -376
  36. package/dist/esm/refresh-runtime.mjs.map +1 -1
  37. package/dist/esm/transformBabel.mjs +261 -194
  38. package/dist/esm/transformBabel.mjs.map +1 -1
  39. package/dist/esm/transformHermesAsync.mjs +20 -21
  40. package/dist/esm/transformHermesAsync.mjs.map +1 -1
  41. package/dist/esm/transformHermesLoops.mjs +264 -255
  42. package/dist/esm/transformHermesLoops.mjs.map +1 -1
  43. package/dist/esm/transformSWC.mjs +163 -171
  44. package/dist/esm/transformSWC.mjs.map +1 -1
  45. package/dist/esm/transformWorklets.mjs +89 -69
  46. package/dist/esm/transformWorklets.mjs.map +1 -1
  47. package/dist/esm/types.mjs +0 -2
  48. package/dist/esm/worklets/autoworklet.mjs +258 -200
  49. package/dist/esm/worklets/autoworklet.mjs.map +1 -1
  50. package/dist/esm/worklets/globals.mjs +109 -42
  51. package/dist/esm/worklets/globals.mjs.map +1 -1
  52. package/dist/esm/worklets/hash.mjs +10 -9
  53. package/dist/esm/worklets/hash.mjs.map +1 -1
  54. package/dist/esm/worklets/scope.mjs +325 -341
  55. package/dist/esm/worklets/scope.mjs.map +1 -1
  56. package/dist/esm/worklets/serialize.mjs +60 -58
  57. package/dist/esm/worklets/serialize.mjs.map +1 -1
  58. package/dist/esm/worklets/transform.mjs +201 -197
  59. package/dist/esm/worklets/transform.mjs.map +1 -1
  60. package/dist/esm/worklets/types.mjs +0 -2
  61. package/package.json +7 -6
  62. package/src/cache.ts +37 -7
  63. package/src/index.ts +33 -18
  64. package/src/transformBabel.test.ts +311 -1
  65. package/src/transformBabel.ts +110 -13
  66. package/types/cache.d.ts +2 -2
  67. package/types/cache.d.ts.map +1 -1
  68. package/types/index.d.ts.map +1 -1
  69. package/types/transformBabel.d.ts +16 -1
  70. package/types/transformBabel.d.ts.map +1 -1
  71. package/types/transformSWC.d.ts +1 -4
  72. package/types/transformSWC.d.ts.map +1 -1
  73. package/dist/cjs/transformBabel.test.cjs +0 -360
  74. package/dist/cjs/transformHermesLoops.test.cjs +0 -257
  75. package/dist/cjs/transformSWC.test.cjs +0 -117
  76. package/dist/cjs/transformWorklets.test.cjs +0 -604
  77. package/dist/esm/transformBabel.test.mjs +0 -337
  78. package/dist/esm/transformBabel.test.mjs.map +0 -1
  79. package/dist/esm/transformHermesLoops.test.mjs +0 -234
  80. package/dist/esm/transformHermesLoops.test.mjs.map +0 -1
  81. package/dist/esm/transformSWC.test.mjs +0 -118
  82. package/dist/esm/transformSWC.test.mjs.map +0 -1
  83. package/dist/esm/transformWorklets.test.mjs +0 -581
  84. package/dist/esm/transformWorklets.test.mjs.map +0 -1
  85. package/dist/esm/types.mjs.map +0 -1
  86. package/dist/esm/worklets/types.mjs.map +0 -1
  87. package/types/transformBabel.test.d.ts +0 -2
  88. package/types/transformBabel.test.d.ts.map +0 -1
  89. package/types/transformHermesLoops.test.d.ts +0 -2
  90. package/types/transformHermesLoops.test.d.ts.map +0 -1
  91. package/types/transformSWC.test.d.ts +0 -2
  92. package/types/transformSWC.test.d.ts.map +0 -1
  93. package/types/transformWorklets.test.d.ts +0 -2
  94. package/types/transformWorklets.test.d.ts.map +0 -1
@@ -3,30 +3,28 @@ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
3
3
  var __getOwnPropNames = Object.getOwnPropertyNames;
4
4
  var __hasOwnProp = Object.prototype.hasOwnProperty;
5
5
  var __export = (target, all) => {
6
- for (var name in all) __defProp(target, name, {
7
- get: all[name],
8
- enumerable: true
9
- });
6
+ for (var name in all) __defProp(target, name, {
7
+ get: all[name],
8
+ enumerable: true
9
+ });
10
10
  };
11
11
  var __copyProps = (to, from, except, desc) => {
12
- if (from && typeof from === "object" || typeof from === "function") {
13
- for (let key of __getOwnPropNames(from)) if (!__hasOwnProp.call(to, key) && key !== except) __defProp(to, key, {
14
- get: () => from[key],
15
- enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
16
- });
17
- }
18
- return to;
12
+ if (from && typeof from === "object" || typeof from === "function") {
13
+ for (let key of __getOwnPropNames(from)) if (!__hasOwnProp.call(to, key) && key !== except) __defProp(to, key, {
14
+ get: () => from[key],
15
+ enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
16
+ });
17
+ }
18
+ return to;
19
19
  };
20
- var __toCommonJS = mod => __copyProps(__defProp({}, "__esModule", {
21
- value: true
22
- }), mod);
20
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
23
21
  var cache_exports = {};
24
22
  __export(cache_exports, {
25
- clearTransformCache: () => clearTransformCache,
26
- getCacheStats: () => getCacheStats,
27
- getCachedTransform: () => getCachedTransform,
28
- logCacheStats: () => logCacheStats,
29
- setCachedTransform: () => setCachedTransform
23
+ clearTransformCache: () => clearTransformCache,
24
+ getCacheStats: () => getCacheStats,
25
+ getCachedTransform: () => getCachedTransform,
26
+ logCacheStats: () => logCacheStats,
27
+ setCachedTransform: () => setCachedTransform
30
28
  });
31
29
  module.exports = __toCommonJS(cache_exports);
32
30
  var import_node_crypto = require("node:crypto");
@@ -34,108 +32,113 @@ var import_node_fs = require("node:fs");
34
32
  var import_node_path = require("node:path");
35
33
  var import_configure = require("./configure.cjs");
36
34
  const stats = {
37
- hits: 0,
38
- misses: 0,
39
- writes: 0,
40
- errors: 0
35
+ hits: 0,
36
+ misses: 0,
37
+ writes: 0,
38
+ errors: 0
41
39
  };
42
40
  function getCacheDir() {
43
- const cacheDir = (0, import_node_path.join)(process.cwd(), "node_modules", ".vxrn", "compiler-cache");
44
- if (!(0, import_node_fs.existsSync)(cacheDir)) {
45
- (0, import_node_fs.mkdirSync)(cacheDir, {
46
- recursive: true
47
- });
48
- }
49
- return cacheDir;
41
+ const cacheDir = (0, import_node_path.join)(process.cwd(), "node_modules", ".vxrn", "compiler-cache");
42
+ if (!(0, import_node_fs.existsSync)(cacheDir)) {
43
+ (0, import_node_fs.mkdirSync)(cacheDir, { recursive: true });
44
+ }
45
+ return cacheDir;
50
46
  }
51
- function getConfigFingerprint() {
52
- return (0, import_node_crypto.createHash)("sha1").update(JSON.stringify({
53
- compiler: import_configure.configuration.enableCompiler,
54
- reanimated: import_configure.configuration.enableReanimated,
55
- nativeWorklets: (0, import_configure.isNativeWorkletsEnabled)(),
56
- nativewind: import_configure.configuration.enableNativewind,
57
- nativeCSS: import_configure.configuration.enableNativeCSS,
58
- // bump when the transform engine changes, so entries written by a
59
- // previous engine aren't served for the same source
60
- engine: "oxc-worklets-hermes-async"
61
- })).digest("hex").slice(0, 8);
47
+ function getConfigFingerprint(userBabelConfigPath) {
48
+ return (0, import_node_crypto.createHash)("sha1").update(JSON.stringify({
49
+ compiler: import_configure.configuration.enableCompiler,
50
+ reanimated: import_configure.configuration.enableReanimated,
51
+ nativeWorklets: (0, import_configure.isNativeWorkletsEnabled)(),
52
+ nativewind: import_configure.configuration.enableNativewind,
53
+ nativeCSS: import_configure.configuration.enableNativeCSS,
54
+ babelConfig: getBabelConfigIdentity(userBabelConfigPath),
55
+ engine: "oxc-worklets-hermes-async"
56
+ })).digest("hex").slice(0, 8);
62
57
  }
63
- function getCacheKey(filePath, environment) {
64
- const hash = (0, import_node_crypto.createHash)("sha1").update(`${environment}:${filePath}:${getConfigFingerprint()}`).digest("hex");
65
- return hash;
58
+ function getBabelConfigIdentity(configPath) {
59
+ if (!configPath) return null;
60
+ try {
61
+ const mtime = (0, import_node_fs.statSync)(configPath).mtimeMs;
62
+ const hash = (0, import_node_crypto.createHash)("sha1").update((0, import_node_fs.readFileSync)(configPath)).digest("hex").slice(0, 16);
63
+ return `${configPath}:${mtime}:${hash}`;
64
+ } catch {
65
+ return configPath;
66
+ }
67
+ }
68
+ function getCacheKey(filePath, environment, userBabelConfigPath) {
69
+ const hash = (0, import_node_crypto.createHash)("sha1").update(`${environment}:${filePath}:${getConfigFingerprint(userBabelConfigPath)}`).digest("hex");
70
+ return hash;
66
71
  }
67
72
  function getContentHash(code) {
68
- return (0, import_node_crypto.createHash)("sha1").update(code).digest("hex").slice(0, 16);
73
+ return (0, import_node_crypto.createHash)("sha1").update(code).digest("hex").slice(0, 16);
69
74
  }
70
- function getCachedTransform(filePath, code, environment) {
71
- try {
72
- const cleanPath = filePath.startsWith("\0") ? filePath.slice(1) : filePath;
73
- const cacheDir = getCacheDir();
74
- const cacheKey = getCacheKey(cleanPath, environment);
75
- const cachePath = (0, import_node_path.join)(cacheDir, `${cacheKey}.json`);
76
- if (!(0, import_node_fs.existsSync)(cachePath)) {
77
- stats.misses++;
78
- return null;
79
- }
80
- const cached = JSON.parse((0, import_node_fs.readFileSync)(cachePath, "utf-8"));
81
- const currentMtime = (0, import_node_fs.statSync)(cleanPath).mtimeMs;
82
- if (cached.mtime !== currentMtime) {
83
- stats.misses++;
84
- return null;
85
- }
86
- const currentHash = getContentHash(code);
87
- if (cached.hash !== currentHash) {
88
- stats.misses++;
89
- return null;
90
- }
91
- stats.hits++;
92
- return {
93
- code: cached.code,
94
- map: cached.map
95
- };
96
- } catch (err) {
97
- stats.misses++;
98
- return null;
99
- }
75
+ function getCachedTransform(filePath, code, environment, userBabelConfigPath) {
76
+ try {
77
+ const cleanPath = filePath.startsWith("\0") ? filePath.slice(1) : filePath;
78
+ const cacheDir = getCacheDir();
79
+ const cacheKey = getCacheKey(cleanPath, environment, userBabelConfigPath);
80
+ const cachePath = (0, import_node_path.join)(cacheDir, `${cacheKey}.json`);
81
+ if (!(0, import_node_fs.existsSync)(cachePath)) {
82
+ stats.misses++;
83
+ return null;
84
+ }
85
+ const cached = JSON.parse((0, import_node_fs.readFileSync)(cachePath, "utf-8"));
86
+ const currentMtime = (0, import_node_fs.statSync)(cleanPath).mtimeMs;
87
+ if (cached.mtime !== currentMtime) {
88
+ stats.misses++;
89
+ return null;
90
+ }
91
+ const currentHash = getContentHash(code);
92
+ if (cached.hash !== currentHash) {
93
+ stats.misses++;
94
+ return null;
95
+ }
96
+ stats.hits++;
97
+ return {
98
+ code: cached.code,
99
+ map: cached.map
100
+ };
101
+ } catch (err) {
102
+ stats.misses++;
103
+ return null;
104
+ }
100
105
  }
101
- function setCachedTransform(filePath, code, result, environment) {
102
- try {
103
- const cleanPath = filePath.startsWith("\0") ? filePath.slice(1) : filePath;
104
- const cacheDir = getCacheDir();
105
- const cacheKey = getCacheKey(cleanPath, environment);
106
- const cachePath = (0, import_node_path.join)(cacheDir, `${cacheKey}.json`);
107
- const mtime = (0, import_node_fs.statSync)(cleanPath).mtimeMs;
108
- const hash = getContentHash(code);
109
- const entry = {
110
- mtime,
111
- hash,
112
- code: result.code,
113
- map: result.map
114
- };
115
- (0, import_node_fs.writeFileSync)(cachePath, JSON.stringify(entry), "utf-8");
116
- stats.writes++;
117
- } catch (err) {
118
- console.warn(`[cache] Failed to write cache for ${filePath}:`, err);
119
- }
106
+ function setCachedTransform(filePath, code, result, environment, userBabelConfigPath) {
107
+ try {
108
+ const cleanPath = filePath.startsWith("\0") ? filePath.slice(1) : filePath;
109
+ const cacheDir = getCacheDir();
110
+ const cacheKey = getCacheKey(cleanPath, environment, userBabelConfigPath);
111
+ const cachePath = (0, import_node_path.join)(cacheDir, `${cacheKey}.json`);
112
+ const mtime = (0, import_node_fs.statSync)(cleanPath).mtimeMs;
113
+ const hash = getContentHash(code);
114
+ const entry = {
115
+ mtime,
116
+ hash,
117
+ code: result.code,
118
+ map: result.map
119
+ };
120
+ (0, import_node_fs.writeFileSync)(cachePath, JSON.stringify(entry), "utf-8");
121
+ stats.writes++;
122
+ } catch (err) {
123
+ console.warn(`[cache] Failed to write cache for ${filePath}:`, err);
124
+ }
120
125
  }
121
126
  function clearTransformCache() {
122
- (0, import_node_fs.rmSync)(getCacheDir(), {
123
- recursive: true,
124
- force: true
125
- });
127
+ (0, import_node_fs.rmSync)(getCacheDir(), {
128
+ recursive: true,
129
+ force: true
130
+ });
126
131
  }
127
132
  function getCacheStats() {
128
- return {
129
- ...stats
130
- };
133
+ return { ...stats };
131
134
  }
132
135
  function logCacheStats() {
133
- if (!process.env.DEBUG_COMPILER_PERF) {
134
- return;
135
- }
136
- const total = stats.hits + stats.misses;
137
- if (total === 0) return;
138
- const hitRate = (stats.hits / total * 100).toFixed(1);
139
- console.info(`
136
+ if (!process.env.DEBUG_COMPILER_PERF) {
137
+ return;
138
+ }
139
+ const total = stats.hits + stats.misses;
140
+ if (total === 0) return;
141
+ const hitRate = (stats.hits / total * 100).toFixed(1);
142
+ console.info(`
140
143
  \u{1F4BE} [Cache Stats] ${stats.hits} hits / ${stats.misses} misses (${hitRate}% hit rate), ${stats.writes} writes`);
141
- }
144
+ }
@@ -3,43 +3,41 @@ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
3
3
  var __getOwnPropNames = Object.getOwnPropertyNames;
4
4
  var __hasOwnProp = Object.prototype.hasOwnProperty;
5
5
  var __export = (target, all) => {
6
- for (var name in all) __defProp(target, name, {
7
- get: all[name],
8
- enumerable: true
9
- });
6
+ for (var name in all) __defProp(target, name, {
7
+ get: all[name],
8
+ enumerable: true
9
+ });
10
10
  };
11
11
  var __copyProps = (to, from, except, desc) => {
12
- if (from && typeof from === "object" || typeof from === "function") {
13
- for (let key of __getOwnPropNames(from)) if (!__hasOwnProp.call(to, key) && key !== except) __defProp(to, key, {
14
- get: () => from[key],
15
- enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
16
- });
17
- }
18
- return to;
12
+ if (from && typeof from === "object" || typeof from === "function") {
13
+ for (let key of __getOwnPropNames(from)) if (!__hasOwnProp.call(to, key) && key !== except) __defProp(to, key, {
14
+ get: () => from[key],
15
+ enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
16
+ });
17
+ }
18
+ return to;
19
19
  };
20
- var __toCommonJS = mod => __copyProps(__defProp({}, "__esModule", {
21
- value: true
22
- }), mod);
20
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
23
21
  var configure_exports = {};
24
22
  __export(configure_exports, {
25
- configuration: () => configuration,
26
- configureVXRNCompilerPlugin: () => configureVXRNCompilerPlugin,
27
- isNativeWorkletsEnabled: () => isNativeWorkletsEnabled
23
+ configuration: () => configuration,
24
+ configureVXRNCompilerPlugin: () => configureVXRNCompilerPlugin,
25
+ isNativeWorkletsEnabled: () => isNativeWorkletsEnabled
28
26
  });
29
27
  module.exports = __toCommonJS(configure_exports);
30
28
  const configuration = {
31
- enableNativewind: false,
32
- enableReanimated: false,
33
- enableNativeWorklets: true,
34
- enableCompiler: false,
35
- enableNativeCSS: false
29
+ enableNativewind: false,
30
+ enableReanimated: false,
31
+ enableNativeWorklets: true,
32
+ enableCompiler: false,
33
+ enableNativeCSS: false
36
34
  };
37
35
  function isNativeWorkletsEnabled() {
38
- if (process.env.VXRN_NATIVE_WORKLETS === "false" || process.env.VXRN_NATIVE_WORKLETS === "0") {
39
- return false;
40
- }
41
- return configuration.enableNativeWorklets !== false;
36
+ if (process.env.VXRN_NATIVE_WORKLETS === "false" || process.env.VXRN_NATIVE_WORKLETS === "0") {
37
+ return false;
38
+ }
39
+ return configuration.enableNativeWorklets !== false;
42
40
  }
43
41
  function configureVXRNCompilerPlugin(_) {
44
- Object.assign(configuration, _);
45
- }
42
+ Object.assign(configuration, _);
43
+ }
@@ -3,75 +3,71 @@ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
3
3
  var __getOwnPropNames = Object.getOwnPropertyNames;
4
4
  var __hasOwnProp = Object.prototype.hasOwnProperty;
5
5
  var __export = (target, all) => {
6
- for (var name in all) __defProp(target, name, {
7
- get: all[name],
8
- enumerable: true
9
- });
6
+ for (var name in all) __defProp(target, name, {
7
+ get: all[name],
8
+ enumerable: true
9
+ });
10
10
  };
11
11
  var __copyProps = (to, from, except, desc) => {
12
- if (from && typeof from === "object" || typeof from === "function") {
13
- for (let key of __getOwnPropNames(from)) if (!__hasOwnProp.call(to, key) && key !== except) __defProp(to, key, {
14
- get: () => from[key],
15
- enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
16
- });
17
- }
18
- return to;
12
+ if (from && typeof from === "object" || typeof from === "function") {
13
+ for (let key of __getOwnPropNames(from)) if (!__hasOwnProp.call(to, key) && key !== except) __defProp(to, key, {
14
+ get: () => from[key],
15
+ enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
16
+ });
17
+ }
18
+ return to;
19
19
  };
20
- var __toCommonJS = mod => __copyProps(__defProp({}, "__esModule", {
21
- value: true
22
- }), mod);
20
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
23
21
  var constants_exports = {};
24
22
  __export(constants_exports, {
25
- asyncGeneratorRegex: () => asyncGeneratorRegex,
26
- debug: () => debug,
27
- parsers: () => parsers,
28
- runtimePublicPath: () => runtimePublicPath,
29
- validParsers: () => validParsers
23
+ asyncGeneratorRegex: () => asyncGeneratorRegex,
24
+ debug: () => debug,
25
+ parsers: () => parsers,
26
+ runtimePublicPath: () => runtimePublicPath,
27
+ validParsers: () => validParsers
30
28
  });
31
29
  module.exports = __toCommonJS(constants_exports);
32
30
  var import_utils = require("@vxrn/utils");
33
- const {
34
- debug
35
- } = (0, import_utils.createDebugger)("vxrn:compiler-plugin");
31
+ const { debug } = (0, import_utils.createDebugger)("vxrn:compiler-plugin");
36
32
  const runtimePublicPath = "/@react-refresh";
37
33
  const asyncGeneratorRegex = /(async \*|async function\*|for await)/;
38
34
  const parsers = {
39
- ".tsx": {
40
- syntax: "typescript",
41
- tsx: true,
42
- decorators: true
43
- },
44
- ".ts": {
45
- syntax: "typescript",
46
- tsx: false,
47
- decorators: true
48
- },
49
- ".jsx": {
50
- syntax: "ecmascript",
51
- jsx: true,
52
- importAttributes: true,
53
- explicitResourceManagement: true
54
- },
55
- ".js": {
56
- syntax: "ecmascript",
57
- importAttributes: true,
58
- explicitResourceManagement: true
59
- },
60
- ".mjs": {
61
- syntax: "ecmascript",
62
- importAttributes: true,
63
- explicitResourceManagement: true
64
- },
65
- ".cjs": {
66
- syntax: "ecmascript",
67
- importAttributes: true,
68
- explicitResourceManagement: true
69
- },
70
- ".mdx": {
71
- syntax: "ecmascript",
72
- jsx: true,
73
- importAttributes: true,
74
- explicitResourceManagement: true
75
- }
35
+ ".tsx": {
36
+ syntax: "typescript",
37
+ tsx: true,
38
+ decorators: true
39
+ },
40
+ ".ts": {
41
+ syntax: "typescript",
42
+ tsx: false,
43
+ decorators: true
44
+ },
45
+ ".jsx": {
46
+ syntax: "ecmascript",
47
+ jsx: true,
48
+ importAttributes: true,
49
+ explicitResourceManagement: true
50
+ },
51
+ ".js": {
52
+ syntax: "ecmascript",
53
+ importAttributes: true,
54
+ explicitResourceManagement: true
55
+ },
56
+ ".mjs": {
57
+ syntax: "ecmascript",
58
+ importAttributes: true,
59
+ explicitResourceManagement: true
60
+ },
61
+ ".cjs": {
62
+ syntax: "ecmascript",
63
+ importAttributes: true,
64
+ explicitResourceManagement: true
65
+ },
66
+ ".mdx": {
67
+ syntax: "ecmascript",
68
+ jsx: true,
69
+ importAttributes: true,
70
+ explicitResourceManagement: true
71
+ }
76
72
  };
77
- const validParsers = /* @__PURE__ */new Set([...Object.keys(parsers), ".css"]);
73
+ const validParsers = /* @__PURE__ */ new Set([...Object.keys(parsers), ".css"]);