@rspack/cli 0.3.12 → 0.3.13

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.
@@ -39,11 +39,13 @@ class BuildCommand {
39
39
  }
40
40
  }), async (options) => {
41
41
  const logger = cli.getLogger();
42
+ // @ts-expect-error
42
43
  let createJsonStringifyStream;
43
44
  if (options.json) {
44
45
  const jsonExt = await import("@discoveryjs/json-ext");
45
46
  createJsonStringifyStream = jsonExt.default.stringifyStream;
46
47
  }
48
+ // @ts-expect-error
47
49
  const callback = (error, stats) => {
48
50
  if (error) {
49
51
  logger.error(error);
@@ -59,10 +61,14 @@ class BuildCommand {
59
61
  ? {
60
62
  children: compiler.compilers.map(compiler => compiler.options ? compiler.options.stats : undefined)
61
63
  }
62
- : compiler.options
63
- ? compiler.options.stats
64
- : undefined;
64
+ : // @ts-expect-error
65
+ compiler.options
66
+ ? // @ts-expect-error
67
+ compiler.options.stats
68
+ : undefined;
69
+ // @ts-expect-error
65
70
  if (options.json && createJsonStringifyStream) {
71
+ // @ts-expect-error
66
72
  const handleWriteError = error => {
67
73
  logger.error(error);
68
74
  process.exit(2);
@@ -94,6 +100,7 @@ class BuildCommand {
94
100
  }
95
101
  };
96
102
  const rspackOptions = { ...options, argv: { ...options } };
103
+ // @ts-expect-error
97
104
  const errorHandler = (err, Stats) => {
98
105
  callback(err, Stats);
99
106
  };
@@ -7,7 +7,7 @@ export declare class RspackCLI {
7
7
  colors: RspackCLIColors;
8
8
  program: yargs.Argv;
9
9
  constructor();
10
- createCompiler(options: RspackBuildCLIOptions, rspackCommand: Command, callback?: (e: Error, res?: Stats | MultiStats) => void): Promise<MultiCompiler | Compiler | null>;
10
+ createCompiler(options: RspackBuildCLIOptions, rspackCommand: Command, callback?: (e: Error, res?: Stats | MultiStats) => void): Promise<MultiCompiler & Compiler>;
11
11
  createColors(useColor?: boolean): RspackCLIColors;
12
12
  getLogger(): RspackCLILogger;
13
13
  run(argv: string[]): Promise<void>;
@@ -62,6 +62,7 @@ class RspackCLI {
62
62
  const isWatch = Array.isArray(config)
63
63
  ? config.some(i => i.watch)
64
64
  : config.watch;
65
+ // @ts-expect-error
65
66
  return (0, core_1.rspack)(config, isWatch ? callback : undefined);
66
67
  }
67
68
  createColors(useColor) {
@@ -84,12 +84,15 @@ const previewOptions = (yargs) => {
84
84
  });
85
85
  };
86
86
  exports.previewOptions = previewOptions;
87
+ // @ts-expect-error
87
88
  function normalizeEnv(argv) {
88
89
  var _a;
90
+ // @ts-expect-error
89
91
  function parseValue(previous, value) {
90
92
  const [allKeys, val] = value.split(/=(.+)/, 2);
91
93
  const splitKeys = allKeys.split(/\.(?!$)/);
92
94
  let prevRef = previous;
95
+ // @ts-expect-error
93
96
  splitKeys.forEach((someKey, index) => {
94
97
  // https://github.com/webpack/webpack-cli/issues/3284
95
98
  if (someKey.endsWith("=")) {
@@ -131,12 +131,15 @@ class RspackProfileJSCPUProfilePlugin {
131
131
  constructor(output) {
132
132
  this.output = output;
133
133
  }
134
+ // @ts-expect-error
134
135
  apply(compiler) {
135
136
  const session = new inspector_1.default.Session();
136
137
  session.connect();
137
138
  session.post("Profiler.enable");
138
139
  session.post("Profiler.start");
139
- compiler.hooks.done.tapAsync(RspackProfileJSCPUProfilePlugin.name, (stats, callback) => {
140
+ compiler.hooks.done.tapAsync(RspackProfileJSCPUProfilePlugin.name,
141
+ // @ts-expect-error
142
+ (stats, callback) => {
140
143
  if (compiler.watchMode)
141
144
  return callback();
142
145
  session.post("Profiler.stop", (error, param) => {
@@ -154,8 +157,11 @@ class RspackProfileLoggingPlugin {
154
157
  constructor(output) {
155
158
  this.output = output;
156
159
  }
160
+ // @ts-expect-error
157
161
  apply(compiler) {
158
- compiler.hooks.done.tapAsync(RspackProfileLoggingPlugin.name, (stats, callback) => {
162
+ compiler.hooks.done.tapAsync(RspackProfileLoggingPlugin.name,
163
+ // @ts-expect-error
164
+ (stats, callback) => {
159
165
  if (compiler.watchMode)
160
166
  return callback();
161
167
  const logging = stats.toJson({
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rspack/cli",
3
- "version": "0.3.12",
3
+ "version": "0.3.13",
4
4
  "license": "MIT",
5
5
  "description": "CLI for rspack",
6
6
  "bin": {
@@ -37,8 +37,8 @@
37
37
  "semver": "6.3.1",
38
38
  "webpack-bundle-analyzer": "4.6.1",
39
39
  "yargs": "17.6.2",
40
- "@rspack/core": "0.3.12",
41
- "@rspack/dev-server": "0.3.12"
40
+ "@rspack/core": "0.3.13",
41
+ "@rspack/dev-server": "0.3.13"
42
42
  },
43
43
  "scripts": {
44
44
  "build": "rimraf dist/ && tsc -b ./tsconfig.build.json --force",