@modern-js/plugin-koa 0.0.0-canary-2021101982333 → 0.0.0-runtime-2021112193858
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 +51 -4
- package/dist/js/modern/cli/index.js +12 -1
- package/dist/js/modern/registerRoutes.js +2 -2
- package/dist/js/node/cli/index.js +12 -1
- package/dist/js/node/registerRoutes.js +2 -2
- package/dist/types/cli/index.d.ts +3 -0
- package/package.json +14 -14
- package/src/cli/index.ts +19 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,12 +1,59 @@
|
|
|
1
1
|
# @modern-js/plugin-koa
|
|
2
2
|
|
|
3
|
-
## 0.0.0-
|
|
3
|
+
## 0.0.0-runtime-2021112193858
|
|
4
4
|
|
|
5
5
|
### Patch Changes
|
|
6
6
|
|
|
7
|
-
-
|
|
8
|
-
- Updated dependencies [
|
|
9
|
-
|
|
7
|
+
- 8698465e: fix: dependence version
|
|
8
|
+
- Updated dependencies [8698465e]
|
|
9
|
+
- Updated dependencies [e04914ce]
|
|
10
|
+
- Updated dependencies [e04914ce]
|
|
11
|
+
- @modern-js/core@0.0.0-runtime-2021112193858
|
|
12
|
+
- @modern-js/adapter-helpers@0.0.0-runtime-2021112193858
|
|
13
|
+
- @modern-js/bff-runtime@0.0.0-runtime-2021112193858
|
|
14
|
+
- @modern-js/bff-utils@0.0.0-runtime-2021112193858
|
|
15
|
+
- @modern-js/server-plugin@0.0.0-runtime-2021112193858
|
|
16
|
+
- @modern-js/utils@0.0.0-runtime-2021112193858
|
|
17
|
+
|
|
18
|
+
## 1.1.4
|
|
19
|
+
|
|
20
|
+
### Patch Changes
|
|
21
|
+
|
|
22
|
+
- 529d7fae: fix: runtime path is broken in development environment
|
|
23
|
+
- Updated dependencies [d927bc83]
|
|
24
|
+
- Updated dependencies [d73ff455]
|
|
25
|
+
- Updated dependencies [9c1ab865]
|
|
26
|
+
- Updated dependencies [d73ff455]
|
|
27
|
+
- Updated dependencies [d73ff455]
|
|
28
|
+
- Updated dependencies [d73ff455]
|
|
29
|
+
- Updated dependencies [d73ff455]
|
|
30
|
+
- @modern-js/utils@1.1.4
|
|
31
|
+
- @modern-js/core@1.1.4
|
|
32
|
+
|
|
33
|
+
## 1.1.2
|
|
34
|
+
|
|
35
|
+
### Patch Changes
|
|
36
|
+
|
|
37
|
+
- 0fa83663: support more .env files
|
|
38
|
+
- Updated dependencies [6f7fe574]
|
|
39
|
+
- Updated dependencies [0fa83663]
|
|
40
|
+
- Updated dependencies [f594fbc8]
|
|
41
|
+
- @modern-js/core@1.1.2
|
|
42
|
+
- @modern-js/adapter-helpers@1.1.1
|
|
43
|
+
- @modern-js/bff-runtime@1.1.1
|
|
44
|
+
- @modern-js/bff-utils@1.1.1
|
|
45
|
+
- @modern-js/server-plugin@1.1.1
|
|
46
|
+
- @modern-js/utils@1.1.2
|
|
47
|
+
|
|
48
|
+
## 1.1.1
|
|
49
|
+
|
|
50
|
+
### Patch Changes
|
|
51
|
+
|
|
52
|
+
- 6ffd1a50: Refactor to base on farrow-pipeline
|
|
53
|
+
- Updated dependencies [687c92c7]
|
|
54
|
+
- Updated dependencies [c0fc0700]
|
|
55
|
+
- @modern-js/core@1.1.1
|
|
56
|
+
- @modern-js/utils@1.1.1
|
|
10
57
|
|
|
11
58
|
## 1.1.0
|
|
12
59
|
|
|
@@ -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':
|
|
26
|
+
'@modern-js/runtime/server': relativeRuntimePath
|
|
16
27
|
}
|
|
17
28
|
}
|
|
18
29
|
};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object);
|
|
1
|
+
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
2
2
|
|
|
3
|
-
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]
|
|
3
|
+
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
4
4
|
|
|
5
5
|
function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
6
6
|
|
|
@@ -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':
|
|
40
|
+
'@modern-js/runtime/server': relativeRuntimePath
|
|
30
41
|
}
|
|
31
42
|
}
|
|
32
43
|
};
|
|
@@ -19,9 +19,9 @@ var _utils = require("@modern-js/utils");
|
|
|
19
19
|
|
|
20
20
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
21
21
|
|
|
22
|
-
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object);
|
|
22
|
+
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
23
23
|
|
|
24
|
-
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]
|
|
24
|
+
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
25
25
|
|
|
26
26
|
function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
27
27
|
|
|
@@ -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": "0.0.0-
|
|
14
|
+
"version": "0.0.0-runtime-2021112193858",
|
|
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": "^
|
|
33
|
-
"@modern-js/utils": "^
|
|
32
|
+
"@modern-js/adapter-helpers": "^0.0.0-runtime-2021112193858",
|
|
33
|
+
"@modern-js/utils": "^0.0.0-runtime-2021112193858",
|
|
34
34
|
"formidable": "^1.2.2",
|
|
35
35
|
"koa-body": "^4.2.0",
|
|
36
36
|
"koa-router": "^10.0.0",
|
|
@@ -46,13 +46,13 @@
|
|
|
46
46
|
"@types/supertest": "^2.0.11",
|
|
47
47
|
"@types/type-is": "^1.6.3",
|
|
48
48
|
"supertest": "^6.1.6",
|
|
49
|
-
"typescript": "^4",
|
|
50
|
-
"@modern-js/bff-runtime": "^
|
|
51
|
-
"@modern-js/bff-utils": "^
|
|
52
|
-
"@modern-js/core": "^0.0.0-
|
|
53
|
-
"@modern-js/server-plugin": "^
|
|
54
|
-
"@modern-js/plugin-testing": "^
|
|
55
|
-
"@modern-js/module-tools": "^
|
|
49
|
+
"typescript": "^4.4.4",
|
|
50
|
+
"@modern-js/bff-runtime": "^0.0.0-runtime-2021112193858",
|
|
51
|
+
"@modern-js/bff-utils": "^0.0.0-runtime-2021112193858",
|
|
52
|
+
"@modern-js/core": "^0.0.0-runtime-2021112193858",
|
|
53
|
+
"@modern-js/server-plugin": "^0.0.0-runtime-2021112193858",
|
|
54
|
+
"@modern-js/plugin-testing": "^0.0.0-runtime-2021112193858",
|
|
55
|
+
"@modern-js/module-tools": "^0.0.0-runtime-2021112193858"
|
|
56
56
|
},
|
|
57
57
|
"modernConfig": {
|
|
58
58
|
"output": {
|
|
@@ -60,10 +60,10 @@
|
|
|
60
60
|
}
|
|
61
61
|
},
|
|
62
62
|
"peerDependencies": {
|
|
63
|
-
"@modern-js/bff-utils": "^
|
|
64
|
-
"@modern-js/core": "^0.0.0-
|
|
65
|
-
"@modern-js/server-plugin": "^
|
|
66
|
-
"@modern-js/bff-runtime": "^
|
|
63
|
+
"@modern-js/bff-utils": "^0.0.0-runtime-2021112193858",
|
|
64
|
+
"@modern-js/core": "^0.0.0-runtime-2021112193858",
|
|
65
|
+
"@modern-js/server-plugin": "^0.0.0-runtime-2021112193858",
|
|
66
|
+
"@modern-js/bff-runtime": "^0.0.0-runtime-2021112193858",
|
|
67
67
|
"koa": "^2.13.3"
|
|
68
68
|
},
|
|
69
69
|
"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: {
|
|
37
|
+
alias: {
|
|
38
|
+
'@modern-js/runtime/server': relativeRuntimePath,
|
|
39
|
+
},
|
|
22
40
|
},
|
|
23
41
|
};
|
|
24
42
|
},
|