@sit-onyx/figma-utils 1.0.0-beta.2 → 1.0.0-beta.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -13,7 +13,7 @@ export const importIconsCommand = new Command("import-icons")
13
13
  .requiredOption("-p, --page-id <string>", "Figma page ID that contains the icons (required)")
14
14
  .option("-d, --dir <string>", "Directory to save the icons to. Defaults to current working directory of the script.")
15
15
  .option("-m, --meta-file <string>", 'JSON filename/path to write icon metadata to (categories, alias names etc.). Must end with ".json". If unset, no metadata will be generated.')
16
- .option("-s, --alias-separator <string>", "Separator for icon alias names (which can be set to the component description in Figma).", "|")
16
+ .option("-s, --alias-separator <string>", "Separator for icon alias names (which can be set to the component description in Figma).", ",")
17
17
  .action(importIconsCommandAction);
18
18
  /**
19
19
  * Action to run when executing the import action. Only intended to be called manually for testing.
@@ -11,7 +11,7 @@ export type ParseIconComponentsOptions = {
11
11
  /**
12
12
  * Separator for icon alias names (which can be set to the component description in Figma).
13
13
  *
14
- * @default "|"
14
+ * @default ","
15
15
  */
16
16
  aliasSeparator?: string;
17
17
  };
@@ -6,8 +6,9 @@ export const parseComponentsToIcons = (options) => {
6
6
  id: component.node_id,
7
7
  name: component.name,
8
8
  aliases: component.description
9
- .split(options.aliasSeparator ?? "|")
10
- .map((alias) => alias.trim()),
9
+ .split(options.aliasSeparator ?? ",")
10
+ .map((alias) => alias.trim())
11
+ .filter((i) => i !== ""),
11
12
  category: component.containing_frame.name.trim(),
12
13
  };
13
14
  })
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@sit-onyx/figma-utils",
3
3
  "description": "Utility functions and CLI for importing data from the Figma API into different formats (e.g. CSS, SCSS etc.)",
4
- "version": "1.0.0-beta.2",
4
+ "version": "1.0.0-beta.4",
5
5
  "type": "module",
6
6
  "bin": {
7
7
  "@sit-onyx/figma-utils": "./dist/cli.js"