mirror of
https://github.com/getpaseo/paseo.git
synced 2026-07-29 12:01:31 +00:00
refactor(desktop): sync package metadata from root
This commit is contained in:
@@ -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") {
|
||||
|
||||
Reference in New Issue
Block a user