@modern-js/types 1.4.0 → 1.5.2

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/.eslintrc.js ADDED
@@ -0,0 +1,8 @@
1
+ module.exports = {
2
+ root: true,
3
+ extends: ['@modern-js'],
4
+ parserOptions: {
5
+ tsconfigRootDir: __dirname,
6
+ project: ['./tsconfig.json'],
7
+ },
8
+ };
package/CHANGELOG.md CHANGED
@@ -1,5 +1,34 @@
1
1
  # @modern-js/types
2
2
 
3
+ ## 1.5.2
4
+
5
+ ### Patch Changes
6
+
7
+ - a4c5fe78: fix test case
8
+ - 6fa74d5f: add internal metrics and logger
9
+
10
+ ## 1.5.1
11
+
12
+ ### Patch Changes
13
+
14
+ - 3d1fac2a: chore: app-tools no longer depend on webpack
15
+
16
+ ## 1.5.0
17
+
18
+ ### Minor Changes
19
+
20
+ - 3bf4f8b0: feat: support start api server only
21
+
22
+ ### Patch Changes
23
+
24
+ - 6cffe99d: chore:
25
+ remove react eslint rules for `modern-js` rule set.
26
+ add .eslintrc for each package to speed up linting
27
+ - 60f7d8bf: feat: add tests dir to npmignore
28
+ - Updated dependencies [6cffe99d]
29
+ - Updated dependencies [60f7d8bf]
30
+ - @modern-js/plugin@1.3.3
31
+
3
32
  ## 1.4.0
4
33
 
5
34
  ### Minor Changes
package/cli/index.d.ts CHANGED
@@ -2,8 +2,6 @@ import { AsyncWaterfall, AsyncWorkflow } from '@modern-js/plugin';
2
2
  import { Compiler, MultiCompiler, Configuration } from 'webpack';
3
3
  import { ServerRoute } from '../server';
4
4
 
5
- export type { Compiler, MultiCompiler, Configuration };
6
-
7
5
  /**
8
6
  * Bundle entrypoint
9
7
  */
@@ -65,7 +63,7 @@ export interface IAppContext {
65
63
  checkedEntries: string[];
66
64
  serverRoutes: ServerRoute[];
67
65
  htmlTemplates: HtmlTemplates;
68
- existSrc: boolean;
66
+ apiOnly: boolean;
69
67
  internalDirAlias: string;
70
68
  internalSrcAlias: string;
71
69
  }
package/package.json CHANGED
@@ -11,10 +11,10 @@
11
11
  "modern",
12
12
  "modern.js"
13
13
  ],
14
- "version": "1.4.0",
14
+ "version": "1.5.2",
15
15
  "types": "./index.d.ts",
16
16
  "dependencies": {
17
- "@modern-js/plugin": "^1.3.2",
17
+ "@modern-js/plugin": "^1.3.3",
18
18
  "http-proxy-middleware": "^2.0.4",
19
19
  "webpack": "^5.54.0"
20
20
  },
@@ -59,8 +59,23 @@ export type BaseSSRServerContext = {
59
59
  distDir: string;
60
60
  template: string;
61
61
  entryName: string;
62
- logger: Logger;
63
- metrics?: Metrics;
62
+ logger: {
63
+ error: (message: string, e: Error | string) => void;
64
+ debug: (message: string, ...args: any[]) => void;
65
+ info: (message: string, ...args: any[]) => void;
66
+ };
67
+ metrics: {
68
+ emitTimer: (
69
+ name: string,
70
+ cost: number,
71
+ tags: Record<string, unknown> = {},
72
+ ) => void;
73
+ emitCounter: (
74
+ name: string,
75
+ counter: number,
76
+ tags: Record<string, unknown> = {},
77
+ ) => void;
78
+ };
64
79
  loadableManifest?: string;
65
80
  cacheConfig?: any;
66
81
  };
package/server/utils.d.ts CHANGED
@@ -1,8 +1,8 @@
1
1
  import { IncomingMessage, ServerResponse } from 'http';
2
2
 
3
3
  export type Metrics = {
4
- counter: () => void;
5
- timer: () => void;
4
+ emitCounter: (name: string, value: number, tags: Record<string, any>) => void;
5
+ emitTimer: (name: string, value: number, tags: Record<string, any>) => void;
6
6
  gauges: () => void;
7
7
  };
8
8
 
package/tsconfig.json CHANGED
@@ -6,5 +6,5 @@
6
6
  "baseUrl": "./",
7
7
  "paths": {}
8
8
  },
9
- "include": ["src"]
9
+ "include": ["cli", "server"]
10
10
  }