@rspack/cli 2.0.0-canary.20260120 → 2.0.0-rc.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/bin/rspack.js +5 -1
- package/dist/{131.js → 697.js} +313 -175
- package/dist/cli.d.ts +10 -3
- package/dist/exit-hook.js +61 -0
- package/dist/index.js +1 -1
- package/dist/json-ext.js +772 -0
- package/dist/{274.js → profile.js} +4 -2
- package/dist/types.d.ts +6 -2
- package/package.json +10 -13
- package/dist/rslib-runtime.js +0 -28
|
@@ -1,7 +1,9 @@
|
|
|
1
|
-
import
|
|
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
|
|
4
|
+
export interface RspackCLIColors {
|
|
5
5
|
isColorSupported: boolean;
|
|
6
|
-
|
|
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;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@rspack/cli",
|
|
3
|
-
"version": "2.0.0-
|
|
3
|
+
"version": "2.0.0-rc.1",
|
|
4
4
|
"description": "CLI for rspack",
|
|
5
5
|
"homepage": "https://rspack.rs",
|
|
6
6
|
"bugs": "https://github.com/web-infra-dev/rspack/issues",
|
|
@@ -26,27 +26,24 @@
|
|
|
26
26
|
"bin",
|
|
27
27
|
"dist"
|
|
28
28
|
],
|
|
29
|
-
"dependencies": {
|
|
30
|
-
"@discoveryjs/json-ext": "^0.5.7",
|
|
31
|
-
"exit-hook": "^4.0.0"
|
|
32
|
-
},
|
|
33
29
|
"devDependencies": {
|
|
34
|
-
"@
|
|
35
|
-
"@
|
|
36
|
-
"
|
|
30
|
+
"@discoveryjs/json-ext": "^0.5.7",
|
|
31
|
+
"@rslib/core": "0.20.3",
|
|
32
|
+
"@rspack/dev-server": "2.0.0-rc.2",
|
|
33
|
+
"cac": "^7.0.0",
|
|
37
34
|
"concat-stream": "^2.0.0",
|
|
38
35
|
"cross-env": "^10.1.0",
|
|
39
36
|
"execa": "^5.1.1",
|
|
40
|
-
"
|
|
37
|
+
"exit-hook": "^4.0.0",
|
|
41
38
|
"pirates": "^4.0.7",
|
|
42
39
|
"ts-node": "^10.9.2",
|
|
43
|
-
"typescript": "^
|
|
44
|
-
"@rspack/core": "2.0.0-
|
|
45
|
-
"@rspack/test-tools": "2.0.0-
|
|
40
|
+
"typescript": "^6.0.2",
|
|
41
|
+
"@rspack/core": "2.0.0-rc.1",
|
|
42
|
+
"@rspack/test-tools": "2.0.0-rc.1"
|
|
46
43
|
},
|
|
47
44
|
"peerDependencies": {
|
|
48
45
|
"@rspack/core": "^2.0.0-0",
|
|
49
|
-
"@rspack/dev-server": "
|
|
46
|
+
"@rspack/dev-server": "^2.0.0-0"
|
|
50
47
|
},
|
|
51
48
|
"peerDependenciesMeta": {
|
|
52
49
|
"@rspack/dev-server": {
|
package/dist/rslib-runtime.js
DELETED
|
@@ -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__ };
|