@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/vue/index.js CHANGED
@@ -1939,6 +1939,222 @@ var init_islandSsr = __esm(() => {
1939
1939
  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;
1940
1940
  });
1941
1941
 
1942
+ // src/build/maskLiterals.ts
1943
+ var SENTINEL = "\uE000", isIdentChar = (c) => /[A-Za-z0-9_$]/.test(c), REGEX_OK_AFTER_CHAR, REGEX_OK_AFTER_WORD, maskLiterals = (src) => {
1944
+ const n = src.length;
1945
+ const pieces = [];
1946
+ let out = "";
1947
+ let i = 0;
1948
+ let prevChar = "";
1949
+ let prevWord = "";
1950
+ const mask = (text) => {
1951
+ out += SENTINEL + pieces.length + SENTINEL;
1952
+ pieces.push(text);
1953
+ };
1954
+ const endOfInterp = (start) => {
1955
+ let j = start;
1956
+ let depth = 1;
1957
+ while (j < n && depth > 0) {
1958
+ const c = src[j];
1959
+ if (c === "\\") {
1960
+ j += 2;
1961
+ continue;
1962
+ }
1963
+ if (c === "`") {
1964
+ j = endOfTemplate(j);
1965
+ continue;
1966
+ }
1967
+ if (c === '"' || c === "'") {
1968
+ j = endOfString(j);
1969
+ continue;
1970
+ }
1971
+ if (c === "/" && src[j + 1] === "/") {
1972
+ const nl = src.indexOf(`
1973
+ `, j);
1974
+ j = nl < 0 ? n : nl;
1975
+ continue;
1976
+ }
1977
+ if (c === "/" && src[j + 1] === "*") {
1978
+ const e = src.indexOf("*/", j + 2);
1979
+ j = e < 0 ? n : e + 2;
1980
+ continue;
1981
+ }
1982
+ if (c === "{")
1983
+ depth++;
1984
+ else if (c === "}")
1985
+ depth--;
1986
+ j++;
1987
+ }
1988
+ return j;
1989
+ };
1990
+ function endOfTemplate(start) {
1991
+ let j = start + 1;
1992
+ while (j < n) {
1993
+ const c = src[j];
1994
+ if (c === "\\") {
1995
+ j += 2;
1996
+ continue;
1997
+ }
1998
+ if (c === "`")
1999
+ return j + 1;
2000
+ if (c === "$" && src[j + 1] === "{") {
2001
+ j = endOfInterp(j + 2);
2002
+ continue;
2003
+ }
2004
+ j++;
2005
+ }
2006
+ return j;
2007
+ }
2008
+ function endOfString(start) {
2009
+ const q = src[start];
2010
+ let j = start + 1;
2011
+ while (j < n) {
2012
+ const c = src[j];
2013
+ if (c === "\\") {
2014
+ j += 2;
2015
+ continue;
2016
+ }
2017
+ if (c === q)
2018
+ return j + 1;
2019
+ if (c === `
2020
+ `)
2021
+ return j;
2022
+ j++;
2023
+ }
2024
+ return j;
2025
+ }
2026
+ const endOfRegex = (start) => {
2027
+ let j = start + 1;
2028
+ let inClass = false;
2029
+ while (j < n) {
2030
+ const c = src[j];
2031
+ if (c === "\\") {
2032
+ j += 2;
2033
+ continue;
2034
+ }
2035
+ if (c === `
2036
+ `)
2037
+ return -1;
2038
+ if (c === "[")
2039
+ inClass = true;
2040
+ else if (c === "]")
2041
+ inClass = false;
2042
+ else if (c === "/" && !inClass) {
2043
+ j++;
2044
+ break;
2045
+ }
2046
+ j++;
2047
+ }
2048
+ while (j < n && /[a-z]/i.test(src[j] ?? ""))
2049
+ j++;
2050
+ return j;
2051
+ };
2052
+ while (i < n) {
2053
+ const c = src[i];
2054
+ const c2 = src[i + 1];
2055
+ if (c === "/" && c2 === "/") {
2056
+ out += "//";
2057
+ i += 2;
2058
+ const s = i;
2059
+ while (i < n && src[i] !== `
2060
+ `)
2061
+ i++;
2062
+ mask(src.slice(s, i));
2063
+ prevChar = "";
2064
+ prevWord = "";
2065
+ continue;
2066
+ }
2067
+ if (c === "/" && c2 === "*") {
2068
+ out += "/*";
2069
+ i += 2;
2070
+ const e = src.indexOf("*/", i);
2071
+ const end = e < 0 ? n : e;
2072
+ mask(src.slice(i, end));
2073
+ i = end < n ? end + 2 : n;
2074
+ if (end < n)
2075
+ out += "*/";
2076
+ continue;
2077
+ }
2078
+ if (c === "`") {
2079
+ const end = endOfTemplate(i);
2080
+ mask(src.slice(i, end));
2081
+ i = end;
2082
+ prevChar = "`";
2083
+ prevWord = "";
2084
+ continue;
2085
+ }
2086
+ if (c === '"' || c === "'") {
2087
+ const end = endOfString(i);
2088
+ out += src.slice(i, end);
2089
+ i = end;
2090
+ prevChar = '"';
2091
+ prevWord = "";
2092
+ continue;
2093
+ }
2094
+ if (c === "/" && (prevChar === "" || REGEX_OK_AFTER_CHAR.has(prevChar) || REGEX_OK_AFTER_WORD.has(prevWord))) {
2095
+ const end = endOfRegex(i);
2096
+ if (end > 0) {
2097
+ out += src.slice(i, end);
2098
+ i = end;
2099
+ prevChar = "/";
2100
+ prevWord = "";
2101
+ continue;
2102
+ }
2103
+ }
2104
+ out += c;
2105
+ i++;
2106
+ if (c === " " || c === "\t" || c === "\r" || c === `
2107
+ `)
2108
+ continue;
2109
+ const wasIdent = isIdentChar(prevChar);
2110
+ prevChar = c;
2111
+ prevWord = isIdentChar(c) ? wasIdent ? prevWord + c : c : "";
2112
+ }
2113
+ const restoreRegex = new RegExp(`${SENTINEL}(\\d+)${SENTINEL}`, "g");
2114
+ const restore = (rewritten) => rewritten.replace(restoreRegex, (_m, d) => pieces[Number(d)] ?? "");
2115
+ return { masked: out, restore };
2116
+ };
2117
+ var init_maskLiterals = __esm(() => {
2118
+ REGEX_OK_AFTER_CHAR = new Set([
2119
+ "(",
2120
+ ",",
2121
+ "=",
2122
+ ":",
2123
+ "[",
2124
+ "!",
2125
+ "&",
2126
+ "|",
2127
+ "?",
2128
+ "{",
2129
+ "}",
2130
+ ";",
2131
+ "+",
2132
+ "-",
2133
+ "*",
2134
+ "/",
2135
+ "%",
2136
+ "^",
2137
+ "~",
2138
+ "<",
2139
+ ">"
2140
+ ]);
2141
+ REGEX_OK_AFTER_WORD = new Set([
2142
+ "return",
2143
+ "typeof",
2144
+ "instanceof",
2145
+ "in",
2146
+ "of",
2147
+ "new",
2148
+ "delete",
2149
+ "void",
2150
+ "do",
2151
+ "else",
2152
+ "yield",
2153
+ "await",
2154
+ "case"
2155
+ ]);
2156
+ });
2157
+
1942
2158
  // src/build/nativeRewrite.ts
