@bleedingdev/modern-js-server-core 3.5.0-ultramodern.6 → 3.5.0-ultramodern.76
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/dist/cjs/adapters/node/plugins/static.js +14 -60
- package/dist/cjs/adapters/node/plugins/staticModuleFederation.js +41 -37
- package/dist/cjs/adapters/node/plugins/staticPrecompressed.js +0 -3
- package/dist/cjs/adapters/node/plugins/staticServing.js +183 -0
- package/dist/esm/adapters/node/plugins/static.mjs +14 -60
- package/dist/esm/adapters/node/plugins/staticModuleFederation.mjs +37 -33
- package/dist/esm/adapters/node/plugins/staticPrecompressed.mjs +1 -1
- package/dist/esm/adapters/node/plugins/staticServing.mjs +129 -0
- package/dist/esm/plugins/render/render.mjs +4 -4
- package/dist/esm-node/adapters/node/plugins/static.mjs +14 -60
- package/dist/esm-node/adapters/node/plugins/staticModuleFederation.mjs +37 -33
- package/dist/esm-node/adapters/node/plugins/staticPrecompressed.mjs +1 -1
- package/dist/esm-node/adapters/node/plugins/staticServing.mjs +130 -0
- package/dist/esm-node/plugins/render/render.mjs +2 -2
- package/dist/types/adapters/node/plugins/staticModuleFederation.d.ts +3 -3
- package/dist/types/adapters/node/plugins/staticPrecompressed.d.ts +1 -2
- package/dist/types/adapters/node/plugins/staticServing.d.ts +25 -0
- package/package.json +12 -15
|
@@ -1,13 +1,12 @@
|
|
|
1
1
|
import type { Middleware } from '../../../types';
|
|
2
2
|
type SupportedEncoding = 'br' | 'gzip';
|
|
3
|
-
|
|
3
|
+
type ResolvePreCompressedAssetResult = {
|
|
4
4
|
selected: {
|
|
5
5
|
filepath: string;
|
|
6
6
|
encoding: SupportedEncoding;
|
|
7
7
|
} | null;
|
|
8
8
|
hasVariant: boolean;
|
|
9
9
|
};
|
|
10
|
-
export declare const appendVaryHeader: (c: Parameters<Middleware>[0], value: string) => void;
|
|
11
10
|
export declare const resolvePreCompressedAsset: (c: Parameters<Middleware>[0], filepath: string) => Promise<ResolvePreCompressedAssetResult>;
|
|
12
11
|
export declare const applyPreCompressedAssetHeaders: (c: Parameters<Middleware>[0], preCompressedAsset: ResolvePreCompressedAssetResult) => void;
|
|
13
12
|
export {};
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import type { ServerRoute } from '@modern-js/types';
|
|
2
|
+
import type { Middleware } from '../../../types';
|
|
3
|
+
type MiddlewareContext = Parameters<Middleware>[0];
|
|
4
|
+
type StaticServingRequest = {
|
|
5
|
+
requestPath: string;
|
|
6
|
+
isModuleFederationAsset: boolean;
|
|
7
|
+
isModuleFederationRemoteEntry: boolean;
|
|
8
|
+
};
|
|
9
|
+
type StaticServingOptions = {
|
|
10
|
+
pwd: string;
|
|
11
|
+
pathPrefix: string;
|
|
12
|
+
};
|
|
13
|
+
export declare const servePreCompressedPublicRouteAsset: (c: MiddlewareContext, pwd: string, route: ServerRoute) => Promise<(Response & import("hono").TypedResponse<Uint8Array<ArrayBuffer>, 200, "body">) | null>;
|
|
14
|
+
/**
|
|
15
|
+
* Serves post-build convention assets generated under dist/public at their
|
|
16
|
+
* root URL. This is intentionally independent of config/public and route.json:
|
|
17
|
+
* the generator runs after the route manifest is built.
|
|
18
|
+
*/
|
|
19
|
+
export declare const servePublicDirectoryAsset: (c: MiddlewareContext, pwd: string) => Promise<(Response & import("hono").TypedResponse<null, 200, "body">) | (Response & import("hono").TypedResponse<Uint8Array<ArrayBuffer>, 200, "body">) | null>;
|
|
20
|
+
export declare const createModuleFederationStaticServing: ({ pwd, pathPrefix, }: StaticServingOptions) => {
|
|
21
|
+
resolveRequest: (pathname: string) => Promise<StaticServingRequest | null>;
|
|
22
|
+
serveStaticHit: (c: MiddlewareContext, request: StaticServingRequest) => Promise<(Response & import("hono").TypedResponse<Uint8Array<ArrayBuffer>, 200, "body">) | null>;
|
|
23
|
+
serveModuleFederationAsset: (c: MiddlewareContext, request: StaticServingRequest) => Promise<(Response & import("hono").TypedResponse<Uint8Array<ArrayBuffer>, 200, "body">) | null> | null;
|
|
24
|
+
};
|
|
25
|
+
export {};
|
package/package.json
CHANGED
|
@@ -17,13 +17,12 @@
|
|
|
17
17
|
"modern",
|
|
18
18
|
"modern.js"
|
|
19
19
|
],
|
|
20
|
-
"version": "3.5.0-ultramodern.
|
|
20
|
+
"version": "3.5.0-ultramodern.76",
|
|
21
21
|
"types": "./dist/types/index.d.ts",
|
|
22
22
|
"main": "./dist/cjs/index.js",
|
|
23
23
|
"exports": {
|
|
24
24
|
".": {
|
|
25
25
|
"types": "./dist/types/index.d.ts",
|
|
26
|
-
"modern:source": "./src/index.ts",
|
|
27
26
|
"node": {
|
|
28
27
|
"import": "./dist/esm-node/index.mjs",
|
|
29
28
|
"require": "./dist/cjs/index.js"
|
|
@@ -32,7 +31,6 @@
|
|
|
32
31
|
},
|
|
33
32
|
"./node": {
|
|
34
33
|
"types": "./dist/types/adapters/node/index.d.ts",
|
|
35
|
-
"modern:source": "./src/adapters/node/index.ts",
|
|
36
34
|
"node": {
|
|
37
35
|
"import": "./dist/esm-node/adapters/node/index.mjs",
|
|
38
36
|
"require": "./dist/cjs/adapters/node/index.js"
|
|
@@ -68,31 +66,30 @@
|
|
|
68
66
|
"node": ">=20"
|
|
69
67
|
},
|
|
70
68
|
"dependencies": {
|
|
69
|
+
"@modern-js/plugin": "npm:@bleedingdev/modern-js-plugin@3.5.0-ultramodern.76",
|
|
70
|
+
"@modern-js/runtime-utils": "npm:@bleedingdev/modern-js-runtime-utils@3.5.0-ultramodern.76",
|
|
71
|
+
"@modern-js/utils": "npm:@bleedingdev/modern-js-utils@3.5.0-ultramodern.76",
|
|
71
72
|
"@swc/helpers": "^0.5.23",
|
|
72
73
|
"@web-std/fetch": "^4.2.1",
|
|
73
74
|
"@web-std/file": "^3.0.3",
|
|
74
75
|
"@web-std/stream": "^1.0.3",
|
|
75
76
|
"cloneable-readable": "^3.0.0",
|
|
76
77
|
"flatted": "^3.4.2",
|
|
77
|
-
"hono": "^4.12.
|
|
78
|
-
"ts-deepmerge": "8.0.0"
|
|
79
|
-
"@modern-js/plugin": "npm:@bleedingdev/modern-js-plugin@3.5.0-ultramodern.6",
|
|
80
|
-
"@modern-js/utils": "npm:@bleedingdev/modern-js-utils@3.5.0-ultramodern.6",
|
|
81
|
-
"@modern-js/runtime-utils": "npm:@bleedingdev/modern-js-runtime-utils@3.5.0-ultramodern.6"
|
|
78
|
+
"hono": "^4.12.28",
|
|
79
|
+
"ts-deepmerge": "8.0.0"
|
|
82
80
|
},
|
|
83
81
|
"devDependencies": {
|
|
84
|
-
"@
|
|
82
|
+
"@modern-js/types": "npm:@bleedingdev/modern-js-types@3.5.0-ultramodern.76",
|
|
83
|
+
"@rslib/core": "0.23.2",
|
|
84
|
+
"@scripts/rstest-config": "2.66.0",
|
|
85
85
|
"@types/cloneable-readable": "^2.0.3",
|
|
86
86
|
"@types/merge-deep": "^3.0.3",
|
|
87
|
-
"@types/node": "^26.
|
|
88
|
-
"@typescript/native-preview": "7.0.0-dev.
|
|
89
|
-
"http-proxy-middleware": "^4.
|
|
90
|
-
"@modern-js/types": "npm:@bleedingdev/modern-js-types@3.5.0-ultramodern.6",
|
|
91
|
-
"@scripts/rstest-config": "2.66.0"
|
|
87
|
+
"@types/node": "^26.1.1",
|
|
88
|
+
"@typescript/native-preview": "7.0.0-dev.20260707.2",
|
|
89
|
+
"http-proxy-middleware": "^4.2.0"
|
|
92
90
|
},
|
|
93
91
|
"sideEffects": false,
|
|
94
92
|
"publishConfig": {
|
|
95
|
-
"registry": "https://registry.npmjs.org/",
|
|
96
93
|
"access": "public"
|
|
97
94
|
},
|
|
98
95
|
"scripts": {
|