@absolutejs/absolute 0.19.0-beta.211 → 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/.absolutejs/prettier.cache.json +236 -0
- package/.absolutejs/tsc.tsbuildinfo +1 -0
- package/.absolutejs/tsconfig.svelte-check.json +6 -0
- package/.absolutejs/tsconfig.tsbuildinfo +1 -1
- package/.absolutejs/tsconfig.vue-check.json +6 -0
- package/.absolutejs/vue-tsc.tsbuildinfo +1 -0
- package/dist/{Image-599vc5xz.vue → Image-k52pzpdh.vue} +71 -37
- package/dist/angular/components/image.component.js +11 -3
- package/dist/angular/index.js.map +2 -2
- package/dist/build.js +6 -12
- package/dist/build.js.map +5 -5
- package/dist/cli/index.js +85 -19
- package/dist/image-client/imageClient.js +1 -10
- package/dist/index.js +6 -12
- package/dist/index.js.map +6 -6
- package/dist/react/components/browser/index.js +1 -10
- package/dist/react/components/index.js +6 -12
- package/dist/react/components/index.js.map +4 -4
- package/dist/svelte/components/Image.svelte +8 -5
- package/dist/types/metadata.d.ts +1 -1
- package/dist/vue/components/Image.vue +71 -37
- package/dist/vue/components/index.js +1 -1
- package/package.json +3 -2
- package/scripts/build.ts +308 -295
- package/types/metadata.ts +7 -1
package/dist/cli/index.js
CHANGED
|
@@ -986,25 +986,64 @@ __export(exports_typecheck, {
|
|
|
986
986
|
import { resolve as resolve7, join as join7 } from "path";
|
|
987
987
|
import { existsSync as existsSync9 } from "fs";
|
|
988
988
|
import { writeFile } from "fs/promises";
|
|
989
|
-
var run = async (name, command
|
|
989
|
+
var run = async (name, command) => {
|
|
990
990
|
const proc = Bun.spawn(command, {
|
|
991
|
-
stderr:
|
|
992
|
-
stdout:
|
|
991
|
+
stderr: "pipe",
|
|
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
|
-
|
|
996
|
-
const stderr = proc.stderr ? await new Response(proc.stderr).text() : "";
|
|
997
|
-
const stdout = proc.stdout ? await new Response(proc.stdout).text() : "";
|
|
998
|
-
const lines = (stdout + stderr).split(`
|
|
999
|
-
`).filter((line) => line.includes("Error:") || line.includes("error ") || line.includes("ERROR"));
|
|
1000
|
-
if (lines.length > 0)
|
|
1001
|
-
console.error(lines.join(`
|
|
1002
|
-
`));
|
|
1003
|
-
}
|
|
1004
|
-
return { exitCode, name };
|
|
999
|
+
return { exitCode, name, output: (stdout + stderr).trim() };
|
|
1005
1000
|
}, findBin = (name) => {
|
|
1006
1001
|
const local = resolve7("node_modules", ".bin", name);
|
|
1007
|
-
return existsSync9(local) ? local :
|
|
1002
|
+
return existsSync9(local) ? local : null;
|
|
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;
|
|
1008
1047
|
}, typecheck = async (configPath2) => {
|
|
1009
1048
|
const config = await loadConfig(configPath2);
|
|
1010
1049
|
const hasSvelte = Boolean(config.svelteDirectory);
|
|
@@ -1012,8 +1051,13 @@ var run = async (name, command, quiet = false) => {
|
|
|
1012
1051
|
const cacheDir = ".absolutejs";
|
|
1013
1052
|
const checks = [];
|
|
1014
1053
|
if (hasVue) {
|
|
1054
|
+
const vueTscBin = findBin("vue-tsc");
|
|
1055
|
+
if (!vueTscBin) {
|
|
1056
|
+
console.error("\x1B[31m\u2717\x1B[0m vue-tsc is required for Vue type checking. Install it: bun add -d vue-tsc");
|
|
1057
|
+
process.exit(1);
|
|
1058
|
+
}
|
|
1015
1059
|
checks.push(run("vue-tsc", [
|
|
1016
|
-
|
|
1060
|
+
vueTscBin,
|
|
1017
1061
|
"--noEmit",
|
|
1018
1062
|
"--incremental",
|
|
1019
1063
|
"--tsBuildInfoFile",
|
|
@@ -1021,8 +1065,13 @@ var run = async (name, command, quiet = false) => {
|
|
|
1021
1065
|
"--pretty"
|
|
1022
1066
|
]));
|
|
1023
1067
|
} else {
|
|
1068
|
+
const tscBin = findBin("tsc");
|
|
1069
|
+
if (!tscBin) {
|
|
1070
|
+
console.error("\x1B[31m\u2717\x1B[0m typescript is required for type checking. Install it: bun add -d typescript");
|
|
1071
|
+
process.exit(1);
|
|
1072
|
+
}
|
|
1024
1073
|
checks.push(run("tsc", [
|
|
1025
|
-
|
|
1074
|
+
tscBin,
|
|
1026
1075
|
"--noEmit",
|
|
1027
1076
|
"--incremental",
|
|
1028
1077
|
"--tsBuildInfoFile",
|
|
@@ -1031,24 +1080,41 @@ var run = async (name, command, quiet = false) => {
|
|
|
1031
1080
|
]));
|
|
1032
1081
|
}
|
|
1033
1082
|
if (hasSvelte) {
|
|
1083
|
+
const svelteBin = findBin("svelte-check");
|
|
1084
|
+
if (!svelteBin) {
|
|
1085
|
+
console.error("\x1B[31m\u2717\x1B[0m svelte-check is required for Svelte type checking. Install it: bun add -d svelte-check");
|
|
1086
|
+
process.exit(1);
|
|
1087
|
+
}
|
|
1034
1088
|
const svelteTsconfigPath = join7(cacheDir, "tsconfig.svelte-check.json");
|
|
1035
1089
|
await writeFile(svelteTsconfigPath, JSON.stringify({
|
|
1036
1090
|
extends: resolve7("tsconfig.json"),
|
|
1037
1091
|
include: [`../${config.svelteDirectory}/**/*`]
|
|
1038
1092
|
}, null, "\t"));
|
|
1039
1093
|
checks.push(run("svelte-check", [
|
|
1040
|
-
|
|
1094
|
+
svelteBin,
|
|
1041
1095
|
"--tsconfig",
|
|
1042
1096
|
resolve7(svelteTsconfigPath),
|
|
1043
1097
|
"--threshold",
|
|
1044
1098
|
"error",
|
|
1045
1099
|
"--compiler-warnings",
|
|
1046
|
-
"css-unused-selector:ignore"
|
|
1047
|
-
|
|
1100
|
+
"css-unused-selector:ignore",
|
|
1101
|
+
"--output",
|
|
1102
|
+
"human-verbose",
|
|
1103
|
+
"--color"
|
|
1104
|
+
]));
|
|
1048
1105
|
}
|
|
1049
1106
|
const results = await Promise.all(checks);
|
|
1050
1107
|
const failed = results.filter((r) => r.exitCode !== 0);
|
|
1051
1108
|
if (failed.length > 0) {
|
|
1109
|
+
for (const result of failed) {
|
|
1110
|
+
console.error(`
|
|
1111
|
+
\x1B[31m[${result.name}]\x1B[0m`);
|
|
1112
|
+
if (result.name === "svelte-check") {
|
|
1113
|
+
console.error(formatSvelteOutput(result.output));
|
|
1114
|
+
} else {
|
|
1115
|
+
console.error(result.output);
|
|
1116
|
+
}
|
|
1117
|
+
}
|
|
1052
1118
|
console.error(`
|
|
1053
1119
|
\x1B[31m\u2717\x1B[0m Typecheck failed: ${failed.map((r) => r.name).join(", ")}`);
|
|
1054
1120
|
process.exit(1);
|
|
@@ -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({
|
|
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=
|
|
177983
|
+
//# debugId=99FAC29D4EBC3F9564756E2164756E21
|
|
177990
177984
|
//# sourceMappingURL=index.js.map
|