Skip to content

refactor: use LocalState from @netlify/dev-utils #7454

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 5 commits into from
Jul 23, 2025

Conversation

keanu-a
Copy link
Contributor

@keanu-a keanu-a commented Jul 22, 2025

🎉 Thanks for submitting a pull request! 🎉

Summary

Fixes #EX-367

Replaced all usages of CLIState with LocalState from @netlify/dev-utils. Deleted cli-state.js as no longer used.

Ref: https://github.com/netlify/primitives/blob/main/packages/dev-utils/src/lib/local-state.ts#L27


For us to review and ship your PR efficiently, please perform the following steps:

  • Open a bug/issue before writing your code 🧑‍💻. This ensures we can discuss the changes and get feedback from everyone that should be involved. If you`re fixing a typo or something that`s on fire 🔥 (e.g. incident related), you can skip this step.
  • Read the contribution guidelines 📖. This ensures your code follows our style guide and
    passes our tests.
  • Update or add tests (if any source code was changed or added) 🧪
  • Update or add documentation (if features were changed or added) 📝
  • Make sure the status checks below are successful ✅

A picture of a cute animal (not mandatory, but encouraged)

Copy link

github-actions bot commented Jul 22, 2025

📊 Benchmark results

Comparing with 0034927

  • Dependency count: 1,083 (no change)
  • Package size: 288 MB (no change)
  • Number of ts-expect-error directives: 388 ⬇️ 2.84% decrease vs. 0034927

@keanu-a keanu-a marked this pull request as ready for review July 22, 2025 22:37
@keanu-a keanu-a requested a review from a team as a code owner July 22, 2025 22:37
@keanu-a keanu-a changed the title refactor: use LocalState in @netlify/dev-utils refactor: use LocalState from @netlify/dev-utils Jul 23, 2025
Copy link
Member

@serhalp serhalp left a comment

Choose a reason for hiding this comment

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

LGTM, let's just remove an unused dependency!

Copy link
Member

Choose a reason for hiding this comment

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

👍🏼 appears to be identical, so no need for any other changes

import process from 'process'

import { deleteProperty, getProperty, hasProperty, setProperty } from 'dot-prop'
import { findUpSync } from 'find-up'
Copy link
Member

Choose a reason for hiding this comment

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

looks like this is the only use of find-up, so we can remove it!

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Ah it's the only use of findUpSync but other files do use findUp from the find-up package still 😅
Ex: https://github.com/netlify/cli/blob/keanualoua/ex-367-use-localstate-in-netlifydev-utils/src/commands/base-command.ts

Copy link
Member

Choose a reason for hiding this comment

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

wtf, github search lied to me earlier, but now it's showing all the results. my bad!

Copy link
Contributor Author

Choose a reason for hiding this comment

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

All good! It does lie sometimes 🤣

@keanu-a keanu-a requested a review from serhalp July 23, 2025 18:01
@keanu-a keanu-a merged commit 6d14bf8 into main Jul 23, 2025
67 of 68 checks passed
@keanu-a keanu-a deleted the keanualoua/ex-367-use-localstate-in-netlifydev-utils branch July 23, 2025 18:18
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