@modern-js/plugin-testing 0.0.0-next-20230226140607 → 0.0.0-next-20230227084544

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,6 +1,11 @@
1
1
  # @modern-js/plugin-testing
2
2
 
3
- ## 0.0.0-next-20230226140607
3
+ ## 0.0.0-next-20230227084544
4
+
5
+ ### Minor Changes
6
+
7
+ - 84bfb439b: feat: support custom apiDir, lambdaDir and style of writing for bff
8
+ feat: 支持定制 api 目录,lambda 目录,bff 的写法
4
9
 
5
10
  ### Patch Changes
6
11
 
@@ -15,12 +20,13 @@
15
20
  - Updated dependencies [dcad88702]
16
21
  - Updated dependencies [7fff9020e]
17
22
  - Updated dependencies [1eea234fd]
18
- - @modern-js/runtime@0.0.0-next-20230226140607
19
- - @modern-js/utils@0.0.0-next-20230226140607
20
- - @modern-js/babel-preset-app@0.0.0-next-20230226140607
21
- - @modern-js/prod-server@0.0.0-next-20230226140607
22
- - @modern-js/babel-compiler@0.0.0-next-20230226140607
23
- - @modern-js/plugin@0.0.0-next-20230226140607
23
+ - Updated dependencies [84bfb439b]
24
+ - @modern-js/runtime@0.0.0-next-20230227084544
25
+ - @modern-js/utils@0.0.0-next-20230227084544
26
+ - @modern-js/babel-preset-app@0.0.0-next-20230227084544
27
+ - @modern-js/prod-server@0.0.0-next-20230227084544
28
+ - @modern-js/babel-compiler@0.0.0-next-20230227084544
29
+ - @modern-js/plugin@0.0.0-next-20230227084544
24
30
 
25
31
  ## 2.6.0
26
32
 
@@ -27,16 +27,18 @@ var import_mockAPI = __toESM(require("./mockAPI"));
27
27
  var import_app = require("./app");
28
28
  let uped = false;
