@modern-js/plugin-express 1.5.4 → 1.5.5-canary.0

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.
@@ -19,13 +19,24 @@ export default (() => ({
19
19
  bffExportsUtils = createRuntimeExportsUtils(appContext.internalDirectory, 'server');
20
20
  const serverRuntimePath = bffExportsUtils.getPath();
21
21
  const relativeRuntimePath = getRelativeRuntimePath(appDirectory, serverRuntimePath);
22
- return {
23
- source: {
24
- alias: {
25
- '@modern-js/runtime/server': relativeRuntimePath
22
+
23
+ if (process.env.NODE_ENV === 'production') {
24
+ return {
25
+ source: {
26
+ alias: {
27
+ '@modern-js/runtime/server': path.join(__dirname, '../runtime')
28
+ }
29
+ }
30
+ };
31
+ } else {
32
+ return {
33
+ source: {
34
+ alias: {
35
+ '@modern-js/runtime/server': serverRuntimePath
36
+ }
26
37
  }
27
- }
28
- };
38
+ };
39
+ }
29
40
  },
30
41
 
31
42
  addRuntimeExports(input) {
@@ -13,7 +13,6 @@ import { createDebugger } from '@modern-js/utils';
13
13
  const debug = createDebugger('express');
14
14
 
15
15
  const registerRoutes = app => {
16
- // eslint-disable-next-line react-hooks/rules-of-hooks
17
16
  const handlerInfos = useAPIHandlerInfos();
18
17
  sortDynamicRoutes(handlerInfos);
19
18
  debug('handlerInfos', handlerInfos);
@@ -33,13 +33,24 @@ var _default = () => ({
33
33
  bffExportsUtils = (0, _utils.createRuntimeExportsUtils)(appContext.internalDirectory, 'server');
34
34
  const serverRuntimePath = bffExportsUtils.getPath();
35
35
  const relativeRuntimePath = (0, _adapterHelpers.getRelativeRuntimePath)(appDirectory, serverRuntimePath);
36
- return {
37
- source: {
38
- alias: {
39
- '@modern-js/runtime/server': relativeRuntimePath
36
+
37
+ if (process.env.NODE_ENV === 'production') {
38
+ return {
39
+ source: {
40
+ alias: {
41
+ '@modern-js/runtime/server': path.join(__dirname, '../runtime')
42
+ }
43
+ }
44
+ };
45
+ } else {
46
+ return {
47
+ source: {
48
+ alias: {
49
+ '@modern-js/runtime/server': serverRuntimePath
50
+ }
40
51
  }
41
- }
42
- };
52
+ };
53
+ }
43
54
  },
44
55
 
45
56
  addRuntimeExports(input) {
@@ -28,7 +28,6 @@ function _defineProperty(obj, key, value) { if (key in obj) { Object.definePrope
28
28
  const debug = (0, _utils.createDebugger)('express');
29
29
 
30
30
  const registerRoutes = app => {
31
- // eslint-disable-next-line react-hooks/rules-of-hooks
32
31
  const handlerInfos = (0, _bffUtils.useAPIHandlerInfos)();
33
32
  (0, _adapterHelpers.sortDynamicRoutes)(handlerInfos);
34
33
  debug('handlerInfos', handlerInfos);
package/package.json CHANGED
@@ -11,7 +11,7 @@
11
11
  "modern",
12
12
  "modern.js"
13
13
  ],
14
- "version": "1.5.4",
14
+ "version": "1.5.5-canary.0",
15
15
  "jsnext:source": "./src/index.ts",
16
16
  "types": "./dist/types/index.d.ts",
17
17
  "main": "./dist/js/node/index.js",
@@ -30,6 +30,10 @@
30
30
  "./cli": {
31
31
  "jsnext:source": "./src/cli/index.ts",
32
32
  "default": "./dist/js/node/cli/index.js"
33
+ },
34
+ "./runtime": {
35
+ "jsnext:source": "./src/runtime.ts",
36
+ "default": "./dist/js/node/runtime.js"
33
37
  }
34
38
  },
35
39
  "dependencies": {
@@ -38,16 +42,16 @@
38
42
  "@modern-js/bff-runtime": "^1.2.3",
39
43
  "@modern-js/bff-utils": "^1.2.6",
40
44
  "@modern-js/types": "^1.5.3",
41
- "@modern-js/utils": "^1.7.3",
45
+ "@modern-js/utils": "^1.7.5",
42
46
  "cookie-parser": "^1.4.5",
43
47
  "finalhandler": "^1.1.2",
44
48
  "formidable": "^1.2.2",
45
49
  "type-is": "^1.6.18"
46
50
  },
47
51
  "devDependencies": {
48
- "@modern-js/core": "1.10.2",
52
+ "@modern-js/core": "1.11.0",
49
53
  "@modern-js/server-core": "1.3.5",
50
- "@modern-js/server-utils": "1.2.6",
54
+ "@modern-js/server-utils": "1.2.9",
51
55
  "@scripts/build": "0.0.0",
52
56
  "@scripts/jest-config": "0.0.0",
53
57
  "@types/cookie-parser": "^1.4.2",
@@ -73,7 +77,8 @@
73
77
  },
74
78
  "publishConfig": {
75
79
  "registry": "https://registry.npmjs.org/",
76
- "access": "public"
80
+ "access": "public",
81
+ "types": "./dist/types/index.d.ts"
77
82
  },
78
83
  "wireit": {
79
84
  "build": {
@@ -92,7 +97,8 @@
92
97
  "files": [
93
98
  "src/**/*",
94
99
  "tsconfig.json",
95
- "package.json"
100
+ "package.json",
101
+ "tests/**/*"
96
102
  ],
97
103
  "output": []
98
104
  }