@modern-js/server-utils 1.2.8 → 1.2.11

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,38 @@
1
1
  # @modern-js/server-utils
2
2
 
3
+ ## 1.2.11
4
+
5
+ ### Patch Changes
6
+
7
+ - b7a1cea52: feat: support utils in tools.babel
8
+ - Updated dependencies [9377d2d9d]
9
+ - Updated dependencies [8c9ad1749]
10
+ - Updated dependencies [b7a1cea52]
11
+ - Updated dependencies [1ac68424f]
12
+ - @modern-js/utils@1.7.7
13
+ - @modern-js/babel-preset-lib@1.3.1
14
+ - @modern-js/plugin@1.3.7
15
+
16
+ ## 1.2.10
17
+
18
+ ### Patch Changes
19
+
20
+ - a1198d509: feat: bump babel 7.18.0
21
+ - Updated dependencies [a1198d509]
22
+ - Updated dependencies [a1198d509]
23
+ - @modern-js/babel-preset-lib@1.3.0
24
+ - @modern-js/plugin@1.3.6
25
+
26
+ ## 1.2.9
27
+
28
+ ### Patch Changes
29
+
30
+ - 77917e355: feat: support assign field in decorator
31
+ - Updated dependencies [54fa1dbd6]
32
+ - Updated dependencies [33de0f7ec]
33
+ - @modern-js/plugin@1.3.5
34
+ - @modern-js/utils@1.7.5
35
+
3
36
  ## 1.2.6
4
37
 
5
38
  ### Patch Changes
@@ -4,7 +4,7 @@ function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { va
4
4
 
5
5
  function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
6
6
 
7
- import { getBabelChain } from '@modern-js/babel-preset-lib';
7
+ import { getBabelChain, applyUserBabelConfig } from '@modern-js/babel-preset-lib';
8
8
  import { fs, json5, getAlias, applyOptionsChain } from '@modern-js/utils';
9
9
  export * from '@babel/core';
10
10
  export const readTsConfig = (tsconfigPath, noExistReturn = null) => {
@@ -70,7 +70,8 @@ export const resolveBabelConfig = (appDirectory, modernConfig, option // FIXME:
70
70
  babelChain.plugin('babel-plugin-transform-typescript-metadata').use(require.resolve('babel-plugin-transform-typescript-metadata'), []);
71
71
  babelChain.plugin('@babel/plugin-proposal-decorators').use(require.resolve('@babel/plugin-proposal-decorators'), [{
72
72
  legacy: true
73
- }]);
73
+ }]); // resolve "Definitely assigned fields cannot be initialized here, but only in the constructor."
74
+
74
75
  babelChain.plugin('@babel/plugin-proposal-class-properties').use(require.resolve('@babel/plugin-proposal-class-properties'), [{
75
76
  loose: true
76
77
  }]);
@@ -78,9 +79,5 @@ export const resolveBabelConfig = (appDirectory, modernConfig, option // FIXME:
78
79
  const internalBabelConfig = _objectSpread({}, babelChain.toJSON());
79
80
 
80
81
  const userBabelConfig = modernConfig.tools.babel;
81
- applyOptionsChain(internalBabelConfig, // TODO: 感觉 userBabelConfig 的类型应该是TransformOptions
82
- userBabelConfig, {
83
- chain: babelChain
84
- });
85
- return internalBabelConfig;
82
+ return applyUserBabelConfig(internalBabelConfig, userBabelConfig);
86
83
  };
@@ -108,7 +108,8 @@ const resolveBabelConfig = (appDirectory, modernConfig, option // FIXME: babel t
108
108
  babelChain.plugin('babel-plugin-transform-typescript-metadata').use(require.resolve('babel-plugin-transform-typescript-metadata'), []);
109
109
  babelChain.plugin('@babel/plugin-proposal-decorators').use(require.resolve('@babel/plugin-proposal-decorators'), [{
110
110
  legacy: true
111
- }]);
111
+ }]); // resolve "Definitely assigned fields cannot be initialized here, but only in the constructor."
112
+
112
113
  babelChain.plugin('@babel/plugin-proposal-class-properties').use(require.resolve('@babel/plugin-proposal-class-properties'), [{
113
114
  loose: true
114
115
  }]);
@@ -116,11 +117,7 @@ const resolveBabelConfig = (appDirectory, modernConfig, option // FIXME: babel t
116
117
  const internalBabelConfig = _objectSpread({}, babelChain.toJSON());
117
118
 
118
119
  const userBabelConfig = modernConfig.tools.babel;
119
- (0, _utils.applyOptionsChain)(internalBabelConfig, // TODO: 感觉 userBabelConfig 的类型应该是TransformOptions
120
- userBabelConfig, {
121
- chain: babelChain
122
- });
123
- return internalBabelConfig;
120
+ return (0, _babelPresetLib.applyUserBabelConfig)(internalBabelConfig, userBabelConfig);
124
121
  };