29
29
  const setup = () => {
30
- var _a, _b;
30
+ var _a, _b, _c, _d;
31
31
  if (uped) {
32
32
  return;
33
33
  }
34
34
  uped = true;
35
35
  const bff_info = global[import_constant.bff_info_key];
36
36
  const prefix = (_b = (_a = bff_info == null ? void 0 : bff_info.modernUserConfig) == null ? void 0 : _a.bff) == null ? void 0 : _b.prefix;
37
+ const httpMethodDecider = (_d = (_c = bff_info == null ? void 0 : bff_info.modernUserConfig) == null ? void 0 : _c.bff) == null ? void 0 : _d.httpMethodDecider;
37
38
  const apiRouter = new import_bff_core.ApiRouter({
38
39
  apiDir: import_path.default.join(bff_info.appDir, "./api"),
39
- prefix
40
+ prefix,
41
+ httpMethodDecider
40
42
  });
41
43
  const apiInfos = apiRouter.getApiHandlers();
42
44
  const apiInfosByFile = apiInfos.reduce(
@@ -129,16 +129,18 @@ import mockAPI from "./mockAPI";
129
129
  import { createApp, closeServer } from "./app";
130
130
  var uped = false;
131
131
  var setup = function() {
132
- var _bff_info_modernUserConfig, _bff_info_modernUserConfig_bff;
132
+ var _bff_info_modernUserConfig, _bff_info_modernUserConfig_bff, _bff_info_modernUserConfig1, _bff_info_modernUserConfig_bff1;
133
133
  if (uped) {
134
134
  return;
135
135
  }
136
136
  uped = true;
137
137
  var bff_info = global[bff_info_key];
138
138
  var prefix = bff_info === null || bff_info === void 0 ? void 0 : (_bff_info_modernUserConfig = bff_info.modernUserConfig) === null || _bff_info_modernUserConfig === void 0 ? void 0 : (_bff_info_modernUserConfig_bff = _bff_info_modernUserConfig.bff) === null || _bff_info_modernUserConfig_bff === void 0 ? void 0 : _bff_info_modernUserConfig_bff.prefix;
139
+ var httpMethodDecider = bff_info === null || bff_info === void 0 ? void 0 : (_bff_info_modernUserConfig1 = bff_info.modernUserConfig) === null || _bff_info_modernUserConfig1 === void 0 ? void 0 : (_bff_info_modernUserConfig_bff1 = _bff_info_modernUserConfig1.bff) === null || _bff_info_modernUserConfig_bff1 === void 0 ? void 0 : _bff_info_modernUserConfig_bff1.httpMethodDecider;
139
140
  var apiRouter = new ApiRouter({
140
141
  apiDir: path.join(bff_info.appDir, "./api"),
141
- prefix: prefix
142
+ prefix: prefix,
143
+ httpMethodDecider: httpMethodDecider
142
144
  });
143
145
  var apiInfos = apiRouter.getApiHandlers();
144
146
  var apiInfosByFile = apiInfos.reduce(function(res, apiInfo) {
@@ -5,16 +5,18 @@ import mockAPI from "./mockAPI";
5
5
  import { createApp, closeServer } from "./app";
6
6
  let uped = false;
7
7
  const setup = () => {
8
- var _a, _b;
8
+ var _a, _b, _c, _d;
9
9
  if (uped) {
10
10
  return;
11
11
  }
12
12
  uped = true;
13
13
  const bff_info = global[bff_info_key];
14
14
  const prefix = (_b = (_a = bff_info == null ? void 0 : bff_info.modernUserConfig) == null ? void 0 : _a.bff) == null ? void 0 : _b.prefix;
15
+ const httpMethodDecider = (_d = (_c = bff_info == null ? void 0 : bff_info.modernUserConfig) == null ? void 0 : _c.bff) == null ? void 0 : _d.httpMethodDecider;
15
16
  const apiRouter = new ApiRouter({
16
17
  apiDir: path.join(bff_info.appDir, "./api"),
17
- prefix
18
+ prefix,
19
+ httpMethodDecider
18
20
  });
19
21
  const apiInfos = apiRouter.getApiHandlers();
20
22
  const apiInfosByFile = apiInfos.reduce(
package/package.json CHANGED
@@ -11,7 +11,7 @@
11
11
  "modern",
12
12
  "modern.js"
13
13
  ],
14
- "version": "0.0.0-next-20230226140607",
14
+ "version": "0.0.0-next-20230227084544",
15
15
  "jsnext:source": "./src/cli/index.ts",
16
16
  "types": "./dist/types/cli/index.d.ts",
17
17
  "main": "./dist/cjs/cli/index.js",
@@ -106,16 +106,16 @@
106
106
  "jest": "^27.0.6",
107
107
  "ts-jest": "^27.0.4",
108
108
  "yargs": "^17.0.1",
109
- "@modern-js/babel-compiler": "0.0.0-next-20230226140607",
110
- "@modern-js/utils": "0.0.0-next-20230226140607",
111
- "@modern-js/babel-preset-app": "0.0.0-next-20230226140607",
112
- "@modern-js/plugin": "0.0.0-next-20230226140607",
113
- "@modern-js/prod-server": "0.0.0-next-20230226140607"
109
+ "@modern-js/babel-compiler": "0.0.0-next-20230227084544",
110
+ "@modern-js/babel-preset-app": "0.0.0-next-20230227084544",
111
+ "@modern-js/utils": "0.0.0-next-20230227084544",
112
+ "@modern-js/plugin": "0.0.0-next-20230227084544",
113
+ "@modern-js/prod-server": "0.0.0-next-20230227084544"
114
114
  },
115
115
  "peerDependencies": {
116
116
  "react": ">=17",
117
117
  "react-dom": ">=17",
118
- "@modern-js/runtime": "0.0.0-next-20230226140607"
118
+ "@modern-js/runtime": "0.0.0-next-20230227084544"
119
119
  },
120
120
  "peerDependenciesMeta": {
121
121
  "@modern-js/runtime": {
@@ -132,12 +132,12 @@
132
132
  "@jest/types": "^27.0.6",
133
133
  "jest": "^27",
134
134
  "typescript": "^4",
135
- "@modern-js/core": "0.0.0-next-20230226140607",
136
- "@modern-js/types": "0.0.0-next-20230226140607",
137
- "@modern-js/bff-core": "0.0.0-next-20230226140607",
138
- "@modern-js/runtime": "0.0.0-next-20230226140607",
139
- "@scripts/build": "0.0.0-next-20230226140607",
140
- "@scripts/jest-config": "0.0.0-next-20230226140607"
135
+ "@modern-js/core": "0.0.0-next-20230227084544",
136
+ "@modern-js/types": "0.0.0-next-20230227084544",
137
+ "@modern-js/runtime": "0.0.0-next-20230227084544",
138
+ "@modern-js/bff-core": "0.0.0-next-20230227084544",
139
+ "@scripts/build": "0.0.0-next-20230227084544",
140
+ "@scripts/jest-config": "0.0.0-next-20230227084544"
141
141
  },
142
142
  "sideEffects": false,
143
143
  "modernConfig": {},