@astryxdesign/cli 0.7.4 → 0.7.5-canary.2a50a80
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 +18 -18
- package/api/icon/_adapter.d.mts +3 -2
- package/api/icon/_adapter.mjs +16 -3
- package/api/icon/_authoring.d.mts +5 -1
- package/api/icon/_authoring.mjs +478 -63
- package/api/icon/_options.d.mts +11 -0
- package/api/icon/_options.mjs +39 -4
- package/api/icon/_records.d.mts +19 -0
- package/api/icon/_records.mjs +25 -0
- package/api/icon/add/add.d.mts +3 -3
- package/api/icon/add/add.mjs +227 -14
- package/api/icon/all-or-nothing.test.mjs +283 -0
- package/api/icon/detail/detail.mjs +2 -13
- package/api/icon/error-codes.test.mjs +14 -7
- package/api/icon/icon.d.mts +2 -2
- package/api/icon/icon.doc.mjs +30 -2
- package/api/icon/icon.mjs +57 -8
- package/api/icon/icon.test.mjs +133 -1
- package/api/icon/icon.type.d.mts +126 -1
- package/api/icon/icon.type.mjs +67 -3
- package/api/icon/iconAdd.doc.mjs +22 -6
- package/api/icon/iconMap.doc.mjs +24 -8
- package/api/icon/iconNewDefinition.doc.mjs +2 -2
- package/api/icon/iconNewSet.doc.mjs +30 -2
- package/api/icon/iconUse.doc.mjs +4 -1
- package/api/icon/map/map.d.mts +4 -4
- package/api/icon/map/map.mjs +134 -9
- package/api/icon/new-definition/new-definition.mjs +6 -2
- package/api/icon/new-set/new-set.mjs +2 -2
- package/api/icon/new-set/new-set.test.mjs +60 -10
- package/api/icon/option-pairs.test.mjs +368 -0
- package/api/icon/search/search.d.mts +10 -0
- package/api/icon/search/search.mjs +55 -14
- package/api/icon/use/use.mjs +2 -13
- package/api/integration/add-helpers.d.mts +15 -1
- package/api/integration/add-helpers.mjs +1 -1
- package/api/integration/validate-integration.type.d.mts +3 -2
- package/api/integration/validate-integration.type.mjs +3 -2
- package/api/template/template.type.d.mts +2 -1
- package/api/template/template.type.mjs +1 -1
- package/assets/discover/official-packages.json +4 -0
- package/assets/docs/tree/icon-definitions.doc.mjs +2 -2
- package/assets/docs/tree/icon-set-files.doc.mjs +1 -1
- package/assets/docs/tree/icon-sets.doc.mjs +50 -20
- package/assets/icons/definitions/activity.doc.mjs +1 -1
- package/assets/icons/definitions/alignCenter.doc.mjs +9 -0
- package/assets/icons/definitions/alignEnd.doc.mjs +10 -0
- package/assets/icons/definitions/alignStart.doc.mjs +10 -0
- package/assets/icons/definitions/archive.doc.mjs +1 -1
- package/assets/icons/definitions/arrowsUpDown.doc.mjs +1 -1
- package/assets/icons/definitions/attach.doc.mjs +1 -1
- package/assets/icons/definitions/audio.doc.mjs +1 -1
- package/assets/icons/definitions/cart.doc.mjs +1 -1
- package/assets/icons/definitions/checkDouble.doc.mjs +1 -1
- package/assets/icons/definitions/chevronsLeft.doc.mjs +1 -1
- package/assets/icons/definitions/chevronsRight.doc.mjs +1 -1
- package/assets/icons/definitions/close.doc.mjs +1 -1
- package/assets/icons/definitions/collapse.doc.mjs +1 -1
- package/assets/icons/definitions/compose.doc.mjs +1 -1
- package/assets/icons/definitions/conversation.doc.mjs +1 -1
- package/assets/icons/definitions/copy.doc.mjs +1 -1
- package/assets/icons/definitions/cpu.doc.mjs +9 -0
- package/assets/icons/definitions/database.doc.mjs +1 -1
- package/assets/icons/definitions/desktop.doc.mjs +1 -1
- package/assets/icons/definitions/discount.doc.mjs +1 -1
- package/assets/icons/definitions/download.doc.mjs +1 -1
- package/assets/icons/definitions/emoji.doc.mjs +1 -1
- package/assets/icons/definitions/error.doc.mjs +1 -1
- package/assets/icons/definitions/expand.doc.mjs +1 -1
- package/assets/icons/definitions/experiment.doc.mjs +1 -1
- package/assets/icons/definitions/externalLink.doc.mjs +7 -1
- package/assets/icons/definitions/eyeSlash.doc.mjs +1 -1
- package/assets/icons/definitions/flipHorizontal.doc.mjs +9 -0
- package/assets/icons/definitions/flipVertical.doc.mjs +9 -0
- package/assets/icons/definitions/folderAdd.doc.mjs +1 -1
- package/assets/icons/definitions/gitBranch.doc.mjs +9 -0
- package/assets/icons/definitions/gitFork.doc.mjs +9 -0
- package/assets/icons/definitions/info.doc.mjs +1 -1
- package/assets/icons/definitions/location.doc.mjs +1 -1
- package/assets/icons/definitions/mention.doc.mjs +1 -1
- package/assets/icons/definitions/menu.doc.mjs +1 -1
- package/assets/icons/definitions/microphone.doc.mjs +1 -1
- package/assets/icons/definitions/mobile.doc.mjs +1 -1
- package/assets/icons/definitions/money.doc.mjs +1 -1
- package/assets/icons/definitions/moreHorizontal.doc.mjs +1 -1
- package/assets/icons/definitions/notificationActive.doc.mjs +1 -1
- package/assets/icons/definitions/notificationOff.doc.mjs +1 -1
- package/assets/icons/definitions/panelLeft.doc.mjs +10 -0
- package/assets/icons/definitions/panelRight.doc.mjs +10 -0
- package/assets/icons/definitions/raiseHand.doc.mjs +1 -1
- package/assets/icons/definitions/redo.doc.mjs +1 -1
- package/assets/icons/definitions/refresh.doc.mjs +1 -1
- package/assets/icons/definitions/rotate.doc.mjs +9 -0
- package/assets/icons/definitions/scale.doc.mjs +10 -0
- package/assets/icons/definitions/search.doc.mjs +1 -1
- package/assets/icons/definitions/send.doc.mjs +1 -1
- package/assets/icons/definitions/settings.doc.mjs +1 -1
- package/assets/icons/definitions/star.doc.mjs +1 -1
- package/assets/icons/definitions/stop.doc.mjs +1 -1
- package/assets/icons/definitions/success.doc.mjs +1 -1
- package/assets/icons/definitions/textCase.doc.mjs +9 -0
- package/assets/icons/definitions/thumbsDown.doc.mjs +1 -1
- package/assets/icons/definitions/thumbsUp.doc.mjs +1 -1
- package/assets/icons/definitions/trendDown.doc.mjs +7 -1
- package/assets/icons/definitions/trendUp.doc.mjs +1 -1
- package/assets/icons/definitions/undo.doc.mjs +1 -1
- package/assets/icons/definitions/upload.doc.mjs +1 -1
- package/assets/icons/definitions/userAdd.doc.mjs +1 -1
- package/assets/icons/definitions/warning.doc.mjs +1 -1
- package/assets/templates/blocks/components/Tokenizer/TokenizerClear.tsx +15 -14
- package/assets/templates/blocks/components/Tokenizer/TokenizerCreatable.tsx +30 -30
- package/assets/templates/blocks/components/Tokenizer/TokenizerEndContent.tsx +15 -14
- package/assets/templates/blocks/components/Tokenizer/TokenizerIcon.tsx +15 -14
- package/assets/templates/blocks/components/Tokenizer/TokenizerMaxEntries.tsx +17 -16
- package/assets/templates/blocks/components/Tokenizer/TokenizerOverflow.tsx +29 -29
- package/assets/templates/blocks/components/Tokenizer/TokenizerShowcase.tsx +9 -8
- package/assets/templates/blocks/components/Tokenizer/TokenizerStates.tsx +39 -41
- package/assets/templates/pages/canvas-editor/template.doc.mjs +9 -0
- package/assets/templates/pages/form-wizard-inline/template.doc.mjs +6 -1
- package/assets/templates/pages/table-comparison/template.doc.mjs +1 -0
- package/assets/templates/pages/table-tree/template.doc.mjs +3 -0
- package/authoring/doctypes/icon-definition/icon-definition.doc.mjs +4 -4
- package/authoring/doctypes/icon-set/icon-set-data.doc.mjs +6 -0
- package/authoring/doctypes/icon-set/parse.d.mts +1 -0
- package/authoring/doctypes/icon-set/parse.mjs +1 -0
- package/authoring/doctypes/icon-set/type.ts +5 -0
- package/authoring/doctypes/template/template.doc.mjs +1 -1
- package/authoring/doctypes/template/type.ts +2 -1
- package/clients/cli/commands/doctor.mjs +16 -17
- package/clients/cli/commands/experimental/icon.mjs +167 -35
- package/clients/cli/commands/experimental-icon-add.doc.mjs +14 -4
- package/clients/cli/commands/experimental-icon-map.doc.mjs +12 -2
- package/clients/cli/commands/experimental-icon-new-definition.doc.mjs +1 -1
- package/clients/cli/commands/experimental-icon-new-set.doc.mjs +28 -1
- package/clients/cli/commands/experimental-icon.doc.mjs +18 -2
- package/clients/cli/commands/experimental.doc.mjs +2 -1
- package/clients/cli/commands/icon-authoring.test.mjs +1823 -13
- package/clients/cli/commands/icon-options-wiring.test.mjs +158 -0
- package/clients/cli/commands/icon.test.mjs +1 -1
- package/clients/cli/commands/template.mjs +4 -1
- package/foundation/discovery/component-discovery.d.mts +2 -1
- package/foundation/discovery/component-discovery.export-names.test.mjs +41 -0
- package/foundation/discovery/component-discovery.mjs +13 -7
- package/foundation/discovery/icon-set-checks.d.mts +43 -9
- package/foundation/discovery/icon-set-checks.mjs +296 -21
- package/foundation/discovery/icon-set-checks.test.mjs +125 -12
- package/foundation/discovery/icon-set-writer.d.mts +192 -3
- package/foundation/discovery/icon-set-writer.mjs +608 -34
- package/foundation/discovery/icon-set-writer.test.mjs +26 -0
- package/foundation/discovery/module-exports.mjs +82 -25
- package/foundation/discovery/module-exports.test.mjs +38 -1
- package/foundation/discovery/package-exports.d.mts +13 -0
- package/foundation/discovery/package-exports.mjs +40 -1
- package/foundation/discovery/template-icons.d.mts +6 -0
- package/foundation/discovery/template-icons.mjs +98 -10
- package/foundation/discovery/template-icons.test.mjs +103 -0
- package/foundation/doc-compiler/tree.mjs +3 -1
- package/foundation/response/response-types.doc.mjs +25 -1
- package/foundation/text/string-utils.mjs +33 -0
- package/foundation/text/string-utils.test.mjs +17 -0
- package/package.json +9 -9
|
@@ -24,7 +24,7 @@ export const docs = {
|
|
|
24
24
|
'integration icons',
|
|
25
25
|
],
|
|
26
26
|
description:
|
|
27
|
-
'
|
|
27
|
+
'Ship an icon set: register each icon against an icon definition, so apps find icons by meaning and templates use your icons.',
|
|
28
28
|
sections: [
|
|
29
29
|
{
|
|
30
30
|
id: 'experimental',
|
|
@@ -42,7 +42,7 @@ export const docs = {
|
|
|
42
42
|
content: [
|
|
43
43
|
{
|
|
44
44
|
type: 'prose',
|
|
45
|
-
text: 'Astryx keeps a list of icon definitions: one file per meaning, like `close` or `delete` (`astryx docs cli/experimental/icon-definitions`). An icon set registers which of its icons draws each definition, in the `map` of its data file. Templates say which definition each of their icons draws, so a project that uses your set gets your icon for every definition you map. Every set maps the built-in definitions, the names Core renders itself.',
|
|
45
|
+
text: 'Astryx keeps a list of icon definitions: one file per meaning, like `close` or `delete` (`astryx docs cli/experimental/icon-definitions`). An icon set registers which of its icons draws each definition, in the `map` of its data file; one icon may draw several definitions (`file` and `document` can both be your `document` icon). Templates say which definition each of their icons draws, so a project that uses your set gets your icon for every definition you map. Every set maps the built-in definitions, the names Core renders itself.',
|
|
46
46
|
},
|
|
47
47
|
{
|
|
48
48
|
type: 'prose',
|
|
@@ -61,7 +61,11 @@ export const docs = {
|
|
|
61
61
|
},
|
|
62
62
|
{
|
|
63
63
|
type: 'prose',
|
|
64
|
-
text: "`outline.doc.mjs` is the descriptor: name, display name
|
|
64
|
+
text: "`outline.doc.mjs` is the descriptor: name, display name and description (`--display-name`, `--description`), and `license`, the SPDX license of the artwork (it starts as your package's own). `outline.icons.json` starts with no icons and an empty `map`; its `module` is your package name. `outline.generated.js` is the set's generated module, with its declaration file `outline.generated.d.ts`: the CLI writes both, and every icon and the theme map are exports of it. Every field is in {@link schema:icon-set-doc} and {@link schema:icon-set-data}.",
|
|
65
|
+
},
|
|
66
|
+
{
|
|
67
|
+
type: 'prose',
|
|
68
|
+
text: "The set's icons import from your package by name, so your package's entry must re-export the generated module. The command writes only the set's own files: your entry, `exports`, `main`, `types`, `files`, peers, and scripts are yours, and the receipt names each change to make as text to copy. For an entry file in the package (and the declaration file package.json names) that is the line `export * from './icon-sets/outline/outline.generated.js';`, relative to it; for a package with no entry, `index.js` and `index.d.ts` with that line and the package.json `main`, `types`, and `exports` that name them; for a built or CommonJS entry, the line to add to the source it is built from. `integration check` names the same change until you make it, and the receipt also names the peers and the `typecheck` script to add. `integration check --strict` type-checks the set's doc files with your package's TypeScript; the receipt says when it is missing (`npm install -D typescript@6`).",
|
|
65
69
|
},
|
|
66
70
|
],
|
|
67
71
|
},
|
|
@@ -71,7 +75,7 @@ export const docs = {
|
|
|
71
75
|
content: [
|
|
72
76
|
{
|
|
73
77
|
type: 'prose',
|
|
74
|
-
text: 'Pick an icon from the library and ask which definitions fit it. Nothing is written yet:',
|
|
78
|
+
text: 'Pick an icon from the library and ask which definitions fit it. Nothing is written yet. To read every icon a set already has, one line each with its words and the definitions it draws, run `astryx experimental icon --set <set> --all-icons`; `astryx experimental icon <set>/<id>` reads one, or says the id does not exist:',
|
|
75
79
|
},
|
|
76
80
|
{
|
|
77
81
|
type: 'code',
|
|
@@ -98,11 +102,11 @@ export const docs = {
|
|
|
98
102
|
{
|
|
99
103
|
type: 'code',
|
|
100
104
|
lang: 'bash',
|
|
101
|
-
code: "astryx experimental icon add
|
|
105
|
+
code: "astryx experimental icon add Dice5 --from @acme/glyph-library --new-definition random --description 'Pick something at random.' --words dice,shuffle,chance",
|
|
102
106
|
},
|
|
103
107
|
{
|
|
104
108
|
type: 'prose',
|
|
105
|
-
text: '`experimental icon map <definition> <icon>` points a definition at an icon the set already has, and `--remove` drops an entry. `experimental icon new-definition <name> --description ... --words ... --icon <id>` adds your own definition for an icon you already have.',
|
|
109
|
+
text: '`experimental icon map <definition> <icon>` points a definition at an icon the set already has (a definition is named in camelCase, `eyeSlash`, or by the kebab id the definitions list shows, `eye-slash`; an icon by its id, its export name in any case, or another name its library exports it as, such as `trash-2`, never by one word of its id), `experimental icon map --pairs close=x-mark,search=magnifying-glass` writes many entries at once (checked together, all or none; an entry the map already has is replaced, and the receipt shows what it was), and `--remove` drops an entry. `experimental icon new-definition <name> --description ... --words ... --icon <id>` adds your own definition for an icon you already have. `experimental icon --definitions` lists every Astryx definition, built in or not, with its words (`--json` for a script).',
|
|
106
110
|
},
|
|
107
111
|
],
|
|
108
112
|
},
|
|
@@ -117,11 +121,29 @@ export const docs = {
|
|
|
117
121
|
},
|
|
118
122
|
{
|
|
119
123
|
type: 'prose',
|
|
120
|
-
text: "Every component the library exports becomes an icon (an alias of one component is recorded once), named `<Name>Icon`,
|
|
124
|
+
text: "Every component the library exports becomes an icon (an alias of one component is recorded once), named `<Name>Icon`, with an id from its name (`Squares2X2Icon` is `squares-2x2`: a dimension stays one word). `map` is filled only where a definition's name is an icon's id (`delete` → icon `delete`), and the receipt lists those entries under Mapped by name: a library can draw another meaning under the same name (one library's `delete` is a backspace key), so check each. An icon whose id is only one of a definition's words (`trash` for `delete`) may mean something else in this library, so the receipt lists it under Suggestions, with the `experimental icon map <definition> <icon>` command for each, and writes nothing for it: check the meaning, then run the ones that fit. Run it again after a library release to refresh the icons that library supplies; `map` entries whose icon still exists are kept, and the receipt names any icon the library dropped, any icon `--exclude` left out, and the `map` entries each took with it. Icons you added from your own files or another library are left as they are. An icon you already have is known by the library export it re-exports, so it keeps its export name exactly, its `map` entries, variants, and words, even when a newer CLI spells its id differently or your `--exclude` lets a library prefix come off new ids; the receipt lists each changed id under `renamed`. A refresh with `--dry-run` writes nothing and prints the Mapped by name and Suggestions lists again; `--display-name` and `--description` on a refresh rewrite the descriptor. Variants added with `add --variant … --all` are kept too; run that `add` again to pick up icons the release added. `experimental icon --list` shows how many definitions the set maps.",
|
|
125
|
+
},
|
|
126
|
+
{
|
|
127
|
+
type: 'prose',
|
|
128
|
+
text: "With a package or package subpath, it also records the installed library and version as the data file's `source`, so `integration check` warns when your dependency moves to another version; copies the library's LICENSE (and NOTICE) files into the set directory; and sets the descriptor's `license` to the library's. A set you started without `--from` gets the same the first time a refresh records its source, unless you already changed `license`: a `license` you set is kept (the receipt names the library's), and every later refresh keeps it too. Your package.json `license` is never changed. Edit `license` when the artwork's license differs from the library's package license.",
|
|
121
129
|
},
|
|
122
130
|
{
|
|
123
131
|
type: 'prose',
|
|
124
|
-
text: 'A library
|
|
132
|
+
text: 'A library with a module per style supplies variants. Declare them when you create the set, then add a variant for every icon in one run:',
|
|
133
|
+
},
|
|
134
|
+
{
|
|
135
|
+
type: 'code',
|
|
136
|
+
lang: 'bash',
|
|
137
|
+
code: `astryx experimental icon new-set heroicons --from @heroicons/react/24/outline --variants outline,solid --default-variant outline --description 'Heroicons, outline and solid.'
|
|
138
|
+
astryx experimental icon add --variant solid --from @heroicons/react/24/solid --all`,
|
|
139
|
+
},
|
|
140
|
+
{
|
|
141
|
+
type: 'prose',
|
|
142
|
+
text: "A library that redraws its artwork for small sizes (Heroicons' 20px mini and 16px micro) ships each of those as its own set in its own package (their export names match the 24px ones), not as variants: a variant's size comes from CSS. `--variants` lists the variants; `--default-variant` names the one each icon's own export draws (the first variant when omitted). `--all` adds the variant for every icon whose id an export of `--from` has (`TrashIcon` in the solid module becomes `TrashSolidIcon`, the solid variant of `trash`), and the receipt lists the icons the module has no export for. Running it again changes nothing.",
|
|
143
|
+
},
|
|
144
|
+
{
|
|
145
|
+
type: 'prose',
|
|
146
|
+
text: 'A library whose icons are data (objects or SVG strings) has no components to find: create the set, declare an `adapter` in its data file (see library shapes), and run the command again; every data export then becomes an icon through the adapter. When every icon export shares a leading word, such as `feather` in `featherEye` and `featherSun`, ids and export names leave it out: `featherEye` becomes id `eye`, exported as `EyeIcon`. The prefix is read over icon-like exports only: SCREAMING_CASE constants (`README`, `VERSION`), number and boolean exports, and, next to components or icon objects, plain strings are never icons. Components named `…Provider` or `…Context` are never icons either. Leave out any other export that is not an icon with `--exclude meta,version`: the data file keeps the list in `exclude`, so a refresh leaves them out too. When a library exports one icon under several names (`Trash2` and `Trash`), the icon is recorded once and its other names become words, so `experimental icon trash-2` finds it and `experimental icon map delete trash-2` maps it. `experimental icon add` reads the prefix the same way, and reuses the icon an export already has, so its commands need no `--id`.',
|
|
125
147
|
},
|
|
126
148
|
],
|
|
127
149
|
},
|
|
@@ -146,7 +168,7 @@ export const docs = {
|
|
|
146
168
|
},
|
|
147
169
|
{
|
|
148
170
|
type: 'prose',
|
|
149
|
-
text: "`experimental icon add` writes the set's generated module (`generated` in the data file) and its declaration file, which re-exports each component's own types and types each adapted icon as `ComponentType<SVGProps<SVGSVGElement>>`. Add
|
|
171
|
+
text: "`experimental icon add` writes the set's generated module (`generated` in the data file) and its declaration file, which re-exports each component's own types and types each adapted icon as `ComponentType<SVGProps<SVGSVGElement>>`. Add this line to your package's entry and its types; `experimental icon new-set` names the exact line and file in its receipt (see add an icon set):",
|
|
150
172
|
},
|
|
151
173
|
{
|
|
152
174
|
type: 'code',
|
|
@@ -155,7 +177,7 @@ export const docs = {
|
|
|
155
177
|
},
|
|
156
178
|
{
|
|
157
179
|
type: 'prose',
|
|
158
|
-
text:
|
|
180
|
+
text: "An optional render test you can copy. Save it inside your package directory and run it there, since it imports your package by name through its `exports`, and install `react-dom` first (`npm install -D react-dom`). A library may add its own classes beside yours, so it checks the class list. A library that sets `width` and `height` attributes (24, say) still fills its box: CSS sizing, such as the `Icon` component's, overrides SVG size attributes.",
|
|
159
181
|
},
|
|
160
182
|
{
|
|
161
183
|
type: 'code',
|
|
@@ -167,7 +189,7 @@ import * as icons from '@acme/icons';
|
|
|
167
189
|
for (const [name, Icon] of Object.entries(icons)) {
|
|
168
190
|
if (!name.endsWith('Icon')) continue;
|
|
169
191
|
const html = renderToStaticMarkup(createElement(Icon, {className: 'x'}));
|
|
170
|
-
if (
|
|
192
|
+
if (!/class="([^"]* )?x( [^"]*)?"/.test(html)) throw new Error(\`\${name} drops className\`);
|
|
171
193
|
if (!html.includes('currentColor')) throw new Error(\`\${name} has a fixed color\`);
|
|
172
194
|
}`,
|
|
173
195
|
},
|
|
@@ -191,7 +213,7 @@ for (const [name, Icon] of Object.entries(icons)) {
|
|
|
191
213
|
],
|
|
192
214
|
[
|
|
193
215
|
'A subpath per style',
|
|
194
|
-
'`experimental icon add Bin --from @acme/glyph-library/solid --id bin --variant solid`
|
|
216
|
+
'`experimental icon add --variant solid --from @acme/glyph-library/solid --all` for every icon at once, or `experimental icon add Bin --from @acme/glyph-library/solid --id bin --variant solid` for one (the set must declare the variant: `new-set --variants`)',
|
|
195
217
|
],
|
|
196
218
|
[
|
|
197
219
|
'One file per icon, default export',
|
|
@@ -207,7 +229,7 @@ for (const [name, Icon] of Object.entries(icons)) {
|
|
|
207
229
|
],
|
|
208
230
|
[
|
|
209
231
|
'Your own component files',
|
|
210
|
-
|
|
232
|
+
"`experimental icon add Rocket --from ./src/icons/rocket.js --definition rocket`, and `--id rocket --variant solid` for its other looks. The file exports a component named as written (no library prefix is taken off), with a declaration file beside it (`rocket.d.ts`) or written in TypeScript, since the set's types re-export its own; when package.json lists `files` and none covers it, the receipt names the `files` array that publishes its folder.",
|
|
211
233
|
],
|
|
212
234
|
],
|
|
213
235
|
},
|
|
@@ -258,7 +280,7 @@ export const brand = defineTheme({name: 'brand', icons: themeIcons});`,
|
|
|
258
280
|
content: [
|
|
259
281
|
{
|
|
260
282
|
type: 'prose',
|
|
261
|
-
text: "`astryx integration check` reads the set without running your icons. An unmapped built-in definition is an error that names the definition's description and words, so you or your agent can pick the icon
|
|
283
|
+
text: "`astryx integration check` reads the set without running your icons. An unmapped built-in definition is an error that names the definition's description and words and the `experimental icon map <definition> <icon id>` command that fixes it, so you or your agent can pick the icon. It names a search of your set (`experimental icon <word> --set <set>`) only when that search finds icons, and suggests one icon: the first of the suggestions `experimental icon new-set` gives for that definition. It never matches part of a word, and never writes a suggestion. Its icon-set codes:",
|
|
262
284
|
},
|
|
263
285
|
{
|
|
264
286
|
type: 'list',
|
|
@@ -286,7 +308,7 @@ export const brand = defineTheme({name: 'brand', icons: themeIcons});`,
|
|
|
286
308
|
},
|
|
287
309
|
{
|
|
288
310
|
type: 'prose',
|
|
289
|
-
text: 'Errors fail the check. Warnings fail only with `--strict`. A set that maps every built-in definition and every definition it declares passes `--strict`, which integrations run in their build ({@link generic:checks}). The flow, start to finish: `experimental icon new-set` → `integration check` → `experimental icon add` (or `experimental icon map`) for each definition it lists → `integration check` passes.',
|
|
311
|
+
text: 'Errors fail the check. Warnings fail only with `--strict`. A set that maps every built-in definition and every definition it declares passes `--strict`, which integrations run in their build ({@link generic:checks}). The flow, start to finish: `experimental icon new-set` → `npm install -D typescript@6` when the receipt asks → `integration check` → `experimental icon add` (or `experimental icon map`) for each definition it lists → `integration check` passes.',
|
|
290
312
|
},
|
|
291
313
|
],
|
|
292
314
|
},
|
|
@@ -299,8 +321,12 @@ export const brand = defineTheme({name: 'brand', icons: themeIcons});`,
|
|
|
299
321
|
style: 'unordered',
|
|
300
322
|
items: [
|
|
301
323
|
'Run `astryx integration verify` yourself before publishing. Do not put it in `prepublishOnly`: under `npm publish --dry-run` its own `npm pack` becomes a dry run too, and it checks nothing.',
|
|
302
|
-
"Declare `@astryxdesign/cli` as an optional peer (`peerDependenciesMeta`). A required peer an app cannot satisfy makes npm remove the app's CLI without a word. Icon sets are experimental, so no version range promises them
|
|
303
|
-
|
|
324
|
+
"Declare `@astryxdesign/cli` as an optional peer (`peerDependenciesMeta`). A required peer an app cannot satisfy makes npm remove the app's CLI without a word. Icon sets are experimental, so no version range promises them, and the format may change in a patch release. A CLI reads a set only when it knows every key the set's data file uses: a key it does not know withdraws the set, naming the key. `exclude` is read only by a CLI whose data-file reference lists it ({@link schema:icon-set-data}); a set without `exclude` is read by every CLI that has `astryx experimental icon`. A CLI without it reads `experimental` as a manifest key it does not know: `astryx doctor` there warns that your package was published against a newer Astryx CLI, other commands print a one-line nudge to run it, and your icons, icon definitions, and template icon mapping do not appear ({@link generic:versioning}).",
|
|
325
|
+
"Every built-in definition needs an icon, because Core renders it. When your library has no icon with that exact meaning, map the closest one, or add your own artwork as a component file in your package (`experimental icon add <Name> --from ./src/icons/<name>.js --definition <definition>`; a ./ path is named as written). Artwork you draw is yours: note its license beside the library's, for example in a NOTICE file in the set directory.",
|
|
326
|
+
'The generated declaration file imports React types, so declare `@types/react` as an optional peer for TypeScript users.',
|
|
327
|
+
'Keep the wrapped library in `dependencies`: your generated module re-exports its components, so apps get it with your package, and `integration check` compares its range with the version the data file records.',
|
|
328
|
+
"`integration check --strict` type-checks the set's doc files; it does not type-check the generated declaration file against React's types. Run `tsc` with `@types/react` installed to check those.",
|
|
329
|
+
'Your package needs `react` (the theme map and adapter use it) as a peer, as Core does. The `experimental icon new-set` receipt names the peers your package.json does not declare yet, as the JSON to add: `react` (`>=18`), and `@types/react` and `@astryxdesign/cli` (from the release that wrote the set) as optional peers; and the `typecheck` script (`astryx integration check --strict`) when there is none.',
|
|
304
330
|
],
|
|
305
331
|
},
|
|
306
332
|
],
|
|
@@ -329,7 +355,11 @@ astryx experimental icon use outline # make it the project's icon set`,
|
|
|
329
355
|
},
|
|
330
356
|
{
|
|
331
357
|
type: 'prose',
|
|
332
|
-
text: "A template declares, in its descriptor's `icons`, the definition each imported icon draws (`{TrashIcon: 'delete'}`). Once the project sets `experimental.iconSet` in astryx.config (`experimental icon use` writes it), each declared icon becomes the set's icon for that definition. An icon the set does not map keeps its original import, and the copy reports every icon as mapped or kept. Nothing is guessed from names.",
|
|
358
|
+
text: "A template declares, in its descriptor's `icons`, the definition each imported icon draws (`{TrashIcon: 'delete'}`). Once the project sets `experimental.iconSet` in astryx.config (`experimental icon use` writes it), each declared icon becomes the set's icon for that definition. An icon the set does not map keeps its original import, and the copy reports every icon as mapped or kept. Nothing is guessed from names. A mapped icon loses its library's sizing props (`size`, `strokeWidth`, `absoluteStrokeWidth`), since a set's icons take their size from CSS; the report names them as `dropped`. Comments on a rewritten import line are kept.",
|
|
359
|
+
},
|
|
360
|
+
{
|
|
361
|
+
type: 'prose',
|
|
362
|
+
text: "Each `icons` key is the name the template imports from its module, not a local alias. When a template imports the same name from two modules, such as `TrashIcon` from a library's outline and solid modules, one key covers both: both draw the same definition. Each then becomes the project set's variant of the same name when its module belongs to an installed set that declares the variant (so solid stays solid), else the set's default.",
|
|
333
363
|
},
|
|
334
364
|
],
|
|
335
365
|
},
|
|
@@ -363,11 +393,11 @@ astryx experimental icon use outline # make it the project's icon set`,
|
|
|
363
393
|
],
|
|
364
394
|
[
|
|
365
395
|
'`astryx doctor`',
|
|
366
|
-
'
|
|
396
|
+
'In an app, the `icon-sets` check: fails when `experimental.iconSet` names a set that is not installed or was withdrawn (an invalid set, or one whose module does not resolve), saying why, and warns when two packages ship a set by that name or a set was withdrawn. In your icon-set package, check with `astryx integration check` instead: plain `doctor` diagnoses an app.',
|
|
367
397
|
],
|
|
368
398
|
[
|
|
369
399
|
'JSON types',
|
|
370
|
-
'`icon.search`, `icon.detail`, `icon.list`, `icon.use`, `icon.map`, `icon.add`, `icon.definitionMatches`, `icon.newSet`, and `icon.newDefinition`, from the matching `astryx experimental icon` command.',
|
|
400
|
+
'`icon.search`, `icon.detail`, `icon.list`, `icon.setIcons`, `icon.definitions`, `icon.use`, `icon.map`, `icon.mapMany`, `icon.add`, `icon.addVariants`, `icon.definitionMatches`, `icon.newSet`, and `icon.newDefinition`, from the matching `astryx experimental icon` command.',
|
|
371
401
|
],
|
|
372
402
|
],
|
|
373
403
|
},
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
// Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
2
|
+
|
|
3
|
+
/** @type {import('@astryxdesign/cli/authoring').IconDefinitionDoc} */
|
|
4
|
+
export default {
|
|
5
|
+
type: 'icon-definition',
|
|
6
|
+
name: 'alignCenter',
|
|
7
|
+
description: 'Center text or items.',
|
|
8
|
+
words: ['center align', 'centre', 'text align'],
|
|
9
|
+
};
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
// Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
2
|
+
|
|
3
|
+
/** @type {import('@astryxdesign/cli/authoring').IconDefinitionDoc} */
|
|
4
|
+
export default {
|
|
5
|
+
type: 'icon-definition',
|
|
6
|
+
name: 'alignEnd',
|
|
7
|
+
description:
|
|
8
|
+
'Align text or items to the end edge: the right in a left-to-right layout, the left in a right-to-left one.',
|
|
9
|
+
words: ['align end', 'right align', 'justify right', 'text align'],
|
|
10
|
+
};
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
// Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
2
|
+
|
|
3
|
+
/** @type {import('@astryxdesign/cli/authoring').IconDefinitionDoc} */
|
|
4
|
+
export default {
|
|
5
|
+
type: 'icon-definition',
|
|
6
|
+
name: 'alignStart',
|
|
7
|
+
description:
|
|
8
|
+
'Align text or items to the start edge: the left in a left-to-right layout, the right in a right-to-left one.',
|
|
9
|
+
words: ['align start', 'left align', 'justify left', 'text align'],
|
|
10
|
+
};
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
// Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
2
|
+
|
|
3
|
+
/** @type {import('@astryxdesign/cli/authoring').IconDefinitionDoc} */
|
|
4
|
+
export default {
|
|
5
|
+
type: 'icon-definition',
|
|
6
|
+
name: 'cpu',
|
|
7
|
+
description: 'A processor or compute resource.',
|
|
8
|
+
words: ['processor', 'chip', 'compute', 'hardware'],
|
|
9
|
+
};
|
|
@@ -5,6 +5,12 @@ export default {
|
|
|
5
5
|
type: 'icon-definition',
|
|
6
6
|
name: 'externalLink',
|
|
7
7
|
description: 'Open a link in a new tab or another site.',
|
|
8
|
-
words: [
|
|
8
|
+
words: [
|
|
9
|
+
'open',
|
|
10
|
+
'new tab',
|
|
11
|
+
'external',
|
|
12
|
+
'arrow top right on square',
|
|
13
|
+
'square arrow out up right',
|
|
14
|
+
],
|
|
9
15
|
builtIn: true,
|
|
10
16
|
};
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
// Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
2
|
+
|
|
3
|
+
/** @type {import('@astryxdesign/cli/authoring').IconDefinitionDoc} */
|
|
4
|
+
export default {
|
|
5
|
+
type: 'icon-definition',
|
|
6
|
+
name: 'flipHorizontal',
|
|
7
|
+
description: 'Mirror an image or shape left to right.',
|
|
8
|
+
words: ['mirror', 'flip', 'reflect'],
|
|
9
|
+
};
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
// Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
2
|
+
|
|
3
|
+
/** @type {import('@astryxdesign/cli/authoring').IconDefinitionDoc} */
|
|
4
|
+
export default {
|
|
5
|
+
type: 'icon-definition',
|
|
6
|
+
name: 'flipVertical',
|
|
7
|
+
description: 'Mirror an image or shape top to bottom.',
|
|
8
|
+
words: ['mirror', 'flip', 'upside down'],
|
|
9
|
+
};
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
// Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
2
|
+
|
|
3
|
+
/** @type {import('@astryxdesign/cli/authoring').IconDefinitionDoc} */
|
|
4
|
+
export default {
|
|
5
|
+
type: 'icon-definition',
|
|
6
|
+
name: 'gitBranch',
|
|
7
|
+
description: 'A branch of a code repository.',
|
|
8
|
+
words: ['branch', 'version control', 'repository'],
|
|
9
|
+
};
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
// Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
2
|
+
|
|
3
|
+
/** @type {import('@astryxdesign/cli/authoring').IconDefinitionDoc} */
|
|
4
|
+
export default {
|
|
5
|
+
type: 'icon-definition',
|
|
6
|
+
name: 'gitFork',
|
|
7
|
+
description: 'A fork: a copy of a repository someone develops separately.',
|
|
8
|
+
words: ['fork', 'repository', 'version control'],
|
|
9
|
+
};
|
|
@@ -5,5 +5,5 @@ export default {
|
|
|
5
5
|
type: 'icon-definition',
|
|
6
6
|
name: 'notificationOff',
|
|
7
7
|
description: 'Turn notifications off, or show that they are muted.',
|
|
8
|
-
words: ['mute', 'silence', 'notifications off'],
|
|
8
|
+
words: ['mute', 'silence', 'notifications off', 'bell slash', 'bell off'],
|
|
9
9
|
};
|