1943
2159
  import { dlopen, FFIType, ptr } from "bun:ffi";
1944
2160
  import { platform as platform2, arch as arch2 } from "os";
@@ -2029,8 +2245,9 @@ var escapeRegex = (str) => str.replace(/[.*+?^${}()|[\]\\]/g, "\\$&"), jsRewrite
2029
2245
  if (Object.keys(vendorPaths).length === 0)
2030
2246
  return content;
2031
2247
  const replacements = Object.entries(vendorPaths).sort(([keyA], [keyB]) => keyB.length - keyA.length);
2032
- const native = nativeRewriteImports(content, replacements);
2033
- return native ?? jsRewriteImports(content, replacements);
2248
+ const { masked, restore } = maskLiterals(content);
2249
+ const native = nativeRewriteImports(masked, replacements);
2250
+ return restore(native ?? jsRewriteImports(masked, replacements));
2034
2251
  }, fixMissingReExportNamespacesInContent = (content) => {
2035
2252
  const REEXPORT_PATTERN = /__reExport\(\s*[A-Za-z_$][\w$]*\s*,\s*([A-Za-z_$][\w$]*)\s*\)/g;
2036
2253
  REEXPORT_PATTERN.lastIndex = 0;
@@ -2176,6 +2393,7 @@ ${content}`;
2176
2393
  return result;
2177
2394
  };
2178
2395
  var init_rewriteImportsPlugin = __esm(() => {
2396
+ init_maskLiterals();
2179
2397
  init_nativeRewrite();
2180
2398
  });
2181
2399
 
@@ -5362,5 +5580,5 @@ export {
5362
5580
  Image
5363
5581
  };
5364
5582
 
5365
- //# debugId=8B4337B6D986FDEC64756E2164756E21
5583
+ //# debugId=2118F34820604CAB64756E2164756E21
5366
5584
  //# sourceMappingURL=index.js.map