@rsbuild/core 2.0.0-alpha.1 → 2.0.0-alpha.3
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/compiled/chokidar/handler.d.ts +90 -0
- package/compiled/chokidar/index.d.ts +34 -201
- package/compiled/chokidar/package.json +1 -1
- package/compiled/css-loader/index.js +2 -2
- package/compiled/html-rspack-plugin/index.js +18 -15
- package/compiled/html-rspack-plugin/package.json +1 -1
- package/compiled/postcss-loader/index.js +6 -6
- package/compiled/rslog/package.json +1 -1
- package/compiled/rspack-chain/package.json +1 -1
- package/dist/131.js +69 -49
- package/dist/397.js +11 -0
- package/dist/7.js +1 -0
- package/dist/chokidar.js +1044 -0
- package/dist/chokidar.js.LICENSE.txt +1 -0
- package/dist/client/hmr.js +33 -0
- package/dist/cors.js +2 -2
- package/dist/manifest-plugin.js +5 -5
- package/dist/memfs.js +3334 -857
- package/dist/open.js +1 -1
- package/dist/tinyglobby.js +9 -1
- package/dist-types/configChain.d.ts +21 -21
- package/dist-types/helpers/vendors.d.ts +0 -1
- package/dist-types/loadConfig.d.ts +1 -1
- package/dist-types/server/socketServer.d.ts +8 -1
- package/dist-types/types/config.d.ts +5 -0
- package/package.json +8 -8
- package/types.d.ts +8 -4
- package/compiled/chokidar/index.js +0 -1793
package/dist/open.js
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
let isDockerCached, cachedResult, canAccessPowerShellPromise, mountPoint, defaultMountPoint;
|
|
2
2
|
import { __webpack_require__ } from "./rslib-runtime.js";
|
|
3
3
|
import node_child_process, { execFile } from "node:child_process";
|
|
4
|
-
import promises, { constants } from "node:fs/promises";
|
|
5
4
|
import { node_process, node_os, external_node_util_promisify } from "./131.js";
|
|
6
5
|
import "./743.js";
|
|
6
|
+
import { constants, promises } from "./7.js";
|
|
7
7
|
let external_node_fs_ = __webpack_require__("node:fs");
|
|
8
8
|
function hasDockerEnv() {
|
|
9
9
|
try {
|
package/dist/tinyglobby.js
CHANGED
|
@@ -1460,4 +1460,12 @@ async function glob(patternsOrOptions, options) {
|
|
|
1460
1460
|
} : patternsOrOptions, cwd = opts.cwd ? external_path_.default.resolve(opts.cwd).replace(BACKSLASHES, "/") : process.cwd().replace(BACKSLASHES, "/");
|
|
1461
1461
|
return crawl(opts, cwd, !1);
|
|
1462
1462
|
}
|
|
1463
|
-
|
|
1463
|
+
function globSync(patternsOrOptions, options) {
|
|
1464
|
+
if (patternsOrOptions && (null == options ? void 0 : options.patterns)) throw Error("Cannot pass patterns as both an argument and an option");
|
|
1465
|
+
let opts = Array.isArray(patternsOrOptions) || "string" == typeof patternsOrOptions ? {
|
|
1466
|
+
...options,
|
|
1467
|
+
patterns: patternsOrOptions
|
|
1468
|
+
} : patternsOrOptions, cwd = opts.cwd ? external_path_.default.resolve(opts.cwd).replace(BACKSLASHES, "/") : process.cwd().replace(BACKSLASHES, "/");
|
|
1469
|
+
return crawl(opts, cwd, !0);
|
|
1470
|
+
}
|
|
1471
|
+
export { glob, globSync };
|
|
@@ -16,38 +16,18 @@ export declare const CHAIN_ID: {
|
|
|
16
16
|
readonly MEDIA: "media";
|
|
17
17
|
/** Rule for additional assets */
|
|
18
18
|
readonly ADDITIONAL_ASSETS: "additional-assets";
|
|
19
|
-
/** Rule for
|
|
19
|
+
/** Rule for JS */
|
|
20
20
|
readonly JS: "js";
|
|
21
|
-
/** Rule for raw js */
|
|
22
|
-
readonly JS_RAW: "js-raw";
|
|
23
21
|
/** Rule for data uri encoded javascript */
|
|
24
22
|
readonly JS_DATA_URI: "js-data-uri";
|
|
25
|
-
/** Rule for ts */
|
|
26
|
-
readonly TS: "ts";
|
|
27
23
|
/** Rule for CSS */
|
|
28
24
|
readonly CSS: "css";
|
|
29
|
-
/** Rule for raw CSS */
|
|
30
|
-
readonly CSS_RAW: "css-raw";
|
|
31
|
-
/** Rule for inline CSS */
|
|
32
|
-
readonly CSS_INLINE: "css-inline";
|
|
33
25
|
/** Rule for Less */
|
|
34
26
|
readonly LESS: "less";
|
|
35
|
-
/** Rule for raw Less */
|
|
36
|
-
readonly LESS_RAW: "less-raw";
|
|
37
|
-
/** Rule for inline Less */
|
|
38
|
-
readonly LESS_INLINE: "less-inline";
|
|
39
27
|
/** Rule for Sass */
|
|
40
28
|
readonly SASS: "sass";
|
|
41
|
-
/** Rule for raw Sass */
|
|
42
|
-
readonly SASS_RAW: "sass-raw";
|
|
43
|
-
/** Rule for inline Sass */
|
|
44
|
-
readonly SASS_INLINE: "sass-inline";
|
|
45
29
|
/** Rule for stylus */
|
|
46
30
|
readonly STYLUS: "stylus";
|
|
47
|
-
/** Rule for raw stylus */
|
|
48
|
-
readonly STYLUS_RAW: "stylus-raw";
|
|
49
|
-
/** Rule for inline stylus */
|
|
50
|
-
readonly STYLUS_INLINE: "stylus-inline";
|
|
51
31
|
/** Rule for svg */
|
|
52
32
|
readonly SVG: "svg";
|
|
53
33
|
/** Rule for Vue */
|
|
@@ -59,6 +39,26 @@ export declare const CHAIN_ID: {
|
|
|
59
39
|
};
|
|
60
40
|
/** Predefined rule groups */
|
|
61
41
|
readonly ONE_OF: {
|
|
42
|
+
/** JS oneOf rules */
|
|
43
|
+
readonly JS_MAIN: "js-main";
|
|
44
|
+
readonly JS_RAW: "js-raw";
|
|
45
|
+
/** CSS oneOf rules */
|
|
46
|
+
readonly CSS_MAIN: "css-main";
|
|
47
|
+
readonly CSS_RAW: "css-raw";
|
|
48
|
+
readonly CSS_INLINE: "css-inline";
|
|
49
|
+
/** Less oneOf rules */
|
|
50
|
+
readonly LESS_MAIN: "less-main";
|
|
51
|
+
readonly LESS_RAW: "less-raw";
|
|
52
|
+
readonly LESS_INLINE: "less-inline";
|
|
53
|
+
/** Sass oneOf rules */
|
|
54
|
+
readonly SASS_MAIN: "sass-main";
|
|
55
|
+
readonly SASS_RAW: "sass-raw";
|
|
56
|
+
readonly SASS_INLINE: "sass-inline";
|
|
57
|
+
/** Stylus oneOf rules */
|
|
58
|
+
readonly STYLUS_MAIN: "stylus-main";
|
|
59
|
+
readonly STYLUS_RAW: "stylus-raw";
|
|
60
|
+
readonly STYLUS_INLINE: "stylus-inline";
|
|
61
|
+
/** SVG oneOf rules */
|
|
62
62
|
readonly SVG: "svg";
|
|
63
63
|
readonly SVG_RAW: "svg-asset-raw";
|
|
64
64
|
readonly SVG_URL: "svg-asset-url";
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
type CompiledPackages = {
|
|
2
2
|
ws: typeof import('../../compiled/ws').default;
|
|
3
|
-
chokidar: typeof import('../../compiled/chokidar').default;
|
|
4
3
|
'webpack-merge': typeof import('../../compiled/webpack-merge');
|
|
5
4
|
'html-rspack-plugin': typeof import('../../compiled/html-rspack-plugin').default;
|
|
6
5
|
'http-proxy-middleware': typeof import('../../compiled/http-proxy-middleware');
|
|
@@ -33,7 +33,7 @@ export type LoadConfigOptions = {
|
|
|
33
33
|
* - 'auto': Use native Node.js loader first, fallback to jiti if failed
|
|
34
34
|
* - 'jiti': Use `jiti` as loader, which supports TypeScript and ESM out of the box
|
|
35
35
|
* - 'native': Use native Node.js loader, requires TypeScript support in Node.js >= 22.6
|
|
36
|
-
* @default '
|
|
36
|
+
* @default 'auto'
|
|
37
37
|
*/
|
|
38
38
|
loader?: ConfigLoader;
|
|
39
39
|
};
|
|
@@ -31,7 +31,14 @@ export type ServerMessageResolvedClientError = {
|
|
|
31
31
|
message: string;
|
|
32
32
|
};
|
|
33
33
|
};
|
|
34
|
-
export type
|
|
34
|
+
export type ServerCustomMessage = {
|
|
35
|
+
type: 'custom';
|
|
36
|
+
data: {
|
|
37
|
+
event: string;
|
|
38
|
+
data?: any;
|
|
39
|
+
};
|
|
40
|
+
};
|
|
41
|
+
export type ServerMessage = ServerMessageOk | ServerMessageStaticChanged | ServerMessageHash | ServerMessageWarnings | ServerMessageErrors | ServerMessageResolvedClientError | ServerCustomMessage;
|
|
35
42
|
export type ClientMessageError = {
|
|
36
43
|
type: 'client-error';
|
|
37
44
|
id: string;
|
|
@@ -311,6 +311,11 @@ export type PublicDirOptions = {
|
|
|
311
311
|
* @default false
|
|
312
312
|
*/
|
|
313
313
|
watch?: boolean;
|
|
314
|
+
/**
|
|
315
|
+
* Glob patterns of files to ignore when copying from the public directory.
|
|
316
|
+
* @default undefined
|
|
317
|
+
*/
|
|
318
|
+
ignore?: string[];
|
|
314
319
|
};
|
|
315
320
|
export type PublicDir = false | PublicDirOptions | PublicDirOptions[];
|
|
316
321
|
/**
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@rsbuild/core",
|
|
3
|
-
"version": "2.0.0-alpha.
|
|
3
|
+
"version": "2.0.0-alpha.3",
|
|
4
4
|
"description": "The Rspack-based build tool.",
|
|
5
5
|
"homepage": "https://rsbuild.rs",
|
|
6
6
|
"bugs": {
|
|
@@ -36,7 +36,7 @@
|
|
|
36
36
|
"types.d.ts"
|
|
37
37
|
],
|
|
38
38
|
"dependencies": {
|
|
39
|
-
"@rspack/core": "2.0.0-
|
|
39
|
+
"@rspack/core": "2.0.0-alpha.0",
|
|
40
40
|
"@rspack/lite-tapable": "~1.1.0",
|
|
41
41
|
"@swc/helpers": "^0.5.18",
|
|
42
42
|
"jiti": "^2.6.1"
|
|
@@ -52,7 +52,7 @@
|
|
|
52
52
|
"devDependencies": {
|
|
53
53
|
"@jridgewell/remapping": "^2.3.5",
|
|
54
54
|
"@jridgewell/trace-mapping": "^0.3.31",
|
|
55
|
-
"@rslib/core": "0.19.
|
|
55
|
+
"@rslib/core": "0.19.3",
|
|
56
56
|
"@types/connect": "3.4.38",
|
|
57
57
|
"@types/cors": "^2.8.19",
|
|
58
58
|
"@types/node": "^24.10.9",
|
|
@@ -61,16 +61,16 @@
|
|
|
61
61
|
"@types/ws": "^8.18.1",
|
|
62
62
|
"browserslist-load-config": "1.0.1",
|
|
63
63
|
"cac": "^6.7.14",
|
|
64
|
-
"chokidar": "^
|
|
64
|
+
"chokidar": "^5.0.0",
|
|
65
65
|
"connect": "3.7.0",
|
|
66
|
-
"cors": "^2.8.
|
|
66
|
+
"cors": "^2.8.6",
|
|
67
67
|
"css-loader": "7.1.2",
|
|
68
68
|
"deepmerge": "^4.3.1",
|
|
69
69
|
"dotenv-expand": "12.0.3",
|
|
70
|
-
"html-rspack-plugin": "6.1.
|
|
70
|
+
"html-rspack-plugin": "6.1.6",
|
|
71
71
|
"http-proxy-middleware": "^2.0.9",
|
|
72
72
|
"launch-editor-middleware": "^2.12.0",
|
|
73
|
-
"memfs": "^4.
|
|
73
|
+
"memfs": "^4.56.10",
|
|
74
74
|
"mrmime": "^2.0.1",
|
|
75
75
|
"on-finished": "2.4.1",
|
|
76
76
|
"open": "^11.0.0",
|
|
@@ -78,7 +78,7 @@
|
|
|
78
78
|
"postcss": "^8.5.6",
|
|
79
79
|
"postcss-load-config": "6.0.1",
|
|
80
80
|
"postcss-loader": "8.2.0",
|
|
81
|
-
"prebundle": "1.6.
|
|
81
|
+
"prebundle": "1.6.2",
|
|
82
82
|
"range-parser": "^1.2.1",
|
|
83
83
|
"reduce-configs": "^1.1.1",
|
|
84
84
|
"rslog": "^1.3.2",
|
package/types.d.ts
CHANGED
|
@@ -11,7 +11,7 @@
|
|
|
11
11
|
* }
|
|
12
12
|
* ```
|
|
13
13
|
*/
|
|
14
|
-
//
|
|
14
|
+
// eslint-disable-next-line @typescript-eslint/no-empty-interface
|
|
15
15
|
interface RsbuildTypeOptions {}
|
|
16
16
|
|
|
17
17
|
/**
|
|
@@ -69,6 +69,12 @@ interface ImportMeta {
|
|
|
69
69
|
readonly env: ImportMetaEnv;
|
|
70
70
|
}
|
|
71
71
|
|
|
72
|
+
declare namespace Rspack {
|
|
73
|
+
interface Hot {
|
|
74
|
+
on: <Data = any>(event: string, cb: (data: Data) => void) => void;
|
|
75
|
+
}
|
|
76
|
+
}
|
|
77
|
+
|
|
72
78
|
/**
|
|
73
79
|
* Image assets
|
|
74
80
|
*/
|
|
@@ -280,9 +286,7 @@ declare module '*?raw' {
|
|
|
280
286
|
/**
|
|
281
287
|
* CSS Modules
|
|
282
288
|
*/
|
|
283
|
-
type CSSModuleClasses =
|
|
284
|
-
readonly [key: string]: string;
|
|
285
|
-
};
|
|
289
|
+
type CSSModuleClasses = Readonly<Record<string, string>>;
|
|
286
290
|
declare module '*.module.css' {
|
|
287
291
|
const classes: CSSModuleClasses;
|
|
288
292
|
export default classes;
|