@cabloy/cli 3.0.99 → 3.0.101
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 +6 -3
- package/dist/lib/local.helper.d.ts +4 -1
- package/dist/types/template.d.ts +1 -1
- package/package.json +2 -1
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
|
-
|
|
251
|
-
|
|
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 }:
|
|
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/dist/types/template.d.ts
CHANGED
|
@@ -35,7 +35,7 @@ export type TypeParseLanguage = 'plain' | 'json' | 'gogo' | '';
|
|
|
35
35
|
export type TypeParseResult<LANGUAGE extends TypeParseLanguage> = LANGUAGE extends 'plain' ? string : LANGUAGE extends 'json' ? any : GoGoAST;
|
|
36
36
|
export type TypeParseOptions<LANGUAGE extends TypeParseLanguage> = LANGUAGE extends 'plain' ? never : LANGUAGE extends 'json' ? never : ParserOptions;
|
|
37
37
|
export interface ISnippet<LANGUAGE extends TypeParseLanguage = ''> {
|
|
38
|
-
language
|
|
38
|
+
language?: LANGUAGE;
|
|
39
39
|
format?: boolean;
|
|
40
40
|
file: string | ((ejsData: IEjsData) => string);
|
|
41
41
|
init?: string | ((initData: IInitData) => Promise<string>);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@cabloy/cli",
|
|
3
|
-
"version": "3.0.
|
|
3
|
+
"version": "3.0.101",
|
|
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",
|