cli: update diff to handle package with configSchema files

This commit is contained in:
Patrik Oldsberg
2020-11-16 01:05:54 +01:00
parent e2fc08cb15
commit 90fb5c81d0
+10 -1
View File
@@ -61,7 +61,7 @@ class PackageJsonHandler {
await this.syncField('main:src');
}
await this.syncField('types');
await this.syncField('files');
await this.syncFiles();
await this.syncScripts();
await this.syncPublishConfig();
await this.syncDependencies('dependencies');
@@ -105,6 +105,15 @@ class PackageJsonHandler {
}
}
private async syncFiles() {
if (typeof this.targetPkg.configSchema === 'string') {
const files = [...this.pkg.files, this.targetPkg.configSchema];
await this.syncField('files', { files });
} else {
await this.syncField('files');
}
}
private async syncScripts() {
const pkgScripts = this.pkg.scripts;
const targetScripts = (this.targetPkg.scripts =