125
122
 
126
123
  exports.resolveBabelConfig = resolveBabelConfig;
@@ -1,5 +1,5 @@
1
1
  import _objectSpread from "@babel/runtime/helpers/esm/objectSpread2";
2
- import { getBabelChain } from '@modern-js/babel-preset-lib';
2
+ import { getBabelChain, applyUserBabelConfig } from '@modern-js/babel-preset-lib';
3
3
  import { fs, json5, getAlias, applyOptionsChain } from '@modern-js/utils';
4
4
  export * from '@babel/core';
5
5
  export var readTsConfig = function readTsConfig(tsconfigPath) {
@@ -61,7 +61,8 @@ export var resolveBabelConfig = function resolveBabelConfig(appDirectory, modern
61
61
  babelChain.plugin('babel-plugin-transform-typescript-metadata').use(require.resolve('babel-plugin-transform-typescript-metadata'), []);
62
62
  babelChain.plugin('@babel/plugin-proposal-decorators').use(require.resolve('@babel/plugin-proposal-decorators'), [{
63
63
  legacy: true
64
- }]);
64
+ }]); // resolve "Definitely assigned fields cannot be initialized here, but only in the constructor."
65
+
65
66
  babelChain.plugin('@babel/plugin-proposal-class-properties').use(require.resolve('@babel/plugin-proposal-class-properties'), [{
66
67
  loose: true
67
68
  }]);
@@ -69,9 +70,5 @@ export var resolveBabelConfig = function resolveBabelConfig(appDirectory, modern
69
70
  var internalBabelConfig = _objectSpread({}, babelChain.toJSON());
70
71
 
71
72
  var userBabelConfig = modernConfig.tools.babel;
72
- applyOptionsChain(internalBabelConfig, // TODO: 感觉 userBabelConfig 的类型应该是TransformOptions
73
- userBabelConfig, {
74
- chain: babelChain
75
- });
76
- return internalBabelConfig;
73
+ return applyUserBabelConfig(internalBabelConfig, userBabelConfig);
77
74
  };
package/package.json CHANGED
@@ -11,7 +11,7 @@
11
11
  "modern",
12
12
  "modern.js"
13
13
  ],
14
- "version": "1.2.8",
14
+ "version": "1.2.11",
15
15
  "jsnext:source": "./src/index.ts",
16
16
  "types": "./dist/types/index.d.ts",
17
17
  "main": "./dist/js/node/index.js",
@@ -28,21 +28,21 @@
28
28
  }
29
29
  },
30
30
  "dependencies": {
31
- "@babel/compat-data": "^7.15.0",
32
- "@babel/core": "^7.17.0",
33
- "@babel/plugin-proposal-class-properties": "^7.12.1",
34
- "@babel/plugin-proposal-decorators": "^7.15.4",
35
- "@babel/preset-env": "^7.17.0",
36
- "@babel/preset-typescript": "^7.15.0",
37
- "@babel/runtime": "^7",
38
- "@modern-js/babel-preset-lib": "^1.2.5",
39
- "@modern-js/plugin": "^1.3.4",
40
- "@modern-js/utils": "^1.7.3",
31
+ "@babel/compat-data": "^7.17.10",
32
+ "@babel/core": "^7.18.0",
33
+ "@babel/plugin-proposal-class-properties": "^7.17.12",
34
+ "@babel/plugin-proposal-decorators": "^7.18.0",
35
+ "@babel/preset-env": "^7.18.0",
36
+ "@babel/preset-typescript": "^7.17.12",
37
+ "@babel/runtime": "^7.18.0",
38
+ "@modern-js/babel-preset-lib": "^1.3.1",
39
+ "@modern-js/plugin": "^1.3.7",
40
+ "@modern-js/utils": "^1.7.7",
41
41
  "babel-plugin-module-resolver": "^4.1.0",
42
42
  "babel-plugin-transform-typescript-metadata": "^0.3.2"
43
43
  },
44
44
  "devDependencies": {
45
- "@modern-js/core": "1.10.2",
45
+ "@modern-js/core": "1.12.0",
46
46
  "@scripts/build": "0.0.0",
47
47
  "@scripts/jest-config": "0.0.0",
48
48
  "@types/babel__core": "^7.1.15",
@@ -57,8 +57,7 @@
57
57
  "sideEffects": false,
58
58
  "publishConfig": {
59
59
  "registry": "https://registry.npmjs.org/",
60
- "access": "public",
61
- "types": "./dist/types/index.d.ts"
60
+ "access": "public"
62
61
  },
63
62
  "wireit": {
64
63
  "build": {