@modern-js/server-core 2.0.0-beta.7 → 2.0.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/CHANGELOG.md CHANGED
@@ -1,5 +1,20 @@
1
1
  # @modern-js/server-plugin
2
2
 
3
+ ## 2.0.0
4
+
5
+ ### Major Changes
6
+
7
+ - dda38c9c3e: chore: v2
8
+
9
+ ### Patch Changes
10
+
11
+ - Updated dependencies [edd1cfb1af]
12
+ - Updated dependencies [dda38c9c3e]
13
+ - Updated dependencies [ffb2ed4]
14
+ - Updated dependencies [bbe4c4ab64]
15
+ - @modern-js/utils@2.0.0
16
+ - @modern-js/plugin@2.0.0
17
+
3
18
  ## 2.0.0-beta.7
4
19
 
5
20
  ### Major Changes
@@ -5,30 +5,30 @@ import { CommonAPI, ToThreads, AsyncSetup, PluginOptions } from '@modern-js/plug
5
5
  import type { ModernServerContext, BaseSSRServerContext, AfterMatchContext, AfterRenderContext, MiddlewareContext, ISAppContext, ServerRoute } from '@modern-js/types';
6
6
  import type { Options } from 'http-proxy-middleware';
7
7
  import type { ServerOptions, UserConfig } from './types/config';
