@svgicons-com/cli 0.1.0-alpha.4 → 0.1.0-alpha.5

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.
package/README.md CHANGED
@@ -8,7 +8,7 @@ Public icon search works without changing the default endpoint. Pro workflows re
8
8
 
9
9
  The scanner is read-only by default. It never edits project files unless a future command explicitly adds that behavior.
10
10
 
11
- Current package version: `0.1.0-alpha.3`.
11
+ Current package version: `0.1.0-alpha.5`.
12
12
 
13
13
  ## Requirements
14
14
 
@@ -70,8 +70,15 @@ svgicons collection add "Dashboard icons" 33716 240297
70
70
  svgicons collection remove "Dashboard icons" 33716-arrow-circle-up-fill
71
71
  svgicons collection delete "Dashboard icons" --yes
72
72
  svgicons collection export "Dashboard icons" --formats react-ts,vue --color-policy currentColor --output ./exports
73
+ svgicons collection export "Dashboard icons" --formats svelte --output ./exports
74
+ svgicons collection export "Dashboard icons" --formats solid --output ./exports
75
+ svgicons collection export "Dashboard icons" --formats blade --output ./exports
76
+ svgicons collection export "Dashboard icons" --formats storybook --output ./exports
77
+ svgicons collection export "Dashboard icons" --formats npm-package --package-name svgicons-dashboard-icons --output ./exports
73
78
  svgicons collection export "Dashboard icons" --formats png-pack --png-sizes 24,48,512 --output ./exports
79
+ svgicons collection export "Dashboard icons" --formats iconify-json --output ./exports
74
80
  svgicons collection export "Dashboard icons" --formats react-ts --no-size-props --no-typescript --output ./exports
81
+ svgicons collection export "Dashboard icons" --formats react-ts,solid --default-size 20 --component-suffix Glyph --no-decorative --output ./exports
75
82
  svgicons export status 55 --collection "Dashboard icons"
76
83
  svgicons export download 55 --collection "Dashboard icons" --output ./exports
77
84
  svgicons init --collection "Dashboard icons" --output ./src/icons
@@ -186,11 +193,17 @@ The command polls every 2 seconds for up to 180 seconds by default. Use `--timeo
186
193
  Supported export flags:
187
194
 
188
195
  ```bash
189
- --formats react-ts,vue,png-pack
196
+ --formats react-ts,vue,svelte,solid,blade,storybook,npm-package,png-pack,iconify-json
190
197
  --color-policy currentColor|preserve|strip
191
198
  --naming-policy kebab|pascal|camel
192
199
  --size-props / --no-size-props
193
200
  --typescript / --no-typescript
201
+ --default-size 24
202
+ --title-prop / --no-title-prop
203
+ --decorative / --no-decorative
204
+ --component-suffix Icon
205
+ --package-name svgicons-dashboard-icons
206
+ --package-version 0.1.0
194
207
  --png-sizes 24,48,512
195
208
  --png-densities 1,2
196
209
  --png-background transparent|solid
@@ -200,7 +213,7 @@ Supported export flags:
200
213
  --png-padding 48
