@rsdoctor/types 0.1.0 → 0.1.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/README.md +10 -3
- package/dist/constants.js +1 -1
- package/dist/logger.d.ts +0 -25
- package/dist/logger.js +1 -4
- package/dist/plugin/baseCompiler.d.ts +12 -6
- package/dist/plugin/baseLoader.d.ts +4 -2
- package/dist/sdk/config.d.ts +3 -1
- package/package.json +9 -2
package/README.md
CHANGED
|
@@ -1,11 +1,18 @@
|
|
|
1
|
-
# Rsdoctor
|
|
1
|
+
# Rsdoctor Types
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
This package is the Rsdoctor‘s types package.
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
## features
|
|
6
|
+
|
|
7
|
+
- Rsdoctor is a one-stop tool for diagnosing and analyzing the build process and build artifacts.
|
|
8
|
+
- Rsdoctor is a tool that supports Webpack and Rspack build analysis.
|
|
9
|
+
- Rsdoctor is an analysis tool that can display the time-consuming and behavioral details of the compilation.
|
|
10
|
+
- Rsdoctor is a tool that provides bundle Diff and other anti-degradation capabilities simultaneously.
|
|
6
11
|
|
|
7
12
|
## Documentation
|
|
8
13
|
|
|
14
|
+
https://rsdoctor.dev/
|
|
15
|
+
|
|
9
16
|
## Contributing
|
|
10
17
|
|
|
11
18
|
Please read the [Contributing Guide](https://github.com/web-infra-dev/rsdoctor/blob/main/CONTRIBUTING.md).
|
package/dist/constants.js
CHANGED
|
@@ -23,7 +23,7 @@ exports.MediaExtensions = [
|
|
|
23
23
|
'.mpg',
|
|
24
24
|
'.mpeg',
|
|
25
25
|
];
|
|
26
|
-
exports.FontExtensions = ['.ttf', '.fnt', '.fon', '.otf'];
|
|
26
|
+
exports.FontExtensions = ['.ttf', '.fnt', '.fon', '.otf', '.woff', '.woff2'];
|
|
27
27
|
exports.MapExtensions = ['.js.map', '.ts.map', '.LICENSE.txt'];
|
|
28
28
|
exports.RsdoctorOutputFolder = '.rsdoctor';
|
|
29
29
|
exports.RsdoctorOutputManifest = 'manifest.json';
|
package/dist/logger.d.ts
CHANGED
|
@@ -7,28 +7,3 @@ export declare enum LogLevel {
|
|
|
7
7
|
Verbose = 5
|
|
8
8
|
}
|
|
9
9
|
export type LogLevelName = keyof typeof LogLevel;
|
|
10
|
-
export interface LoggerOptions {
|
|
11
|
-
/**
|
|
12
|
-
* Default is `info`.
|
|
13
|
-
*/
|
|
14
|
-
level?: LogLevelName;
|
|
15
|
-
/**
|
|
16
|
-
* Default is `false`.
|
|
17
|
-
*/
|
|
18
|
-
timestamp?: boolean;
|
|
19
|
-
/**
|
|
20
|
-
* Default is empty string
|
|
21
|
-
*/
|
|
22
|
-
prefix?: string;
|
|
23
|
-
}
|
|
24
|
-
type Label = string;
|
|
25
|
-
export declare abstract class LoggerInstance {
|
|
26
|
-
abstract timesLog: Map<Label, number>;
|
|
27
|
-
abstract info(...msg: string[]): void;
|
|
28
|
-
abstract warn(...msg: string[]): void;
|
|
29
|
-
abstract error(...msg: string[]): void;
|
|
30
|
-
abstract debug(...msg: string[]): void;
|
|
31
|
-
abstract time(label: Label): void;
|
|
32
|
-
abstract timeEnd(label: Label): void;
|
|
33
|
-
}
|
|
34
|
-
export {};
|
package/dist/logger.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
3
|
+
exports.LogLevel = void 0;
|
|
4
4
|
var LogLevel;
|
|
5
5
|
(function (LogLevel) {
|
|
6
6
|
LogLevel[LogLevel["Silent"] = 0] = "Silent";
|
|
@@ -10,6 +10,3 @@ var LogLevel;
|
|
|
10
10
|
LogLevel[LogLevel["Debug"] = 4] = "Debug";
|
|
11
11
|
LogLevel[LogLevel["Verbose"] = 5] = "Verbose";
|
|
12
12
|
})(LogLevel || (exports.LogLevel = LogLevel = {}));
|
|
13
|
-
class LoggerInstance {
|
|
14
|
-
}
|
|
15
|
-
exports.LoggerInstance = LoggerInstance;
|
|
@@ -1,10 +1,15 @@
|
|
|
1
1
|
import type { Compiler, Compilation, Stats, StatsError, RuleSetRule } from 'webpack';
|
|
2
|
-
import type { Compiler as RspackCompiler, Compilation as RspackCompilation, Stats as RspackStats, RuleSetRule as RspackRuleSetRule, RuleSetRules } from '@rspack/core';
|
|
3
|
-
|
|
2
|
+
import type { Compiler as RspackCompiler, Compilation as RspackCompilation, Stats as RspackStats, RuleSetRule as RspackRuleSetRule, RuleSetRules as RspackRuleSetRules } from '@rspack/core';
|
|
3
|
+
type RspackCompilerWrapper = any extends RspackCompiler ? never : RspackCompiler;
|
|
4
|
+
type RspackCompilationWrapper = any extends RspackCompilation ? never : RspackCompilation;
|
|
5
|
+
type RspackStatsWrapper = any extends RspackStats ? never : RspackStats;
|
|
6
|
+
type RspackRuleSetRuleWrapper = any extends RspackRuleSetRule ? never : RspackRuleSetRule;
|
|
7
|
+
type RspackRuleSetRulesWrapper = any extends RspackRuleSetRules ? never : (RspackRuleSetRule | '...')[] | RspackRuleSetRules;
|
|
8
|
+
export type BaseCompiler = (Compiler | RspackCompilerWrapper) & {
|
|
4
9
|
webpack: any;
|
|
5
10
|
};
|
|
6
|
-
export type BaseCompilation =
|
|
7
|
-
export type BaseStats = Stats |
|
|
11
|
+
export type BaseCompilation = RspackCompilationWrapper | Compilation;
|
|
12
|
+
export type BaseStats = Stats | RspackStatsWrapper;
|
|
8
13
|
export interface JsStatsError {
|
|
9
14
|
message: string;
|
|
10
15
|
formatted: string;
|
|
@@ -16,5 +21,6 @@ export interface JsStatsWarning {
|
|
|
16
21
|
}
|
|
17
22
|
export type BuildError = JsStatsError | StatsError;
|
|
18
23
|
export type BuildWarning = JsStatsWarning | StatsError;
|
|
19
|
-
export type BuildRuleSetRules = (RuleSetRule | '...')[] |
|
|
20
|
-
export type BuildRuleSetRule = RuleSetRule |
|
|
24
|
+
export type BuildRuleSetRules = (RuleSetRule | '...')[] | RspackRuleSetRulesWrapper;
|
|
25
|
+
export type BuildRuleSetRule = RuleSetRule | RspackRuleSetRuleWrapper;
|
|
26
|
+
export {};
|
|
@@ -10,8 +10,10 @@ export interface SourceMap {
|
|
|
10
10
|
sourcesContent?: string[];
|
|
11
11
|
names?: string[];
|
|
12
12
|
}
|
|
13
|
-
|
|
14
|
-
|
|
13
|
+
type RspackConfigurationWrapper = any extends RspackConfiguration ? never : RspackConfiguration;
|
|
14
|
+
type RspackRuleSetRuleWrapper = any extends RspackRuleSetRule ? never : RspackRuleSetRule;
|
|
15
|
+
export type RuleSetRule = RspackRuleSetRuleWrapper | WebpackRuleSetRule;
|
|
16
|
+
export type Configuration = WebpackConfiguration | RspackConfigurationWrapper;
|
|
15
17
|
declare interface AdditionalData {
|
|
16
18
|
[index: string]: any;
|
|
17
19
|
webpackAST: object;
|
package/dist/sdk/config.d.ts
CHANGED
|
@@ -1,9 +1,11 @@
|
|
|
1
1
|
import type { Configuration } from 'webpack';
|
|
2
2
|
import type { Configuration as RspackConfiguration } from '@rspack/core';
|
|
3
|
+
type RspackConfigurationWrapper = any extends RspackConfiguration ? never : RspackConfiguration;
|
|
3
4
|
export interface WebpackConfigData {
|
|
4
5
|
name: 'webpack' | 'rspack';
|
|
5
6
|
version: string | number;
|
|
6
7
|
bin?: string;
|
|
7
|
-
config: Configuration |
|
|
8
|
+
config: Configuration | RspackConfigurationWrapper;
|
|
8
9
|
}
|
|
9
10
|
export type ConfigData = WebpackConfigData[];
|
|
11
|
+
export {};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@rsdoctor/types",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.2",
|
|
4
4
|
"repository": {
|
|
5
5
|
"type": "git",
|
|
6
6
|
"url": "https://github.com/web-infra-dev/rsdoctor",
|
|
@@ -13,7 +13,6 @@
|
|
|
13
13
|
"dist"
|
|
14
14
|
],
|
|
15
15
|
"dependencies": {
|
|
16
|
-
"@rspack/core": "0.5.1",
|
|
17
16
|
"@types/connect": "3.4.35",
|
|
18
17
|
"@types/estree": "1.0.0",
|
|
19
18
|
"@types/tapable": "2.2.2",
|
|
@@ -26,6 +25,14 @@
|
|
|
26
25
|
"tslib": "2.4.1",
|
|
27
26
|
"typescript": "^5.2.2"
|
|
28
27
|
},
|
|
28
|
+
"peerDependencies": {
|
|
29
|
+
"@rspack/core": "^0.5.1"
|
|
30
|
+
},
|
|
31
|
+
"peerDependenciesMeta": {
|
|
32
|
+
"@rspack/core": {
|
|
33
|
+
"optional": true
|
|
34
|
+
}
|
|
35
|
+
},
|
|
29
36
|
"publishConfig": {
|
|
30
37
|
"access": "public",
|
|
31
38
|
"provenance": true,
|