8
- export declare type WebAdapter = (ctx: MiddlewareContext) => void | Promise<void>;
9
- export declare type Adapter = (req: IncomingMessage, res: ServerResponse) => void | Promise<void>;
10
- export declare type WebServerStartInput = {
8
+ export type WebAdapter = (ctx: MiddlewareContext) => void | Promise<void>;
9
+ export type Adapter = (req: IncomingMessage, res: ServerResponse) => void | Promise<void>;
10
+ export type WebServerStartInput = {
11
11
  pwd: string;
12
12
  config: Record<string, any>;
13
13
  };
14
- export declare type BeforeRouteHandler = (context: ModernServerContext) => Promise<void>;
15
- export declare type APIServerStartInput = {
14
+ export type BeforeRouteHandler = (context: ModernServerContext) => Promise<void>;
15
+ export type APIServerStartInput = {
16
16
  pwd: string;
17
17
  prefix?: string;
18
18
  config?: {
19
19
  middleware?: Array<any>;
20
20
  };
21
21
  };
22
- declare type Change = {
22
+ type Change = {
23
23
  filename: string;
24
24
  event: 'add' | 'change' | 'unlink';
25
25
  };
26
- export declare type Route = Record<string, unknown>;
27
- export declare type RequestResult = {
26
+ export type Route = Record<string, unknown>;
27
+ export type RequestResult = {
28
28
  isfinish: boolean;
29
29
  };
30
- export declare type SSRServerContext = Record<string, unknown>;
31
- export declare type RenderContext = Record<string, unknown>;
30
+ export type SSRServerContext = Record<string, unknown>;
31
+ export type RenderContext = Record<string, unknown>;
32
32
  export declare const AppContext: import("@modern-js/plugin").Context<ISAppContext>;
33
33
  export declare const setAppContext: (value: ISAppContext) => void;
34
34
  export declare const ConfigContext: import("@modern-js/plugin").Context<UserConfig>;
@@ -102,13 +102,13 @@ declare const serverHooks: {
102
102
  };
103
103
  /** All hooks of server plugin. */
104
104
 
105
- export declare type ServerHooks = typeof serverHooks;
105
+ export type ServerHooks = typeof serverHooks;
106
106
  /** All hook callbacks of server plugin. */
107
107
 
108
- export declare type ServerHookCallbacks = ToThreads<ServerHooks>;
108
+ export type ServerHookCallbacks = ToThreads<ServerHooks>;
109
109
  /** All apis for server plugin. */
110
110
 
111
- export declare type PluginAPI = typeof pluginAPI & CommonAPI<ServerHooks>;
111
+ export type PluginAPI = typeof pluginAPI & CommonAPI<ServerHooks>;
112
112
  export declare const createServerManager: () => import("@modern-js/plugin").AsyncManager<{
113
113
  gather: import("@modern-js/plugin").ParallelWorkflow<{
114
114
  addWebMiddleware: (_input: any) => void;
@@ -225,8 +225,8 @@ export declare const serverManager: import("@modern-js/plugin").AsyncManager<{
225
225
  }>;
226
226
  /** Plugin options of a server plugin. */
227
227
 
228
- export declare type ServerPlugin = PluginOptions<ServerHooks, AsyncSetup<ServerHooks, PluginAPI>>;
229
- export declare type ServerConfig = {
228
+ export type ServerPlugin = PluginOptions<ServerHooks, AsyncSetup<ServerHooks, PluginAPI>>;
229
+ export type ServerConfig = {
230
230
  bff?: Partial<{
231
231
  proxy: Record<string, Options>;
232
232
  }>;
@@ -2,4 +2,4 @@ export interface BffUserConfig {
2
2
  prefix?: string;
3
3
  proxy?: Record<string, string>;
4
4
  }
5
- export declare type BffNormalizedConfig = BffUserConfig;
5
+ export type BffNormalizedConfig = BffUserConfig;
@@ -2,4 +2,4 @@ export interface HtmlUserConfig {
2
2
  favicon?: string;
3
3
  faviconByEntries?: Record<string, string | undefined>;
4
4
  }
5
- export declare type HtmlNormalizedConfig = HtmlUserConfig;
5
+ export type HtmlNormalizedConfig = HtmlUserConfig;
@@ -13,7 +13,7 @@ export * from './tools';
13
13
  interface RuntimeUserConfig {
14
14
  [property: string]: any;
15
15
  }
16
- declare type RuntimeNormalizedConfig = RuntimeUserConfig;
16
+ type RuntimeNormalizedConfig = RuntimeUserConfig;
17
17
  export interface UserConfig {
18
18
  output?: OutputUserConfig;
19
19
  source?: SourceUserConfig;
@@ -23,7 +23,7 @@ export interface UserConfig {
23
23
  html?: HtmlUserConfig;
24
24
  bff?: BffUserConfig;
25
25
  }
26
- export declare type ServerOptions = {
26
+ export type ServerOptions = {
27
27
  output: OutputNormalizedConfig;
28
28
  source: SourceNormalizedConfig;
29
29
  tools: ToolsNormalizedConfig;
@@ -14,4 +14,4 @@ export interface OutputUserConfig {
14
14
  assetPrefix?: string;
15
15
  polyfill?: 'entry' | 'usage' | 'ua' | 'off';
16
16
  }
17
- export declare type OutputNormalizedConfig = OutputUserConfig;
17
+ export type OutputNormalizedConfig = OutputUserConfig;
@@ -1,14 +1,14 @@
1
1
  import type { WatchOptions } from '@modern-js/utils';
2
- declare type Route = string | string[] | {
2
+ type Route = string | string[] | {
3
3
  route?: string | string[];
4
4
  disableSpa?: boolean;
5
5
  resHeaders?: Record<string, unknown>;
6
6
  };
7
- export declare type Routes = Record<string, Route>;
8
- export declare type SSR = boolean | {
7
+ export type Routes = Record<string, Route>;
8
+ export type SSR = boolean | {
9
9
  mode?: 'string' | 'stream';
10
10
  };
11
- export declare type SSRByEntries = Record<string, SSR>;
11
+ export type SSRByEntries = Record<string, SSR>;
12
12
  export interface ServerUserConfig {
13
13
  routes?: Routes;
14
14
  publicRoutes?: Record<string, string>;
@@ -21,7 +21,7 @@ export interface ServerUserConfig {
21
21
  enableMicroFrontendDebug?: boolean;
22
22
  watchOptions?: WatchOptions;
23
23
  compiler?: 'babel' | 'typescript';
24
- disableFrameworkExt?: boolean;
24
+ enableFrameworkExt?: boolean;
25
25
  }
26
- export declare type ServerNormalizedConfig = ServerUserConfig;
26
+ export type ServerNormalizedConfig = ServerUserConfig;
27
27
  export {};
@@ -1,3 +1,3 @@
1
- declare type ArrayOrNot<T> = T | T[];
2
- export declare type ChainedConfig<Config, Utils = unknown> = ArrayOrNot<Config | (keyof Utils extends never ? (config: Config) => Config | void : (config: Config, utils: Utils) => Config | void)>;
1
+ type ArrayOrNot<T> = T | T[];
2
+ export type ChainedConfig<Config, Utils = unknown> = ArrayOrNot<Config | (keyof Utils extends never ? (config: Config) => Config | void : (config: Config, utils: Utils) => Config | void)>;
3
3
  export {};
@@ -1,15 +1,15 @@
1
1
  import type { Alias } from '@modern-js/utils';
2
2
  import type { ChainedConfig } from './share';
3
- declare type JSONPrimitive = string | number | boolean | null;
4
- declare type JSONArray = Array<JSONValue>;
5
- declare type JSONObject = {
3
+ type JSONPrimitive = string | number | boolean | null;
4
+ type JSONArray = Array<JSONValue>;
5
+ type JSONObject = {
6
6
  [key: string]: JSONValue;
7
7
  };
8
- declare type JSONValue = JSONPrimitive | JSONObject | JSONArray;
8
+ type JSONValue = JSONPrimitive | JSONObject | JSONArray;
9
9
  export interface SourceUserConfig {
10
10
  alias?: ChainedConfig<Alias>;
11
11
  define?: Record<string, any>;
12
12
  globalVars?: Record<string, JSONValue>;
13
13
  }
14
- export declare type SourceNormalizedConfig = SourceUserConfig;
14
+ export type SourceNormalizedConfig = SourceUserConfig;
15
15
  export {};
@@ -1,9 +1,9 @@
1
1
  import { BabelConfigUtils } from '@modern-js/babel-preset-app';
2
2
  import { BabelTransformOptions } from '@modern-js/types/common';
3
3
  import { ChainedConfig } from './share';
4
- declare type ToolsBabelConfig = ChainedConfig<BabelTransformOptions, BabelConfigUtils>;
4
+ type ToolsBabelConfig = ChainedConfig<BabelTransformOptions, BabelConfigUtils>;
5
5
  export interface ToolsUserConfig {
6
6
  babel?: ToolsBabelConfig;
7
7
  }
8
- export declare type ToolsNormalizedConfig = ToolsUserConfig;
8
+ export type ToolsNormalizedConfig = ToolsUserConfig;
9
9
  export {};
package/package.json CHANGED
@@ -11,7 +11,7 @@
11
11
  "modern",
12
12
  "modern.js"
13
13
  ],
14
- "version": "2.0.0-beta.7",
14
+ "version": "2.0.0",
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
  },
31
31
  "dependencies": {
32
- "@modern-js/plugin": "2.0.0-beta.7",
33
- "@modern-js/utils": "2.0.0-beta.7"
32
+ "@modern-js/plugin": "2.0.0",
33
+ "@modern-js/utils": "2.0.0"
34
34
  },
35
35
  "devDependencies": {
36
36
  "@types/jest": "^27",
@@ -39,10 +39,10 @@
39
39
  "jest": "^27",
40
40
  "ts-jest": "^27.0.4",
41
41
  "typescript": "^4",
42
- "@modern-js/types": "2.0.0-beta.7",
43
- "@modern-js/babel-preset-app": "2.0.0-beta.7",
44
- "@scripts/jest-config": "2.0.0-beta.7",
45
- "@scripts/build": "2.0.0-beta.7"
42
+ "@modern-js/types": "2.0.0",
43
+ "@modern-js/babel-preset-app": "2.0.0",
44
+ "@scripts/jest-config": "2.0.0",
45
+ "@scripts/build": "2.0.0"
46
46
  },
47
47
  "sideEffects": false,
48
48
  "publishConfig": {