release: WRNexusJS 0.8.0
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
import { readFileSync, readdirSync, statSync, writeFileSync } from "node:fs";
|
||||
import { existsSync, readFileSync, readdirSync, statSync, writeFileSync } from "node:fs";
|
||||
import { createRequire } from "node:module";
|
||||
import { dirname, join, relative, resolve, sep } from "node:path";
|
||||
import process from "node:process";
|
||||
@@ -128,7 +128,18 @@ module.exports = __load("packages/compiler/src/index.ts");
|
||||
`;
|
||||
|
||||
const destination = join(root, "editors", "vscode", "src", "compiler.cjs");
|
||||
writeFileSync(destination, output, "utf8");
|
||||
process.stdout.write(
|
||||
`Built ${relative(root, destination)} from ${sourceFiles.length} TypeScript modules.\n`,
|
||||
);
|
||||
if (process.argv.includes("--check")) {
|
||||
if (!existsSync(destination) || readFileSync(destination, "utf8") !== output) {
|
||||
throw new Error(
|
||||
`${relative(root, destination)} is stale. Run bun run --cwd editors/vscode build and commit the result.`,
|
||||
);
|
||||
}
|
||||
process.stdout.write(
|
||||
`Verified ${relative(root, destination)} matches ${sourceFiles.length} TypeScript modules.\n`,
|
||||
);
|
||||
} else {
|
||||
writeFileSync(destination, output, "utf8");
|
||||
process.stdout.write(
|
||||
`Built ${relative(root, destination)} from ${sourceFiles.length} TypeScript modules.\n`,
|
||||
);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user