@cabloy/cli 3.0.99 → 3.0.100

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js CHANGED
@@ -6,6 +6,7 @@ import semver from 'semver';
6
6
  import urllib from 'urllib';
7
7
  import NPMConfig from '@npmcli/config';
8
8
  import npmDefinitions from '@npmcli/config/lib/definitions/index.js';
9
+ import DeepEqual from 'deep-equal';
9
10
  import fse from 'fs-extra';
10
11
  import { globby } from 'globby';
11
12
  import path from 'node:path';
@@ -247,10 +248,12 @@ class LocalCommon {
247
248
  // zovaRest
248
249
  await this._generatePackageJson_pkgFromZovaRest(projectPath, pkgOriginal.dependencies);
249
250
  // save
250
- const strPkgOriginal = `${JSON.stringify(pkgOriginal, null, 2)}\n`;
251
- const strPkg = pkg ? `${JSON.stringify(pkg, null, 2)}\n` : '';
252
- if (strPkgOriginal !== strPkg) {
251
+ if (!DeepEqual(pkg?.scripts, pkgOriginal.scripts) || !DeepEqual(pkg?.dependencies, pkgOriginal.dependencies) || !DeepEqual(pkg?.devDependencies, pkgOriginal.devDependencies)) {
252
+ const strPkgOriginal = `${JSON.stringify(pkgOriginal, null, 2)}\n`;
253
253
  await fse.writeFile(pkgFile, strPkgOriginal);
254
+ await this.cli.helper.formatFile({
255
+ fileName: pkgFile
256
+ });
254
257
  await this.cli.helper.pnpmInstall();
255
258
  return true;
256
259
  }
@@ -84,7 +84,10 @@ export declare class LocalHelper {
84
84
  findSuite(suiteName: any): ModuleInfo.ISuite;
85
85
  ensureDir(dir: any): Promise<any>;
86
86
  pnpmInstall(): Promise<void>;
87
- formatFile({ fileName, logPrefix }: any): Promise<void>;
87
+ formatFile({ fileName, logPrefix }: {
88
+ fileName: string;
89
+ logPrefix?: string;
90
+ }): Promise<void>;
88
91
  spawnBin({ cmd, args, options }: {
89
92
  cmd: string;
90
93
  args?: string[];
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cabloy/cli",
3
- "version": "3.0.99",
3
+ "version": "3.0.100",
4
4
  "gitHead": "0eab9dc4a5622caffe89e7b1b3f02c08ccbc4c4b",
5
5
  "description": "@cabloy/cli",
6
6
  "keywords": [
@@ -39,6 +39,7 @@
39
39
  "boxen": "^4.2.0",
40
40
  "chalk": "^3.0.0",
41
41
  "cli-table3": "^0.6.5",
42
+ "deep-equal": "^2.2.3",
42
43
  "enquirer": "^2.3.6",
43
44
  "fs-extra": "^11.2.0",
44
45
  "globby": "^16.0.0",