@modern-js/plugin-bff 3.0.5 → 3.1.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,7 +34,7 @@ async function loader(source) {
34
34
  delete require.cache[resourcePath];
35
35
  const callback = this.async();
36
36
  const draftOptions = this.getOptions();
37
- const warning = `The file ${resourcePath} is not allowd to be imported in src directory, only API definition files are allowed.`;
37
+ const warning = `The file ${resourcePath} is not allowed to be imported in src directory, only API definition files are allowed.`;
38
38
  if (!draftOptions.existLambda) {
39
39
  utils_namespaceObject.logger.warn(warning);
40
40
  callback(null, `throw new Error('${warning}')`);
@@ -178,7 +178,7 @@ async function copyFiles(from, to) {
178
178
  async function clientGenerator(draftOptions) {
179
179
  const sourceList = await readDirectoryFiles(draftOptions.appDir, draftOptions.lambdaDir, draftOptions.relativeDistPath);
180
180
  const getClitentCode = async (resourcePath, source)=>{
181
- const warning = `The file ${resourcePath} is not allowd to be imported in src directory, only API definition files are allowed.`;
181
+ const warning = `The file ${resourcePath} is not allowed to be imported in src directory, only API definition files are allowed.`;
182
182
  if (!draftOptions.existLambda) return void utils_namespaceObject.logger.warn(warning);
183
183
  const options = {
184
184
  prefix: Array.isArray(draftOptions.prefix) ? draftOptions.prefix[0] : draftOptions.prefix,
package/dist/esm/cli.mjs CHANGED
@@ -203,4 +203,5 @@ const bffPlugin = ()=>({
203
203
  }
204
204
  });
205
205
  const cli = bffPlugin;
206
- export { bffPlugin, cli as default };
206
+ export default cli;
207
+ export { bffPlugin };
@@ -6,7 +6,7 @@ async function loader(source) {
6
6
  delete require.cache[resourcePath];
7
7
  const callback = this.async();
8
8
  const draftOptions = this.getOptions();
9
- const warning = `The file ${resourcePath} is not allowd to be imported in src directory, only API definition files are allowed.`;
9
+ const warning = `The file ${resourcePath} is not allowed to be imported in src directory, only API definition files are allowed.`;
10
10
  if (!draftOptions.existLambda) {
11
11
  logger.warn(warning);
12
12
  callback(null, `throw new Error('${warning}')`);
@@ -36,4 +36,4 @@ async function loader(source) {
36
36
  callback(void 0, result.isOk ? result.value : `throw new Error('${result.value}')`);
37
37
  }
38
38
  const src_loader = loader;
39
- export { src_loader as default };
39
+ export default src_loader;
@@ -1,2 +1 @@
1
- import { configure, createRequest, createUploader } from "@modern-js/create-request";
2
- export { configure, createRequest, createUploader };
1
+ export { configure, createRequest, createUploader } from "@modern-js/create-request";
@@ -28,7 +28,7 @@ class HonoAdapter {
28
28
  method,
29
29
  handler,
30
30
  order: 'post',
31
- before
31
+ before: before
32
32
  }));
33
33
  };
34
34
  this.registerApiRoutes = async ()=>{
@@ -88,7 +88,7 @@ class HonoAdapter {
88
88
  path: `${prefix}/*`,
89
89
  method: 'all',
90
90
  order: 'post',
91
- before,
91
+ before: before,
92
92
  handler: async (c, next)=>{
93
93
  if (this.apiServer) {
94
94
  const nodeReq = c.env?.node?.req;
@@ -104,4 +104,4 @@ const server = ()=>({
104
104
  });
105
105
  }
106
106
  });
107
- export { server as default };
107
+ export default server;
@@ -138,7 +138,7 @@ async function copyFiles(from, to) {
138
138
  async function clientGenerator(draftOptions) {
139
139
  const sourceList = await readDirectoryFiles(draftOptions.appDir, draftOptions.lambdaDir, draftOptions.relativeDistPath);
140
140
  const getClitentCode = async (resourcePath, source)=>{
141
- const warning = `The file ${resourcePath} is not allowd to be imported in src directory, only API definition files are allowed.`;
141
+ const warning = `The file ${resourcePath} is not allowed to be imported in src directory, only API definition files are allowed.`;
142
142
  if (!draftOptions.existLambda) return void logger.warn(warning);
143
143
  const options = {
144
144
  prefix: Array.isArray(draftOptions.prefix) ? draftOptions.prefix[0] : draftOptions.prefix,
@@ -172,4 +172,5 @@ async function clientGenerator(draftOptions) {
172
172
  setPackage(sourceList, draftOptions.appDir, draftOptions.relativeDistPath);
173
173
  }
174
174
  const utils_clientGenerator = clientGenerator;
175
- export { copyFiles, utils_clientGenerator as default, readDirectoryFiles };
175
+ export default utils_clientGenerator;
176
+ export { copyFiles, readDirectoryFiles };
@@ -88,4 +88,5 @@ const getHonoInput = async (c)=>{
88
88
  return draft;
89
89
  };
90
90
  const utils_createHonoRoutes = createHonoRoutes;
91
- export { createHonoHandler, utils_createHonoRoutes as default };
91
+ export default utils_createHonoRoutes;
92
+ export { createHonoHandler };
@@ -31,4 +31,5 @@ When using cross-project BFF, you should not configure bff.prefix as it may caus
31
31
  }
32
32
  });
33
33
  const utils_crossProjectApiPlugin = crossProjectApiPlugin;
34
- export { API_DIR, DIST_DIR, LAMBDA_DIR, PACKAGE_NAME, PREFIX, crossProjectApiPlugin, utils_crossProjectApiPlugin as default };
34
+ export default utils_crossProjectApiPlugin;
35
+ export { API_DIR, DIST_DIR, LAMBDA_DIR, PACKAGE_NAME, PREFIX, crossProjectApiPlugin };
@@ -26,4 +26,4 @@ async function pluginGenerator({ prefix, appDirectory, relativeDistPath, relativ
26
26
  }
27
27
  }
28
28
  const utils_pluginGenerator = pluginGenerator;
29
- export { utils_pluginGenerator as default };
29
+ export default utils_pluginGenerator;
@@ -40,4 +40,4 @@ async function runtimeGenerator({ runtime, appDirectory, relativeDistPath, packa
40
40
  await fs.writeFile(pluginTypePath, tsSource);
41
41
  }
42
42
  const utils_runtimeGenerator = runtimeGenerator;
43
- export { utils_runtimeGenerator as default };
43
+ export default utils_runtimeGenerator;
@@ -207,4 +207,5 @@ const bffPlugin = ()=>({
207
207
  }
208
208
  });
209
209
  const cli = bffPlugin;
210
- export { bffPlugin, cli as default };
210
+ export default cli;
211
+ export { bffPlugin };
@@ -8,7 +8,7 @@ async function loader(source) {
8
8
  delete require.cache[resourcePath];
9
9
  const callback = this.async();
10
10
  const draftOptions = this.getOptions();
11
- const warning = `The file ${resourcePath} is not allowd to be imported in src directory, only API definition files are allowed.`;
11
+ const warning = `The file ${resourcePath} is not allowed to be imported in src directory, only API definition files are allowed.`;
12
12
  if (!draftOptions.existLambda) {
13
13
  logger.warn(warning);
14
14
  callback(null, `throw new Error('${warning}')`);
@@ -38,4 +38,4 @@ async function loader(source) {
38
38
  callback(void 0, result.isOk ? result.value : `throw new Error('${result.value}')`);
39
39
  }
40
40
  const src_loader = loader;
41
- export { src_loader as default };
41
+ export default src_loader;
@@ -1,3 +1,2 @@
1
1
  import "node:module";
2
- import { configure, createRequest, createUploader } from "@modern-js/create-request";
3
- export { configure, createRequest, createUploader };
2
+ export { configure, createRequest, createUploader } from "@modern-js/create-request";
@@ -29,7 +29,7 @@ class HonoAdapter {
29
29
  method,
30
30
  handler,
31
31
  order: 'post',
32
- before
32
+ before: before
33
33
  }));
34
34
  };
35
35
  this.registerApiRoutes = async ()=>{
@@ -89,7 +89,7 @@ class HonoAdapter {
89
89
  path: `${prefix}/*`,
90
90
  method: 'all',
91
91
  order: 'post',
92
- before,
92
+ before: before,
93
93
  handler: async (c, next)=>{
94
94
  if (this.apiServer) {
95
95
  const nodeReq = c.env?.node?.req;
@@ -105,4 +105,4 @@ const server = ()=>({
105
105
  });
106
106
  }
107
107
  });
108
- export { server as default };
108
+ export default server;
@@ -139,7 +139,7 @@ async function copyFiles(from, to) {
139
139
  async function clientGenerator(draftOptions) {
140
140
  const sourceList = await readDirectoryFiles(draftOptions.appDir, draftOptions.lambdaDir, draftOptions.relativeDistPath);
141
141
  const getClitentCode = async (resourcePath, source)=>{
142
- const warning = `The file ${resourcePath} is not allowd to be imported in src directory, only API definition files are allowed.`;
142
+ const warning = `The file ${resourcePath} is not allowed to be imported in src directory, only API definition files are allowed.`;
143
143
  if (!draftOptions.existLambda) return void logger.warn(warning);
144
144
  const options = {
145
145
  prefix: Array.isArray(draftOptions.prefix) ? draftOptions.prefix[0] : draftOptions.prefix,
@@ -173,4 +173,5 @@ async function clientGenerator(draftOptions) {
173
173
  setPackage(sourceList, draftOptions.appDir, draftOptions.relativeDistPath);
174
174
  }
175
175
  const utils_clientGenerator = clientGenerator;
176
- export { copyFiles, utils_clientGenerator as default, readDirectoryFiles };
176
+ export default utils_clientGenerator;
177
+ export { copyFiles, readDirectoryFiles };
@@ -89,4 +89,5 @@ const getHonoInput = async (c)=>{
89
89
  return draft;
90
90
  };
91
91
  const utils_createHonoRoutes = createHonoRoutes;
92
- export { createHonoHandler, utils_createHonoRoutes as default };
92
+ export default utils_createHonoRoutes;
93
+ export { createHonoHandler };
@@ -32,4 +32,5 @@ When using cross-project BFF, you should not configure bff.prefix as it may caus
32
32
  }
33
33
  });
34
34
  const utils_crossProjectApiPlugin = crossProjectApiPlugin;
35
- export { API_DIR, DIST_DIR, LAMBDA_DIR, PACKAGE_NAME, PREFIX, crossProjectApiPlugin, utils_crossProjectApiPlugin as default };
35
+ export default utils_crossProjectApiPlugin;
36
+ export { API_DIR, DIST_DIR, LAMBDA_DIR, PACKAGE_NAME, PREFIX, crossProjectApiPlugin };
@@ -30,4 +30,4 @@ async function pluginGenerator({ prefix, appDirectory, relativeDistPath, relativ
30
30
  }
31
31
  }
32
32
  const utils_pluginGenerator = pluginGenerator;
33
- export { utils_pluginGenerator as default };
33
+ export default utils_pluginGenerator;
@@ -42,4 +42,4 @@ async function runtimeGenerator({ runtime, appDirectory, relativeDistPath, packa
42
42
  await fs.writeFile(pluginTypePath, tsSource);
43
43
  }
44
44
  const utils_runtimeGenerator = runtimeGenerator;
45
- export { utils_runtimeGenerator as default };
45
+ export default utils_runtimeGenerator;
package/package.json CHANGED
@@ -15,7 +15,7 @@
15
15
  "modern",
16
16
  "modern.js"
17
17
  ],
18
- "version": "3.0.5",
18
+ "version": "3.1.1",
19
19
  "types": "./dist/types/cli.d.ts",
20
20
  "main": "./dist/cjs/cli.js",
21
21
  "exports": {
@@ -79,29 +79,29 @@
79
79
  "@swc/helpers": "^0.5.17",
80
80
  "qs": "^6.15.0",
81
81
  "type-is": "^1.6.18",
82
- "@modern-js/bff-core": "3.0.5",
83
- "@modern-js/create-request": "3.0.5",
84
- "@modern-js/builder": "3.0.5",
85
- "@modern-js/server-utils": "3.0.5",
86
- "@modern-js/server-core": "3.0.5",
87
- "@modern-js/utils": "3.0.5"
82
+ "@modern-js/bff-core": "3.1.1",
83
+ "@modern-js/create-request": "3.1.1",
84
+ "@modern-js/server-core": "3.1.1",
85
+ "@modern-js/server-utils": "3.1.1",
86
+ "@modern-js/utils": "3.1.1",
87
+ "@modern-js/builder": "3.1.1"
88
88
  },
89
89
  "devDependencies": {
90
90
  "@rsbuild/core": "2.0.0-beta.4",
91
- "@rslib/core": "0.19.6",
91
+ "@rslib/core": "0.20.0",
92
92
  "@types/node": "^20",
93
93
  "@types/qs": "^6.15.0",
94
94
  "@types/type-is": "^1.6.7",
95
95
  "memfs": "^3.5.3",
96
96
  "typescript": "^5",
97
97
  "zod": "^3.25.76",
98
- "@modern-js/app-tools": "3.0.5",
99
- "@modern-js/bff-runtime": "3.0.5",
100
- "@modern-js/plugin": "3.0.5",
98
+ "@modern-js/app-tools": "3.1.1",
99
+ "@modern-js/bff-runtime": "3.1.1",
100
+ "@modern-js/plugin": "3.1.1",
101
101
  "@modern-js/rslib": "2.68.10",
102
- "@modern-js/runtime": "3.0.5",
102
+ "@modern-js/types": "3.1.1",
103
103
  "@scripts/rstest-config": "2.66.0",
104
- "@modern-js/types": "3.0.5"
104
+ "@modern-js/runtime": "3.1.1"
105
105
  },
106
106
  "sideEffects": false,
107
107
  "publishConfig": {
File without changes