@modern-js/plugin-worker 2.48.6 → 2.49.1
Sign up to get free protection for your applications and to get access to all the features.
- package/CHANGELOG.md +810 -0
- package/package.json +9 -9
- package/README.md +0 -26
- package/dist/cjs/code.js +0 -55
- package/dist/cjs/constants.js +0 -46
- package/dist/cjs/index.js +0 -132
- package/dist/esm/code.js +0 -31
- package/dist/esm/constants.js +0 -16
- package/dist/esm/index.js +0 -98
- package/dist/types/code.d.ts +0 -1
- package/dist/types/constants.d.ts +0 -7
- package/dist/types/index.d.ts +0 -3
package/CHANGELOG.md
ADDED
@@ -0,0 +1,810 @@
|
|
1
|
+
# @modern-js/plugin-worker
|
2
|
+
|
3
|
+
## 2.49.1
|
4
|
+
|
5
|
+
### Patch Changes
|
6
|
+
|
7
|
+
- Updated dependencies [0766ae2]
|
8
|
+
- @modern-js/prod-server@2.49.1
|
9
|
+
- @modern-js/server-utils@2.49.1
|
10
|
+
- @modern-js/utils@2.49.1
|
11
|
+
|
12
|
+
## 2.49.0
|
13
|
+
|
14
|
+
### Patch Changes
|
15
|
+
|
16
|
+
- Updated dependencies [fa7949a]
|
17
|
+
- Updated dependencies [e8c8c5d]
|
18
|
+
- Updated dependencies [805e021]
|
19
|
+
- @modern-js/prod-server@2.49.0
|
20
|
+
- @modern-js/utils@2.49.0
|
21
|
+
- @modern-js/server-utils@2.49.0
|
22
|
+
|
23
|
+
## 2.48.6
|
24
|
+
|
25
|
+
### Patch Changes
|
26
|
+
|
27
|
+
- @modern-js/prod-server@2.48.6
|
28
|
+
- @modern-js/server-utils@2.48.6
|
29
|
+
- @modern-js/utils@2.48.6
|
30
|
+
|
31
|
+
## 2.48.5
|
32
|
+
|
33
|
+
### Patch Changes
|
34
|
+
|
35
|
+
- Updated dependencies [4ca9f4c]
|
36
|
+
- @modern-js/utils@2.48.5
|
37
|
+
- @modern-js/prod-server@2.48.5
|
38
|
+
- @modern-js/server-utils@2.48.5
|
39
|
+
|
40
|
+
## 2.48.4
|
41
|
+
|
42
|
+
### Patch Changes
|
43
|
+
|
44
|
+
- Updated dependencies [7d2d433]
|
45
|
+
- @modern-js/utils@2.48.4
|
46
|
+
- @modern-js/prod-server@2.48.4
|
47
|
+
- @modern-js/server-utils@2.48.4
|
48
|
+
|
49
|
+
## 2.48.3
|
50
|
+
|
51
|
+
### Patch Changes
|
52
|
+
|
53
|
+
- @modern-js/prod-server@2.48.3
|
54
|
+
- @modern-js/server-utils@2.48.3
|
55
|
+
- @modern-js/utils@2.48.3
|
56
|
+
|
57
|
+
## 2.48.2
|
58
|
+
|
59
|
+
### Patch Changes
|
60
|
+
|
61
|
+
- @modern-js/prod-server@2.48.2
|
62
|
+
- @modern-js/server-utils@2.48.2
|
63
|
+
- @modern-js/utils@2.48.2
|
64
|
+
|
65
|
+
## 2.48.1
|
66
|
+
|
67
|
+
### Patch Changes
|
68
|
+
|
69
|
+
- Updated dependencies [8942b90]
|
70
|
+
- Updated dependencies [24b2ec1]
|
71
|
+
- Updated dependencies [ce426f7]
|
72
|
+
- Updated dependencies [74749ae]
|
73
|
+
- @modern-js/utils@2.48.1
|
74
|
+
- @modern-js/prod-server@2.48.1
|
75
|
+
- @modern-js/server-utils@2.48.1
|
76
|
+
|
77
|
+
## 2.48.0
|
78
|
+
|
79
|
+
### Patch Changes
|
80
|
+
|
81
|
+
- Updated dependencies [0b44ddb]
|
82
|
+
- Updated dependencies [c323a23]
|
83
|
+
- @modern-js/prod-server@2.48.0
|
84
|
+
- @modern-js/utils@2.48.0
|
85
|
+
- @modern-js/server-utils@2.48.0
|
86
|
+
|
87
|
+
## 2.47.1
|
88
|
+
|
89
|
+
### Patch Changes
|
90
|
+
|
91
|
+
- @modern-js/prod-server@2.47.1
|
92
|
+
- @modern-js/server-utils@2.47.1
|
93
|
+
- @modern-js/utils@2.47.1
|
94
|
+
|
95
|
+
## 2.47.0
|
96
|
+
|
97
|
+
### Patch Changes
|
98
|
+
|
99
|
+
- Updated dependencies [b68c12a]
|
100
|
+
- Updated dependencies [a5386ab]
|
101
|
+
- Updated dependencies [a9a3626]
|
102
|
+
- Updated dependencies [01b75e6]
|
103
|
+
- @modern-js/prod-server@2.47.0
|
104
|
+
- @modern-js/utils@2.47.0
|
105
|
+
- @modern-js/server-utils@2.47.0
|
106
|
+
|
107
|
+
## 2.46.1
|
108
|
+
|
109
|
+
### Patch Changes
|
110
|
+
|
111
|
+
- @modern-js/prod-server@2.46.1
|
112
|
+
- @modern-js/server-utils@2.46.1
|
113
|
+
- @modern-js/utils@2.46.1
|
114
|
+
|
115
|
+
## 2.46.0
|
116
|
+
|
117
|
+
### Patch Changes
|
118
|
+
|
119
|
+
- Updated dependencies [091c7c2]
|
120
|
+
- Updated dependencies [d833015]
|
121
|
+
- Updated dependencies [46e6d56]
|
122
|
+
- Updated dependencies [494b290]
|
123
|
+
- Updated dependencies [4699e22]
|
124
|
+
- @modern-js/prod-server@2.46.0
|
125
|
+
- @modern-js/server-utils@2.46.0
|
126
|
+
- @modern-js/utils@2.46.0
|
127
|
+
|
128
|
+
## 2.45.0
|
129
|
+
|
130
|
+
### Patch Changes
|
131
|
+
|
132
|
+
- Updated dependencies [f50ad3e]
|
133
|
+
- @modern-js/prod-server@2.45.0
|
134
|
+
- @modern-js/server-utils@2.45.0
|
135
|
+
- @modern-js/utils@2.45.0
|
136
|
+
|
137
|
+
## 2.44.0
|
138
|
+
|
139
|
+
### Patch Changes
|
140
|
+
|
141
|
+
- Updated dependencies [0ed968c]
|
142
|
+
- Updated dependencies [56d7f9a]
|
143
|
+
- @modern-js/prod-server@2.44.0
|
144
|
+
- @modern-js/utils@2.44.0
|
145
|
+
- @modern-js/server-utils@2.44.0
|
146
|
+
|
147
|
+
## 2.43.0
|
148
|
+
|
149
|
+
### Patch Changes
|
150
|
+
|
151
|
+
- Updated dependencies [d959200]
|
152
|
+
- @modern-js/prod-server@2.43.0
|
153
|
+
- @modern-js/utils@2.43.0
|
154
|
+
- @modern-js/server-utils@2.43.0
|
155
|
+
|
156
|
+
## 2.42.2
|
157
|
+
|
158
|
+
### Patch Changes
|
159
|
+
|
160
|
+
- Updated dependencies [07c56c0]
|
161
|
+
- @modern-js/server-utils@2.42.2
|
162
|
+
- @modern-js/prod-server@2.42.2
|
163
|
+
- @modern-js/utils@2.42.2
|
164
|
+
|
165
|
+
## 2.42.1
|
166
|
+
|
167
|
+
### Patch Changes
|
168
|
+
|
169
|
+
- @modern-js/prod-server@2.42.1
|
170
|
+
- @modern-js/server-utils@2.42.1
|
171
|
+
- @modern-js/utils@2.42.1
|
172
|
+
|
173
|
+
## 2.42.0
|
174
|
+
|
175
|
+
### Patch Changes
|
176
|
+
|
177
|
+
- Updated dependencies [8c2efe1]
|
178
|
+
- Updated dependencies [8793e64]
|
179
|
+
- @modern-js/prod-server@2.42.0
|
180
|
+
- @modern-js/server-utils@2.42.0
|
181
|
+
- @modern-js/utils@2.42.0
|
182
|
+
|
183
|
+
## 2.41.0
|
184
|
+
|
185
|
+
### Patch Changes
|
186
|
+
|
187
|
+
- c4d396a: chore(swc): bump swc and helpers
|
188
|
+
chore(swc): 升级 swc 以及 helpers
|
189
|
+
- Updated dependencies [2555586]
|
190
|
+
- Updated dependencies [c4d396a]
|
191
|
+
- @modern-js/prod-server@2.41.0
|
192
|
+
- @modern-js/utils@2.41.0
|
193
|
+
- @modern-js/server-utils@2.41.0
|
194
|
+
|
195
|
+
## 2.40.0
|
196
|
+
|
197
|
+
### Minor Changes
|
198
|
+
|
199
|
+
- 95f15d2: chore: remove ajv schema verification of configuration
|
200
|
+
chore: 移除 ajv 对项目配置的校验
|
201
|
+
|
202
|
+
### Patch Changes
|
203
|
+
|
204
|
+
- Updated dependencies [95f15d2]
|
205
|
+
- Updated dependencies [c960bcb]
|
206
|
+
- Updated dependencies [a68a2e9]
|
207
|
+
- @modern-js/utils@2.40.0
|
208
|
+
- @modern-js/prod-server@2.40.0
|
209
|
+
- @modern-js/server-utils@2.40.0
|
210
|
+
|
211
|
+
## 2.39.2
|
212
|
+
|
213
|
+
### Patch Changes
|
214
|
+
|
215
|
+
- @modern-js/prod-server@2.39.2
|
216
|
+
- @modern-js/server-utils@2.39.2
|
217
|
+
- @modern-js/utils@2.39.2
|
218
|
+
|
219
|
+
## 2.39.1
|
220
|
+
|
221
|
+
### Patch Changes
|
222
|
+
|
223
|
+
- @modern-js/prod-server@2.39.1
|
224
|
+
- @modern-js/server-utils@2.39.1
|
225
|
+
- @modern-js/utils@2.39.1
|
226
|
+
|
227
|
+
## 2.39.0
|
228
|
+
|
229
|
+
### Patch Changes
|
230
|
+
|
231
|
+
- @modern-js/prod-server@2.39.0
|
232
|
+
- @modern-js/server-utils@2.39.0
|
233
|
+
- @modern-js/utils@2.39.0
|
234
|
+
|
235
|
+
## 2.38.0
|
236
|
+
|
237
|
+
### Patch Changes
|
238
|
+
|
239
|
+
- Updated dependencies [3304d33]
|
240
|
+
- Updated dependencies [6d8ef7d]
|
241
|
+
- @modern-js/server-utils@2.38.0
|
242
|
+
- @modern-js/prod-server@2.38.0
|
243
|
+
- @modern-js/utils@2.38.0
|
244
|
+
|
245
|
+
## 2.37.2
|
246
|
+
|
247
|
+
### Patch Changes
|
248
|
+
|
249
|
+
- @modern-js/prod-server@2.37.2
|
250
|
+
- @modern-js/server-utils@2.37.2
|
251
|
+
- @modern-js/utils@2.37.2
|
252
|
+
|
253
|
+
## 2.37.1
|
254
|
+
|
255
|
+
### Patch Changes
|
256
|
+
|
257
|
+
- @modern-js/prod-server@2.37.1
|
258
|
+
- @modern-js/server-utils@2.37.1
|
259
|
+
- @modern-js/utils@2.37.1
|
260
|
+
|
261
|
+
## 2.37.0
|
262
|
+
|
263
|
+
### Patch Changes
|
264
|
+
|
265
|
+
- Updated dependencies [383b636]
|
266
|
+
- Updated dependencies [ce0a14e]
|
267
|
+
- Updated dependencies [708f248]
|
268
|
+
- @modern-js/utils@2.37.0
|
269
|
+
- @modern-js/server-utils@2.37.0
|
270
|
+
- @modern-js/prod-server@2.37.0
|
271
|
+
|
272
|
+
## 2.36.0
|
273
|
+
|
274
|
+
### Patch Changes
|
275
|
+
|
276
|
+
- Updated dependencies [3473bee]
|
277
|
+
- Updated dependencies [b98f8aa]
|
278
|
+
- Updated dependencies [eb602d2]
|
279
|
+
- @modern-js/utils@2.36.0
|
280
|
+
- @modern-js/prod-server@2.36.0
|
281
|
+
- @modern-js/server-utils@2.36.0
|
282
|
+
|
283
|
+
## 2.35.1
|
284
|
+
|
285
|
+
### Patch Changes
|
286
|
+
|
287
|
+
- Updated dependencies [ea3fe18]
|
288
|
+
- Updated dependencies [bb97082]
|
289
|
+
- Updated dependencies [9dd3151]
|
290
|
+
- Updated dependencies [0db5680]
|
291
|
+
- Updated dependencies [411cea2]
|
292
|
+
- Updated dependencies [4980480]
|
293
|
+
- Updated dependencies [6a1d46e]
|
294
|
+
- @modern-js/utils@2.35.1
|
295
|
+
- @modern-js/prod-server@2.35.1
|
296
|
+
- @modern-js/server-utils@2.35.1
|
297
|
+
|
298
|
+
## 2.35.0
|
299
|
+
|
300
|
+
### Patch Changes
|
301
|
+
|
302
|
+
- Updated dependencies [15b834f]
|
303
|
+
- @modern-js/utils@2.35.0
|
304
|
+
- @modern-js/prod-server@2.35.0
|
305
|
+
- @modern-js/server-utils@2.35.0
|
306
|
+
|
307
|
+
## 2.34.0
|
308
|
+
|
309
|
+
### Patch Changes
|
310
|
+
|
311
|
+
- Updated dependencies [f851fa9]
|
312
|
+
- Updated dependencies [7d70738]
|
313
|
+
- Updated dependencies [5240e5d]
|
314
|
+
- Updated dependencies [a77b82a]
|
315
|
+
- Updated dependencies [c8b448b]
|
316
|
+
- @modern-js/prod-server@2.34.0
|
317
|
+
- @modern-js/utils@2.34.0
|
318
|
+
- @modern-js/server-utils@2.34.0
|
319
|
+
|
320
|
+
## 2.33.1
|
321
|
+
|
322
|
+
### Patch Changes
|
323
|
+
|
324
|
+
- @modern-js/prod-server@2.33.1
|
325
|
+
- @modern-js/server-utils@2.33.1
|
326
|
+
- @modern-js/utils@2.33.1
|
327
|
+
|
328
|
+
## 2.33.0
|
329
|
+
|
330
|
+
### Patch Changes
|
331
|
+
|
332
|
+
- Updated dependencies [fd82137]
|
333
|
+
- Updated dependencies [1042583]
|
334
|
+
- Updated dependencies [bc1f8da]
|
335
|
+
- Updated dependencies [3ba1682]
|
336
|
+
- @modern-js/utils@2.33.0
|
337
|
+
- @modern-js/prod-server@2.33.0
|
338
|
+
- @modern-js/server-utils@2.33.0
|
339
|
+
|
340
|
+
## 2.32.1
|
341
|
+
|
342
|
+
### Patch Changes
|
343
|
+
|
344
|
+
- @modern-js/prod-server@2.32.1
|
345
|
+
- @modern-js/utils@2.32.1
|
346
|
+
- @modern-js/server-utils@2.32.1
|
347
|
+
|
348
|
+
## 2.32.0
|
349
|
+
|
350
|
+
### Patch Changes
|
351
|
+
|
352
|
+
- 6076166: fix: packaging errors found by publint
|
353
|
+
|
354
|
+
fix: 修复 publint 检测到的 packaging 问题
|
355
|
+
|
356
|
+
- Updated dependencies [e6c7d33]
|
357
|
+
- Updated dependencies [e5a3fb4]
|
358
|
+
- Updated dependencies [6076166]
|
359
|
+
- Updated dependencies [5f7c714]
|
360
|
+
- Updated dependencies [a030aff]
|
361
|
+
- Updated dependencies [6d73519]
|
362
|
+
- Updated dependencies [79658a0]
|
363
|
+
- Updated dependencies [3c91100]
|
364
|
+
- Updated dependencies [2447d64]
|
365
|
+
- Updated dependencies [5255eba]
|
366
|
+
- @modern-js/prod-server@2.32.0
|
367
|
+
- @modern-js/utils@2.32.0
|
368
|
+
- @modern-js/server-utils@2.32.0
|
369
|
+
|
370
|
+
## 2.31.2
|
371
|
+
|
372
|
+
### Patch Changes
|
373
|
+
|
374
|
+
- Updated dependencies [15d30abdc66]
|
375
|
+
- @modern-js/utils@2.31.2
|
376
|
+
- @modern-js/prod-server@2.31.2
|
377
|
+
- @modern-js/server-utils@2.31.2
|
378
|
+
|
379
|
+
## 2.31.1
|
380
|
+
|
381
|
+
### Patch Changes
|
382
|
+
|
383
|
+
- @modern-js/prod-server@2.31.1
|
384
|
+
- @modern-js/server-utils@2.31.1
|
385
|
+
- @modern-js/utils@2.31.1
|
386
|
+
|
387
|
+
## 2.31.0
|
388
|
+
|
389
|
+
### Patch Changes
|
390
|
+
|
391
|
+
- Updated dependencies [56eaa0b]
|
392
|
+
- Updated dependencies [d9cc4d8]
|
393
|
+
- Updated dependencies [1882366]
|
394
|
+
- @modern-js/prod-server@2.31.0
|
395
|
+
- @modern-js/utils@2.31.0
|
396
|
+
- @modern-js/server-utils@2.31.0
|
397
|
+
|
398
|
+
## 2.30.0
|
399
|
+
|
400
|
+
### Patch Changes
|
401
|
+
|
402
|
+
- Updated dependencies [9f21f28]
|
403
|
+
- Updated dependencies [a5ee81a]
|
404
|
+
- Updated dependencies [883692c]
|
405
|
+
- Updated dependencies [cc5f49e]
|
406
|
+
- Updated dependencies [b6ab299]
|
407
|
+
- @modern-js/prod-server@2.30.0
|
408
|
+
- @modern-js/server-utils@2.30.0
|
409
|
+
- @modern-js/utils@2.30.0
|
410
|
+
|
411
|
+
## 2.29.0
|
412
|
+
|
413
|
+
### Patch Changes
|
414
|
+
|
415
|
+
- Updated dependencies [e6b5355]
|
416
|
+
- Updated dependencies [16e5195]
|
417
|
+
- Updated dependencies [93db783]
|
418
|
+
- Updated dependencies [cba7675]
|
419
|
+
- Updated dependencies [76ace5d]
|
420
|
+
- Updated dependencies [99052ea]
|
421
|
+
- Updated dependencies [1d71d2e]
|
422
|
+
- @modern-js/utils@2.29.0
|
423
|
+
- @modern-js/prod-server@2.29.0
|
424
|
+
- @modern-js/server-utils@2.29.0
|
425
|
+
|
426
|
+
## 2.28.0
|
427
|
+
|
428
|
+
### Patch Changes
|
429
|
+
|
430
|
+
- Updated dependencies [6eae1e7]
|
431
|
+
- Updated dependencies [00b58a7]
|
432
|
+
- @modern-js/prod-server@2.28.0
|
433
|
+
- @modern-js/utils@2.28.0
|
434
|
+
- @modern-js/server-utils@2.28.0
|
435
|
+
|
436
|
+
## 2.27.0
|
437
|
+
|
438
|
+
### Patch Changes
|
439
|
+
|
440
|
+
- Updated dependencies [91d14b8]
|
441
|
+
- Updated dependencies [6d7104d]
|
442
|
+
- @modern-js/utils@2.27.0
|
443
|
+
- @modern-js/prod-server@2.27.0
|
444
|
+
- @modern-js/server-utils@2.27.0
|
445
|
+
|
446
|
+
## 2.26.0
|
447
|
+
|
448
|
+
### Patch Changes
|
449
|
+
|
450
|
+
- Updated dependencies [1fb5804]
|
451
|
+
- @modern-js/server-utils@2.26.0
|
452
|
+
- @modern-js/prod-server@2.26.0
|
453
|
+
- @modern-js/utils@2.26.0
|
454
|
+
|
455
|
+
## 2.25.2
|
456
|
+
|
457
|
+
### Patch Changes
|
458
|
+
|
459
|
+
- Updated dependencies [63d8247]
|
460
|
+
- Updated dependencies [6651684]
|
461
|
+
- Updated dependencies [272646c]
|
462
|
+
- Updated dependencies [358ed24]
|
463
|
+
- @modern-js/utils@2.25.2
|
464
|
+
- @modern-js/prod-server@2.25.2
|
465
|
+
- @modern-js/server-utils@2.25.2
|
466
|
+
|
467
|
+
## 2.25.1
|
468
|
+
|
469
|
+
### Patch Changes
|
470
|
+
|
471
|
+
- Updated dependencies [9f78d0c]
|
472
|
+
- @modern-js/utils@2.25.1
|
473
|
+
- @modern-js/prod-server@2.25.1
|
474
|
+
- @modern-js/server-utils@2.25.1
|
475
|
+
|
476
|
+
## 2.25.0
|
477
|
+
|
478
|
+
### Patch Changes
|
479
|
+
|
480
|
+
- 4c4c0ad: feat: add named exports for all CLI plugins
|
481
|
+
|
482
|
+
feat: 为各个 CLI 插件添加 named 导出
|
483
|
+
|
484
|
+
- Updated dependencies [2491875]
|
485
|
+
- Updated dependencies [5732c6a]
|
486
|
+
- @modern-js/prod-server@2.25.0
|
487
|
+
- @modern-js/utils@2.25.0
|
488
|
+
- @modern-js/server-utils@2.25.0
|
489
|
+
|
490
|
+
## 2.24.0
|
491
|
+
|
492
|
+
### Patch Changes
|
493
|
+
|
494
|
+
- Updated dependencies [c882fbd]
|
495
|
+
- Updated dependencies [36f5bdf]
|
496
|
+
- Updated dependencies [4a82c3b]
|
497
|
+
- @modern-js/utils@2.24.0
|
498
|
+
- @modern-js/server-utils@2.24.0
|
499
|
+
- @modern-js/prod-server@2.24.0
|
500
|
+
|
501
|
+
## 2.23.1
|
502
|
+
|
503
|
+
### Patch Changes
|
504
|
+
|
505
|
+
- Updated dependencies [f08bbfc]
|
506
|
+
- Updated dependencies [a6b313a]
|
507
|
+
- Updated dependencies [8f2cab0]
|
508
|
+
- @modern-js/utils@2.23.1
|
509
|
+
- @modern-js/prod-server@2.23.1
|
510
|
+
- @modern-js/server-utils@2.23.1
|
511
|
+
|
512
|
+
## 2.23.0
|
513
|
+
|
514
|
+
### Patch Changes
|
515
|
+
|
516
|
+
- 7e6fb5f: chore: publishConfig add provenance config
|
517
|
+
|
518
|
+
chore: publishConfig 增加 provenance 配置
|
519
|
+
|
520
|
+
- c3216b5: chore: split the scheme into the plugin
|
521
|
+
|
522
|
+
chore: 拆分 scheme 到插件内部
|
523
|
+
|
524
|
+
- Updated dependencies [7e6fb5f]
|
525
|
+
- Updated dependencies [a7a7ad7]
|
526
|
+
- Updated dependencies [6dec7c2]
|
527
|
+
- Updated dependencies [c3216b5]
|
528
|
+
- @modern-js/prod-server@2.23.0
|
529
|
+
- @modern-js/utils@2.23.0
|
530
|
+
- @modern-js/server-utils@2.23.0
|
531
|
+
|
532
|
+
## 2.22.1
|
533
|
+
|
534
|
+
### Patch Changes
|
535
|
+
|
536
|
+
- Updated dependencies [e2848a2]
|
537
|
+
- Updated dependencies [4be1da5]
|
538
|
+
- Updated dependencies [d4045ed]
|
539
|
+
- Updated dependencies [1f02cd2]
|
540
|
+
- @modern-js/utils@2.22.1
|
541
|
+
- @modern-js/server-utils@2.22.1
|
542
|
+
- @modern-js/prod-server@2.22.1
|
543
|
+
|
544
|
+
## 2.22.0
|
545
|
+
|
546
|
+
### Minor Changes
|
547
|
+
|
548
|
+
- cb9e1ec: feat: worker ssr support server hooks
|
549
|
+
feat: worker ssr 支持 server hooks
|
550
|
+
|
551
|
+
### Patch Changes
|
552
|
+
|
553
|
+
- Updated dependencies [3d48836]
|
554
|
+
- Updated dependencies [5050e8e]
|
555
|
+
- Updated dependencies [4991c8a]
|
556
|
+
- Updated dependencies [cb9e1ec]
|
557
|
+
- Updated dependencies [ea961e7]
|
558
|
+
- @modern-js/utils@2.22.0
|
559
|
+
- @modern-js/prod-server@2.22.0
|
560
|
+
- @modern-js/server-utils@2.22.0
|
561
|
+
|
562
|
+
## 2.21.1
|
563
|
+
|
564
|
+
### Patch Changes
|
565
|
+
|
566
|
+
- Updated dependencies [78e3ac8]
|
567
|
+
- Updated dependencies [2728724]
|
568
|
+
- @modern-js/prod-server@2.21.1
|
569
|
+
- @modern-js/server-utils@2.21.1
|
570
|
+
- @modern-js/utils@2.21.1
|
571
|
+
|
572
|
+
## 2.21.0
|
573
|
+
|
574
|
+
### Patch Changes
|
575
|
+
|
576
|
+
- 26dcf3a: chore: bump typescript to v5 in devDependencies
|
577
|
+
|
578
|
+
chore: 升级 devDependencies 中的 typescript 版本到 v5
|
579
|
+
|
580
|
+
- Updated dependencies [cfc5bda]
|
581
|
+
- Updated dependencies [e81eeaf]
|
582
|
+
- Updated dependencies [26dcf3a]
|
583
|
+
- Updated dependencies [056627f]
|
584
|
+
- Updated dependencies [0fc15ca]
|
585
|
+
- Updated dependencies [43b4e83]
|
586
|
+
- Updated dependencies [ad78387]
|
587
|
+
- @modern-js/prod-server@2.21.0
|
588
|
+
- @modern-js/utils@2.21.0
|
589
|
+
- @modern-js/server-utils@2.21.0
|
590
|
+
|
591
|
+
## 2.20.0
|
592
|
+
|
593
|
+
### Patch Changes
|
594
|
+
|
595
|
+
- 6b9d90a: chore: remove @babel/runtime. add @swc/helper and enable `externalHelper` config.
|
596
|
+
chore: 移除 @babel/runtime 依赖. 增加 @swc/helpers 依赖并且开启 `externalHelpers` 配置
|
597
|
+
- 4425fd6: fix: worker ssr context lack some fields & worker ssr must have routerManifest.json
|
598
|
+
fix: worker ssr 上下文缺少一些字段,worker ssr 必须有 routerManifest.json 文件
|
599
|
+
- Updated dependencies [3c4e0a5]
|
600
|
+
- Updated dependencies [6b9d90a]
|
601
|
+
- Updated dependencies [4425fd6]
|
602
|
+
- @modern-js/utils@2.20.0
|
603
|
+
- @modern-js/prod-server@2.20.0
|
604
|
+
- @modern-js/server-utils@2.20.0
|
605
|
+
|
606
|
+
## 2.19.1
|
607
|
+
|
608
|
+
### Patch Changes
|
609
|
+
|
610
|
+
- @modern-js/prod-server@2.19.1
|
611
|
+
- @modern-js/server-utils@2.19.1
|
612
|
+
- @modern-js/utils@2.19.1
|
613
|
+
|
614
|
+
## 2.19.0
|
615
|
+
|
616
|
+
### Patch Changes
|
617
|
+
|
618
|
+
- Updated dependencies [1134fe2]
|
619
|
+
- @modern-js/utils@2.19.0
|
620
|
+
- @modern-js/prod-server@2.19.0
|
621
|
+
- @modern-js/server-utils@2.19.0
|
622
|
+
|
623
|
+
## 2.18.1
|
624
|
+
|
625
|
+
### Patch Changes
|
626
|
+
|
627
|
+
- @modern-js/prod-server@2.18.1
|
628
|
+
- @modern-js/server-utils@2.18.1
|
629
|
+
- @modern-js/utils@2.18.1
|
630
|
+
|
631
|
+
## 2.18.0
|
632
|
+
|
633
|
+
### Patch Changes
|
634
|
+
|
635
|
+
- @modern-js/prod-server@2.18.0
|
636
|
+
- @modern-js/server-utils@2.18.0
|
637
|
+
- @modern-js/utils@2.18.0
|
638
|
+
|
639
|
+
## 2.17.1
|
640
|
+
|
641
|
+
### Patch Changes
|
642
|
+
|
643
|
+
- @modern-js/prod-server@2.17.1
|
644
|
+
- @modern-js/server-utils@2.17.1
|
645
|
+
- @modern-js/utils@2.17.1
|
646
|
+
|
647
|
+
## 2.17.0
|
648
|
+
|
649
|
+
### Patch Changes
|
650
|
+
|
651
|
+
- @modern-js/prod-server@2.17.0
|
652
|
+
- @modern-js/server-utils@2.17.0
|
653
|
+
- @modern-js/utils@2.17.0
|
654
|
+
|
655
|
+
## 2.16.0
|
656
|
+
|
657
|
+
### Patch Changes
|
658
|
+
|
659
|
+
- 4e876ab: chore: package.json include the monorepo-relative directory
|
660
|
+
|
661
|
+
chore: 在 package.json 中声明 monorepo 的子路径
|
662
|
+
|
663
|
+
- Updated dependencies [5954330]
|
664
|
+
- Updated dependencies [7596520]
|
665
|
+
- Updated dependencies [4e876ab]
|
666
|
+
- @modern-js/utils@2.16.0
|
667
|
+
- @modern-js/prod-server@2.16.0
|
668
|
+
- @modern-js/server-utils@2.16.0
|
669
|
+
|
670
|
+
## 2.15.0
|
671
|
+
|
672
|
+
### Patch Changes
|
673
|
+
|
674
|
+
- @modern-js/prod-server@2.15.0
|
675
|
+
- @modern-js/server-utils@2.15.0
|
676
|
+
- @modern-js/utils@2.15.0
|
677
|
+
|
678
|
+
## 2.14.0
|
679
|
+
|
680
|
+
### Patch Changes
|
681
|
+
|
682
|
+
- 9321bef: feat: adjust server.worker config to deploy.worker.ssr
|
683
|
+
|
684
|
+
feat: 调整 server.worker 为 deploy.worker.ssr
|
685
|
+
|
686
|
+
- Updated dependencies [4779152]
|
687
|
+
- Updated dependencies [8a3c693]
|
688
|
+
- Updated dependencies [9321bef]
|
689
|
+
- Updated dependencies [9b45c58]
|
690
|
+
- Updated dependencies [52d0cb1]
|
691
|
+
- Updated dependencies [60a81d0]
|
692
|
+
- Updated dependencies [dacef96]
|
693
|
+
- Updated dependencies [16399fd]
|
694
|
+
- @modern-js/utils@2.14.0
|
695
|
+
- @modern-js/server-utils@2.14.0
|
696
|
+
- @modern-js/prod-server@2.14.0
|
697
|
+
|
698
|
+
## 2.13.4
|
699
|
+
|
700
|
+
### Patch Changes
|
701
|
+
|
702
|
+
- @modern-js/prod-server@2.13.4
|
703
|
+
- @modern-js/server-utils@2.13.4
|
704
|
+
- @modern-js/utils@2.13.4
|
705
|
+
|
706
|
+
## 2.13.3
|
707
|
+
|
708
|
+
### Patch Changes
|
709
|
+
|
710
|
+
- @modern-js/prod-server@2.13.3
|
711
|
+
- @modern-js/server-utils@2.13.3
|
712
|
+
- @modern-js/utils@2.13.3
|
713
|
+
|
714
|
+
## 2.13.2
|
715
|
+
|
716
|
+
### Patch Changes
|
717
|
+
|
718
|
+
- @modern-js/prod-server@2.13.2
|
719
|
+
- @modern-js/server-utils@2.13.2
|
720
|
+
- @modern-js/utils@2.13.2
|
721
|
+
|
722
|
+
## 2.13.1
|
723
|
+
|
724
|
+
### Patch Changes
|
725
|
+
|
726
|
+
- @modern-js/prod-server@2.13.1
|
727
|
+
- @modern-js/server-utils@2.13.1
|
728
|
+
- @modern-js/utils@2.13.1
|
729
|
+
|
730
|
+
## 2.13.0
|
731
|
+
|
732
|
+
### Patch Changes
|
733
|
+
|
734
|
+
- @modern-js/prod-server@2.13.0
|
735
|
+
- @modern-js/server-utils@2.13.0
|
736
|
+
- @modern-js/utils@2.13.0
|
737
|
+
|
738
|
+
## 2.12.0
|
739
|
+
|
740
|
+
### Patch Changes
|
741
|
+
|
742
|
+
- Updated dependencies [c2ca6c8]
|
743
|
+
- Updated dependencies [7980842]
|
744
|
+
- Updated dependencies [6d86e34]
|
745
|
+
- Updated dependencies [05493a7]
|
746
|
+
- @modern-js/utils@2.12.0
|
747
|
+
- @modern-js/prod-server@2.12.0
|
748
|
+
- @modern-js/server-utils@2.12.0
|
749
|
+
|
750
|
+
## 2.11.0
|
751
|
+
|
752
|
+
### Patch Changes
|
753
|
+
|
754
|
+
- Updated dependencies [cfb058f]
|
755
|
+
- Updated dependencies [0bd018b]
|
756
|
+
- Updated dependencies [5d624fd]
|
757
|
+
- Updated dependencies [e2466a1]
|
758
|
+
- Updated dependencies [02bb383]
|
759
|
+
- Updated dependencies [381a3b9]
|
760
|
+
- Updated dependencies [7a60f10]
|
761
|
+
- Updated dependencies [274b2e5]
|
762
|
+
- Updated dependencies [b9e1c54]
|
763
|
+
- @modern-js/utils@2.11.0
|
764
|
+
- @modern-js/prod-server@2.11.0
|
765
|
+
- @modern-js/server-utils@2.11.0
|
766
|
+
|
767
|
+
## 2.10.0
|
768
|
+
|
769
|
+
### Patch Changes
|
770
|
+
|
771
|
+
- 0da32d0: chore: upgrade jest and puppeteer
|
772
|
+
chore: 升级 jest 和 puppeteer 到 latest
|
773
|
+
- 0d9962b: fix: add types field in package.json
|
774
|
+
fix: 添加 package.json 中的 types 字段
|
775
|
+
- Updated dependencies [d8bbf28]
|
776
|
+
- Updated dependencies [3e0bd50]
|
777
|
+
- Updated dependencies [92d247f]
|
778
|
+
- Updated dependencies [0da32d0]
|
779
|
+
- Updated dependencies [0d9962b]
|
780
|
+
- Updated dependencies [fbefa7e]
|
781
|
+
- Updated dependencies [4d54233]
|
782
|
+
- Updated dependencies [6db4864]
|
783
|
+
- @modern-js/prod-server@2.10.0
|
784
|
+
- @modern-js/utils@2.10.0
|
785
|
+
- @modern-js/server-utils@2.10.0
|
786
|
+
|
787
|
+
## 2.9.0
|
788
|
+
|
789
|
+
### Patch Changes
|
790
|
+
|
791
|
+
- 7035d5c22f: fix: worker router config error when enable bff
|
792
|
+
|
793
|
+
fix: 修复当开启 BFF 时 worker 路由配置
|
794
|
+
|
795
|
+
- Updated dependencies [49bb8cd0ef]
|
796
|
+
- @modern-js/prod-server@2.9.0
|
797
|
+
- @modern-js/server-utils@2.9.0
|
798
|
+
- @modern-js/utils@2.9.0
|
799
|
+
|
800
|
+
## 2.8.0
|
801
|
+
|
802
|
+
### Patch Changes
|
803
|
+
|
804
|
+
- Updated dependencies [1104a9f18b]
|
805
|
+
- Updated dependencies [70d82e1408]
|
806
|
+
- Updated dependencies [2c1151271d]
|
807
|
+
- Updated dependencies [1f6ca2c7fb]
|
808
|
+
- @modern-js/prod-server@2.8.0
|
809
|
+
- @modern-js/utils@2.8.0
|
810
|
+
- @modern-js/server-utils@2.8.0
|
package/package.json
CHANGED
@@ -15,7 +15,7 @@
|
|
15
15
|
"modern",
|
16
16
|
"modern.js"
|
17
17
|
],
|
18
|
-
"version": "2.
|
18
|
+
"version": "2.49.1",
|
19
19
|
"types": "./dist/types/index.d.ts",
|
20
20
|
"jsnext:source": "./src/index.ts",
|
21
21
|
"main": "./dist/cjs/index.js",
|
@@ -43,20 +43,20 @@
|
|
43
43
|
},
|
44
44
|
"dependencies": {
|
45
45
|
"@swc/helpers": "0.5.3",
|
46
|
-
"@modern-js/server-utils": "2.
|
47
|
-
"@modern-js/utils": "2.
|
48
|
-
"@modern-js/prod-server": "2.
|
46
|
+
"@modern-js/server-utils": "2.49.1",
|
47
|
+
"@modern-js/utils": "2.49.1",
|
48
|
+
"@modern-js/prod-server": "2.49.1"
|
49
49
|
},
|
50
50
|
"devDependencies": {
|
51
51
|
"typescript": "^5",
|
52
52
|
"@types/jest": "^29",
|
53
53
|
"@types/node": "^14",
|
54
54
|
"jest": "^29",
|
55
|
-
"@modern-js/app-tools": "2.
|
56
|
-
"@modern-js/core": "2.
|
57
|
-
"@scripts/build": "2.
|
58
|
-
"@
|
59
|
-
"@
|
55
|
+
"@modern-js/app-tools": "2.49.1",
|
56
|
+
"@modern-js/core": "2.49.1",
|
57
|
+
"@scripts/build": "2.49.1",
|
58
|
+
"@scripts/jest-config": "2.49.1",
|
59
|
+
"@modern-js/types": "2.49.1"
|
60
60
|
},
|
61
61
|
"sideEffects": [
|
62
62
|
"*.css",
|
package/README.md
DELETED
@@ -1,26 +0,0 @@
|
|
1
|
-
<p align="center">
|
2
|
-
<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>
|
3
|
-
</p>
|
4
|
-
|
5
|
-
<h1 align="center">Modern.js</h1>
|
6
|
-
|
7
|
-
<p align="center">
|
8
|
-
A Progressive React Framework for modern web development.
|
9
|
-
</p>
|
10
|
-
|
11
|
-
## Getting Started
|
12
|
-
|
13
|
-
Please follow [Quick Start](https://modernjs.dev/en/guides/get-started/quick-start) to get started with Modern.js.
|
14
|
-
|
15
|
-
## Documentation
|
16
|
-
|
17
|
-
- [English Documentation](https://modernjs.dev/en/)
|
18
|
-
- [中文文档](https://modernjs.dev)
|
19
|
-
|
20
|
-
## Contributing
|
21
|
-
|
22
|
-
Please read the [Contributing Guide](https://github.com/web-infra-dev/modern.js/blob/main/CONTRIBUTING.md).
|
23
|
-
|
24
|
-
## License
|
25
|
-
|
26
|
-
Modern.js is [MIT licensed](https://github.com/web-infra-dev/modern.js/blob/main/LICENSE).
|
package/dist/cjs/code.js
DELETED
@@ -1,55 +0,0 @@
|
|
1
|
-
"use strict";
|
2
|
-
var __defProp = Object.defineProperty;
|
3
|
-
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
4
|
-
var __getOwnPropNames = Object.getOwnPropertyNames;
|
5
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
6
|
-
var __export = (target, all) => {
|
7
|
-
for (var name in all)
|
8
|
-
__defProp(target, name, { get: all[name], enumerable: true });
|
9
|
-
};
|
10
|
-
var __copyProps = (to, from, except, desc) => {
|
11
|
-
if (from && typeof from === "object" || typeof from === "function") {
|
12
|
-
for (let key of __getOwnPropNames(from))
|
13
|
-
if (!__hasOwnProp.call(to, key) && key !== except)
|
14
|
-
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
15
|
-
}
|
16
|
-
return to;
|
17
|
-
};
|
18
|
-
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
19
|
-
var code_exports = {};
|
20
|
-
__export(code_exports, {
|
21
|
-
worker: () => worker
|
22
|
-
});
|
23
|
-
module.exports = __toCommonJS(code_exports);
|
24
|
-
const worker = () => `
|
25
|
-
// work entry code
|
26
|
-
import { createHandler } from "@modern-js/prod-server/worker";
|
27
|
-
import loadableStats from "../loadable-stats.json";
|
28
|
-
import routeManifest from "../routes-manifest.json";
|
29
|
-
import { manifest } from "./manifest";
|
30
|
-
|
31
|
-
const handler = createHandler(manifest);
|
32
|
-
|
33
|
-
async function handleRequest(request) {
|
34
|
-
const options = {
|
35
|
-
request,
|
36
|
-
loadableStats,
|
37
|
-
routeManifest,
|
38
|
-
}
|
39
|
-
|
40
|
-
const { body, status, headers } = await handler(options);
|
41
|
-
|
42
|
-
return new Response(body, {
|
43
|
-
status,
|
44
|
-
headers,
|
45
|
-
});
|
46
|
-
}
|
47
|
-
|
48
|
-
addEventListener("fetch", (event) => {
|
49
|
-
event.respondWith(handleRequest(event.request));
|
50
|
-
});
|
51
|
-
`;
|
52
|
-
// Annotate the CommonJS export names for ESM import in node:
|
53
|
-
0 && (module.exports = {
|
54
|
-
worker
|
55
|
-
});
|
package/dist/cjs/constants.js
DELETED
@@ -1,46 +0,0 @@
|
|
1
|
-
"use strict";
|
2
|
-
var __defProp = Object.defineProperty;
|
3
|
-
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
4
|
-
var __getOwnPropNames = Object.getOwnPropertyNames;
|
5
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
6
|
-
var __export = (target, all) => {
|
7
|
-
for (var name in all)
|
8
|
-
__defProp(target, name, { get: all[name], enumerable: true });
|
9
|
-
};
|
10
|
-
var __copyProps = (to, from, except, desc) => {
|
11
|
-
if (from && typeof from === "object" || typeof from === "function") {
|
12
|
-
for (let key of __getOwnPropNames(from))
|
13
|
-
if (!__hasOwnProp.call(to, key) && key !== except)
|
14
|
-
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
15
|
-
}
|
16
|
-
return to;
|
17
|
-
};
|
18
|
-
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
19
|
-
var constants_exports = {};
|
20
|
-
__export(constants_exports, {
|
21
|
-
MANIFEST_FILE: () => MANIFEST_FILE,
|
22
|
-
PKG_FILE: () => PKG_FILE,
|
23
|
-
SERVER_HOOKS: () => SERVER_HOOKS,
|
24
|
-
WEB_APP_NAME: () => WEB_APP_NAME,
|
25
|
-
WORKER_SERVER: () => WORKER_SERVER,
|
26
|
-
WORKER_SERVER_ENTRY: () => WORKER_SERVER_ENTRY,
|
27
|
-
WRANGLER_FILE: () => WRANGLER_FILE
|
28
|
-
});
|
29
|
-
module.exports = __toCommonJS(constants_exports);
|
30
|
-
const WORKER_SERVER = "worker-server";
|
31
|
-
const WORKER_SERVER_ENTRY = "index.js";
|
32
|
-
const MANIFEST_FILE = "manifest.js";
|
33
|
-
const PKG_FILE = "package.json";
|
34
|
-
const WRANGLER_FILE = "wrangler.toml";
|
35
|
-
const WEB_APP_NAME = "index";
|
36
|
-
const SERVER_HOOKS = "serverHooks";
|
37
|
-
// Annotate the CommonJS export names for ESM import in node:
|
38
|
-
0 && (module.exports = {
|
39
|
-
MANIFEST_FILE,
|
40
|
-
PKG_FILE,
|
41
|
-
SERVER_HOOKS,
|
42
|
-
WEB_APP_NAME,
|
43
|
-
WORKER_SERVER,
|
44
|
-
WORKER_SERVER_ENTRY,
|
45
|
-
WRANGLER_FILE
|
46
|
-
});
|
package/dist/cjs/index.js
DELETED
@@ -1,132 +0,0 @@
|
|
1
|
-
"use strict";
|
2
|
-
var __create = Object.create;
|
3
|
-
var __defProp = Object.defineProperty;
|
4
|
-
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
5
|
-
var __getOwnPropNames = Object.getOwnPropertyNames;
|
6
|
-
var __getProtoOf = Object.getPrototypeOf;
|
7
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
8
|
-
var __export = (target, all) => {
|
9
|
-
for (var name in all)
|
10
|
-
__defProp(target, name, { get: all[name], enumerable: true });
|
11
|
-
};
|
12
|
-
var __copyProps = (to, from, except, desc) => {
|
13
|
-
if (from && typeof from === "object" || typeof from === "function") {
|
14
|
-
for (let key of __getOwnPropNames(from))
|
15
|
-
if (!__hasOwnProp.call(to, key) && key !== except)
|
16
|
-
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
17
|
-
}
|
18
|
-
return to;
|
19
|
-
};
|
20
|
-
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
21
|
-
// If the importer is in node compatibility mode or this is not an ESM
|
22
|
-
// file that has been converted to a CommonJS file using a Babel-
|
23
|
-
// compatible transform (i.e. "__esModule" has not been set), then set
|
24
|
-
// "default" to the CommonJS "module.exports" for node compatibility.
|
25
|
-
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
26
|
-
mod
|
27
|
-
));
|
28
|
-
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
29
|
-
var src_exports = {};
|
30
|
-
__export(src_exports, {
|
31
|
-
default: () => src_default,
|
32
|
-
workerPlugin: () => workerPlugin
|
33
|
-
});
|
34
|
-
module.exports = __toCommonJS(src_exports);
|
35
|
-
var import_path = __toESM(require("path"));
|
36
|
-
var import_utils = require("@modern-js/utils");
|
37
|
-
var import_constants = require("./constants");
|
38
|
-
var import_code = require("./code");
|
39
|
-
const workerPlugin = () => ({
|
40
|
-
name: "@modern-js/plugin-worker",
|
41
|
-
setup: (ctx) => {
|
42
|
-
return {
|
43
|
-
async config() {
|
44
|
-
return {
|
45
|
-
output: {
|
46
|
-
disableNodePolyfill: false
|
47
|
-
}
|
48
|
-
};
|
49
|
-
},
|
50
|
-
async afterDev() {
|
51
|
-
var _configContext_deploy_worker;
|
52
|
-
const { appDirectory, distDirectory } = ctx.useAppContext();
|
53
|
-
const configContext = ctx.useResolvedConfigContext();
|
54
|
-
if (!(0, import_utils.isServiceWorker)(configContext)) {
|
55
|
-
return;
|
56
|
-
}
|
57
|
-
const enableWorkerInWeb = configContext.deploy.enableWorker || ((_configContext_deploy_worker = configContext.deploy.worker) === null || _configContext_deploy_worker === void 0 ? void 0 : _configContext_deploy_worker.web);
|
58
|
-
writeWorkerServerFile(appDirectory, distDirectory, enableWorkerInWeb);
|
59
|
-
},
|
60
|
-
async afterBuild() {
|
61
|
-
var _configContext_deploy_worker;
|
62
|
-
const { appDirectory, distDirectory } = ctx.useAppContext();
|
63
|
-
const configContext = ctx.useResolvedConfigContext();
|
64
|
-
if (!(0, import_utils.isServiceWorker)(configContext)) {
|
65
|
-
return;
|
66
|
-
}
|
67
|
-
const enableWorkerInWeb = configContext.deploy.enableWorker || ((_configContext_deploy_worker = configContext.deploy.worker) === null || _configContext_deploy_worker === void 0 ? void 0 : _configContext_deploy_worker.web);
|
68
|
-
writeWorkerServerFile(appDirectory, distDirectory, enableWorkerInWeb);
|
69
|
-
}
|
70
|
-
};
|
71
|
-
}
|
72
|
-
});
|
73
|
-
const writeWorkerServerFile = (appDirectory, distDirectory, enableWorkerInWeb) => {
|
74
|
-
const workServerDir = import_path.default.join(distDirectory, import_constants.WORKER_SERVER);
|
75
|
-
const serverHookDir = import_path.default.join(appDirectory, import_utils.SERVER_DIR, import_constants.WEB_APP_NAME);
|
76
|
-
const isExistsServerHook = import_utils.fs.existsSync(`${serverHookDir}.ts`) || import_utils.fs.existsSync(`${serverHookDir}.js`);
|
77
|
-
const relativePath = import_path.default.relative(workServerDir, serverHookDir);
|
78
|
-
import_utils.fs.removeSync(workServerDir);
|
79
|
-
import_utils.fs.mkdirSync(workServerDir);
|
80
|
-
import_utils.fs.writeFileSync(import_path.default.join(workServerDir, import_constants.WORKER_SERVER_ENTRY), (0, import_code.worker)());
|
81
|
-
const routeJSON = import_path.default.join(distDirectory, import_utils.ROUTE_SPEC_FILE);
|
82
|
-
const { routes } = import_utils.fs.readJSONSync(routeJSON);
|
83
|
-
let importStr = ``;
|
84
|
-
let pageStr = ``;
|
85
|
-
const routeArr = [];
|
86
|
-
if (isExistsServerHook && !enableWorkerInWeb) {
|
87
|
-
importStr += `import * as ${import_constants.SERVER_HOOKS} from '${relativePath}'
|
88
|
-
`;
|
89
|
-
}
|
90
|
-
routes.forEach((route) => {
|
91
|
-
if (route.isSSR) {
|
92
|
-
importStr += `import { serverRender as ${route.entryName}ServerRender } from "../${route.worker}";
|
93
|
-
`;
|
94
|
-
}
|
95
|
-
if (!route.isApi) {
|
96
|
-
importStr += `import ${route.entryName}template from "../${route.entryPath}";
|
97
|
-
`;
|
98
|
-
pageStr += `"${route.urlPath}": {
|
99
|
-
${isExistsServerHook && !enableWorkerInWeb ? `${import_constants.SERVER_HOOKS},` : ""}
|
100
|
-
entryName: "${route.entryName}",
|
101
|
-
template: ${route.entryName}template,
|
102
|
-
serverRender: ${route.isSSR ? `${route.entryName}ServerRender` : void 0},
|
103
|
-
},`;
|
104
|
-
routeArr.push({
|
105
|
-
entryName: route.entryName,
|
106
|
-
isSSR: route.isSSR,
|
107
|
-
urlPath: route.urlPath
|
108
|
-
});
|
109
|
-
}
|
110
|
-
});
|
111
|
-
const manifest = `
|
112
|
-
${importStr}
|
113
|
-
|
114
|
-
export const manifest = {
|
115
|
-
pages: {
|
116
|
-
${pageStr}
|
117
|
-
},
|
118
|
-
routes: ${JSON.stringify(routeArr, null, " ")}
|
119
|
-
}
|
120
|
-
`;
|
121
|
-
import_utils.fs.writeFileSync(import_path.default.join(workServerDir, import_constants.MANIFEST_FILE), manifest);
|
122
|
-
const pkg = import_utils.fs.readJSONSync(import_path.default.join(appDirectory, import_constants.PKG_FILE));
|
123
|
-
import_utils.fs.writeFileSync(import_path.default.join(distDirectory, import_constants.WRANGLER_FILE), `name = "${pkg.name}"
|
124
|
-
main = "${import_path.default.join(import_constants.WORKER_SERVER, import_constants.WORKER_SERVER_ENTRY)}"
|
125
|
-
compatibility_date = "${(/* @__PURE__ */ new Date()).toISOString().substring(0, 10)}"
|
126
|
-
`);
|
127
|
-
};
|
128
|
-
var src_default = workerPlugin;
|
129
|
-
// Annotate the CommonJS export names for ESM import in node:
|
130
|
-
0 && (module.exports = {
|
131
|
-
workerPlugin
|
132
|
-
});
|
package/dist/esm/code.js
DELETED
@@ -1,31 +0,0 @@
|
|
1
|
-
const worker = () => `
|
2
|
-
// work entry code
|
3
|
-
import { createHandler } from "@modern-js/prod-server/worker";
|
4
|
-
import loadableStats from "../loadable-stats.json";
|
5
|
-
import routeManifest from "../routes-manifest.json";
|
6
|
-
import { manifest } from "./manifest";
|
7
|
-
|
8
|
-
const handler = createHandler(manifest);
|
9
|
-
|
10
|
-
async function handleRequest(request) {
|
11
|
-
const options = {
|
12
|
-
request,
|
13
|
-
loadableStats,
|
14
|
-
routeManifest,
|
15
|
-
}
|
16
|
-
|
17
|
-
const { body, status, headers } = await handler(options);
|
18
|
-
|
19
|
-
return new Response(body, {
|
20
|
-
status,
|
21
|
-
headers,
|
22
|
-
});
|
23
|
-
}
|
24
|
-
|
25
|
-
addEventListener("fetch", (event) => {
|
26
|
-
event.respondWith(handleRequest(event.request));
|
27
|
-
});
|
28
|
-
`;
|
29
|
-
export {
|
30
|
-
worker
|
31
|
-
};
|
package/dist/esm/constants.js
DELETED
@@ -1,16 +0,0 @@
|
|
1
|
-
const WORKER_SERVER = "worker-server";
|
2
|
-
const WORKER_SERVER_ENTRY = "index.js";
|
3
|
-
const MANIFEST_FILE = "manifest.js";
|
4
|
-
const PKG_FILE = "package.json";
|
5
|
-
const WRANGLER_FILE = "wrangler.toml";
|
6
|
-
const WEB_APP_NAME = "index";
|
7
|
-
const SERVER_HOOKS = "serverHooks";
|
8
|
-
export {
|
9
|
-
MANIFEST_FILE,
|
10
|
-
PKG_FILE,
|
11
|
-
SERVER_HOOKS,
|
12
|
-
WEB_APP_NAME,
|
13
|
-
WORKER_SERVER,
|
14
|
-
WORKER_SERVER_ENTRY,
|
15
|
-
WRANGLER_FILE
|
16
|
-
};
|
package/dist/esm/index.js
DELETED
@@ -1,98 +0,0 @@
|
|
1
|
-
import path from "path";
|
2
|
-
import { fs, isServiceWorker, ROUTE_SPEC_FILE, SERVER_DIR } from "@modern-js/utils";
|
3
|
-
import { MANIFEST_FILE, PKG_FILE, SERVER_HOOKS, WEB_APP_NAME, WORKER_SERVER, WORKER_SERVER_ENTRY, WRANGLER_FILE } from "./constants";
|
4
|
-
import { worker } from "./code";
|
5
|
-
const workerPlugin = () => ({
|
6
|
-
name: "@modern-js/plugin-worker",
|
7
|
-
setup: (ctx) => {
|
8
|
-
return {
|
9
|
-
async config() {
|
10
|
-
return {
|
11
|
-
output: {
|
12
|
-
disableNodePolyfill: false
|
13
|
-
}
|
14
|
-
};
|
15
|
-
},
|
16
|
-
async afterDev() {
|
17
|
-
var _configContext_deploy_worker;
|
18
|
-
const { appDirectory, distDirectory } = ctx.useAppContext();
|
19
|
-
const configContext = ctx.useResolvedConfigContext();
|
20
|
-
if (!isServiceWorker(configContext)) {
|
21
|
-
return;
|
22
|
-
}
|
23
|
-
const enableWorkerInWeb = configContext.deploy.enableWorker || ((_configContext_deploy_worker = configContext.deploy.worker) === null || _configContext_deploy_worker === void 0 ? void 0 : _configContext_deploy_worker.web);
|
24
|
-
writeWorkerServerFile(appDirectory, distDirectory, enableWorkerInWeb);
|
25
|
-
},
|
26
|
-
async afterBuild() {
|
27
|
-
var _configContext_deploy_worker;
|
28
|
-
const { appDirectory, distDirectory } = ctx.useAppContext();
|
29
|
-
const configContext = ctx.useResolvedConfigContext();
|
30
|
-
if (!isServiceWorker(configContext)) {
|
31
|
-
return;
|
32
|
-
}
|
33
|
-
const enableWorkerInWeb = configContext.deploy.enableWorker || ((_configContext_deploy_worker = configContext.deploy.worker) === null || _configContext_deploy_worker === void 0 ? void 0 : _configContext_deploy_worker.web);
|
34
|
-
writeWorkerServerFile(appDirectory, distDirectory, enableWorkerInWeb);
|
35
|
-
}
|
36
|
-
};
|
37
|
-
}
|
38
|
-
});
|
39
|
-
const writeWorkerServerFile = (appDirectory, distDirectory, enableWorkerInWeb) => {
|
40
|
-
const workServerDir = path.join(distDirectory, WORKER_SERVER);
|
41
|
-
const serverHookDir = path.join(appDirectory, SERVER_DIR, WEB_APP_NAME);
|
42
|
-
const isExistsServerHook = fs.existsSync(`${serverHookDir}.ts`) || fs.existsSync(`${serverHookDir}.js`);
|
43
|
-
const relativePath = path.relative(workServerDir, serverHookDir);
|
44
|
-
fs.removeSync(workServerDir);
|
45
|
-
fs.mkdirSync(workServerDir);
|
46
|
-
fs.writeFileSync(path.join(workServerDir, WORKER_SERVER_ENTRY), worker());
|
47
|
-
const routeJSON = path.join(distDirectory, ROUTE_SPEC_FILE);
|
48
|
-
const { routes } = fs.readJSONSync(routeJSON);
|
49
|
-
let importStr = ``;
|
50
|
-
let pageStr = ``;
|
51
|
-
const routeArr = [];
|
52
|
-
if (isExistsServerHook && !enableWorkerInWeb) {
|
53
|
-
importStr += `import * as ${SERVER_HOOKS} from '${relativePath}'
|
54
|
-
`;
|
55
|
-
}
|
56
|
-
routes.forEach((route) => {
|
57
|
-
if (route.isSSR) {
|
58
|
-
importStr += `import { serverRender as ${route.entryName}ServerRender } from "../${route.worker}";
|
59
|
-
`;
|
60
|
-
}
|
61
|
-
if (!route.isApi) {
|
62
|
-
importStr += `import ${route.entryName}template from "../${route.entryPath}";
|
63
|
-
`;
|
64
|
-
pageStr += `"${route.urlPath}": {
|
65
|
-
${isExistsServerHook && !enableWorkerInWeb ? `${SERVER_HOOKS},` : ""}
|
66
|
-
entryName: "${route.entryName}",
|
67
|
-
template: ${route.entryName}template,
|
68
|
-
serverRender: ${route.isSSR ? `${route.entryName}ServerRender` : void 0},
|
69
|
-
},`;
|
70
|
-
routeArr.push({
|
71
|
-
entryName: route.entryName,
|
72
|
-
isSSR: route.isSSR,
|
73
|
-
urlPath: route.urlPath
|
74
|
-
});
|
75
|
-
}
|
76
|
-
});
|
77
|
-
const manifest = `
|
78
|
-
${importStr}
|
79
|
-
|
80
|
-
export const manifest = {
|
81
|
-
pages: {
|
82
|
-
${pageStr}
|
83
|
-
},
|
84
|
-
routes: ${JSON.stringify(routeArr, null, " ")}
|
85
|
-
}
|
86
|
-
`;
|
87
|
-
fs.writeFileSync(path.join(workServerDir, MANIFEST_FILE), manifest);
|
88
|
-
const pkg = fs.readJSONSync(path.join(appDirectory, PKG_FILE));
|
89
|
-
fs.writeFileSync(path.join(distDirectory, WRANGLER_FILE), `name = "${pkg.name}"
|
90
|
-
main = "${path.join(WORKER_SERVER, WORKER_SERVER_ENTRY)}"
|
91
|
-
compatibility_date = "${(/* @__PURE__ */ new Date()).toISOString().substring(0, 10)}"
|
92
|
-
`);
|
93
|
-
};
|
94
|
-
var src_default = workerPlugin;
|
95
|
-
export {
|
96
|
-
src_default as default,
|
97
|
-
workerPlugin
|
98
|
-
};
|
package/dist/types/code.d.ts
DELETED
@@ -1 +0,0 @@
|
|
1
|
-
export declare const worker: () => string;
|
@@ -1,7 +0,0 @@
|
|
1
|
-
export declare const WORKER_SERVER = "worker-server";
|
2
|
-
export declare const WORKER_SERVER_ENTRY = "index.js";
|
3
|
-
export declare const MANIFEST_FILE = "manifest.js";
|
4
|
-
export declare const PKG_FILE = "package.json";
|
5
|
-
export declare const WRANGLER_FILE = "wrangler.toml";
|
6
|
-
export declare const WEB_APP_NAME = "index";
|
7
|
-
export declare const SERVER_HOOKS = "serverHooks";
|
package/dist/types/index.d.ts
DELETED