mirror of
https://github.com/vercel/next.js.git
synced 2026-09-20 02:25:18 +08:00
be2c3fdb3a
When creating an NFT file in https://github.com/vercel/next.js/pull/98003, I store a generic list of "base" paths and then construct the final path in the JSON file as relative to the base path. For most files, these paths are relative to the `*.nft.json` file, but for additional roots, this base path is always an empty string (relative to the root of the filesystem), so being able to re-use the original `RcStr` instead of constructing a brand new string may be beneficial. This also moves the unit tests to be colocated next to the functions that are actually being tested.
Utilities for Next.js written without a dependency on turbo-tasks, allowing them to be shared with webpack and/or rspack codepaths. This crate must be compilable to WASM, so that it works in environments where no native bindings are available.
These utilities should not perform file IO directly, but instead accept files they depend on as arguments (preferred) or via async trait methods or callbacks (acceptable). Follow "sans-io" patterns where possible.