@modern-js/server-utils 1.0.0-rc.14 → 1.0.0-rc.18
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 +60 -0
- package/dist/js/modern/babel.js +5 -5
- package/dist/js/modern/gather.js +1 -1
- package/dist/js/node/babel.js +4 -4
- package/dist/js/node/gather.js +5 -7
- package/dist/js/treeshaking/babel.js +5 -5
- package/dist/js/treeshaking/gather.js +1 -1
- package/package.json +7 -7
- package/src/babel.ts +5 -5
- package/src/gather.ts +1 -1
- package/tests/babel.test.ts +1 -1
- package/tests/gather.test.ts +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,65 @@
|
|
|
1
1
|
# @modern-js/server-utils
|
|
2
2
|
|
|
3
|
+
## 1.0.0-rc.18
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- 224f7fe: fix server route match
|
|
8
|
+
- 30ac27c: feat: add generator package description
|
|
9
|
+
- 204c626: feat: initial
|
|
10
|
+
- 63be0a5: fix: #118 #104
|
|
11
|
+
- Updated dependencies [224f7fe]
|
|
12
|
+
- Updated dependencies [30ac27c]
|
|
13
|
+
- Updated dependencies [204c626]
|
|
14
|
+
- Updated dependencies [63be0a5]
|
|
15
|
+
- @modern-js/babel-preset-lib@1.0.0-rc.18
|
|
16
|
+
- @modern-js/plugin@1.0.0-rc.18
|
|
17
|
+
- @modern-js/utils@1.0.0-rc.18
|
|
18
|
+
|
|
19
|
+
## 1.0.0-rc.17
|
|
20
|
+
|
|
21
|
+
### Patch Changes
|
|
22
|
+
|
|
23
|
+
- 224f7fe: fix server route match
|
|
24
|
+
- 30ac27c: feat: add generator package description
|
|
25
|
+
- 204c626: feat: initial
|
|
26
|
+
- fix: #118 #104
|
|
27
|
+
- Updated dependencies [224f7fe]
|
|
28
|
+
- Updated dependencies [30ac27c]
|
|
29
|
+
- Updated dependencies [204c626]
|
|
30
|
+
- Updated dependencies [undefined]
|
|
31
|
+
- @modern-js/babel-preset-lib@1.0.0-rc.17
|
|
32
|
+
- @modern-js/plugin@1.0.0-rc.17
|
|
33
|
+
- @modern-js/utils@1.0.0-rc.17
|
|
34
|
+
|
|
35
|
+
## 1.0.0-rc.16
|
|
36
|
+
|
|
37
|
+
### Patch Changes
|
|
38
|
+
|
|
39
|
+
- 224f7fe: fix server route match
|
|
40
|
+
- 30ac27c: feat: add generator package description
|
|
41
|
+
- 204c626: feat: initial
|
|
42
|
+
- Updated dependencies [224f7fe]
|
|
43
|
+
- Updated dependencies [30ac27c]
|
|
44
|
+
- Updated dependencies [204c626]
|
|
45
|
+
- @modern-js/babel-preset-lib@1.0.0-rc.16
|
|
46
|
+
- @modern-js/plugin@1.0.0-rc.16
|
|
47
|
+
- @modern-js/utils@1.0.0-rc.16
|
|
48
|
+
|
|
49
|
+
## 1.0.0-rc.15
|
|
50
|
+
|
|
51
|
+
### Patch Changes
|
|
52
|
+
|
|
53
|
+
- 224f7fe: fix server route match
|
|
54
|
+
- 30ac27c: feat: add generator package description
|
|
55
|
+
- 204c626: feat: initial
|
|
56
|
+
- Updated dependencies [224f7fe]
|
|
57
|
+
- Updated dependencies [30ac27c]
|
|
58
|
+
- Updated dependencies [204c626]
|
|
59
|
+
- @modern-js/babel-preset-lib@1.0.0-rc.15
|
|
60
|
+
- @modern-js/plugin@1.0.0-rc.15
|
|
61
|
+
- @modern-js/utils@1.0.0-rc.15
|
|
62
|
+
|
|
3
63
|
## 1.0.0-rc.14
|
|
4
64
|
|
|
5
65
|
### Patch Changes
|
package/dist/js/modern/babel.js
CHANGED
|
@@ -5,7 +5,7 @@ function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { va
|
|
|
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
7
|
import { getBabelChain } from '@modern-js/babel-preset-lib';
|
|
8
|
-
import { applyOptionsChain, fs, getAlias } from '@modern-js/utils';
|
|
8
|
+
import { applyOptionsChain, fs, getAlias, upath } from '@modern-js/utils';
|
|
9
9
|
import json5 from 'json5';
|
|
10
10
|
export * from '@babel/core';
|
|
11
11
|
export const readTsConfig = (tsconfigPath, noExistReturn = null) => {
|
|
@@ -65,14 +65,14 @@ export const resolveBabelConfig = (appDirectory, modernConfig, option // FIXME:
|
|
|
65
65
|
syntax: option.syntax
|
|
66
66
|
});
|
|
67
67
|
const envOptions = babelChain.preset('@babel/preset-env').options();
|
|
68
|
-
babelChain.preset('@babel/preset-env').use(require.resolve('@babel/preset-env'), [_objectSpread(_objectSpread({}, envOptions[0]), {}, {
|
|
68
|
+
babelChain.preset('@babel/preset-env').use(upath.normalizeSafe(require.resolve('@babel/preset-env')), [_objectSpread(_objectSpread({}, envOptions[0]), {}, {
|
|
69
69
|
loose: true
|
|
70
70
|
})]);
|
|
71
|
-
babelChain.plugin('babel-plugin-transform-typescript-metadata').use(require.resolve('babel-plugin-transform-typescript-metadata'), []);
|
|
72
|
-
babelChain.plugin('@babel/plugin-proposal-decorators').use(require.resolve('@babel/plugin-proposal-decorators'), [{
|
|
71
|
+
babelChain.plugin('babel-plugin-transform-typescript-metadata').use(upath.normalizeSafe(require.resolve('babel-plugin-transform-typescript-metadata')), []);
|
|
72
|
+
babelChain.plugin('@babel/plugin-proposal-decorators').use(upath.normalizeSafe(require.resolve('@babel/plugin-proposal-decorators')), [{
|
|
73
73
|
legacy: true
|
|
74
74
|
}]);
|
|
75
|
-
babelChain.plugin('@babel/plugin-proposal-class-properties').use(require.resolve('@babel/plugin-proposal-class-properties'), [{
|
|
75
|
+
babelChain.plugin('@babel/plugin-proposal-class-properties').use(upath.normalizeSafe(require.resolve('@babel/plugin-proposal-class-properties')), [{
|
|
76
76
|
loose: true
|
|
77
77
|
}]);
|
|
78
78
|
|
package/dist/js/modern/gather.js
CHANGED
package/dist/js/node/babel.js
CHANGED
|
@@ -106,14 +106,14 @@ const resolveBabelConfig = (appDirectory, modernConfig, option // FIXME: babel t
|
|
|
106
106
|
syntax: option.syntax
|
|
107
107
|
});
|
|
108
108
|
const envOptions = babelChain.preset('@babel/preset-env').options();
|
|
109
|
-
babelChain.preset('@babel/preset-env').use(require.resolve('@babel/preset-env'), [_objectSpread(_objectSpread({}, envOptions[0]), {}, {
|
|
109
|
+
babelChain.preset('@babel/preset-env').use(_utils.upath.normalizeSafe(require.resolve('@babel/preset-env')), [_objectSpread(_objectSpread({}, envOptions[0]), {}, {
|
|
110
110
|
loose: true
|
|
111
111
|
})]);
|
|
112
|
-
babelChain.plugin('babel-plugin-transform-typescript-metadata').use(require.resolve('babel-plugin-transform-typescript-metadata'), []);
|
|
113
|
-
babelChain.plugin('@babel/plugin-proposal-decorators').use(require.resolve('@babel/plugin-proposal-decorators'), [{
|
|
112
|
+
babelChain.plugin('babel-plugin-transform-typescript-metadata').use(_utils.upath.normalizeSafe(require.resolve('babel-plugin-transform-typescript-metadata')), []);
|
|
113
|
+
babelChain.plugin('@babel/plugin-proposal-decorators').use(_utils.upath.normalizeSafe(require.resolve('@babel/plugin-proposal-decorators')), [{
|
|
114
114
|
legacy: true
|
|
115
115
|
}]);
|
|
116
|
-
babelChain.plugin('@babel/plugin-proposal-class-properties').use(require.resolve('@babel/plugin-proposal-class-properties'), [{
|
|
116
|
+
babelChain.plugin('@babel/plugin-proposal-class-properties').use(_utils.upath.normalizeSafe(require.resolve('@babel/plugin-proposal-class-properties')), [{
|
|
117
117
|
loose: true
|
|
118
118
|
}]);
|
|
119
119
|
|
package/dist/js/node/gather.js
CHANGED
|
@@ -5,14 +5,12 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
5
5
|
});
|
|
6
6
|
exports.gather = void 0;
|
|
7
7
|
|
|
8
|
-
var
|
|
8
|
+
var _utils = require("@modern-js/utils");
|
|
9
9
|
|
|
10
10
|
var _middleware = require("./middleware");
|
|
11
11
|
|
|
12
12
|
var _requireModule = require("./requireModule");
|
|
13
13
|
|
|
14
|
-
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
15
|
-
|
|
16
14
|
const API_DIR_PATH = 'api';
|
|
17
15
|
const API_APP_NAME = '_app';
|
|
18
16
|
const SERVER_DIR_PATH = 'server';
|
|
@@ -25,13 +23,13 @@ const gather = pwd => {
|
|
|
25
23
|
addWebMiddleware
|
|
26
24
|
} = (0, _middleware.createMiddlewareCollecter)();
|
|
27
25
|
|
|
28
|
-
const apiPath =
|
|
26
|
+
const apiPath = _utils.path.resolve(pwd, API_DIR_PATH);
|
|
29
27
|
|
|
30
|
-
const apiAppPath =
|
|
28
|
+
const apiAppPath = _utils.path.resolve(apiPath, API_APP_NAME);
|
|
31
29
|
|
|
32
|
-
const serverPath =
|
|
30
|
+
const serverPath = _utils.path.resolve(pwd, SERVER_DIR_PATH);
|
|
33
31
|
|
|
34
|
-
const webAppPath =
|
|
32
|
+
const webAppPath = _utils.path.resolve(serverPath, WEB_APP_NAME);
|
|
35
33
|
|
|
36
34
|
const apiAttacher = (0, _requireModule.requireModule)(apiAppPath);
|
|
37
35
|
|
|
@@ -5,7 +5,7 @@ function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { va
|
|
|
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
7
|
import { getBabelChain } from '@modern-js/babel-preset-lib';
|
|
8
|
-
import { applyOptionsChain, fs, getAlias } from '@modern-js/utils';
|
|
8
|
+
import { applyOptionsChain, fs, getAlias, upath } from '@modern-js/utils';
|
|
9
9
|
import json5 from 'json5';
|
|
10
10
|
export * from '@babel/core';
|
|
11
11
|
export var readTsConfig = function readTsConfig(tsconfigPath) {
|
|
@@ -61,14 +61,14 @@ export var resolveBabelConfig = function resolveBabelConfig(appDirectory, modern
|
|
|
61
61
|
syntax: option.syntax
|
|
62
62
|
});
|
|
63
63
|
var envOptions = babelChain.preset('@babel/preset-env').options();
|
|
64
|
-
babelChain.preset('@babel/preset-env').use(require.resolve('@babel/preset-env'), [_objectSpread(_objectSpread({}, envOptions[0]), {}, {
|
|
64
|
+
babelChain.preset('@babel/preset-env').use(upath.normalizeSafe(require.resolve('@babel/preset-env')), [_objectSpread(_objectSpread({}, envOptions[0]), {}, {
|
|
65
65
|
loose: true
|
|
66
66
|
})]);
|
|
67
|
-
babelChain.plugin('babel-plugin-transform-typescript-metadata').use(require.resolve('babel-plugin-transform-typescript-metadata'), []);
|
|
68
|
-
babelChain.plugin('@babel/plugin-proposal-decorators').use(require.resolve('@babel/plugin-proposal-decorators'), [{
|
|
67
|
+
babelChain.plugin('babel-plugin-transform-typescript-metadata').use(upath.normalizeSafe(require.resolve('babel-plugin-transform-typescript-metadata')), []);
|
|
68
|
+
babelChain.plugin('@babel/plugin-proposal-decorators').use(upath.normalizeSafe(require.resolve('@babel/plugin-proposal-decorators')), [{
|
|
69
69
|
legacy: true
|
|
70
70
|
}]);
|
|
71
|
-
babelChain.plugin('@babel/plugin-proposal-class-properties').use(require.resolve('@babel/plugin-proposal-class-properties'), [{
|
|
71
|
+
babelChain.plugin('@babel/plugin-proposal-class-properties').use(upath.normalizeSafe(require.resolve('@babel/plugin-proposal-class-properties')), [{
|
|
72
72
|
loose: true
|
|
73
73
|
}]);
|
|
74
74
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@modern-js/server-utils",
|
|
3
|
-
"version": "1.0.0-rc.
|
|
3
|
+
"version": "1.0.0-rc.18",
|
|
4
4
|
"jsnext:source": "./src/index.ts",
|
|
5
5
|
"types": "./dist/types/index.d.ts",
|
|
6
6
|
"main": "./dist/js/node/index.js",
|
|
@@ -23,15 +23,15 @@
|
|
|
23
23
|
"@babel/preset-env": "^7.15.0",
|
|
24
24
|
"@babel/preset-typescript": "^7.15.0",
|
|
25
25
|
"@babel/runtime": "^7",
|
|
26
|
-
"@modern-js/babel-preset-lib": "^1.0.0-rc.
|
|
27
|
-
"@modern-js/plugin": "^1.0.0-rc.
|
|
28
|
-
"@modern-js/utils": "^1.0.0-rc.
|
|
26
|
+
"@modern-js/babel-preset-lib": "^1.0.0-rc.18",
|
|
27
|
+
"@modern-js/plugin": "^1.0.0-rc.18",
|
|
28
|
+
"@modern-js/utils": "^1.0.0-rc.18",
|
|
29
29
|
"babel-plugin-module-resolver": "^4.1.0",
|
|
30
30
|
"babel-plugin-transform-typescript-metadata": "^0.3.2",
|
|
31
31
|
"json5": "^2.2.0"
|
|
32
32
|
},
|
|
33
33
|
"devDependencies": {
|
|
34
|
-
"@modern-js/core": "^1.0.0-rc.
|
|
34
|
+
"@modern-js/core": "^1.0.0-rc.18",
|
|
35
35
|
"@types/babel__core": "^7.1.15",
|
|
36
36
|
"@types/jest": "^26",
|
|
37
37
|
"@types/node": "^14",
|
|
@@ -39,8 +39,8 @@
|
|
|
39
39
|
"@types/react-dom": "^17",
|
|
40
40
|
"ts-jest": "^27.0.4",
|
|
41
41
|
"typescript": "^4",
|
|
42
|
-
"@modern-js/plugin-testing": "^1.0.0-rc.
|
|
43
|
-
"@modern-js/module-tools": "^1.0.0-rc.
|
|
42
|
+
"@modern-js/plugin-testing": "^1.0.0-rc.18",
|
|
43
|
+
"@modern-js/module-tools": "^1.0.0-rc.18"
|
|
44
44
|
},
|
|
45
45
|
"sideEffects": false,
|
|
46
46
|
"publishConfig": {
|
package/src/babel.ts
CHANGED
|
@@ -4,7 +4,7 @@ import {
|
|
|
4
4
|
ISyntaxOption,
|
|
5
5
|
} from '@modern-js/babel-preset-lib';
|
|
6
6
|
import { TransformOptions } from '@babel/core';
|
|
7
|
-
import { applyOptionsChain, fs, getAlias } from '@modern-js/utils';
|
|
7
|
+
import { applyOptionsChain, fs, getAlias, upath } from '@modern-js/utils';
|
|
8
8
|
import type { NormalizedConfig } from '@modern-js/core';
|
|
9
9
|
import json5 from 'json5';
|
|
10
10
|
|
|
@@ -112,7 +112,7 @@ export const resolveBabelConfig = (
|
|
|
112
112
|
const envOptions = babelChain.preset('@babel/preset-env').options();
|
|
113
113
|
babelChain
|
|
114
114
|
.preset('@babel/preset-env')
|
|
115
|
-
.use(require.resolve('@babel/preset-env'), [
|
|
115
|
+
.use(upath.normalizeSafe(require.resolve('@babel/preset-env')), [
|
|
116
116
|
{
|
|
117
117
|
...envOptions[0],
|
|
118
118
|
loose: true,
|
|
@@ -121,17 +121,17 @@ export const resolveBabelConfig = (
|
|
|
121
121
|
|
|
122
122
|
babelChain
|
|
123
123
|
.plugin('babel-plugin-transform-typescript-metadata')
|
|
124
|
-
.use(require.resolve('babel-plugin-transform-typescript-metadata'), []);
|
|
124
|
+
.use(upath.normalizeSafe(require.resolve('babel-plugin-transform-typescript-metadata')), []);
|
|
125
125
|
|
|
126
126
|
babelChain
|
|
127
127
|
.plugin('@babel/plugin-proposal-decorators')
|
|
128
|
-
.use(require.resolve('@babel/plugin-proposal-decorators'), [
|
|
128
|
+
.use(upath.normalizeSafe(require.resolve('@babel/plugin-proposal-decorators')), [
|
|
129
129
|
{ legacy: true },
|
|
130
130
|
]);
|
|
131
131
|
|
|
132
132
|
babelChain
|
|
133
133
|
.plugin('@babel/plugin-proposal-class-properties')
|
|
134
|
-
.use(require.resolve('@babel/plugin-proposal-class-properties'), [
|
|
134
|
+
.use(upath.normalizeSafe(require.resolve('@babel/plugin-proposal-class-properties')), [
|
|
135
135
|
{ loose: true },
|
|
136
136
|
]);
|
|
137
137
|
|
package/src/gather.ts
CHANGED
package/tests/babel.test.ts
CHANGED
package/tests/gather.test.ts
CHANGED