@varlet/cli 2.0.2 → 2.0.3

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.
@@ -38,6 +38,7 @@ interface VarletConfig {
38
38
  mobile?: Record<string, any>;
39
39
  moduleCompatible?: Record<string, string>;
40
40
  }
41
- export declare const defineConfig: (conf: VarletConfig) => VarletConfig;
41
+ export declare function defineConfig(conf: VarletConfig): VarletConfig;
42
+ export declare function mergeStrategy(value: any, srcValue: any, key: string): any[] | undefined;
42
43
  export declare function getVarletConfig(emit?: boolean): any;
43
44
  export {};
@@ -1,12 +1,21 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.getVarletConfig = exports.defineConfig = void 0;
3
+ exports.getVarletConfig = exports.mergeStrategy = exports.defineConfig = void 0;
4
4
  var fs_extra_1 = require("fs-extra");
5
5
  var lodash_1 = require("lodash");
6
6
  var constant_1 = require("../shared/constant");
7
7
  var fsUtils_1 = require("../shared/fsUtils");
8
- var defineConfig = function (conf) { return conf; };
8
+ var shared_1 = require("@varlet/shared");
9
+ function defineConfig(conf) {
10
+ return conf;
11
+ }
9
12
  exports.defineConfig = defineConfig;
13
+ function mergeStrategy(value, srcValue, key) {
14
+ if (key === 'features' && (0, shared_1.isArray)(srcValue)) {
15
+ return srcValue;
16
+ }
17
+ }
18
+ exports.mergeStrategy = mergeStrategy;
10
19
  function getVarletConfig(emit) {
11
20
  if (emit === void 0) { emit = false; }
12
21
  var config = {};
@@ -16,7 +25,7 @@ function getVarletConfig(emit) {
16
25
  }
17
26
  delete require.cache[require.resolve('../../varlet.default.config.js')];
18
27
  var defaultConfig = require('../../varlet.default.config.js');
19
- var mergedConfig = (0, lodash_1.merge)(defaultConfig, config);
28
+ var mergedConfig = (0, lodash_1.mergeWith)(defaultConfig, config, mergeStrategy);
20
29
  if (emit) {
21
30
  var source = JSON.stringify(mergedConfig, null, 2);
22
31
  (0, fsUtils_1.outputFileSyncOnChange)(constant_1.SITE_CONFIG, source);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@varlet/cli",
3
- "version": "2.0.2",
3
+ "version": "2.0.3",
4
4
  "description": "cli of varlet",
5
5
  "bin": {
6
6
  "varlet-cli": "./lib/bin.js"
@@ -34,10 +34,10 @@
34
34
  "@babel/helper-plugin-utils": "^7.14.5",
35
35
  "@babel/preset-env": "^7.14.8",
36
36
  "@babel/preset-typescript": "^7.14.5",
37
- "@varlet/icons": "2.0.2",
38
- "@varlet/markdown-vite-plugin": "2.0.2",
39
- "@varlet/shared": "2.0.2",
40
- "@varlet/touch-emulator": "2.0.2",
37
+ "@varlet/icons": "2.0.3",
38
+ "@varlet/markdown-vite-plugin": "2.0.3",
39
+ "@varlet/shared": "2.0.3",
40
+ "@varlet/touch-emulator": "2.0.3",
41
41
  "@vitejs/plugin-vue": "3.0.1",
42
42
  "@vitejs/plugin-vue-jsx": "2.0.0",
43
43
  "@vue/babel-plugin-jsx": "1.1.1",
@@ -82,7 +82,7 @@
82
82
  "@types/semver": "^7.3.9"
83
83
  },
84
84
  "peerDependencies": {
85
- "@varlet/touch-emulator": "2.0.2",
85
+ "@varlet/touch-emulator": "2.0.3",
86
86
  "@vue/runtime-core": "3.2.16",
87
87
  "@vue/test-utils": "^2.0.2",
88
88
  "clipboard": "^2.0.6",