Skip to content

Fix: Enforce documentation supply-chain quality gates and dependency security,strict TypeScript boundaries and eliminate unbounded any usage - #643

Open
magqqgq wants to merge 3 commits into
inkonchain:mainfrom
magqqgq:kerem

Conversation

@magqqgq

@magqqgq magqqgq commented Aug 20, 2026

Copy link
Copy Markdown

Description

This PR addresses CI/CD reliability, code formatting drift, and vulnerable supply-chain dependencies within the docs repository, as identified in the workspace-wide security audit and strict type-safety issues in the docs repository, specifically targeting the browser wallet boundaries and MDX component maps, as identified in the workspace-wide security audit.

Vulnerabilities & Security Defects Remediated:

  • CI Dependency-Install Contract: Updated the shared base-setup action to use pnpm install --frozen-lockfile after restoring the cache. This ensures strict, deterministic dependency installations across all independent CI jobs.
  • Mutating Format Job and Spell-Check: Removed the mutating format step in CI (format:js). Replaced it with the strictly validated check-only mode (format:js:check) and actively re-enabled the previously disabled spell-check job utilizing updated project dictionaries (cspell/project-words.txt).
  • Build Validation Bypass: Eliminated the ignoreDuringBuilds: true bypass from next.config.mjs, enforcing that ESLint fully validates production builds before completion.
  • Vulnerable JavaScript Dependencies: Mitigated findings from pnpm audit-prod by directly upgrading Next.js and PostCSS versions, and enforcing patched versions for transitive dependencies (such as cross-spawn, dompurify, sharp, lodash-es) using the pnpm.overrides configuration.
  • Formatter Drift: Formatted drifting source files (e.g., theme.config.tsx) using the repository's native Prettier configuration to comply deterministically with the new CI format check. Quality & Security Defects Remediated:
  • Untyped Browser Wallet Boundary (global-env.d.ts, src/utils/networks.ts): Removed all instances of (window as any).ethereum and ambient ethereum: any. The browser wallet interaction is now secured behind a strict EIP-1193 interface. Additionally, eth_chainId responses are strictly validated at runtime, and chainChanged event listeners are properly cleaned up upon component unmount to prevent memory leaks.
  • Untyped MDX Component Map (src/types/mdx.d.ts): Replaced the overly permissive ComponentType<any> with ComponentType<never>. This eliminates the unbounded any escape hatch while maintaining full compatibility with the existing MDX component wrapper prop types.

…security,strict TypeScript boundaries and eliminate unbounded any usage

### Description
This PR addresses CI/CD reliability, code formatting drift, and vulnerable supply-chain dependencies within the `docs` repository, as identified in the workspace-wide security audit and strict type-safety issues in the `docs` repository, specifically targeting the browser wallet boundaries and MDX component maps, as identified in the workspace-wide security audit.

**Vulnerabilities & Security Defects Remediated:**
* **CI Dependency-Install Contract:** Updated the shared `base-setup` action to use `pnpm install --frozen-lockfile` after restoring the cache. This ensures strict, deterministic dependency installations across all independent CI jobs.
* **Mutating Format Job and Spell-Check:** Removed the mutating format step in CI (`format:js`). Replaced it with the strictly validated check-only mode (`format:js:check`) and actively re-enabled the previously disabled spell-check job utilizing updated project dictionaries (`cspell/project-words.txt`).
* **Build Validation Bypass:** Eliminated the `ignoreDuringBuilds: true` bypass from `next.config.mjs`, enforcing that ESLint fully validates production builds before completion.
* **Vulnerable JavaScript Dependencies:** Mitigated findings from `pnpm audit-prod` by directly upgrading Next.js and PostCSS versions, and enforcing patched versions for transitive dependencies (such as `cross-spawn`, `dompurify`, `sharp`, `lodash-es`) using the `pnpm.overrides` configuration.
* **Formatter Drift:** Formatted drifting source files (e.g., `theme.config.tsx`) using the repository's native Prettier configuration to comply deterministically with the new CI format check.
**Quality & Security Defects Remediated:**
* **Untyped Browser Wallet Boundary (`global-env.d.ts`, `src/utils/networks.ts`):** Removed all instances of `(window as any).ethereum` and ambient `ethereum: any`. The browser wallet interaction is now secured behind a strict EIP-1193 interface. Additionally, `eth_chainId` responses are strictly validated at runtime, and `chainChanged` event listeners are properly cleaned up upon component unmount to prevent memory leaks.
* **Untyped MDX Component Map (`src/types/mdx.d.ts`):** Replaced the overly permissive `ComponentType<any>` with `ComponentType<never>`. This eliminates the unbounded `any` escape hatch while maintaining full compatibility with the existing MDX component wrapper prop types.
@magqqgq
magqqgq requested a review from a team as a code owner August 20, 2026 10:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant