feat: migrate cloud web to vue platform shell
This commit is contained in:
@@ -21,21 +21,20 @@ for (const file of sourceFiles) {
|
||||
}
|
||||
}
|
||||
if (explicitAnyCount > 0) {
|
||||
console.error(`hwlab-cloud-web tsc-check: ${explicitAnyCount} explicit any usage(s) in React source`);
|
||||
console.error(`hwlab-cloud-web tsc-check: ${explicitAnyCount} explicit any usage(s) in Vue source`);
|
||||
process.exit(2);
|
||||
}
|
||||
|
||||
const tscBin = path.join(rootDir, "node_modules/.bin/tsc");
|
||||
const tscArgs = ["--noEmit", "--project", path.join(rootDir, "tsconfig.json"), "--strict"];
|
||||
const tscResult = spawnSync(tscBin, tscArgs, { cwd: rootDir, encoding: "utf8" });
|
||||
if (tscResult.stdout) process.stdout.write(tscResult.stdout);
|
||||
if (tscResult.stderr) process.stderr.write(tscResult.stderr);
|
||||
if (tscResult.error) console.error(`hwlab-cloud-web tsc-check: failed to start ${tscBin}: ${tscResult.error.message}`);
|
||||
if (tscResult.status !== 0) {
|
||||
console.error(`hwlab-cloud-web tsc-check: strict TypeScript failed with exit ${tscResult.status ?? "unknown"}`);
|
||||
process.exit(tscResult.status ?? 2);
|
||||
const vueTscBin = path.join(rootDir, "node_modules/.bin/vue-tsc");
|
||||
const result = spawnSync(vueTscBin, ["--noEmit", "--project", path.join(rootDir, "tsconfig.json")], { cwd: rootDir, encoding: "utf8" });
|
||||
if (result.stdout) process.stdout.write(result.stdout);
|
||||
if (result.stderr) process.stderr.write(result.stderr);
|
||||
if (result.error) console.error(`hwlab-cloud-web tsc-check: failed to start ${vueTscBin}: ${result.error.message}`);
|
||||
if (result.status !== 0) {
|
||||
console.error(`hwlab-cloud-web tsc-check: vue-tsc failed with exit ${result.status ?? "unknown"}`);
|
||||
process.exit(result.status ?? 2);
|
||||
}
|
||||
console.log("hwlab-cloud-web tsc-check: passed (strict React TSX, 0 explicit any)");
|
||||
console.log("hwlab-cloud-web tsc-check: passed (strict Vue TS, 0 explicit any)");
|
||||
|
||||
function collectSourceFiles(dir: string): string[] {
|
||||
const out: string[] = [];
|
||||
@@ -44,7 +43,7 @@ function collectSourceFiles(dir: string): string[] {
|
||||
const full = path.join(dir, entry);
|
||||
const stat = statSync(full);
|
||||
if (stat.isDirectory()) out.push(...collectSourceFiles(full));
|
||||
else if (/\.(ts|tsx)$/u.test(full)) out.push(full);
|
||||
else if (/\.(ts|vue)$/u.test(full)) out.push(full);
|
||||
}
|
||||
return out;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user