@vxrn/compiler 1.27.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 (89) hide show
  1. package/dist/cjs/cache.cjs +106 -117
  2. package/dist/cjs/configure.cjs +26 -28
  3. package/dist/cjs/constants.cjs +56 -60
  4. package/dist/cjs/index.cjs +420 -443
  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 +273 -263
  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 +90 -97
  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 -425
  28. package/dist/esm/index.js.map +1 -1
  29. package/dist/esm/index.mjs +417 -425
  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 +255 -237
  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/transformBabel.test.ts +77 -17
  63. package/src/transformBabel.ts +28 -12
  64. package/types/transformBabel.d.ts +12 -0
  65. package/types/transformBabel.d.ts.map +1 -1
  66. package/types/transformSWC.d.ts +1 -4
  67. package/types/transformSWC.d.ts.map +1 -1
  68. package/dist/cjs/transformBabel.test.cjs +0 -652
  69. package/dist/cjs/transformHermesLoops.test.cjs +0 -257
  70. package/dist/cjs/transformSWC.test.cjs +0 -117
  71. package/dist/cjs/transformWorklets.test.cjs +0 -604
  72. package/dist/esm/transformBabel.test.mjs +0 -629
  73. package/dist/esm/transformBabel.test.mjs.map +0 -1
  74. package/dist/esm/transformHermesLoops.test.mjs +0 -234
  75. package/dist/esm/transformHermesLoops.test.mjs.map +0 -1
  76. package/dist/esm/transformSWC.test.mjs +0 -118
  77. package/dist/esm/transformSWC.test.mjs.map +0 -1
  78. package/dist/esm/transformWorklets.test.mjs +0 -581
  79. package/dist/esm/transformWorklets.test.mjs.map +0 -1
  80. package/dist/esm/types.mjs.map +0 -1
  81. package/dist/esm/worklets/types.mjs.map +0 -1
  82. package/types/transformBabel.test.d.ts +0 -2
  83. package/types/transformBabel.test.d.ts.map +0 -1
  84. package/types/transformHermesLoops.test.d.ts +0 -2
  85. package/types/transformHermesLoops.test.d.ts.map +0 -1
  86. package/types/transformSWC.test.d.ts +0 -2
  87. package/types/transformSWC.test.d.ts.map +0 -1
  88. package/types/transformWorklets.test.d.ts +0 -2
  89. 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,122 +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
47
  function getConfigFingerprint(userBabelConfigPath) {
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
- // transform output depends on the user babel config when one applies,
59
- // so its identity joins the fingerprint. adding, removing, or editing
60
- // babel.config.* must miss entries written without that change.
61
- babelConfig: getBabelConfigIdentity(userBabelConfigPath),
62
- // bump when the transform engine changes, so entries written by a
63
- // previous engine aren't served for the same source
64
- engine: "oxc-worklets-hermes-async"
65
- })).digest("hex").slice(0, 8);
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);
66
57
  }
67
58
  function getBabelConfigIdentity(configPath) {
68
- if (!configPath) return null;
69
- try {
70
- const mtime = (0, import_node_fs.statSync)(configPath).mtimeMs;
71
- const hash = (0, import_node_crypto.createHash)("sha1").update((0, import_node_fs.readFileSync)(configPath)).digest("hex").slice(0, 16);
72
- return `${configPath}:${mtime}:${hash}`;
73
- } catch {
74
- return configPath;
75
- }
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
+ }
76
67
  }
77
68
  function getCacheKey(filePath, environment, userBabelConfigPath) {
78
- const hash = (0, import_node_crypto.createHash)("sha1").update(`${environment}:${filePath}:${getConfigFingerprint(userBabelConfigPath)}`).digest("hex");
79
- return hash;
69
+ const hash = (0, import_node_crypto.createHash)("sha1").update(`${environment}:${filePath}:${getConfigFingerprint(userBabelConfigPath)}`).digest("hex");
70
+ return hash;
80
71
  }
81
72
  function getContentHash(code) {
82
- 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);
83
74
  }
84
75
  function getCachedTransform(filePath, code, environment, userBabelConfigPath) {
85
- try {
86
- const cleanPath = filePath.startsWith("\0") ? filePath.slice(1) : filePath;
87
- const cacheDir = getCacheDir();
88
- const cacheKey = getCacheKey(cleanPath, environment, userBabelConfigPath);
89
- const cachePath = (0, import_node_path.join)(cacheDir, `${cacheKey}.json`);
90
- if (!(0, import_node_fs.existsSync)(cachePath)) {
91
- stats.misses++;
92
- return null;
93
- }
94
- const cached = JSON.parse((0, import_node_fs.readFileSync)(cachePath, "utf-8"));
95
- const currentMtime = (0, import_node_fs.statSync)(cleanPath).mtimeMs;
96
- if (cached.mtime !== currentMtime) {
97
- stats.misses++;
98
- return null;
99
- }
100
- const currentHash = getContentHash(code);
101
- if (cached.hash !== currentHash) {
102
- stats.misses++;
103
- return null;
104
- }
105
- stats.hits++;
106
- return {
107
- code: cached.code,
108
- map: cached.map
109
- };
110
- } catch (err) {
111
- stats.misses++;
112
- return null;
113
- }
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
+ }
114
105
  }
115
106
  function setCachedTransform(filePath, code, result, environment, userBabelConfigPath) {
116
- try {
117
- const cleanPath = filePath.startsWith("\0") ? filePath.slice(1) : filePath;
118
- const cacheDir = getCacheDir();
119
- const cacheKey = getCacheKey(cleanPath, environment, userBabelConfigPath);
120
- const cachePath = (0, import_node_path.join)(cacheDir, `${cacheKey}.json`);
121
- const mtime = (0, import_node_fs.statSync)(cleanPath).mtimeMs;
122
- const hash = getContentHash(code);
123
- const entry = {
124
- mtime,
125
- hash,
126
- code: result.code,
127
- map: result.map
128
- };
129
- (0, import_node_fs.writeFileSync)(cachePath, JSON.stringify(entry), "utf-8");
130
- stats.writes++;
131
- } catch (err) {
132
- console.warn(`[cache] Failed to write cache for ${filePath}:`, err);
133
- }
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
+ }
134
125
  }
135
126
  function clearTransformCache() {
136
- (0, import_node_fs.rmSync)(getCacheDir(), {
137
- recursive: true,
138
- force: true
139
- });
127
+ (0, import_node_fs.rmSync)(getCacheDir(), {
128
+ recursive: true,
129
+ force: true
130
+ });
140
131
  }
141
132
  function getCacheStats() {
142
- return {
143
- ...stats
144
- };
133
+ return { ...stats };
145
134
  }
146
135
  function logCacheStats() {
147
- if (!process.env.DEBUG_COMPILER_PERF) {
148
- return;
149
- }
150
- const total = stats.hits + stats.misses;
151
- if (total === 0) return;
152
- const hitRate = (stats.hits / total * 100).toFixed(1);
153
- 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(`
154
143
  \u{1F4BE} [Cache Stats] ${stats.hits} hits / ${stats.misses} misses (${hitRate}% hit rate), ${stats.writes} writes`);
155
- }
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"]);