vercel / turborepo

Build system optimized for JavaScript and TypeScript, written in Rust
https://turbo.build/repo/docs
MIT License
26.33k stars 1.82k forks source link

chore(path): make path reading api more rusty #9103

Closed chris-olszewski closed 2 months ago

chris-olszewski commented 2 months ago

Description

Remove read_existing_to_string_or in favor of read_existing_to_string to consolidate on the more Rust-y API for reading a path to a file.

read_existing_to_string_or is an awkward API due:

The benefits of not conflating the two outcomes is best displayed when trying to read a config file. Instead of defaulting having a default of {} and then parsing it as JSON we can skip the parse and just use ConfigurationOptions::default()

Testing Instructions

Existing unit tests + 👀

vercel[bot] commented 2 months ago

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
examples-nonmonorepo ✅ Ready (Inspect) Visit Preview 💬 Add feedback Sep 3, 2024 7:18pm
8 Skipped Deployments | Name | Status | Preview | Comments | Updated (UTC) | | :--- | :----- | :------ | :------- | :------ | | **examples-basic-web** | ⬜️ Ignored ([Inspect](https://vercel.com/vercel/examples-basic-web/hogBTgaLxCGN665peUyw1Haudf13)) | | | Sep 3, 2024 7:18pm | | **examples-designsystem-docs** | ⬜️ Ignored ([Inspect](https://vercel.com/vercel/examples-designsystem-docs/FTFaFYqW1ma1pocyKtnXEpD7Nun7)) | | | Sep 3, 2024 7:18pm | | **examples-gatsby-web** | ⬜️ Ignored ([Inspect](https://vercel.com/vercel/examples-gatsby-web/3MWzS9LTRaMBbDhBqYW91iv6Pc8U)) | | | Sep 3, 2024 7:18pm | | **examples-kitchensink-blog** | ⬜️ Ignored ([Inspect](https://vercel.com/vercel/examples-kitchensink-blog/BsF7udynVW2YUUfFsM66mxMr8zpG)) | | | Sep 3, 2024 7:18pm | | **examples-native-web** | ⬜️ Ignored ([Inspect](https://vercel.com/vercel/examples-native-web/2dPvPuYrNbLdzZSzoDPZs6t6B5FF)) | | | Sep 3, 2024 7:18pm | | **examples-svelte-web** | ⬜️ Ignored ([Inspect](https://vercel.com/vercel/examples-svelte-web/8w4wBF4TogLQNk1zBeBgreHL6tGZ)) | | | Sep 3, 2024 7:18pm | | **examples-tailwind-web** | ⬜️ Ignored ([Inspect](https://vercel.com/vercel/examples-tailwind-web/6E48cncyPZ8ovNLPe5UD7tV7TxPp)) | | | Sep 3, 2024 7:18pm | | **examples-vite-web** | ⬜️ Ignored ([Inspect](https://vercel.com/vercel/examples-vite-web/61Tsm3QrynS5h3set7PZiGsuoFMv)) | | | Sep 3, 2024 7:18pm |