refactor(desktop): sync package metadata from root

This commit is contained in:
Mohamed Boudra
2026-03-25 23:34:02 +07:00
parent 1768e2787f
commit 08e37540eb
3 changed files with 37 additions and 12 deletions

View File

@@ -9,6 +9,12 @@ const rootPackagePath = path.join(rootDir, "package.json");
const rootPackage = JSON.parse(readFileSync(rootPackagePath, "utf8"));
const rootVersion = rootPackage.version;
const workspacePaths = Array.isArray(rootPackage.workspaces) ? rootPackage.workspaces : [];
const sharedMetadata = {
homepage: rootPackage.homepage,
repository: rootPackage.repository,
author: rootPackage.author,
license: rootPackage.license,
};
if (typeof rootVersion !== "string" || rootVersion.length === 0) {
throw new Error('Root package.json must contain a valid "version"');
@@ -37,6 +43,17 @@ for (const workspacePath of workspacePaths) {
changed = true;
}
if (pkg.name === "@getpaseo/desktop") {
for (const [field, value] of Object.entries(sharedMetadata)) {
const currentValue = JSON.stringify(pkg[field]);
const nextValue = JSON.stringify(value);
if (currentValue !== nextValue) {
pkg[field] = value;
changed = true;
}
}
}
for (const section of dependencySections) {
const deps = pkg[section];
if (!deps || typeof deps !== "object") {