@modern-js/plugin-koa 1.0.0-rc.2 → 1.0.0-rc.23

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 ADDED
@@ -0,0 +1,354 @@
1
+ # @modern-js/plugin-koa
2
+
3
+ ## 1.0.0-rc.23
4
+
5
+ ### Patch Changes
6
+
7
+ - 224f7fe: fix server route match
8
+ - 30ac27c: feat: add generator package description
9
+ - 0fd196e: feat: fix bugs
10
+ - 204c626: feat: initial
11
+ - 63be0a5: fix: #118 #104
12
+ - Updated dependencies [224f7fe]
13
+ - Updated dependencies [30ac27c]
14
+ - Updated dependencies [0fd196e]
15
+ - Updated dependencies [204c626]
16
+ - Updated dependencies [63be0a5]
17
+ - @modern-js/core@1.0.0-rc.23
18
+ - @modern-js/adapter-helpers@1.0.0-rc.23
19
+ - @modern-js/bff-runtime@1.0.0-rc.23
20
+ - @modern-js/bff-utils@1.0.0-rc.23
21
+ - @modern-js/server-plugin@1.0.0-rc.23
22
+ - @modern-js/utils@1.0.0-rc.23
23
+
24
+ ## 1.0.0-rc.22
25
+
26
+ ### Patch Changes
27
+
28
+ - 224f7fe: fix server route match
29
+ - 30ac27c: feat: add generator package description
30
+ - 0fd196e: feat: fix bugs
31
+ - 204c626: feat: initial
32
+ - 63be0a5: fix: #118 #104
33
+ - Updated dependencies [224f7fe]
34
+ - Updated dependencies [30ac27c]
35
+ - Updated dependencies [0fd196e]
36
+ - Updated dependencies [204c626]
37
+ - Updated dependencies [63be0a5]
38
+ - @modern-js/core@1.0.0-rc.22
39
+ - @modern-js/adapter-helpers@1.0.0-rc.22
40
+ - @modern-js/bff-runtime@1.0.0-rc.22
41
+ - @modern-js/bff-utils@1.0.0-rc.22
42
+ - @modern-js/server-plugin@1.0.0-rc.22
43
+ - @modern-js/utils@1.0.0-rc.22
44
+
45
+ ## 1.0.0-rc.21
46
+
47
+ ### Patch Changes
48
+
49
+ - 224f7fe: fix server route match
50
+ - 30ac27c: feat: add generator package description
51
+ - 0fd196e: feat: fix bugs
52
+ - 204c626: feat: initial
53
+ - 63be0a5: fix: #118 #104
54
+ - Updated dependencies [224f7fe]
55
+ - Updated dependencies [30ac27c]
56
+ - Updated dependencies [0fd196e]
57
+ - Updated dependencies [204c626]
58
+ - Updated dependencies [63be0a5]
59
+ - @modern-js/core@1.0.0-rc.21
60
+ - @modern-js/adapter-helpers@1.0.0-rc.21
61
+ - @modern-js/bff-runtime@1.0.0-rc.21
62
+ - @modern-js/bff-utils@1.0.0-rc.21
63
+ - @modern-js/server-plugin@1.0.0-rc.21
64
+ - @modern-js/utils@1.0.0-rc.21
65
+
66
+ ## 1.0.0-rc.20
67
+
68
+ ### Patch Changes
69
+
70
+ - 224f7fe: fix server route match
71
+ - 30ac27c: feat: add generator package description
72
+ - feat: fix bugs
73
+ - 204c626: feat: initial
74
+ - 63be0a5: fix: #118 #104
75
+ - Updated dependencies [224f7fe]
76
+ - Updated dependencies [30ac27c]
77
+ - Updated dependencies [undefined]
78
+ - Updated dependencies [204c626]
79
+ - Updated dependencies [63be0a5]
80
+ - @modern-js/core@1.0.0-rc.20
81
+ - @modern-js/adapter-helpers@1.0.0-rc.20
82
+ - @modern-js/bff-runtime@1.0.0-rc.20
83
+ - @modern-js/bff-utils@1.0.0-rc.20
84
+ - @modern-js/server-plugin@1.0.0-rc.20
85
+ - @modern-js/utils@1.0.0-rc.20
86
+
87
+ ## 1.0.0-rc.19
88
+
89
+ ### Patch Changes
90
+
91
+ - 224f7fe: fix server route match
92
+ - 30ac27c: feat: add generator package description
93
+ - 204c626: feat: initial
94
+ - 63be0a5: fix: #118 #104
95
+ - Updated dependencies [224f7fe]
96
+ - Updated dependencies [30ac27c]
97
+ - Updated dependencies [204c626]
98
+ - Updated dependencies [63be0a5]
99
+ - @modern-js/core@1.0.0-rc.19
100
+ - @modern-js/adapter-helpers@1.0.0-rc.19
101
+ - @modern-js/bff-runtime@1.0.0-rc.19
102
+ - @modern-js/bff-utils@1.0.0-rc.19
103
+ - @modern-js/server-plugin@1.0.0-rc.19
104
+ - @modern-js/utils@1.0.0-rc.19
105
+
106
+ ## 1.0.0-rc.18
107
+
108
+ ### Patch Changes
109
+
110
+ - 224f7fe: fix server route match
111
+ - 30ac27c: feat: add generator package description
112
+ - 204c626: feat: initial
113
+ - 63be0a5: fix: #118 #104
114
+ - Updated dependencies [224f7fe]
115
+ - Updated dependencies [30ac27c]
116
+ - Updated dependencies [204c626]
117
+ - Updated dependencies [63be0a5]
118
+ - @modern-js/core@1.0.0-rc.18
119
+ - @modern-js/adapter-helpers@1.0.0-rc.18
120
+ - @modern-js/bff-runtime@1.0.0-rc.18
121
+ - @modern-js/bff-utils@1.0.0-rc.18
122
+ - @modern-js/server-plugin@1.0.0-rc.18
123
+ - @modern-js/utils@1.0.0-rc.18
124
+
125
+ ## 1.0.0-rc.17
126
+
127
+ ### Patch Changes
128
+
129
+ - 224f7fe: fix server route match
130
+ - 30ac27c: feat: add generator package description
131
+ - 204c626: feat: initial
132
+ - fix: #118 #104
133
+ - Updated dependencies [224f7fe]
134
+ - Updated dependencies [30ac27c]
135
+ - Updated dependencies [204c626]
136
+ - Updated dependencies [undefined]
137
+ - @modern-js/core@1.0.0-rc.17
138
+ - @modern-js/adapter-helpers@1.0.0-rc.17
139
+ - @modern-js/bff-runtime@1.0.0-rc.17
140
+ - @modern-js/bff-utils@1.0.0-rc.17
141
+ - @modern-js/server-plugin@1.0.0-rc.17
142
+ - @modern-js/utils@1.0.0-rc.17
143
+
144
+ ## 1.0.0-rc.16
145
+
146
+ ### Patch Changes
147
+
148
+ - 224f7fe: fix server route match
149
+ - 30ac27c: feat: add generator package description
150
+ - 204c626: feat: initial
151
+ - Updated dependencies [224f7fe]
152
+ - Updated dependencies [30ac27c]
153
+ - Updated dependencies [204c626]
154
+ - @modern-js/core@1.0.0-rc.16
155
+ - @modern-js/adapter-helpers@1.0.0-rc.16
156
+ - @modern-js/bff-runtime@1.0.0-rc.16
157
+ - @modern-js/bff-utils@1.0.0-rc.16
158
+ - @modern-js/server-plugin@1.0.0-rc.16
159
+ - @modern-js/utils@1.0.0-rc.16
160
+
161
+ ## 1.0.0-rc.15
162
+
163
+ ### Patch Changes
164
+
165
+ - 224f7fe: fix server route match
166
+ - 30ac27c: feat: add generator package description
167
+ - 204c626: feat: initial
168
+ - Updated dependencies [224f7fe]
169
+ - Updated dependencies [30ac27c]
170
+ - Updated dependencies [204c626]
171
+ - @modern-js/core@1.0.0-rc.15
172
+ - @modern-js/adapter-helpers@1.0.0-rc.15
173
+ - @modern-js/bff-runtime@1.0.0-rc.15
174
+ - @modern-js/bff-utils@1.0.0-rc.15
175
+ - @modern-js/server-plugin@1.0.0-rc.15
176
+ - @modern-js/utils@1.0.0-rc.15
177
+
178
+ ## 1.0.0-rc.14
179
+
180
+ ### Patch Changes
181
+
182
+ - 224f7fe: fix server route match
183
+ - 204c626: feat: initial
184
+ - Updated dependencies [224f7fe]
185
+ - Updated dependencies [204c626]
186
+ - @modern-js/core@1.0.0-rc.14
187
+ - @modern-js/adapter-helpers@1.0.0-rc.14
188
+ - @modern-js/bff-runtime@1.0.0-rc.14
189
+ - @modern-js/bff-utils@1.0.0-rc.14
190
+ - @modern-js/server-plugin@1.0.0-rc.14
191
+ - @modern-js/utils@1.0.0-rc.14
192
+
193
+ ## 1.0.0-rc.13
194
+
195
+ ### Patch Changes
196
+
197
+ - 224f7fe: fix server route match
198
+ - 204c626: feat: initial
199
+ - Updated dependencies [224f7fe]
200
+ - Updated dependencies [204c626]
201
+ - @modern-js/core@1.0.0-rc.13
202
+ - @modern-js/adapter-helpers@1.0.0-rc.13
203
+ - @modern-js/bff-runtime@1.0.0-rc.13
204
+ - @modern-js/bff-utils@1.0.0-rc.13
205
+ - @modern-js/server-plugin@1.0.0-rc.13
206
+ - @modern-js/utils@1.0.0-rc.13
207
+
208
+ ## 1.0.0-rc.12
209
+
210
+ ### Patch Changes
211
+
212
+ - 224f7fe: fix server route match
213
+ - 204c626: feat: initial
214
+ - Updated dependencies [224f7fe]
215
+ - Updated dependencies [204c626]
216
+ - @modern-js/core@1.0.0-rc.12
217
+ - @modern-js/adapter-helpers@1.0.0-rc.12
218
+ - @modern-js/bff-runtime@1.0.0-rc.12
219
+ - @modern-js/bff-utils@1.0.0-rc.12
220
+ - @modern-js/server-plugin@1.0.0-rc.12
221
+ - @modern-js/utils@1.0.0-rc.12
222
+
223
+ ## 1.0.0-rc.11
224
+
225
+ ### Patch Changes
226
+
227
+ - 224f7fe: fix server route match
228
+ - 204c626: feat: initial
229
+ - Updated dependencies [224f7fe]
230
+ - Updated dependencies [204c626]
231
+ - @modern-js/core@1.0.0-rc.11
232
+ - @modern-js/adapter-helpers@1.0.0-rc.11
233
+ - @modern-js/bff-runtime@1.0.0-rc.11
234
+ - @modern-js/bff-utils@1.0.0-rc.11
235
+ - @modern-js/server-plugin@1.0.0-rc.11
236
+ - @modern-js/utils@1.0.0-rc.11
237
+
238
+ ## 1.0.0-rc.10
239
+
240
+ ### Patch Changes
241
+
242
+ - 224f7fe: fix server route match
243
+ - 204c626: feat: initial
244
+ - Updated dependencies [224f7fe]
245
+ - Updated dependencies [204c626]
246
+ - @modern-js/core@1.0.0-rc.10
247
+ - @modern-js/adapter-helpers@1.0.0-rc.10
248
+ - @modern-js/bff-runtime@1.0.0-rc.10
249
+ - @modern-js/bff-utils@1.0.0-rc.10
250
+ - @modern-js/server-plugin@1.0.0-rc.10
251
+ - @modern-js/utils@1.0.0-rc.10
252
+
253
+ ## 1.0.0-rc.9
254
+
255
+ ### Patch Changes
256
+
257
+ - 224f7fe: fix server route match
258
+ - 204c626: feat: initial
259
+ - Updated dependencies [224f7fe]
260
+ - Updated dependencies [204c626]
261
+ - @modern-js/core@1.0.0-rc.9
262
+ - @modern-js/adapter-helpers@1.0.0-rc.9
263
+ - @modern-js/bff-runtime@1.0.0-rc.9
264
+ - @modern-js/bff-utils@1.0.0-rc.9
265
+ - @modern-js/server-plugin@1.0.0-rc.9
266
+ - @modern-js/utils@1.0.0-rc.9
267
+
268
+ ## 1.0.0-rc.8
269
+
270
+ ### Patch Changes
271
+
272
+ - 224f7fe: fix server route match
273
+ - 204c626: feat: initial
274
+ - Updated dependencies [224f7fe]
275
+ - Updated dependencies [204c626]
276
+ - @modern-js/core@1.0.0-rc.8
277
+ - @modern-js/adapter-helpers@1.0.0-rc.8
278
+ - @modern-js/bff-runtime@1.0.0-rc.8
279
+ - @modern-js/bff-utils@1.0.0-rc.8
280
+ - @modern-js/server-plugin@1.0.0-rc.8
281
+ - @modern-js/utils@1.0.0-rc.8
282
+
283
+ ## 1.0.0-rc.7
284
+
285
+ ### Patch Changes
286
+
287
+ - 224f7fe: fix server route match
288
+ - 204c626: feat: initial
289
+ - Updated dependencies [224f7fe]
290
+ - Updated dependencies [204c626]
291
+ - @modern-js/core@1.0.0-rc.7
292
+ - @modern-js/adapter-helpers@1.0.0-rc.7
293
+ - @modern-js/bff-runtime@1.0.0-rc.7
294
+ - @modern-js/bff-utils@1.0.0-rc.7
295
+ - @modern-js/server-plugin@1.0.0-rc.7
296
+ - @modern-js/utils@1.0.0-rc.7
297
+
298
+ ## 1.0.0-rc.6
299
+
300
+ ### Patch Changes
301
+
302
+ - 224f7fe: fix server route match
303
+ - 204c626: feat: initial
304
+ - Updated dependencies [224f7fe]
305
+ - Updated dependencies [204c626]
306
+ - @modern-js/core@1.0.0-rc.6
307
+ - @modern-js/adapter-helpers@1.0.0-rc.6
308
+ - @modern-js/bff-runtime@1.0.0-rc.6
309
+ - @modern-js/bff-utils@1.0.0-rc.6
310
+ - @modern-js/server-plugin@1.0.0-rc.6
311
+ - @modern-js/utils@1.0.0-rc.6
312
+
313
+ ## 1.0.0-rc.5
314
+
315
+ ### Patch Changes
316
+
317
+ - 224f7fe: fix server route match
318
+ - 204c626: feat: initial
319
+ - Updated dependencies [224f7fe]
320
+ - Updated dependencies [204c626]
321
+ - @modern-js/core@1.0.0-rc.5
322
+ - @modern-js/adapter-helpers@1.0.0-rc.5
323
+ - @modern-js/bff-runtime@1.0.0-rc.5
324
+ - @modern-js/bff-utils@1.0.0-rc.5
325
+ - @modern-js/server-plugin@1.0.0-rc.5
326
+ - @modern-js/utils@1.0.0-rc.5
327
+
328
+ ## 1.0.0-rc.4
329
+
330
+ ### Patch Changes
331
+
332
+ - fix server route match
333
+ - 204c626: feat: initial
334
+ - Updated dependencies [undefined]
335
+ - Updated dependencies [204c626]
336
+ - @modern-js/core@1.0.0-rc.4
337
+ - @modern-js/adapter-helpers@1.0.0-rc.4
338
+ - @modern-js/bff-runtime@1.0.0-rc.4
339
+ - @modern-js/bff-utils@1.0.0-rc.4
340
+ - @modern-js/server-plugin@1.0.0-rc.4
341
+ - @modern-js/utils@1.0.0-rc.4
342
+
343
+ ## 1.0.0-rc.3
344
+
345
+ ### Patch Changes
346
+
347
+ - feat: initial
348
+ - Updated dependencies [undefined]
349
+ - @modern-js/core@1.0.0-rc.3
350
+ - @modern-js/adapter-helpers@1.0.0-rc.3
351
+ - @modern-js/bff-runtime@1.0.0-rc.3
352
+ - @modern-js/bff-utils@1.0.0-rc.3
353
+ - @modern-js/server-plugin@1.0.0-rc.3
354
+ - @modern-js/utils@1.0.0-rc.3
package/README.md CHANGED
@@ -1,32 +1,33 @@
1
1
 
