@modern-js/plugin-koa 1.4.8-canary.1 → 1.4.10

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,41 @@
1
1
  # @modern-js/plugin-koa
2
2
 
3
+ ## 1.4.10
4
+
5
+ ### Patch Changes
6
+
7
+ - a1198d509: feat: bump babel 7.18.0
8
+ - Updated dependencies [a1198d509]
9
+ - @modern-js/adapter-helpers@1.2.6
10
+ - @modern-js/bff-runtime@1.2.4
11
+ - @modern-js/bff-utils@1.2.9
12
+
13
+ ## 1.4.9
14
+
15
+ ### Patch Changes
16
+
17
+ - bfccb4c8: fix: bff runtime path not found in development
18
+ - Updated dependencies [d57e7622]
19
+ - Updated dependencies [6451a098]
20
+ - Updated dependencies [d5a2cfd8]
21
+ - Updated dependencies [437367c6]
22
+ - @modern-js/bff-utils@1.2.8
23
+ - @modern-js/utils@1.7.6
24
+
25
+ ## 1.4.8
26
+
27
+ ### Patch Changes
28
+
29
+ - d32f35134: chore: add modern/jest/eslint/ts config files to .npmignore
30
+ - Updated dependencies [d32f35134]
31
+ - Updated dependencies [6ae4a34ae]
32
+ - Updated dependencies [b80229c79]
33
+ - Updated dependencies [948cc4436]
34
+ - @modern-js/adapter-helpers@1.2.4
35
+ - @modern-js/bff-runtime@1.2.3
36
+ - @modern-js/bff-utils@1.2.6
37
+ - @modern-js/utils@1.7.3
38
+
3
39
  ## 1.4.7
4
40
 
5
41
  ### Patch Changes
@@ -1,5 +1,5 @@
1
1
  import * as path from 'path';
2
- import { createRuntimeExportsUtils, TEST_ENV } from '@modern-js/utils';
2
+ import { createRuntimeExportsUtils } from '@modern-js/utils';
3
3
  import { getRelativeRuntimePath } from '@modern-js/adapter-helpers';
