Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
34 changes: 0 additions & 34 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 0 additions & 4 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,6 @@ members = [
"crates/perry-ext-uuid",
"crates/perry-ext-bcrypt",
"crates/perry-ext-argon2",
"crates/perry-ext-validator",
"crates/perry-validation",
"crates/perry-perex",
"crates/perry-ext-lru-cache",
"crates/perry-ext-better-sqlite3",
Expand Down Expand Up @@ -481,8 +479,6 @@ perry-ext-nanoid = { path = "crates/perry-ext-nanoid" }
perry-ext-uuid = { path = "crates/perry-ext-uuid" }
perry-ext-bcrypt = { path = "crates/perry-ext-bcrypt" }
perry-ext-argon2 = { path = "crates/perry-ext-argon2" }
perry-ext-validator = { path = "crates/perry-ext-validator" }
perry-validation = { path = "crates/perry-validation" }
perry-perex = { path = "crates/perry-perex" }
perry-ext-lru-cache = { path = "crates/perry-ext-lru-cache" }
perry-ext-better-sqlite3 = { path = "crates/perry-ext-better-sqlite3" }
Expand Down
17 changes: 17 additions & 0 deletions changelog.d/10690-validator-native-binding-removal.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
Removed the native `validator` binding: 9+ methods threw "not implemented"
(`trim`/`contains`/`equals`/`isAlpha`/`escape`/`isMobilePhone`/etc.), `trim()`
silently returned `undefined`, and the 5 implemented checks
(`isEmail`/`isURL`/`isUUID`/`isJSON`/`isEmpty`) returned `0`/`1` instead of
real booleans. `import validator from "validator"` (no
`perry.compilePackages` entry) now compiles the real npm package from
source, matching Node for all 50 checks.

Deleted both duplicate hand-written implementations
(`crates/perry-ext-validator` and `crates/perry-stdlib/src/validator.rs`,
which independently exported the same `js_validator_*` symbols — #10678)
plus `crates/perry-validation`, a shared grammar-helper crate consumed only
by the two duplicates. Also fixed a standalone-workspace release fixture
(`tests/release/packages/next-app-route/provider/stdlib/Cargo.toml`) that
referenced the now-deleted `validation` feature — it has its own
`Cargo.lock` and isn't a member of the main workspace, so `cargo check
--workspace` never covers it.
1 change: 0 additions & 1 deletion crates/perry-api-manifest/src/entries.rs
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,6 @@ pub const NATIVE_MODULES: &[&str] = &[
"dotenv", // .env file loader
"dotenv/config", // dotenv's auto-load-on-import subpath
"nanoid", // compact URL-safe ID generation
"validator", // string validators/sanitizers
"ethers", // Ethereum library (utils/wallet/ABI)
"mongodb", // MongoDB driver
"better-sqlite3", // synchronous SQLite (replaces the N-API addon)
Expand Down
60 changes: 0 additions & 60 deletions crates/perry-api-manifest/src/entries/part_1.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1210,66 +1210,6 @@ pub(crate) const API_MANIFEST_PART_1: &[ApiEntry] = &[
}],
TypeSpec::String,
),
method_sig(
"validator",
"isEmail",
false,
None,
&[ParamSpec::Named {
name: "s",
ty: TypeSpec::String,
optional: false,
}],
TypeSpec::Bool,
),
method_sig(
"validator",
"isURL",
false,
None,
&[ParamSpec::Named {
name: "s",
ty: TypeSpec::String,
optional: false,
}],
TypeSpec::Bool,
),
method_sig(
"validator",
"isUUID",
false,
None,
&[ParamSpec::Named {
name: "s",
ty: TypeSpec::String,
optional: false,
}],
TypeSpec::Bool,
),
method_sig(
"validator",
"isJSON",
false,
None,
&[ParamSpec::Named {
name: "s",
ty: TypeSpec::String,
optional: false,
}],
TypeSpec::Bool,
),
method_sig(
"validator",
"isEmpty",
false,
None,
&[ParamSpec::Named {
name: "s",
ty: TypeSpec::String,
optional: false,
}],
TypeSpec::Bool,
),
// #4917 — real retry semantics: options (numOfAttempts/startingDelay/
// timeMultiple/maxDelay/delayFirstAttempt/jitter/retry) honored;
// Promise-returning tasks retry on rejection via promise reactions.
Expand Down
46 changes: 0 additions & 46 deletions crates/perry-codegen/src/lower_call/native_table/utils_crypto.rs
Original file line number Diff line number Diff line change
Expand Up @@ -139,52 +139,6 @@ pub(super) const UTILS_CRYPTO_ROWS: &[NativeModSig] = &[
args: &[NA_F64],
ret: NR_STR,
},
// ========== validator ==========
NativeModSig {
module: "validator",
has_receiver: false,
method: "isEmail",
class_filter: None,
runtime: "js_validator_is_email",
args: &[NA_STR],
ret: NR_F64,
},
NativeModSig {
module: "validator",
has_receiver: false,
method: "isURL",
class_filter: None,
runtime: "js_validator_is_url",
args: &[NA_STR],
ret: NR_F64,
},
NativeModSig {
module: "validator",
has_receiver: false,
method: "isUUID",
class_filter: None,
runtime: "js_validator_is_uuid",
args: &[NA_STR],
ret: NR_F64,
},
NativeModSig {
module: "validator",
has_receiver: false,
method: "isJSON",
class_filter: None,
runtime: "js_validator_is_json",
args: &[NA_STR],
ret: NR_F64,
},
NativeModSig {
module: "validator",
has_receiver: false,
method: "isEmpty",
class_filter: None,
runtime: "js_validator_is_empty",
args: &[NA_STR],
ret: NR_F64,
},
// ========== exponential-backoff ==========
NativeModSig {
module: "exponential-backoff",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -293,22 +293,4 @@ pub(crate) fn declare_streams_events(module: &mut LlModule) {
module.declare_function("js_ratelimit_new_from_options", I64, &[I64]);
module.declare_function("js_ratelimit_penalty", I64, &[I64, I64, DOUBLE]);
module.declare_function("js_ratelimit_reward", I64, &[I64, I64, DOUBLE]);

// ========== Validator ==========
module.declare_function("js_validator_contains", DOUBLE, &[I64, I64]);
module.declare_function("js_validator_equals", DOUBLE, &[I64, I64]);
module.declare_function("js_validator_is_alpha", DOUBLE, &[I64]);
module.declare_function("js_validator_is_alphanumeric", DOUBLE, &[I64]);
module.declare_function("js_validator_is_email", DOUBLE, &[I64]);
module.declare_function("js_validator_is_empty", DOUBLE, &[I64]);
module.declare_function("js_validator_is_float", DOUBLE, &[I64]);
module.declare_function("js_validator_is_hexadecimal", DOUBLE, &[I64]);
module.declare_function("js_validator_is_int", DOUBLE, &[I64]);
module.declare_function("js_validator_is_json", DOUBLE, &[I64]);
module.declare_function("js_validator_is_length", DOUBLE, &[I64, DOUBLE, DOUBLE]);
module.declare_function("js_validator_is_lowercase", DOUBLE, &[I64]);
module.declare_function("js_validator_is_numeric", DOUBLE, &[I64]);
module.declare_function("js_validator_is_uppercase", DOUBLE, &[I64]);
module.declare_function("js_validator_is_url", DOUBLE, &[I64]);
module.declare_function("js_validator_is_uuid", DOUBLE, &[I64]);
}
20 changes: 0 additions & 20 deletions crates/perry-ext-validator/Cargo.toml

This file was deleted.

Loading
Loading