goetzrobin / spartan

Cutting-edge tools powering Angular full-stack development.
https://spartan.ng
MIT License
1.13k stars 123 forks source link

"Select All" Functionality in Spartan CLI Incorrectly Handles Installed Components #173

Closed wassimbenr closed 4 months ago

wassimbenr commented 4 months ago

Please provide the environment you discovered this bug in.

Angular 17.1.2 application

Which area/package is the issue in?

Don't know / other

Description

I'm encountering an issue with the "Select All" functionality in the Spartan CLI. When using this option, it appears to throw errors when attempting to install components that are already present in the project.

The expected behavior would be for the "Select All" function to only install new components and ignore those that are already installed. However, the current behavior results in errors, making it difficult to efficiently install multiple components at once.

Please provide the exception or error you saw

You already have a library using the import path "@spartan-ng/ui-****-helm". Make sure to specify a unique one.

Other information

Additional observation: It appears that selecting individual components does not automatically deselect the "Select All" option. In other words, users can have both individual components and "Select All" selected simultaneously, which can lead to confusion and unintended installations.

I would be willing to submit a PR to fix this issue

goetzrobin commented 4 months ago

I added a check to skip installation if a primitive already exists: https://github.com/goetzrobin/spartan/commit/7cc2aaf0a78b829180e52411935322e5d4aa593a

Will be part of the next release

goetzrobin commented 4 months ago

@wassimbenr with the newest version of the CLI already installed primitives should simply be skipped. Please let me know if this issue is fixed now

wassimbenr commented 4 months ago

@goetzrobin Yess! Well done