Skip to content

build(deps): remove unused lru-cache dependency - #256

Merged
sy-records merged 1 commit into
docsifyjs:masterfrom
HeversonSilva-gif:remove-unused-lru-cache
Aug 4, 2026
Merged

build(deps): remove unused lru-cache dependency#256
sy-records merged 1 commit into
docsifyjs:masterfrom
HeversonSilva-gif:remove-unused-lru-cache

Conversation

@HeversonSilva-gif

Copy link
Copy Markdown
Contributor

lru-cache@^5.1.1 is declared in dependencies but is not imported anywhere in the
project. Its only occurrence in the whole repository is the package.json line itself.

Everyone who installs docsify-cli gets it, and nothing ever loads it.

Verified at b9d118f on Node 20.20.0 / npm 10.8.2, Windows:

  • git grep -E "(from|require\(|import\()\s*['\"]lru-cache" returns nothing, and a plain
    git grep for lru-cache or LRU outside the lockfile matches only package.json:61.

  • npm run build (rollup) after the change: exit 0, lib/cli.js → bin/docsify created as
    before. Nothing was being bundled from it either.

  • npm test before the change: 9 tests failed. After the change: 9 tests failed. The
    set of failing titles is identical, diffed rather than counted:

    cli › shows up help message without any args
    cli › shows help with -h flag
    cli › shows help with --help flag
    cli › shows version information with -v flag
    cli › shows version information with --version flag
    cli › rejects promise due to error on passing in an unknown command
    commands › generate › generate _sidebar.md
    commands › init › generates docs directory
    commands › init › force generates docs directory with --local flag
    

    Those 9 are pre-existing on this machine and unrelated to this change — they are the
    e2e tests that shell out, and they fail the same way on a clean checkout. pretest runs
    eslint ., which is clean on both sides.

  • npm install reports removed 2 packages: lru-cache and yallist, which came in only
    as its dependency.

I have not touched anything else. If you would rather I re-run the suite somewhere the e2e
tests pass before this is merged, I'm happy to, but the failing set being identical is what
tells you the change is inert.

@sy-records sy-records left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks.

It was previously referenced in SSR, but now that SSR has been removed, it is no longer needed.

@sy-records
sy-records merged commit bca45f5 into docsifyjs:master Aug 4, 2026
4 checks passed
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.

2 participants