@ohos-ports/rspack-core 2.2.2-beta.0 → 2.3.2-beta.0
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/README.md +9 -0
- package/compiled/@rspack/lite-tapable/dist/index.d.ts +20 -6
- package/compiled/@rspack/lite-tapable/package.json +1 -1
- package/compiled/http-proxy-middleware/index.d.ts +10 -10
- package/compiled/http-proxy-middleware/package.json +1 -1
- package/compiled/open/package.json +1 -1
- package/compiled/tinypool/README.md +4 -4
- package/compiled/tinypool/dist/index.d.ts +3 -2
- package/compiled/tinypool/dist/index.js +3 -3
- package/compiled/tinypool/package.json +1 -1
- package/compiled/watchpack/index.js +276 -49
- package/compiled/watchpack/package.json +1 -1
- package/compiled/watchpack/types/DirectoryWatcher.d.ts +24 -0
- package/compiled/watchpack/types/index.d.ts +1 -1
- package/compiled/watchpack/types/watchEventSource.d.ts +9 -0
- package/compiled/webpack-sources/index.d.ts +61 -0
- package/compiled/webpack-sources/index.js +858 -224
- package/compiled/webpack-sources/package.json +8 -1
- package/compiled/webpack-sources/types/CachedSource.d.ts +192 -0
- package/compiled/webpack-sources/types/CompatSource.d.ts +87 -0
- package/compiled/webpack-sources/types/ConcatSource.d.ts +75 -0
- package/compiled/webpack-sources/types/OriginalSource.d.ts +87 -0
- package/compiled/webpack-sources/types/PrefixSource.d.ts +59 -0
- package/compiled/webpack-sources/types/RawSource.d.ts +75 -0
- package/compiled/webpack-sources/types/ReplaceSource.d.ts +107 -0
- package/compiled/webpack-sources/types/SizeOnlySource.d.ts +24 -0
- package/compiled/webpack-sources/types/Source.d.ts +189 -0
- package/compiled/webpack-sources/types/SourceMapSource.d.ts +136 -0
- package/compiled/webpack-sources/types/helpers/createMappingsSerializer.d.ts +60 -0
- package/compiled/webpack-sources/types/helpers/getFromStreamChunks.d.ts +16 -0
- package/compiled/webpack-sources/types/helpers/getGeneratedSourceInfo.d.ts +31 -0
- package/compiled/webpack-sources/types/helpers/getName.d.ts +15 -0
- package/compiled/webpack-sources/types/helpers/getSource.d.ts +15 -0
- package/compiled/webpack-sources/types/helpers/readMappings.d.ts +19 -0
- package/compiled/webpack-sources/types/helpers/scopes.d.ts +119 -0
- package/compiled/webpack-sources/types/helpers/splitIntoLines.d.ts +6 -0
- package/compiled/webpack-sources/types/helpers/splitIntoPotentialTokens.d.ts +37 -0
- package/compiled/webpack-sources/types/helpers/streamAndGetSourceAndMap.d.ts +39 -0
- package/compiled/webpack-sources/types/helpers/streamChunks.d.ts +56 -0
- package/compiled/webpack-sources/types/helpers/streamChunksOfCombinedSourceMap.d.ts +42 -0
- package/compiled/webpack-sources/types/helpers/streamChunksOfRawSource.d.ts +16 -0
- package/compiled/webpack-sources/types/helpers/streamChunksOfSourceMap.d.ts +19 -0
- package/compiled/webpack-sources/types/helpers/stringBufferUtils.d.ts +55 -0
- package/compiled/webpack-sources/types/index.d.ts +50 -0
- package/dist/BuildInfo.d.ts +13 -4
- package/dist/Chunk.d.ts +3 -3
- package/dist/ChunkGraph.d.ts +2 -2
- package/dist/Chunks.d.ts +2 -2
- package/dist/CodeGenerationResults.d.ts +6 -1
- package/dist/Compilation.d.ts +16 -53
- package/dist/Compiler.d.ts +9 -10
- package/dist/ConcatenatedModule.d.ts +5 -1
- package/dist/ContextModule.d.ts +3 -1
- package/dist/Diagnostics.d.ts +2 -6
- package/dist/Entrypoint.d.ts +1 -1
- package/dist/ExportsInfo.d.ts +1 -1
- package/dist/ExternalModule.d.ts +7 -6
- package/dist/FileSystem.d.ts +3 -1
- package/dist/FileSystemDependencies.d.ts +15 -0
- package/dist/FileSystemInfo.d.ts +1 -0
- package/dist/Module.d.ts +19 -11
- package/dist/ModuleGraph.d.ts +6 -6
- package/dist/ModuleGraphConnection.d.ts +9 -3
- package/dist/Modules.d.ts +3 -0
- package/dist/NativeWatchFileSystem.d.ts +20 -8
- package/dist/NormalModule.d.ts +14 -6
- package/dist/NormalModuleFactory.d.ts +2 -1
- package/dist/Resolver.d.ts +10 -2
- package/dist/ResolverFactory.d.ts +1 -1
- package/dist/RspackError.d.ts +2 -2
- package/dist/RuntimeGlobals.d.ts +4 -3
- package/dist/RuntimeModule.d.ts +1 -1
- package/dist/RuntimeTemplate.d.ts +1 -0
- package/dist/Stats.d.ts +1 -1
- package/dist/builtin-loader/lightningcss/target.d.ts +1 -1
- package/dist/builtin-plugin/APIPlugin.d.ts +1 -1
- package/dist/builtin-plugin/ArrayPushCallbackChunkFormatPlugin.d.ts +1 -1
- package/dist/builtin-plugin/AssetModulesPlugin.d.ts +1 -1
- package/dist/builtin-plugin/AsyncWebAssemblyModulesPlugin.d.ts +1 -1
- package/dist/builtin-plugin/BannerPlugin.d.ts +2 -2
- package/dist/builtin-plugin/BundlerInfoRspackPlugin.d.ts +1 -1
- package/dist/builtin-plugin/CaseSensitivePlugin.d.ts +1 -1
- package/dist/builtin-plugin/ChunkPrefetchPreloadPlugin.d.ts +1 -1
- package/dist/builtin-plugin/CircularCheckRspackPlugin.d.ts +1 -1
- package/dist/builtin-plugin/CircularDependencyRspackPlugin.d.ts +1 -1
- package/dist/builtin-plugin/CircularModulesInfoPlugin.d.ts +1 -1
- package/dist/builtin-plugin/CommonJsChunkFormatPlugin.d.ts +1 -1
- package/dist/builtin-plugin/CompactHashedChunkIdsPlugin.d.ts +1 -1
- package/dist/builtin-plugin/CompactHashedModuleIdsPlugin.d.ts +1 -1
- package/dist/builtin-plugin/ContextReplacementPlugin.d.ts +1 -1
- package/dist/builtin-plugin/CopyRspackPlugin.d.ts +2 -2
- package/dist/builtin-plugin/CssChunkingPlugin.d.ts +1 -1
- package/dist/builtin-plugin/CssHttpExternalsRspackPlugin.d.ts +1 -1
- package/dist/builtin-plugin/CssModulesPlugin.d.ts +1 -1
- package/dist/builtin-plugin/DataUriPlugin.d.ts +1 -1
- package/dist/builtin-plugin/DefinePlugin.d.ts +1 -1
- package/dist/builtin-plugin/DeterministicChunkIdsPlugin.d.ts +1 -1
- package/dist/builtin-plugin/DeterministicModuleIdsPlugin.d.ts +1 -1
- package/dist/builtin-plugin/DllEntryPlugin.d.ts +1 -1
- package/dist/builtin-plugin/DllReferenceAgencyPlugin.d.ts +2 -2
- package/dist/builtin-plugin/DynamicEntryPlugin.d.ts +1 -1
- package/dist/builtin-plugin/ElectronTargetPlugin.d.ts +1 -1
- package/dist/builtin-plugin/EnableChunkLoadingPlugin.d.ts +1 -1
- package/dist/builtin-plugin/EnableLibraryPlugin.d.ts +1 -1
- package/dist/builtin-plugin/EnableWasmLoadingPlugin.d.ts +1 -1
- package/dist/builtin-plugin/EnsureChunkConditionsPlugin.d.ts +1 -1
- package/dist/builtin-plugin/EntryPlugin.d.ts +2 -2
- package/dist/builtin-plugin/EsmNodeTargetPlugin.d.ts +1 -1
- package/dist/builtin-plugin/EvalDevToolModulePlugin.d.ts +2 -2
- package/dist/builtin-plugin/EvalSourceMapDevToolPlugin.d.ts +5 -4
- package/dist/builtin-plugin/ExternalsPlugin.d.ts +1 -1
- package/dist/builtin-plugin/FetchCompileAsyncWasmPlugin.d.ts +1 -1
- package/dist/builtin-plugin/FileUriPlugin.d.ts +1 -1
- package/dist/builtin-plugin/FlagAllModulesAsUsedPlugin.d.ts +1 -1
- package/dist/builtin-plugin/FlagDependencyExportsPlugin.d.ts +1 -1
- package/dist/builtin-plugin/FlagDependencyUsagePlugin.d.ts +1 -1
- package/dist/builtin-plugin/HashedModuleIdsPlugin.d.ts +2 -2
- package/dist/builtin-plugin/HotModuleReplacementPlugin.d.ts +1 -1
- package/dist/builtin-plugin/HttpExternalsRspackPlugin.d.ts +1 -1
- package/dist/builtin-plugin/HttpUriPlugin.d.ts +5 -1
- package/dist/builtin-plugin/IgnorePlugin.d.ts +2 -2
- package/dist/builtin-plugin/ImportedByDeferModulesPlugin.d.ts +9 -0
- package/dist/builtin-plugin/InferAsyncModulesPlugin.d.ts +1 -1
- package/dist/builtin-plugin/InlineExportsPlugin.d.ts +1 -1
- package/dist/builtin-plugin/JavascriptModulesPlugin.d.ts +1 -1
- package/dist/builtin-plugin/JsLoaderRspackPlugin.d.ts +1 -1
- package/dist/builtin-plugin/JsonModulesPlugin.d.ts +1 -1
- package/dist/builtin-plugin/LibManifestPlugin.d.ts +1 -1
- package/dist/builtin-plugin/LightningCssMinimizerRspackPlugin.d.ts +1 -1
- package/dist/builtin-plugin/LimitChunkCountPlugin.d.ts +1 -1
- package/dist/builtin-plugin/MangleExportsPlugin.d.ts +1 -1
- package/dist/builtin-plugin/MergeDuplicateChunksPlugin.d.ts +1 -1
- package/dist/builtin-plugin/ModuleChunkFormatPlugin.d.ts +1 -1
- package/dist/builtin-plugin/ModuleConcatenationPlugin.d.ts +1 -1
- package/dist/builtin-plugin/ModuleInfoHeaderPlugin.d.ts +1 -1
- package/dist/builtin-plugin/NamedChunkIdsPlugin.d.ts +1 -1
- package/dist/builtin-plugin/NamedModuleIdsPlugin.d.ts +1 -1
- package/dist/builtin-plugin/NaturalChunkIdsPlugin.d.ts +1 -1
- package/dist/builtin-plugin/NaturalModuleIdsPlugin.d.ts +1 -1
- package/dist/builtin-plugin/NoEmitOnErrorsPlugin.d.ts +1 -1
- package/dist/builtin-plugin/NodeTargetPlugin.d.ts +1 -1
- package/dist/builtin-plugin/NormalModuleReplacementPlugin.d.ts +1 -1
- package/dist/builtin-plugin/OccurrenceChunkIdsPlugin.d.ts +2 -2
- package/dist/builtin-plugin/ProgressPlugin.d.ts +2 -2
- package/dist/builtin-plugin/ProvidePlugin.d.ts +1 -1
- package/dist/builtin-plugin/RealContentHashPlugin.d.ts +1 -1
- package/dist/builtin-plugin/RemoveDuplicateModulesPlugin.d.ts +1 -1
- package/dist/builtin-plugin/RemoveEmptyChunksPlugin.d.ts +1 -1
- package/dist/builtin-plugin/RsdoctorPlugin.d.ts +2 -2
- package/dist/builtin-plugin/RslibPlugin.d.ts +4 -4
- package/dist/builtin-plugin/RstestPlugin.d.ts +2 -2
- package/dist/builtin-plugin/RuntimeChunkPlugin.d.ts +2 -2
- package/dist/builtin-plugin/RuntimePlugin.d.ts +1 -1
- package/dist/builtin-plugin/SideEffectsFlagPlugin.d.ts +1 -1
- package/dist/builtin-plugin/SizeLimitsPlugin.d.ts +1 -1
- package/dist/builtin-plugin/SourceMapDevToolPlugin.d.ts +2 -2
- package/dist/builtin-plugin/SplitChunksPlugin.d.ts +1 -1
- package/dist/builtin-plugin/SubresourceIntegrityPlugin.d.ts +3 -2
- package/dist/builtin-plugin/SwcJsMinimizerPlugin.d.ts +1 -1
- package/dist/builtin-plugin/SyncModuleIdsPlugin.d.ts +1 -1
- package/dist/builtin-plugin/URLPlugin.d.ts +1 -1
- package/dist/builtin-plugin/WorkerPlugin.d.ts +1 -1
- package/dist/builtin-plugin/base.d.ts +1 -1
- package/dist/builtin-plugin/css-extract/index.d.ts +1 -1
- package/dist/builtin-plugin/css-extract/utils.d.ts +4 -1
- package/dist/builtin-plugin/html-plugin/hooks.d.ts +1 -1
- package/dist/builtin-plugin/html-plugin/plugin.d.ts +2 -2
- package/dist/builtin-plugin/index.d.ts +1 -0
- package/dist/builtin-plugin/lazy-compilation/lazyCompilation.d.ts +3 -3
- package/dist/builtin-plugin/rsc/RscClientPlugin.d.ts +1 -1
- package/dist/builtin-plugin/rsc/RscServerPlugin.d.ts +1 -1
- package/dist/config/adapter.d.ts +1 -1
- package/dist/config/adapterRuleUse.d.ts +3 -2
- package/dist/config/normalization.d.ts +5 -8
- package/dist/config/target.d.ts +2 -0
- package/dist/config/types.d.ts +104 -19
- package/dist/container/ContainerPlugin.d.ts +1 -1
- package/dist/container/ContainerReferencePlugin.d.ts +1 -1
- package/dist/container/ModuleFederationManifestPlugin.d.ts +1 -1
- package/dist/container/ModuleFederationPluginV1.d.ts +5 -1
- package/dist/container/ModuleFederationRuntimePlugin.d.ts +1 -1
- package/dist/cssExtractHmr.js +1 -1
- package/dist/cssExtractLoader.js +7 -5
- package/dist/exports.d.ts +7 -7
- package/dist/index.js +1845 -1070
- package/dist/lib/Cache.d.ts +3 -0
- package/dist/lib/DllReferencePlugin.d.ts +1 -1
- package/dist/lib/WebpackError.d.ts +1 -1
- package/dist/loader-runner/codeFilter.d.ts +9 -0
- package/dist/loader-runner/dependencies.d.ts +5 -4
- package/dist/loader-runner/index.d.ts +3 -2
- package/dist/loader-runner/service.d.ts +6 -5
- package/dist/loader-runner/worker.d.ts +5 -2
- package/dist/l~0.js +34 -0
- package/dist/l~3.js +34 -0
- package/dist/node/NodeWatchFileSystem.d.ts +7 -4
- package/dist/sharing/CollectSharedEntryPlugin.d.ts +1 -1
- package/dist/sharing/ConsumeSharedPlugin.d.ts +1 -1
- package/dist/sharing/ProvideSharedPlugin.d.ts +1 -1
- package/dist/sharing/SharePlugin.d.ts +13 -1
- package/dist/sharing/ShareRuntimePlugin.d.ts +1 -1
- package/dist/sharing/SharedContainerPlugin.d.ts +1 -1
- package/dist/sharing/SharedUsedExportsOptimizerPlugin.d.ts +2 -2
- package/dist/sources.d.ts +3 -0
- package/dist/stats/StatsFactory.d.ts +4 -2
- package/dist/stats/StatsPrinter.d.ts +5 -5
- package/dist/stats/statsFactoryUtils.d.ts +12 -6
- package/dist/swc.d.ts +1 -1
- package/dist/taps/compilation.d.ts +1 -1
- package/dist/taps/types.d.ts +1 -1
- package/dist/util/SplitChunkSize.d.ts +1 -1
- package/dist/util/bindingHelpers.d.ts +9 -0
- package/dist/util/createModule.d.ts +3 -0
- package/dist/util/fs.d.ts +22 -16
- package/dist/util/resolveLayerExternals.d.ts +1 -0
- package/dist/util/source.d.ts +13 -4
- package/dist/util/symbols.d.ts +10 -0
- package/dist/util/watchTimeInfo.d.ts +11 -0
- package/dist/worker.js +386 -353
- package/hot/lazy-compilation-node.js +1 -1
- package/hot/lazy-compilation-web.js +1 -1
- package/package.json +8 -32
- package/compiled/webpack-sources/types.d.ts +0 -500
- package/dist/612~0.js +0 -32
- package/dist/612~3.js +0 -32
- package/dist/loader-runner/cache.d.ts +0 -18
- package/dist/util/MergeCaller.d.ts +0 -10
- package/dist/util/fake.d.ts +0 -11
package/dist/lib/Cache.d.ts
CHANGED
|
@@ -7,6 +7,7 @@
|
|
|
7
7
|
* Copyright (c) JS Foundation and other contributors
|
|
8
8
|
* https://github.com/webpack/webpack/blob/main/LICENSE
|
|
9
9
|
*/
|
|
10
|
+
import type binding from '@rspack/binding';
|
|
10
11
|
import { AsyncParallelHook, AsyncSeriesBailHook, SyncHook } from '../../compiled/@rspack/lite-tapable/dist/index.js';
|
|
11
12
|
import type { WebpackError } from './WebpackError.js';
|
|
12
13
|
export interface Etag {
|
|
@@ -15,6 +16,7 @@ export interface Etag {
|
|
|
15
16
|
export type CallbackCache<T> = (err?: WebpackError | null, result?: T) => void;
|
|
16
17
|
type GotHandler<T = any> = (result: T | null, callback: (error: Error | null) => void) => void;
|
|
17
18
|
export declare class Cache {
|
|
19
|
+
#private;
|
|
18
20
|
static STAGE_DISK: number;
|
|
19
21
|
static STAGE_MEMORY: number;
|
|
20
22
|
static STAGE_DEFAULT: number;
|
|
@@ -28,6 +30,7 @@ export declare class Cache {
|
|
|
28
30
|
shutdown: AsyncParallelHook<[]>;
|
|
29
31
|
};
|
|
30
32
|
constructor();
|
|
33
|
+
static __to_binding(cache: Cache): binding.JsCache;
|
|
31
34
|
/**
|
|
32
35
|
* @param identifier the cache identifier
|
|
33
36
|
* @param etag the etag
|
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
* Copyright (c) JS Foundation and other contributors
|
|
8
8
|
* https://github.com/webpack/webpack/blob/main/LICENSE
|
|
9
9
|
*/
|
|
10
|
-
import type { JsBuildMeta } from '@
|
|
10
|
+
import type { JsBuildMeta } from '@rspack/binding';
|
|
11
11
|
import type { Compiler } from '../Compiler.js';
|
|
12
12
|
export type DllReferencePluginOptions = {
|
|
13
13
|
/**
|
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
* Copyright (c) JS Foundation and other contributors
|
|
8
8
|
* https://github.com/webpack/webpack/blob/main/LICENSE
|
|
9
9
|
*/
|
|
10
|
-
import type { DependencyLocation } from '@
|
|
10
|
+
import type { DependencyLocation } from '@rspack/binding';
|
|
11
11
|
import type { Chunk } from '../Chunk.js';
|
|
12
12
|
import type { Module } from '../Module.js';
|
|
13
13
|
export declare class WebpackError extends Error {
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
export type LoaderCodeFilter = string | RegExp;
|
|
2
|
+
export interface CodeFilterTextCache {
|
|
3
|
+
initialized: boolean;
|
|
4
|
+
content?: unknown;
|
|
5
|
+
text?: string | null;
|
|
6
|
+
}
|
|
7
|
+
export declare function createCodeFilterTextCache(): CodeFilterTextCache;
|
|
8
|
+
export declare function invalidateCodeFilterTextCache(cache: CodeFilterTextCache): void;
|
|
9
|
+
export declare function matchesCodeFilter(filter: LoaderCodeFilter, content: unknown, cache: CodeFilterTextCache): boolean | undefined;
|
|
@@ -1,10 +1,11 @@
|
|
|
1
|
-
import type { JsLoaderContext } from '@
|
|
1
|
+
import type { JsLoaderContext } from '@rspack/binding';
|
|
2
2
|
export type LoaderDependencies = JsLoaderContext['dependencies'];
|
|
3
3
|
export declare class LoaderDependenciesState {
|
|
4
|
+
#private;
|
|
4
5
|
readonly existing: LoaderDependencies;
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
6
|
+
constructor(existing: LoaderDependencies, added?: LoaderDependencies, removed?: LoaderDependencies);
|
|
7
|
+
get added(): LoaderDependencies;
|
|
8
|
+
get removed(): LoaderDependencies;
|
|
8
9
|
resetChanges(): void;
|
|
9
10
|
mergeChanges(): void;
|
|
10
11
|
addDependencies(dependencies: LoaderDependencies): void;
|
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
import { type JsLoaderContext, type JsLoaderItem } from '@
|
|
1
|
+
import { type JsLoaderContext, type JsLoaderItem } from '@rspack/binding';
|
|
2
2
|
import type { Compiler } from '../Compiler.js';
|
|
3
|
+
import { createCodeFilterTextCache } from './codeFilter.js';
|
|
3
4
|
type LoaderObjectOptions = string | (object & {
|
|
4
5
|
ident?: unknown;
|
|
5
6
|
}) | null;
|
|
@@ -27,7 +28,7 @@ export declare class LoaderObject {
|
|
|
27
28
|
get normalExecuted(): boolean;
|
|
28
29
|
set normalExecuted(value: boolean);
|
|
29
30
|
set noPitch(value: boolean);
|
|
30
|
-
|
|
31
|
+
shouldSkipNormal(content: unknown, cache: ReturnType<typeof createCodeFilterTextCache>): boolean;
|
|
31
32
|
static __from_binding(loaderItem: JsLoaderItem, compiler: Compiler): LoaderObject;
|
|
32
33
|
static __to_binding(loader: LoaderObject): JsLoaderItem;
|
|
33
34
|
}
|
|
@@ -43,8 +43,6 @@ export declare enum RequestType {
|
|
|
43
43
|
GetContextDependencies = "GetContextDependencies",
|
|
44
44
|
GetMissingDependencies = "GetMissingDependencies",
|
|
45
45
|
ClearDependencies = "ClearDependencies",
|
|
46
|
-
BeginDependencyChanges = "BeginDependencyChanges",
|
|
47
|
-
MergeDependencyChanges = "MergeDependencyChanges",
|
|
48
46
|
Resolve = "Resolve",
|
|
49
47
|
GetResolve = "GetResolve",
|
|
50
48
|
GetLogger = "GetLogger",
|
|
@@ -55,8 +53,7 @@ export declare enum RequestType {
|
|
|
55
53
|
SetCacheable = "SetCacheable",
|
|
56
54
|
ImportModule = "ImportModule",
|
|
57
55
|
UpdateLoaderObjects = "UpdateLoaderObjects",
|
|
58
|
-
|
|
59
|
-
LoaderCacheStore = "LoaderCacheStore",
|
|
56
|
+
UpdateBuildInfo = "UpdateBuildInfo",
|
|
60
57
|
CompilationGetPath = "CompilationGetPath",
|
|
61
58
|
CompilationGetPathWithInfo = "CompilationGetPathWithInfo",
|
|
62
59
|
CompilationGetAssetPath = "CompilationGetAssetPath",
|
|
@@ -67,8 +64,12 @@ export declare enum RequestSyncType {
|
|
|
67
64
|
}
|
|
68
65
|
export type HandleIncomingRequest = (requestType: RequestType, ...args: any[]) => any;
|
|
69
66
|
type WorkerArgs = any[];
|
|
70
|
-
export type WorkerError = Error
|
|
67
|
+
export type WorkerError = Error & {
|
|
68
|
+
__internal__isAggregateError?: boolean;
|
|
69
|
+
errors?: unknown;
|
|
70
|
+
};
|
|
71
71
|
export declare function serializeError(error: unknown): WorkerError;
|
|
72
|
+
export declare function deserializeError(error: WorkerError): WorkerError;
|
|
72
73
|
export declare const run: (loaderName: string, task: any, options: RunOptions & {
|
|
73
74
|
handleIncomingRequest: HandleIncomingRequest;
|
|
74
75
|
}, workerOptions?: {
|
|
@@ -1,8 +1,11 @@
|
|
|
1
1
|
import { type MessagePort } from 'node:worker_threads';
|
|
2
|
-
import { JsLoaderState } from '@
|
|
2
|
+
import { JsLoaderState } from '@rspack/binding';
|
|
3
3
|
import type { LoaderContext } from '../config/index.js';
|
|
4
4
|
interface WorkerOptions {
|
|
5
|
-
loaderContext: LoaderContext
|
|
5
|
+
loaderContext: LoaderContext & {
|
|
6
|
+
loaderChainStart: number;
|
|
7
|
+
loaderChainEnd: number;
|
|
8
|
+
};
|
|
6
9
|
loaderState: JsLoaderState;
|
|
7
10
|
args: any[];
|
|
8
11
|
workerData?: {
|
package/dist/l~0.js
ADDED
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
var modules = {}, moduleCache = {};
|
|
2
|
+
function rspackRequire(moduleId) {
|
|
3
|
+
var cachedModule = moduleCache[moduleId];
|
|
4
|
+
if (void 0 !== cachedModule) return cachedModule.exports;
|
|
5
|
+
var module = moduleCache[moduleId] = {
|
|
6
|
+
exports: {}
|
|
7
|
+
};
|
|
8
|
+
return modules[moduleId](module, module.exports, rspackRequire), module.exports;
|
|
9
|
+
}
|
|
10
|
+
var moduleFactories = modules, compatGetDefaultExport = (module)=>{
|
|
11
|
+
var getter = module && module.__esModule ? ()=>module.default : ()=>module;
|
|
12
|
+
return definePropertyGetters(getter, {
|
|
13
|
+
a: getter
|
|
14
|
+
}), getter;
|
|
15
|
+
}, definePropertyGetters = (exports, getters, values)=>{
|
|
16
|
+
var define = (defs, kind)=>{
|
|
17
|
+
for(var key in defs)hasOwnProperty(defs, key) && !hasOwnProperty(exports, key) && Object.defineProperty(exports, key, {
|
|
18
|
+
enumerable: !0,
|
|
19
|
+
[kind]: defs[key]
|
|
20
|
+
});
|
|
21
|
+
};
|
|
22
|
+
define(getters, "get"), define(values, "value");
|
|
23
|
+
};
|
|
24
|
+
moduleFactories.add = function(modules) {
|
|
25
|
+
Object.assign(moduleFactories, modules);
|
|
26
|
+
};
|
|
27
|
+
var hasOwnProperty = (obj, prop)=>Object.prototype.hasOwnProperty.call(obj, prop), makeNamespaceObject = (exports)=>{
|
|
28
|
+
"u" > typeof Symbol && Symbol.toStringTag && Object.defineProperty(exports, Symbol.toStringTag, {
|
|
29
|
+
value: 'Module'
|
|
30
|
+
}), Object.defineProperty(exports, '__esModule', {
|
|
31
|
+
value: !0
|
|
32
|
+
});
|
|
33
|
+
};
|
|
34
|
+
export { rspackRequire, moduleFactories, compatGetDefaultExport, definePropertyGetters, makeNamespaceObject };
|
package/dist/l~3.js
ADDED
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
var modules = {}, moduleCache = {};
|
|
2
|
+
function rspackRequire(moduleId) {
|
|
3
|
+
var cachedModule = moduleCache[moduleId];
|
|
4
|
+
if (void 0 !== cachedModule) return cachedModule.exports;
|
|
5
|
+
var module = moduleCache[moduleId] = {
|
|
6
|
+
exports: {}
|
|
7
|
+
};
|
|
8
|
+
return modules[moduleId](module, module.exports, rspackRequire), module.exports;
|
|
9
|
+
}
|
|
10
|
+
var moduleFactories = modules, compatGetDefaultExport = (module)=>{
|
|
11
|
+
var getter = module && module.__esModule ? ()=>module.default : ()=>module;
|
|
12
|
+
return definePropertyGetters(getter, {
|
|
13
|
+
a: getter
|
|
14
|
+
}), getter;
|
|
15
|
+
}, definePropertyGetters = (exports, getters, values)=>{
|
|
16
|
+
var define = (defs, kind)=>{
|
|
17
|
+
for(var key in defs)hasOwnProperty(defs, key) && !hasOwnProperty(exports, key) && Object.defineProperty(exports, key, {
|
|
18
|
+
enumerable: !0,
|
|
19
|
+
[kind]: defs[key]
|
|
20
|
+
});
|
|
21
|
+
};
|
|
22
|
+
define(getters, "get"), define(values, "value");
|
|
23
|
+
};
|
|
24
|
+
moduleFactories.add = function(modules) {
|
|
25
|
+
Object.assign(moduleFactories, modules);
|
|
26
|
+
};
|
|
27
|
+
var hasOwnProperty = (obj, prop)=>Object.prototype.hasOwnProperty.call(obj, prop), makeNamespaceObject = (exports)=>{
|
|
28
|
+
"u" > typeof Symbol && Symbol.toStringTag && Object.defineProperty(exports, Symbol.toStringTag, {
|
|
29
|
+
value: 'Module'
|
|
30
|
+
}), Object.defineProperty(exports, '__esModule', {
|
|
31
|
+
value: !0
|
|
32
|
+
});
|
|
33
|
+
};
|
|
34
|
+
export { rspackRequire, moduleFactories, compatGetDefaultExport, definePropertyGetters, makeNamespaceObject };
|
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
* https://github.com/webpack/webpack/blob/main/LICENSE
|
|
9
9
|
*/
|
|
10
10
|
import type Watchpack from '../../compiled/watchpack/index.js';
|
|
11
|
-
import type {
|
|
11
|
+
import type { InputFileSystem, TimeInfoEntries, Watcher, WatchFileSystem } from '../util/fs.js';
|
|
12
12
|
type WatchpackInstance = InstanceType<typeof Watchpack>;
|
|
13
13
|
export default class NodeWatchFileSystem implements WatchFileSystem {
|
|
14
14
|
#private;
|
|
@@ -16,11 +16,14 @@ export default class NodeWatchFileSystem implements WatchFileSystem {
|
|
|
16
16
|
watcherOptions: Watchpack.WatchOptions;
|
|
17
17
|
watcher?: WatchpackInstance;
|
|
18
18
|
constructor(inputFileSystem: InputFileSystem);
|
|
19
|
-
watch(files: Iterable<string>, directories: Iterable<string>, missing: Iterable<string>, startTime: number, options: Watchpack.WatchOptions, callback: (error: Error | null, fileTimeInfoEntries:
|
|
20
|
-
|
|
19
|
+
watch(files: Iterable<string>, directories: Iterable<string>, missing: Iterable<string>, startTime: number, options: Watchpack.WatchOptions, callback: (error: Error | null, fileTimeInfoEntries: TimeInfoEntries, contextTimeInfoEntries: TimeInfoEntries, changedFiles: Set<string>, removedFiles: Set<string>) => void, callbackUndelayed: (fileName: string, changeTime: number) => void): Watcher;
|
|
20
|
+
getTimes(): Record<string, number | null>;
|
|
21
|
+
getTimeInfoEntries(): TimeInfoEntries;
|
|
22
|
+
collectTimeInfoEntries(fileTimestamps: TimeInfoEntries, directoryTimestamps: TimeInfoEntries): void;
|
|
23
|
+
on(event: 'change', listener: (filename: string, mtime: number | null) => void): this;
|
|
21
24
|
on(event: 'remove', listener: (filename: string) => void): this;
|
|
22
25
|
on(event: 'aggregated', listener: (changes: Set<string>, removals: Set<string>) => void): this;
|
|
23
|
-
once(event: 'change', listener: (filename: string, mtime: number) => void): this;
|
|
26
|
+
once(event: 'change', listener: (filename: string, mtime: number | null) => void): this;
|
|
24
27
|
once(event: 'remove', listener: (filename: string) => void): this;
|
|
25
28
|
once(event: 'aggregated', listener: (changes: Set<string>, removals: Set<string>) => void): this;
|
|
26
29
|
emit(event: 'change', filename: string, mtime: number): boolean;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { type BuiltinPlugin, BuiltinPluginName } from '@
|
|
1
|
+
import { type BuiltinPlugin, BuiltinPluginName } from '@rspack/binding';
|
|
2
2
|
import { RspackBuiltinPlugin } from '../builtin-plugin/base.js';
|
|
3
3
|
import type { Compiler } from '../Compiler.js';
|
|
4
4
|
import { type NormalizedSharedOptions, type ShareScope } from './SharePlugin.js';
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { type BuiltinPlugin, BuiltinPluginName } from '@
|
|
1
|
+
import { type BuiltinPlugin, BuiltinPluginName } from '@rspack/binding';
|
|
2
2
|
import { RspackBuiltinPlugin } from '../builtin-plugin/base.js';
|
|
3
3
|
import type { Compiler } from '../Compiler.js';
|
|
4
4
|
export type ConsumeSharedPluginOptions = {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { type BuiltinPlugin, BuiltinPluginName, type RawProvideOptions } from '@
|
|
1
|
+
import { type BuiltinPlugin, BuiltinPluginName, type RawProvideOptions } from '@rspack/binding';
|
|
2
2
|
import { RspackBuiltinPlugin } from '../builtin-plugin/base.js';
|
|
3
3
|
import type { Compiler } from '../Compiler.js';
|
|
4
4
|
import type { ShareScope } from './SharePlugin.js';
|
|
@@ -2,9 +2,21 @@ import type { Compiler } from '../Compiler.js';
|
|
|
2
2
|
export type ShareScope = string | string[];
|
|
3
3
|
export declare function validateShareScope(shareScope: ShareScope, enhanced: boolean, pluginName: string): void;
|
|
4
4
|
export type SharePluginOptions = {
|
|
5
|
+
/**
|
|
6
|
+
* Share scope(s) used for modules that do not specify their own `shareScope`.
|
|
7
|
+
* @default 'default'
|
|
8
|
+
*/
|
|
5
9
|
shareScope?: ShareScope;
|
|
10
|
+
/**
|
|
11
|
+
* Modules to consume from a share scope and provide as local fallbacks.
|
|
12
|
+
* Set a module's `import` to `false` to consume it without a local fallback.
|
|
13
|
+
*/
|
|
6
14
|
shared: Shared;
|
|
7
|
-
|
|
15
|
+
/**
|
|
16
|
+
* Whether to generate sharing code for the enhanced Module Federation runtime.
|
|
17
|
+
* @default false
|
|
18
|
+
*/
|
|
19
|
+
enhanced?: boolean;
|
|
8
20
|
};
|
|
9
21
|
export type Shared = (SharedItem | SharedObject)[] | SharedObject;
|
|
10
22
|
export type SharedItem = string;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { type BuiltinPlugin, BuiltinPluginName } from '@
|
|
1
|
+
import { type BuiltinPlugin, BuiltinPluginName } from '@rspack/binding';
|
|
2
2
|
import { RspackBuiltinPlugin } from '../builtin-plugin/base.js';
|
|
3
3
|
import type { Compiler } from '../Compiler.js';
|
|
4
4
|
export declare class ShareRuntimePlugin extends RspackBuiltinPlugin {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { type BuiltinPlugin, BuiltinPluginName, type RawSharedContainerPluginOptions } from '@
|
|
1
|
+
import { type BuiltinPlugin, BuiltinPluginName, type RawSharedContainerPluginOptions } from '@rspack/binding';
|
|
2
2
|
import { RspackBuiltinPlugin } from '../builtin-plugin/base.js';
|
|
3
3
|
import type { Compiler } from '../Compiler.js';
|
|
4
4
|
import type { LibraryOptions } from '../config/index.js';
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import type { BuiltinPlugin } from '@
|
|
2
|
-
import { BuiltinPluginName } from '@
|
|
1
|
+
import type { BuiltinPlugin } from '@rspack/binding';
|
|
2
|
+
import { BuiltinPluginName } from '@rspack/binding';
|
|
3
3
|
import { RspackBuiltinPlugin } from '../builtin-plugin/base.js';
|
|
4
4
|
import { type ModuleFederationManifestPluginOptions } from '../container/ModuleFederationManifestPlugin.js';
|
|
5
5
|
import type { NormalizedSharedOptions } from './SharePlugin.js';
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
export { CachedSource, CompatSource, OriginalSource, PrefixSource, RawSource, SizeOnlySource, Source, SourceMapSource, util, } from '../compiled/webpack-sources/index.js';
|
|
2
|
+
export type * from '../compiled/webpack-sources/index.js';
|
|
3
|
+
export { RspackConcatSource as ConcatSource, RspackReplaceSource as ReplaceSource, } from './util/source.js';
|
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
* Copyright (c) JS Foundation and other contributors
|
|
8
8
|
* https://github.com/webpack/webpack/blob/main/LICENSE
|
|
9
9
|
*/
|
|
10
|
-
import type { JsStats, JsStatsCompilation, JsStatsError } from '@
|
|
10
|
+
import type { JsStats, JsStatsCompilation, JsStatsError } from '@rspack/binding';
|
|
11
11
|
import { HookMap, SyncBailHook, SyncWaterfallHook } from '../../compiled/@rspack/lite-tapable/dist/index.js';
|
|
12
12
|
import type { Compilation } from '../Compilation.js';
|
|
13
13
|
import { type GroupConfig } from '../util/smartGrouping.js';
|
|
@@ -22,7 +22,7 @@ export type KnownStatsFactoryContext = {
|
|
|
22
22
|
};
|
|
23
23
|
export type StatsFactoryContext = KnownStatsFactoryContext & Record<string, any>;
|
|
24
24
|
type Hooks = Readonly<{
|
|
25
|
-
extract: HookMap<SyncBailHook<[
|
|
25
|
+
extract: HookMap<SyncBailHook<[Record<string, any>, any, StatsFactoryContext], undefined>>;
|
|
26
26
|
filter: HookMap<SyncBailHook<[any, StatsFactoryContext, number, number], undefined>>;
|
|
27
27
|
filterSorted: HookMap<SyncBailHook<[any, StatsFactoryContext, number, number], undefined>>;
|
|
28
28
|
groupResults: HookMap<SyncBailHook<[GroupConfig<any>[], StatsFactoryContext], undefined>>;
|
|
@@ -46,7 +46,9 @@ export declare class StatsFactory {
|
|
|
46
46
|
hooks: Hooks;
|
|
47
47
|
private _caches;
|
|
48
48
|
private _inCreate;
|
|
49
|
+
private _itemTypes;
|
|
49
50
|
constructor();
|
|
51
|
+
private _getItemTypes;
|
|
50
52
|
_getAllLevelHooks(hookMap: HookMap<any>, cache: CacheHookMap, type: string): any[];
|
|
51
53
|
_forEachLevel(hookMap: HookMap<any>, cache: CacheHookMap, type: string, fn: CallFn): any;
|
|
52
54
|
_forEachLevelWaterfall(hookMap: HookMap<any>, cache: CacheHookMap, type: string, data: any, fn: CallFn): any;
|
|
@@ -33,11 +33,11 @@ export declare class StatsPrinter {
|
|
|
33
33
|
private _inPrint;
|
|
34
34
|
hooks: Readonly<{
|
|
35
35
|
sortElements: HookMap<SyncBailHook<[string[], StatsPrinterContext], true | void>>;
|
|
36
|
-
printElements: HookMap<SyncBailHook<[PrintedElement[], StatsPrinterContext], string>>;
|
|
37
|
-
sortItems: HookMap<SyncBailHook<[any[], StatsPrinterContext], true>>;
|
|
38
|
-
getItemName: HookMap<SyncBailHook<[any, StatsPrinterContext], string>>;
|
|
39
|
-
printItems: HookMap<SyncBailHook<[string[], StatsPrinterContext], string>>;
|
|
40
|
-
print: HookMap<SyncBailHook<[{}, StatsPrinterContext], string>>;
|
|
36
|
+
printElements: HookMap<SyncBailHook<[PrintedElement[], StatsPrinterContext], string | void>>;
|
|
37
|
+
sortItems: HookMap<SyncBailHook<[any[], StatsPrinterContext], true | void>>;
|
|
38
|
+
getItemName: HookMap<SyncBailHook<[any, StatsPrinterContext], string | void>>;
|
|
39
|
+
printItems: HookMap<SyncBailHook<[string[], StatsPrinterContext], string | void>>;
|
|
40
|
+
print: HookMap<SyncBailHook<[{}, StatsPrinterContext], string | void>>;
|
|
41
41
|
result: HookMap<SyncWaterfallHook<[string, StatsPrinterContext]>>;
|
|
42
42
|
}>;
|
|
43
43
|
constructor();
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import type binding from '@
|
|
2
|
-
import type { JsOriginRecord } from '@
|
|
1
|
+
import type binding from '@rspack/binding';
|
|
2
|
+
import type { JsOriginRecord } from '@rspack/binding';
|
|
3
3
|
import type { Compilation } from '../Compilation.js';
|
|
4
4
|
import type { StatsOptions } from '../config/index.js';
|
|
5
5
|
import type { StatsFactory, StatsFactoryContext } from './StatsFactory.js';
|
|
@@ -229,6 +229,12 @@ export type KnownStatsChunkOrigin = {
|
|
|
229
229
|
moduleId?: string | number | null;
|
|
230
230
|
};
|
|
231
231
|
export type StatsChunkOrigin = KnownStatsChunkOrigin & Record<string, any>;
|
|
232
|
+
export type StatsCacheInfo = {
|
|
233
|
+
hits: number;
|
|
234
|
+
misses: number;
|
|
235
|
+
reused: number;
|
|
236
|
+
stores: number;
|
|
237
|
+
};
|
|
232
238
|
export type KnownStatsCompilation = {
|
|
233
239
|
/**
|
|
234
240
|
* webpack version.
|
|
@@ -239,6 +245,7 @@ export type KnownStatsCompilation = {
|
|
|
239
245
|
rspackVersion?: string;
|
|
240
246
|
name?: string;
|
|
241
247
|
hash?: string;
|
|
248
|
+
cacheInfo?: Record<string, StatsCacheInfo>;
|
|
242
249
|
env?: any;
|
|
243
250
|
time?: number;
|
|
244
251
|
builtAt?: number;
|
|
@@ -316,7 +323,7 @@ export declare const spaceLimited: (itemsAndGroups: ItemChildren, max: number, f
|
|
|
316
323
|
filteredChildren: any;
|
|
317
324
|
};
|
|
318
325
|
export declare const countWithChildren: (compilation: Compilation, getItems: (compilation: Compilation, key: string) => any[]) => number;
|
|
319
|
-
export declare const sortByField: (field: string) => ((a1:
|
|
326
|
+
export declare const sortByField: (field: string) => ((a1: Record<string, any>, a2: Record<string, any>) => number);
|
|
320
327
|
export declare const assetGroup: (children: StatsAsset[]) => {
|
|
321
328
|
size: number;
|
|
322
329
|
};
|
|
@@ -327,10 +334,9 @@ export declare const moduleGroup: (children: {
|
|
|
327
334
|
size: number;
|
|
328
335
|
sizes: Record<string, number>;
|
|
329
336
|
};
|
|
330
|
-
export declare const mergeToObject:
|
|
331
|
-
[key: string]: any;
|
|
337
|
+
export declare const mergeToObject: <T extends {
|
|
332
338
|
name: string;
|
|
333
|
-
}[]) =>
|
|
339
|
+
}>(items: T[]) => Record<string, T>;
|
|
334
340
|
export declare const errorsSpaceLimit: (errors: StatsError[], max: number) => {
|
|
335
341
|
errors: StatsError[];
|
|
336
342
|
filtered: number;
|
package/dist/swc.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { TransformOutput } from '@
|
|
1
|
+
import type { TransformOutput } from '@rspack/binding';
|
|
2
2
|
import type { JsMinifyOptions, Options as TransformOptions } from '../compiled/@swc/types/index.js';
|
|
3
3
|
export type { JsMinifyOptions, TransformOptions, TransformOutput };
|
|
4
4
|
export declare function minify(source: string, options?: JsMinifyOptions): Promise<TransformOutput>;
|
package/dist/taps/types.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type binding from '@
|
|
1
|
+
import type binding from '@rspack/binding';
|
|
2
2
|
import type * as liteTapable from '../../compiled/@rspack/lite-tapable/dist/index.js';
|
|
3
3
|
import type { Compiler } from '../Compiler.js';
|
|
4
4
|
type CreateHookMapRegisterTaps = <H extends liteTapable.Hook<any, any, any>>(registerKind: binding.RegisterJsTapKind, getHookMap: () => liteTapable.HookMap<H>, createTap: (queried: liteTapable.QueriedHookMap<H>) => any) => (stages: number[]) => binding.JsTap[];
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { RawSplitChunkSizes } from '@
|
|
1
|
+
import type { RawSplitChunkSizes } from '@rspack/binding';
|
|
2
2
|
declare class JsSplitChunkSizes {
|
|
3
3
|
static __to_binding(sizes?: number | Record<string, number>): number | RawSplitChunkSizes | undefined;
|
|
4
4
|
}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { createModule } from './createModule.js';
|
|
2
|
+
declare function applyIndexedArrayUpdates<T>(source: readonly T[], target: T[], commands: Uint32Array): void;
|
|
3
|
+
declare function swapRemoveArrayElements<T>(array: T[], removedIndices: Uint32Array): void;
|
|
4
|
+
export declare const bindingHelpers: {
|
|
5
|
+
createModule: typeof createModule;
|
|
6
|
+
applyIndexedArrayUpdates: typeof applyIndexedArrayUpdates;
|
|
7
|
+
swapRemoveArrayElements: typeof swapRemoveArrayElements;
|
|
8
|
+
};
|
|
9
|
+
export {};
|
package/dist/util/fs.d.ts
CHANGED
|
@@ -9,20 +9,22 @@
|
|
|
9
9
|
*/
|
|
10
10
|
import type { Abortable } from 'node:events';
|
|
11
11
|
import type { WatchOptions } from '../config/index.js';
|
|
12
|
+
export type ExistenceOnlyTimeEntry = Record<string, never>;
|
|
13
|
+
export type TimeInfoEntries = Map<string, FileSystemInfoEntry | ExistenceOnlyTimeEntry | 'ignore' | null>;
|
|
12
14
|
export interface Watcher {
|
|
13
15
|
close(): void;
|
|
14
16
|
pause(): void;
|
|
15
17
|
getAggregatedChanges?(): Set<string>;
|
|
16
18
|
getAggregatedRemovals?(): Set<string>;
|
|
17
|
-
getFileTimeInfoEntries?():
|
|
18
|
-
getContextTimeInfoEntries?():
|
|
19
|
+
getFileTimeInfoEntries?(): TimeInfoEntries;
|
|
20
|
+
getContextTimeInfoEntries?(): TimeInfoEntries;
|
|
19
21
|
getInfo(): WatcherInfo;
|
|
20
22
|
}
|
|
21
23
|
export interface WatcherInfo {
|
|
22
24
|
changes: Set<string>;
|
|
23
25
|
removals: Set<string>;
|
|
24
|
-
fileTimeInfoEntries:
|
|
25
|
-
contextTimeInfoEntries:
|
|
26
|
+
fileTimeInfoEntries: TimeInfoEntries;
|
|
27
|
+
contextTimeInfoEntries: TimeInfoEntries;
|
|
26
28
|
}
|
|
27
29
|
export type IStatsBase<T> = {
|
|
28
30
|
isFile: () => boolean;
|
|
@@ -144,15 +146,15 @@ export type ReadFile = {
|
|
|
144
146
|
(path: PathOrFileDescriptor, callback: BufferCallback): void;
|
|
145
147
|
};
|
|
146
148
|
export type ReadFileSync = {
|
|
147
|
-
(path: PathOrFileDescriptor, options
|
|
148
|
-
encoding
|
|
149
|
+
(path: PathOrFileDescriptor, options?: {
|
|
150
|
+
encoding?: null | undefined;
|
|
149
151
|
flag?: string;
|
|
150
152
|
} | null): Buffer;
|
|
151
153
|
(path: PathOrFileDescriptor, options: {
|
|
152
154
|
encoding: BufferEncoding;
|
|
153
155
|
flag?: string;
|
|
154
156
|
} | BufferEncoding): string;
|
|
155
|
-
(path: PathOrFileDescriptor, options
|
|
157
|
+
(path: PathOrFileDescriptor, options?: (ObjectEncodingOptions & {
|
|
156
158
|
flag?: string;
|
|
157
159
|
}) | BufferEncoding | null): string | Buffer;
|
|
158
160
|
};
|
|
@@ -174,9 +176,9 @@ export type Readlink = {
|
|
|
174
176
|
(path: PathLike, callback: StringCallback): void;
|
|
175
177
|
};
|
|
176
178
|
export type ReadlinkSync = {
|
|
177
|
-
(path: PathLike, options
|
|
179
|
+
(path: PathLike, options?: EncodingOption): string;
|
|
178
180
|
(path: PathLike, options: BufferEncodingOption): Buffer;
|
|
179
|
-
(path: PathLike, options
|
|
181
|
+
(path: PathLike, options?: EncodingOption): string | Buffer;
|
|
180
182
|
};
|
|
181
183
|
export type Readdir = {
|
|
182
184
|
(path: PathLike, options: {
|
|
@@ -191,7 +193,7 @@ export type Readdir = {
|
|
|
191
193
|
} | 'buffer', callback: ReaddirBufferCallback): void;
|
|
192
194
|
(path: PathLike, callback: ReaddirStringCallback): void;
|
|
193
195
|
(path: PathLike, options: (ObjectEncodingOptions & {
|
|
194
|
-
withFileTypes
|
|
196
|
+
withFileTypes?: false;
|
|
195
197
|
recursive?: boolean;
|
|
196
198
|
}) | BufferEncoding | null | undefined, callback: ReaddirStringOrBufferCallback): void;
|
|
197
199
|
(path: PathLike, options: ObjectEncodingOptions & {
|
|
@@ -200,7 +202,7 @@ export type Readdir = {
|
|
|
200
202
|
}, callback: ReaddirDirentCallback): void;
|
|
201
203
|
};
|
|
202
204
|
export type ReaddirSync = {
|
|
203
|
-
(path: PathLike, options
|
|
205
|
+
(path: PathLike, options?: {
|
|
204
206
|
encoding: BufferEncoding | null;
|
|
205
207
|
withFileTypes?: false;
|
|
206
208
|
recursive?: boolean;
|
|
@@ -210,7 +212,7 @@ export type ReaddirSync = {
|
|
|
210
212
|
withFileTypes?: false;
|
|
211
213
|
recursive?: boolean;
|
|
212
214
|
} | 'buffer'): Buffer[];
|
|
213
|
-
(path: PathLike, options
|
|
215
|
+
(path: PathLike, options?: (ObjectEncodingOptions & {
|
|
214
216
|
withFileTypes?: false;
|
|
215
217
|
recursive?: boolean;
|
|
216
218
|
}) | BufferEncoding | null): string[] | Buffer[];
|
|
@@ -333,7 +335,7 @@ export type Read<TBuffer extends ArrayBufferView = Buffer> = (fd: number, option
|
|
|
333
335
|
export type WriteAsyncOptions<TBuffer extends ArrayBufferView = Buffer> = {
|
|
334
336
|
offset?: number;
|
|
335
337
|
length?: number;
|
|
336
|
-
position?: null | number
|
|
338
|
+
position?: null | number;
|
|
337
339
|
buffer?: TBuffer;
|
|
338
340
|
};
|
|
339
341
|
export type Write<TBuffer extends ArrayBufferView = Buffer> = (fd: number, content: Buffer, options: WriteAsyncOptions<TBuffer>, callback: (err: null | NodeJS.ErrnoException, bytesWrite: number, buffer: TBuffer) => void) => void;
|
|
@@ -351,6 +353,7 @@ export declare const mkdirp: (fs: OutputFileSystem, p: string, callback: (error?
|
|
|
351
353
|
export interface FileSystemInfoEntry {
|
|
352
354
|
safeTime: number;
|
|
353
355
|
timestamp?: number;
|
|
356
|
+
accuracy?: number;
|
|
354
357
|
}
|
|
355
358
|
export interface WatchFileSystem {
|
|
356
359
|
watch(files: Iterable<string> & {
|
|
@@ -362,11 +365,14 @@ export interface WatchFileSystem {
|
|
|
362
365
|
}, missing: Iterable<string> & {
|
|
363
366
|
added?: Iterable<String>;
|
|
364
367
|
removed?: Iterable<String>;
|
|
365
|
-
}, startTime: number, options: WatchOptions, callback: (error: Error | null, fileTimeInfoEntries:
|
|
366
|
-
|
|
368
|
+
}, startTime: number, options: WatchOptions, callback: (error: Error | null, fileTimeInfoEntries: TimeInfoEntries, contextTimeInfoEntries: TimeInfoEntries, changedFiles: Set<string>, removedFiles: Set<string>) => void, callbackUndelayed: (fileName: string, changeTime: number) => void): Watcher;
|
|
369
|
+
getTimes?(): Record<string, number | null>;
|
|
370
|
+
getTimeInfoEntries?(): TimeInfoEntries;
|
|
371
|
+
collectTimeInfoEntries?(fileTimestamps: TimeInfoEntries, directoryTimestamps: TimeInfoEntries): void;
|
|
372
|
+
on?(event: 'change', listener: (filename: string, mtime: number | null) => void): this;
|
|
367
373
|
on?(event: 'remove', listener: (filename: string) => void): this;
|
|
368
374
|
on?(event: 'aggregated', listener: (changes: Set<string>, removals: Set<string>) => void): this;
|
|
369
|
-
once?(event: 'change', listener: (filename: string, mtime: number) => void): this;
|
|
375
|
+
once?(event: 'change', listener: (filename: string, mtime: number | null) => void): this;
|
|
370
376
|
once?(event: 'remove', listener: (filename: string) => void): this;
|
|
371
377
|
once?(event: 'aggregated', listener: (changes: Set<string>, removals: Set<string>) => void): this;
|
|
372
378
|
emit?(event: 'change', filename: string, mtime: number): boolean;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const resolveLayerExternals: <T>(item: T, layer: string | null) => T;
|
package/dist/util/source.d.ts
CHANGED
|
@@ -1,6 +1,15 @@
|
|
|
1
|
-
import type { JsSource } from '@
|
|
2
|
-
import
|
|
1
|
+
import type { JsNativeSource, JsSource, JsSourceFromJs, JsSourceWithLazyMap } from '@rspack/binding';
|
|
2
|
+
import * as webpackSources from '../../compiled/webpack-sources/index.js';
|
|
3
|
+
import { type Source } from '../../compiled/webpack-sources/index.js';
|
|
4
|
+
declare const toBindingSource: unique symbol;
|
|
5
|
+
export declare class RspackConcatSource extends webpackSources.ConcatSource {
|
|
6
|
+
[toBindingSource](): JsSourceFromJs | null;
|
|
7
|
+
}
|
|
8
|
+
export declare class RspackReplaceSource extends webpackSources.ReplaceSource {
|
|
9
|
+
[toBindingSource](): JsSourceFromJs | null;
|
|
10
|
+
}
|
|
3
11
|
export declare class SourceAdapter {
|
|
4
|
-
static fromBinding(
|
|
5
|
-
static toBinding(source: Source):
|
|
12
|
+
static fromBinding(cache: JsSource | JsSourceWithLazyMap, nativeSource?: JsNativeSource | null): Source;
|
|
13
|
+
static toBinding(source: Source): JsSourceFromJs;
|
|
6
14
|
}
|
|
15
|
+
export {};
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
export declare const MODULE_BUILD_INFO_SYMBOL: unique symbol;
|
|
2
|
+
export declare const COMPILATION_HOOKS_MAP_SYMBOL: unique symbol;
|
|
3
|
+
export declare const BUILD_INFO_ASSETS_SYMBOL: unique symbol;
|
|
4
|
+
export declare const BUILD_INFO_FILE_DEPENDENCIES_SYMBOL: unique symbol;
|
|
5
|
+
export declare const BUILD_INFO_CONTEXT_DEPENDENCIES_SYMBOL: unique symbol;
|
|
6
|
+
export declare const BUILD_INFO_MISSING_DEPENDENCIES_SYMBOL: unique symbol;
|
|
7
|
+
export declare const BUILD_INFO_BUILD_DEPENDENCIES_SYMBOL: unique symbol;
|
|
8
|
+
export declare const COMMIT_CUSTOM_FIELDS_SYMBOL: unique symbol;
|
|
9
|
+
export declare const CIRCULAR_CONNECTION_SYMBOL: unique symbol;
|
|
10
|
+
export declare const TRANSITIVE_ONLY_SYMBOL: unique symbol;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { Watcher, WatchFileSystem, WatcherInfo } from './fs.js';
|
|
2
|
+
type WatchCallback = Parameters<WatchFileSystem['watch']>[5];
|
|
3
|
+
type WatchCallbackArgs = Parameters<WatchCallback>;
|
|
4
|
+
type OptionalTimeInfoWatchCallback = (error: WatchCallbackArgs[0], fileTimeInfoEntries: WatchCallbackArgs[1] | undefined, contextTimeInfoEntries: WatchCallbackArgs[2] | undefined, changedFiles: WatchCallbackArgs[3], removedFiles: WatchCallbackArgs[4]) => void;
|
|
5
|
+
export declare function markInternalCallback(callback: OptionalTimeInfoWatchCallback): OptionalTimeInfoWatchCallback;
|
|
6
|
+
export declare const consumeWatcherInfo: unique symbol;
|
|
7
|
+
export type ConsumableWatcher = Watcher & {
|
|
8
|
+
[consumeWatcherInfo]?: () => WatcherInfo;
|
|
9
|
+
};
|
|
10
|
+
export declare function isInternalCallback(callback: WatchCallback): callback is OptionalTimeInfoWatchCallback;
|
|
11
|
+
export {};
|