4
4
  export default (() => ({
5
5
  name: '@modern-js/plugin-koa',
@@ -16,19 +16,26 @@ export default (() => ({
16
16
  appDirectory
17
17
  } = appContext;
18
18
  bffExportsUtils = createRuntimeExportsUtils(appContext.internalDirectory, 'server');
19
- let serverRuntimePath = bffExportsUtils.getPath(); // Basedir is not a fixed path when the test is executed,so server runtime path must be absolute path.
19
+ const serverRuntimePath = bffExportsUtils.getPath();
20
+ const relativeRuntimePath = getRelativeRuntimePath(appDirectory, serverRuntimePath);
20
21
 
21
- if (process.env.NODE_ENV !== TEST_ENV) {
22
- serverRuntimePath = getRelativeRuntimePath(appDirectory, serverRuntimePath);
23
- }
24
-
25
- return {
26
- source: {
27
- alias: {
28
- '@modern-js/runtime/server': serverRuntimePath
22
+ if (process.env.NODE_ENV === 'production') {
23
+ return {
24
+ source: {
25
+ alias: {
26
+ '@modern-js/runtime/server': relativeRuntimePath
27
+ }
29
28
  }
30
- }
31
- };
29
+ };
30
+ } else {
31
+ return {
32
+ source: {
33
+ alias: {
34
+ '@modern-js/runtime/server': serverRuntimePath
35
+ }
36
+ }
37
+ };
38
+ }
32
39
  },
33
40
 
34
41
  addRuntimeExports(input) {
@@ -30,19 +30,26 @@ var _default = () => ({
30
30
  appDirectory
31
31
  } = appContext;
32
32
  bffExportsUtils = (0, _utils.createRuntimeExportsUtils)(appContext.internalDirectory, 'server');
33
- let serverRuntimePath = bffExportsUtils.getPath(); // Basedir is not a fixed path when the test is executed,so server runtime path must be absolute path.
33
+ const serverRuntimePath = bffExportsUtils.getPath();
34
+ const relativeRuntimePath = (0, _adapterHelpers.getRelativeRuntimePath)(appDirectory, serverRuntimePath);
34
35
 
35
- if (process.env.NODE_ENV !== _utils.TEST_ENV) {
36
- serverRuntimePath = (0, _adapterHelpers.getRelativeRuntimePath)(appDirectory, serverRuntimePath);
37
- }
38
-
39
- return {
40
- source: {
41
- alias: {
42
- '@modern-js/runtime/server': serverRuntimePath
36
+ if (process.env.NODE_ENV === 'production') {
37
+ return {
38
+ source: {
39
+ alias: {
40
+ '@modern-js/runtime/server': relativeRuntimePath
41
+ }
43
42
  }
44
- }
45
- };
43
+ };
44
+ } else {
45
+ return {
46
+ source: {
47
+ alias: {
48
+ '@modern-js/runtime/server': serverRuntimePath
49
+ }
50
+ }
51
+ };
52
+ }
46
53
  },
47
54
 
48
55
  addRuntimeExports(input) {
package/package.json CHANGED
@@ -11,7 +11,7 @@
11
11
  "modern",
12
12
  "modern.js"
13
13
  ],
14
- "version": "1.4.8-canary.1",
14
+ "version": "1.4.10",
15
15
  "jsnext:source": "./src/index.ts",
16
16
  "types": "./dist/types/index.d.ts",
17
17
  "main": "./dist/js/node/index.js",
@@ -33,11 +33,11 @@
33
33
  }
34
34
  },
35
35
  "dependencies": {
36
- "@babel/runtime": "^7.15.3",
37
- "@modern-js/adapter-helpers": "^1.2.3",
38
- "@modern-js/bff-runtime": "^1.2.2",
39
- "@modern-js/bff-utils": "^1.2.5",
40
- "@modern-js/utils": "^1.7.2",
36
+ "@babel/runtime": "^7.18.0",
37
+ "@modern-js/adapter-helpers": "^1.2.6",
38
+ "@modern-js/bff-runtime": "^1.2.4",
39
+ "@modern-js/bff-utils": "^1.2.9",
40
+ "@modern-js/utils": "^1.7.6",
41
41
  "koa-body": "^4.2.0",
42
42
  "koa-router": "^10.0.0",
43
43
  "type-is": "^1.6.18"
@@ -45,15 +45,15 @@
45
45
  "devDependencies": {
46
46
  "@scripts/build": "0.0.0",
47
47
  "@scripts/jest-config": "0.0.0",
48
- "@types/jest": "^27.0.1",
48
+ "@types/jest": "^27",
49
49
  "@types/koa": "^2.13.4",
50
50
  "@types/koa-router": "^7.4.4",
51
51
  "@types/node": "^14",
52
52
  "@types/supertest": "^2.0.11",
53
53
  "@types/type-is": "^1.6.3",
54
54
  "jest": "^27",
55
- "@modern-js/server-core": "1.3.4",
56
- "@modern-js/core": "1.10.1",
55
+ "@modern-js/server-core": "1.3.5",
56
+ "@modern-js/core": "1.11.2",
57
57
  "supertest": "^6.1.6",
58
58
  "koa": "^2.13.3",
59
59
  "typescript": "^4"
@@ -68,8 +68,7 @@
68
68
  },
69
69
  "publishConfig": {
70
70
  "registry": "https://registry.npmjs.org/",
71
- "access": "public",
72
- "types": "./dist/types/index.d.ts"
71
+ "access": "public"
73
72
  },
74
73
  "wireit": {
75
74
  "build": {
@@ -88,7 +87,8 @@
88
87
  "files": [
89
88
  "src/**/*",
90
89
  "tsconfig.json",
91
- "package.json"
90
+ "package.json",
91
+ "tests/**/*"
92
92
  ],
93
93
  "output": []
94
94
  }