@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.
@@ -1,7 +1,7 @@
1
1
  // @bun
2
2
  var __require = import.meta.require;
3
3
 
4
- // .angular-partial-tmp-PxMA4z/src/core/streamingSlotRegistrar.ts
4
+ // .angular-partial-tmp-CjyDRP/src/core/streamingSlotRegistrar.ts
5
5
  var STREAMING_SLOT_REGISTRAR_KEY = Symbol.for("absolutejs.streamingSlotRegistrar");
6
6
  var STREAMING_SLOT_WARNING_STORAGE_KEY = Symbol.for("absolutejs.streamingSlotWarningController");
7
7
  var STREAMING_SLOT_COLLECTION_STORAGE_KEY = Symbol.for("absolutejs.streamingSlotCollectionController");
@@ -1,7 +1,7 @@
1
1
  // @bun
2
2
  var __require = import.meta.require;
3
3
 
4
- // .angular-partial-tmp-PxMA4z/src/core/streamingSlotRegistrar.ts
4
+ // .angular-partial-tmp-CjyDRP/src/core/streamingSlotRegistrar.ts
5
5
  var STREAMING_SLOT_REGISTRAR_KEY = Symbol.for("absolutejs.streamingSlotRegistrar");
6
6
  var STREAMING_SLOT_WARNING_STORAGE_KEY = Symbol.for("absolutejs.streamingSlotWarningController");
7
7
  var STREAMING_SLOT_COLLECTION_STORAGE_KEY = Symbol.for("absolutejs.streamingSlotCollectionController");
@@ -48,7 +48,7 @@ var warnMissingStreamingSlotCollector = (primitiveName) => {
48
48
  getWarningController()?.maybeWarn(primitiveName);
49
49
  };
50
50
 
51
- // .angular-partial-tmp-PxMA4z/src/core/streamingSlotRegistry.ts
51
+ // .angular-partial-tmp-CjyDRP/src/core/streamingSlotRegistry.ts
52
52
  var STREAMING_SLOT_STORAGE_KEY = Symbol.for("absolutejs.streamingSlotAsyncLocalStorage");
53
53
  var isObjectRecord2 = (value) => Boolean(value) && typeof value === "object";
54
54
  var isAsyncLocalStorage = (value) => isObjectRecord2(value) && ("getStore" in value) && typeof value.getStore === "function" && ("run" in value) && typeof value.run === "function";
@@ -783,6 +783,240 @@ var init_islandSsr = __esm(() => {
783
783
  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;
784
784
  });
785
785
 
