Skip to content

Commit 15b1a19

Browse files
committed
chore: update
1 parent 79b921f commit 15b1a19

File tree

13 files changed

+249
-57
lines changed

13 files changed

+249
-57
lines changed

Cargo.lock

Lines changed: 1 addition & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

crates/node_binding/binding.d.ts

Lines changed: 4 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -1105,17 +1105,6 @@ export interface JsTap {
11051105
stage: number
11061106
}
11071107

1108-
export interface NodeFsStats {
1109-
isFile: boolean
1110-
isDirectory: boolean
1111-
isSymlink: boolean
1112-
atimeMs: number
1113-
mtimeMs: number
1114-
ctimeMs: number
1115-
birthtimeMs: number
1116-
size: number
1117-
}
1118-
11191108
export interface PathWithInfo {
11201109
path: string
11211110
info: JsAssetInfo
@@ -1142,6 +1131,8 @@ export interface RawAssetGeneratorOptions {
11421131
outputPath?: JsFilename
11431132
publicPath?: "auto" | JsFilename
11441133
dataUrl?: RawAssetGeneratorDataUrlOptions | ((source: Buffer, context: RawAssetGeneratorDataUrlFnCtx) => string)
1134+
experimentalLibReExport?: boolean
1135+
experimentalLibPreserveImport?: boolean
11451136
}
11461137

11471138
export interface RawAssetInlineGeneratorOptions {
@@ -1166,6 +1157,8 @@ export interface RawAssetResourceGeneratorOptions {
11661157
filename?: JsFilename
11671158
outputPath?: JsFilename
11681159
publicPath?: "auto" | JsFilename
1160+
experimentalLibPreserveImport?: boolean
1161+
experimentalLibReExport?: boolean
11691162
}
11701163

11711164
export interface RawBannerPluginOptions {
@@ -2139,23 +2132,3 @@ export interface RegisterJsTaps {
21392132
registerHtmlPluginBeforeEmitTaps: (stages: Array<number>) => Array<{ function: ((arg: JsBeforeEmitData) => JsBeforeEmitData); stage: number; }>
21402133
registerHtmlPluginAfterEmitTaps: (stages: Array<number>) => Array<{ function: ((arg: JsAfterEmitData) => JsAfterEmitData); stage: number; }>
21412134
}
2142-
2143-
export interface ThreadsafeNodeFS {
2144-
writeFile: (name: string, content: Buffer) => Promise<void>
2145-
removeFile: (name: string) => Promise<void>
2146-
mkdir: (name: string) => Promise<void>
2147-
mkdirp: (name: string) => Promise<string | void>
2148-
removeDirAll: (name: string) => Promise<string | void>
2149-
readDir: (name: string) => Promise<string[] | void>
2150-
readFile: (name: string) => Promise<Buffer | string | void>
2151-
stat: (name: string) => Promise<NodeFsStats | void>
2152-
lstat: (name: string) => Promise<NodeFsStats | void>
2153-
open: (name: string, flags: string) => Promise<number | void>
2154-
rename: (from: string, to: string) => Promise<void>
2155-
close: (fd: number) => Promise<void>
2156-
write: (fd: number, content: Buffer, position: number) => Promise<number | void>
2157-
writeAll: (fd: number, content: Buffer) => Promise<number | void>
2158-
read: (fd: number, length: number, position: number) => Promise<Buffer | void>
2159-
readUntil: (fd: number, code: number, position: number) => Promise<Buffer | void>
2160-
readToEnd: (fd: number, position: number) => Promise<Buffer | void>
2161-
}

crates/rspack_binding_values/src/raw_options/raw_module/mod.rs

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -541,6 +541,9 @@ pub struct RawAssetGeneratorOptions {
541541
ts_type = "RawAssetGeneratorDataUrlOptions | ((source: Buffer, context: RawAssetGeneratorDataUrlFnCtx) => string)"
542542
)]
543543
pub data_url: Option<RawAssetGeneratorDataUrl>,
544+
545+
pub experimental_lib_re_export: Option<bool>,
546+
pub experimental_lib_preserve_import: Option<bool>,
544547
}
545548

546549
impl From<RawAssetGeneratorOptions> for AssetGeneratorOptions {
@@ -553,6 +556,8 @@ impl From<RawAssetGeneratorOptions> for AssetGeneratorOptions {
553556
data_url: value
554557
.data_url
555558
.map(|i| RawAssetGeneratorDataUrlWrapper(i).into()),
559+
experimental_lib_re_export: value.experimental_lib_re_export,
560+
experimental_lib_preserve_import: value.experimental_lib_preserve_import,
556561
}
557562
}
558563
}
@@ -585,6 +590,9 @@ pub struct RawAssetResourceGeneratorOptions {
585590
pub output_path: Option<JsFilename>,
586591
#[napi(ts_type = "\"auto\" | JsFilename")]
587592
pub public_path: Option<JsFilename>,
593+
594+
pub experimental_lib_preserve_import: Option<bool>,
595+
pub experimental_lib_re_export: Option<bool>,
588596
}
589597

