Skip to content

Commit

Permalink
patch: add test files
Browse files Browse the repository at this point in the history
Signed-off-by: cl <cailue@apache.org>
  • Loading branch information
ClSlaid committed Nov 23, 2024
1 parent 6ac7cf0 commit 69103e2
Show file tree
Hide file tree
Showing 23 changed files with 186 additions and 2,346 deletions.
13 changes: 12 additions & 1 deletion crates/node_binding/binding.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -518,6 +518,17 @@ export interface JsChunkGroupOrigin {
request?: string
}

/**
* File clean filter object
*
* This clean filter matches with:
* - keep:
* - If a string, keep the files under this path
*/
export interface JsCleanFilter {
keep?: string
}

export interface JsCodegenerationResult {
sources: Record<string, string>
}
Expand Down Expand Up @@ -1729,7 +1740,7 @@ export interface RawOptions {
export interface RawOutputOptions {
path: string
pathinfo: boolean | "verbose"
clean: boolean
clean: JsCleanOptions
publicPath: "auto" | JsFilename
assetModuleFilename: JsFilename
wasmLoading: string
Expand Down
4 changes: 3 additions & 1 deletion crates/rspack_binding_values/src/clean_options.rs
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,9 @@ impl FromNapiValue for JsCleanOptions {
env: napi::sys::napi_env,
napi_val: napi::sys::napi_value,
) -> napi::Result<Self> {
Ok(Self(Either::from_napi_value(env, napi_val)?))
let val = Either::from_napi_value(env, napi_val);
std::fs::write("/tmp/rspack.log", format!("{:?}", val).as_bytes()).unwrap();
Ok(Self(val?))
}
}

Expand Down
5 changes: 1 addition & 4 deletions crates/rspack_core/src/options/output.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,7 @@ use rspack_paths::{AssertUtf8, Utf8Path, Utf8PathBuf};
use sugar_path::SugarPath;

use super::CleanOptions;
use crate::{
Chunk, ChunkGraph, ChunkGroupByUkey, ChunkKind, Compilation, Filename, FilenameTemplate, Module,
RuntimeSpec, SourceType,
};
use crate::{Chunk, ChunkGroupByUkey, ChunkKind, Compilation, Filename, FilenameTemplate};

#[derive(Debug)]
pub enum PathInfo {
Expand Down
1 change: 1 addition & 0 deletions packages/rspack-test-tools/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@
"@babel/template": "7.22.15",
"@babel/traverse": "7.23.2",
"@babel/types": "7.23.0",
"cross-env": "^7.0.3",
"csv-to-markdown-table": "^1.3.0",
"deepmerge": "^4.3.1",
"filenamify": "4.3.0",
Expand Down
773 changes: 0 additions & 773 deletions packages/rspack-test-tools/tests/__snapshots__/Config.test.js.snap

This file was deleted.

Loading

0 comments on commit 69103e2

Please sign in to comment.