@sinkaroid/rust-shapeshift 1.0.4 → 1.0.5

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/package.json CHANGED
@@ -26,11 +26,11 @@
26
26
  "license": "MIT",
27
27
  "name": "@sinkaroid/rust-shapeshift",
28
28
  "optionalDependencies": {
29
- "@sinkaroid/rust-shapeshift-darwin-arm64": "1.0.4",
30
- "@sinkaroid/rust-shapeshift-darwin-x64": "1.0.4",
31
- "@sinkaroid/rust-shapeshift-linux-arm64": "1.0.4",
32
- "@sinkaroid/rust-shapeshift-linux-x64": "1.0.4",
33
- "@sinkaroid/rust-shapeshift-win32-x64": "1.0.4"
29
+ "@sinkaroid/rust-shapeshift-darwin-arm64": "1.0.5",
30
+ "@sinkaroid/rust-shapeshift-darwin-x64": "1.0.5",
31
+ "@sinkaroid/rust-shapeshift-linux-arm64": "1.0.5",
32
+ "@sinkaroid/rust-shapeshift-linux-x64": "1.0.5",
33
+ "@sinkaroid/rust-shapeshift-win32-x64": "1.0.5"
34
34
  },
35
35
  "publishConfig": {
36
36
  "access": "public"
@@ -43,5 +43,5 @@
43
43
  "build": "cargo build --release",
44
44
  "test": "node bin/rust-shapeshift.js --help"
45
45
  },
46
- "version": "1.0.4"
46
+ "version": "1.0.5"
47
47
  }
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  name: rust-shapeshift
3
3
  author: "@sinkaroid"
4
- version: "1.0.4"
4
+ version: "1.0.5"
5
5
  repository: "https://github.com/sinkaroid"
6
6
  description: Master modern Rust (1.80+ / 2024 Edition) specialized in extreme memory and runtime efficiency. Expert in transforming backend services from any runtime into lean, production-grade Rust with Axum 0.8 as canonical reference architecture while remaining fully stack-adaptable (Actix Web, Salvo, Loco, std::net). Eliminates hundreds of MBs of RSS bloat via framework selection, allocator tuning, DOM pruning, zero-copy parsing, and bounded concurrency. Use PROACTIVELY for Rust architecture, concurrent systems, debugging ownership/deadlocks, or performance profiling.
7
7
  metadata:
@@ -2,7 +2,7 @@
2
2
 
3
3
  Achieving production efficiency requires minimizing **both runtime memory consumption (RSS) and physical Docker image size**. A bloated Docker image wastes registry bandwidth, slows CI/CD deployments, expands vulnerability attack surfaces, and invalidates build caches needlessly.
4
4
 
5
- This playbook documents the exact multi-stage container recipe and `.dockerignore` discipline used in **Jandapress** and **Lustpress** to achieve **sub-80MB Debian runtime images** and instant build context transfers.
5
+ This playbook documents the exact multi-stage container recipe and `.dockerignore` discipline used in high-throughput production services to achieve **sub-80MB Debian runtime images** and instant build context transfers.
6
6
 
7
7
  ---
8
8
 
@@ -86,7 +86,7 @@ static SEL_VIEWS: LazyLock<Selector> =
86
86
 
87
87
  ## 3. Pattern C: Zero-Allocation Byte Slice Parsing for JSON APIs
88
88
 
89
- When scraping providers that offer undocumented or internal JSON endpoints (such as Eporner or Txxx in `lustpress`), **never** allocate an intermediate `String` from the network response.
89
+ When scraping upstream providers that offer undocumented or internal JSON endpoints, **never** allocate an intermediate `String` from the network response.
90
90
 
91
91
  Deserialize directly from `&[u8]` using `serde_json::from_slice`:
92
92
 
@@ -6,7 +6,7 @@ In dynamic languages (JavaScript / Python), developers habitually call regex rep
6
6
 
7
7
  ## 1. Zero-Regex Whitespace Squeezing (Single-Pass Iterator)
8
8
 
9
- In `jandapress/src/scraper/pururin.rs`, collapsing newlines and multiple spaces into a single space is executed on every parsed tag.
9
+ In high-volume HTML scraping, collapsing newlines and multiple spaces into a single space is executed on every parsed tag.
10
10
 
11
11
  Instead of running a regex engine, this single-pass character iterator performs zero regex compilation and minimal allocations:
12
12
 
@@ -35,7 +35,7 @@ pub fn squeeze_whitespace(value: &str) -> String {
35
35
 
36
36
  ## 2. Integer Arithmetic Over Heavy Date/Time Crates
37
37
 
38
- In `lustpress/src/util.rs`, converting video duration in seconds into `"{m}min, {s}sec"` format is called on hundreds of items per search request.
38
+ In media metadata processing, converting duration in seconds into `"{m}min, {s}sec"` format is called on hundreds of items per search request.
39
39
 
40
40
  Instead of creating DateTime objects or calling heavy formatting libraries, use native CPU integer division and modulo:
41
41
 
@@ -69,7 +69,7 @@ pub fn encode_query(val: &str) -> String {
69
69
 
70
70
  ## 4. Static Regex Compilation with `LazyLock<Regex>`
71
71
 
72
- When regular expressions are strictly required (such as mathematical challenge extraction in `lustpress/src/fetch.rs`), **NEVER** construct `Regex::new(...)` inside function bodies.
72
+ When regular expressions are strictly required (such as mathematical challenge token extraction), **NEVER** construct `Regex::new(...)` inside function bodies.
73
73
 
74
74
  Always compile regex patterns once into static memory:
75
75
 
@@ -37,7 +37,7 @@ Connecting to Redis in asynchronous Rust (via `redis` and `deadpool-redis`) oper
37
37
 
38
38
  ---
39
39
 
40
- ## 2. The Production-Tested Hybrid Cache Pattern (`jandapress`)
40
+ ## 2. The Production-Tested Hybrid Cache Pattern
41
41
 
42
42
  ```rust
43
43
  use deadpool_redis::{Config as RedisConfig, Pool, Runtime};
@@ -42,7 +42,7 @@ pub fn create_shared_http_client(user_agent: &str) -> reqwest::Client {
42
42
 
43
43
  A common mistake is using the same 15-second timeout for everything. If an ancillary request (like GeoIP lookup or third-party status probe) hangs, it pins the Tokio worker thread context for 15 seconds.
44
44
 
45
- ### The Jandapress Pattern:
45
+ ### The Fast-Fail Ancillary Pattern:
46
46
  Override timeouts on ancillary requests so they fail fast without impacting core traffic:
47
47
 
48
48
  ```rust
@@ -96,7 +96,7 @@ pub async fn telemetry_middleware(req: Request<Body>, next: Next) -> Response {
96
96
  return next.run(req).await;
97
97
  }
98
98
 
99
- // STRICT route normalization: Only record matched templates (e.g. /pornhub/get),
99
+ // STRICT route normalization: Only record matched templates (e.g. /api/v1/items/:id),
100
100
  // NEVER raw path or query params (?id=..., ?key=...) to prevent cardinality explosion.
101
101
  let matched_path = req
102
102
  .extensions()