786
+ // src/build/maskLiterals.ts
787
+ var SENTINEL, isIdentChar = (c) => /[A-Za-z0-9_$]/.test(c), REGEX_OK_AFTER_CHAR, REGEX_OK_AFTER_WORD, maskLiterals = (src) => {
788
+ const n = src.length;
789
+ const pieces = [];
790
+ let out = "";
791
+ let i = 0;
792
+ let prevChar = "";
793
+ let prevWord = "";
794
+ let prevWasSpace = false;
795
+ let wordBeforeParen = "";
796
+ const mask = (text) => {
797
+ out += SENTINEL + pieces.length + SENTINEL;
798
+ pieces.push(text);
799
+ prevChar = ")";
800
+ prevWord = "";
801
+ prevWasSpace = false;
802
+ };
803
+ const endOfString = (start) => {
804
+ const q = src[start];
805
+ let j = start + 1;
806
+ while (j < n) {
807
+ const c = src[j];
808
+ if (c === "\\") {
809
+ j += 2;
810
+ continue;
811
+ }
812
+ if (c === q)
813
+ return j + 1;
814
+ if (c === `
815
+ `)
816
+ return j;
817
+ j++;
818
+ }
819
+ return j;
820
+ };
821
+ const endOfInterp = (start) => {
822
+ let j = start;
823
+ let depth = 1;
824
+ while (j < n && depth > 0) {
825
+ const c = src[j];
826
+ if (c === "\\") {
827
+ j += 2;
828
+ continue;
829
+ }
830
+ if (c === "`") {
831
+ j = endOfTemplate(j);
832
+ continue;
833
+ }
834
+ if (c === '"' || c === "'") {
835
+ j = endOfString(j);
836
+ continue;
837
+ }
838
+ if (c === "/" && src[j + 1] === "/") {
839
+ const nl = src.indexOf(`
840
+ `, j);
841
+ j = nl < 0 ? n : nl;
842
+ continue;
843
+ }
844
+ if (c === "/" && src[j + 1] === "*") {
845
+ const e = src.indexOf("*/", j + 2);
846
+ j = e < 0 ? n : e + 2;
847
+ continue;
848
+ }
849
+ if (c === "{")
850
+ depth++;
851
+ else if (c === "}")
852
+ depth--;
853
+ j++;
854
+ }
855
+ return j;
856
+ };
857
+ function endOfTemplate(start) {
858
+ let j = start + 1;
859
+ while (j < n) {
860
+ const c = src[j];
861
+ if (c === "\\") {
862
+ j += 2;
863
+ continue;
864
+ }
865
+ if (c === "`")
866
+ return j + 1;
867
+ if (c === "$" && src[j + 1] === "{") {
868
+ j = endOfInterp(j + 2);
869
+ continue;
870
+ }
871
+ j++;
872
+ }
873
+ return j;
874
+ }
875
+ const endOfRegex = (start) => {
876
+ let j = start + 1;
877
+ let inClass = false;
878
+ while (j < n) {
879
+ const c = src[j];
880
+ if (c === "\\") {
881
+ j += 2;
882
+ continue;
883
+ }
884
+ if (c === `
885
+ `)
886
+ return -1;
887
+ if (c === "[")
888
+ inClass = true;
889
+ else if (c === "]")
890
+ inClass = false;
891
+ else if (c === "/" && !inClass) {
892
+ j++;
893
+ break;
894
+ }
895
+ j++;
896
+ }
897
+ while (j < n && /[a-z]/i.test(src[j] ?? ""))
898
+ j++;
899
+ return j;
900
+ };
901
+ while (i < n) {
902
+ const c = src[i];
903
+ const c2 = src[i + 1];
904
+ if (c === "/" && c2 === "/") {
905
+ out += "//";
906
+ i += 2;
907
+ const s = i;
908
+ while (i < n && src[i] !== `
909
+ `)
910
+ i++;
911
+ mask(src.slice(s, i));
912
+ continue;
913
+ }
914
+ if (c === "/" && c2 === "*") {
915
+ out += "/*";
916
+ i += 2;
917
+ const e = src.indexOf("*/", i);
918
+ const end = e < 0 ? n : e;
919
+ mask(src.slice(i, end));
920
+ i = end < n ? end + 2 : n;
921
+ if (end < n)
922
+ out += "*/";
923
+ continue;
924
+ }
925
+ if (c === "`") {
926
+ const end = endOfTemplate(i);
927
+ mask(src.slice(i, end));
928
+ i = end;
929
+ continue;
930
+ }
931
+ if (c === '"' || c === "'") {
932
+ const end = endOfString(i);
933
+ const isSpecifier = prevWord === "from" || prevWord === "import" || prevChar === "(" && (wordBeforeParen === "import" || wordBeforeParen === "require");
934
+ if (isSpecifier) {
935
+ out += src.slice(i, end);
936
+ prevChar = '"';
937
+ prevWord = "";
938
+ prevWasSpace = false;
939
+ } else {
940
+ mask(src.slice(i, end));
941
+ }
942
+ i = end;
943
+ continue;
944
+ }
945
+ if (c === "/" && (prevChar === "" || REGEX_OK_AFTER_CHAR.has(prevChar) || REGEX_OK_AFTER_WORD.has(prevWord))) {
946
+ const end = endOfRegex(i);
947
+ if (end > 0) {
948
+ out += src.slice(i, end);
949
+ i = end;
950
+ prevChar = ")";
951
+ prevWord = "";
952
+ prevWasSpace = false;
953
+ continue;
954
+ }
955
+ }
956
+ out += c;
957
+ i++;
958
+ if (c === " " || c === "\t" || c === "\r" || c === `
959
+ `) {
960
+ prevWasSpace = true;
961
+ continue;
962
+ }
963
+ if (isIdentChar(c)) {
964
+ const contiguous = isIdentChar(prevChar) && !prevWasSpace;
965
+ prevWord = contiguous ? prevWord + c : c;
966
+ } else {
967
+ if (c === "(")
968
+ wordBeforeParen = prevWord;
969
+ prevWord = "";
970
+ }
971
+ prevChar = c;
972
+ prevWasSpace = false;
973
+ }
974
+ const restoreRegex = new RegExp(`${SENTINEL}(\\d+)${SENTINEL}`, "g");
975
+ const restore = (rewritten) => rewritten.replace(restoreRegex, (_m, d) => pieces[Number(d)] ?? "");
976
+ return { masked: out, restore };
977
+ };
978
+ var init_maskLiterals = __esm(() => {
979
+ SENTINEL = String.fromCharCode(57344);
980
+ REGEX_OK_AFTER_CHAR = new Set([
981
+ "(",
982
+ ",",
983
+ "=",
984
+ ":",
985
+ "[",
986
+ "!",
987
+ "&",
988
+ "|",
989
+ "?",
990
+ "{",
991
+ "}",
992
+ ";",
993
+ "+",
994
+ "-",
995
+ "*",
996
+ "/",
997
+ "%",
998
+ "^",
999
+ "~",
1000
+ "<",
1001
+ ">"
1002
+ ]);
1003
+ REGEX_OK_AFTER_WORD = new Set([
1004
+ "return",
1005
+ "typeof",
1006
+ "instanceof",
1007
+ "in",
1008
+ "of",
1009
+ "new",
1010
+ "delete",
1011
+ "void",
1012
+ "do",
1013
+ "else",
1014
+ "yield",
1015
+ "await",
1016
+ "case"
1017
+ ]);
1018
+ });
1019
+
786
1020
  // src/build/nativeRewrite.ts
