@modern-js/server 2.0.0-beta.7 → 2.0.1

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,34 @@
1
1
  # @modern-js/server
2
2
 
3
+ ## 2.0.1
4
+
5
+ ### Patch Changes
6
+
7
+ - @modern-js/prod-server@2.0.1
8
+ - @modern-js/server-utils@2.0.1
9
+ - @modern-js/types@2.0.1
10
+ - @modern-js/utils@2.0.1
11
+
12
+ ## 2.0.0
13
+
14
+ ### Major Changes
15
+
16
+ - dda38c9c3e: chore: v2
17
+
18
+ ### Patch Changes
19
+
20
+ - Updated dependencies [c9e800d39a]
21
+ - Updated dependencies [edd1cfb1af]
22
+ - Updated dependencies [6bda14ed71]
23
+ - Updated dependencies [dda38c9c3e]
24
+ - Updated dependencies [8b8e1bb571]
25
+ - Updated dependencies [ffb2ed4]
26
+ - Updated dependencies [bbe4c4ab64]
27
+ - @modern-js/prod-server@2.0.0
28
+ - @modern-js/utils@2.0.0
29
+ - @modern-js/types@2.0.0
30
+ - @modern-js/server-utils@2.0.0
31
+
3
32
  ## 2.0.0-beta.7
4
33
 
5
34
  ### Major Changes
@@ -3,7 +3,7 @@
3
3
  import { Server } from 'http';
4
4
  import { EventEmitter } from 'events';
5
5
  import { DevServerOptions, DevMiddlewareAPI, DevMiddleware as CustomDevMiddleware } from '../../types';
6
- declare type Options = {
6
+ type Options = {
7
7
  dev: DevServerOptions;
8
8
  devMiddleware?: CustomDevMiddleware;
9
9
  };
@@ -1,10 +1,10 @@
1
1
  /// <reference types="node" />
2
2
  import { IncomingMessage, ServerResponse } from 'http';
3
3
  import type { ModernServerContext, NextFunction } from '@modern-js/types';
4
- export declare type MockConfig = Record<string, {
4
+ export type MockConfig = Record<string, {
5
5
  data: any;
6
6
  } | ((req: IncomingMessage, res: ServerResponse, next: NextFunction) => Promise<void>)>;
7
- export declare type MockApi = {
7
+ export type MockApi = {
8
8
  method: string;
9
9
  path: string;
10
10
  handler: ReturnType<typeof createFunctionDataHandler | typeof createStaticDataHandler>;
@@ -1,5 +1,5 @@
1
1
  import { FSWatcher, WatchOptions } from '@modern-js/utils';
2
- export declare type WatchEvent = 'add' | 'change' | 'unlink';
2
+ export type WatchEvent = 'add' | 'change' | 'unlink';
3
3
  export declare const defaultWatchOptions: {
4
4
  ignoreInitial: boolean;
5
5
  ignored: RegExp;
@@ -16,7 +16,7 @@ export declare class ModernDevServer extends ModernServer {
16
16
  onInit(runner: ServerHookRunner, app: Server): Promise<void>;
17
17
  private applyDefaultMiddlewares;
18
18
  onRepack(options?: BuildOptions): void;
19
- createHTTPServer(handler: (req: IncomingMessage, res: ServerResponse, next?: () => void) => void): Promise<Server | import("https").Server>;
19
+ createHTTPServer(handler: (req: IncomingMessage, res: ServerResponse, next?: () => void) => void): Promise<Server<typeof IncomingMessage, typeof ServerResponse> | import("https").Server<typeof IncomingMessage, typeof ServerResponse>>;
20
20
  protected warmupSSRBundle(): void;
21
21
  protected onServerChange({
22
22
  filepath,
@@ -3,15 +3,15 @@ import type { IncomingMessage, ServerResponse } from 'http';
3
3
  import type { DevServerOptions, DevServerHttpsOptions, NextFunction } from '@modern-js/types';
4
4
  import type { ModernServerOptions } from '@modern-js/prod-server';
5
5
  export type { DevServerOptions, DevServerHttpsOptions };
6
- declare type Middleware = (req: IncomingMessage, res: ServerResponse, next: NextFunction) => Promise<void>;
7
- export declare type DevMiddlewareAPI = Middleware & {
6
+ type Middleware = (req: IncomingMessage, res: ServerResponse, next: NextFunction) => Promise<void>;
7
+ export type DevMiddlewareAPI = Middleware & {
8
8
  close: (callback: (err: Error | null | undefined) => void) => any;
9
9
  };
10
- export declare type MiddlewareCallbacks = {
10
+ export type MiddlewareCallbacks = {
11
11
  onInvalid: () => void;
12
12
  onDone: (stats: any) => void;
13
13
  };
14
- export declare type DevMiddlewareOptions = {
14
+ export type DevMiddlewareOptions = {
15
15
  /** To ensure HMR works, the devMiddleware need inject the hmr client path into page when HMR enable. */
16
16
  hmrClientPath?: string;
17
17
  /** The options need by compiler middleware (like webpackMiddleware) */
@@ -30,9 +30,9 @@ export declare type DevMiddlewareOptions = {
30
30
  * - Notify server when compiler hooks are triggered.
31
31
  */
32
32
 
33
- export declare type DevMiddleware = (options: DevMiddlewareOptions) => DevMiddlewareAPI;
34
- export declare type ExtraOptions = {
33
+ export type DevMiddleware = (options: DevMiddlewareOptions) => DevMiddlewareAPI;
34
+ export type ExtraOptions = {
35
35
  dev: boolean | Partial<DevServerOptions>;
36
36
  devMiddleware?: DevMiddleware;
37
37
  };
38
- export declare type ModernDevServerOptions = ModernServerOptions & ExtraOptions;
38
+ export type ModernDevServerOptions = ModernServerOptions & ExtraOptions;
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.1",
15
15
  "jsnext:source": "./src/index.ts",
16
16
  "types": "./dist/types/index.d.ts",
17
17
  "main": "./dist/js/node/index.js",
@@ -34,10 +34,10 @@
34
34
  "minimatch": "^3.0.4",
35
35
  "path-to-regexp": "^6.2.0",
36
36
  "ws": "^8.2.0",
37
- "@modern-js/prod-server": "2.0.0-beta.7",
38
- "@modern-js/server-utils": "2.0.0-beta.7",
39
- "@modern-js/types": "2.0.0-beta.7",
40
- "@modern-js/utils": "2.0.0-beta.7"
37
+ "@modern-js/prod-server": "2.0.1",
38
+ "@modern-js/server-utils": "2.0.1",
39
+ "@modern-js/types": "2.0.1",
40
+ "@modern-js/utils": "2.0.1"
41
41
  },
42
42
  "devDependencies": {
43
43
  "@types/connect-history-api-fallback": "^1.3.5",
@@ -52,9 +52,9 @@
52
52
  "typescript": "^4",
53
53
  "webpack": "^5.75.0",
54
54
  "websocket": "^1",
55
- "@modern-js/server-core": "2.0.0-beta.7",
56
- "@scripts/build": "2.0.0-beta.7",
57
- "@scripts/jest-config": "2.0.0-beta.7"
55
+ "@modern-js/server-core": "2.0.1",
56
+ "@scripts/jest-config": "2.0.1",
57
+ "@scripts/build": "2.0.1"
58
58
  },
59
59
  "peerDependencies": {
60
60
  "devcert": "^1.0.0",