@modern-js/server-utils 1.2.9 → 1.2.12-beta.0
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 +23 -0
- package/dist/js/modern/babel.js +13 -9
- package/dist/js/node/babel.js +12 -8
- package/dist/js/treeshaking/babel.js +13 -9
- package/package.json +14 -13
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,28 @@
|
|
|
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
|
+
|
|
3
26
|
## 1.2.9
|
|
4
27
|
|
|
5
28
|
### Patch Changes
|
package/dist/js/modern/babel.js
CHANGED
|
@@ -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) => {
|
|
@@ -65,23 +65,27 @@ export const resolveBabelConfig = (appDirectory, modernConfig, option // FIXME:
|
|
|
65
65
|
});
|
|
66
66
|
const envOptions = babelChain.preset('@babel/preset-env').options();
|
|
67
67
|
babelChain.preset('@babel/preset-env').use(require.resolve('@babel/preset-env'), [_objectSpread(_objectSpread({}, envOptions[0]), {}, {
|
|
68
|
+
targets: {
|
|
69
|
+
node: '12.18.3'
|
|
70
|
+
},
|
|
68
71
|
loose: true
|
|
69
72
|
})]);
|
|
70
73
|
babelChain.plugin('babel-plugin-transform-typescript-metadata').use(require.resolve('babel-plugin-transform-typescript-metadata'), []);
|
|
71
74
|
babelChain.plugin('@babel/plugin-proposal-decorators').use(require.resolve('@babel/plugin-proposal-decorators'), [{
|
|
72
75
|
legacy: true
|
|
73
76
|
}]); // resolve "Definitely assigned fields cannot be initialized here, but only in the constructor."
|
|
77
|
+
// babelChain
|
|
78
|
+
// .plugin('@babel/plugin-proposal-class-properties')
|
|
79
|
+
// .use(require.resolve('@babel/plugin-proposal-class-properties'), [
|
|
80
|
+
// {
|
|
81
|
+
// loose: true,
|
|
82
|
+
// },
|
|
83
|
+
// ]);
|
|
74
84
|
|
|
75
|
-
babelChain.plugin('@babel/plugin-
|
|
76
|
-
loose: true
|
|
77
|
-
}]);
|
|
85
|
+
babelChain.plugin('@babel/plugin-syntax-class-properties').use(require.resolve('@babel/plugin-syntax-class-properties'), []);
|
|
78
86
|
|
|
79
87
|
const internalBabelConfig = _objectSpread({}, babelChain.toJSON());
|
|
80
88
|
|
|
81
89
|
const userBabelConfig = modernConfig.tools.babel;
|
|
82
|
-
|
|
83
|
-
userBabelConfig, {
|
|
84
|
-
chain: babelChain
|
|
85
|
-
});
|
|
86
|
-
return internalBabelConfig;
|
|
90
|
+
return applyUserBabelConfig(internalBabelConfig, userBabelConfig);
|
|
87
91
|
};
|
package/dist/js/node/babel.js
CHANGED
|
@@ -103,25 +103,29 @@ const resolveBabelConfig = (appDirectory, modernConfig, option // FIXME: babel t
|
|
|
103
103
|
});
|
|
104
104
|
const envOptions = babelChain.preset('@babel/preset-env').options();
|
|
105
105
|
babelChain.preset('@babel/preset-env').use(require.resolve('@babel/preset-env'), [_objectSpread(_objectSpread({}, envOptions[0]), {}, {
|
|
106
|
+
targets: {
|
|
107
|
+
node: '12.18.3'
|
|
108
|
+
},
|
|
106
109
|
loose: true
|
|
107
110
|
})]);
|
|
108
111
|
babelChain.plugin('babel-plugin-transform-typescript-metadata').use(require.resolve('babel-plugin-transform-typescript-metadata'), []);
|
|
109
112
|
babelChain.plugin('@babel/plugin-proposal-decorators').use(require.resolve('@babel/plugin-proposal-decorators'), [{
|
|
110
113
|
legacy: true
|
|
111
114
|
}]); // resolve "Definitely assigned fields cannot be initialized here, but only in the constructor."
|
|
115
|
+
// babelChain
|
|
116
|
+
// .plugin('@babel/plugin-proposal-class-properties')
|
|
117
|
+
// .use(require.resolve('@babel/plugin-proposal-class-properties'), [
|
|
118
|
+
// {
|
|
119
|
+
// loose: true,
|
|
120
|
+
// },
|
|
121
|
+
// ]);
|
|
112
122
|
|
|
113
|
-
babelChain.plugin('@babel/plugin-
|
|
114
|
-
loose: true
|
|
115
|
-
}]);
|
|
123
|
+
babelChain.plugin('@babel/plugin-syntax-class-properties').use(require.resolve('@babel/plugin-syntax-class-properties'), []);
|
|
116
124
|
|
|
117
125
|
const internalBabelConfig = _objectSpread({}, babelChain.toJSON());
|
|
118
126
|
|
|
119
127
|
const userBabelConfig = modernConfig.tools.babel;
|
|
120
|
-
(0,
|
|
121
|
-
userBabelConfig, {
|
|
122
|
-
chain: babelChain
|
|
123
|
-
});
|
|
124
|
-
return internalBabelConfig;
|
|
128
|
+
return (0, _babelPresetLib.applyUserBabelConfig)(internalBabelConfig, userBabelConfig);
|
|
125
129
|
};
|
|
126
130
|
|
|
127
131
|
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) {
|
|
@@ -56,23 +56,27 @@ export var resolveBabelConfig = function resolveBabelConfig(appDirectory, modern
|
|
|
56
56
|
});
|
|
57
57
|
var envOptions = babelChain.preset('@babel/preset-env').options();
|
|
58
58
|
babelChain.preset('@babel/preset-env').use(require.resolve('@babel/preset-env'), [_objectSpread(_objectSpread({}, envOptions[0]), {}, {
|
|
59
|
+
targets: {
|
|
60
|
+
node: '12.18.3'
|
|
61
|
+
},
|
|
59
62
|
loose: true
|
|
60
63
|
})]);
|
|
61
64
|
babelChain.plugin('babel-plugin-transform-typescript-metadata').use(require.resolve('babel-plugin-transform-typescript-metadata'), []);
|
|
62
65
|
babelChain.plugin('@babel/plugin-proposal-decorators').use(require.resolve('@babel/plugin-proposal-decorators'), [{
|
|
63
66
|
legacy: true
|
|
64
67
|
}]); // resolve "Definitely assigned fields cannot be initialized here, but only in the constructor."
|
|
68
|
+
// babelChain
|
|
69
|
+
// .plugin('@babel/plugin-proposal-class-properties')
|
|
70
|
+
// .use(require.resolve('@babel/plugin-proposal-class-properties'), [
|
|
71
|
+
// {
|
|
72
|
+
// loose: true,
|
|
73
|
+
// },
|
|
74
|
+
// ]);
|
|
65
75
|
|
|
66
|
-
babelChain.plugin('@babel/plugin-
|
|
67
|
-
loose: true
|
|
68
|
-
}]);
|
|
76
|
+
babelChain.plugin('@babel/plugin-syntax-class-properties').use(require.resolve('@babel/plugin-syntax-class-properties'), []);
|
|
69
77
|
|
|
70
78
|
var internalBabelConfig = _objectSpread({}, babelChain.toJSON());
|
|
71
79
|
|
|
72
80
|
var userBabelConfig = modernConfig.tools.babel;
|
|
73
|
-
|
|
74
|
-
userBabelConfig, {
|
|
75
|
-
chain: babelChain
|
|
76
|
-
});
|
|
77
|
-
return internalBabelConfig;
|
|
81
|
+
return applyUserBabelConfig(internalBabelConfig, userBabelConfig);
|
|
78
82
|
};
|
package/package.json
CHANGED
|
@@ -11,7 +11,7 @@
|
|
|
11
11
|
"modern",
|
|
12
12
|
"modern.js"
|
|
13
13
|
],
|
|
14
|
-
"version": "1.2.
|
|
14
|
+
"version": "1.2.12-beta.0",
|
|
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.
|
|
32
|
-
"@babel/core": "^7.
|
|
33
|
-
"@babel/plugin-proposal-class-properties": "^7.12
|
|
34
|
-
"@babel/plugin-proposal-decorators": "^7.
|
|
35
|
-
"@babel/preset-env": "^7.
|
|
36
|
-
"@babel/preset-typescript": "^7.
|
|
37
|
-
"@babel/runtime": "^7",
|
|
38
|
-
"@modern-js/babel-preset-lib": "^1.
|
|
39
|
-
"@modern-js/plugin": "^1.3.
|
|
40
|
-
"@modern-js/utils": "^1.7.
|
|
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.
|
|
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,7 +57,8 @@
|
|
|
57
57
|
"sideEffects": false,
|
|
58
58
|
"publishConfig": {
|
|
59
59
|
"registry": "https://registry.npmjs.org/",
|
|
60
|
-
"access": "public"
|
|
60
|
+
"access": "public",
|
|
61
|
+
"types": "./dist/types/index.d.ts"
|
|
61
62
|
},
|
|
62
63
|
"wireit": {
|
|
63
64
|
"build": {
|