Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
SyMind committed Dec 12, 2024
1 parent ff9c023 commit 6f39872
Show file tree
Hide file tree
Showing 3 changed files with 52 additions and 45 deletions.
1 change: 1 addition & 0 deletions crates/node_binding/binding.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,7 @@ export declare class JsChunkGraph {
getChunkEntryDependentChunksIterable(chunk: JsChunk): JsChunk[]
getChunkModulesIterableBySourceType(chunk: JsChunk, sourceType: string): JsModule[]
getModuleChunks(module: JsModule): JsChunk[]
getModuleId(jsModule: JsModule): string | null
}

export declare class JsChunkGroup {
Expand Down
92 changes: 47 additions & 45 deletions packages/rspack/etc/core.api.md
Original file line number Diff line number Diff line change
Expand Up @@ -280,27 +280,27 @@ interface BaseModuleConfig {

// @public (undocumented)
interface BaseResolveRequest {
// (undocumented)
// (undocumented)
__innerRequest?: string;
// (undocumented)
// (undocumented)
__innerRequest_relativePath?: string;
// (undocumented)
// (undocumented)
__innerRequest_request?: string;
// (undocumented)
// (undocumented)
context?: object;
// (undocumented)
// (undocumented)
descriptionFileData?: JsonObject;
// (undocumented)
// (undocumented)
descriptionFilePath?: string;
// (undocumented)
// (undocumented)
descriptionFileRoot?: string;
// (undocumented)
// (undocumented)
fullySpecified?: boolean;
// (undocumented)
// (undocumented)
ignoreSymlinks?: boolean;
// (undocumented)
// (undocumented)
path: string | false;
// (undocumented)
// (undocumented)
relativePath?: string;
}

Expand Down Expand Up @@ -491,6 +491,8 @@ class ChunkGraph {
getModuleChunks(module: Module): Chunk[];
// (undocumented)
getModuleChunksIterable(module: Module): Iterable<Chunk>;
// (undocumented)
getModuleId(module: Module): string | null;
}

// @public (undocumented)
Expand Down Expand Up @@ -2181,11 +2183,11 @@ type GroupOptions = {

// @public (undocumented)
class Hash {
constructor();
constructor();

digest(encoding?: string): string | Buffer;
digest(encoding?: string): string | Buffer;

update(data: string | Buffer, inputEncoding?: string): Hash;
update(data: string | Buffer, inputEncoding?: string): Hash;
}

// @public (undocumented)
Expand Down Expand Up @@ -2678,14 +2680,14 @@ type JsonArray = JsonValue_2[];

// @public (undocumented)
type JsonObject = { [index: string]: JsonValue } & {
[index: string]:
| undefined
| null
| string
| number
| boolean
| JsonObject
| JsonValue[];
[index: string]:
| undefined
| null
| string
| number
| boolean
| JsonObject
| JsonValue[];
};

// @public (undocumented)
Expand Down Expand Up @@ -4343,19 +4345,19 @@ interface ParseContext {

// @public (undocumented)
interface ParsedIdentifier {
// (undocumented)
// (undocumented)
directory: boolean;
// (undocumented)
// (undocumented)
file: boolean;
// (undocumented)
// (undocumented)
fragment: string;
// (undocumented)
// (undocumented)
internal: boolean;
// (undocumented)
// (undocumented)
module: boolean;
// (undocumented)
// (undocumented)
query: string;
// (undocumented)
// (undocumented)
request: string;
}

Expand Down Expand Up @@ -4625,13 +4627,13 @@ type RawCreateParams = {

// @public (undocumented)
type RawSourceMap = {
version: number;
sources: string[];
names: string[];
sourceRoot?: string;
sourcesContent?: string[];
mappings: string;
file: string;
version: number;
sources: string[];
names: string[];
sourceRoot?: string;
sourcesContent?: string[];
mappings: string;
file: string;
};

// @public (undocumented)
Expand Down Expand Up @@ -9866,25 +9868,25 @@ export type SnapshotOptions = {};

// @public (undocumented)
abstract class Source {
// (undocumented)
// (undocumented)
buffer(): Buffer;

// (undocumented)
// (undocumented)
map(options?: MapOptions): RawSourceMap | null;

// (undocumented)
// (undocumented)
size(): number;

// (undocumented)
// (undocumented)
source(): string | Buffer;

// (undocumented)
// (undocumented)
sourceAndMap(options?: MapOptions): {
source: string | Buffer;
map: Object;
};
source: string | Buffer;
map: Object;
};

// (undocumented)
// (undocumented)
updateHash(hash: Hash): void;
}

Expand Down
4 changes: 4 additions & 0 deletions packages/rspack/src/ChunkGraph.ts
Original file line number Diff line number Diff line change
Expand Up @@ -61,4 +61,8 @@ export class ChunkGraph {
.getModuleChunks(Module.__to_binding(module))
.map(binding => Chunk.__from_binding(binding));
}

getModuleId(module: Module): string | null {
return this.#inner.getModuleId(Module.__to_binding(module));
}
}

0 comments on commit 6f39872

Please sign in to comment.