@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.
- package/dist/cjs/cache.cjs +112 -109
- package/dist/cjs/configure.cjs +26 -28
- package/dist/cjs/constants.cjs +56 -60
- package/dist/cjs/index.cjs +420 -438
- package/dist/cjs/reactNativeCodegen.cjs +105 -114
- package/dist/cjs/reactNativeViewConfig.cjs +362 -381
- package/dist/cjs/refresh-runtime.cjs +390 -397
- package/dist/cjs/transformBabel.cjs +278 -218
- package/dist/cjs/transformHermesAsync.cjs +36 -47
- package/dist/cjs/transformHermesLoops.cjs +279 -281
- package/dist/cjs/transformSWC.cjs +183 -200
- package/dist/cjs/transformWorklets.cjs +107 -95
- package/dist/cjs/types.cjs +9 -11
- package/dist/cjs/worklets/autoworklet.cjs +277 -222
- package/dist/cjs/worklets/globals.cjs +124 -60
- package/dist/cjs/worklets/hash.cjs +23 -27
- package/dist/cjs/worklets/scope.cjs +338 -359
- package/dist/cjs/worklets/serialize.cjs +73 -75
- package/dist/cjs/worklets/transform.cjs +217 -222
- package/dist/cjs/worklets/types.cjs +9 -11
- package/dist/esm/cache.mjs +96 -89
- package/dist/esm/cache.mjs.map +1 -1
- package/dist/esm/configure.mjs +11 -10
- package/dist/esm/configure.mjs.map +1 -1
- package/dist/esm/constants.mjs +41 -41
- package/dist/esm/constants.mjs.map +1 -1
- package/dist/esm/index.js +417 -420
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/index.mjs +417 -420
- package/dist/esm/index.mjs.map +1 -1
- package/dist/esm/reactNativeCodegen.mjs +90 -88
- package/dist/esm/reactNativeCodegen.mjs.map +1 -1
- package/dist/esm/reactNativeViewConfig.mjs +347 -362
- package/dist/esm/reactNativeViewConfig.mjs.map +1 -1
- package/dist/esm/refresh-runtime.mjs +372 -376
- package/dist/esm/refresh-runtime.mjs.map +1 -1
- package/dist/esm/transformBabel.mjs +261 -194
- package/dist/esm/transformBabel.mjs.map +1 -1
- package/dist/esm/transformHermesAsync.mjs +20 -21
- package/dist/esm/transformHermesAsync.mjs.map +1 -1
- package/dist/esm/transformHermesLoops.mjs +264 -255
- package/dist/esm/transformHermesLoops.mjs.map +1 -1
- package/dist/esm/transformSWC.mjs +163 -171
- package/dist/esm/transformSWC.mjs.map +1 -1
- package/dist/esm/transformWorklets.mjs +89 -69
- package/dist/esm/transformWorklets.mjs.map +1 -1
- package/dist/esm/types.mjs +0 -2
- package/dist/esm/worklets/autoworklet.mjs +258 -200
- package/dist/esm/worklets/autoworklet.mjs.map +1 -1
- package/dist/esm/worklets/globals.mjs +109 -42
- package/dist/esm/worklets/globals.mjs.map +1 -1
- package/dist/esm/worklets/hash.mjs +10 -9
- package/dist/esm/worklets/hash.mjs.map +1 -1
- package/dist/esm/worklets/scope.mjs +325 -341
- package/dist/esm/worklets/scope.mjs.map +1 -1
- package/dist/esm/worklets/serialize.mjs +60 -58
- package/dist/esm/worklets/serialize.mjs.map +1 -1
- package/dist/esm/worklets/transform.mjs +201 -197
- package/dist/esm/worklets/transform.mjs.map +1 -1
- package/dist/esm/worklets/types.mjs +0 -2
- package/package.json +7 -6
- package/src/cache.ts +37 -7
- package/src/index.ts +33 -18
- package/src/transformBabel.test.ts +311 -1
- package/src/transformBabel.ts +110 -13
- package/types/cache.d.ts +2 -2
- package/types/cache.d.ts.map +1 -1
- package/types/index.d.ts.map +1 -1
- package/types/transformBabel.d.ts +16 -1
- package/types/transformBabel.d.ts.map +1 -1
- package/types/transformSWC.d.ts +1 -4
- package/types/transformSWC.d.ts.map +1 -1
- package/dist/cjs/transformBabel.test.cjs +0 -360
- package/dist/cjs/transformHermesLoops.test.cjs +0 -257
- package/dist/cjs/transformSWC.test.cjs +0 -117
- package/dist/cjs/transformWorklets.test.cjs +0 -604
- package/dist/esm/transformBabel.test.mjs +0 -337
- package/dist/esm/transformBabel.test.mjs.map +0 -1
- package/dist/esm/transformHermesLoops.test.mjs +0 -234
- package/dist/esm/transformHermesLoops.test.mjs.map +0 -1
- package/dist/esm/transformSWC.test.mjs +0 -118
- package/dist/esm/transformSWC.test.mjs.map +0 -1
- package/dist/esm/transformWorklets.test.mjs +0 -581
- package/dist/esm/transformWorklets.test.mjs.map +0 -1
- package/dist/esm/types.mjs.map +0 -1
- package/dist/esm/worklets/types.mjs.map +0 -1
- package/types/transformBabel.test.d.ts +0 -2
- package/types/transformBabel.test.d.ts.map +0 -1
- package/types/transformHermesLoops.test.d.ts +0 -2
- package/types/transformHermesLoops.test.d.ts.map +0 -1
- package/types/transformSWC.test.d.ts +0 -2
- package/types/transformSWC.test.d.ts.map +0 -1
- package/types/transformWorklets.test.d.ts +0 -2
- package/types/transformWorklets.test.d.ts.map +0 -1
|
@@ -3,16 +3,14 @@ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
|
3
3
|
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
4
4
|
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
5
5
|
var __copyProps = (to, from, except, desc) => {
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
6
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
7
|
+
for (let key of __getOwnPropNames(from)) if (!__hasOwnProp.call(to, key) && key !== except) __defProp(to, key, {
|
|
8
|
+
get: () => from[key],
|
|
9
|
+
enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
|
|
10
|
+
});
|
|
11
|
+
}
|
|
12
|
+
return to;
|
|
13
13
|
};
|
|
14
|
-
var __toCommonJS = mod => __copyProps(__defProp({}, "__esModule", {
|
|
15
|
-
value: true
|
|
16
|
-
}), mod);
|
|
14
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
17
15
|
var types_exports = {};
|
|
18
|
-
module.exports = __toCommonJS(types_exports);
|
|
16
|
+
module.exports = __toCommonJS(types_exports);
|
package/dist/esm/cache.mjs
CHANGED
|
@@ -2,111 +2,118 @@ import { createHash } from "node:crypto";
|
|
|
2
2
|
import { existsSync, mkdirSync, readFileSync, rmSync, statSync, writeFileSync } from "node:fs";
|
|
3
3
|
import { join } from "node:path";
|
|
4
4
|
import { configuration, isNativeWorkletsEnabled } from "./configure.mjs";
|
|
5
|
+
|
|
5
6
|
const stats = {
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
7
|
+
hits: 0,
|
|
8
|
+
misses: 0,
|
|
9
|
+
writes: 0,
|
|
10
|
+
errors: 0
|
|
10
11
|
};
|
|
11
12
|
function getCacheDir() {
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
}
|
|
18
|
-
return cacheDir;
|
|
13
|
+
const cacheDir = join(process.cwd(), "node_modules", ".vxrn", "compiler-cache");
|
|
14
|
+
if (!existsSync(cacheDir)) {
|
|
15
|
+
mkdirSync(cacheDir, { recursive: true });
|
|
16
|
+
}
|
|
17
|
+
return cacheDir;
|
|
19
18
|
}
|
|
20
|
-
function getConfigFingerprint() {
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
})).digest("hex").slice(0, 8);
|
|
19
|
+
function getConfigFingerprint(userBabelConfigPath) {
|
|
20
|
+
return createHash("sha1").update(JSON.stringify({
|
|
21
|
+
compiler: configuration.enableCompiler,
|
|
22
|
+
reanimated: configuration.enableReanimated,
|
|
23
|
+
nativeWorklets: isNativeWorkletsEnabled(),
|
|
24
|
+
nativewind: configuration.enableNativewind,
|
|
25
|
+
nativeCSS: configuration.enableNativeCSS,
|
|
26
|
+
babelConfig: getBabelConfigIdentity(userBabelConfigPath),
|
|
27
|
+
engine: "oxc-worklets-hermes-async"
|
|
28
|
+
})).digest("hex").slice(0, 8);
|
|
31
29
|
}
|
|
32
|
-
function
|
|
33
|
-
|
|
34
|
-
|
|
30
|
+
function getBabelConfigIdentity(configPath) {
|
|
31
|
+
if (!configPath) return null;
|
|
32
|
+
try {
|
|
33
|
+
const mtime = statSync(configPath).mtimeMs;
|
|
34
|
+
const hash = createHash("sha1").update(readFileSync(configPath)).digest("hex").slice(0, 16);
|
|
35
|
+
return `${configPath}:${mtime}:${hash}`;
|
|
36
|
+
} catch {
|
|
37
|
+
return configPath;
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
function getCacheKey(filePath, environment, userBabelConfigPath) {
|
|
41
|
+
const hash = createHash("sha1").update(`${environment}:${filePath}:${getConfigFingerprint(userBabelConfigPath)}`).digest("hex");
|
|
42
|
+
return hash;
|
|
35
43
|
}
|
|
36
44
|
function getContentHash(code) {
|
|
37
|
-
|
|
45
|
+
return createHash("sha1").update(code).digest("hex").slice(0, 16);
|
|
38
46
|
}
|
|
39
|
-
function getCachedTransform(filePath, code, environment) {
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
47
|
+
function getCachedTransform(filePath, code, environment, userBabelConfigPath) {
|
|
48
|
+
try {
|
|
49
|
+
const cleanPath = filePath.startsWith("\0") ? filePath.slice(1) : filePath;
|
|
50
|
+
const cacheDir = getCacheDir();
|
|
51
|
+
const cacheKey = getCacheKey(cleanPath, environment, userBabelConfigPath);
|
|
52
|
+
const cachePath = join(cacheDir, `${cacheKey}.json`);
|
|
53
|
+
if (!existsSync(cachePath)) {
|
|
54
|
+
stats.misses++;
|
|
55
|
+
return null;
|
|
56
|
+
}
|
|
57
|
+
const cached = JSON.parse(readFileSync(cachePath, "utf-8"));
|
|
58
|
+
const currentMtime = statSync(cleanPath).mtimeMs;
|
|
59
|
+
if (cached.mtime !== currentMtime) {
|
|
60
|
+
stats.misses++;
|
|
61
|
+
return null;
|
|
62
|
+
}
|
|
63
|
+
const currentHash = getContentHash(code);
|
|
64
|
+
if (cached.hash !== currentHash) {
|
|
65
|
+
stats.misses++;
|
|
66
|
+
return null;
|
|
67
|
+
}
|
|
68
|
+
stats.hits++;
|
|
69
|
+
return {
|
|
70
|
+
code: cached.code,
|
|
71
|
+
map: cached.map
|
|
72
|
+
};
|
|
73
|
+
} catch (err) {
|
|
74
|
+
stats.misses++;
|
|
75
|
+
return null;
|
|
76
|
+
}
|
|
69
77
|
}
|
|
70
|
-
function setCachedTransform(filePath, code, result, environment) {
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
78
|
+
function setCachedTransform(filePath, code, result, environment, userBabelConfigPath) {
|
|
79
|
+
try {
|
|
80
|
+
const cleanPath = filePath.startsWith("\0") ? filePath.slice(1) : filePath;
|
|
81
|
+
const cacheDir = getCacheDir();
|
|
82
|
+
const cacheKey = getCacheKey(cleanPath, environment, userBabelConfigPath);
|
|
83
|
+
const cachePath = join(cacheDir, `${cacheKey}.json`);
|
|
84
|
+
const mtime = statSync(cleanPath).mtimeMs;
|
|
85
|
+
const hash = getContentHash(code);
|
|
86
|
+
const entry = {
|
|
87
|
+
mtime,
|
|
88
|
+
hash,
|
|
89
|
+
code: result.code,
|
|
90
|
+
map: result.map
|
|
91
|
+
};
|
|
92
|
+
writeFileSync(cachePath, JSON.stringify(entry), "utf-8");
|
|
93
|
+
stats.writes++;
|
|
94
|
+
} catch (err) {
|
|
95
|
+
console.warn(`[cache] Failed to write cache for ${filePath}:`, err);
|
|
96
|
+
}
|
|
89
97
|
}
|
|
90
98
|
function clearTransformCache() {
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
99
|
+
rmSync(getCacheDir(), {
|
|
100
|
+
recursive: true,
|
|
101
|
+
force: true
|
|
102
|
+
});
|
|
95
103
|
}
|
|
96
104
|
function getCacheStats() {
|
|
97
|
-
|
|
98
|
-
...stats
|
|
99
|
-
};
|
|
105
|
+
return { ...stats };
|
|
100
106
|
}
|
|
101
107
|
function logCacheStats() {
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
108
|
+
if (!process.env.DEBUG_COMPILER_PERF) {
|
|
109
|
+
return;
|
|
110
|
+
}
|
|
111
|
+
const total = stats.hits + stats.misses;
|
|
112
|
+
if (total === 0) return;
|
|
113
|
+
const hitRate = (stats.hits / total * 100).toFixed(1);
|
|
114
|
+
console.info(`
|
|
109
115
|
\u{1F4BE} [Cache Stats] ${stats.hits} hits / ${stats.misses} misses (${hitRate}% hit rate), ${stats.writes} writes`);
|
|
110
116
|
}
|
|
117
|
+
|
|
111
118
|
export { clearTransformCache, getCacheStats, getCachedTransform, logCacheStats, setCachedTransform };
|
|
112
119
|
//# sourceMappingURL=cache.mjs.map
|
package/dist/esm/cache.mjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"
|
|
1
|
+
{"version":3,"file":"cache.js","names":[],"sources":["esm/cache.js"],"sourcesContent":["import { createHash } from \"node:crypto\";\nimport {\n existsSync,\n mkdirSync,\n readFileSync,\n rmSync,\n statSync,\n writeFileSync\n} from \"node:fs\";\nimport { join } from \"node:path\";\nimport { configuration, isNativeWorkletsEnabled } from \"./configure\";\nconst stats = {\n hits: 0,\n misses: 0,\n writes: 0,\n errors: 0\n};\nfunction getCacheDir() {\n const cacheDir = join(process.cwd(), \"node_modules\", \".vxrn\", \"compiler-cache\");\n if (!existsSync(cacheDir)) {\n mkdirSync(cacheDir, { recursive: true });\n }\n return cacheDir;\n}\nfunction getConfigFingerprint(userBabelConfigPath) {\n return createHash(\"sha1\").update(\n JSON.stringify({\n compiler: configuration.enableCompiler,\n reanimated: configuration.enableReanimated,\n nativeWorklets: isNativeWorkletsEnabled(),\n nativewind: configuration.enableNativewind,\n nativeCSS: configuration.enableNativeCSS,\n // transform output depends on the user babel config when one applies,\n // so its identity joins the fingerprint. adding, removing, or editing\n // babel.config.* must miss entries written without that change.\n babelConfig: getBabelConfigIdentity(userBabelConfigPath),\n // bump when the transform engine changes, so entries written by a\n // previous engine aren't served for the same source\n engine: \"oxc-worklets-hermes-async\"\n })\n ).digest(\"hex\").slice(0, 8);\n}\nfunction getBabelConfigIdentity(configPath) {\n if (!configPath) return null;\n try {\n const mtime = statSync(configPath).mtimeMs;\n const hash = createHash(\"sha1\").update(readFileSync(configPath)).digest(\"hex\").slice(0, 16);\n return `${configPath}:${mtime}:${hash}`;\n } catch {\n return configPath;\n }\n}\nfunction getCacheKey(filePath, environment, userBabelConfigPath) {\n const hash = createHash(\"sha1\").update(`${environment}:${filePath}:${getConfigFingerprint(userBabelConfigPath)}`).digest(\"hex\");\n return hash;\n}\nfunction getContentHash(code) {\n return createHash(\"sha1\").update(code).digest(\"hex\").slice(0, 16);\n}\nfunction getCachedTransform(filePath, code, environment, userBabelConfigPath) {\n try {\n const cleanPath = filePath.startsWith(\"\\0\") ? filePath.slice(1) : filePath;\n const cacheDir = getCacheDir();\n const cacheKey = getCacheKey(cleanPath, environment, userBabelConfigPath);\n const cachePath = join(cacheDir, `${cacheKey}.json`);\n if (!existsSync(cachePath)) {\n stats.misses++;\n return null;\n }\n const cached = JSON.parse(readFileSync(cachePath, \"utf-8\"));\n const currentMtime = statSync(cleanPath).mtimeMs;\n if (cached.mtime !== currentMtime) {\n stats.misses++;\n return null;\n }\n const currentHash = getContentHash(code);\n if (cached.hash !== currentHash) {\n stats.misses++;\n return null;\n }\n stats.hits++;\n return { code: cached.code, map: cached.map };\n } catch (err) {\n stats.misses++;\n return null;\n }\n}\nfunction setCachedTransform(filePath, code, result, environment, userBabelConfigPath) {\n try {\n const cleanPath = filePath.startsWith(\"\\0\") ? filePath.slice(1) : filePath;\n const cacheDir = getCacheDir();\n const cacheKey = getCacheKey(cleanPath, environment, userBabelConfigPath);\n const cachePath = join(cacheDir, `${cacheKey}.json`);\n const mtime = statSync(cleanPath).mtimeMs;\n const hash = getContentHash(code);\n const entry = {\n mtime,\n hash,\n code: result.code,\n map: result.map\n };\n writeFileSync(cachePath, JSON.stringify(entry), \"utf-8\");\n stats.writes++;\n } catch (err) {\n console.warn(`[cache] Failed to write cache for ${filePath}:`, err);\n }\n}\nfunction clearTransformCache() {\n rmSync(getCacheDir(), { recursive: true, force: true });\n}\nfunction getCacheStats() {\n return { ...stats };\n}\nfunction logCacheStats() {\n if (!process.env.DEBUG_COMPILER_PERF) {\n return;\n }\n const total = stats.hits + stats.misses;\n if (total === 0) return;\n const hitRate = (stats.hits / total * 100).toFixed(1);\n console.info(\n `\n\\u{1F4BE} [Cache Stats] ${stats.hits} hits / ${stats.misses} misses (${hitRate}% hit rate), ${stats.writes} writes`\n );\n}\nexport {\n clearTransformCache,\n getCacheStats,\n getCachedTransform,\n logCacheStats,\n setCachedTransform\n};\n//# sourceMappingURL=cache.js.map\n"],"mappings":";;;;;;AAWA,MAAM,QAAQ;CACZ,MAAM;CACN,QAAQ;CACR,QAAQ;CACR,QAAQ;AACV;AACA,SAAS,cAAc;CACrB,MAAM,WAAW,KAAK,QAAQ,IAAI,GAAG,gBAAgB,SAAS,gBAAgB;CAC9E,IAAI,CAAC,WAAW,QAAQ,GAAG;EACzB,UAAU,UAAU,EAAE,WAAW,KAAK,CAAC;CACzC;CACA,OAAO;AACT;AACA,SAAS,q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AK,UAAU,MAAM,OAAO,WAAW,QAAQ,eAAe,MAAM,OAAO,QACzG;AACF"}
|
package/dist/esm/configure.mjs
CHANGED
|
@@ -1,18 +1,19 @@
|
|
|
1
1
|
const configuration = {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
2
|
+
enableNativewind: false,
|
|
3
|
+
enableReanimated: false,
|
|
4
|
+
enableNativeWorklets: true,
|
|
5
|
+
enableCompiler: false,
|
|
6
|
+
enableNativeCSS: false
|
|
7
7
|
};
|
|
8
8
|
function isNativeWorkletsEnabled() {
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
9
|
+
if (process.env.VXRN_NATIVE_WORKLETS === "false" || process.env.VXRN_NATIVE_WORKLETS === "0") {
|
|
10
|
+
return false;
|
|
11
|
+
}
|
|
12
|
+
return configuration.enableNativeWorklets !== false;
|
|
13
13
|
}
|
|
14
14
|
function configureVXRNCompilerPlugin(_) {
|
|
15
|
-
|
|
15
|
+
Object.assign(configuration, _);
|
|
16
16
|
}
|
|
17
|
+
|
|
17
18
|
export { configuration, configureVXRNCompilerPlugin, isNativeWorkletsEnabled };
|
|
18
19
|
//# sourceMappingURL=configure.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"
|
|
1
|
+
{"version":3,"file":"configure.js","names":[],"sources":["esm/configure.js"],"sourcesContent":["const configuration = {\n enableNativewind: false,\n enableReanimated: false,\n enableNativeWorklets: true,\n enableCompiler: false,\n enableNativeCSS: false\n};\nfunction isNativeWorkletsEnabled() {\n if (process.env.VXRN_NATIVE_WORKLETS === \"false\" || process.env.VXRN_NATIVE_WORKLETS === \"0\") {\n return false;\n }\n return configuration.enableNativeWorklets !== false;\n}\nfunction configureVXRNCompilerPlugin(_) {\n Object.assign(configuration, _);\n}\nexport {\n configuration,\n configureVXRNCompilerPlugin,\n isNativeWorkletsEnabled\n};\n//# sourceMappingURL=configure.js.map\n"],"mappings":";AAAA,MAAM,gBAAgB;CACpB,kBAAkB;CAClB,kBAAkB;CAClB,sBAAsB;CACtB,gBAAgB;CAChB,iBAAiB;AACnB;AACA,SAAS,0BAA0B;CACjC,IAAI,QAAQ,IAAI,yBAAyB,WAAW,QAAQ,IAAI,yBAAyB,KAAK;EAC5F,OAAO;CACT;CACA,OAAO,cAAc,yBAAyB;AAChD;AACA,SAAS,4BAA4B,GAAG;CACtC,OAAO,OAAO,eAAe,CAAC;AAChC"}
|
package/dist/esm/constants.mjs
CHANGED
|
@@ -1,48 +1,48 @@
|
|
|
1
1
|
import { createDebugger } from "@vxrn/utils";
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
} = createDebugger("vxrn:compiler-plugin");
|
|
2
|
+
|
|
3
|
+
const { debug } = createDebugger("vxrn:compiler-plugin");
|
|
5
4
|
const runtimePublicPath = "/@react-refresh";
|
|
6
5
|
const asyncGeneratorRegex = /(async \*|async function\*|for await)/;
|
|
7
6
|
const parsers = {
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
7
|
+
".tsx": {
|
|
8
|
+
syntax: "typescript",
|
|
9
|
+
tsx: true,
|
|
10
|
+
decorators: true
|
|
11
|
+
},
|
|
12
|
+
".ts": {
|
|
13
|
+
syntax: "typescript",
|
|
14
|
+
tsx: false,
|
|
15
|
+
decorators: true
|
|
16
|
+
},
|
|
17
|
+
".jsx": {
|
|
18
|
+
syntax: "ecmascript",
|
|
19
|
+
jsx: true,
|
|
20
|
+
importAttributes: true,
|
|
21
|
+
explicitResourceManagement: true
|
|
22
|
+
},
|
|
23
|
+
".js": {
|
|
24
|
+
syntax: "ecmascript",
|
|
25
|
+
importAttributes: true,
|
|
26
|
+
explicitResourceManagement: true
|
|
27
|
+
},
|
|
28
|
+
".mjs": {
|
|
29
|
+
syntax: "ecmascript",
|
|
30
|
+
importAttributes: true,
|
|
31
|
+
explicitResourceManagement: true
|
|
32
|
+
},
|
|
33
|
+
".cjs": {
|
|
34
|
+
syntax: "ecmascript",
|
|
35
|
+
importAttributes: true,
|
|
36
|
+
explicitResourceManagement: true
|
|
37
|
+
},
|
|
38
|
+
".mdx": {
|
|
39
|
+
syntax: "ecmascript",
|
|
40
|
+
jsx: true,
|
|
41
|
+
importAttributes: true,
|
|
42
|
+
explicitResourceManagement: true
|
|
43
|
+
}
|
|
45
44
|
};
|
|
46
|
-
const validParsers = /* @__PURE__ */new Set([...Object.keys(parsers), ".css"]);
|
|
45
|
+
const validParsers = /* @__PURE__ */ new Set([...Object.keys(parsers), ".css"]);
|
|
46
|
+
|
|
47
47
|
export { asyncGeneratorRegex, debug, parsers, runtimePublicPath, validParsers };
|
|
48
48
|
//# sourceMappingURL=constants.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["
|
|
1
|
+
{"version":3,"file":"constants.js","names":[],"sources":["esm/constants.js"],"sourcesContent":["import { createDebugger } from \"@vxrn/utils\";\nconst { debug } = createDebugger(\"vxrn:compiler-plugin\");\nconst runtimePublicPath = \"/@react-refresh\";\nconst asyncGeneratorRegex = /(async \\*|async function\\*|for await)/;\nconst parsers = {\n \".tsx\": { syntax: \"typescript\", tsx: true, decorators: true },\n \".ts\": { syntax: \"typescript\", tsx: false, decorators: true },\n \".jsx\": {\n syntax: \"ecmascript\",\n jsx: true,\n importAttributes: true,\n explicitResourceManagement: true\n },\n \".js\": {\n syntax: \"ecmascript\",\n importAttributes: true,\n explicitResourceManagement: true\n },\n \".mjs\": {\n syntax: \"ecmascript\",\n importAttributes: true,\n explicitResourceManagement: true\n },\n \".cjs\": {\n syntax: \"ecmascript\",\n importAttributes: true,\n explicitResourceManagement: true\n },\n \".mdx\": {\n syntax: \"ecmascript\",\n jsx: true,\n importAttributes: true,\n explicitResourceManagement: true\n }\n};\nconst validParsers = /* @__PURE__ */ new Set([...Object.keys(parsers), \".css\"]);\nexport {\n asyncGeneratorRegex,\n debug,\n parsers,\n runtimePublicPath,\n validParsers\n};\n//# sourceMappingURL=constants.js.map\n"],"mappings":";;;AACA,MAAM,EAAE,UAAU,eAAe,sBAAsB;AACvD,MAAM,oBAAoB;AAC1B,MAAM,sBAAsB;AAC5B,MAAM,UAAU;CACd,QAAQ;EAAE,QAAQ;EAAc,KAAK;EAAM,YAAY;CAAK;CAC5D,OAAO;EAAE,QAAQ;EAAc,KAAK;EAAO,YAAY;CAAK;CAC5D,QAAQ;EACN,QAAQ;EACR,KAAK;EACL,kBAAkB;EAClB,4BAA4B;CAC9B;CACA,OAAO;EACL,QAAQ;EACR,kBAAkB;EAClB,4BAA4B;CAC9B;CACA,QAAQ;EACN,QAAQ;EACR,kBAAkB;EAClB,4BAA4B;CAC9B;CACA,QAAQ;EACN,QAAQ;EACR,kBAAkB;EAClB,4BAA4B;CAC9B;CACA,QAAQ;EACN,QAAQ;EACR,KAAK;EACL,kBAAkB;EAClB,4BAA4B;CAC9B;AACF;AACA,MAAM,+BAA+B,IAAI,IAAI,CAAC,GAAG,OAAO,KAAK,OAAO,GAAG,MAAM,CAAC"}
|