@modern-js/plugin-bff 2.0.0-beta.1 → 2.0.0-beta.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,38 @@
1
1
  # @modern-js/plugin-bff
2
2
 
3
+ ## 2.0.0-beta.2
4
+
5
+ ### Major Changes
6
+
7
+ - dda38c9c3e: chore: v2
8
+
9
+ ### Patch Changes
10
+
11
+ - 8ff2cf4c71: fix: bff api loader should run before babel loader
12
+ fix: bff 一体化调用的 loader 应该在 babel loader 前执行
13
+ - Updated dependencies [9b915e0c10]
14
+ - Updated dependencies [2344eb2]
15
+ - Updated dependencies [a2509bfbdb]
16
+ - Updated dependencies [92f0ead]
17
+ - Updated dependencies [edd1cfb1af]
18
+ - Updated dependencies [cc971eabfc]
19
+ - Updated dependencies [5b9049f2e9]
20
+ - Updated dependencies [a8642da58f]
21
+ - Updated dependencies [92004d1]
22
+ - Updated dependencies [b8bbe036c7]
23
+ - Updated dependencies [c2bb0f1]
24
+ - Updated dependencies [d5a31df781]
25
+ - Updated dependencies [dda38c9c3e]
26
+ - Updated dependencies [3bbea92b2a]
27
+ - Updated dependencies [abf3421a75]
28
+ - Updated dependencies [543be9558e]
29
+ - Updated dependencies [14b712da84]
30
+ - @modern-js/server-utils@2.0.0-beta.2
31
+ - @modern-js/bff-core@2.0.0-beta.2
32
+ - @modern-js/utils@2.0.0-beta.2
33
+ - @modern-js/create-request@2.0.0-beta.2
34
+ - @modern-js/babel-compiler@2.0.0-beta.2
35
+
3
36
  ## 2.0.0-beta.1
4
37
 
5
38
  ### Major Changes