201
214
  ```
202
215
 
203
- Use `--formats png` as a shorthand for `--formats png-pack`. PNG pack exports are generated by the server queue worker and downloaded as part of the collection ZIP.
216
+ Use `--formats png` as a shorthand for `--formats png-pack`. PNG pack exports are generated by the server queue worker and downloaded as part of the collection ZIP. Use `--formats svelte` to include Svelte components, `--formats solid` to include Solid components, `--formats blade` to include Laravel Blade components, `--formats storybook` to include a React Storybook gallery, `--formats npm-package` to include a React TypeScript package scaffold, or `--formats iconify-json` to include an Iconify-compatible `iconify.json` file in the collection ZIP.
204
217
 
205
218
  Collection commands accept a numeric ID, exact slug, or exact case-insensitive collection name. The legacy `kit` alias remains available for old scripts.
206
219
 
package/RELEASE_NOTES.md CHANGED
@@ -1,4 +1,27 @@
1
- # Svg/icons CLI 0.1.0-alpha.3
1
+ # Svg/icons CLI 0.1.0-alpha.5
2
+
3
+ This alpha refresh keeps the npm alpha channel aligned with the current Svg/icons Pro export workflow.
4
+
5
+ ## New in 0.1.0-alpha.5
6
+
7
+ - Version bump for npm alpha publication after `0.1.0-alpha.4`.
8
+ - No runtime command changes from `0.1.0-alpha.4`.
9
+ - Keeps the package README and release notes aligned with the current CLI export surface.
10
+
11
+ ## 0.1.0-alpha.4
12
+
13
+ This alpha brought the CLI up to date with the current Svg/icons Pro export workflow.
14
+
15
+ - Added single-icon PNG export with `svgicons icon png`, including PNG and ZIP variant downloads.
16
+ - Added collection PNG pack export with size, density, background, color, padding, and fit options.
17
+ - Added collection export format support for `svelte`, `solid`, `blade`, `storybook`, `npm-package`, and `iconify-json`.
18
+ - Added `png` as a shorthand for the `png-pack` collection export format.
19
+ - Added safe framework export options: `--default-size`, `--component-suffix`, `--title-prop`, `--no-title-prop`, `--decorative`, and `--no-decorative`.
20
+ - Added npm package export metadata options: `--package-name` and `--package-version`.
21
+ - Added `svgicons export download <export-id> --collection <collection>` for downloading queued collection export ZIPs.
22
+ - Updated CLI docs and tests for the newer Pro API export formats.
23
+
24
+ ## 0.1.0-alpha.3
2
25
 
3
26
  This alpha refresh improves token setup safety. `login` now rejects obviously truncated numeric tokens, which commonly happens when a shell command is run without quoting a Sanctum-style token containing `|`.
4
27
 
@@ -44,6 +67,7 @@ Before publishing, run:
44
67
 
45
68
  ```bash
46
69
  npm --prefix cli test
70
+ cd cli
47
71
  npm pack --dry-run
