@rspack-debug/cli 2.0.0-canary.20260120 → 2.0.0-rc.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.
@@ -1,7 +1,9 @@
1
- import { node_fs, node_path, rspack } from "./131.js";
1
+ import node_fs from "node:fs";
2
+ import node_path from "node:path";
3
+ import { rspack } from "@rspack/core";
2
4
  const DEFAULT_RUST_TRACE_LAYER = 'perfetto';
3
5
  async function applyProfile(filterValue, traceLayer = DEFAULT_RUST_TRACE_LAYER, traceOutput) {
4
- const { asyncExitHook } = await import("exit-hook");
6
+ const { asyncExitHook } = await import("./exit-hook.js");
5
7
  if ('logger' !== traceLayer && 'perfetto' !== traceLayer) throw new Error(`unsupported trace layer: ${traceLayer}`);
6
8
  const timestamp = Date.now();
7
9
  const defaultOutputDir = node_path.resolve(`.rspack-profile-${timestamp}-${process.pid}`);
package/dist/types.d.ts CHANGED
@@ -1,9 +1,13 @@
1
1
  import type { RspackCLI } from './cli';
2
2
  export type { Configuration } from '@rspack/core';
3
3
  export type LogHandler = (value: any) => void;
4
- export type RspackCLIColors = {
4
+ export interface RspackCLIColors {
5
5
  isColorSupported: boolean;
6
- } & Omit<typeof import('picocolors'), 'createColors'>;
6
+ red(text: string): string;
7
+ yellow(text: string): string;
8
+ cyan(text: string): string;
9
+ green(text: string): string;
10
+ }
7
11
  export interface RspackCLILogger {
8
12
  error: LogHandler;
9
13
  warn: LogHandler;
@@ -1,7 +1,7 @@
1
1
  import type { MultiRspackOptions, RspackOptions } from '@rspack/core';
2
2
  import type { CommonOptions } from './options';
3
- export declare function compile(sourcecode: string, filename: string): string;
4
- export type LoadedRspackConfig = undefined | RspackOptions | MultiRspackOptions | ((env: Record<string, any>, argv?: Record<string, any>) => RspackOptions | MultiRspackOptions);
3
+ export type LoadedRspackConfig = undefined | RspackOptions | MultiRspackOptions | ((env: Record<string, any>, argv?: Record<string, any>) => RspackOptions | MultiRspackOptions | Promise<RspackOptions | MultiRspackOptions>);
4
+ export declare const resolveRspackConfigExport: (configExport: LoadedRspackConfig, options: CommonOptions) => Promise<RspackOptions | MultiRspackOptions>;
5
5
  /**
6
6
  * Loads and merges configurations from the 'extends' property
7
7
  * @param config The configuration object that may contain an 'extends' property
@@ -1,4 +1,5 @@
1
1
  import type { Command } from 'cac';
2
+ export type ConfigLoader = 'auto' | 'jiti' | 'native';
2
3
  /**
3
4
  * Apply common options for all commands
4
5
  */
@@ -6,7 +7,7 @@ export declare const commonOptions: (command: Command) => Command;
6
7
  export type CommonOptions = {
7
8
  config?: string;
8
9
  configName?: string[];
9
- configLoader?: string;
10
+ configLoader?: ConfigLoader;
10
11
  env?: Record<string, unknown> | string[];
11
12
  nodeEnv?: string;
12
13
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rspack-debug/cli",
3
- "version": "2.0.0-canary.20260120",
3
+ "version": "2.0.0-rc.2",
4
4
  "description": "CLI for rspack",
5
5
  "homepage": "https://rspack.rs",
6
6
  "bugs": "https://github.com/web-infra-dev/rspack/issues",
@@ -24,29 +24,27 @@
24
24
  },
25
25
  "files": [
26
26
  "bin",
27
+ "compiled",
27
28
  "dist"
28
29
  ],
29
- "dependencies": {
30
- "@discoveryjs/json-ext": "^0.5.7",
31
- "exit-hook": "^4.0.0"
32
- },
33
30
  "devDependencies": {
34
- "@rslib/core": "0.19.2",
35
- "@rspack/dev-server": "~1.1.5",
36
- "cac": "^6.7.14",
31
+ "@discoveryjs/json-ext": "^0.5.7",
32
+ "@rslib/core": "0.21.0",
33
+ "@rspack/dev-server": "2.0.0-rc.2",
34
+ "cac": "^7.0.0",
37
35
  "concat-stream": "^2.0.0",
38
36
  "cross-env": "^10.1.0",
39
37
  "execa": "^5.1.1",
40
- "picocolors": "^1.1.1",
41
- "pirates": "^4.0.7",
42
- "ts-node": "^10.9.2",
43
- "typescript": "^5.9.3",
44
- "@rspack/core": "npm:@rspack-debug/core@2.0.0-canary.20260120",
45
- "@rspack/test-tools": "npm:@rspack-debug/test-tools@2.0.0-canary.20260120"
38
+ "exit-hook": "^4.0.0",
39
+ "jiti": "^2.6.1",
40
+ "prebundle": "^1.6.4",
41
+ "typescript": "^6.0.2",
42
+ "@rspack/core": "npm:@rspack-debug/core@2.0.0-rc.2",
43
+ "@rspack/test-tools": "npm:@rspack-debug/test-tools@2.0.0-rc.2"
46
44
  },
47
45
  "peerDependencies": {
48
46
  "@rspack/core": "^2.0.0-0",
49
- "@rspack/dev-server": "~1.1.5"
47
+ "@rspack/dev-server": "^2.0.0-0"
50
48
  },
51
49
  "peerDependenciesMeta": {
52
50
  "@rspack/dev-server": {
@@ -1,28 +0,0 @@
1
- var __webpack_modules__ = {};
2
- var __webpack_module_cache__ = {};
3
- function __webpack_require__(moduleId) {
4
- var cachedModule = __webpack_module_cache__[moduleId];
5
- if (void 0 !== cachedModule) return cachedModule.exports;
6
- var module = __webpack_module_cache__[moduleId] = {
7
- id: moduleId,
8
- loaded: false,
9
- exports: {}
10
- };
11
- __webpack_modules__[moduleId](module, module.exports, __webpack_require__);
12
- module.loaded = true;
13
- return module.exports;
14
- }
15
- __webpack_require__.m = __webpack_modules__;
16
- (()=>{
17
- __webpack_require__.add = function(modules) {
18
- Object.assign(__webpack_require__.m, modules);
19
- };
20
- })();
21
- (()=>{
22
- __webpack_require__.nmd = (module)=>{
23
- module.paths = [];
24
- if (!module.children) module.children = [];
25
- return module;
26
- };
27
- })();
28
- export { __webpack_require__ };
@@ -1 +0,0 @@
1
- export declare const crossImport: <T = any>(path: string) => Promise<T>;
@@ -1 +0,0 @@
1
- export declare const isEsmFile: (filePath: string) => boolean;
@@ -1,4 +0,0 @@
1
- declare const readPackageUp: (cwd?: string) => {
2
- type?: "module";
3
- } | null;
4
- export default readPackageUp;