11ty / eleventy

A simpler site generator. Transforms a directory of templates (of varying types) into HTML.
https://www.11ty.dev/
MIT License
17.01k stars 492 forks source link

New deprecation warnings stemming from `recursive-copy@^2.0.14` #3299

Closed noelforte closed 2 months ago

noelforte commented 4 months ago

Operating system

macOS Sonoma 14.2.1 (23C71)

Eleventy

@11ty/eleventy@3.0.0-alpha.10

Describe the bug

As of writing this issue, I'm seeing new deprecation warnings for the following packages:

npm warn deprecated inflight@1.0.6: This module is not supported, and leaks memory. Do not use it. Check out lru-cache if you want a good and tested way to coalesce async requests by a key value, which is much more comprehensive and powerful.
npm warn deprecated rimraf@2.7.1: Rimraf versions prior to v4 are no longer supported
npm warn deprecated glob@7.2.3: Glob versions prior to v9 are no longer supported

Upon further investigation, I can see that these deprecated packages stem from recursive-copy@^2.0.14 which hasn't been touched for the past 2 years. recursive-copy is a direct dependency of Eleventy as of the latest canary (3.0.0-alpha.10). Here's a copy of the dependency tree:

@11ty/eleventy 3.0.0-alpha.10
└─┬ recursive-copy 2.0.14 # <-- hasn't been updated, below dependencies are deprecated
  └─┬ rimraf 2.7.1
    └─┬ glob 7.2.3
      └── inflight 1.0.6

Reproduction steps

  1. Create a new directory
  2. npm init -y
  3. npm install @11ty/eleventy@canary
  4. See output

Expected behavior

Warnings about deprecated packages should not be thrown.

Reproduction URL

No response

Screenshots

No response

noelforte commented 4 months ago

As an addendum: I recently learned that there's a native API for recursive copying in NodeJS that was introduced back in Node 16 (along with a promisified version too), however even as of v22 it's still labeled as "Experimental", so might not be the right thing to lean on if Eleventy's policy is to only use native API's that are stable. Just thought I'd add it as an afterthought here since it seemed relevant.

zachleat commented 3 months ago

Confirmed this, filed upstream first: https://github.com/timkendrick/recursive-copy/issues/44

zachleat commented 3 months ago

Lovely visualization here of the dep graph: https://npmgraph.js.org/?q=%4011ty%2Feleventy%40canary#select=exact%3Arecursive-copy%402.0.14

BenjaminEHowe commented 2 months ago

Hmm -- the upstream project seems to have limited activity, and no releases for over 2 years. I think fs-extra could be used instead here... any thoughts? I suspect this would be a breaking change so perhaps best to get into v3 if it's not too late.

zachleat commented 2 months ago

@BenjaminEHowe I think we’ll temporarily fork this one and hopefully move to fs.cp in the next major. Looks like fs.cp is stable in Node v22.3.0: https://nodejs.org/docs/latest-v22.x/api/fs.html#fscpsrc-dest-options-callback Filed that work at #3360

zachleat commented 2 months ago

We’re now using @11ty/recursive-copy temporarily which includes the npm dependency updates required here: https://github.com/11ty/recursive-copy/

Shipping with 3.0.0-alpha.17.