@modern-js/plugin-koa 1.4.7 → 1.4.8-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.
- package/.wireit/6275696c64/cache/5a7fd1190b57f273bbfc05fc04fa99ef67c54e4eac07712cccd97346c9903534/.wireit/6275696c64/stdout +9 -0
- package/.wireit/6275696c64/cache/5a7fd1190b57f273bbfc05fc04fa99ef67c54e4eac07712cccd97346c9903534/dist/js/modern/cli/index.js +60 -0
- package/.wireit/6275696c64/cache/5a7fd1190b57f273bbfc05fc04fa99ef67c54e4eac07712cccd97346c9903534/dist/js/modern/context.js +6 -0
- package/.wireit/6275696c64/cache/5a7fd1190b57f273bbfc05fc04fa99ef67c54e4eac07712cccd97346c9903534/dist/js/modern/index.js +3 -0
- package/.wireit/6275696c64/cache/5a7fd1190b57f273bbfc05fc04fa99ef67c54e4eac07712cccd97346c9903534/dist/js/modern/plugin.js +129 -0
- package/.wireit/6275696c64/cache/5a7fd1190b57f273bbfc05fc04fa99ef67c54e4eac07712cccd97346c9903534/dist/js/modern/registerRoutes.js +82 -0
- package/.wireit/6275696c64/cache/5a7fd1190b57f273bbfc05fc04fa99ef67c54e4eac07712cccd97346c9903534/dist/js/modern/runtime.js +1 -0
- package/.wireit/6275696c64/cache/5a7fd1190b57f273bbfc05fc04fa99ef67c54e4eac07712cccd97346c9903534/dist/js/node/cli/index.js +76 -0
- package/.wireit/6275696c64/cache/5a7fd1190b57f273bbfc05fc04fa99ef67c54e4eac07712cccd97346c9903534/dist/js/node/context.js +15 -0
- package/.wireit/6275696c64/cache/5a7fd1190b57f273bbfc05fc04fa99ef67c54e4eac07712cccd97346c9903534/dist/js/node/index.js +28 -0
- package/.wireit/6275696c64/cache/5a7fd1190b57f273bbfc05fc04fa99ef67c54e4eac07712cccd97346c9903534/dist/js/node/plugin.js +151 -0
- package/.wireit/6275696c64/cache/5a7fd1190b57f273bbfc05fc04fa99ef67c54e4eac07712cccd97346c9903534/dist/js/node/registerRoutes.js +97 -0
- package/.wireit/6275696c64/cache/5a7fd1190b57f273bbfc05fc04fa99ef67c54e4eac07712cccd97346c9903534/dist/js/node/runtime.js +13 -0
- package/.wireit/6275696c64/cache/a48cd57db6d78fbc9aca74c669a12325d8d6adee3602be60b39b7f0aee775e0e/dist/js/modern/cli/index.js +60 -0
- package/.wireit/6275696c64/cache/a48cd57db6d78fbc9aca74c669a12325d8d6adee3602be60b39b7f0aee775e0e/dist/js/modern/context.js +6 -0
- package/.wireit/6275696c64/cache/a48cd57db6d78fbc9aca74c669a12325d8d6adee3602be60b39b7f0aee775e0e/dist/js/modern/index.js +3 -0
- package/.wireit/6275696c64/cache/a48cd57db6d78fbc9aca74c669a12325d8d6adee3602be60b39b7f0aee775e0e/dist/js/modern/plugin.js +129 -0
- package/.wireit/6275696c64/cache/a48cd57db6d78fbc9aca74c669a12325d8d6adee3602be60b39b7f0aee775e0e/dist/js/modern/registerRoutes.js +82 -0
- package/.wireit/6275696c64/cache/a48cd57db6d78fbc9aca74c669a12325d8d6adee3602be60b39b7f0aee775e0e/dist/js/modern/runtime.js +1 -0
- package/.wireit/6275696c64/cache/a48cd57db6d78fbc9aca74c669a12325d8d6adee3602be60b39b7f0aee775e0e/dist/js/node/cli/index.js +76 -0
- package/.wireit/6275696c64/cache/a48cd57db6d78fbc9aca74c669a12325d8d6adee3602be60b39b7f0aee775e0e/dist/js/node/context.js +15 -0
- package/.wireit/6275696c64/cache/a48cd57db6d78fbc9aca74c669a12325d8d6adee3602be60b39b7f0aee775e0e/dist/js/node/index.js +28 -0
- package/.wireit/6275696c64/cache/a48cd57db6d78fbc9aca74c669a12325d8d6adee3602be60b39b7f0aee775e0e/dist/js/node/plugin.js +151 -0
- package/.wireit/6275696c64/cache/a48cd57db6d78fbc9aca74c669a12325d8d6adee3602be60b39b7f0aee775e0e/dist/js/node/registerRoutes.js +97 -0
- package/.wireit/6275696c64/cache/a48cd57db6d78fbc9aca74c669a12325d8d6adee3602be60b39b7f0aee775e0e/dist/js/node/runtime.js +13 -0
- package/.wireit/6275696c64/cache/c2bcc9f69d6e88cab5556c7e21d2d96caf864704311f42923d5aac9d76903c09/dist/js/modern/cli/index.js +60 -0
- package/.wireit/6275696c64/cache/c2bcc9f69d6e88cab5556c7e21d2d96caf864704311f42923d5aac9d76903c09/dist/js/modern/context.js +6 -0
- package/.wireit/6275696c64/cache/c2bcc9f69d6e88cab5556c7e21d2d96caf864704311f42923d5aac9d76903c09/dist/js/modern/index.js +3 -0
- package/.wireit/6275696c64/cache/c2bcc9f69d6e88cab5556c7e21d2d96caf864704311f42923d5aac9d76903c09/dist/js/modern/plugin.js +129 -0
- package/.wireit/6275696c64/cache/c2bcc9f69d6e88cab5556c7e21d2d96caf864704311f42923d5aac9d76903c09/dist/js/modern/registerRoutes.js +82 -0
- package/.wireit/6275696c64/cache/c2bcc9f69d6e88cab5556c7e21d2d96caf864704311f42923d5aac9d76903c09/dist/js/modern/runtime.js +1 -0
- package/.wireit/6275696c64/cache/c2bcc9f69d6e88cab5556c7e21d2d96caf864704311f42923d5aac9d76903c09/dist/js/node/cli/index.js +76 -0
- package/.wireit/6275696c64/cache/c2bcc9f69d6e88cab5556c7e21d2d96caf864704311f42923d5aac9d76903c09/dist/js/node/context.js +15 -0
- package/.wireit/6275696c64/cache/c2bcc9f69d6e88cab5556c7e21d2d96caf864704311f42923d5aac9d76903c09/dist/js/node/index.js +28 -0
- package/.wireit/6275696c64/cache/c2bcc9f69d6e88cab5556c7e21d2d96caf864704311f42923d5aac9d76903c09/dist/js/node/plugin.js +151 -0
- package/.wireit/6275696c64/cache/c2bcc9f69d6e88cab5556c7e21d2d96caf864704311f42923d5aac9d76903c09/dist/js/node/registerRoutes.js +97 -0
- package/.wireit/6275696c64/cache/c2bcc9f69d6e88cab5556c7e21d2d96caf864704311f42923d5aac9d76903c09/dist/js/node/runtime.js +13 -0
- package/.wireit/6275696c64/cache/c702551e9ac5f99417b3d7904cde2a76ea272e9a04c27fe6afd33e73b7c25856/.wireit/6275696c64/stdout +9 -0
- package/.wireit/6275696c64/cache/c702551e9ac5f99417b3d7904cde2a76ea272e9a04c27fe6afd33e73b7c25856/dist/js/modern/cli/index.js +62 -0
- package/.wireit/6275696c64/cache/c702551e9ac5f99417b3d7904cde2a76ea272e9a04c27fe6afd33e73b7c25856/dist/js/modern/context.js +6 -0
- package/.wireit/6275696c64/cache/c702551e9ac5f99417b3d7904cde2a76ea272e9a04c27fe6afd33e73b7c25856/dist/js/modern/index.js +3 -0
- package/.wireit/6275696c64/cache/c702551e9ac5f99417b3d7904cde2a76ea272e9a04c27fe6afd33e73b7c25856/dist/js/modern/plugin.js +129 -0
- package/.wireit/6275696c64/cache/c702551e9ac5f99417b3d7904cde2a76ea272e9a04c27fe6afd33e73b7c25856/dist/js/modern/registerRoutes.js +82 -0
- package/.wireit/6275696c64/cache/c702551e9ac5f99417b3d7904cde2a76ea272e9a04c27fe6afd33e73b7c25856/dist/js/modern/runtime.js +1 -0
- package/.wireit/6275696c64/cache/c702551e9ac5f99417b3d7904cde2a76ea272e9a04c27fe6afd33e73b7c25856/dist/js/node/cli/index.js +78 -0
- package/.wireit/6275696c64/cache/c702551e9ac5f99417b3d7904cde2a76ea272e9a04c27fe6afd33e73b7c25856/dist/js/node/context.js +15 -0
- package/.wireit/6275696c64/cache/c702551e9ac5f99417b3d7904cde2a76ea272e9a04c27fe6afd33e73b7c25856/dist/js/node/index.js +28 -0
- package/.wireit/6275696c64/cache/c702551e9ac5f99417b3d7904cde2a76ea272e9a04c27fe6afd33e73b7c25856/dist/js/node/plugin.js +151 -0
- package/.wireit/6275696c64/cache/c702551e9ac5f99417b3d7904cde2a76ea272e9a04c27fe6afd33e73b7c25856/dist/js/node/registerRoutes.js +97 -0
- package/.wireit/6275696c64/cache/c702551e9ac5f99417b3d7904cde2a76ea272e9a04c27fe6afd33e73b7c25856/dist/js/node/runtime.js +13 -0
- package/.wireit/6275696c64/cache/fceab7422ff46c3bc400017a31f179fd20fb88539c1968876d37bec188823945/dist/js/modern/cli/index.js +60 -0
- package/.wireit/6275696c64/cache/fceab7422ff46c3bc400017a31f179fd20fb88539c1968876d37bec188823945/dist/js/modern/context.js +6 -0
- package/.wireit/6275696c64/cache/fceab7422ff46c3bc400017a31f179fd20fb88539c1968876d37bec188823945/dist/js/modern/index.js +3 -0
- package/.wireit/6275696c64/cache/fceab7422ff46c3bc400017a31f179fd20fb88539c1968876d37bec188823945/dist/js/modern/plugin.js +129 -0
- package/.wireit/6275696c64/cache/fceab7422ff46c3bc400017a31f179fd20fb88539c1968876d37bec188823945/dist/js/modern/registerRoutes.js +82 -0
- package/.wireit/6275696c64/cache/fceab7422ff46c3bc400017a31f179fd20fb88539c1968876d37bec188823945/dist/js/modern/runtime.js +1 -0
- package/.wireit/6275696c64/cache/fceab7422ff46c3bc400017a31f179fd20fb88539c1968876d37bec188823945/dist/js/node/cli/index.js +76 -0
- package/.wireit/6275696c64/cache/fceab7422ff46c3bc400017a31f179fd20fb88539c1968876d37bec188823945/dist/js/node/context.js +15 -0
- package/.wireit/6275696c64/cache/fceab7422ff46c3bc400017a31f179fd20fb88539c1968876d37bec188823945/dist/js/node/index.js +28 -0
- package/.wireit/6275696c64/cache/fceab7422ff46c3bc400017a31f179fd20fb88539c1968876d37bec188823945/dist/js/node/plugin.js +151 -0
- package/.wireit/6275696c64/cache/fceab7422ff46c3bc400017a31f179fd20fb88539c1968876d37bec188823945/dist/js/node/registerRoutes.js +97 -0
- package/.wireit/6275696c64/cache/fceab7422ff46c3bc400017a31f179fd20fb88539c1968876d37bec188823945/dist/js/node/runtime.js +13 -0
- package/.wireit/6275696c64/lock +0 -0
- package/.wireit/6275696c64/state +1 -0
- package/.wireit/6275696c64/stdout +9 -0
- package/dist/js/modern/cli/index.js +8 -6
- package/dist/js/node/cli/index.js +7 -5
- package/package.json +28 -4
- package/.eslintrc.js +0 -7
- package/jest.config.js +0 -7
- package/modern.config.js +0 -2
- package/tsconfig.json +0 -10
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as path from 'path';
|
|
2
|
-
import { createRuntimeExportsUtils } from '@modern-js/utils';
|
|
2
|
+
import { createRuntimeExportsUtils, TEST_ENV } from '@modern-js/utils';
|
|
3
3
|
import { getRelativeRuntimePath } from '@modern-js/adapter-helpers';
|
|
4
4
|
export default (() => ({
|
|
5
5
|
name: '@modern-js/plugin-koa',
|
|
@@ -11,25 +11,27 @@ export default (() => ({
|
|
|
11
11
|
const runtimeModulePath = path.resolve(__dirname, '../runtime');
|
|
12
12
|
return {
|
|
13
13
|
config() {
|
|
14
|
-
// eslint-disable-next-line react-hooks/rules-of-hooks
|
|
15
14
|
const appContext = useAppContext();
|
|
16
15
|
const {
|
|
17
16
|
appDirectory
|
|
18
17
|
} = appContext;
|
|
19
18
|
bffExportsUtils = createRuntimeExportsUtils(appContext.internalDirectory, 'server');
|
|
20
|
-
|
|
21
|
-
|
|
19
|
+
let serverRuntimePath = bffExportsUtils.getPath(); // Basedir is not a fixed path when the test is executed,so server runtime path must be absolute path.
|
|
20
|
+
|
|
21
|
+
if (process.env.NODE_ENV !== TEST_ENV) {
|
|
22
|
+
serverRuntimePath = getRelativeRuntimePath(appDirectory, serverRuntimePath);
|
|
23
|
+
}
|
|
24
|
+
|
|
22
25
|
return {
|
|
23
26
|
source: {
|
|
24
27
|
alias: {
|
|
25
|
-
'@modern-js/runtime/server':
|
|
28
|
+
'@modern-js/runtime/server': serverRuntimePath
|
|
26
29
|
}
|
|
27
30
|
}
|
|
28
31
|
};
|
|
29
32
|
},
|
|
30
33
|
|
|
31
34
|
addRuntimeExports(input) {
|
|
32
|
-
// eslint-disable-next-line react-hooks/rules-of-hooks
|
|
33
35
|
const {
|
|
34
36
|
appDirectory
|
|
35
37
|
} = useAppContext();
|
|
@@ -25,25 +25,27 @@ var _default = () => ({
|
|
|
25
25
|
const runtimeModulePath = path.resolve(__dirname, '../runtime');
|
|
26
26
|
return {
|
|
27
27
|
config() {
|
|
28
|
-
// eslint-disable-next-line react-hooks/rules-of-hooks
|
|
29
28
|
const appContext = useAppContext();
|
|
30
29
|
const {
|
|
31
30
|
appDirectory
|
|
32
31
|
} = appContext;
|
|
33
32
|
bffExportsUtils = (0, _utils.createRuntimeExportsUtils)(appContext.internalDirectory, 'server');
|
|
34
|
-
|
|
35
|
-
|
|
33
|
+
let serverRuntimePath = bffExportsUtils.getPath(); // Basedir is not a fixed path when the test is executed,so server runtime path must be absolute path.
|
|
34
|
+
|
|
35
|
+
if (process.env.NODE_ENV !== _utils.TEST_ENV) {
|
|
36
|
+
serverRuntimePath = (0, _adapterHelpers.getRelativeRuntimePath)(appDirectory, serverRuntimePath);
|
|
37
|
+
}
|
|
38
|
+
|
|
36
39
|
return {
|
|
37
40
|
source: {
|
|
38
41
|
alias: {
|
|
39
|
-
'@modern-js/runtime/server':
|
|
42
|
+
'@modern-js/runtime/server': serverRuntimePath
|
|
40
43
|
}
|
|
41
44
|
}
|
|
42
45
|
};
|
|
43
46
|
},
|
|
44
47
|
|
|
45
48
|
addRuntimeExports(input) {
|
|
46
|
-
// eslint-disable-next-line react-hooks/rules-of-hooks
|
|
47
49
|
const {
|
|
48
50
|
appDirectory
|
|
49
51
|
} = useAppContext();
|
package/package.json
CHANGED
|
@@ -11,7 +11,7 @@
|
|
|
11
11
|
"modern",
|
|
12
12
|
"modern.js"
|
|
13
13
|
],
|
|
14
|
-
"version": "1.4.
|
|
14
|
+
"version": "1.4.8-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",
|
|
@@ -68,12 +68,36 @@
|
|
|
68
68
|
},
|
|
69
69
|
"publishConfig": {
|
|
70
70
|
"registry": "https://registry.npmjs.org/",
|
|
71
|
-
"access": "public"
|
|
71
|
+
"access": "public",
|
|
72
|
+
"types": "./dist/types/index.d.ts"
|
|
73
|
+
},
|
|
74
|
+
"wireit": {
|
|
75
|
+
"build": {
|
|
76
|
+
"command": "modern build",
|
|
77
|
+
"files": [
|
|
78
|
+
"src/**/*.ts",
|
|
79
|
+
"tsconfig.json",
|
|
80
|
+
"package.json"
|
|
81
|
+
],
|
|
82
|
+
"output": [
|
|
83
|
+
"dist/**/*.js"
|
|
84
|
+
]
|
|
85
|
+
},
|
|
86
|
+
"test": {
|
|
87
|
+
"command": "jest --passWithNoTests",
|
|
88
|
+
"files": [
|
|
89
|
+
"src/**/*.ts",
|
|
90
|
+
"tsconfig.json",
|
|
91
|
+
"package.json"
|
|
92
|
+
],
|
|
93
|
+
"output": []
|
|
94
|
+
}
|
|
72
95
|
},
|
|
73
96
|
"scripts": {
|
|
74
97
|
"new": "modern new",
|
|
75
|
-
"
|
|
76
|
-
"
|
|
98
|
+
"dev": "modern build --watch",
|
|
99
|
+
"build": "wireit",
|
|
100
|
+
"test": "wireit"
|
|
77
101
|
},
|
|
78
102
|
"readme": "\n<p align=\"center\">\n <a href=\"https://modernjs.dev\" target=\"blank\"><img src=\"https://lf3-static.bytednsdoc.com/obj/eden-cn/ylaelkeh7nuhfnuhf/modernjs-cover.png\" width=\"300\" alt=\"Modern.js Logo\" /></a>\n</p>\n<p align=\"center\">\n现代 Web 工程体系\n <br/>\n <a href=\"https://modernjs.dev\" target=\"blank\">\n modernjs.dev\n </a>\n</p>\n<p align=\"center\">\n The meta-framework suite designed from scratch for frontend-focused modern web development\n</p>\n\n# Introduction\n\n> The doc site ([modernjs.dev](https://modernjs.dev)) and articles are only available in Chinese for now, we are planning to add English versions soon.\n\n- [Modern.js: Hello, World!](https://zhuanlan.zhihu.com/p/426707646)\n\n## Getting Started\n\n- [Quick Start](https://modernjs.dev/docs/start)\n- [Guides](https://modernjs.dev/docs/guides)\n- [API References](https://modernjs.dev/docs/apis)\n\n## Contributing\n\n- [Contributing Guide](https://github.com/modern-js-dev/modern.js/blob/main/CONTRIBUTING.md)\n"
|
|
79
103
|
}
|
package/.eslintrc.js
DELETED
package/jest.config.js
DELETED
package/modern.config.js
DELETED