@modern-js/bff-core 2.5.1-alpha.0 → 2.5.1-alpha.1

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.
@@ -34,6 +34,7 @@ const DEFAULT_CLIENT_REQUEST_CREATOR = "@modern-js/create-request";
34
34
  const generateClient = async ({
35
35
  resourcePath,
36
36
  apiDir,
37
+ lambdaDir,
37
38
  prefix,
38
39
  port,
39
40
  target,
@@ -59,6 +60,7 @@ const generateClient = async ({
59
60
  }
60
61
  const apiRouter = new import_router.ApiRouter({
61
62
  apiDir,
63
+ lambdaDir,
62
64
  prefix,
63
65
  httpMethodDecider
64
66
  });
@@ -169,9 +169,11 @@ class ApiRouter {
169
169
  return import_types.HttpMethod.Get;
170
170
  }
171
171
  default:
172
- import_utils.logger.warn(
173
- `Only api handlers are allowd to be exported, please remove the function ${originHandlerName} from exports`
174
- );
172
+ if (process.env.NODE_ENV !== "test") {
173
+ import_utils.logger.warn(
174
+ `Only api handlers are allowd to be exported, please remove the function ${originHandlerName} from exports`
175
+ );
176
+ }
175
177
  return null;
176
178
  }
177
179
  } else {
@@ -5,6 +5,7 @@ const DEFAULT_CLIENT_REQUEST_CREATOR = "@modern-js/create-request";
5
5
  const generateClient = async ({
6
6
  resourcePath,
7
7
  apiDir,
8
+ lambdaDir,
8
9
  prefix,
9
10
  port,
10
11
  target,
@@ -30,6 +31,7 @@ const generateClient = async ({
30
31
  }
31
32
  const apiRouter = new ApiRouter({
32
33
  apiDir,
34
+ lambdaDir,
33
35
  prefix,
34
36
  httpMethodDecider
35
37
  });
@@ -150,9 +150,11 @@ class ApiRouter {
150
150
  return HttpMethod.Get;
151
151
  }
152
152
  default:
153
- logger.warn(
154
- `Only api handlers are allowd to be exported, please remove the function ${originHandlerName} from exports`
155
- );
153
+ if (process.env.NODE_ENV !== "test") {
154
+ logger.warn(
155
+ `Only api handlers are allowd to be exported, please remove the function ${originHandlerName} from exports`
156
+ );
157
+ }
156
158
  return null;
157
159
  }
158
160
  } else {
@@ -5,6 +5,7 @@ export type GenClientOptions = {
5
5
  resourcePath: string;
6
6
  source: string;
7
7
  apiDir: string;
8
+ lambdaDir: string;
8
9
  prefix: string;
9
10
  port: number;
10
11
  requestCreator?: string;
@@ -17,6 +18,7 @@ export declare const DEFAULT_CLIENT_REQUEST_CREATOR = "@modern-js/create-request
17
18
  export declare const generateClient: ({
18
19
  resourcePath,
19
20
  apiDir,
21
+ lambdaDir,
20
22
  prefix,
21
23
  port,
22
24
  target,
package/package.json CHANGED
@@ -11,7 +11,7 @@
11
11
  "modern",
12
12
  "modern.js"
13
13
  ],
14
- "version": "2.5.1-alpha.0",
14
+ "version": "2.5.1-alpha.1",
15
15
  "jsnext:source": "./src/index.ts",
16
16
  "types": "./dist/types/index.d.ts",
17
17
  "main": "./dist/cjs/index.js",