@@ -28,9 +28,6 @@ export default (() => ({
28
28
  const {
29
29
  bff
30
30
  } = modernConfig || {};
31
- const {
32
- fetcher
33
- } = bff || {};
34
31
  const prefix = (bff === null || bff === void 0 ? void 0 : bff.prefix) || DEFAULT_API_PREFIX;
35
32
  const rootDir = path.resolve(appDirectory, API_DIR);
36
33
  chain.resolve.alias.set('@api', rootDir);
@@ -48,9 +45,7 @@ export default (() => ({
48
45
  lambdaDir,
49
46
  existLambda,
50
47
  port,
51
- fetcher,
52
- target: name,
53
- requestCreator: bff === null || bff === void 0 ? void 0 : bff.requestCreator
48
+ target: name
54
49
  });
55
50
  }
56
51
  },
@@ -120,7 +115,7 @@ export default (() => ({
120
115
  } = modernConfig;
121
116
  const {
122
117
  alias,
123
- envVars,
118
+ define,
124
119
  globalVars
125
120
  } = modernConfig.source;
126
121
  const {
@@ -130,7 +125,7 @@ export default (() => ({
130
125
  await compile(appDirectory, {
131
126
  server,
132
127
  alias,
133
- envVars,
128
+ define,
134
129
  globalVars,
135
130
  babelConfig: babel
136
131
  }, {
@@ -35,9 +35,6 @@ var _default = () => ({
35
35
  const {
36
36
  bff
37
37
  } = modernConfig || {};
38
- const {
39
- fetcher
40
- } = bff || {};
41
38
  const prefix = (bff === null || bff === void 0 ? void 0 : bff.prefix) || DEFAULT_API_PREFIX;
42
39
  const rootDir = _path.default.resolve(appDirectory, _utils.API_DIR);
43
40
  chain.resolve.alias.set('@api', rootDir);
@@ -55,9 +52,7 @@ var _default = () => ({
55
52
  lambdaDir,
56
53
  existLambda,
57
54
  port,
58
- fetcher,
59
- target: name,
60
- requestCreator: bff === null || bff === void 0 ? void 0 : bff.requestCreator
55
+ target: name
61
56
  });
62
57
  }
63
58
  },
@@ -127,7 +122,7 @@ var _default = () => ({
127
122
  } = modernConfig;
128
123
  const {
129
124
  alias,
130
- envVars,
125
+ define,
131
126
  globalVars
132
127
  } = modernConfig.source;
133
128
  const {
@@ -137,7 +132,7 @@ var _default = () => ({
137
132
  await (0, _serverUtils.compile)(appDirectory, {
138
133
  server,
139
134
  alias,
140
- envVars,
135
+ define,
141
136
  globalVars,
142
137
  babelConfig: babel
143
138
  }, {
@@ -29,8 +29,6 @@ export default (function () {
29
29
  var modernConfig = api.useResolvedConfigContext();
30
30
  var _ref2 = modernConfig || {},
31
31
  bff = _ref2.bff;
32
- var _ref3 = bff || {},
33
- fetcher = _ref3.fetcher;
34
32
  var prefix = (bff === null || bff === void 0 ? void 0 : bff.prefix) || DEFAULT_API_PREFIX;
35
33
  var rootDir = path.resolve(appDirectory, API_DIR);
36
34
  chain.resolve.alias.set('@api', rootDir);
@@ -48,9 +46,7 @@ export default (function () {
48
46
  lambdaDir: lambdaDir,
49
47
  existLambda: existLambda,
50
48
  port: port,
51
- fetcher: fetcher,
52
- target: name,
53
- requestCreator: bff === null || bff === void 0 ? void 0 : bff.requestCreator
49
+ target: name
54
50
  });
55
51
  }
56
52
  },
@@ -59,11 +55,11 @@ export default (function () {
59
55
  }
60
56
  };
61
57
  },
62
- modifyServerRoutes: function modifyServerRoutes(_ref4) {
63
- var routes = _ref4.routes;
58
+ modifyServerRoutes: function modifyServerRoutes(_ref3) {
59
+ var routes = _ref3.routes;
64
60
  var modernConfig = api.useResolvedConfigContext();
65
- var _ref5 = modernConfig || {},
66
- bff = _ref5.bff;
61
+ var _ref4 = modernConfig || {},
62
+ bff = _ref4.bff;
67
63
  var prefix = (bff === null || bff === void 0 ? void 0 : bff.prefix) || '/api';
68
64
  var prefixList = [];
69
65
  if (Array.isArray(prefix)) {
@@ -108,7 +104,7 @@ export default (function () {
108
104
  },
109
105
  afterBuild: function afterBuild() {
110
106
  return _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2() {
111
- var _api$useAppContext3, appDirectory, distDirectory, modernConfig, distDir, apiDir, sharedDir, tsconfigPath, sourceDirs, server, _modernConfig$source, alias, envVars, globalVars, babel;
107
+ var _api$useAppContext3, appDirectory, distDirectory, modernConfig, distDir, apiDir, sharedDir, tsconfigPath, sourceDirs, server, _modernConfig$source, alias, define, globalVars, babel;
112
108
  return _regeneratorRuntime().wrap(function _callee2$(_context2) {
113
109
  while (1) {
114
110
  switch (_context2.prev = _context2.next) {
@@ -130,7 +126,7 @@ export default (function () {
130
126
  sourceDirs.push(sharedDir);
131
127
  }
132
128
  server = modernConfig.server;
133
- _modernConfig$source = modernConfig.source, alias = _modernConfig$source.alias, envVars = _modernConfig$source.envVars, globalVars = _modernConfig$source.globalVars;
129
+ _modernConfig$source = modernConfig.source, alias = _modernConfig$source.alias, define = _modernConfig$source.define, globalVars = _modernConfig$source.globalVars;
134
130
  babel = modernConfig.tools.babel;
135
131
  if (!(sourceDirs.length > 0)) {
136
132
  _context2.next = 16;
@@ -140,7 +136,7 @@ export default (function () {
140
136
  return compile(appDirectory, {
141
137
  server: server,
142
138
  alias: alias,
143
- envVars: envVars,
139
+ define: define,
144
140
  globalVars: globalVars,
145
141
  babelConfig: babel
146
142
  }, {
@@ -1,3 +1,3 @@
1
- import type { CliPlugin } from '@modern-js/core';
2
- declare const _default: () => CliPlugin;
1
+ import type { AppTools, CliPlugin } from '@modern-js/app-tools';
2
+ declare const _default: () => CliPlugin<AppTools>;
3
3
  export default _default;
package/package.json CHANGED
@@ -11,7 +11,7 @@
11
11
  "modern",
12
12
  "modern.js"
13
13
  ],
14
- "version": "2.0.0-beta.1",
14
+ "version": "2.0.0-beta.2",
15
15
  "jsnext:source": "./src/index.ts",
16
16
  "types": "./dist/types/index.d.ts",
17
17
  "main": "./dist/js/node/index.js",
@@ -55,11 +55,11 @@
55
55
  "dependencies": {
56
56
  "@babel/core": "^7.18.0",
57
57
  "@babel/runtime": "^7.18.0",
58
- "@modern-js/babel-compiler": "2.0.0-beta.1",
59
- "@modern-js/bff-core": "2.0.0-beta.1",
60
- "@modern-js/create-request": "2.0.0-beta.1",
61
- "@modern-js/server-utils": "2.0.0-beta.1",
62
- "@modern-js/utils": "2.0.0-beta.1"
58
+ "@modern-js/babel-compiler": "2.0.0-beta.2",
59
+ "@modern-js/bff-core": "2.0.0-beta.2",
60
+ "@modern-js/create-request": "2.0.0-beta.2",
61
+ "@modern-js/server-utils": "2.0.0-beta.2",
62
+ "@modern-js/utils": "2.0.0-beta.2"
63
63
  },
64
64
  "devDependencies": {
65
65
  "@types/babel__core": "^7.1.15",
@@ -71,13 +71,14 @@
71
71
  "typescript": "^4",
72
72
  "webpack": "^5.74.0",
73
73
  "webpack-chain": "^6.5.1",
74
- "@modern-js/core": "2.0.0-beta.1",
75
- "@modern-js/bff-runtime": "2.0.0-beta.1",
76
- "@modern-js/runtime": "2.0.0-beta.1",
77
- "@modern-js/server-core": "2.0.0-beta.1",
78
- "@modern-js/types": "2.0.0-beta.1",
79
- "@scripts/build": "2.0.0-beta.1",
80
- "@scripts/jest-config": "2.0.0-beta.1"
74
+ "@modern-js/runtime": "2.0.0-beta.2",
75
+ "@modern-js/core": "2.0.0-beta.2",
76
+ "@modern-js/bff-runtime": "2.0.0-beta.2",
77
+ "@modern-js/server-core": "2.0.0-beta.2",
78
+ "@modern-js/types": "2.0.0-beta.2",
79
+ "@modern-js/app-tools": "2.0.0-beta.2",
80
+ "@scripts/build": "2.0.0-beta.2",
81
+ "@scripts/jest-config": "2.0.0-beta.2"
81
82
  },
82
83
  "sideEffects": false,
83
84
  "publishConfig": {
@@ -85,9 +86,9 @@
85
86
  "access": "public"
86
87
  },
87
88
  "scripts": {
88
- "new": "modern new",
89
- "build": "modern build",
90
- "dev": "modern build --watch",
89
+ "new": "modern-lib new",
90
+ "build": "modern-lib build",
91
+ "dev": "modern-lib build --watch",
91
92
  "test": "jest --passWithNoTests"
92
93
  }
93
94
  }