@modern-js/plugin-bff 2.35.0 → 2.35.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.
package/dist/cjs/cli.js CHANGED
@@ -61,12 +61,11 @@ const bffPlugin = () => ({
61
61
  return {
62
62
  tools: {
63
63
  bundlerChain: (chain, { CHAIN_ID, isServer }) => {
64
- var _bff, _bff1, _bff2;
65
64
  const { port, appDirectory, apiDirectory, lambdaDirectory } = api.useAppContext();
66
65
  const modernConfig = api.useResolvedConfigContext();
67
66
  const { bff } = modernConfig || {};
68
- const prefix = ((_bff = bff) === null || _bff === void 0 ? void 0 : _bff.prefix) || DEFAULT_API_PREFIX;
69
- const httpMethodDecider = (_bff1 = bff) === null || _bff1 === void 0 ? void 0 : _bff1.httpMethodDecider;
67
+ const prefix = (bff === null || bff === void 0 ? void 0 : bff.prefix) || DEFAULT_API_PREFIX;
68
+ const httpMethodDecider = bff === null || bff === void 0 ? void 0 : bff.httpMethodDecider;
70
69
  chain.resolve.alias.set("@api", apiDirectory);
71
70
  const apiRouter = new _bffcore.ApiRouter({
72
71
  apiDir: apiDirectory,
@@ -90,7 +89,7 @@ const bffPlugin = () => ({
90
89
  port,
91
90
  target: name,
92
91
  // Internal field
93
- requestCreator: (_bff2 = bff) === null || _bff2 === void 0 ? void 0 : _bff2.requestCreator,
92
+ requestCreator: bff === null || bff === void 0 ? void 0 : bff.requestCreator,
94
93
  httpMethodDecider
95
94
  });
96
95
  }
@@ -104,10 +103,9 @@ const bffPlugin = () => ({
104
103
  };
105
104
  },
106
105
  modifyServerRoutes({ routes }) {
107
- var _bff, _bff1;
108
106
  const modernConfig = api.useResolvedConfigContext();
109
107
  const { bff } = modernConfig || {};
110
- const prefix = ((_bff = bff) === null || _bff === void 0 ? void 0 : _bff.prefix) || "/api";
108
+ const prefix = (bff === null || bff === void 0 ? void 0 : bff.prefix) || "/api";
111
109
  const prefixList = [];
112
110
  if (Array.isArray(prefix)) {
113
111
  prefixList.push(...prefix);
@@ -121,7 +119,7 @@ const bffPlugin = () => ({
121
119
  isSPA: false,
122
120
  isSSR: false
123
121
  }));
124
- if ((_bff1 = bff) === null || _bff1 === void 0 ? void 0 : _bff1.enableHandleWeb) {
122
+ if (bff === null || bff === void 0 ? void 0 : bff.enableHandleWeb) {
125
123
  return {
126
124
  routes: routes.map((route) => {
127
125
  return {
package/dist/esm/cli.js CHANGED
@@ -48,12 +48,11 @@ export var bffPlugin = function() {
48
48
  tools: {
49
49
  bundlerChain: function(chain, param) {
50
50
  var CHAIN_ID = param.CHAIN_ID, isServer = param.isServer;
51
- var _bff, _bff1, _bff2;
52
51
  var _api_useAppContext = api.useAppContext(), port = _api_useAppContext.port, appDirectory = _api_useAppContext.appDirectory, apiDirectory = _api_useAppContext.apiDirectory, lambdaDirectory = _api_useAppContext.lambdaDirectory;
53
52
  var modernConfig = api.useResolvedConfigContext();
54
53
  var bff = (modernConfig || {}).bff;
55
- var prefix = ((_bff = bff) === null || _bff === void 0 ? void 0 : _bff.prefix) || DEFAULT_API_PREFIX;
56
- var httpMethodDecider = (_bff1 = bff) === null || _bff1 === void 0 ? void 0 : _bff1.httpMethodDecider;
54
+ var prefix = (bff === null || bff === void 0 ? void 0 : bff.prefix) || DEFAULT_API_PREFIX;
55
+ var httpMethodDecider = bff === null || bff === void 0 ? void 0 : bff.httpMethodDecider;
57
56
  chain.resolve.alias.set("@api", apiDirectory);
58
57
  var apiRouter = new ApiRouter({
59
58
  apiDir: apiDirectory,
@@ -77,7 +76,7 @@ export var bffPlugin = function() {
77
76
  port: port,
78
77
  target: name,
79
78
  // Internal field
80
- requestCreator: (_bff2 = bff) === null || _bff2 === void 0 ? void 0 : _bff2.requestCreator,
79
+ requestCreator: bff === null || bff === void 0 ? void 0 : bff.requestCreator,
81
80
  httpMethodDecider: httpMethodDecider
82
81
  });
83
82
  }
@@ -92,10 +91,9 @@ export var bffPlugin = function() {
92
91
  },
93
92
  modifyServerRoutes: function modifyServerRoutes(param) {
94
93
  var routes = param.routes;
95
- var _bff, _bff1;
96
94
  var modernConfig = api.useResolvedConfigContext();
97
95
  var bff = (modernConfig || {}).bff;
98
- var prefix = ((_bff = bff) === null || _bff === void 0 ? void 0 : _bff.prefix) || "/api";
96
+ var prefix = (bff === null || bff === void 0 ? void 0 : bff.prefix) || "/api";
99
97
  var prefixList = [];
100
98
  if (Array.isArray(prefix)) {
101
99
  var _prefixList;
@@ -112,7 +110,7 @@ export var bffPlugin = function() {
112
110
  isSSR: false
113
111
  };
114
112
  });
115
- if ((_bff1 = bff) === null || _bff1 === void 0 ? void 0 : _bff1.enableHandleWeb) {
113
+ if (bff === null || bff === void 0 ? void 0 : bff.enableHandleWeb) {
116
114
  return {
117
115
  routes: routes.map(function(route) {
118
116
  return _object_spread_props(_object_spread({}, route), {
@@ -41,12 +41,11 @@ export const bffPlugin = () => ({
41
41
  return {
42
42
  tools: {
43
43
  bundlerChain: (chain, { CHAIN_ID, isServer }) => {
44
- var _bff, _bff1, _bff2;
45
44
  const { port, appDirectory, apiDirectory, lambdaDirectory } = api.useAppContext();
46
45
  const modernConfig = api.useResolvedConfigContext();
47
46
  const { bff } = modernConfig || {};
48
- const prefix = ((_bff = bff) === null || _bff === void 0 ? void 0 : _bff.prefix) || DEFAULT_API_PREFIX;
49
- const httpMethodDecider = (_bff1 = bff) === null || _bff1 === void 0 ? void 0 : _bff1.httpMethodDecider;
47
+ const prefix = (bff === null || bff === void 0 ? void 0 : bff.prefix) || DEFAULT_API_PREFIX;
48
+ const httpMethodDecider = bff === null || bff === void 0 ? void 0 : bff.httpMethodDecider;
50
49
  chain.resolve.alias.set("@api", apiDirectory);
51
50
  const apiRouter = new ApiRouter({
52
51
  apiDir: apiDirectory,
@@ -70,7 +69,7 @@ export const bffPlugin = () => ({
70
69
  port,
71
70
  target: name,
72
71
  // Internal field
73
- requestCreator: (_bff2 = bff) === null || _bff2 === void 0 ? void 0 : _bff2.requestCreator,
72
+ requestCreator: bff === null || bff === void 0 ? void 0 : bff.requestCreator,
74
73
  httpMethodDecider
75
74
  });
76
75
  }
@@ -84,10 +83,9 @@ export const bffPlugin = () => ({
84
83
  };
85
84
  },
86
85
  modifyServerRoutes({ routes }) {
87
- var _bff, _bff1;
88
86
  const modernConfig = api.useResolvedConfigContext();
89
87
  const { bff } = modernConfig || {};
90
- const prefix = ((_bff = bff) === null || _bff === void 0 ? void 0 : _bff.prefix) || "/api";
88
+ const prefix = (bff === null || bff === void 0 ? void 0 : bff.prefix) || "/api";
91
89
  const prefixList = [];
92
90
  if (Array.isArray(prefix)) {
93
91
  prefixList.push(...prefix);
@@ -101,7 +99,7 @@ export const bffPlugin = () => ({
101
99
  isSPA: false,
102
100
  isSSR: false
103
101
  }));
104
- if ((_bff1 = bff) === null || _bff1 === void 0 ? void 0 : _bff1.enableHandleWeb) {
102
+ if (bff === null || bff === void 0 ? void 0 : bff.enableHandleWeb) {
105
103
  return {
106
104
  routes: routes.map((route) => {
107
105
  return {
package/package.json CHANGED
@@ -15,7 +15,7 @@
15
15
  "modern",
16
16
  "modern.js"
17
17
  ],
18
- "version": "2.35.0",
18
+ "version": "2.35.1",
19
19
  "jsnext:source": "./src/cli.ts",
20
20
  "types": "./dist/types/cli.d.ts",
21
21
  "main": "./dist/cjs/cli.js",
@@ -57,10 +57,10 @@
57
57
  "dependencies": {
58
58
  "@babel/core": "^7.22.15",
59
59
  "@swc/helpers": "0.5.1",
60
- "@modern-js/create-request": "2.35.0",
61
- "@modern-js/bff-core": "2.35.0",
62
- "@modern-js/server-utils": "2.35.0",
63
- "@modern-js/utils": "2.35.0"
60
+ "@modern-js/create-request": "2.35.1",
61
+ "@modern-js/bff-core": "2.35.1",
62
+ "@modern-js/server-utils": "2.35.1",
63
+ "@modern-js/utils": "2.35.1"
64
64
  },
65
65
  "devDependencies": {
66
66
  "@types/babel__core": "^7.20.0",
@@ -71,14 +71,14 @@
71
71
  "ts-jest": "^29.1.0",
72
72
  "typescript": "^5",
73
73
  "webpack": "^5.88.1",
74
- "@modern-js/runtime": "2.35.0",
75
- "@modern-js/core": "2.35.0",
76
- "@modern-js/bff-runtime": "2.35.0",
77
- "@modern-js/server-core": "2.35.0",
78
- "@modern-js/types": "2.35.0",
79
- "@modern-js/app-tools": "2.35.0",
80
- "@scripts/jest-config": "2.35.0",
81
- "@scripts/build": "2.35.0"
74
+ "@modern-js/runtime": "2.35.1",
75
+ "@modern-js/core": "2.35.1",
76
+ "@modern-js/bff-runtime": "2.35.1",
77
+ "@modern-js/server-core": "2.35.1",
78
+ "@modern-js/types": "2.35.1",
79
+ "@modern-js/app-tools": "2.35.1",
80
+ "@scripts/build": "2.35.1",
81
+ "@scripts/jest-config": "2.35.1"
82
82
  },
83
83
  "sideEffects": false,
84
84
  "publishConfig": {