2
2
  <p align="center">
3
- <a href="https://modernjs.dev" target="blank"><img src="https://lf3-static.bytednsdoc.com/obj/eden-cn/ylaelkeh7nuhfnuhf/modernjs.png" width="300" alt="Modern.js Logo" /></a>
3
+ <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>
4
4
  </p>
5
+ <p align="center">
6
+ 现代 Web 工程体系
7
+ <br/>
8
+ <a href="https://modernjs.dev" target="blank">
9
+ modernjs.dev
10
+ </a>
11
+ </p>
12
+ <p align="center">
13
+ The meta-framework suite designed from scratch for frontend-focused modern web development
14
+ </p>
15
+
16
+ # Introduction
5
17
 
6
- <p align="center">现代 Web 工程体系</p>
18
+ > 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.
7
19
 
8
- ## 背景
20
+ - 介绍 Modern.js (即将上线)
9
21
  - [迈入现代 Web 开发](https://zhuanlan.zhihu.com/p/386607009)
10
22
  - [现代 Web 开发者问卷调查报告](https://zhuanlan.zhihu.com/p/403206195)
23
+ - [字节跳动是如何落地微前端的](https://mp.weixin.qq.com/s/L9wbfNG5fTXF5bx7dcgj4Q)
11
24
 
12
- ## 计划
13
-
14
- Modern.js 的 1.0.0.rc 版已经发到 npm,目前在做测试改进,README 文档之后统一提供(现阶段加入测试和开发,可以发 [issue](https://github.com/modern-js-dev/modern.js/issues) 留微信联系),完整的文档站计划在10月14日上线
15
-
16
-
17
-
18
-
19
-
20
-
21
-
22
-
23
-
24
-
25
-
26
-
27
-
28
-
29
-
25
+ ## Getting Started
30
26
 
27
+ - [Quick Start](https://modernjs.dev/docs/start)
28
+ - [Guides](https://modernjs.dev/docs/guides)
29
+ - [API References](https://modernjs.dev/docs/apis)
31
30
 
31
+ ## Contributing
32
32
 
33
+ - [Contributing Guide](https://github.com/modern-js-dev/modern.js/blob/main/CONTRIBUTING.md)
@@ -1,15 +1,13 @@
1
1
  import * as path from 'path';
2
2
  import { useAppContext, createPlugin } from '@modern-js/core';
3
- import { createRuntimeExportsUtils } from '@modern-js/utils';
3
+ import { createRuntimeExportsUtils, upath } from '@modern-js/utils';
4
4
  export default createPlugin(() => {
5
5
  let bffExportsUtils;
6
6
  const runtimeModulePath = path.resolve(__dirname, '../runtime');
7
7
  return {
8
8
  config() {
9
9
  // eslint-disable-next-line react-hooks/rules-of-hooks
10
- const {
11
- value: appContext
12
- } = useAppContext();
10
+ const appContext = useAppContext();
13
11
  bffExportsUtils = createRuntimeExportsUtils(appContext.internalDirectory, 'server');
14
12
  return {
15
13
  source: {
@@ -21,17 +19,13 @@ export default createPlugin(() => {
21
19
  },
22
20
 
23
21
  modifyEntryImports() {
22
+ // eslint-disable-next-line react-hooks/rules-of-hooks
24
23
  const {
25
- value: {
26
- appDirectory
27
- } // eslint-disable-next-line react-hooks/rules-of-hooks
28
-
24
+ appDirectory
29
25
  } = useAppContext();
30
-
31
- const runtimePath = require.resolve(`@modern-js/runtime`, {
26
+ const runtimePath = upath.normalizeSafe(require.resolve(`@modern-js/runtime`, {
32
27
  paths: [appDirectory]
33
- });
34
-
28
+ }));
35
29
  const currentFile = bffExportsUtils.getPath();
36
30
  const runtimeDir = path.dirname(runtimePath);
37
31
  const relativeBffPath = path.relative(path.dirname(currentFile), path.join(runtimeDir, './exports/server'));
@@ -21,9 +21,7 @@ var _default = (0, _core.createPlugin)(() => {
21
21
  return {
22
22
  config() {
23
23
  // eslint-disable-next-line react-hooks/rules-of-hooks
24
- const {
25
- value: appContext
26
- } = (0, _core.useAppContext)();
24
+ const appContext = (0, _core.useAppContext)();
27
25
  bffExportsUtils = (0, _utils.createRuntimeExportsUtils)(appContext.internalDirectory, 'server');
28
26
  return {
29
27
  source: {
@@ -35,16 +33,14 @@ var _default = (0, _core.createPlugin)(() => {
35
33
  },
36
34
 
37
35
  modifyEntryImports() {
36
+ // eslint-disable-next-line react-hooks/rules-of-hooks
38
37
  const {
39
- value: {
40
- appDirectory
41
- } // eslint-disable-next-line react-hooks/rules-of-hooks
42
-
38
+ appDirectory
43
39
  } = (0, _core.useAppContext)();
44
40
 
45
- const runtimePath = require.resolve(`@modern-js/runtime`, {
41
+ const runtimePath = _utils.upath.normalizeSafe(require.resolve(`@modern-js/runtime`, {
46
42
  paths: [appDirectory]
47
- });
43
+ }));
48
44
 
49
45
  const currentFile = bffExportsUtils.getPath();
50
46
  const runtimeDir = path.dirname(runtimePath);
@@ -1,15 +1,15 @@
1
- declare const _default: import("@modern-js/plugin").AsyncPlugin<Partial<import("@modern-js/plugin").Progresses2Threads<{
2
- config: import("@modern-js/plugin").ParallelWorkflow<void, unknown>;
3
- validateSchema: import("@modern-js/plugin").ParallelWorkflow<void, unknown>;
4
- prepare: import("@modern-js/plugin").AsyncWorkflow<void, void>;
5
- commands: import("@modern-js/plugin").AsyncWorkflow<{
1
+ declare const _default: import("@modern-js/core").AsyncPlugin<Partial<import("@modern-js/core").Progresses2Threads<{
2
+ config: import("@modern-js/core").ParallelWorkflow<void, unknown>;
3
+ validateSchema: import("@modern-js/core").ParallelWorkflow<void, unknown>;
4
+ prepare: import("@modern-js/core").AsyncWorkflow<void, void>;
5
+ commands: import("@modern-js/core").AsyncWorkflow<{
6
6
  program: import("commander").Command;
7
7
  }, void>;
8
- watchFiles: import("@modern-js/plugin").ParallelWorkflow<void, unknown>;
9
- fileChange: import("@modern-js/plugin").AsyncWorkflow<{
8
+ watchFiles: import("@modern-js/core").ParallelWorkflow<void, unknown>;
9
+ fileChange: import("@modern-js/core").AsyncWorkflow<{
10
10
  filename: string;
11
11
  }, void>;
12
- beforeExit: import("@modern-js/plugin").AsyncWorkflow<void, void>;
13
- } & import("@modern-js/plugin").ClearDraftProgress<import("@modern-js/core").Hooks>>>>;
12
+ beforeExit: import("@modern-js/core").AsyncWorkflow<void, void>;
13
+ } & import("@modern-js/core").ClearDraftProgress<import("@modern-js/core").Hooks>>>>;
14
14
 
15
15
  export default _default;
package/package.json CHANGED
@@ -1,6 +1,17 @@
1
1
  {
2
2
  "name": "@modern-js/plugin-koa",
3
- "version": "1.0.0-rc.2",
3
+ "description": "The meta-framework suite designed from scratch for frontend-focused modern web development.",
4
+ "homepage": "https://modernjs.dev",
5
+ "bugs": "https://github.com/modern-js-dev/modern.js/issues",
6
+ "repository": "modern-js-dev/modern.js",
7
+ "license": "MIT",
8
+ "keywords": [
9
+ "react",
10
+ "framework",
11
+ "modern",
12
+ "modern.js"
13
+ ],
14
+ "version": "1.0.0-rc.23",
4
15
  "jsnext:source": "./src/index.ts",
5
16
  "types": "./dist/types/index.d.ts",
6
17
  "main": "./dist/js/node/index.js",
@@ -18,12 +29,8 @@
18
29
  },
19
30
  "dependencies": {
20
31
  "@babel/runtime": "^7.15.3",
21
- "@modern-js/adapter-helpers": "^1.0.0-rc.2",
22
- "@modern-js/bff-runtime": "^1.0.0-rc.2",
23
- "@modern-js/bff-utils": "^1.0.0-rc.2",
24
- "@modern-js/core": "^1.0.0-rc.2",
25
- "@modern-js/server-plugin": "^1.0.0-rc.2",
26
- "@modern-js/utils": "^1.0.0-rc.2",
32
+ "@modern-js/adapter-helpers": "^1.0.0-rc.23",
33
+ "@modern-js/utils": "^1.0.0-rc.23",
27
34
  "formidable": "^1.2.2",
28
35
  "koa-body": "^4.2.0",
29
36
  "koa-router": "^10.0.0",
@@ -40,8 +47,12 @@
40
47
  "@types/type-is": "^1.6.3",
41
48
  "supertest": "^6.1.6",
42
49
  "typescript": "^4",
43
- "@modern-js/plugin-testing": "^1.0.0-rc.2",
44
- "@modern-js/module-tools": "^1.0.0-rc.2"
50
+ "@modern-js/bff-runtime": "^1.0.0-rc.23",
51
+ "@modern-js/bff-utils": "^1.0.0-rc.23",
52
+ "@modern-js/core": "^1.0.0-rc.23",
53
+ "@modern-js/server-plugin": "^1.0.0-rc.23",
54
+ "@modern-js/plugin-testing": "^1.0.0-rc.23",
55
+ "@modern-js/module-tools": "^1.0.0-rc.23"
45
56
  },
46
57
  "modernConfig": {
47
58
  "output": {
@@ -49,8 +60,16 @@
49
60
  }
50
61
  },
51
62
  "peerDependencies": {
63
+ "@modern-js/bff-utils": "^1.0.0-rc.23",
64
+ "@modern-js/core": "^1.0.0-rc.23",
65
+ "@modern-js/server-plugin": "^1.0.0-rc.23",
66
+ "@modern-js/bff-runtime": "^1.0.0-rc.23",
52
67
  "koa": "^2.13.3"
53
68
  },
69
+ "publishConfig": {
70
+ "registry": "https://registry.npmjs.org/",
71
+ "access": "public"
72
+ },
54
73
  "scripts": {
55
74
  "new": "modern new",
56
75
  "build": "modern build",
package/src/cli/index.ts CHANGED
@@ -1,6 +1,6 @@
1
1
  import * as path from 'path';
2
2
  import { useAppContext, createPlugin } from '@modern-js/core';
3
- import { createRuntimeExportsUtils } from '@modern-js/utils';
3
+ import { createRuntimeExportsUtils, upath } from '@modern-js/utils';
4
4
 
5
5
  export default createPlugin(
6
6
  () => {
@@ -10,7 +10,7 @@ export default createPlugin(
10
10
  return {
11
11
  config() {
12
12
  // eslint-disable-next-line react-hooks/rules-of-hooks
13
- const { value: appContext } = useAppContext();
13
+ const appContext = useAppContext();
14
14
  bffExportsUtils = createRuntimeExportsUtils(
15
15
  appContext.internalDirectory,
16
16
  'server',
@@ -23,13 +23,11 @@ export default createPlugin(
23
23
  };
24
24
  },
25
25
  modifyEntryImports() {
26
- const {
27
- value: { appDirectory },
28
- // eslint-disable-next-line react-hooks/rules-of-hooks
29
- } = useAppContext();
30
- const runtimePath = require.resolve(`@modern-js/runtime`, {
26
+ // eslint-disable-next-line react-hooks/rules-of-hooks
27
+ const { appDirectory } = useAppContext();
28
+ const runtimePath = upath.normalizeSafe(require.resolve(`@modern-js/runtime`, {
31
29
  paths: [appDirectory],
32
- });
30
+ }));
33
31
 
34
32
  const currentFile = bffExportsUtils.getPath();
35
33
 
package/tests/helpers.ts CHANGED
@@ -1,4 +1,4 @@
1
- import path from 'path';
1
+ import { path } from '@modern-js/utils';
2
2
  import { createPlugin } from '@modern-js/server-plugin';
3
3
  import { injectAPIHandlerInfos, API_DIR } from '@modern-js/bff-utils';
4
4