@rspress/core 1.8.2 → 1.8.4
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/fast-glob/@nodelib/fs.scandir/out/adapters/fs.d.ts +20 -0
- package/compiled/fast-glob/@nodelib/fs.scandir/out/index.d.ts +12 -0
- package/compiled/fast-glob/@nodelib/fs.scandir/out/providers/async.d.ts +7 -0
- package/compiled/fast-glob/@nodelib/fs.scandir/out/settings.d.ts +20 -0
- package/compiled/fast-glob/@nodelib/fs.scandir/out/types/index.d.ts +20 -0
- package/compiled/fast-glob/@nodelib/fs.stat/out/adapters/fs.d.ts +13 -0
- package/compiled/fast-glob/@nodelib/fs.stat/out/index.d.ts +12 -0
- package/compiled/fast-glob/@nodelib/fs.stat/out/providers/async.d.ts +4 -0
- package/compiled/fast-glob/@nodelib/fs.stat/out/settings.d.ts +16 -0
- package/compiled/fast-glob/@nodelib/fs.stat/out/types/index.d.ts +4 -0
- package/compiled/fast-glob/@nodelib/fs.walk/out/index.d.ts +14 -0
- package/compiled/fast-glob/@nodelib/fs.walk/out/providers/async.d.ts +12 -0
- package/compiled/fast-glob/@nodelib/fs.walk/out/readers/async.d.ts +30 -0
- package/compiled/fast-glob/@nodelib/fs.walk/out/readers/reader.d.ts +6 -0
- package/compiled/fast-glob/@nodelib/fs.walk/out/settings.d.ts +30 -0
- package/compiled/fast-glob/@nodelib/fs.walk/out/types/index.d.ts +8 -0
- package/compiled/fast-glob/index.js +37 -0
- package/compiled/fast-glob/license +21 -0
- package/compiled/fast-glob/out/index.d.ts +27 -0
- package/compiled/fast-glob/out/managers/tasks.d.ts +22 -0
- package/compiled/fast-glob/out/settings.d.ts +164 -0
- package/compiled/fast-glob/out/types/index.d.ts +31 -0
- package/compiled/fast-glob/package.json +1 -0
- package/compiled/globby/index.d.ts +186 -0
- package/compiled/globby/index.js +1 -0
- package/compiled/globby/license +9 -0
- package/compiled/globby/package.json +1 -0
- package/dist/index.js +33 -26
- package/dist/index.js.map +1 -1
- package/dist/loader.js +9 -5
- package/dist/loader.js.map +1 -1
- package/dist/runtime/App.js +8 -3
- package/package.json +18 -18
- package/src/runtime/App.tsx +18 -14
|
@@ -0,0 +1,164 @@
|
|
|
1
|
+
import { FileSystemAdapter, Pattern } from './types';
|
|
2
|
+
export declare const DEFAULT_FILE_SYSTEM_ADAPTER: FileSystemAdapter;
|
|
3
|
+
export declare type Options = {
|
|
4
|
+
/**
|
|
5
|
+
* Return the absolute path for entries.
|
|
6
|
+
*
|
|
7
|
+
* @default false
|
|
8
|
+
*/
|
|
9
|
+
absolute?: boolean;
|
|
10
|
+
/**
|
|
11
|
+
* If set to `true`, then patterns without slashes will be matched against
|
|
12
|
+
* the basename of the path if it contains slashes.
|
|
13
|
+
*
|
|
14
|
+
* @default false
|
|
15
|
+
*/
|
|
16
|
+
baseNameMatch?: boolean;
|
|
17
|
+
/**
|
|
18
|
+
* Enables Bash-like brace expansion.
|
|
19
|
+
*
|
|
20
|
+
* @default true
|
|
21
|
+
*/
|
|
22
|
+
braceExpansion?: boolean;
|
|
23
|
+
/**
|
|
24
|
+
* Enables a case-sensitive mode for matching files.
|
|
25
|
+
*
|
|
26
|
+
* @default true
|
|
27
|
+
*/
|
|
28
|
+
caseSensitiveMatch?: boolean;
|
|
29
|
+
/**
|
|
30
|
+
* Specifies the maximum number of concurrent requests from a reader to read
|
|
31
|
+
* directories.
|
|
32
|
+
*
|
|
33
|
+
* @default os.cpus().length
|
|
34
|
+
*/
|
|
35
|
+
concurrency?: number;
|
|
36
|
+
/**
|
|
37
|
+
* The current working directory in which to search.
|
|
38
|
+
*
|
|
39
|
+
* @default process.cwd()
|
|
40
|
+
*/
|
|
41
|
+
cwd?: string;
|
|
42
|
+
/**
|
|
43
|
+
* Specifies the maximum depth of a read directory relative to the start
|
|
44
|
+
* directory.
|
|
45
|
+
*
|
|
46
|
+
* @default Infinity
|
|
47
|
+
*/
|
|
48
|
+
deep?: number;
|
|
49
|
+
/**
|
|
50
|
+
* Allow patterns to match entries that begin with a period (`.`).
|
|
51
|
+
*
|
|
52
|
+
* @default false
|
|
53
|
+
*/
|
|
54
|
+
dot?: boolean;
|
|
55
|
+
/**
|
|
56
|
+
* Enables Bash-like `extglob` functionality.
|
|
57
|
+
*
|
|
58
|
+
* @default true
|
|
59
|
+
*/
|
|
60
|
+
extglob?: boolean;
|
|
61
|
+
/**
|
|
62
|
+
* Indicates whether to traverse descendants of symbolic link directories.
|
|
63
|
+
*
|
|
64
|
+
* @default true
|
|
65
|
+
*/
|
|
66
|
+
followSymbolicLinks?: boolean;
|
|
67
|
+
/**
|
|
68
|
+
* Custom implementation of methods for working with the file system.
|
|
69
|
+
*
|
|
70
|
+
* @default fs.*
|
|
71
|
+
*/
|
|
72
|
+
fs?: Partial<FileSystemAdapter>;
|
|
73
|
+
/**
|
|
74
|
+
* Enables recursively repeats a pattern containing `**`.
|
|
75
|
+
* If `false`, `**` behaves exactly like `*`.
|
|
76
|
+
*
|
|
77
|
+
* @default true
|
|
78
|
+
*/
|
|
79
|
+
globstar?: boolean;
|
|
80
|
+
/**
|
|
81
|
+
* An array of glob patterns to exclude matches.
|
|
82
|
+
* This is an alternative way to use negative patterns.
|
|
83
|
+
*
|
|
84
|
+
* @default []
|
|
85
|
+
*/
|
|
86
|
+
ignore?: Pattern[];
|
|
87
|
+
/**
|
|
88
|
+
* Mark the directory path with the final slash.
|
|
89
|
+
*
|
|
90
|
+
* @default false
|
|
91
|
+
*/
|
|
92
|
+
markDirectories?: boolean;
|
|
93
|
+
/**
|
|
94
|
+
* Returns objects (instead of strings) describing entries.
|
|
95
|
+
*
|
|
96
|
+
* @default false
|
|
97
|
+
*/
|
|
98
|
+
objectMode?: boolean;
|
|
99
|
+
/**
|
|
100
|
+
* Return only directories.
|
|
101
|
+
*
|
|
102
|
+
* @default false
|
|
103
|
+
*/
|
|
104
|
+
onlyDirectories?: boolean;
|
|
105
|
+
/**
|
|
106
|
+
* Return only files.
|
|
107
|
+
*
|
|
108
|
+
* @default true
|
|
109
|
+
*/
|
|
110
|
+
onlyFiles?: boolean;
|
|
111
|
+
/**
|
|
112
|
+
* Enables an object mode (`objectMode`) with an additional `stats` field.
|
|
113
|
+
*
|
|
114
|
+
* @default false
|
|
115
|
+
*/
|
|
116
|
+
stats?: boolean;
|
|
117
|
+
/**
|
|
118
|
+
* By default this package suppress only `ENOENT` errors.
|
|
119
|
+
* Set to `true` to suppress any error.
|
|
120
|
+
*
|
|
121
|
+
* @default false
|
|
122
|
+
*/
|
|
123
|
+
suppressErrors?: boolean;
|
|
124
|
+
/**
|
|
125
|
+
* Throw an error when symbolic link is broken if `true` or safely
|
|
126
|
+
* return `lstat` call if `false`.
|
|
127
|
+
*
|
|
128
|
+
* @default false
|
|
129
|
+
*/
|
|
130
|
+
throwErrorOnBrokenSymbolicLink?: boolean;
|
|
131
|
+
/**
|
|
132
|
+
* Ensures that the returned entries are unique.
|
|
133
|
+
*
|
|
134
|
+
* @default true
|
|
135
|
+
*/
|
|
136
|
+
unique?: boolean;
|
|
137
|
+
};
|
|
138
|
+
export default class Settings {
|
|
139
|
+
private readonly _options;
|
|
140
|
+
readonly absolute: boolean;
|
|
141
|
+
readonly baseNameMatch: boolean;
|
|
142
|
+
readonly braceExpansion: boolean;
|
|
143
|
+
readonly caseSensitiveMatch: boolean;
|
|
144
|
+
readonly concurrency: number;
|
|
145
|
+
readonly cwd: string;
|
|
146
|
+
readonly deep: number;
|
|
147
|
+
readonly dot: boolean;
|
|
148
|
+
readonly extglob: boolean;
|
|
149
|
+
readonly followSymbolicLinks: boolean;
|
|
150
|
+
readonly fs: FileSystemAdapter;
|
|
151
|
+
readonly globstar: boolean;
|
|
152
|
+
readonly ignore: Pattern[];
|
|
153
|
+
readonly markDirectories: boolean;
|
|
154
|
+
readonly objectMode: boolean;
|
|
155
|
+
readonly onlyDirectories: boolean;
|
|
156
|
+
readonly onlyFiles: boolean;
|
|
157
|
+
readonly stats: boolean;
|
|
158
|
+
readonly suppressErrors: boolean;
|
|
159
|
+
readonly throwErrorOnBrokenSymbolicLink: boolean;
|
|
160
|
+
readonly unique: boolean;
|
|
161
|
+
constructor(_options?: Options);
|
|
162
|
+
private _getValue;
|
|
163
|
+
private _getFileSystemMethods;
|
|
164
|
+
}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
/// <reference types="node" />
|
|
2
|
+
import * as fsWalk from '../../@nodelib/fs.walk';
|
|
3
|
+
export declare type ErrnoException = NodeJS.ErrnoException;
|
|
4
|
+
export declare type Entry = fsWalk.Entry;
|
|
5
|
+
export declare type EntryItem = string | Entry;
|
|
6
|
+
export declare type Pattern = string;
|
|
7
|
+
export declare type PatternRe = RegExp;
|
|
8
|
+
export declare type PatternsGroup = Record<string, Pattern[]>;
|
|
9
|
+
export declare type ReaderOptions = fsWalk.Options & {
|
|
10
|
+
transform(entry: Entry): EntryItem;
|
|
11
|
+
deepFilter: DeepFilterFunction;
|
|
12
|
+
entryFilter: EntryFilterFunction;
|
|
13
|
+
errorFilter: ErrorFilterFunction;
|
|
14
|
+
fs: FileSystemAdapter;
|
|
15
|
+
stats: boolean;
|
|
16
|
+
};
|
|
17
|
+
export declare type ErrorFilterFunction = fsWalk.ErrorFilterFunction;
|
|
18
|
+
export declare type EntryFilterFunction = fsWalk.EntryFilterFunction;
|
|
19
|
+
export declare type DeepFilterFunction = fsWalk.DeepFilterFunction;
|
|
20
|
+
export declare type EntryTransformerFunction = (entry: Entry) => EntryItem;
|
|
21
|
+
export declare type MicromatchOptions = {
|
|
22
|
+
dot?: boolean;
|
|
23
|
+
matchBase?: boolean;
|
|
24
|
+
nobrace?: boolean;
|
|
25
|
+
nocase?: boolean;
|
|
26
|
+
noext?: boolean;
|
|
27
|
+
noglobstar?: boolean;
|
|
28
|
+
posix?: boolean;
|
|
29
|
+
strictSlashes?: boolean;
|
|
30
|
+
};
|
|
31
|
+
export declare type FileSystemAdapter = fsWalk.FileSystemAdapter;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"name":"fast-glob","author":{"name":"Denis Malinochkin","url":"https://mrmlnc.com"},"version":"3.2.11","license":"MIT","typings":"out/index.d.ts"}
|
|
@@ -0,0 +1,186 @@
|
|
|
1
|
+
import {Options as FastGlobOptions, Entry as FastGlobEntry} from '../fast-glob';
|
|
2
|
+
|
|
3
|
+
declare namespace globby {
|
|
4
|
+
type ExpandDirectoriesOption =
|
|
5
|
+
| boolean
|
|
6
|
+
| readonly string[]
|
|
7
|
+
| {files?: readonly string[]; extensions?: readonly string[]};
|
|
8
|
+
|
|
9
|
+
type Entry = FastGlobEntry;
|
|
10
|
+
|
|
11
|
+
interface GlobbyOptions extends FastGlobOptions {
|
|
12
|
+
/**
|
|
13
|
+
If set to `true`, `globby` will automatically glob directories for you. If you define an `Array` it will only glob files that matches the patterns inside the `Array`. You can also define an `Object` with `files` and `extensions` like in the example below.
|
|
14
|
+
|
|
15
|
+
Note that if you set this option to `false`, you won't get back matched directories unless you set `onlyFiles: false`.
|
|
16
|
+
|
|
17
|
+
@default true
|
|
18
|
+
|
|
19
|
+
@example
|
|
20
|
+
```
|
|
21
|
+
import globby = require('./globby');
|
|
22
|
+
|
|
23
|
+
(async () => {
|
|
24
|
+
const paths = await globby('images', {
|
|
25
|
+
expandDirectories: {
|
|
26
|
+
files: ['cat', 'unicorn', '*.jpg'],
|
|
27
|
+
extensions: ['png']
|
|
28
|
+
}
|
|
29
|
+
});
|
|
30
|
+
|
|
31
|
+
console.log(paths);
|
|
32
|
+
//=> ['cat.png', 'unicorn.png', 'cow.jpg', 'rainbow.jpg']
|
|
33
|
+
})();
|
|
34
|
+
```
|
|
35
|
+
*/
|
|
36
|
+
readonly expandDirectories?: ExpandDirectoriesOption;
|
|
37
|
+
|
|
38
|
+
/**
|
|
39
|
+
Respect ignore patterns in `.gitignore` files that apply to the globbed files.
|
|
40
|
+
|
|
41
|
+
@default false
|
|
42
|
+
*/
|
|
43
|
+
readonly gitignore?: boolean;
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
interface GlobTask {
|
|
47
|
+
readonly pattern: string;
|
|
48
|
+
readonly options: GlobbyOptions;
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
interface GitignoreOptions {
|
|
52
|
+
readonly cwd?: string;
|
|
53
|
+
readonly ignore?: readonly string[];
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
type FilterFunction = (path: string) => boolean;
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
interface Gitignore {
|
|
60
|
+
/**
|
|
61
|
+
@returns A filter function indicating whether a given path is ignored via a `.gitignore` file.
|
|
62
|
+
*/
|
|
63
|
+
sync: (options?: globby.GitignoreOptions) => globby.FilterFunction;
|
|
64
|
+
|
|
65
|
+
/**
|
|
66
|
+
`.gitignore` files matched by the ignore config are not used for the resulting filter function.
|
|
67
|
+
|
|
68
|
+
@returns A filter function indicating whether a given path is ignored via a `.gitignore` file.
|
|
69
|
+
|
|
70
|
+
@example
|
|
71
|
+
```
|
|
72
|
+
import {gitignore} from './globby';
|
|
73
|
+
|
|
74
|
+
(async () => {
|
|
75
|
+
const isIgnored = await gitignore();
|
|
76
|
+
console.log(isIgnored('some/file'));
|
|
77
|
+
})();
|
|
78
|
+
```
|
|
79
|
+
*/
|
|
80
|
+
(options?: globby.GitignoreOptions): Promise<globby.FilterFunction>;
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
declare const globby: {
|
|
84
|
+
/**
|
|
85
|
+
Find files and directories using glob patterns.
|
|
86
|
+
|
|
87
|
+
Note that glob patterns can only contain forward-slashes, not backward-slashes, so if you want to construct a glob pattern from path components, you need to use `path.posix.join()` instead of `path.join()`.
|
|
88
|
+
|
|
89
|
+
@param patterns - See the supported [glob patterns](https://github.com/sindresorhus/globby#globbing-patterns).
|
|
90
|
+
@param options - See the [`fast-glob` options](https://github.com/mrmlnc/fast-glob#options-3) in addition to the ones in this package.
|
|
91
|
+
@returns The matching paths.
|
|
92
|
+
*/
|
|
93
|
+
sync: ((
|
|
94
|
+
patterns: string | readonly string[],
|
|
95
|
+
options: globby.GlobbyOptions & {objectMode: true}
|
|
96
|
+
) => globby.Entry[]) & ((
|
|
97
|
+
patterns: string | readonly string[],
|
|
98
|
+
options?: globby.GlobbyOptions
|
|
99
|
+
) => string[]);
|
|
100
|
+
|
|
101
|
+
/**
|
|
102
|
+
Find files and directories using glob patterns.
|
|
103
|
+
|
|
104
|
+
Note that glob patterns can only contain forward-slashes, not backward-slashes, so if you want to construct a glob pattern from path components, you need to use `path.posix.join()` instead of `path.join()`.
|
|
105
|
+
|
|
106
|
+
@param patterns - See the supported [glob patterns](https://github.com/sindresorhus/globby#globbing-patterns).
|
|
107
|
+
@param options - See the [`fast-glob` options](https://github.com/mrmlnc/fast-glob#options-3) in addition to the ones in this package.
|
|
108
|
+
@returns The stream of matching paths.
|
|
109
|
+
|
|
110
|
+
@example
|
|
111
|
+
```
|
|
112
|
+
import globby = require('./globby');
|
|
113
|
+
|
|
114
|
+
(async () => {
|
|
115
|
+
for await (const path of globby.stream('*.tmp')) {
|
|
116
|
+
console.log(path);
|
|
117
|
+
}
|
|
118
|
+
})();
|
|
119
|
+
```
|
|
120
|
+
*/
|
|
121
|
+
stream: (
|
|
122
|
+
patterns: string | readonly string[],
|
|
123
|
+
options?: globby.GlobbyOptions
|
|
124
|
+
) => NodeJS.ReadableStream;
|
|
125
|
+
|
|
126
|
+
/**
|
|
127
|
+
Note that you should avoid running the same tasks multiple times as they contain a file system cache. Instead, run this method each time to ensure file system changes are taken into consideration.
|
|
128
|
+
|
|
129
|
+
@param patterns - See the supported [glob patterns](https://github.com/sindresorhus/globby#globbing-patterns).
|
|
130
|
+
@param options - See the [`fast-glob` options](https://github.com/mrmlnc/fast-glob#options-3) in addition to the ones in this package.
|
|
131
|
+
@returns An object in the format `{pattern: string, options: object}`, which can be passed as arguments to [`fast-glob`](https://github.com/mrmlnc/fast-glob). This is useful for other globbing-related packages.
|
|
132
|
+
*/
|
|
133
|
+
generateGlobTasks: (
|
|
134
|
+
patterns: string | readonly string[],
|
|
135
|
+
options?: globby.GlobbyOptions
|
|
136
|
+
) => globby.GlobTask[];
|
|
137
|
+
|
|
138
|
+
/**
|
|
139
|
+
Note that the options affect the results.
|
|
140
|
+
|
|
141
|
+
This function is backed by [`fast-glob`](https://github.com/mrmlnc/fast-glob#isdynamicpatternpattern-options).
|
|
142
|
+
|
|
143
|
+
@param patterns - See the supported [glob patterns](https://github.com/sindresorhus/globby#globbing-patterns).
|
|
144
|
+
@param options - See the [`fast-glob` options](https://github.com/mrmlnc/fast-glob#options-3).
|
|
145
|
+
@returns Whether there are any special glob characters in the `patterns`.
|
|
146
|
+
*/
|
|
147
|
+
hasMagic: (
|
|
148
|
+
patterns: string | readonly string[],
|
|
149
|
+
options?: FastGlobOptions
|
|
150
|
+
) => boolean;
|
|
151
|
+
|
|
152
|
+
readonly gitignore: Gitignore;
|
|
153
|
+
|
|
154
|
+
(
|
|
155
|
+
patterns: string | readonly string[],
|
|
156
|
+
options: globby.GlobbyOptions & {objectMode: true}
|
|
157
|
+
): Promise<globby.Entry[]>;
|
|
158
|
+
|
|
159
|
+
/**
|
|
160
|
+
Find files and directories using glob patterns.
|
|
161
|
+
|
|
162
|
+
Note that glob patterns can only contain forward-slashes, not backward-slashes, so if you want to construct a glob pattern from path components, you need to use `path.posix.join()` instead of `path.join()`.
|
|
163
|
+
|
|
164
|
+
@param patterns - See the supported [glob patterns](https://github.com/sindresorhus/globby#globbing-patterns).
|
|
165
|
+
@param options - See the [`fast-glob` options](https://github.com/mrmlnc/fast-glob#options-3) in addition to the ones in this package.
|
|
166
|
+
@returns The matching paths.
|
|
167
|
+
|
|
168
|
+
@example
|
|
169
|
+
```
|
|
170
|
+
import globby = require('./globby');
|
|
171
|
+
|
|
172
|
+
(async () => {
|
|
173
|
+
const paths = await globby(['*', '!cake']);
|
|
174
|
+
|
|
175
|
+
console.log(paths);
|
|
176
|
+
//=> ['unicorn', 'rainbow']
|
|
177
|
+
})();
|
|
178
|
+
```
|
|
179
|
+
*/
|
|
180
|
+
(
|
|
181
|
+
patterns: string | readonly string[],
|
|
182
|
+
options?: globby.GlobbyOptions
|
|
183
|
+
): Promise<string[]>;
|
|
184
|
+
};
|
|
185
|
+
|
|
186
|
+
export = globby;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
(()=>{var t={337:t=>{"use strict";t.exports=(...t)=>[...new Set([].concat(...t))]},352:(t,e,r)=>{"use strict";const n=r(17);const s=r(223);const getExtensions=t=>t.length>1?`{${t.join(",")}}`:t[0];const getPath=(t,e)=>{const r=t[0]==="!"?t.slice(1):t;return n.isAbsolute(r)?r:n.join(e,r)};const addExtensions=(t,e)=>{if(n.extname(t)){return`**/${t}`}return`**/${t}.${getExtensions(e)}`};const getGlob=(t,e)=>{if(e.files&&!Array.isArray(e.files)){throw new TypeError(`Expected \`files\` to be of type \`Array\` but received type \`${typeof e.files}\``)}if(e.extensions&&!Array.isArray(e.extensions)){throw new TypeError(`Expected \`extensions\` to be of type \`Array\` but received type \`${typeof e.extensions}\``)}if(e.files&&e.extensions){return e.files.map((r=>n.posix.join(t,addExtensions(r,e.extensions))))}if(e.files){return e.files.map((e=>n.posix.join(t,`**/${e}`)))}if(e.extensions){return[n.posix.join(t,`**/*.${getExtensions(e.extensions)}`)]}return[n.posix.join(t,"**")]};t.exports=async(t,e)=>{e={cwd:process.cwd(),...e};if(typeof e.cwd!=="string"){throw new TypeError(`Expected \`cwd\` to be of type \`string\` but received type \`${typeof e.cwd}\``)}const r=await Promise.all([].concat(t).map((async t=>{const r=await s.isDirectory(getPath(t,e.cwd));return r?getGlob(t,e):t})));return[].concat.apply([],r)};t.exports.sync=(t,e)=>{e={cwd:process.cwd(),...e};if(typeof e.cwd!=="string"){throw new TypeError(`Expected \`cwd\` to be of type \`string\` but received type \`${typeof e.cwd}\``)}const r=[].concat(t).map((t=>s.isDirectorySync(getPath(t,e.cwd))?getGlob(t,e):t));return[].concat.apply([],r)}},153:(t,e,r)=>{"use strict";const{promisify:n}=r(837);const s=r(147);const o=r(17);const i=r(592);const c=r(302);const a=r(398);const p=["**/node_modules/**","**/flow-typed/**","**/coverage/**","**/.git"];const u=n(s.readFile);const mapGitIgnorePatternTo=t=>e=>{if(e.startsWith("!")){return"!"+o.posix.join(t,e.slice(1))}return o.posix.join(t,e)};const parseGitIgnore=(t,e)=>{const r=a(o.relative(e.cwd,o.dirname(e.fileName)));return t.split(/\r?\n/).filter(Boolean).filter((t=>!t.startsWith("#"))).map(mapGitIgnorePatternTo(r))};const reduceIgnore=t=>{const e=c();for(const r of t){e.add(parseGitIgnore(r.content,{cwd:r.cwd,fileName:r.filePath}))}return e};const ensureAbsolutePathForCwd=(t,e)=>{t=a(t);if(o.isAbsolute(e)){if(a(e).startsWith(t)){return e}throw new Error(`Path ${e} is not in cwd ${t}`)}return o.join(t,e)};const getIsIgnoredPredecate=(t,e)=>r=>t.ignores(a(o.relative(e,ensureAbsolutePathForCwd(e,r.path||r))));const getFile=async(t,e)=>{const r=o.join(e,t);const n=await u(r,"utf8");return{cwd:e,filePath:r,content:n}};const getFileSync=(t,e)=>{const r=o.join(e,t);const n=s.readFileSync(r,"utf8");return{cwd:e,filePath:r,content:n}};const normalizeOptions=({ignore:t=[],cwd:e=a(process.cwd())}={})=>({ignore:t,cwd:e});t.exports=async t=>{t=normalizeOptions(t);const e=await i("**/.gitignore",{ignore:p.concat(t.ignore),cwd:t.cwd});const r=await Promise.all(e.map((e=>getFile(e,t.cwd))));const n=reduceIgnore(r);return getIsIgnoredPredecate(n,t.cwd)};t.exports.sync=t=>{t=normalizeOptions(t);const e=i.sync("**/.gitignore",{ignore:p.concat(t.ignore),cwd:t.cwd});const r=e.map((e=>getFileSync(e,t.cwd)));const n=reduceIgnore(r);return getIsIgnoredPredecate(n,t.cwd)}},718:(t,e,r)=>{"use strict";const n=r(147);const s=r(337);const o=r(382);const i=r(592);const c=r(352);const a=r(153);const{FilterStream:p,UniqueStream:u}=r(546);const DEFAULT_FILTER=()=>false;const isNegative=t=>t[0]==="!";const assertPatternsInput=t=>{if(!t.every((t=>typeof t==="string"))){throw new TypeError("Patterns must be a string or an array of strings")}};const checkCwdOption=(t={})=>{if(!t.cwd){return}let e;try{e=n.statSync(t.cwd)}catch{return}if(!e.isDirectory()){throw new Error("The `cwd` option must be a path to a directory")}};const getPathString=t=>t.stats instanceof n.Stats?t.path:t;const generateGlobTasks=(t,e)=>{t=s([].concat(t));assertPatternsInput(t);checkCwdOption(e);const r=[];e={ignore:[],expandDirectories:true,...e};for(const[n,s]of t.entries()){if(isNegative(s)){continue}const o=t.slice(n).filter((t=>isNegative(t))).map((t=>t.slice(1)));const i={...e,ignore:e.ignore.concat(o)};r.push({pattern:s,options:i})}return r};const globDirs=(t,e)=>{let r={};if(t.options.cwd){r.cwd=t.options.cwd}if(Array.isArray(t.options.expandDirectories)){r={...r,files:t.options.expandDirectories}}else if(typeof t.options.expandDirectories==="object"){r={...r,...t.options.expandDirectories}}return e(t.pattern,r)};const getPattern=(t,e)=>t.options.expandDirectories?globDirs(t,e):[t.pattern];const getFilterSync=t=>t&&t.gitignore?a.sync({cwd:t.cwd,ignore:t.ignore}):DEFAULT_FILTER;const globToTask=t=>e=>{const{options:r}=t;if(r.ignore&&Array.isArray(r.ignore)&&r.expandDirectories){r.ignore=c.sync(r.ignore)}return{pattern:e,options:r}};t.exports=async(t,e)=>{const r=generateGlobTasks(t,e);const getFilter=async()=>e&&e.gitignore?a({cwd:e.cwd,ignore:e.ignore}):DEFAULT_FILTER;const getTasks=async()=>{const t=await Promise.all(r.map((async t=>{const e=await getPattern(t,c);return Promise.all(e.map(globToTask(t)))})));return s(...t)};const[n,o]=await Promise.all([getFilter(),getTasks()]);const p=await Promise.all(o.map((t=>i(t.pattern,t.options))));return s(...p).filter((t=>!n(getPathString(t))))};t.exports.sync=(t,e)=>{const r=generateGlobTasks(t,e);const n=[];for(const t of r){const e=getPattern(t,c.sync).map(globToTask(t));n.push(...e)}const o=getFilterSync(e);let a=[];for(const t of n){a=s(a,i.sync(t.pattern,t.options))}return a.filter((t=>!o(t)))};t.exports.stream=(t,e)=>{const r=generateGlobTasks(t,e);const n=[];for(const t of r){const e=getPattern(t,c.sync).map(globToTask(t));n.push(...e)}const s=getFilterSync(e);const a=new p((t=>!s(t)));const l=new u;return o(n.map((t=>i.stream(t.pattern,t.options)))).pipe(a).pipe(l)};t.exports.generateGlobTasks=generateGlobTasks;t.exports.hasMagic=(t,e)=>[].concat(t).some((t=>i.isDynamicPattern(t,e)));t.exports.gitignore=a},546:(t,e,r)=>{"use strict";const{Transform:n}=r(781);class ObjectTransform extends n{constructor(){super({objectMode:true})}}class FilterStream extends ObjectTransform{constructor(t){super();this._filter=t}_transform(t,e,r){if(this._filter(t)){this.push(t)}r()}}class UniqueStream extends ObjectTransform{constructor(){super();this._pushed=new Set}_transform(t,e,r){if(!this._pushed.has(t)){this.push(t);this._pushed.add(t)}r()}}t.exports={FilterStream:FilterStream,UniqueStream:UniqueStream}},302:t=>{function makeArray(t){return Array.isArray(t)?t:[t]}const e="";const r=" ";const n="\\";const s=/^\s+$/;const o=/^\\!/;const i=/^\\#/;const c=/\r?\n/g;const a=/^\.*\/|^\.+$/;const p="/";const u=typeof Symbol!=="undefined"?Symbol.for("node-ignore"):"node-ignore";const define=(t,e,r)=>Object.defineProperty(t,e,{value:r});const l=/([0-z])-([0-z])/g;const RETURN_FALSE=()=>false;const sanitizeRange=t=>t.replace(l,((t,r,n)=>r.charCodeAt(0)<=n.charCodeAt(0)?t:e));const cleanRangeBackSlash=t=>{const{length:e}=t;return t.slice(0,e-e%2)};const f=[[/\\?\s+$/,t=>t.indexOf("\\")===0?r:e],[/\\\s/g,()=>r],[/[\\$.|*+(){^]/g,t=>`\\${t}`],[/(?!\\)\?/g,()=>"[^/]"],[/^\//,()=>"^"],[/\//g,()=>"\\/"],[/^\^*\\\*\\\*\\\//,()=>"^(?:.*\\/)?"],[/^(?=[^^])/,function startingReplacer(){return!/\/(?!$)/.test(this)?"(?:^|\\/)":"^"}],[/\\\/\\\*\\\*(?=\\\/|$)/g,(t,e,r)=>e+6<r.length?"(?:\\/[^\\/]+)*":"\\/.+"],[/(^|[^\\]+)\\\*(?=.+)/g,(t,e)=>`${e}[^\\/]*`],[/\\\\\\(?=[$.|*+(){^])/g,()=>n],[/\\\\/g,()=>n],[/(\\)?\[([^\]/]*?)(\\*)($|\])/g,(t,e,r,s,o)=>e===n?`\\[${r}${cleanRangeBackSlash(s)}${o}`:o==="]"?s.length%2===0?`[${sanitizeRange(r)}${s}]`:"[]":"[]"],[/(?:[^*])$/,t=>/\/$/.test(t)?`${t}$`:`${t}(?=$|\\/$)`],[/(\^|\\\/)?\\\*$/,(t,e)=>{const r=e?`${e}[^/]+`:"[^/]*";return`${r}(?=$|\\/$)`}]];const d=Object.create(null);const makeRegex=(t,e)=>{let r=d[t];if(!r){r=f.reduce(((e,r)=>e.replace(r[0],r[1].bind(t))),t);d[t]=r}return e?new RegExp(r,"i"):new RegExp(r)};const isString=t=>typeof t==="string";const checkPattern=t=>t&&isString(t)&&!s.test(t)&&t.indexOf("#")!==0;const splitPattern=t=>t.split(c);class IgnoreRule{constructor(t,e,r,n){this.origin=t;this.pattern=e;this.negative=r;this.regex=n}}const createRule=(t,e)=>{const r=t;let n=false;if(t.indexOf("!")===0){n=true;t=t.substr(1)}t=t.replace(o,"!").replace(i,"#");const s=makeRegex(t,e);return new IgnoreRule(r,t,n,s)};const throwError=(t,e)=>{throw new e(t)};const checkPath=(t,e,r)=>{if(!isString(t)){return r(`path must be a string, but got \`${e}\``,TypeError)}if(!t){return r(`path must not be empty`,TypeError)}if(checkPath.isNotRelative(t)){const t="`path.relative()`d";return r(`path should be a ${t} string, but got "${e}"`,RangeError)}return true};const isNotRelative=t=>a.test(t);checkPath.isNotRelative=isNotRelative;checkPath.convert=t=>t;class Ignore{constructor({ignorecase:t=true,ignoreCase:e=t,allowRelativePaths:r=false}={}){define(this,u,true);this._rules=[];this._ignoreCase=e;this._allowRelativePaths=r;this._initCache()}_initCache(){this._ignoreCache=Object.create(null);this._testCache=Object.create(null)}_addPattern(t){if(t&&t[u]){this._rules=this._rules.concat(t._rules);this._added=true;return}if(checkPattern(t)){const e=createRule(t,this._ignoreCase);this._added=true;this._rules.push(e)}}add(t){this._added=false;makeArray(isString(t)?splitPattern(t):t).forEach(this._addPattern,this);if(this._added){this._initCache()}return this}addPattern(t){return this.add(t)}_testOne(t,e){let r=false;let n=false;this._rules.forEach((s=>{const{negative:o}=s;if(n===o&&r!==n||o&&!r&&!n&&!e){return}const i=s.regex.test(t);if(i){r=!o;n=o}}));return{ignored:r,unignored:n}}_test(t,e,r,n){const s=t&&checkPath.convert(t);checkPath(s,t,this._allowRelativePaths?RETURN_FALSE:throwError);return this._t(s,e,r,n)}_t(t,e,r,n){if(t in e){return e[t]}if(!n){n=t.split(p)}n.pop();if(!n.length){return e[t]=this._testOne(t,r)}const s=this._t(n.join(p)+p,e,r,n);return e[t]=s.ignored?s:this._testOne(t,r)}ignores(t){return this._test(t,this._ignoreCache,false).ignored}createFilter(){return t=>!this.ignores(t)}filter(t){return makeArray(t).filter(this.createFilter())}test(t){return this._test(t,this._testCache,true)}}const factory=t=>new Ignore(t);const isPathValid=t=>checkPath(t&&checkPath.convert(t),t,RETURN_FALSE);factory.isPathValid=isPathValid;factory.default=factory;t.exports=factory;if(typeof process!=="undefined"&&(process.env&&process.env.IGNORE_TEST_WIN32||process.platform==="win32")){const makePosix=t=>/^\\\\\?\\/.test(t)||/["<>|\u0000-\u001F]+/u.test(t)?t:t.replace(/\\/g,"/");checkPath.convert=makePosix;const t=/^[a-z]:\//i;checkPath.isNotRelative=e=>t.test(e)||isNotRelative(e)}},382:(t,e,r)=>{"use strict";const n=r(781);const s=n.PassThrough;const o=Array.prototype.slice;t.exports=merge2;function merge2(){const t=[];const e=o.call(arguments);let r=false;let n=e[e.length-1];if(n&&!Array.isArray(n)&&n.pipe==null){e.pop()}else{n={}}const i=n.end!==false;const c=n.pipeError===true;if(n.objectMode==null){n.objectMode=true}if(n.highWaterMark==null){n.highWaterMark=64*1024}const a=s(n);function addStream(){for(let e=0,r=arguments.length;e<r;e++){t.push(pauseStreams(arguments[e],n))}mergeStream();return this}function mergeStream(){if(r){return}r=true;let e=t.shift();if(!e){process.nextTick(endStream);return}if(!Array.isArray(e)){e=[e]}let n=e.length+1;function next(){if(--n>0){return}r=false;mergeStream()}function pipe(t){function onend(){t.removeListener("merge2UnpipeEnd",onend);t.removeListener("end",onend);if(c){t.removeListener("error",onerror)}next()}function onerror(t){a.emit("error",t)}if(t._readableState.endEmitted){return next()}t.on("merge2UnpipeEnd",onend);t.on("end",onend);if(c){t.on("error",onerror)}t.pipe(a,{end:false});t.resume()}for(let t=0;t<e.length;t++){pipe(e[t])}next()}function endStream(){r=false;a.emit("queueDrain");if(i){a.end()}}a.setMaxListeners(0);a.add=addStream;a.on("unpipe",(function(t){t.emit("merge2UnpipeEnd")}));if(e.length){addStream.apply(null,e)}return a}function pauseStreams(t,e){if(!Array.isArray(t)){if(!t._readableState&&t.pipe){t=t.pipe(s(e))}if(!t._readableState||!t.pause||!t.pipe){throw new Error("Only readable stream can be merged.")}t.pause()}else{for(let r=0,n=t.length;r<n;r++){t[r]=pauseStreams(t[r],e)}}return t}},223:(t,e,r)=>{"use strict";const{promisify:n}=r(837);const s=r(147);async function isType(t,e,r){if(typeof r!=="string"){throw new TypeError(`Expected a string, got ${typeof r}`)}try{const o=await n(s[t])(r);return o[e]()}catch(t){if(t.code==="ENOENT"){return false}throw t}}function isTypeSync(t,e,r){if(typeof r!=="string"){throw new TypeError(`Expected a string, got ${typeof r}`)}try{return s[t](r)[e]()}catch(t){if(t.code==="ENOENT"){return false}throw t}}e.isFile=isType.bind(null,"stat","isFile");e.isDirectory=isType.bind(null,"stat","isDirectory");e.isSymlink=isType.bind(null,"lstat","isSymbolicLink");e.isFileSync=isTypeSync.bind(null,"statSync","isFile");e.isDirectorySync=isTypeSync.bind(null,"statSync","isDirectory");e.isSymlinkSync=isTypeSync.bind(null,"lstatSync","isSymbolicLink")},398:t=>{"use strict";t.exports=t=>{const e=/^\\\\\?\\/.test(t);const r=/[^\u0000-\u0080]+/.test(t);if(e||r){return t}return t.replace(/\\/g,"/")}},592:t=>{"use strict";t.exports=require("../fast-glob")},147:t=>{"use strict";t.exports=require("fs")},17:t=>{"use strict";t.exports=require("path")},781:t=>{"use strict";t.exports=require("stream")},837:t=>{"use strict";t.exports=require("util")}};var e={};function __nccwpck_require__(r){var n=e[r];if(n!==undefined){return n.exports}var s=e[r]={exports:{}};var o=true;try{t[r](s,s.exports,__nccwpck_require__);o=false}finally{if(o)delete e[r]}return s.exports}if(typeof __nccwpck_require__!=="undefined")__nccwpck_require__.ab=__dirname+"/";var r=__nccwpck_require__(718);module.exports=r})();
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) Sindre Sorhus <sindresorhus@gmail.com> (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.
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"name":"globby","author":{"email":"sindresorhus@gmail.com","name":"Sindre Sorhus","url":"https://sindresorhus.com"},"version":"11.1.0","funding":"https://github.com/sponsors/sindresorhus","license":"MIT"}
|
package/dist/index.js
CHANGED
|
@@ -3625,7 +3625,7 @@ import { logger as logger4 } from "@rspress/shared/logger";
|
|
|
3625
3625
|
|
|
3626
3626
|
// src/node/initRsbuild.ts
|
|
3627
3627
|
import path10 from "path";
|
|
3628
|
-
import fs9 from "@
|
|
3628
|
+
import fs9 from "@rspress/shared/fs-extra";
|
|
3629
3629
|
import {
|
|
3630
3630
|
MDX_REGEXP as MDX_REGEXP3,
|
|
3631
3631
|
RSPRESS_TEMP_DIR as RSPRESS_TEMP_DIR2,
|
|
@@ -3751,7 +3751,7 @@ async function routeVMPlugin(context) {
|
|
|
3751
3751
|
// src/node/runtimeModule/siteData/index.ts
|
|
3752
3752
|
import path7 from "path";
|
|
3753
3753
|
import { SEARCH_INDEX_NAME } from "@rspress/shared";
|
|
3754
|
-
import fs4 from "@
|
|
3754
|
+
import fs4 from "@rspress/shared/fs-extra";
|
|
3755
3755
|
|
|
3756
3756
|
// src/node/runtimeModule/siteData/normalizeThemeConfig.ts
|
|
3757
3757
|
import {
|
|
@@ -3942,7 +3942,7 @@ import {
|
|
|
3942
3942
|
MDX_REGEXP as MDX_REGEXP2
|
|
3943
3943
|
} from "@rspress/shared";
|
|
3944
3944
|
import { htmlToText } from "html-to-text";
|
|
3945
|
-
import fs3 from "@
|
|
3945
|
+
import fs3 from "@rspress/shared/fs-extra";
|
|
3946
3946
|
import { compile } from "@rspress/mdx-rs";
|
|
3947
3947
|
|
|
3948
3948
|
// src/node/utils/normalizePath.ts
|
|
@@ -3971,7 +3971,7 @@ function createHash(str2) {
|
|
|
3971
3971
|
|
|
3972
3972
|
// src/node/utils/detectReactVersion.ts
|
|
3973
3973
|
import path3 from "path";
|
|
3974
|
-
import fs from "@
|
|
3974
|
+
import fs from "@rspress/shared/fs-extra";
|
|
3975
3975
|
import { logger } from "@rspress/shared/logger";
|
|
3976
3976
|
import enhancedResolve from "enhanced-resolve";
|
|
3977
3977
|
var { CachedInputFileSystem, ResolverFactory } = enhancedResolve;
|
|
@@ -4034,7 +4034,7 @@ async function resolveReactAlias(reactVersion) {
|
|
|
4034
4034
|
// src/node/utils/flattenMdxContent.ts
|
|
4035
4035
|
import path4 from "path";
|
|
4036
4036
|
import enhancedResolve2 from "enhanced-resolve";
|
|
4037
|
-
import fs2 from "@
|
|
4037
|
+
import fs2 from "@rspress/shared/fs-extra";
|
|
4038
4038
|
import { createProcessor } from "@mdx-js/mdx";
|
|
4039
4039
|
import { MDX_REGEXP } from "@rspress/shared";
|
|
4040
4040
|
var { CachedInputFileSystem: CachedInputFileSystem2, ResolverFactory: ResolverFactory2 } = enhancedResolve2;
|
|
@@ -4377,7 +4377,7 @@ const Props_${index++} = ${JSON.stringify(source[1])};
|
|
|
4377
4377
|
}
|
|
4378
4378
|
|
|
4379
4379
|
// src/node/runtimeModule/globalStyles.ts
|
|
4380
|
-
import fs5 from "@
|
|
4380
|
+
import fs5 from "@rspress/shared/fs-extra";
|
|
4381
4381
|
async function globalStylesVMPlugin(context) {
|
|
4382
4382
|
const { config, pluginDriver } = context;
|
|
4383
4383
|
const globalStylesByPlugins = pluginDriver.globalStyles();
|
|
@@ -4398,7 +4398,7 @@ async function globalStylesVMPlugin(context) {
|
|
|
4398
4398
|
}
|
|
4399
4399
|
|
|
4400
4400
|
// src/node/runtimeModule/searchHooks.ts
|
|
4401
|
-
import fs6 from "@
|
|
4401
|
+
import fs6 from "@rspress/shared/fs-extra";
|
|
4402
4402
|
async function searchHookVMPlugin(context) {
|
|
4403
4403
|
const { config } = context;
|
|
4404
4404
|
let content = "export const onSearch = () => {}";
|
|
@@ -4507,8 +4507,8 @@ function rsbuildPluginDocVM(factoryContext) {
|
|
|
4507
4507
|
|
|
4508
4508
|
// src/node/searchIndex.ts
|
|
4509
4509
|
import path8, { join as join2 } from "path";
|
|
4510
|
-
import fs7 from "@
|
|
4511
|
-
import chalk from "@
|
|
4510
|
+
import fs7 from "@rspress/shared/fs-extra";
|
|
4511
|
+
import chalk from "@rspress/shared/chalk";
|
|
4512
4512
|
import fetch from "node-fetch";
|
|
4513
4513
|
import { isSCM, SEARCH_INDEX_NAME as SEARCH_INDEX_NAME2 } from "@rspress/shared";
|
|
4514
4514
|
import { logger as logger3 } from "@rspress/shared/logger";
|
|
@@ -4582,7 +4582,7 @@ function serveSearchIndexMiddleware(config) {
|
|
|
4582
4582
|
|
|
4583
4583
|
// src/node/route/RouteService.ts
|
|
4584
4584
|
import path9 from "path";
|
|
4585
|
-
import fs8 from "@
|
|
4585
|
+
import fs8 from "@rspress/shared/fs-extra";
|
|
4586
4586
|
import { withBase as withBase2 } from "@rspress/shared";
|
|
4587
4587
|
var DEFAULT_PAGE_EXTENSIONS = ["js", "jsx", "ts", "tsx", "md", "mdx"];
|
|
4588
4588
|
var addLeadingSlash3 = (str2) => {
|
|
@@ -4659,7 +4659,11 @@ var RouteService = class {
|
|
|
4659
4659
|
}
|
|
4660
4660
|
}
|
|
4661
4661
|
async init() {
|
|
4662
|
-
const
|
|
4662
|
+
const globby = (await import(
|
|
4663
|
+
// @ts-expect-error
|
|
4664
|
+
// eslint-disable-next-line node/file-extension-in-import
|
|
4665
|
+
"../compiled/globby/index.js"
|
|
4666
|
+
)).default;
|
|
4663
4667
|
const files = globby.sync([`**/*.{${__privateGet(this, _extensions).join(",")}}`, ...__privateGet(this, _include)], {
|
|
4664
4668
|
cwd: __privateGet(this, _scanDir),
|
|
4665
4669
|
absolute: true,
|
|
@@ -4827,7 +4831,7 @@ async function initRouteService(options2) {
|
|
|
4827
4831
|
// src/node/initRsbuild.ts
|
|
4828
4832
|
async function createInternalBuildConfig(userDocRoot, config, isSSR, routeService2, pluginDriver) {
|
|
4829
4833
|
const cwd = process.cwd();
|
|
4830
|
-
const { default: fs11 } = await import("@
|
|
4834
|
+
const { default: fs11 } = await import("@rspress/shared/fs-extra");
|
|
4831
4835
|
const CUSTOM_THEME_DIR = config?.themeDir ?? path10.join(process.cwd(), "theme");
|
|
4832
4836
|
const outDir = config?.outDir ?? OUTPUT_DIR;
|
|
4833
4837
|
const DEFAULT_THEME = __require.resolve("@rspress/theme-default");
|
|
@@ -4878,6 +4882,7 @@ async function createInternalBuildConfig(userDocRoot, config, isSSR, routeServic
|
|
|
4878
4882
|
template: path10.join(PACKAGE_ROOT, "index.html")
|
|
4879
4883
|
},
|
|
4880
4884
|
output: {
|
|
4885
|
+
targets: isSSR ? ["node"] : ["web"],
|
|
4881
4886
|
distPath: {
|
|
4882
4887
|
// `root` must be a relative path in Rsbuild
|
|
4883
4888
|
root: path10.isAbsolute(outDir) ? path10.relative(cwd, outDir) : outDir
|
|
@@ -4917,16 +4922,19 @@ async function createInternalBuildConfig(userDocRoot, config, isSSR, routeServic
|
|
|
4917
4922
|
tools: {
|
|
4918
4923
|
postcss(config2) {
|
|
4919
4924
|
if (isDebugMode()) {
|
|
4920
|
-
|
|
4921
|
-
|
|
4922
|
-
|
|
4923
|
-
|
|
4924
|
-
|
|
4925
|
-
|
|
4926
|
-
|
|
4927
|
-
|
|
4928
|
-
|
|
4929
|
-
|
|
4925
|
+
try {
|
|
4926
|
+
config2.postcssOptions.plugins.push(
|
|
4927
|
+
__require("tailwindcss")({
|
|
4928
|
+
config: {
|
|
4929
|
+
...tailwindConfig,
|
|
4930
|
+
content: [
|
|
4931
|
+
path10.join(PACKAGE_ROOT, "src", "theme-default", "**/*")
|
|
4932
|
+
]
|
|
4933
|
+
}
|
|
4934
|
+
})
|
|
4935
|
+
);
|
|
4936
|
+
} catch (e) {
|
|
4937
|
+
}
|
|
4930
4938
|
}
|
|
4931
4939
|
},
|
|
4932
4940
|
bundlerChain(chain, { CHAIN_ID }) {
|
|
@@ -4979,7 +4987,6 @@ async function initRsbuild(rootDir, config, pluginDriver, isSSR = false, extraRs
|
|
|
4979
4987
|
pluginDriver
|
|
4980
4988
|
);
|
|
4981
4989
|
const rsbuild = await createRsbuild({
|
|
4982
|
-
target: isSSR ? "node" : "web",
|
|
4983
4990
|
rsbuildConfig: mergeRsbuildConfig(
|
|
4984
4991
|
internalRsbuildConfig,
|
|
4985
4992
|
...config?.plugins?.map((plugin) => plugin.builderConfig ?? {}) || [],
|
|
@@ -5211,8 +5218,8 @@ async function dev(options2) {
|
|
|
5211
5218
|
// src/node/build.ts
|
|
5212
5219
|
import { dirname as dirname2, join as join3 } from "path";
|
|
5213
5220
|
import { pathToFileURL } from "url";
|
|
5214
|
-
import chalk2 from "@
|
|
5215
|
-
import fs10 from "@
|
|
5221
|
+
import chalk2 from "@rspress/shared/chalk";
|
|
5222
|
+
import fs10 from "@rspress/shared/fs-extra";
|
|
5216
5223
|
import {
|
|
5217
5224
|
APPEARANCE_KEY,
|
|
5218
5225
|
normalizeSlash,
|
|
@@ -5275,7 +5282,7 @@ async function renderPages(appDirectory, config, pluginDriver, enableSSG) {
|
|
|
5275
5282
|
const outputPath = config?.outDir ?? join3(appDirectory, OUTPUT_DIR);
|
|
5276
5283
|
const ssrBundlePath = join3(outputPath, "ssr", "main.cjs");
|
|
5277
5284
|
try {
|
|
5278
|
-
const { default: fs11 } = await import("@
|
|
5285
|
+
const { default: fs11 } = await import("@rspress/shared/fs-extra");
|
|
5279
5286
|
let render = null;
|
|
5280
5287
|
if (enableSSG) {
|
|
5281
5288
|
try {
|