Skip to content

All-in-one dependancey updating PR#246

Open
abdoei wants to merge 21 commits into
skygragon:masterfrom
abdoei:abdoeid/experiment
Open

All-in-one dependancey updating PR#246
abdoei wants to merge 21 commits into
skygragon:masterfrom
abdoei:abdoeid/experiment

Conversation

@abdoei

@abdoei abdoei commented Jul 23, 2026

Copy link
Copy Markdown

Summary

Modernize the entire project — bump all dependencies to latest, migrate tooling, and produce standalone executables with Node 22 while keeping API intact.

Changes

Build & Packaging

  • Replace pkg@4 with @yao-pkg/pkg@6 — The original pkg only supports up to Node 10. The maintained fork supports Node 22 and includes Zstd compression.
  • Targets: node10node22 — Binaries built for Linux, macOS, and Windows at Node 22.
  • Add --fallback-to-source — Ships plain source for ESM files that can't be bytecode-compiled.
  • Optionally compress with Zstd — Produces ~30% smaller binaries.

Dependency Modernization

All dependencies bumped to latest compatible versions:

  • cheerio 0.x1.2.0
  • yargs 6.x17.7.3 (via intermediate 18.0.0, rolled back to CJS-compatible v17 for pkg)
  • ora 0.x5.4.1 (rolled back from 9.4.1 to avoid ESM-only chalk subpath imports)
  • mkdirp 0.x3.0.1
  • ansi-styles 2.x6.2.3
  • color-convert added as explicit dependency
  • supports-color 2.x10.2.2
  • nconf, underscore, wordwrap, prompt, request, moment, he — minor bumps

Tooling

  • ESLint 4.x10.x — Migrated from legacy .eslintrc to flat config (eslint.config.js)
  • chai → native node:assert — Removes chai dependency, uses built-in assert.strict
  • nycc8 — Native coverage tool compatible with modern Node
  • npmpnpm — Updated install scripts and added pnpm-workspace.yaml

Standalone Binary Fixes

  • Plugin directory — Downloads remote plugins to ~/.lc/<app>/plugins/ instead of the read-only pkg snapshot
  • Graceful error handling — Catches plugin load failures instead of crashing
  • Suppress punycode deprecationprocess.noDeprecation silences tough-cookie warnings

Patches

  • winston@2.1.1 — Suppressed padLevels deprecation warning via pnpm patch

Other

  • ESM-compatible debug entry point — leetcode-debug for --inspect-brk debugging
  • Stat formatting fix — Right-aligned progress bar numbers for problems with ≥4 digits

Verification: All 139 tests pass (pnpm run test).

abdoei added 21 commits July 19, 2026 04:12
This reverts commit f264dd3.
…rackets to fix the broken visual representation after problem count exceeded 999 becoming a 4-digit number.
nyc hooks into Module._compile to instrument code, which breaks
Node.js's ESM-require feature (--experimental-require-module) and
causes SyntaxErrors on ESM dependencies like ora@9 and ansi-styles@6.

c8 uses V8 native coverage instead, working seamlessly with both
CJS and ESM modules without patching the module loader.
winston@2.1.1 accesses module.exports.padLevels during a circular
dependency load, which emits a warning in Node.js v26+. Patched
common.js to guard with hasOwnProperty before accessing the property.
The patch is persisted via pnpm's patchedDependencies so it survives
reinstalls. Why not upgrading? Because the latest prompt is using this 4yo version of winston.
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