@modern-js/plugin-ssg 2.41.0 → 2.42.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/dist/types/index.d.ts +1 -1
- package/dist/types/libs/make.d.ts +1 -1
- package/dist/types/libs/output.d.ts +1 -1
- package/dist/types/libs/replace.d.ts +1 -1
- package/dist/types/libs/util.d.ts +11 -11
- package/dist/types/server/consts.d.ts +1 -1
- package/dist/types/server/index.d.ts +1 -1
- package/dist/types/server/prerender.d.ts +7 -7
- package/dist/types/server/process.d.ts +1 -1
- package/dist/types/types.d.ts +13 -13
- package/package.json +7 -7
package/dist/types/index.d.ts
CHANGED
|
@@ -2,4 +2,4 @@ import { ServerRoute as ModernRoute } from '@modern-js/types';
|
|
|
2
2
|
import { compile } from '../server/prerender';
|
|
3
3
|
import { SSGRouteOptions, SsgRoute } from '../types';
|
|
4
4
|
export declare function makeRender(ssgRoutes: SsgRoute[], render: ReturnType<typeof compile>, port: number): Promise<string>[];
|
|
5
|
-
export declare function makeRoute(baseRoute: ModernRoute, route: string | SSGRouteOptions, headers?: Record<string, any>): SsgRoute;
|
|
5
|
+
export declare function makeRoute(baseRoute: ModernRoute, route: string | SSGRouteOptions, headers?: Record<string, any>): SsgRoute;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import { SsgRoute } from '../types';
|
|
2
|
-
export declare function writeHtmlFile(htmlAry: string[], ssgRoutes: SsgRoute[], baseDir: string): void;
|
|
2
|
+
export declare function writeHtmlFile(htmlAry: string[], ssgRoutes: SsgRoute[], baseDir: string): void;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import { ServerRoute as ModernRoute } from '@modern-js/types';
|
|
2
2
|
import { SsgRoute } from '../types';
|
|
3
3
|
export declare function exist(route: ModernRoute, pageRoutes: ModernRoute[]): number;
|
|
4
|
-
export declare function replaceRoute(ssgRoutes: SsgRoute[], pageRoutes: ModernRoute[]): ModernRoute[];
|
|
4
|
+
export declare function replaceRoute(ssgRoutes: SsgRoute[], pageRoutes: ModernRoute[]): ModernRoute[];
|
|
@@ -11,15 +11,15 @@ export declare const writeJSONSpec: (dir: string, routes: ModernRoute[]) => void
|
|
|
11
11
|
export declare const replaceWithAlias: (base: string, filePath: string, alias: string) => string;
|
|
12
12
|
export declare const standardOptions: (ssgOptions: SSGConfig, entrypoints: EntryPoint[], routes: ModernRoute[], server: ServerUserConfig) => false | SSGMultiEntryOptions;
|
|
13
13
|
export declare const openRouteSSR: (routes: ModernRoute[], entries?: string[]) => {
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
14
|
+
isSSR: boolean;
|
|
15
|
+
bundle: string;
|
|
16
|
+
entryName?: string | undefined;
|
|
17
|
+
urlPath: string;
|
|
18
|
+
entryPath: string;
|
|
19
|
+
isSPA?: boolean | undefined;
|
|
20
|
+
isStream?: boolean | undefined;
|
|
21
|
+
isApi?: boolean | undefined;
|
|
22
|
+
worker?: string | undefined;
|
|
23
|
+
responseHeaders?: Record<string, unknown> | undefined;
|
|
24
24
|
}[];
|
|
25
|
-
export declare const flattenRoutes: (routes: AgreedRoute[]) => AgreedRoute[];
|
|
25
|
+
export declare const flattenRoutes: (routes: AgreedRoute[]) => AgreedRoute[];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const CLOSE_SIGN = "modern_close_server";
|
|
1
|
+
export declare const CLOSE_SIGN = "modern_close_server";
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import type { AppNormalizedConfig, PluginAPI, AppTools } from '@modern-js/app-tools';
|
|
2
2
|
import { ServerRoute as ModernRoute } from '@modern-js/types';
|
|
3
3
|
import { SsgRoute } from '../types';
|
|
4
|
-
export declare const createServer: (api: PluginAPI<AppTools>, ssgRoutes: SsgRoute[], pageRoutes: ModernRoute[], apiRoutes: ModernRoute[], options: AppNormalizedConfig, appDirectory: string) => Promise<string[]>;
|
|
4
|
+
export declare const createServer: (api: PluginAPI<AppTools>, ssgRoutes: SsgRoute[], pageRoutes: ModernRoute[], apiRoutes: ModernRoute[], options: AppNormalizedConfig, appDirectory: string) => Promise<string[]>;
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { IncomingMessage, ServerResponse } from 'http';
|
|
2
2
|
export type Options = {
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
3
|
+
url: string;
|
|
4
|
+
headers: {
|
|
5
|
+
host: string;
|
|
6
|
+
[key: string]: string;
|
|
7
|
+
};
|
|
8
|
+
[propName: string]: any;
|
|
9
9
|
};
|
|
10
|
-
export declare const compile: (requestHandler: (req: IncomingMessage, res: ServerResponse) => void) => (options: Options, extend?: {}) => Promise<string>;
|
|
10
|
+
export declare const compile: (requestHandler: (req: IncomingMessage, res: ServerResponse) => void) => (options: Options, extend?: {}) => Promise<string>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export {};
|
|
1
|
+
export {};
|
package/dist/types/types.d.ts
CHANGED
|
@@ -1,24 +1,24 @@
|
|
|
1
1
|
import type { ServerRoute as ModernRoute } from '@modern-js/types';
|
|
2
2
|
import { SSGConfig, SSGRouteOptions, SSGMultiEntryOptions, SSGSingleEntryOptions } from '@modern-js/types';
|
|
3
|
-
export type { SSGConfig, SSGRouteOptions, SSGMultiEntryOptions, SSGSingleEntryOptions };
|
|
3
|
+
export type { SSGConfig, SSGRouteOptions, SSGMultiEntryOptions, SSGSingleEntryOptions, };
|
|
4
4
|
export type AgreedRoute = {
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
5
|
+
path?: string;
|
|
6
|
+
component?: string;
|
|
7
|
+
_component?: string;
|
|
8
|
+
children?: AgreedRoute[];
|
|
9
|
+
exact?: boolean;
|
|
10
10
|
};
|
|
11
11
|
export type EntryPoint = {
|
|
12
|
-
|
|
13
|
-
|
|
12
|
+
entryName: string;
|
|
13
|
+
entry: string;
|
|
14
14
|
};
|
|
15
15
|
export type AgreedRouteMap = {
|
|
16
|
-
|
|
16
|
+
[propNames: string]: AgreedRoute[];
|
|
17
17
|
};
|
|
18
18
|
export type SsgRoute = ModernRoute & {
|
|
19
|
-
|
|
20
|
-
|
|
19
|
+
output: string;
|
|
20
|
+
headers?: Record<string, string>;
|
|
21
21
|
};
|
|
22
22
|
export type ExtendOutputConfig = {
|
|
23
|
-
|
|
24
|
-
};
|
|
23
|
+
ssg: SSGConfig;
|
|
24
|
+
};
|
package/package.json
CHANGED
|
@@ -15,7 +15,7 @@
|
|
|
15
15
|
"modern",
|
|
16
16
|
"modern.js"
|
|
17
17
|
],
|
|
18
|
-
"version": "2.
|
|
18
|
+
"version": "2.42.0",
|
|
19
19
|
"jsnext:source": "./src/index.ts",
|
|
20
20
|
"types": "./dist/types/index.d.ts",
|
|
21
21
|
"main": "./dist/cjs/index.js",
|
|
@@ -63,7 +63,7 @@
|
|
|
63
63
|
"normalize-path": "3.0.0",
|
|
64
64
|
"portfinder": "^1.0.28",
|
|
65
65
|
"@swc/helpers": "0.5.3",
|
|
66
|
-
"@modern-js/utils": "2.
|
|
66
|
+
"@modern-js/utils": "2.42.0"
|
|
67
67
|
},
|
|
68
68
|
"peerDependencies": {
|
|
69
69
|
"react-router-dom": ">=5.1.2"
|
|
@@ -81,11 +81,11 @@
|
|
|
81
81
|
"react-dom": "^18",
|
|
82
82
|
"react-router-dom": "6.17.0",
|
|
83
83
|
"typescript": "^5",
|
|
84
|
-
"@modern-js/
|
|
85
|
-
"@modern-js/
|
|
86
|
-
"@
|
|
87
|
-
"@scripts/jest-config": "2.
|
|
88
|
-
"@
|
|
84
|
+
"@modern-js/app-tools": "2.42.0",
|
|
85
|
+
"@modern-js/types": "2.42.0",
|
|
86
|
+
"@scripts/build": "2.42.0",
|
|
87
|
+
"@scripts/jest-config": "2.42.0",
|
|
88
|
+
"@modern-js/prod-server": "2.42.0"
|
|
89
89
|
},
|
|
90
90
|
"sideEffects": false,
|
|
91
91
|
"publishConfig": {
|