@rsbuild/core 0.6.8 → 0.6.9
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/commander/{typings/index.d.ts → index.d.ts} +26 -24
- package/compiled/commander/index.js +3528 -1
- package/compiled/commander/package.json +1 -1
- package/compiled/connect-history-api-fallback/index.js +186 -1
- package/compiled/dotenv/{lib/main.d.ts → index.d.ts} +16 -12
- package/compiled/dotenv/index.js +458 -1
- package/compiled/dotenv/package.json +1 -1
- package/compiled/dotenv-expand/{lib/main.d.ts → index.d.ts} +9 -7
- package/compiled/dotenv-expand/index.js +146 -1
- package/compiled/dotenv-expand/package.json +1 -1
- package/compiled/http-compression/index.js +185 -1
- package/compiled/launch-editor-middleware/index.js +843 -1
- package/compiled/on-finished/index.d.ts +2 -2
- package/compiled/on-finished/index.js +390 -3
- package/compiled/on-finished/package.json +1 -1
- package/compiled/open/index.d.ts +1 -153
- package/compiled/open/index.js +526 -1
- package/compiled/open/package.json +1 -1
- package/compiled/sirv/index.d.ts +1 -0
- package/compiled/sirv/index.js +798 -1
- package/compiled/sirv/package.json +1 -1
- package/compiled/webpack-dev-middleware/index.d.ts +1 -0
- package/compiled/webpack-dev-middleware/index.js +6696 -0
- package/compiled/webpack-dev-middleware/license +20 -0
- package/compiled/webpack-dev-middleware/package.json +1 -0
- package/compiled/webpack-dev-middleware/schema-utils.js +1 -0
- package/compiled/ws/index.d.ts +7 -15
- package/compiled/ws/index.js +4885 -1
- package/compiled/ws/package.json +1 -1
- package/dist/cli/commands.js +1 -1
- package/dist/cli/prepare.js +1 -1
- package/dist/client/format.d.ts +5 -0
- package/dist/client/{formatStats.js → format.js} +8 -43
- package/dist/client/{hmr/index.d.ts → hmr.d.ts} +4 -0
- package/dist/client/hmr.mjs +194 -431
- package/dist/client/overlay.mjs +205 -227
- package/dist/createContext.js +1 -1
- package/dist/index.js +1 -1
- package/dist/plugins/target.js +19 -16
- package/dist/provider/plugins/swc.js +1 -0
- package/dist/provider/shared.js +2 -2
- package/dist/server/devMiddleware.js +1 -1
- package/dist/server/devServer.js +6 -1
- package/dist/server/getDevMiddlewares.d.ts +3 -0
- package/dist/server/getDevMiddlewares.js +6 -8
- package/dist/server/helper.d.ts +4 -4
- package/dist/server/middlewares.d.ts +5 -2
- package/dist/server/middlewares.js +1 -7
- package/package.json +6 -5
- package/compiled/open/license +0 -9
- package/compiled/sirv/sirv.d.ts +0 -27
- package/dist/client/formatStats.d.ts +0 -12
- package/dist/client/hmr/url.d.ts +0 -6
|
@@ -1,10 +1,13 @@
|
|
|
1
|
+
/// <reference types="node" />
|
|
2
|
+
import type fs from 'node:fs';
|
|
1
3
|
import { type HtmlFallback, type RequestHandler as Middleware } from '@rsbuild/shared';
|
|
2
|
-
import type
|
|
4
|
+
import type Connect from '@rsbuild/shared/connect';
|
|
3
5
|
export declare const faviconFallbackMiddleware: Middleware;
|
|
4
|
-
export declare const getRequestLoggerMiddleware: () => Promise<NextHandleFunction>;
|
|
6
|
+
export declare const getRequestLoggerMiddleware: () => Promise<Connect.NextHandleFunction>;
|
|
5
7
|
export declare const notFoundMiddleware: Middleware;
|
|
6
8
|
export declare const getHtmlFallbackMiddleware: (params: {
|
|
7
9
|
distPath: string;
|
|
8
10
|
callback?: Middleware;
|
|
9
11
|
htmlFallback?: HtmlFallback;
|
|
12
|
+
outputFileSystem: typeof fs;
|
|
10
13
|
}) => Middleware;
|
|
@@ -34,7 +34,6 @@ __export(middlewares_exports, {
|
|
|
34
34
|
notFoundMiddleware: () => notFoundMiddleware
|
|
35
35
|
});
|
|
36
36
|
module.exports = __toCommonJS(middlewares_exports);
|
|
37
|
-
var import_node_fs = __toESM(require("node:fs"));
|
|
38
37
|
var import_node_path = __toESM(require("node:path"));
|
|
39
38
|
var import_node_url = require("node:url");
|
|
40
39
|
var import_shared = require("@rsbuild/shared");
|
|
@@ -86,7 +85,7 @@ const notFoundMiddleware = (_req, res, _next) => {
|
|
|
86
85
|
res.statusCode = 404;
|
|
87
86
|
res.end();
|
|
88
87
|
};
|
|
89
|
-
const getHtmlFallbackMiddleware = ({ htmlFallback, distPath, callback }) => {
|
|
88
|
+
const getHtmlFallbackMiddleware = ({ htmlFallback, distPath, callback, outputFileSystem }) => {
|
|
90
89
|
return (req, res, next) => {
|
|
91
90
|
if (
|
|
92
91
|
// Only accept GET or HEAD
|
|
@@ -107,11 +106,6 @@ const getHtmlFallbackMiddleware = ({ htmlFallback, distPath, callback }) => {
|
|
|
107
106
|
);
|
|
108
107
|
return next();
|
|
109
108
|
}
|
|
110
|
-
let outputFileSystem = import_node_fs.default;
|
|
111
|
-
if (res.locals.webpack) {
|
|
112
|
-
const { devMiddleware } = res.locals.webpack;
|
|
113
|
-
outputFileSystem = devMiddleware.outputFileSystem;
|
|
114
|
-
}
|
|
115
109
|
const rewrite = (newUrl, isFallback = false) => {
|
|
116
110
|
if (isFallback && (0, import_shared.isDebug)()) {
|
|
117
111
|
(0, import_shared.debug)(
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@rsbuild/core",
|
|
3
|
-
"version": "0.6.
|
|
3
|
+
"version": "0.6.9",
|
|
4
4
|
"description": "The Rspack-based build tool.",
|
|
5
5
|
"homepage": "https://rsbuild.dev",
|
|
6
6
|
"bugs": {
|
|
@@ -51,9 +51,9 @@
|
|
|
51
51
|
"@rspack/core": "0.6.3",
|
|
52
52
|
"@swc/helpers": "0.5.3",
|
|
53
53
|
"core-js": "~3.36.0",
|
|
54
|
-
"html-webpack-plugin": "npm:html-rspack-plugin@5.7.
|
|
54
|
+
"html-webpack-plugin": "npm:html-rspack-plugin@5.7.2",
|
|
55
55
|
"postcss": "^8.4.38",
|
|
56
|
-
"@rsbuild/shared": "0.6.
|
|
56
|
+
"@rsbuild/shared": "0.6.9"
|
|
57
57
|
},
|
|
58
58
|
"devDependencies": {
|
|
59
59
|
"@types/node": "18.x",
|
|
@@ -67,11 +67,12 @@
|
|
|
67
67
|
"launch-editor-middleware": "^2.6.1",
|
|
68
68
|
"on-finished": "2.4.1",
|
|
69
69
|
"open": "^8.4.0",
|
|
70
|
-
"prebundle": "1.0
|
|
70
|
+
"prebundle": "1.1.0",
|
|
71
71
|
"sirv": "^2.0.4",
|
|
72
72
|
"typescript": "^5.4.2",
|
|
73
73
|
"webpack": "^5.91.0",
|
|
74
|
-
"
|
|
74
|
+
"webpack-dev-middleware": "7.2.1",
|
|
75
|
+
"ws": "^8.17.0"
|
|
75
76
|
},
|
|
76
77
|
"engines": {
|
|
77
78
|
"node": ">=16.0.0"
|
package/compiled/open/license
DELETED
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
MIT License
|
|
2
|
-
|
|
3
|
-
Copyright (c) Sindre Sorhus <sindresorhus@gmail.com> (https://sindresorhus.com)
|
|
4
|
-
|
|
5
|
-
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
|
|
6
|
-
|
|
7
|
-
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
|
|
8
|
-
|
|
9
|
-
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
package/compiled/sirv/sirv.d.ts
DELETED
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
declare namespace sirv {
|
|
2
|
-
import type { Stats } from 'fs';
|
|
3
|
-
import type { IncomingMessage, ServerResponse } from 'http';
|
|
4
|
-
|
|
5
|
-
type Arrayable<T> = T | T[];
|
|
6
|
-
export type NextHandler = () => void | Promise<void>;
|
|
7
|
-
export type RequestHandler = (req: IncomingMessage, res: ServerResponse, next?: NextHandler) => void;
|
|
8
|
-
|
|
9
|
-
export interface Options {
|
|
10
|
-
dev?: boolean;
|
|
11
|
-
etag?: boolean;
|
|
12
|
-
maxAge?: number;
|
|
13
|
-
immutable?: boolean;
|
|
14
|
-
single?: string | boolean;
|
|
15
|
-
ignores?: false | Arrayable<string | RegExp>;
|
|
16
|
-
extensions?: string[];
|
|
17
|
-
dotfiles?: boolean;
|
|
18
|
-
brotli?: boolean;
|
|
19
|
-
gzip?: boolean;
|
|
20
|
-
onNoMatch?: (req: IncomingMessage, res: ServerResponse) => void;
|
|
21
|
-
setHeaders?: (res: ServerResponse, pathname: string, stats: Stats) => void;
|
|
22
|
-
}
|
|
23
|
-
|
|
24
|
-
export default function(dir?: string, opts?: Options): RequestHandler;
|
|
25
|
-
}
|
|
26
|
-
|
|
27
|
-
export = sirv;
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Copyright (c) 2015-present, Facebook, Inc.
|
|
3
|
-
*
|
|
4
|
-
* This source code is licensed under the MIT license found in the
|
|
5
|
-
* LICENSE file at
|
|
6
|
-
* https://github.com/facebook/create-react-app/blob/master/LICENSE
|
|
7
|
-
*/
|
|
8
|
-
import type { StatsCompilation } from 'webpack';
|
|
9
|
-
export declare function formatStatsMessages(stats: Pick<StatsCompilation, 'errors' | 'warnings'>): {
|
|
10
|
-
errors: string[];
|
|
11
|
-
warnings: string[];
|
|
12
|
-
};
|