@absolutejs/absolute 0.19.0-beta.212 → 0.19.0-beta.213

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/cli/index.js CHANGED
@@ -991,21 +991,60 @@ var run = async (name, command) => {
991
991
  stderr: "pipe",
992
992
  stdout: "pipe"
993
993
  });
994
+ const [stdout, stderr] = await Promise.all([
995
+ new Response(proc.stdout).text(),
996
+ new Response(proc.stderr).text()
997
+ ]);
994
998
  const exitCode = await proc.exited;
995
- const stdout = proc.stdout ? await new Response(proc.stdout).text() : "";
996
- const stderr = proc.stderr ? await new Response(proc.stderr).text() : "";
997
999
  return { exitCode, name, output: (stdout + stderr).trim() };
998
1000
  }, findBin = (name) => {
999
1001
  const local = resolve7("node_modules", ".bin", name);
1000
1002
  return existsSync9(local) ? local : null;
1001
- }, formatSvelteOutput = (output) => output.split(`
1002
- `).filter((line) => line.includes("ERROR") && !line.includes("START") && !line.includes("COMPLETED")).map((line) => {
1003
- const match = line.match(/ERROR "([^"]+)" (\d+:\d+) "(.+)"/);
1004
- if (!match)
1005
- return line;
1006
- return `\x1B[96m${match[1]}\x1B[0m:\x1B[93m${match[2]}\x1B[0m - \x1B[91merror\x1B[0m ${match[3]}`;
1007
- }).join(`
1008
- `), typecheck = async (configPath2) => {
1003
+ }, stripAnsi = (str) => str.replace(/\x1b\[[0-9;]*m/g, ""), formatSvelteOutput = (output) => {
1004
+ const cwd = process.cwd() + "/";
1005
+ const summaryMatch = stripAnsi(output).match(/svelte-check found (\d+) error/);
1006
+ const errorCount = summaryMatch ? parseInt(summaryMatch[1] ?? "0", 10) : 0;
1007
+ const formatted = output.split(`
1008
+ `).filter((line) => {
1009
+ const plain = stripAnsi(line);
1010
+ return !plain.startsWith("Loading svelte-check") && !plain.startsWith("Getting Svelte") && !plain.startsWith("====") && !plain.startsWith("svelte-check found") && !/^\d+ (START|COMPLETED)/.test(plain) && plain.trim() !== "";
1011
+ }).flatMap((line) => {
1012
+ let result = line.replaceAll(cwd, "");
1013
+ const plain = stripAnsi(result);
1014
+ const pathMatch = plain.match(/^(\S+\.svelte):(\d+:\d+)$/);
1015
+ if (pathMatch) {
1016
+ return [
1017
+ `\x1B[96m${pathMatch[1]}\x1B[0m:\x1B[93m${pathMatch[2]}\x1B[0m`
1018
+ ];
1019
+ }
1020
+ if (result.includes("\x1B[35m")) {
1021
+ const plainLine = stripAnsi(result);
1022
+ const before = stripAnsi(result.split("\x1B[35m")[0] ?? "");
1023
+ const token = stripAnsi((result.split("\x1B[35m")[1] ?? "").split(/\x1b\[3[69]m/)[0] ?? "");
1024
+ if (token) {
1025
+ const expanded = before.replace(/\t/g, " ");
1026
+ const expandedLine = plainLine.replace(/\t/g, " ");
1027
+ const underline = "~".repeat(token.length);
1028
+ return [
1029
+ `\x1B[0m${expandedLine}`,
1030
+ `${" ".repeat(expanded.length)}\x1B[91m${underline}\x1B[0m`
1031
+ ];
1032
+ }
1033
+ }
1034
+ if (/^\x1b\[36m|\t/.test(result) && !result.includes("Error") && !result.includes("\x1B[35m")) {
1035
+ return [];
1036
+ }
1037
+ return [result];
1038
+ }).join(`
1039
+ `);
1040
+ if (errorCount > 0) {
1041
+ const s = errorCount === 1 ? "" : "s";
1042
+ return `${formatted}
1043
+
1044
+ Found ${errorCount} error${s}.`;
1045
+ }
1046
+ return formatted;
1047
+ }, typecheck = async (configPath2) => {
1009
1048
  const config = await loadConfig(configPath2);
1010
1049
  const hasSvelte = Boolean(config.svelteDirectory);
1011
1050
  const hasVue = Boolean(config.vueDirectory);
@@ -1058,7 +1097,10 @@ var run = async (name, command) => {
1058
1097
  "--threshold",
1059
1098
  "error",
1060
1099
  "--compiler-warnings",
1061
- "css-unused-selector:ignore"
1100
+ "css-unused-selector:ignore",
1101
+ "--output",
1102
+ "human-verbose",
1103
+ "--color"
1062
1104
  ]));
1063
1105
  }
1064
1106
  const results = await Promise.all(checks);
@@ -9,16 +9,7 @@ var DEFAULT_DEVICE_SIZES = [
9
9
  2048,
10
10
  3840
11
11
  ];
12
- var DEFAULT_IMAGE_SIZES = [
13
- 16,
14
- 32,
15
- 48,
16
- 64,
17
- 96,
18
- 128,
19
- 256,
20
- 384
21
- ];
12
+ var DEFAULT_IMAGE_SIZES = [16, 32, 48, 64, 96, 128, 256, 384];
22
13
  var DEFAULT_QUALITY = 75;
23
14
  var OPTIMIZATION_ENDPOINT = "/_absolute/image";
24
15
  var buildOptimizedUrl = (src, width, quality, basePath = OPTIMIZATION_ENDPOINT) => `${basePath}?url=${encodeURIComponent(src)}&w=${width}&q=${quality}`;
package/dist/index.js CHANGED
@@ -956,7 +956,10 @@ var DEFAULT_DEVICE_SIZES, DEFAULT_IMAGE_SIZES, DEFAULT_QUALITY = 75, OPTIMIZATIO
956
956
  const pipeline = callSharp(sharp, toBuffer(buffer)).rotate().resize(width, undefined, { withoutEnlargement: true });
957
957
  switch (format) {
958
958
  case "avif":
959
- return pipeline.avif({ effort: AVIF_EFFORT, quality: Math.max(1, quality - AVIF_QUALITY_OFFSET) }).toBuffer();
959
+ return pipeline.avif({
960
+ effort: AVIF_EFFORT,
961
+ quality: Math.max(1, quality - AVIF_QUALITY_OFFSET)
962
+ }).toBuffer();
960
963
  case "jpeg":
961
964
  return pipeline.jpeg({ mozjpeg: true, quality }).toBuffer();
962
965
  case "png":
@@ -1011,16 +1014,7 @@ var init_imageProcessing = __esm(() => {
1011
1014
  2048,
1012
1015
  3840
1013
1016
  ];
1014
- DEFAULT_IMAGE_SIZES = [
1015
- 16,
1016
- 32,
1017
- 48,
1018
- 64,
1019
- 96,
1020
- 128,
1021
- 256,
1022
- 384
1023
- ];
1017
+ DEFAULT_IMAGE_SIZES = [16, 32, 48, 64, 96, 128, 256, 384];
1024
1018
  MIME_MAP = {
1025
1019
  avif: "image/avif",
1026
1020
  jpeg: "image/jpeg",
@@ -177986,5 +177980,5 @@ export {
177986
177980
  ANGULAR_INIT_TIMEOUT_MS
177987
177981
  };
177988
177982
 
177989
- //# debugId=FF39154C4CAFE45D64756E2164756E21
177983
+ //# debugId=99FAC29D4EBC3F9564756E2164756E21
177990
177984
  //# sourceMappingURL=index.js.map