@modern-js/core 1.13.1 → 1.13.2

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/CHANGELOG.md CHANGED
@@ -1,5 +1,17 @@
1
1
  # @modern-js/core
2
2
 
3
+ ## 1.13.2
4
+
5
+ ### Patch Changes
6
+
7
+ - bfc1264: fix(core): should keep single function value after merge config
8
+
9
+ fix(core): 修复合并配置后,函数类型的配置项变成数组类型的问题
10
+
11
+ - 44e3bb1: feat: support response headers
12
+ feat: 支持设置响应头
13
+ - @modern-js/utils@1.8.0
14
+
3
15
  ## 1.13.1
4
16
 
5
17
  ### Patch Changes
@@ -22,11 +22,17 @@ const mergeConfig = (configs) => (0, lodash_1.mergeWith)({}, ...configs, (target
22
22
  return [...target, ...source];
23
23
  }
24
24
  else {
25
- return typeof source !== 'undefined' ? [...target, source] : target;
25
+ return source !== undefined ? [...target, source] : target;
26
26
  }
27
27
  }
28
- else if ((0, utils_1.isFunction)(source)) {
29
- return typeof target !== 'undefined' ? [target, source] : [source];
28
+ else if ((0, utils_1.isFunction)(target) || (0, utils_1.isFunction)(source)) {
29
+ if (source === undefined) {
30
+ return target;
31
+ }
32
+ if (target === undefined) {
33
+ return source;
34
+ }
35
+ return [target, source];
30
36
  }
31
37
  return undefined;
32
38
  });
@@ -340,6 +340,9 @@ export declare const patchSchema: (pluginSchemas: Array<PluginValidateSchema | P
340
340
  disableSpa: {
341
341
  type: string;
342
342
  };
343
+ resHeaders: {
344
+ type: string;
345
+ };
343
346
  };
344
347
  additionalProperties: boolean;
345
348
  };
@@ -124,6 +124,9 @@ export declare const server: {
124
124
  disableSpa: {
125
125
  type: string;
126
126
  };
127
+ resHeaders: {
128
+ type: string;
129
+ };
127
130
  };
128
131
  additionalProperties: boolean;
129
132
  };
@@ -69,6 +69,7 @@ exports.server = {
69
69
  ],
70
70
  },
71
71
  disableSpa: { type: 'boolean' },
72
+ resHeaders: { type: 'object' },
72
73
  },
73
74
  additionalProperties: false,
74
75
  },
@@ -103,8 +103,9 @@ export interface OutputConfig {
103
103
  }
104
104
  export interface ServerConfig {
105
105
  routes?: Record<string, string | string[] | {
106
- route: string | string[];
106
+ route?: string | string[];
107
107
  disableSpa?: boolean;
108
+ resHeaders?: Record<string, unknown>;
108
109
  }>;
109
110
  publicRoutes?: {
110
111
  [filepath: string]: string;
package/package.json CHANGED
@@ -6,12 +6,11 @@
6
6
  "repository": "modern-js-dev/modern.js",
7
7
  "license": "MIT",
8
8
  "keywords": [
9
- "react",
10
9
  "framework",
11
10
  "modern",
12
11
  "modern.js"
13
12
  ],
14
- "version": "1.13.1",
13
+ "version": "1.13.2",
15
14
  "jsnext:source": "./src/index.ts",
16
15
  "types": "./dist/index.d.ts",
17
16
  "main": "./dist/index.js",
@@ -45,7 +44,7 @@
45
44
  },
46
45
  "devDependencies": {
47
46
  "@jest/types": "^27.0.6",
48
- "@modern-js/types": "1.6.0",
47
+ "@modern-js/types": "1.6.1",
49
48
  "@scripts/build": "0.0.0",
50
49
  "@scripts/jest-config": "0.0.0",
51
50
  "@types/babel__code-frame": "^7.0.3",
@@ -53,8 +52,6 @@
53
52
  "@types/jest": "^27",
54
53
  "@types/less": "^3.0.3",
55
54
  "@types/node": "^14",
56
- "@types/react": "^17",
57
- "@types/react-dom": "^17",
58
55
  "autoprefixer": "^10.3.1",
59
56
  "btsm": "2.2.2",
60
57
  "jest": "^27",