@absolutejs/absolute 0.19.0-beta.1077 → 0.19.0-beta.1079
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/angular/components/core/streamingSlotRegistrar.js +1 -1
- package/dist/angular/components/core/streamingSlotRegistry.js +2 -2
- package/dist/angular/index.js +239 -3
- package/dist/angular/index.js.map +5 -4
- package/dist/angular/server.js +239 -3
- package/dist/angular/server.js.map +5 -4
- package/dist/build.js +246 -8
- package/dist/build.js.map +6 -5
- package/dist/cli/index.js +242 -3
- package/dist/index.js +246 -8
- package/dist/index.js.map +6 -5
- package/dist/islands/index.js +239 -3
- package/dist/islands/index.js.map +5 -4
- package/dist/react/index.js +239 -3
- package/dist/react/index.js.map +5 -4
- package/dist/src/build/maskLiterals.d.ts +25 -0
- package/dist/svelte/index.js +239 -3
- package/dist/svelte/index.js.map +5 -4
- package/dist/vue/index.js +239 -3
- package/dist/vue/index.js.map +5 -4
- package/package.json +1 -1
package/dist/cli/index.js
CHANGED
|
@@ -170607,6 +170607,240 @@ ${serverOutput}` : "Server failed to start for pre-rendering";
|
|
|
170607
170607
|
};
|
|
170608
170608
|
var init_prerender = () => {};
|
|
170609
170609
|
|
|
170610
|
+
// src/build/maskLiterals.ts
|
|
170611
|
+
var SENTINEL, isIdentChar = (c) => /[A-Za-z0-9_$]/.test(c), REGEX_OK_AFTER_CHAR, REGEX_OK_AFTER_WORD, maskLiterals = (src) => {
|
|
170612
|
+
const n = src.length;
|
|
170613
|
+
const pieces = [];
|
|
170614
|
+
let out = "";
|
|
170615
|
+
let i = 0;
|
|
170616
|
+
let prevChar = "";
|
|
170617
|
+
let prevWord = "";
|
|
170618
|
+
let prevWasSpace = false;
|
|
170619
|
+
let wordBeforeParen = "";
|
|
170620
|
+
const mask = (text) => {
|
|
170621
|
+
out += SENTINEL + pieces.length + SENTINEL;
|
|
170622
|
+
pieces.push(text);
|
|
170623
|
+
prevChar = ")";
|
|
170624
|
+
prevWord = "";
|
|
170625
|
+
prevWasSpace = false;
|
|
170626
|
+
};
|
|
170627
|
+
const endOfString = (start) => {
|
|
170628
|
+
const q = src[start];
|
|
170629
|
+
let j = start + 1;
|
|
170630
|
+
while (j < n) {
|
|
170631
|
+
const c = src[j];
|
|
170632
|
+
if (c === "\\") {
|
|
170633
|
+
j += 2;
|
|
170634
|
+
continue;
|
|
170635
|
+
}
|
|
170636
|
+
if (c === q)
|
|
170637
|
+
return j + 1;
|
|
170638
|
+
if (c === `
|
|
170639
|
+
`)
|
|
170640
|
+
return j;
|
|
170641
|
+
j++;
|
|
170642
|
+
}
|
|
170643
|
+
return j;
|
|
170644
|
+
};
|
|
170645
|
+
const endOfInterp = (start) => {
|
|
170646
|
+
let j = start;
|
|
170647
|
+
let depth = 1;
|
|
170648
|
+
while (j < n && depth > 0) {
|
|
170649
|
+
const c = src[j];
|
|
170650
|
+
if (c === "\\") {
|
|
170651
|
+
j += 2;
|
|
170652
|
+
continue;
|
|
170653
|
+
}
|
|
170654
|
+
if (c === "`") {
|
|
170655
|
+
j = endOfTemplate(j);
|
|
170656
|
+
continue;
|
|
170657
|
+
}
|
|
170658
|
+
if (c === '"' || c === "'") {
|
|
170659
|
+
j = endOfString(j);
|
|
170660
|
+
continue;
|
|
170661
|
+
}
|
|
170662
|
+
if (c === "/" && src[j + 1] === "/") {
|
|
170663
|
+
const nl = src.indexOf(`
|
|
170664
|
+
`, j);
|
|
170665
|
+
j = nl < 0 ? n : nl;
|
|
170666
|
+
continue;
|
|
170667
|
+
}
|
|
170668
|
+
if (c === "/" && src[j + 1] === "*") {
|
|
170669
|
+
const e = src.indexOf("*/", j + 2);
|
|
170670
|
+
j = e < 0 ? n : e + 2;
|
|
170671
|
+
continue;
|
|
170672
|
+
}
|
|
170673
|
+
if (c === "{")
|
|
170674
|
+
depth++;
|
|
170675
|
+
else if (c === "}")
|
|
170676
|
+
depth--;
|
|
170677
|
+
j++;
|
|
170678
|
+
}
|
|
170679
|
+
return j;
|
|
170680
|
+
};
|
|
170681
|
+
function endOfTemplate(start) {
|
|
170682
|
+
let j = start + 1;
|
|
170683
|
+
while (j < n) {
|
|
170684
|
+
const c = src[j];
|
|
170685
|
+
if (c === "\\") {
|
|
170686
|
+
j += 2;
|
|
170687
|
+
continue;
|
|
170688
|
+
}
|
|
170689
|
+
if (c === "`")
|
|
170690
|
+
return j + 1;
|
|
170691
|
+
if (c === "$" && src[j + 1] === "{") {
|
|
170692
|
+
j = endOfInterp(j + 2);
|
|
170693
|
+
continue;
|
|
170694
|
+
}
|
|
170695
|
+
j++;
|
|
170696
|
+
}
|
|
170697
|
+
return j;
|
|
170698
|
+
}
|
|
170699
|
+
const endOfRegex = (start) => {
|
|
170700
|
+
let j = start + 1;
|
|
170701
|
+
let inClass = false;
|
|
170702
|
+
while (j < n) {
|
|
170703
|
+
const c = src[j];
|
|
170704
|
+
if (c === "\\") {
|
|
170705
|
+
j += 2;
|
|
170706
|
+
continue;
|
|
170707
|
+
}
|
|
170708
|
+
if (c === `
|
|
170709
|
+
`)
|
|
170710
|
+
return -1;
|
|
170711
|
+
if (c === "[")
|
|
170712
|
+
inClass = true;
|
|
170713
|
+
else if (c === "]")
|
|
170714
|
+
inClass = false;
|
|
170715
|
+
else if (c === "/" && !inClass) {
|
|
170716
|
+
j++;
|
|
170717
|
+
break;
|
|
170718
|
+
}
|
|
170719
|
+
j++;
|
|
170720
|
+
}
|
|
170721
|
+
while (j < n && /[a-z]/i.test(src[j] ?? ""))
|
|
170722
|
+
j++;
|
|
170723
|
+
return j;
|
|
170724
|
+
};
|
|
170725
|
+
while (i < n) {
|
|
170726
|
+
const c = src[i];
|
|
170727
|
+
const c2 = src[i + 1];
|
|
170728
|
+
if (c === "/" && c2 === "/") {
|
|
170729
|
+
out += "//";
|
|
170730
|
+
i += 2;
|
|
170731
|
+
const s = i;
|
|
170732
|
+
while (i < n && src[i] !== `
|
|
170733
|
+
`)
|
|
170734
|
+
i++;
|
|
170735
|
+
mask(src.slice(s, i));
|
|
170736
|
+
continue;
|
|
170737
|
+
}
|
|
170738
|
+
if (c === "/" && c2 === "*") {
|
|
170739
|
+
out += "/*";
|
|
170740
|
+
i += 2;
|
|
170741
|
+
const e = src.indexOf("*/", i);
|
|
170742
|
+
const end = e < 0 ? n : e;
|
|
170743
|
+
mask(src.slice(i, end));
|
|
170744
|
+
i = end < n ? end + 2 : n;
|
|
170745
|
+
if (end < n)
|
|
170746
|
+
out += "*/";
|
|
170747
|
+
continue;
|
|
170748
|
+
}
|
|
170749
|
+
if (c === "`") {
|
|
170750
|
+
const end = endOfTemplate(i);
|
|
170751
|
+
mask(src.slice(i, end));
|
|
170752
|
+
i = end;
|
|
170753
|
+
continue;
|
|
170754
|
+
}
|
|
170755
|
+
if (c === '"' || c === "'") {
|
|
170756
|
+
const end = endOfString(i);
|
|
170757
|
+
const isSpecifier = prevWord === "from" || prevWord === "import" || prevChar === "(" && (wordBeforeParen === "import" || wordBeforeParen === "require");
|
|
170758
|
+
if (isSpecifier) {
|
|
170759
|
+
out += src.slice(i, end);
|
|
170760
|
+
prevChar = '"';
|
|
170761
|
+
prevWord = "";
|
|
170762
|
+
prevWasSpace = false;
|
|
170763
|
+
} else {
|
|
170764
|
+
mask(src.slice(i, end));
|
|
170765
|
+
}
|
|
170766
|
+
i = end;
|
|
170767
|
+
continue;
|
|
170768
|
+
}
|
|
170769
|
+
if (c === "/" && (prevChar === "" || REGEX_OK_AFTER_CHAR.has(prevChar) || REGEX_OK_AFTER_WORD.has(prevWord))) {
|
|
170770
|
+
const end = endOfRegex(i);
|
|
170771
|
+
if (end > 0) {
|
|
170772
|
+
out += src.slice(i, end);
|
|
170773
|
+
i = end;
|
|
170774
|
+
prevChar = ")";
|
|
170775
|
+
prevWord = "";
|
|
170776
|
+
prevWasSpace = false;
|
|
170777
|
+
continue;
|
|
170778
|
+
}
|
|
170779
|
+
}
|
|
170780
|
+
out += c;
|
|
170781
|
+
i++;
|
|
170782
|
+
if (c === " " || c === "\t" || c === "\r" || c === `
|
|
170783
|
+
`) {
|
|
170784
|
+
prevWasSpace = true;
|
|
170785
|
+
continue;
|
|
170786
|
+
}
|
|
170787
|
+
if (isIdentChar(c)) {
|
|
170788
|
+
const contiguous = isIdentChar(prevChar) && !prevWasSpace;
|
|
170789
|
+
prevWord = contiguous ? prevWord + c : c;
|
|
170790
|
+
} else {
|
|
170791
|
+
if (c === "(")
|
|
170792
|
+
wordBeforeParen = prevWord;
|
|
170793
|
+
prevWord = "";
|
|
170794
|
+
}
|
|
170795
|
+
prevChar = c;
|
|
170796
|
+
prevWasSpace = false;
|
|
170797
|
+
}
|
|
170798
|
+
const restoreRegex = new RegExp(`${SENTINEL}(\\d+)${SENTINEL}`, "g");
|
|
170799
|
+
const restore = (rewritten) => rewritten.replace(restoreRegex, (_m, d) => pieces[Number(d)] ?? "");
|
|
170800
|
+
return { masked: out, restore };
|
|
170801
|
+
};
|
|
170802
|
+
var init_maskLiterals = __esm(() => {
|
|
170803
|
+
SENTINEL = String.fromCharCode(57344);
|
|
170804
|
+
REGEX_OK_AFTER_CHAR = new Set([
|
|
170805
|
+
"(",
|
|
170806
|
+
",",
|
|
170807
|
+
"=",
|
|
170808
|
+
":",
|
|
170809
|
+
"[",
|
|
170810
|
+
"!",
|
|
170811
|
+
"&",
|
|
170812
|
+
"|",
|
|
170813
|
+
"?",
|
|
170814
|
+
"{",
|
|
170815
|
+
"}",
|
|
170816
|
+
";",
|
|
170817
|
+
"+",
|
|
170818
|
+
"-",
|
|
170819
|
+
"*",
|
|
170820
|
+
"/",
|
|
170821
|
+
"%",
|
|
170822
|
+
"^",
|
|
170823
|
+
"~",
|
|
170824
|
+
"<",
|
|
170825
|
+
">"
|
|
170826
|
+
]);
|
|
170827
|
+
REGEX_OK_AFTER_WORD = new Set([
|
|
170828
|
+
"return",
|
|
170829
|
+
"typeof",
|
|
170830
|
+
"instanceof",
|
|
170831
|
+
"in",
|
|
170832
|
+
"of",
|
|
170833
|
+
"new",
|
|
170834
|
+
"delete",
|
|
170835
|
+
"void",
|
|
170836
|
+
"do",
|
|
170837
|
+
"else",
|
|
170838
|
+
"yield",
|
|
170839
|
+
"await",
|
|
170840
|
+
"case"
|
|
170841
|
+
]);
|
|
170842
|
+
});
|
|
170843
|
+
|
|
170610
170844
|
// src/build/nativeRewrite.ts
|
|
170611
170845
|
import { dlopen, FFIType, ptr } from "bun:ffi";
|
|
170612
170846
|
import { platform as platform4, arch as arch3 } from "os";
|
|
@@ -170687,8 +170921,9 @@ var escapeRegex = (str) => str.replace(/[.*+?^${}()|[\]\\]/g, "\\$&"), jsRewrite
|
|
|
170687
170921
|
if (Object.keys(vendorPaths).length === 0)
|
|
170688
170922
|
return content;
|
|
170689
170923
|
const replacements = Object.entries(vendorPaths).sort(([keyA], [keyB]) => keyB.length - keyA.length);
|
|
170690
|
-
const
|
|
170691
|
-
|
|
170924
|
+
const { masked, restore } = maskLiterals(content);
|
|
170925
|
+
const native = nativeRewriteImports(masked, replacements);
|
|
170926
|
+
return restore(native ?? jsRewriteImports(masked, replacements));
|
|
170692
170927
|
}, fixMissingReExportNamespacesInContent = (content) => {
|
|
170693
170928
|
const REEXPORT_PATTERN = /__reExport\(\s*[A-Za-z_$][\w$]*\s*,\s*([A-Za-z_$][\w$]*)\s*\)/g;
|
|
170694
170929
|
REEXPORT_PATTERN.lastIndex = 0;
|
|
@@ -170777,6 +171012,7 @@ ${content}`;
|
|
|
170777
171012
|
}));
|
|
170778
171013
|
};
|
|
170779
171014
|
var init_rewriteImportsPlugin = __esm(() => {
|
|
171015
|
+
init_maskLiterals();
|
|
170780
171016
|
init_nativeRewrite();
|
|
170781
171017
|
});
|
|
170782
171018
|
|
|
@@ -177034,7 +177270,8 @@ var cliTag4 = (color, message) => `\x1B[2m${formatTimestamp()}\x1B[0m ${color}[c
|
|
|
177034
177270
|
continue;
|
|
177035
177271
|
seen.add(filePath);
|
|
177036
177272
|
const source = readFileSync33(filePath, "utf-8");
|
|
177037
|
-
const
|
|
177273
|
+
const { masked, restore } = maskLiterals(source);
|
|
177274
|
+
const rewrittenMasked = masked.replace(MODULE_SPECIFIER_RE, (match, prefix, quote, specifier) => {
|
|
177038
177275
|
if (typeof specifier === "string" && specifier.startsWith(".")) {
|
|
177039
177276
|
enqueue(resolveRuntimeJsFile(resolve21(dirname14(filePath), specifier)));
|
|
177040
177277
|
return match;
|
|
@@ -177050,6 +177287,7 @@ var cliTag4 = (color, message) => `\x1B[2m${formatTimestamp()}\x1B[0m ${color}[c
|
|
|
177050
177287
|
enqueue(target);
|
|
177051
177288
|
return `${prefix}${quote}${ensureRelativeModuleSpecifier(filePath, target)}${quote}`;
|
|
177052
177289
|
});
|
|
177290
|
+
const rewritten = restore(rewrittenMasked);
|
|
177053
177291
|
if (rewritten !== source) {
|
|
177054
177292
|
writeFileSync18(filePath, rewritten);
|
|
177055
177293
|
}
|
|
@@ -177712,6 +177950,7 @@ console.log(\`
|
|
|
177712
177950
|
};
|
|
177713
177951
|
var init_compile = __esm(() => {
|
|
177714
177952
|
init_externalAssetPlugin();
|
|
177953
|
+
init_maskLiterals();
|
|
177715
177954
|
init_islandEntries();
|
|
177716
177955
|
init_islandRegistryTransform();
|
|
177717
177956
|
init_constants();
|
package/dist/index.js
CHANGED
|
@@ -7237,6 +7237,240 @@ var init_islandSsr = __esm(() => {
|
|
|
7237
7237
|
LEADING_HOISTED_RESOURCE_RE = /^\s*(?:<link\b[^>]*\/?>|<meta\b[^>]*\/?>|<title\b[^>]*>[\s\S]*?<\/title>|<style\b[^>]*>[\s\S]*?<\/style>|<script\b[^>]*>[\s\S]*?<\/script>)/i;
|
|
7238
7238
|
});
|
|
7239
7239
|
|
|
7240
|
+
// src/build/maskLiterals.ts
|
|
7241
|
+
var SENTINEL, isIdentChar = (c) => /[A-Za-z0-9_$]/.test(c), REGEX_OK_AFTER_CHAR, REGEX_OK_AFTER_WORD, maskLiterals = (src) => {
|
|
7242
|
+
const n = src.length;
|
|
7243
|
+
const pieces = [];
|
|
7244
|
+
let out = "";
|
|
7245
|
+
let i = 0;
|
|
7246
|
+
let prevChar = "";
|
|
7247
|
+
let prevWord = "";
|
|
7248
|
+
let prevWasSpace = false;
|
|
7249
|
+
let wordBeforeParen = "";
|
|
7250
|
+
const mask = (text) => {
|
|
7251
|
+
out += SENTINEL + pieces.length + SENTINEL;
|
|
7252
|
+
pieces.push(text);
|
|
7253
|
+
prevChar = ")";
|
|
7254
|
+
prevWord = "";
|
|
7255
|
+
prevWasSpace = false;
|
|
7256
|
+
};
|
|
7257
|
+
const endOfString = (start) => {
|
|
7258
|
+
const q2 = src[start];
|
|
7259
|
+
let j2 = start + 1;
|
|
7260
|
+
while (j2 < n) {
|
|
7261
|
+
const c = src[j2];
|
|
7262
|
+
if (c === "\\") {
|
|
7263
|
+
j2 += 2;
|
|
7264
|
+
continue;
|
|
7265
|
+
}
|
|
7266
|
+
if (c === q2)
|
|
7267
|
+
return j2 + 1;
|
|
7268
|
+
if (c === `
|
|
7269
|
+
`)
|
|
7270
|
+
return j2;
|
|
7271
|
+
j2++;
|
|
7272
|
+
}
|
|
7273
|
+
return j2;
|
|
7274
|
+
};
|
|
7275
|
+
const endOfInterp = (start) => {
|
|
7276
|
+
let j2 = start;
|
|
7277
|
+
let depth = 1;
|
|
7278
|
+
while (j2 < n && depth > 0) {
|
|
7279
|
+
const c = src[j2];
|
|
7280
|
+
if (c === "\\") {
|
|
7281
|
+
j2 += 2;
|
|
7282
|
+
continue;
|
|
7283
|
+
}
|
|
7284
|
+
if (c === "`") {
|
|
7285
|
+
j2 = endOfTemplate(j2);
|
|
7286
|
+
continue;
|
|
7287
|
+
}
|
|
7288
|
+
if (c === '"' || c === "'") {
|
|
7289
|
+
j2 = endOfString(j2);
|
|
7290
|
+
continue;
|
|
7291
|
+
}
|
|
7292
|
+
if (c === "/" && src[j2 + 1] === "/") {
|
|
7293
|
+
const nl = src.indexOf(`
|
|
7294
|
+
`, j2);
|
|
7295
|
+
j2 = nl < 0 ? n : nl;
|
|
7296
|
+
continue;
|
|
7297
|
+
}
|
|
7298
|
+
if (c === "/" && src[j2 + 1] === "*") {
|
|
7299
|
+
const e = src.indexOf("*/", j2 + 2);
|
|
7300
|
+
j2 = e < 0 ? n : e + 2;
|
|
7301
|
+
continue;
|
|
7302
|
+
}
|
|
7303
|
+
if (c === "{")
|
|
7304
|
+
depth++;
|
|
7305
|
+
else if (c === "}")
|
|
7306
|
+
depth--;
|
|
7307
|
+
j2++;
|
|
7308
|
+
}
|
|
7309
|
+
return j2;
|
|
7310
|
+
};
|
|
7311
|
+
function endOfTemplate(start) {
|
|
7312
|
+
let j2 = start + 1;
|
|
7313
|
+
while (j2 < n) {
|
|
7314
|
+
const c = src[j2];
|
|
7315
|
+
if (c === "\\") {
|
|
7316
|
+
j2 += 2;
|
|
7317
|
+
continue;
|
|
7318
|
+
}
|
|
7319
|
+
if (c === "`")
|
|
7320
|
+
return j2 + 1;
|
|
7321
|
+
if (c === "$" && src[j2 + 1] === "{") {
|
|
7322
|
+
j2 = endOfInterp(j2 + 2);
|
|
7323
|
+
continue;
|
|
7324
|
+
}
|
|
7325
|
+
j2++;
|
|
7326
|
+
}
|
|
7327
|
+
return j2;
|
|
7328
|
+
}
|
|
7329
|
+
const endOfRegex = (start) => {
|
|
7330
|
+
let j2 = start + 1;
|
|
7331
|
+
let inClass = false;
|
|
7332
|
+
while (j2 < n) {
|
|
7333
|
+
const c = src[j2];
|
|
7334
|
+
if (c === "\\") {
|
|
7335
|
+
j2 += 2;
|
|
7336
|
+
continue;
|
|
7337
|
+
}
|
|
7338
|
+
if (c === `
|
|
7339
|
+
`)
|
|
7340
|
+
return -1;
|
|
7341
|
+
if (c === "[")
|
|
7342
|
+
inClass = true;
|
|
7343
|
+
else if (c === "]")
|
|
7344
|
+
inClass = false;
|
|
7345
|
+
else if (c === "/" && !inClass) {
|
|
7346
|
+
j2++;
|
|
7347
|
+
break;
|
|
7348
|
+
}
|
|
7349
|
+
j2++;
|
|
7350
|
+
}
|
|
7351
|
+
while (j2 < n && /[a-z]/i.test(src[j2] ?? ""))
|
|
7352
|
+
j2++;
|
|
7353
|
+
return j2;
|
|
7354
|
+
};
|
|
7355
|
+
while (i < n) {
|
|
7356
|
+
const c = src[i];
|
|
7357
|
+
const c2 = src[i + 1];
|
|
7358
|
+
if (c === "/" && c2 === "/") {
|
|
7359
|
+
out += "//";
|
|
7360
|
+
i += 2;
|
|
7361
|
+
const s2 = i;
|
|
7362
|
+
while (i < n && src[i] !== `
|
|
7363
|
+
`)
|
|
7364
|
+
i++;
|
|
7365
|
+
mask(src.slice(s2, i));
|
|
7366
|
+
continue;
|
|
7367
|
+
}
|
|
7368
|
+
if (c === "/" && c2 === "*") {
|
|
7369
|
+
out += "/*";
|
|
7370
|
+
i += 2;
|
|
7371
|
+
const e = src.indexOf("*/", i);
|
|
7372
|
+
const end = e < 0 ? n : e;
|
|
7373
|
+
mask(src.slice(i, end));
|
|
7374
|
+
i = end < n ? end + 2 : n;
|
|
7375
|
+
if (end < n)
|
|
7376
|
+
out += "*/";
|
|
7377
|
+
continue;
|
|
7378
|
+
}
|
|
7379
|
+
if (c === "`") {
|
|
7380
|
+
const end = endOfTemplate(i);
|
|
7381
|
+
mask(src.slice(i, end));
|
|
7382
|
+
i = end;
|
|
7383
|
+
continue;
|
|
7384
|
+
}
|
|
7385
|
+
if (c === '"' || c === "'") {
|
|
7386
|
+
const end = endOfString(i);
|
|
7387
|
+
const isSpecifier = prevWord === "from" || prevWord === "import" || prevChar === "(" && (wordBeforeParen === "import" || wordBeforeParen === "require");
|
|
7388
|
+
if (isSpecifier) {
|
|
7389
|
+
out += src.slice(i, end);
|
|
7390
|
+
prevChar = '"';
|
|
7391
|
+
prevWord = "";
|
|
7392
|
+
prevWasSpace = false;
|
|
7393
|
+
} else {
|
|
7394
|
+
mask(src.slice(i, end));
|
|
7395
|
+
}
|
|
7396
|
+
i = end;
|
|
7397
|
+
continue;
|
|
7398
|
+
}
|
|
7399
|
+
if (c === "/" && (prevChar === "" || REGEX_OK_AFTER_CHAR.has(prevChar) || REGEX_OK_AFTER_WORD.has(prevWord))) {
|
|
7400
|
+
const end = endOfRegex(i);
|
|
7401
|
+
if (end > 0) {
|
|
7402
|
+
out += src.slice(i, end);
|
|
7403
|
+
i = end;
|
|
7404
|
+
prevChar = ")";
|
|
7405
|
+
prevWord = "";
|
|
7406
|
+
prevWasSpace = false;
|
|
7407
|
+
continue;
|
|
7408
|
+
}
|
|
7409
|
+
}
|
|
7410
|
+
out += c;
|
|
7411
|
+
i++;
|
|
7412
|
+
if (c === " " || c === "\t" || c === "\r" || c === `
|
|
7413
|
+
`) {
|
|
7414
|
+
prevWasSpace = true;
|
|
7415
|
+
continue;
|
|
7416
|
+
}
|
|
7417
|
+
if (isIdentChar(c)) {
|
|
7418
|
+
const contiguous = isIdentChar(prevChar) && !prevWasSpace;
|
|
7419
|
+
prevWord = contiguous ? prevWord + c : c;
|
|
7420
|
+
} else {
|
|
7421
|
+
if (c === "(")
|
|
7422
|
+
wordBeforeParen = prevWord;
|
|
7423
|
+
prevWord = "";
|
|
7424
|
+
}
|
|
7425
|
+
prevChar = c;
|
|
7426
|
+
prevWasSpace = false;
|
|
7427
|
+
}
|
|
7428
|
+
const restoreRegex = new RegExp(`${SENTINEL}(\\d+)${SENTINEL}`, "g");
|
|
7429
|
+
const restore = (rewritten) => rewritten.replace(restoreRegex, (_m, d2) => pieces[Number(d2)] ?? "");
|
|
7430
|
+
return { masked: out, restore };
|
|
7431
|
+
};
|
|
7432
|
+
var init_maskLiterals = __esm(() => {
|
|
7433
|
+
SENTINEL = String.fromCharCode(57344);
|
|
7434
|
+
REGEX_OK_AFTER_CHAR = new Set([
|
|
7435
|
+
"(",
|
|
7436
|
+
",",
|
|
7437
|
+
"=",
|
|
7438
|
+
":",
|
|
7439
|
+
"[",
|
|
7440
|
+
"!",
|
|
7441
|
+
"&",
|
|
7442
|
+
"|",
|
|
7443
|
+
"?",
|
|
7444
|
+
"{",
|
|
7445
|
+
"}",
|
|
7446
|
+
";",
|
|
7447
|
+
"+",
|
|
7448
|
+
"-",
|
|
7449
|
+
"*",
|
|
7450
|
+
"/",
|
|
7451
|
+
"%",
|
|
7452
|
+
"^",
|
|
7453
|
+
"~",
|
|
7454
|
+
"<",
|
|
7455
|
+
">"
|
|
7456
|
+
]);
|
|
7457
|
+
REGEX_OK_AFTER_WORD = new Set([
|
|
7458
|
+
"return",
|
|
7459
|
+
"typeof",
|
|
7460
|
+
"instanceof",
|
|
7461
|
+
"in",
|
|
7462
|
+
"of",
|
|
7463
|
+
"new",
|
|
7464
|
+
"delete",
|
|
7465
|
+
"void",
|
|
7466
|
+
"do",
|
|
7467
|
+
"else",
|
|
7468
|
+
"yield",
|
|
7469
|
+
"await",
|
|
7470
|
+
"case"
|
|
7471
|
+
]);
|
|
7472
|
+
});
|
|
7473
|
+
|
|
7240
7474
|
// src/build/nativeRewrite.ts
|
|
7241
7475
|
import { dlopen, FFIType, ptr } from "bun:ffi";
|
|
7242
7476
|
import { platform, arch } from "os";
|
|
@@ -7327,8 +7561,9 @@ var escapeRegex = (str) => str.replace(/[.*+?^${}()|[\]\\]/g, "\\$&"), jsRewrite
|
|
|
7327
7561
|
if (Object.keys(vendorPaths).length === 0)
|
|
7328
7562
|
return content;
|
|
7329
7563
|
const replacements = Object.entries(vendorPaths).sort(([keyA], [keyB]) => keyB.length - keyA.length);
|
|
7330
|
-
const
|
|
7331
|
-
|
|
7564
|
+
const { masked, restore } = maskLiterals(content);
|
|
7565
|
+
const native = nativeRewriteImports(masked, replacements);
|
|
7566
|
+
return restore(native ?? jsRewriteImports(masked, replacements));
|
|
7332
7567
|
}, fixMissingReExportNamespacesInContent = (content) => {
|
|
7333
7568
|
const REEXPORT_PATTERN = /__reExport\(\s*[A-Za-z_$][\w$]*\s*,\s*([A-Za-z_$][\w$]*)\s*\)/g;
|
|
7334
7569
|
REEXPORT_PATTERN.lastIndex = 0;
|
|
@@ -7474,6 +7709,7 @@ ${content}`;
|
|
|
7474
7709
|
return result;
|
|
7475
7710
|
};
|
|
7476
7711
|
var init_rewriteImportsPlugin = __esm(() => {
|
|
7712
|
+
init_maskLiterals();
|
|
7477
7713
|
init_nativeRewrite();
|
|
7478
7714
|
});
|
|
7479
7715
|
|
|
@@ -21369,14 +21605,16 @@ var escapeRegex3 = (str) => str.replace(/[.*+?^${}()|[\]\\]/g, "\\$&"), rewriter
|
|
|
21369
21605
|
const replacements = Object.entries(vendorPaths).sort(([keyA], [keyB]) => keyB.length - keyA.length);
|
|
21370
21606
|
await Promise.all(jsFiles.map(async (filePath) => {
|
|
21371
21607
|
const original = await Bun.file(filePath).text();
|
|
21372
|
-
const
|
|
21373
|
-
const
|
|
21608
|
+
const { masked, restore } = maskLiterals(original);
|
|
21609
|
+
const native = nativeRewriteImports(masked, replacements);
|
|
21610
|
+
const content = restore(native ?? applyAllReplacements(masked, rewriter));
|
|
21374
21611
|
if (content !== original) {
|
|
21375
21612
|
await Bun.write(filePath, content);
|
|
21376
21613
|
}
|
|
21377
21614
|
}));
|
|
21378
21615
|
};
|
|
21379
21616
|
var init_rewriteReactImports = __esm(() => {
|
|
21617
|
+
init_maskLiterals();
|
|
21380
21618
|
init_nativeRewrite();
|
|
21381
21619
|
rewriterCache = new Map;
|
|
21382
21620
|
REFRESH_STUBS = "window.$RefreshReg$||(window.$RefreshReg$=function(){});" + `window.$RefreshSig$||(window.$RefreshSig$=function(){return function(t){return t}});
|
|
@@ -23497,7 +23735,7 @@ var init_chainInlineSourcemaps = __esm(() => {
|
|
|
23497
23735
|
});
|
|
23498
23736
|
|
|
23499
23737
|
// src/build/vueAutoRouterTransform.ts
|
|
23500
|
-
var SCRIPT_REGEX, ROUTES_EXPORT_REGEX,
|
|
23738
|
+
var SCRIPT_REGEX, ROUTES_EXPORT_REGEX, SENTINEL2 = "__ABSOLUTE_AUTO_ROUTER__", SETUP_APP_DECLARATION_REGEX, SETUP_APP_FUNCTION_REGEX, addAutoRouterSetupApp = (sourceContent) => {
|
|
23501
23739
|
if (!ROUTES_EXPORT_REGEX.test(sourceContent))
|
|
23502
23740
|
return sourceContent;
|
|
23503
23741
|
const match = SCRIPT_REGEX.exec(sourceContent);
|
|
@@ -23506,13 +23744,13 @@ var SCRIPT_REGEX, ROUTES_EXPORT_REGEX, SENTINEL = "__ABSOLUTE_AUTO_ROUTER__", SE
|
|
|
23506
23744
|
const [, openTag, scriptBody, closeTag] = match;
|
|
23507
23745
|
if (!openTag || scriptBody === undefined || !closeTag)
|
|
23508
23746
|
return sourceContent;
|
|
23509
|
-
if (scriptBody.includes(
|
|
23747
|
+
if (scriptBody.includes(SENTINEL2))
|
|
23510
23748
|
return sourceContent;
|
|
23511
23749
|
let rewrittenScript = scriptBody.replace(SETUP_APP_DECLARATION_REGEX, "const __absoluteUserSetupApp__");
|
|
23512
23750
|
rewrittenScript = rewrittenScript.replace(SETUP_APP_FUNCTION_REGEX, "$1 __absoluteUserSetupApp__");
|
|
23513
23751
|
const userHadSetupApp = rewrittenScript !== scriptBody;
|
|
23514
23752
|
const autoWrapper = `
|
|
23515
|
-
// ${
|
|
23753
|
+
// ${SENTINEL2} \u2014 generated by AbsoluteJS because this page exports
|
|
23516
23754
|
// \`routes\`. Owns the vue-router lifecycle (history pick, app.use,
|
|
23517
23755
|
// push, isReady) so user code stays declarative.
|
|
23518
23756
|
import {
|
|
@@ -46737,5 +46975,5 @@ export {
|
|
|
46737
46975
|
ANGULAR_INIT_TIMEOUT_MS
|
|
46738
46976
|
};
|
|
46739
46977
|
|
|
46740
|
-
//# debugId=
|
|
46978
|
+
//# debugId=8D7748D6ECBDDF8764756E2164756E21
|
|
46741
46979
|
//# sourceMappingURL=index.js.map
|