ngneat / svg-icon

👻 A lightweight library that makes it easier to use SVG icons in your Angular Application
https://netbasal.com
MIT License
257 stars 35 forks source link

feat: 🎸 add ability to export all icons in root and folders #43

Closed zgabievi closed 3 years ago

zgabievi commented 3 years ago

all icons can be exported from index.ts file in root, or from group/index.ts file.

PR Checklist

Please check if your PR fulfills the following requirements:

PR Type

What kind of change does this PR introduce?

[ ] Bugfix
[x] Feature
[ ] Code style update (formatting, local variables)
[ ] Refactoring (no functional changes, no api changes)
[] Build related changes
[ ] CI related changes
[x] Documentation content changes
[ ] Other... Please describe:

What is the current behavior?

I had a case where I needed to export all icons from one file. Ex: In content management system, I want to give user ability to choose any icon.

I have another case where I have entry points in my project and to make icons work, I have to export every icon from public-api.ts file.

Issue Number: N/A

What is the new behavior?

With this change, no index.ts file will be generated in root directory, with every icons exported. Also export statement will be added to group folders index.ts file.

Does this PR introduce a breaking change?

[ ] Yes
[x] No

Other information

NetanelBasal commented 3 years ago

Thanks. One of my tasks was to create specs for the generator. I can't merge this because currently I have no specs to check that it works as expected.

zgabievi commented 3 years ago

Yep. I was looking for specs to write some test. Waiting for your specs then, and then I will update the request.

NetanelBasal commented 3 years ago

This is done in v3 - https://github.com/ngneat/svg-icon/commit/0a0f8bfcfe233fb94fb1fd1f9b649420b9074962#diff-142ec6eabfb5776aeca0c476aafb5b36fba7e37efafa13179f5578b469a0ff90R17

Notice that we update svgo to v2.