release: WRNexusJS 0.8.3
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
import { existsSync, readdirSync, readFileSync, writeFileSync } from "node:fs";
|
||||
import { join } from "node:path";
|
||||
|
||||
const version = "0.8.2";
|
||||
const version = "0.8.3";
|
||||
|
||||
const dependencyGroups = [
|
||||
"dependencies",
|
||||
@@ -61,3 +61,35 @@ for (const entry of readdirSync("packages", {
|
||||
|
||||
writeFileSync(packageFile, `${JSON.stringify(packageJson, null, 2)}\n`);
|
||||
}
|
||||
|
||||
const editorPackageFile = join("editors", "vscode", "package.json");
|
||||
if (existsSync(editorPackageFile)) {
|
||||
const editorPackage = JSON.parse(readFileSync(editorPackageFile, "utf8"));
|
||||
editorPackage.version = version;
|
||||
writeFileSync(editorPackageFile, `${JSON.stringify(editorPackage, null, 2)}\n`);
|
||||
}
|
||||
|
||||
const editorLockFile = join("editors", "vscode", "package-lock.json");
|
||||
if (existsSync(editorLockFile)) {
|
||||
const editorLock = JSON.parse(readFileSync(editorLockFile, "utf8"));
|
||||
editorLock.version = version;
|
||||
if (editorLock.packages?.[""]) editorLock.packages[""].version = version;
|
||||
writeFileSync(editorLockFile, `${JSON.stringify(editorLock, null, 2)}\n`);
|
||||
}
|
||||
|
||||
const bunLockFile = "bun.lock";
|
||||
if (existsSync(bunLockFile)) {
|
||||
let currentWorkspace = "";
|
||||
const lines = readFileSync(bunLockFile, "utf8").split(/(?<=\n)/);
|
||||
const updated = lines.map((line) => {
|
||||
const workspace = /^ {4}"([^"]+)": \{\r?\n?$/.exec(line)?.[1];
|
||||
if (workspace) currentWorkspace = workspace;
|
||||
if (currentWorkspace.startsWith("packages/") && /^ {6}"version": "[^"]+",\r?\n?$/.test(line)) {
|
||||
const newline = line.endsWith("\r\n") ? "\r\n" : line.endsWith("\n") ? "\n" : "";
|
||||
return ` "version": "${version}",${newline}`;
|
||||
}
|
||||
if (/^ {4}\},?\r?\n?$/.test(line)) currentWorkspace = "";
|
||||
return line;
|
||||
});
|
||||
writeFileSync(bunLockFile, updated.join(""));
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user