@modern-js/plugin-express 1.1.1 → 1.1.5

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,5 +1,20 @@
1
1
  # @modern-js/plugin-express
2
2
 
3
+ ## 1.1.2
4
+
5
+ ### Patch Changes
6
+
7
+ - 0fa83663: support more .env files
8
+ - Updated dependencies [6f7fe574]
9
+ - Updated dependencies [0fa83663]
10
+ - Updated dependencies [f594fbc8]
11
+ - @modern-js/core@1.1.2
12
+ - @modern-js/adapter-helpers@1.1.1
13
+ - @modern-js/bff-runtime@1.1.1
14
+ - @modern-js/bff-utils@1.1.1
15
+ - @modern-js/server-plugin@1.1.1
16
+ - @modern-js/utils@1.1.2
17
+
3
18
  ## 1.1.1
4
19
 
5
20
  ### Patch Changes
@@ -8,11 +8,22 @@ export default createPlugin(() => {
8
8
  config() {
9
9
  // eslint-disable-next-line react-hooks/rules-of-hooks
10
10
  const appContext = useAppContext();
11
+ const {
12
+ appDirectory
13
+ } = appContext;
11
14
  bffExportsUtils = createRuntimeExportsUtils(appContext.internalDirectory, 'server');
15
+ const serverRuntimePath = bffExportsUtils.getPath(); // Look up one level, because the artifacts after build have dist directories
16
+
17
+ let relativeRuntimePath = path.join('../', path.relative(appDirectory, serverRuntimePath));
18
+
19
+ if (process.env.NODE_ENV === 'development') {
20
+ relativeRuntimePath = `./${path.relative(appDirectory, serverRuntimePath)}`;
21
+ }
22
+
12
23
  return {
13
24
  source: {
14
25
  alias: {
15
- '@modern-js/runtime/server': bffExportsUtils.getPath()
26
+ '@modern-js/runtime/server': relativeRuntimePath
16
27
  }
17
28
  }
18
29
  };
@@ -22,11 +22,22 @@ var _default = (0, _core.createPlugin)(() => {
22
22
  config() {
23
23
  // eslint-disable-next-line react-hooks/rules-of-hooks
24
24
  const appContext = (0, _core.useAppContext)();
25
+ const {
26
+ appDirectory
27
+ } = appContext;
25
28
  bffExportsUtils = (0, _utils.createRuntimeExportsUtils)(appContext.internalDirectory, 'server');
29
+ const serverRuntimePath = bffExportsUtils.getPath(); // Look up one level, because the artifacts after build have dist directories
30
+
31
+ let relativeRuntimePath = path.join('../', path.relative(appDirectory, serverRuntimePath));
32
+
33
+ if (process.env.NODE_ENV === 'development') {
34
+ relativeRuntimePath = `./${path.relative(appDirectory, serverRuntimePath)}`;
35
+ }
36
+
26
37
  return {
27
38
  source: {
28
39
  alias: {
29
- '@modern-js/runtime/server': bffExportsUtils.getPath()
40
+ '@modern-js/runtime/server': relativeRuntimePath
30
41
  }
31
42
  }
32
43
  };
@@ -1,5 +1,8 @@
1
1
  declare const _default: import("@modern-js/core").AsyncPlugin<Partial<import("@modern-js/core").Progresses2Threads<{
2
2
  config: import("@modern-js/core").ParallelWorkflow<void, unknown>;
3
+ resolvedConfig: import("@modern-js/core").AsyncWaterfall<{
4
+ resolved: import("@modern-js/core").NormalizedConfig;
5
+ }>;
3
6
  validateSchema: import("@modern-js/core").ParallelWorkflow<void, unknown>;
4
7
  prepare: import("@modern-js/core").AsyncWorkflow<void, void>;
5
8
  commands: import("@modern-js/core").AsyncWorkflow<{
package/package.json CHANGED
@@ -11,7 +11,7 @@
11
11
  "modern",
12
12
  "modern.js"
13
13
  ],
14
- "version": "1.1.1",
14
+ "version": "1.1.5",
15
15
  "jsnext:source": "./src/index.ts",
16
16
  "types": "./dist/types/index.d.ts",
17
17
  "main": "./dist/js/node/index.js",
@@ -29,8 +29,8 @@
29
29
  },
30
30
  "dependencies": {
31
31
  "@babel/runtime": "^7.15.3",
32
- "@modern-js/adapter-helpers": "^1.1.0",
33
- "@modern-js/utils": "^1.1.1",
32
+ "@modern-js/adapter-helpers": "^1.1.1",
33
+ "@modern-js/utils": "^1.1.2",
34
34
  "cookie-parser": "^1.4.5",
35
35
  "finalhandler": "^1.1.2",
36
36
  "formidable": "^1.2.2",
@@ -38,8 +38,8 @@
38
38
  },
39
39
  "devDependencies": {
40
40
  "express": "^4.17.1",
41
- "@modern-js/server-utils": "^1.1.0",
42
- "@modern-js/bff-runtime": "^1.1.0",
41
+ "@modern-js/server-utils": "^1.1.1",
42
+ "@modern-js/bff-runtime": "^1.1.1",
43
43
  "@types/cookie-parser": "^1.4.2",
44
44
  "@types/express": "^4.17.13",
45
45
  "@types/finalhandler": "^1.1.1",
@@ -50,11 +50,11 @@
50
50
  "@types/type-is": "^1.6.3",
51
51
  "supertest": "^6.1.6",
52
52
  "typescript": "^4",
53
- "@modern-js/bff-utils": "^1.1.0",
54
- "@modern-js/core": "^1.1.1",
55
- "@modern-js/server-plugin": "^1.1.0",
56
- "@modern-js/plugin-testing": "^1.1.0",
57
- "@modern-js/module-tools": "^1.1.0"
53
+ "@modern-js/bff-utils": "^1.1.1",
54
+ "@modern-js/core": "^1.1.2",
55
+ "@modern-js/server-plugin": "^1.1.1",
56
+ "@modern-js/plugin-testing": "^1.1.1",
57
+ "@modern-js/module-tools": "^1.1.1"
58
58
  },
59
59
  "modernConfig": {
60
60
  "output": {
@@ -62,10 +62,10 @@
62
62
  }
63
63
  },
64
64
  "peerDependencies": {
65
- "@modern-js/bff-utils": "^1.1.0",
66
- "@modern-js/core": "^1.1.1",
67
- "@modern-js/server-plugin": "^1.1.0",
68
- "@modern-js/bff-runtime": "^1.1.0",
65
+ "@modern-js/bff-utils": "^1.1.1",
66
+ "@modern-js/core": "^1.1.2",
67
+ "@modern-js/server-plugin": "^1.1.1",
68
+ "@modern-js/bff-runtime": "^1.1.1",
69
69
  "express": "^4.17.1"
70
70
  },
71
71
  "publishConfig": {
package/src/cli/index.ts CHANGED
@@ -11,14 +11,32 @@ export default createPlugin(
11
11
  config() {
12
12
  // eslint-disable-next-line react-hooks/rules-of-hooks
13
13
  const appContext = useAppContext();
14
+ const { appDirectory } = appContext;
14
15
  bffExportsUtils = createRuntimeExportsUtils(
15
16
  appContext.internalDirectory,
16
17
  'server',
17
18
  );
18
19
 
20
+ const serverRuntimePath = bffExportsUtils.getPath();
21
+
22
+ // Look up one level, because the artifacts after build have dist directories
23
+ let relativeRuntimePath = path.join(
24
+ '../',
25
+ path.relative(appDirectory, serverRuntimePath),
26
+ );
27
+
28
+ if (process.env.NODE_ENV === 'development') {
29
+ relativeRuntimePath = `./${path.relative(
30
+ appDirectory,
31
+ serverRuntimePath,
32
+ )}`;
33
+ }
34
+
19
35
  return {
20
36
  source: {
21
- alias: { '@modern-js/runtime/server': bffExportsUtils.getPath() },
37
+ alias: {
38
+ '@modern-js/runtime/server': relativeRuntimePath,
39
+ },
22
40
  },
23
41
  };
24
42
  },