feat: support WRN imports and dynamic public shell

This commit is contained in:
2026-07-21 11:15:06 +05:30
parent 0013c0771d
commit 2ca2d02b22
82 changed files with 959 additions and 174 deletions
+12
View File
@@ -89,6 +89,7 @@ function stripComments(source) {
function maskLeadingTrivia(source) {
const masked = [...source];
let offset = 0;
const importPattern = /import\s+(?:type\s+)?(?:[\s\S]*?\s+from\s+)?["'][^"'\r\n]+["']\s*;?/y;
while (offset < source.length) {
if (/\s/u.test(source[offset])) {
@@ -96,6 +97,17 @@ function maskLeadingTrivia(source) {
continue;
}
importPattern.lastIndex = offset;
const importStatement = importPattern.exec(source);
if (importStatement) {
const end = importPattern.lastIndex;
while (offset < end) {
if (source[offset] !== "\n" && source[offset] !== "\r") masked[offset] = " ";
offset += 1;
}
continue;
}
if (!source.startsWith("//", offset)) break;
while (offset < source.length && source[offset] !== "\n") {