Skip to content

refactor(@angular/cli): enhance JSON file handling and utility functions #30828

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

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

clydin
Copy link
Member

@clydin clydin commented Aug 1, 2025

This commit introduces a number of significant improvements to the core utility functions, with a primary focus on enhancing the robustness and developer experience of JSONFile.

The JSONFile class now automatically detects and preserves file indentation, uses native private fields for better encapsulation, and includes a new delete() method for a more intuitive API.

Additionally, the readAndParseJson and parseJson functions are now generic for improved type-safety. The assertIsError utility is more robust, and a type-related bug in workspace configuration validation has been fixed. All related utilities have been updated with comprehensive JSDoc comments.

This commit introduces a number of significant improvements to the core utility functions, with a primary focus on enhancing the robustness and developer experience of `JSONFile`.

The `JSONFile` class now automatically detects and preserves file indentation, uses native private fields for better encapsulation, and includes a new `delete()` method for a more intuitive API.

Additionally, the `readAndParseJson` and `parseJson` functions are now generic for improved type-safety. The `assertIsError` utility is more robust, and a type-related bug in workspace configuration validation has been fixed. All related utilities have been updated with comprehensive JSDoc comments.
@clydin clydin added the target: minor This PR is targeted for the next minor release label Aug 1, 2025
@clydin clydin added the action: review The PR is still awaiting reviews from at least one requested reviewer label Aug 1, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
action: review The PR is still awaiting reviews from at least one requested reviewer area: @angular/cli target: minor This PR is targeted for the next minor release
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant