@absolutejs/absolute 0.19.0-beta.211 → 0.19.0-beta.212
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
|
@@ -986,34 +986,39 @@ __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
994
|
const exitCode = await proc.exited;
|
|
995
|
-
|
|
996
|
-
|
|
997
|
-
|
|
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 };
|
|
995
|
+
const stdout = proc.stdout ? await new Response(proc.stdout).text() : "";
|
|
996
|
+
const stderr = proc.stderr ? await new Response(proc.stderr).text() : "";
|
|
997
|
+
return { exitCode, name, output: (stdout + stderr).trim() };
|
|
1005
998
|
}, findBin = (name) => {
|
|
1006
999
|
const local = resolve7("node_modules", ".bin", name);
|
|
1007
|
-
return existsSync9(local) ? local :
|
|
1008
|
-
},
|
|
1000
|
+
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) => {
|
|
1009
1009
|
const config = await loadConfig(configPath2);
|
|
1010
1010
|
const hasSvelte = Boolean(config.svelteDirectory);
|
|
1011
1011
|
const hasVue = Boolean(config.vueDirectory);
|
|
1012
1012
|
const cacheDir = ".absolutejs";
|
|
1013
1013
|
const checks = [];
|
|
1014
1014
|
if (hasVue) {
|
|
1015
|
+
const vueTscBin = findBin("vue-tsc");
|
|
1016
|
+
if (!vueTscBin) {
|
|
1017
|
+
console.error("\x1B[31m\u2717\x1B[0m vue-tsc is required for Vue type checking. Install it: bun add -d vue-tsc");
|
|
1018
|
+
process.exit(1);
|
|
1019
|
+
}
|
|
1015
1020
|
checks.push(run("vue-tsc", [
|
|
1016
|
-
|
|
1021
|
+
vueTscBin,
|
|
1017
1022
|
"--noEmit",
|
|
1018
1023
|
"--incremental",
|
|
1019
1024
|
"--tsBuildInfoFile",
|
|
@@ -1021,8 +1026,13 @@ var run = async (name, command, quiet = false) => {
|
|
|
1021
1026
|
"--pretty"
|
|
1022
1027
|
]));
|
|
1023
1028
|
} else {
|
|
1029
|
+
const tscBin = findBin("tsc");
|
|
1030
|
+
if (!tscBin) {
|
|
1031
|
+
console.error("\x1B[31m\u2717\x1B[0m typescript is required for type checking. Install it: bun add -d typescript");
|
|
1032
|
+
process.exit(1);
|
|
1033
|
+
}
|
|
1024
1034
|
checks.push(run("tsc", [
|
|
1025
|
-
|
|
1035
|
+
tscBin,
|
|
1026
1036
|
"--noEmit",
|
|
1027
1037
|
"--incremental",
|
|
1028
1038
|
"--tsBuildInfoFile",
|
|
@@ -1031,24 +1041,38 @@ var run = async (name, command, quiet = false) => {
|
|
|
1031
1041
|
]));
|
|
1032
1042
|
}
|
|
1033
1043
|
if (hasSvelte) {
|
|
1044
|
+
const svelteBin = findBin("svelte-check");
|
|
1045
|
+
if (!svelteBin) {
|
|
1046
|
+
console.error("\x1B[31m\u2717\x1B[0m svelte-check is required for Svelte type checking. Install it: bun add -d svelte-check");
|
|
1047
|
+
process.exit(1);
|
|
1048
|
+
}
|
|
1034
1049
|
const svelteTsconfigPath = join7(cacheDir, "tsconfig.svelte-check.json");
|
|
1035
1050
|
await writeFile(svelteTsconfigPath, JSON.stringify({
|
|
1036
1051
|
extends: resolve7("tsconfig.json"),
|
|
1037
1052
|
include: [`../${config.svelteDirectory}/**/*`]
|
|
1038
1053
|
}, null, "\t"));
|
|
1039
1054
|
checks.push(run("svelte-check", [
|
|
1040
|
-
|
|
1055
|
+
svelteBin,
|
|
1041
1056
|
"--tsconfig",
|
|
1042
1057
|
resolve7(svelteTsconfigPath),
|
|
1043
1058
|
"--threshold",
|
|
1044
1059
|
"error",
|
|
1045
1060
|
"--compiler-warnings",
|
|
1046
1061
|
"css-unused-selector:ignore"
|
|
1047
|
-
]
|
|
1062
|
+
]));
|
|
1048
1063
|
}
|
|
1049
1064
|
const results = await Promise.all(checks);
|
|
1050
1065
|
const failed = results.filter((r) => r.exitCode !== 0);
|
|
1051
1066
|
if (failed.length > 0) {
|
|
1067
|
+
for (const result of failed) {
|
|
1068
|
+
console.error(`
|
|
1069
|
+
\x1B[31m[${result.name}]\x1B[0m`);
|
|
1070
|
+
if (result.name === "svelte-check") {
|
|
1071
|
+
console.error(formatSvelteOutput(result.output));
|
|
1072
|
+
} else {
|
|
1073
|
+
console.error(result.output);
|
|
1074
|
+
}
|
|
1075
|
+
}
|
|
1052
1076
|
console.error(`
|
|
1053
1077
|
\x1B[31m\u2717\x1B[0m Typecheck failed: ${failed.map((r) => r.name).join(", ")}`);
|
|
1054
1078
|
process.exit(1);
|
package/dist/types/metadata.d.ts
CHANGED
|
@@ -32,7 +32,7 @@ export type RobotsDirective = {
|
|
|
32
32
|
export type MetaTag = {
|
|
33
33
|
name?: string;
|
|
34
34
|
property?: string;
|
|
35
|
-
httpEquiv?:
|
|
35
|
+
httpEquiv?: 'accept-ch' | 'content-security-policy' | 'content-type' | 'default-style' | 'refresh' | 'x-ua-compatible';
|
|
36
36
|
content: string;
|
|
37
37
|
};
|
|
38
38
|
export type Metadata = {
|
package/package.json
CHANGED
|
@@ -39,6 +39,7 @@
|
|
|
39
39
|
"react-dom": "19.2.1",
|
|
40
40
|
"react-refresh": "0.18.0",
|
|
41
41
|
"svelte": "5.55.0",
|
|
42
|
+
"svelte-check": "^4.4.5",
|
|
42
43
|
"tailwindcss": "4.1.7",
|
|
43
44
|
"typescript": "^5.9.3",
|
|
44
45
|
"typescript-eslint": "8.56.1",
|
|
@@ -214,8 +215,8 @@
|
|
|
214
215
|
"release:beta": "bun run test && bun run format && bun run build:native && bun run build && ./native/publish.sh --tag beta && bun publish --tag beta",
|
|
215
216
|
"start": "TELEMETRY_OFF=1 bun run src/cli/index.ts start example/server.ts --outdir example/dist --config example/absolute.config.ts",
|
|
216
217
|
"test": "bun test tests/unit && bun test --concurrency 1 tests/integration",
|
|
217
|
-
"typecheck": "bun run
|
|
218
|
+
"typecheck": "bun run src/cli/index.ts typecheck --config example/absolute.config.ts"
|
|
218
219
|
},
|
|
219
220
|
"types": "./dist/src/index.d.ts",
|
|
220
|
-
"version": "0.19.0-beta.
|
|
221
|
+
"version": "0.19.0-beta.212"
|
|
221
222
|
}
|
package/types/metadata.ts
CHANGED
|
@@ -35,7 +35,7 @@ export type RobotsDirective = {
|
|
|
35
35
|
export type MetaTag = {
|
|
36
36
|
name?: string;
|
|
37
37
|
property?: string;
|
|
38
|
-
httpEquiv?:
|
|
38
|
+
httpEquiv?: 'accept-ch' | 'content-security-policy' | 'content-type' | 'default-style' | 'refresh' | 'x-ua-compatible';
|
|
39
39
|
content: string;
|
|
40
40
|
};
|
|
41
41
|
|