@absolutejs/absolute 0.19.0-beta.1077 → 0.19.0-beta.1078
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 +221 -3
- package/dist/angular/index.js.map +5 -4
- package/dist/angular/server.js +221 -3
- package/dist/angular/server.js.map +5 -4
- package/dist/build.js +228 -8
- package/dist/build.js.map +6 -5
- package/dist/cli/index.js +220 -2
- package/dist/index.js +228 -8
- package/dist/index.js.map +6 -5
- package/dist/islands/index.js +221 -3
- package/dist/islands/index.js.map +5 -4
- package/dist/react/index.js +221 -3
- package/dist/react/index.js.map +5 -4
- package/dist/src/build/maskLiterals.d.ts +23 -0
- package/dist/svelte/index.js +221 -3
- package/dist/svelte/index.js.map +5 -4
- package/dist/vue/index.js +221 -3
- package/dist/vue/index.js.map +5 -4
- package/package.json +1 -1
package/dist/cli/index.js
CHANGED
|
@@ -170607,6 +170607,222 @@ ${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 = "\uE000", 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
|
+
const mask = (text) => {
|
|
170619
|
+
out += SENTINEL + pieces.length + SENTINEL;
|
|
170620
|
+
pieces.push(text);
|
|
170621
|
+
};
|
|
170622
|
+
const endOfInterp = (start) => {
|
|
170623
|
+
let j = start;
|
|
170624
|
+
let depth = 1;
|
|
170625
|
+
while (j < n && depth > 0) {
|
|
170626
|
+
const c = src[j];
|
|
170627
|
+
if (c === "\\") {
|
|
170628
|
+
j += 2;
|
|
170629
|
+
continue;
|
|
170630
|
+
}
|
|
170631
|
+
if (c === "`") {
|
|
170632
|
+
j = endOfTemplate(j);
|
|
170633
|
+
continue;
|
|
170634
|
+
}
|
|
170635
|
+
if (c === '"' || c === "'") {
|
|
170636
|
+
j = endOfString(j);
|
|
170637
|
+
continue;
|
|
170638
|
+
}
|
|
170639
|
+
if (c === "/" && src[j + 1] === "/") {
|
|
170640
|
+
const nl = src.indexOf(`
|
|
170641
|
+
`, j);
|
|
170642
|
+
j = nl < 0 ? n : nl;
|
|
170643
|
+
continue;
|
|
170644
|
+
}
|
|
170645
|
+
if (c === "/" && src[j + 1] === "*") {
|
|
170646
|
+
const e = src.indexOf("*/", j + 2);
|
|
170647
|
+
j = e < 0 ? n : e + 2;
|
|
170648
|
+
continue;
|
|
170649
|
+
}
|
|
170650
|
+
if (c === "{")
|
|
170651
|
+
depth++;
|
|
170652
|
+
else if (c === "}")
|
|
170653
|
+
depth--;
|
|
170654
|
+
j++;
|
|
170655
|
+
}
|
|
170656
|
+
return j;
|
|
170657
|
+
};
|
|
170658
|
+
function endOfTemplate(start) {
|
|
170659
|
+
let j = start + 1;
|
|
170660
|
+
while (j < n) {
|
|
170661
|
+
const c = src[j];
|
|
170662
|
+
if (c === "\\") {
|
|
170663
|
+
j += 2;
|
|
170664
|
+
continue;
|
|
170665
|
+
}
|
|
170666
|
+
if (c === "`")
|
|
170667
|
+
return j + 1;
|
|
170668
|
+
if (c === "$" && src[j + 1] === "{") {
|
|
170669
|
+
j = endOfInterp(j + 2);
|
|
170670
|
+
continue;
|
|
170671
|
+
}
|
|
170672
|
+
j++;
|
|
170673
|
+
}
|
|
170674
|
+
return j;
|
|
170675
|
+
}
|
|
170676
|
+
function endOfString(start) {
|
|
170677
|
+
const q = src[start];
|
|
170678
|
+
let j = start + 1;
|
|
170679
|
+
while (j < n) {
|
|
170680
|
+
const c = src[j];
|
|
170681
|
+
if (c === "\\") {
|
|
170682
|
+
j += 2;
|
|
170683
|
+
continue;
|
|
170684
|
+
}
|
|
170685
|
+
if (c === q)
|
|
170686
|
+
return j + 1;
|
|
170687
|
+
if (c === `
|
|
170688
|
+
`)
|
|
170689
|
+
return j;
|
|
170690
|
+
j++;
|
|
170691
|
+
}
|
|
170692
|
+
return j;
|
|
170693
|
+
}
|
|
170694
|
+
const endOfRegex = (start) => {
|
|
170695
|
+
let j = start + 1;
|
|
170696
|
+
let inClass = false;
|
|
170697
|
+
while (j < n) {
|
|
170698
|
+
const c = src[j];
|
|
170699
|
+
if (c === "\\") {
|
|
170700
|
+
j += 2;
|
|
170701
|
+
continue;
|
|
170702
|
+
}
|
|
170703
|
+
if (c === `
|
|
170704
|
+
`)
|
|
170705
|
+
return -1;
|
|
170706
|
+
if (c === "[")
|
|
170707
|
+
inClass = true;
|
|
170708
|
+
else if (c === "]")
|
|
170709
|
+
inClass = false;
|
|
170710
|
+
else if (c === "/" && !inClass) {
|
|
170711
|
+
j++;
|
|
170712
|
+
break;
|
|
170713
|
+
}
|
|
170714
|
+
j++;
|
|
170715
|
+
}
|
|
170716
|
+
while (j < n && /[a-z]/i.test(src[j] ?? ""))
|
|
170717
|
+
j++;
|
|
170718
|
+
return j;
|
|
170719
|
+
};
|
|
170720
|
+
while (i < n) {
|
|
170721
|
+
const c = src[i];
|
|
170722
|
+
const c2 = src[i + 1];
|
|
170723
|
+
if (c === "/" && c2 === "/") {
|
|
170724
|
+
out += "//";
|
|
170725
|
+
i += 2;
|
|
170726
|
+
const s = i;
|
|
170727
|
+
while (i < n && src[i] !== `
|
|
170728
|
+
`)
|
|
170729
|
+
i++;
|
|
170730
|
+
mask(src.slice(s, i));
|
|
170731
|
+
prevChar = "";
|
|
170732
|
+
prevWord = "";
|
|
170733
|
+
continue;
|
|
170734
|
+
}
|
|
170735
|
+
if (c === "/" && c2 === "*") {
|
|
170736
|
+
out += "/*";
|
|
170737
|
+
i += 2;
|
|
170738
|
+
const e = src.indexOf("*/", i);
|
|
170739
|
+
const end = e < 0 ? n : e;
|
|
170740
|
+
mask(src.slice(i, end));
|
|
170741
|
+
i = end < n ? end + 2 : n;
|
|
170742
|
+
if (end < n)
|
|
170743
|
+
out += "*/";
|
|
170744
|
+
continue;
|
|
170745
|
+
}
|
|
170746
|
+
if (c === "`") {
|
|
170747
|
+
const end = endOfTemplate(i);
|
|
170748
|
+
mask(src.slice(i, end));
|
|
170749
|
+
i = end;
|
|
170750
|
+
prevChar = "`";
|
|
170751
|
+
prevWord = "";
|
|
170752
|
+
continue;
|
|
170753
|
+
}
|
|
170754
|
+
if (c === '"' || c === "'") {
|
|
170755
|
+
const end = endOfString(i);
|
|
170756
|
+
out += src.slice(i, end);
|
|
170757
|
+
i = end;
|
|
170758
|
+
prevChar = '"';
|
|
170759
|
+
prevWord = "";
|
|
170760
|
+
continue;
|
|
170761
|
+
}
|
|
170762
|
+
if (c === "/" && (prevChar === "" || REGEX_OK_AFTER_CHAR.has(prevChar) || REGEX_OK_AFTER_WORD.has(prevWord))) {
|
|
170763
|
+
const end = endOfRegex(i);
|
|
170764
|
+
if (end > 0) {
|
|
170765
|
+
out += src.slice(i, end);
|
|
170766
|
+
i = end;
|
|
170767
|
+
prevChar = "/";
|
|
170768
|
+
prevWord = "";
|
|
170769
|
+
continue;
|
|
170770
|
+
}
|
|
170771
|
+
}
|
|
170772
|
+
out += c;
|
|
170773
|
+
i++;
|
|
170774
|
+
if (c === " " || c === "\t" || c === "\r" || c === `
|
|
170775
|
+
`)
|
|
170776
|
+
continue;
|
|
170777
|
+
const wasIdent = isIdentChar(prevChar);
|
|
170778
|
+
prevChar = c;
|
|
170779
|
+
prevWord = isIdentChar(c) ? wasIdent ? prevWord + c : c : "";
|
|
170780
|
+
}
|
|
170781
|
+
const restoreRegex = new RegExp(`${SENTINEL}(\\d+)${SENTINEL}`, "g");
|
|
170782
|
+
const restore = (rewritten) => rewritten.replace(restoreRegex, (_m, d) => pieces[Number(d)] ?? "");
|
|
170783
|
+
return { masked: out, restore };
|
|
170784
|
+
};
|
|
170785
|
+
var init_maskLiterals = __esm(() => {
|
|
170786
|
+
REGEX_OK_AFTER_CHAR = new Set([
|
|
170787
|
+
"(",
|
|
170788
|
+
",",
|
|
170789
|
+
"=",
|
|
170790
|
+
":",
|
|
170791
|
+
"[",
|
|
170792
|
+
"!",
|
|
170793
|
+
"&",
|
|
170794
|
+
"|",
|
|
170795
|
+
"?",
|
|
170796
|
+
"{",
|
|
170797
|
+
"}",
|
|
170798
|
+
";",
|
|
170799
|
+
"+",
|
|
170800
|
+
"-",
|
|
170801
|
+
"*",
|
|
170802
|
+
"/",
|
|
170803
|
+
"%",
|
|
170804
|
+
"^",
|
|
170805
|
+
"~",
|
|
170806
|
+
"<",
|
|
170807
|
+
">"
|
|
170808
|
+
]);
|
|
170809
|
+
REGEX_OK_AFTER_WORD = new Set([
|
|
170810
|
+
"return",
|
|
170811
|
+
"typeof",
|
|
170812
|
+
"instanceof",
|
|
170813
|
+
"in",
|
|
170814
|
+
"of",
|
|
170815
|
+
"new",
|
|
170816
|
+
"delete",
|
|
170817
|
+
"void",
|
|
170818
|
+
"do",
|
|
170819
|
+
"else",
|
|
170820
|
+
"yield",
|
|
170821
|
+
"await",
|
|
170822
|
+
"case"
|
|
170823
|
+
]);
|
|
170824
|
+
});
|
|
170825
|
+
|
|
170610
170826
|
// src/build/nativeRewrite.ts
|
|
170611
170827
|
import { dlopen, FFIType, ptr } from "bun:ffi";
|
|
170612
170828
|
import { platform as platform4, arch as arch3 } from "os";
|
|
@@ -170687,8 +170903,9 @@ var escapeRegex = (str) => str.replace(/[.*+?^${}()|[\]\\]/g, "\\$&"), jsRewrite
|
|
|
170687
170903
|
if (Object.keys(vendorPaths).length === 0)
|
|
170688
170904
|
return content;
|
|
170689
170905
|
const replacements = Object.entries(vendorPaths).sort(([keyA], [keyB]) => keyB.length - keyA.length);
|
|
170690
|
-
const
|
|
170691
|
-
|
|
170906
|
+
const { masked, restore } = maskLiterals(content);
|
|
170907
|
+
const native = nativeRewriteImports(masked, replacements);
|
|
170908
|
+
return restore(native ?? jsRewriteImports(masked, replacements));
|
|
170692
170909
|
}, fixMissingReExportNamespacesInContent = (content) => {
|
|
170693
170910
|
const REEXPORT_PATTERN = /__reExport\(\s*[A-Za-z_$][\w$]*\s*,\s*([A-Za-z_$][\w$]*)\s*\)/g;
|
|
170694
170911
|
REEXPORT_PATTERN.lastIndex = 0;
|
|
@@ -170777,6 +170994,7 @@ ${content}`;
|
|
|
170777
170994
|
}));
|
|
170778
170995
|
};
|
|
170779
170996
|
var init_rewriteImportsPlugin = __esm(() => {
|
|
170997
|
+
init_maskLiterals();
|
|
170780
170998
|
init_nativeRewrite();
|
|
170781
170999
|
});
|
|
170782
171000
|
|
package/dist/index.js
CHANGED
|
@@ -7237,6 +7237,222 @@ 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 = "\uE000", 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
|
+
const mask = (text) => {
|
|
7249
|
+
out += SENTINEL + pieces.length + SENTINEL;
|
|
7250
|
+
pieces.push(text);
|
|
7251
|
+
};
|
|
7252
|
+
const endOfInterp = (start) => {
|
|
7253
|
+
let j2 = start;
|
|
7254
|
+
let depth = 1;
|
|
7255
|
+
while (j2 < n && depth > 0) {
|
|
7256
|
+
const c = src[j2];
|
|
7257
|
+
if (c === "\\") {
|
|
7258
|
+
j2 += 2;
|
|
7259
|
+
continue;
|
|
7260
|
+
}
|
|
7261
|
+
if (c === "`") {
|
|
7262
|
+
j2 = endOfTemplate(j2);
|
|
7263
|
+
continue;
|
|
7264
|
+
}
|
|
7265
|
+
if (c === '"' || c === "'") {
|
|
7266
|
+
j2 = endOfString(j2);
|
|
7267
|
+
continue;
|
|
7268
|
+
}
|
|
7269
|
+
if (c === "/" && src[j2 + 1] === "/") {
|
|
7270
|
+
const nl = src.indexOf(`
|
|
7271
|
+
`, j2);
|
|
7272
|
+
j2 = nl < 0 ? n : nl;
|
|
7273
|
+
continue;
|
|
7274
|
+
}
|
|
7275
|
+
if (c === "/" && src[j2 + 1] === "*") {
|
|
7276
|
+
const e = src.indexOf("*/", j2 + 2);
|
|
7277
|
+
j2 = e < 0 ? n : e + 2;
|
|
7278
|
+
continue;
|
|
7279
|
+
}
|
|
7280
|
+
if (c === "{")
|
|
7281
|
+
depth++;
|
|
7282
|
+
else if (c === "}")
|
|
7283
|
+
depth--;
|
|
7284
|
+
j2++;
|
|
7285
|
+
}
|
|
7286
|
+
return j2;
|
|
7287
|
+
};
|
|
7288
|
+
function endOfTemplate(start) {
|
|
7289
|
+
let j2 = start + 1;
|
|
7290
|
+
while (j2 < n) {
|
|
7291
|
+
const c = src[j2];
|
|
7292
|
+
if (c === "\\") {
|
|
7293
|
+
j2 += 2;
|
|
7294
|
+
continue;
|
|
7295
|
+
}
|
|
7296
|
+
if (c === "`")
|
|
7297
|
+
return j2 + 1;
|
|
7298
|
+
if (c === "$" && src[j2 + 1] === "{") {
|
|
7299
|
+
j2 = endOfInterp(j2 + 2);
|
|
7300
|
+
continue;
|
|
7301
|
+
}
|
|
7302
|
+
j2++;
|
|
7303
|
+
}
|
|
7304
|
+
return j2;
|
|
7305
|
+
}
|
|
7306
|
+
function endOfString(start) {
|
|
7307
|
+
const q2 = src[start];
|
|
7308
|
+
let j2 = start + 1;
|
|
7309
|
+
while (j2 < n) {
|
|
7310
|
+
const c = src[j2];
|
|
7311
|
+
if (c === "\\") {
|
|
7312
|
+
j2 += 2;
|
|
7313
|
+
continue;
|
|
7314
|
+
}
|
|
7315
|
+
if (c === q2)
|
|
7316
|
+
return j2 + 1;
|
|
7317
|
+
if (c === `
|
|
7318
|
+
`)
|
|
7319
|
+
return j2;
|
|
7320
|
+
j2++;
|
|
7321
|
+
}
|
|
7322
|
+
return j2;
|
|
7323
|
+
}
|
|
7324
|
+
const endOfRegex = (start) => {
|
|
7325
|
+
let j2 = start + 1;
|
|
7326
|
+
let inClass = false;
|
|
7327
|
+
while (j2 < n) {
|
|
7328
|
+
const c = src[j2];
|
|
7329
|
+
if (c === "\\") {
|
|
7330
|
+
j2 += 2;
|
|
7331
|
+
continue;
|
|
7332
|
+
}
|
|
7333
|
+
if (c === `
|
|
7334
|
+
`)
|
|
7335
|
+
return -1;
|
|
7336
|
+
if (c === "[")
|
|
7337
|
+
inClass = true;
|
|
7338
|
+
else if (c === "]")
|
|
7339
|
+
inClass = false;
|
|
7340
|
+
else if (c === "/" && !inClass) {
|
|
7341
|
+
j2++;
|
|
7342
|
+
break;
|
|
7343
|
+
}
|
|
7344
|
+
j2++;
|
|
7345
|
+
}
|
|
7346
|
+
while (j2 < n && /[a-z]/i.test(src[j2] ?? ""))
|
|
7347
|
+
j2++;
|
|
7348
|
+
return j2;
|
|
7349
|
+
};
|
|
7350
|
+
while (i < n) {
|
|
7351
|
+
const c = src[i];
|
|
7352
|
+
const c2 = src[i + 1];
|
|
7353
|
+
if (c === "/" && c2 === "/") {
|
|
7354
|
+
out += "//";
|
|
7355
|
+
i += 2;
|
|
7356
|
+
const s2 = i;
|
|
7357
|
+
while (i < n && src[i] !== `
|
|
7358
|
+
`)
|
|
7359
|
+
i++;
|
|
7360
|
+
mask(src.slice(s2, i));
|
|
7361
|
+
prevChar = "";
|
|
7362
|
+
prevWord = "";
|
|
7363
|
+
continue;
|
|
7364
|
+
}
|
|
7365
|
+
if (c === "/" && c2 === "*") {
|
|
7366
|
+
out += "/*";
|
|
7367
|
+
i += 2;
|
|
7368
|
+
const e = src.indexOf("*/", i);
|
|
7369
|
+
const end = e < 0 ? n : e;
|
|
7370
|
+
mask(src.slice(i, end));
|
|
7371
|
+
i = end < n ? end + 2 : n;
|
|
7372
|
+
if (end < n)
|
|
7373
|
+
out += "*/";
|
|
7374
|
+
continue;
|
|
7375
|
+
}
|
|
7376
|
+
if (c === "`") {
|
|
7377
|
+
const end = endOfTemplate(i);
|
|
7378
|
+
mask(src.slice(i, end));
|
|
7379
|
+
i = end;
|
|
7380
|
+
prevChar = "`";
|
|
7381
|
+
prevWord = "";
|
|
7382
|
+
continue;
|
|
7383
|
+
}
|
|
7384
|
+
if (c === '"' || c === "'") {
|
|
7385
|
+
const end = endOfString(i);
|
|
7386
|
+
out += src.slice(i, end);
|
|
7387
|
+
i = end;
|
|
7388
|
+
prevChar = '"';
|
|
7389
|
+
prevWord = "";
|
|
7390
|
+
continue;
|
|
7391
|
+
}
|
|
7392
|
+
if (c === "/" && (prevChar === "" || REGEX_OK_AFTER_CHAR.has(prevChar) || REGEX_OK_AFTER_WORD.has(prevWord))) {
|
|
7393
|
+
const end = endOfRegex(i);
|
|
7394
|
+
if (end > 0) {
|
|
7395
|
+
out += src.slice(i, end);
|
|
7396
|
+
i = end;
|
|
7397
|
+
prevChar = "/";
|
|
7398
|
+
prevWord = "";
|
|
7399
|
+
continue;
|
|
7400
|
+
}
|
|
7401
|
+
}
|
|
7402
|
+
out += c;
|
|
7403
|
+
i++;
|
|
7404
|
+
if (c === " " || c === "\t" || c === "\r" || c === `
|
|
7405
|
+
`)
|
|
7406
|
+
continue;
|
|
7407
|
+
const wasIdent = isIdentChar(prevChar);
|
|
7408
|
+
prevChar = c;
|
|
7409
|
+
prevWord = isIdentChar(c) ? wasIdent ? prevWord + c : c : "";
|
|
7410
|
+
}
|
|
7411
|
+
const restoreRegex = new RegExp(`${SENTINEL}(\\d+)${SENTINEL}`, "g");
|
|
7412
|
+
const restore = (rewritten) => rewritten.replace(restoreRegex, (_m, d2) => pieces[Number(d2)] ?? "");
|
|
7413
|
+
return { masked: out, restore };
|
|
7414
|
+
};
|
|
7415
|
+
var init_maskLiterals = __esm(() => {
|
|
7416
|
+
REGEX_OK_AFTER_CHAR = new Set([
|
|
7417
|
+
"(",
|
|
7418
|
+
",",
|
|
7419
|
+
"=",
|
|
7420
|
+
":",
|
|
7421
|
+
"[",
|
|
7422
|
+
"!",
|
|
7423
|
+
"&",
|
|
7424
|
+
"|",
|
|
7425
|
+
"?",
|
|
7426
|
+
"{",
|
|
7427
|
+
"}",
|
|
7428
|
+
";",
|
|
7429
|
+
"+",
|
|
7430
|
+
"-",
|
|
7431
|
+
"*",
|
|
7432
|
+
"/",
|
|
7433
|
+
"%",
|
|
7434
|
+
"^",
|
|
7435
|
+
"~",
|
|
7436
|
+
"<",
|
|
7437
|
+
">"
|
|
7438
|
+
]);
|
|
7439
|
+
REGEX_OK_AFTER_WORD = new Set([
|
|
7440
|
+
"return",
|
|
7441
|
+
"typeof",
|
|
7442
|
+
"instanceof",
|
|
7443
|
+
"in",
|
|
7444
|
+
"of",
|
|
7445
|
+
"new",
|
|
7446
|
+
"delete",
|
|
7447
|
+
"void",
|
|
7448
|
+
"do",
|
|
7449
|
+
"else",
|
|
7450
|
+
"yield",
|
|
7451
|
+
"await",
|
|
7452
|
+
"case"
|
|
7453
|
+
]);
|
|
7454
|
+
});
|
|
7455
|
+
|
|
7240
7456
|
// src/build/nativeRewrite.ts
|
|
7241
7457
|
import { dlopen, FFIType, ptr } from "bun:ffi";
|
|
7242
7458
|
import { platform, arch } from "os";
|
|
@@ -7327,8 +7543,9 @@ var escapeRegex = (str) => str.replace(/[.*+?^${}()|[\]\\]/g, "\\$&"), jsRewrite
|
|
|
7327
7543
|
if (Object.keys(vendorPaths).length === 0)
|
|
7328
7544
|
return content;
|
|
7329
7545
|
const replacements = Object.entries(vendorPaths).sort(([keyA], [keyB]) => keyB.length - keyA.length);
|
|
7330
|
-
const
|
|
7331
|
-
|
|
7546
|
+
const { masked, restore } = maskLiterals(content);
|
|
7547
|
+
const native = nativeRewriteImports(masked, replacements);
|
|
7548
|
+
return restore(native ?? jsRewriteImports(masked, replacements));
|
|
7332
7549
|
}, fixMissingReExportNamespacesInContent = (content) => {
|
|
7333
7550
|
const REEXPORT_PATTERN = /__reExport\(\s*[A-Za-z_$][\w$]*\s*,\s*([A-Za-z_$][\w$]*)\s*\)/g;
|
|
7334
7551
|
REEXPORT_PATTERN.lastIndex = 0;
|
|
@@ -7474,6 +7691,7 @@ ${content}`;
|
|
|
7474
7691
|
return result;
|
|
7475
7692
|
};
|
|
7476
7693
|
var init_rewriteImportsPlugin = __esm(() => {
|
|
7694
|
+
init_maskLiterals();
|
|
7477
7695
|
init_nativeRewrite();
|
|
7478
7696
|
});
|
|
7479
7697
|
|
|
@@ -21369,14 +21587,16 @@ var escapeRegex3 = (str) => str.replace(/[.*+?^${}()|[\]\\]/g, "\\$&"), rewriter
|
|
|
21369
21587
|
const replacements = Object.entries(vendorPaths).sort(([keyA], [keyB]) => keyB.length - keyA.length);
|
|
21370
21588
|
await Promise.all(jsFiles.map(async (filePath) => {
|
|
21371
21589
|
const original = await Bun.file(filePath).text();
|
|
21372
|
-
const
|
|
21373
|
-
const
|
|
21590
|
+
const { masked, restore } = maskLiterals(original);
|
|
21591
|
+
const native = nativeRewriteImports(masked, replacements);
|
|
21592
|
+
const content = restore(native ?? applyAllReplacements(masked, rewriter));
|
|
21374
21593
|
if (content !== original) {
|
|
21375
21594
|
await Bun.write(filePath, content);
|
|
21376
21595
|
}
|
|
21377
21596
|
}));
|
|
21378
21597
|
};
|
|
21379
21598
|
var init_rewriteReactImports = __esm(() => {
|
|
21599
|
+
init_maskLiterals();
|
|
21380
21600
|
init_nativeRewrite();
|
|
21381
21601
|
rewriterCache = new Map;
|
|
21382
21602
|
REFRESH_STUBS = "window.$RefreshReg$||(window.$RefreshReg$=function(){});" + `window.$RefreshSig$||(window.$RefreshSig$=function(){return function(t){return t}});
|
|
@@ -23497,7 +23717,7 @@ var init_chainInlineSourcemaps = __esm(() => {
|
|
|
23497
23717
|
});
|
|
23498
23718
|
|
|
23499
23719
|
// src/build/vueAutoRouterTransform.ts
|
|
23500
|
-
var SCRIPT_REGEX, ROUTES_EXPORT_REGEX,
|
|
23720
|
+
var SCRIPT_REGEX, ROUTES_EXPORT_REGEX, SENTINEL2 = "__ABSOLUTE_AUTO_ROUTER__", SETUP_APP_DECLARATION_REGEX, SETUP_APP_FUNCTION_REGEX, addAutoRouterSetupApp = (sourceContent) => {
|
|
23501
23721
|
if (!ROUTES_EXPORT_REGEX.test(sourceContent))
|
|
23502
23722
|
return sourceContent;
|
|
23503
23723
|
const match = SCRIPT_REGEX.exec(sourceContent);
|
|
@@ -23506,13 +23726,13 @@ var SCRIPT_REGEX, ROUTES_EXPORT_REGEX, SENTINEL = "__ABSOLUTE_AUTO_ROUTER__", SE
|
|
|
23506
23726
|
const [, openTag, scriptBody, closeTag] = match;
|
|
23507
23727
|
if (!openTag || scriptBody === undefined || !closeTag)
|
|
23508
23728
|
return sourceContent;
|
|
23509
|
-
if (scriptBody.includes(
|
|
23729
|
+
if (scriptBody.includes(SENTINEL2))
|
|
23510
23730
|
return sourceContent;
|
|
23511
23731
|
let rewrittenScript = scriptBody.replace(SETUP_APP_DECLARATION_REGEX, "const __absoluteUserSetupApp__");
|
|
23512
23732
|
rewrittenScript = rewrittenScript.replace(SETUP_APP_FUNCTION_REGEX, "$1 __absoluteUserSetupApp__");
|
|
23513
23733
|
const userHadSetupApp = rewrittenScript !== scriptBody;
|
|
23514
23734
|
const autoWrapper = `
|
|
23515
|
-
// ${
|
|
23735
|
+
// ${SENTINEL2} \u2014 generated by AbsoluteJS because this page exports
|
|
23516
23736
|
// \`routes\`. Owns the vue-router lifecycle (history pick, app.use,
|
|
23517
23737
|
// push, isReady) so user code stays declarative.
|
|
23518
23738
|
import {
|
|
@@ -46737,5 +46957,5 @@ export {
|
|
|
46737
46957
|
ANGULAR_INIT_TIMEOUT_MS
|
|
46738
46958
|
};
|
|
46739
46959
|
|
|
46740
|
-
//# debugId=
|
|
46960
|
+
//# debugId=C3D862B3C898113964756E2164756E21
|
|
46741
46961
|
//# sourceMappingURL=index.js.map
|