590598
impl From<RawAssetResourceGeneratorOptions> for AssetResourceGeneratorOptions {
@@ -594,6 +602,8 @@ impl From<RawAssetResourceGeneratorOptions> for AssetResourceGeneratorOptions {
594602
filename: value.filename.map(|i| i.into()),
595603
output_path: value.output_path.map(|i| i.into()),
596604
public_path: value.public_path.map(|i| i.into()),
605+
experimental_lib_preserve_import: value.experimental_lib_preserve_import,
606+
experimental_lib_re_export: value.experimental_lib_re_export,
597607
}
598608
}
599609
}

crates/rspack_core/src/concatenated_module.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -639,6 +639,7 @@ impl Module for ConcatenatedModule {
639639
};
640640
let runtime = runtime.as_deref();
641641
let context = compilation.options.context.clone();
642+
dbg!(&context);
642643

643644
let (modules_with_info, module_to_info_map) =
644645
self.get_modules_with_info(&compilation.get_module_graph(), runtime);
@@ -955,6 +956,7 @@ impl Module for ConcatenatedModule {
955956
continue;
956957
}
957958
let used_name = export_info.get_used_name(&module_graph, None, runtime);
959+
dbg!(&used_name);
958960

959961
let Some(used_name) = used_name else {
960962
unused_exports.insert(name);

crates/rspack_core/src/options/module.rs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -455,6 +455,8 @@ pub struct AssetResourceGeneratorOptions {
455455
pub filename: Option<Filename>,
456456
pub output_path: Option<Filename>,
457457
pub public_path: Option<PublicPath>,
458+
pub experimental_lib_re_export: Option<bool>,
459+
pub experimental_lib_preserve_import: Option<bool>,
458460
}
459461

460462
#[cacheable]
@@ -465,6 +467,8 @@ pub struct AssetGeneratorOptions {
465467
pub output_path: Option<Filename>,
466468
pub public_path: Option<PublicPath>,
467469
pub data_url: Option<AssetGeneratorDataUrl>,
470+
pub experimental_lib_re_export: Option<bool>,
471+
pub experimental_lib_preserve_import: Option<bool>,
468472
}
469473

470474
pub struct AssetGeneratorDataUrlFnCtx<'a> {

crates/rspack_plugin_asset/Cargo.toml

Lines changed: 13 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -8,19 +8,20 @@ version = "0.2.0"
88
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
99

1010
[dependencies]
11-
async-trait = { workspace = true }
12-
mime_guess = { workspace = true }
13-
rayon = { workspace = true }
14-
rspack_base64 = { workspace = true }
11+
async-trait = { workspace = true }
12+
cow-utils = { workspace = true }
13+
mime_guess = { workspace = true }
14+
rayon = { workspace = true }
15+
rspack_base64 = { workspace = true }
1516
rspack_cacheable = { workspace = true }
16-
rspack_core = { workspace = true }
17-
rspack_error = { workspace = true }
18-
rspack_hash = { workspace = true }
19-
rspack_hook = { workspace = true }
20-
rspack_util = { workspace = true }
21-
serde_json = { workspace = true }
22-
tracing = { workspace = true }
23-
urlencoding = { workspace = true }
17+
rspack_core = { workspace = true }
18+
rspack_error = { workspace = true }
19+
rspack_hash = { workspace = true }
20+
rspack_hook = { workspace = true }
21+
rspack_util = { workspace = true }
22+
serde_json = { workspace = true }
23+
tracing = { workspace = true }
24+
urlencoding = { workspace = true }
2425

2526
[package.metadata.cargo-shear]
2627
ignored = ["tracing"]

0 commit comments

Comments
 (0)