787
1021
  import { dlopen, FFIType, ptr } from "bun:ffi";
788
1022
  import { platform, arch } from "os";
@@ -873,8 +1107,9 @@ var escapeRegex = (str) => str.replace(/[.*+?^${}()|[\]\\]/g, "\\$&"), jsRewrite
873
1107
  if (Object.keys(vendorPaths).length === 0)
874
1108
  return content;
875
1109
  const replacements = Object.entries(vendorPaths).sort(([keyA], [keyB]) => keyB.length - keyA.length);
876
- const native = nativeRewriteImports(content, replacements);
877
- return native ?? jsRewriteImports(content, replacements);
1110
+ const { masked, restore } = maskLiterals(content);
1111
+ const native = nativeRewriteImports(masked, replacements);
1112
+ return restore(native ?? jsRewriteImports(masked, replacements));
878
1113
  }, fixMissingReExportNamespacesInContent = (content) => {
879
1114
  const REEXPORT_PATTERN = /__reExport\(\s*[A-Za-z_$][\w$]*\s*,\s*([A-Za-z_$][\w$]*)\s*\)/g;
880
1115
  REEXPORT_PATTERN.lastIndex = 0;
@@ -1020,6 +1255,7 @@ ${content}`;
1020
1255
  return result;
1021
1256
  };
1022
1257
  var init_rewriteImportsPlugin = __esm(() => {
1258
+ init_maskLiterals();
1023
1259
  init_nativeRewrite();
1024
1260
  });
1025
1261
 
@@ -15888,5 +16124,5 @@ export {
15888
16124
  ABSOLUTE_HTTP_TRANSFER_CACHE_SKIP_HEADER
15889
16125
  };
15890
16126
 
15891
- //# debugId=A52AAA59BCCC2F1564756E2164756E21
16127
+ //# debugId=BA705493D94D3D1B64756E2164756E21
15892
16128
  //# sourceMappingURL=index.js.map