48
72
  ```
49
73
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@svgicons-com/cli",
3
- "version": "0.1.0-alpha.4",
3
+ "version": "0.1.0-alpha.5",
4
4
  "description": "Svg/icons CLI alpha for icon search, Pro collections, exports, project scanning, and license workflows.",
5
5
  "type": "module",
6
6
  "bin": {
@@ -13,7 +13,7 @@
13
13
  "RELEASE_NOTES.md"
14
14
  ],
15
15
  "scripts": {
16
- "test": "node --test tests"
16
+ "test": "node --test"
17
17
  },
18
18
  "engines": {
19
19
  "node": ">=18.18"
package/src/cli.js CHANGED
@@ -57,7 +57,21 @@ const KNOWN_SCOPES = [
57
57
  'exports:create',
58
58
  'mcp:use',
59
59
  ];
60
- const EXPORT_FORMATS = ['svg-folder', 'svg-sprite', 'json-manifest', 'license-manifest', 'react-ts', 'vue', 'png-pack'];
60
+ const EXPORT_FORMATS = [
61
+ 'svg-folder',
62
+ 'svg-sprite',
63
+ 'json-manifest',
64
+ 'license-manifest',
65
+ 'react-ts',
66
+ 'vue',
67
+ 'svelte',
68
+ 'solid',
69
+ 'blade',
70
+ 'storybook',
71
+ 'npm-package',
72
+ 'png-pack',
73
+ 'iconify-json',
74
+ ];
61
75
  const FRAMEWORKS = ['svg', 'react-ts', 'vue', 'sprite'];
62
76
  const COLOR_POLICIES = ['currentColor', 'preserve', 'strip'];
63
77
  const NAMING_POLICIES = ['kebab', 'pascal', 'camel'];
@@ -1218,7 +1232,7 @@ async function buildProject(args) {
1218
1232
  const format = options.format || manifest.format || 'svg';
1219
1233
 
1220
1234
  if (format !== 'svg') {
1221
- throw usageError('Local build currently supports format svg. Use collection export for React TypeScript or Vue component ZIPs.');
1235
+ throw usageError('Local build currently supports format svg. Use collection export for React TypeScript, Vue, Svelte, or Solid component ZIPs.');
1222
1236
  }
1223
1237
 
1224
1238
  const outputDir = resolve(String(options.output || options.o || manifest.output));
@@ -1889,6 +1903,12 @@ function buildExportOptions(options) {
1889
1903
  namingPolicy: enumOption(options['naming-policy'], 'naming policy', NAMING_POLICIES),
1890
1904
  sizeProps: booleanFlagPair(options, 'size-props', 'no-size-props'),
1891
1905
  typescript: booleanFlagPair(options, 'typescript', 'no-typescript'),
1906
+ defaultSize: boundedIntegerOption(options['default-size'], 'default component size', 1, 1024),
1907
+ titleProp: booleanFlagPair(options, 'title-prop', 'no-title-prop'),
1908
+ decorative: booleanFlagPair(options, 'decorative', 'no-decorative'),
1909
+ componentSuffix: identifierOption(options['component-suffix'], 'component suffix'),
1910
+ packageName: packageNameOption(options['package-name']),
1911
+ packageVersion: packageVersionOption(options['package-version']),
1892
1912
  png: includesPng ? png : undefined,
1893
1913
  },
1894
1914
  };
@@ -1969,6 +1989,59 @@ function integerOption(value, label) {
1969
1989
  return parsed;
1970
1990
  }
1971
1991
 
1992
+ function boundedIntegerOption(value, label, min, max) {
1993
+ const parsed = integerOption(value, label);
1994
+
1995
+ if (parsed === undefined) {
1996
+ return undefined;
1997
+ }
1998
+
1999
+ if (parsed < min || parsed > max) {
2000
+ throw usageError(`Invalid ${label}: ${value}. Allowed range: ${min}-${max}.`);
2001
+ }
2002
+
2003
+ return parsed;
2004
+ }
2005
+
2006
+ function identifierOption(value, label) {
2007
+ if (value === undefined || value === true || value === '') {
2008
+ return undefined;
2009
+ }
2010
+
2011
+ const parsed = String(value);
2012
+ if (!/^[A-Za-z][A-Za-z0-9]{0,31}$/.test(parsed)) {
2013
+ throw usageError(`Invalid ${label}: ${value}. Use 1-32 letters or numbers, starting with a letter.`);
2014
+ }
2015
+
2016
+ return parsed;
2017
+ }
2018
+
2019
+ function packageNameOption(value) {
2020
+ if (value === undefined || value === true || value === '') {
2021
+ return undefined;
2022
+ }
2023
+
2024
+ const parsed = String(value);
2025
+ if (parsed.length > 214 || parsed.toLowerCase() !== parsed || !/^(?:@[a-z0-9][a-z0-9._-]*\/[a-z0-9][a-z0-9._-]*|[a-z0-9][a-z0-9._-]*)$/.test(parsed)) {
2026
+ throw usageError(`Invalid npm package name: ${value}. Use a lowercase npm package name such as svgicons-dashboard or @svgicons-com/dashboard.`);
2027
+ }
2028
+
2029
+ return parsed;
2030
+ }
2031
+
2032
+ function packageVersionOption(value) {
2033
+ if (value === undefined || value === true || value === '') {
2034
+ return undefined;
2035
+ }
2036
+
2037
+ const parsed = String(value);
2038
+ if (parsed.length > 64 || !/^\d+\.\d+\.\d+(?:-[0-9A-Za-z.-]+)?(?:\+[0-9A-Za-z.-]+)?$/.test(parsed)) {
2039
+ throw usageError(`Invalid npm package version: ${value}. Use a semver-like version such as 1.0.0 or 1.0.0-beta.1.`);
2040
+ }
2041
+
2042
+ return parsed;
2043
+ }
2044
+
1972
2045
  function stripUndefined(value) {
1973
2046
  return Object.fromEntries(Object.entries(value).filter(([, item]) => item !== undefined));
1974
2047
  }
@@ -2035,7 +2108,7 @@ Usage:
2035
2108
  svgicons collection add <collection-id-or-name> <icon-id...>
2036
2109
  svgicons collection remove <collection-id-or-name> <icon-id...>
2037
2110
  svgicons collection delete <collection-id-or-name> [--yes]
2038
- svgicons collection export <collection-id-or-name> [--formats react-ts,vue,png-pack] [--png-sizes 24,48,512] [--no-size-props] [--no-typescript] [--output ./exports]
2111
+ svgicons collection export <collection-id-or-name> [--formats react-ts,vue,svelte,solid,blade,storybook,npm-package,png-pack,iconify-json] [--default-size 24] [--component-suffix Icon] [--package-name svgicons-dashboard] [--package-version 0.1.0] [--title-prop|--no-title-prop] [--decorative|--no-decorative] [--no-size-props] [--no-typescript] [--output ./exports]
2039
2112
  svgicons export status <export-id> --collection <collection-id-or-name>
2040
2113
  svgicons export download <export-id> --collection <collection-id-or-name> [--output ./exports]
2041
2114
  svgicons init [--collection <collection-id-or-name>] [--output svgicons-icons]