Skip to content
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

refactor(icon-import): change alias separator to comma #1885

Merged
merged 5 commits into from
Sep 18, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 15 additions & 0 deletions .changeset/fast-rivers-learn.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
---
"@sit-onyx/icons": minor
---

feat: update icons

Also fixed icon aliases in the metadata for most icons which are now separated correctly

#### New icons

- heptagon-cloud-foundry

#### Modified icons

- sidebar-arrow-right
10 changes: 10 additions & 0 deletions .changeset/swift-fans-rhyme.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
---
"@sit-onyx/figma-utils": major
---

refactor(icon-import): change alias separator to comma

To use the previous behavior, change the alias separator to `|`:

- if using CLI: add flag `-s "|"`
- if using function: `parseComponentsToIcons({ aliasSeparator: "|" })`
2 changes: 1 addition & 1 deletion packages/figma-utils/src/commands/import-icons.ts
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ export const importIconsCommand = new Command("import-icons")
.option(
"-s, --alias-separator <string>",
"Separator for icon alias names (which can be set to the component description in Figma).",
"|",
",",
)
.action(importIconsCommandAction);

Expand Down
4 changes: 2 additions & 2 deletions packages/figma-utils/src/icons/parse.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ export type ParseIconComponentsOptions = {
/**
* Separator for icon alias names (which can be set to the component description in Figma).
*
* @default "|"
* @default ","
*/
aliasSeparator?: string;
};
Expand All @@ -28,7 +28,7 @@ export const parseComponentsToIcons = (options: ParseIconComponentsOptions): Par
id: component.node_id,
name: component.name,
aliases: component.description
.split(options.aliasSeparator ?? "|")
.split(options.aliasSeparator ?? ",")
.map((alias) => alias.trim())
.filter((i) => i !== ""),
category: component.containing_frame.name.trim(),
Expand Down
1 change: 1 addition & 0 deletions packages/icons/src/assets/heptagon-cloud-foundry.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion packages/icons/src/assets/sidebar-arrow-right.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Loading