@absolutejs/absolute 0.19.0-beta.201 → 0.19.0-beta.203
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
|
@@ -978,6 +978,75 @@ var init_compile = __esm(() => {
|
|
|
978
978
|
];
|
|
979
979
|
});
|
|
980
980
|
|
|
981
|
+
// src/cli/scripts/typecheck.ts
|
|
982
|
+
var exports_typecheck = {};
|
|
983
|
+
__export(exports_typecheck, {
|
|
984
|
+
typecheck: () => typecheck
|
|
985
|
+
});
|
|
986
|
+
import { resolve as resolve7, join as join7 } from "path";
|
|
987
|
+
import { existsSync as existsSync9 } from "fs";
|
|
988
|
+
var run = async (name, command) => {
|
|
989
|
+
const proc = Bun.spawn(command, {
|
|
990
|
+
stderr: "inherit",
|
|
991
|
+
stdout: "inherit"
|
|
992
|
+
});
|
|
993
|
+
const exitCode = await proc.exited;
|
|
994
|
+
return { exitCode, name };
|
|
995
|
+
}, findBin = (name) => {
|
|
996
|
+
const local = resolve7("node_modules", ".bin", name);
|
|
997
|
+
return existsSync9(local) ? local : name;
|
|
998
|
+
}, typecheck = async (configPath2) => {
|
|
999
|
+
const config = await loadConfig(configPath2);
|
|
1000
|
+
const hasSvelte = Boolean(config.svelteDirectory);
|
|
1001
|
+
const hasVue = Boolean(config.vueDirectory);
|
|
1002
|
+
const cacheDir = ".absolutejs";
|
|
1003
|
+
const checks = [];
|
|
1004
|
+
if (hasVue) {
|
|
1005
|
+
checks.push(run("vue-tsc", [
|
|
1006
|
+
findBin("vue-tsc"),
|
|
1007
|
+
"--noEmit",
|
|
1008
|
+
"--incremental",
|
|
1009
|
+
"--tsBuildInfoFile",
|
|
1010
|
+
join7(cacheDir, "vue-tsc.tsbuildinfo"),
|
|
1011
|
+
"--pretty"
|
|
1012
|
+
]));
|
|
1013
|
+
} else {
|
|
1014
|
+
checks.push(run("tsc", [
|
|
1015
|
+
findBin("tsc"),
|
|
1016
|
+
"--noEmit",
|
|
1017
|
+
"--incremental",
|
|
1018
|
+
"--tsBuildInfoFile",
|
|
1019
|
+
join7(cacheDir, "tsc.tsbuildinfo"),
|
|
1020
|
+
"--pretty"
|
|
1021
|
+
]));
|
|
1022
|
+
}
|
|
1023
|
+
if (hasSvelte) {
|
|
1024
|
+
const svelteDir = resolve7(config.svelteDirectory);
|
|
1025
|
+
checks.push(run("svelte-check", [
|
|
1026
|
+
findBin("svelte-check"),
|
|
1027
|
+
"--tsconfig",
|
|
1028
|
+
"./tsconfig.json",
|
|
1029
|
+
"--threshold",
|
|
1030
|
+
"error",
|
|
1031
|
+
"--compiler-warnings",
|
|
1032
|
+
"css-unused-selector:ignore",
|
|
1033
|
+
"--workspace",
|
|
1034
|
+
svelteDir
|
|
1035
|
+
]));
|
|
1036
|
+
}
|
|
1037
|
+
const results = await Promise.all(checks);
|
|
1038
|
+
const failed = results.filter((r) => r.exitCode !== 0);
|
|
1039
|
+
if (failed.length > 0) {
|
|
1040
|
+
console.error(`
|
|
1041
|
+
\x1B[31m\u2717\x1B[0m Typecheck failed: ${failed.map((r) => r.name).join(", ")}`);
|
|
1042
|
+
process.exit(1);
|
|
1043
|
+
}
|
|
1044
|
+
console.log("\x1B[32m\u2713\x1B[0m Typecheck passed");
|
|
1045
|
+
};
|
|
1046
|
+
var init_typecheck = __esm(() => {
|
|
1047
|
+
init_loadConfig();
|
|
1048
|
+
});
|
|
1049
|
+
|
|
981
1050
|
// src/cli/scripts/dev.ts
|
|
982
1051
|
init_constants();
|
|
983
1052
|
init_startupBanner();
|
|
@@ -2149,6 +2218,11 @@ if (command === "dev") {
|
|
|
2149
2218
|
const serverEntry = positionalArgs[0] ?? DEFAULT_SERVER_ENTRY;
|
|
2150
2219
|
const { compile: compile2 } = await Promise.resolve().then(() => (init_compile(), exports_compile));
|
|
2151
2220
|
await compile2(serverEntry, outdir, outfile, configPath2);
|
|
2221
|
+
} else if (command === "typecheck") {
|
|
2222
|
+
sendTelemetryEvent("cli:command", { command });
|
|
2223
|
+
const configPath2 = parseNamedArg("--config");
|
|
2224
|
+
const { typecheck: typecheck2 } = await Promise.resolve().then(() => (init_typecheck(), exports_typecheck));
|
|
2225
|
+
await typecheck2(configPath2);
|
|
2152
2226
|
} else if (command === "mkcert") {
|
|
2153
2227
|
sendTelemetryEvent("cli:command", { command });
|
|
2154
2228
|
const { setupMkcert: setupMkcert2 } = await Promise.resolve().then(() => (init_devCert(), exports_devCert));
|
|
@@ -2164,6 +2238,7 @@ if (command === "dev") {
|
|
|
2164
2238
|
console.error(" eslint Run ESLint (cached)");
|
|
2165
2239
|
console.error(" info Print system info for bug reports");
|
|
2166
2240
|
console.error(" prettier Run Prettier check (cached)");
|
|
2241
|
+
console.error(" typecheck Run type checkers for all frameworks");
|
|
2167
2242
|
console.error(" telemetry Manage anonymous telemetry");
|
|
2168
2243
|
process.exit(1);
|
|
2169
2244
|
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const typecheck: (configPath?: string) => Promise<void>;
|
package/package.json
CHANGED