@astryxdesign/cli 0.7.4 → 0.7.5-canary.0026f37
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/component/_adapter.mjs +16 -1
- package/api/component/component.test.mjs +31 -0
- package/api/discover/_adapter.d.mts +1 -1
- package/api/docs/_adapter.d.mts +5 -2
- package/api/docs/_adapter.mjs +24 -16
- package/api/docs/docs.test.mjs +18 -0
- package/api/docs/integrationDocs.test.mjs +2 -2
- package/api/experimental.d.mts +5 -0
- package/api/experimental.mjs +15 -0
- package/api/hook/list/list.d.mts +1 -1
- 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/pack-check.lifecycle-output.test.mjs +24 -1
- package/api/integration/pack-check.mjs +10 -4
- package/api/integration/pack-check.test.mjs +5 -1
- package/api/integration/validate-integration.type.d.mts +3 -2
- package/api/integration/validate-integration.type.mjs +3 -2
- package/api/render/_adapter.d.mts +28 -0
- package/api/render/_adapter.mjs +540 -0
- package/api/render/render.d.mts +15 -0
- package/api/render/render.doc.d.mts +9 -0
- package/api/render/render.doc.mjs +112 -0
- package/api/render/render.mjs +113 -0
- package/api/render/render.test.mjs +1155 -0
- package/api/render/render.type.d.mts +74 -0
- package/api/render/render.type.mjs +64 -0
- package/api/search/_adapter.test.mjs +21 -2
- package/api/search/_result.d.mts +5 -5
- package/api/search/search.d.mts +1 -1
- package/api/template/template.mjs +3 -1
- package/api/template/template.type.d.mts +2 -1
- package/api/template/template.type.mjs +1 -1
- package/api/template/unknown-name.test.mjs +63 -0
- package/assets/codemods/transforms/v0.7.0/__tests__/validate-data-token-ownership.test.mjs +123 -70
- package/assets/codemods/transforms/v0.7.0/validate-data-token-ownership.mjs +19 -77
- 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/docs/tree/render-pages.doc.mjs +94 -0
- 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/debug/parse.d.mts +2 -2
- 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/index.mjs +2 -0
- package/clients/cli/commands/experimental/render.mjs +113 -0
- 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-render.doc.mjs +60 -0
- package/clients/cli/commands/experimental.doc.mjs +4 -2
- 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/clients/cli/commands/text-json-parity.test.mjs +46 -0
- package/clients/cli/index.mjs +1 -0
- 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/doc-loads.test.mjs +20 -5
- package/foundation/doc-compiler/import.mjs +81 -8
- package/foundation/doc-compiler/read.d.mts +4 -3
- package/foundation/doc-compiler/read.mjs +15 -10
- package/foundation/doc-compiler/read.test.mjs +59 -1
- package/foundation/doc-compiler/tree.mjs +3 -1
- package/foundation/fs/module-loader.d.mts +3 -2
- package/foundation/fs/module-loader.mjs +3 -2
- package/foundation/fs/publish-file-eperm-mutation.test.mjs +2 -0
- package/foundation/fs/read-record.d.mts +27 -0
- package/foundation/fs/read-record.mjs +83 -15
- package/foundation/fs/read-record.test.mjs +88 -1
- package/foundation/render/assets.d.mts +31 -0
- package/foundation/render/assets.mjs +102 -0
- package/foundation/render/component-map.d.mts +52 -0
- package/foundation/render/component-map.mjs +141 -0
- package/foundation/render/css-cut.d.mts +29 -0
- package/foundation/render/css-cut.mjs +144 -0
- package/foundation/render/embedded-files.d.mts +28 -0
- package/foundation/render/embedded-files.mjs +108 -0
- package/foundation/render/embedded-imports.d.mts +61 -0
- package/foundation/render/embedded-imports.mjs +315 -0
- package/foundation/render/html-reader.d.mts +37 -0
- package/foundation/render/html-reader.mjs +121 -0
- package/foundation/render/page-worker.d.mts +7 -0
- package/foundation/render/page-worker.mjs +519 -0
- package/foundation/render/rebuild.d.mts +19 -0
- package/foundation/render/rebuild.mjs +269 -0
- package/foundation/render/render-page.d.mts +85 -0
- package/foundation/render/render-page.mjs +612 -0
- package/foundation/render/render.test.mjs +117 -0
- package/foundation/render/source-block.d.mts +52 -0
- package/foundation/render/source-block.mjs +106 -0
- package/foundation/response/error-codes.d.mts +10 -1
- package/foundation/response/error-codes.doc.mjs +56 -0
- package/foundation/response/error-codes.mjs +61 -0
- package/foundation/response/response-types.doc.mjs +38 -1
- package/foundation/text/string-utils.mjs +33 -0
- package/foundation/text/string-utils.test.mjs +17 -0
- package/foundation/text/suggest-order.d.mts +17 -3
- package/foundation/text/suggest-order.mjs +58 -13
- package/foundation/text/suggest-order.test.mjs +53 -0
- package/package.json +14 -9
|
@@ -68,7 +68,7 @@ export function registerExperimentalIcon(group, program) {
|
|
|
68
68
|
fn: iconFn,
|
|
69
69
|
action: async (
|
|
70
70
|
/** @type {string[] | string | undefined} */ words,
|
|
71
|
-
/** @type {{list?: boolean, set?: string, limit?: string}} */ options,
|
|
71
|
+
/** @type {{list?: boolean, set?: string, limit?: string, allIcons?: boolean, definitions?: boolean}} */ options,
|
|
72
72
|
) => {
|
|
73
73
|
const json = program.opts().json || false;
|
|
74
74
|
const query = Array.isArray(words) ? words.join(' ') : words;
|
|
@@ -83,6 +83,8 @@ export function registerExperimentalIcon(group, program) {
|
|
|
83
83
|
list: options.list ?? false,
|
|
84
84
|
set: options.set,
|
|
85
85
|
limit,
|
|
86
|
+
allIcons: options.allIcons ?? false,
|
|
87
|
+
definitions: options.definitions ?? false,
|
|
86
88
|
});
|
|
87
89
|
} catch (e) {
|
|
88
90
|
const err =
|
|
@@ -100,13 +102,24 @@ export function registerExperimentalIcon(group, program) {
|
|
|
100
102
|
resultKind: 'mixed',
|
|
101
103
|
empty: result.data.matchCount === 0,
|
|
102
104
|
})
|
|
103
|
-
: result.type === 'icon.
|
|
105
|
+
: result.type === 'icon.definitions'
|
|
104
106
|
? resultSet({
|
|
105
|
-
count: result.data.
|
|
107
|
+
count: result.data.definitions.length,
|
|
106
108
|
resultKind: 'mixed',
|
|
107
|
-
empty: result.data.sets.length === 0,
|
|
108
109
|
})
|
|
109
|
-
:
|
|
110
|
+
: result.type === 'icon.setIcons'
|
|
111
|
+
? resultSet({
|
|
112
|
+
count: result.data.icons.length,
|
|
113
|
+
resultKind: 'mixed',
|
|
114
|
+
empty: result.data.icons.length === 0,
|
|
115
|
+
})
|
|
116
|
+
: result.type === 'icon.list'
|
|
117
|
+
? resultSet({
|
|
118
|
+
count: result.data.sets.length,
|
|
119
|
+
resultKind: 'mixed',
|
|
120
|
+
empty: result.data.sets.length === 0,
|
|
121
|
+
})
|
|
122
|
+
: resultSet({count: 1, resultKind: 'mixed', directMatch: true});
|
|
110
123
|
|
|
111
124
|
if (json) {
|
|
112
125
|
jsonOut(result);
|
|
@@ -114,6 +127,40 @@ export function registerExperimentalIcon(group, program) {
|
|
|
114
127
|
}
|
|
115
128
|
|
|
116
129
|
const run = getCliInvocation();
|
|
130
|
+
if (result.type === 'icon.definitions') {
|
|
131
|
+
const {definitions} = result.data;
|
|
132
|
+
emit(
|
|
133
|
+
section(
|
|
134
|
+
`Icon definitions (${definitions.length}, ${definitions.filter(each => each.builtIn).length} built-in)`,
|
|
135
|
+
),
|
|
136
|
+
list(
|
|
137
|
+
definitions.map(
|
|
138
|
+
each =>
|
|
139
|
+
`${each.name} [${each.builtIn ? 'built-in' : 'optional'}]: ${each.description} Words: ${each.words.join(', ')}.`,
|
|
140
|
+
),
|
|
141
|
+
),
|
|
142
|
+
text(
|
|
143
|
+
`Built-in definitions are the ones every set maps. Map one: ${run} experimental icon map <definition> <icon id>`,
|
|
144
|
+
),
|
|
145
|
+
);
|
|
146
|
+
return answered;
|
|
147
|
+
}
|
|
148
|
+
if (result.type === 'icon.setIcons') {
|
|
149
|
+
const {set, iconCount, icons} = result.data;
|
|
150
|
+
emit(
|
|
151
|
+
section(`Icons in ${set} (${iconCount})`),
|
|
152
|
+
// One line each, so a whole library reads at a glance:
|
|
153
|
+
// id, then its words, then the definitions it draws.
|
|
154
|
+
list(
|
|
155
|
+
icons.map(
|
|
156
|
+
each =>
|
|
157
|
+
`${each.id}: ${each.words.join(', ')}${each.definitions.length > 0 ? ` = ${each.definitions.join(', ')}` : ''}`,
|
|
158
|
+
),
|
|
159
|
+
),
|
|
160
|
+
text(`Map one: ${run} experimental icon map <definition> <id>`),
|
|
161
|
+
);
|
|
162
|
+
return answered;
|
|
163
|
+
}
|
|
117
164
|
if (result.type === 'icon.search') {
|
|
118
165
|
const {query: q, matchCount, matches} = result.data;
|
|
119
166
|
if (matches.length === 0) {
|
|
@@ -129,13 +176,17 @@ export function registerExperimentalIcon(group, program) {
|
|
|
129
176
|
? `Icons for "${q}" (${matches.length} of ${matchCount})`
|
|
130
177
|
: `Icons for "${q}" (${matches.length})`,
|
|
131
178
|
),
|
|
132
|
-
//
|
|
133
|
-
// with
|
|
179
|
+
// The import draws the icon's default look; its other variants
|
|
180
|
+
// are named with their exports and read with `icon <set>/<id>`.
|
|
134
181
|
records(
|
|
135
182
|
matches.map(({variants, ...match}) => ({
|
|
136
183
|
...match,
|
|
137
184
|
...(variants.length > 0
|
|
138
|
-
? {
|
|
185
|
+
? {
|
|
186
|
+
variant: variants
|
|
187
|
+
.map(each => `${each.variant} (${each.export})`)
|
|
188
|
+
.join(', '),
|
|
189
|
+
}
|
|
139
190
|
: {}),
|
|
140
191
|
})),
|
|
141
192
|
{
|
|
@@ -175,7 +226,7 @@ export function registerExperimentalIcon(group, program) {
|
|
|
175
226
|
}),
|
|
176
227
|
...(variants.length > 0
|
|
177
228
|
? [
|
|
178
|
-
section('
|
|
229
|
+
section('Other variants'),
|
|
179
230
|
records(variants, {
|
|
180
231
|
fields: ['variant', 'module', 'export', 'import'],
|
|
181
232
|
}),
|
|
@@ -239,6 +290,18 @@ export function registerExperimentalIcon(group, program) {
|
|
|
239
290
|
},
|
|
240
291
|
});
|
|
241
292
|
|
|
293
|
+
/**
|
|
294
|
+
* The set an authoring subcommand edits. `experimental icon` declares
|
|
295
|
+
* `--set` too, so Commander gives the parent a `--set` written after a
|
|
296
|
+
* subcommand's name; the subcommand reads it there.
|
|
297
|
+
* @param {{set?: unknown}} options the subcommand's own options
|
|
298
|
+
* @returns {string | undefined}
|
|
299
|
+
*/
|
|
300
|
+
const setOf = options => {
|
|
301
|
+
const value = options.set ?? iconCli.opts().set;
|
|
302
|
+
return typeof value === 'string' ? value : undefined;
|
|
303
|
+
};
|
|
304
|
+
|
|
242
305
|
/**
|
|
243
306
|
* Run one authoring call and print its receipt, or its error.
|
|
244
307
|
* @param {() => Promise<any>} call
|
|
@@ -284,36 +347,51 @@ export function registerExperimentalIcon(group, program) {
|
|
|
284
347
|
defineCommand(iconCli, iconMapCommand, {
|
|
285
348
|
fn: iconMapFn,
|
|
286
349
|
action: (
|
|
287
|
-
/** @type {string} */ definition,
|
|
350
|
+
/** @type {string | undefined} */ definition,
|
|
288
351
|
/** @type {string | undefined} */ iconId,
|
|
289
|
-
/** @type {{set?: string, remove?: boolean}} */ options,
|
|
352
|
+
/** @type {{set?: string, remove?: boolean, pairs?: string}} */ options,
|
|
290
353
|
) =>
|
|
291
354
|
run(
|
|
292
355
|
() =>
|
|
293
356
|
iconMap(definition, iconId, {
|
|
294
357
|
cwd: process.cwd(),
|
|
295
|
-
set: options
|
|
358
|
+
set: setOf(options),
|
|
296
359
|
remove: options.remove ?? false,
|
|
360
|
+
pairs: options.pairs,
|
|
297
361
|
}),
|
|
298
|
-
({data}) =>
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
362
|
+
(/** @type {any} */ {type, data}) =>
|
|
363
|
+
type === 'icon.mapMany'
|
|
364
|
+
? emit(
|
|
365
|
+
text(
|
|
366
|
+
`[ok] ${data.entries.filter((/** @type {{changed: boolean}} */ each) => each.changed).length} of ${data.entries.length} map entries changed in ${data.file}.`,
|
|
367
|
+
),
|
|
368
|
+
list(
|
|
369
|
+
data.entries.map(
|
|
370
|
+
(
|
|
371
|
+
/** @type {{definition: string, icon: string, previous: string | null}} */ each,
|
|
372
|
+
) =>
|
|
373
|
+
`${each.definition} = "${each.icon}"${each.previous && each.previous !== each.icon ? ` (was "${each.previous}")` : ''}`,
|
|
374
|
+
),
|
|
375
|
+
),
|
|
376
|
+
)
|
|
377
|
+
: emit(
|
|
378
|
+
text(
|
|
379
|
+
data.icon == null
|
|
380
|
+
? data.changed
|
|
381
|
+
? `[ok] Removed map.${data.definition} (was "${data.previous}") from ${data.file}.`
|
|
382
|
+
: `[ok] ${data.file} has no map.${data.definition}.`
|
|
383
|
+
: data.changed
|
|
384
|
+
? `[ok] map.${data.definition} = "${data.icon}" in ${data.file}${data.previous ? ` (was "${data.previous}")` : ''}.`
|
|
385
|
+
: `[ok] map.${data.definition} is already "${data.icon}".`,
|
|
386
|
+
),
|
|
387
|
+
),
|
|
310
388
|
),
|
|
311
389
|
});
|
|
312
390
|
|
|
313
391
|
defineCommand(iconCli, iconAddCommand, {
|
|
314
392
|
fn: iconAddFn,
|
|
315
393
|
action: (
|
|
316
|
-
/** @type {string} */ exportName,
|
|
394
|
+
/** @type {string | undefined} */ exportName,
|
|
317
395
|
/** @type {Record<string, string | boolean | undefined>} */ options,
|
|
318
396
|
) =>
|
|
319
397
|
run(
|
|
@@ -321,7 +399,7 @@ export function registerExperimentalIcon(group, program) {
|
|
|
321
399
|
iconAdd(exportName, {
|
|
322
400
|
cwd: process.cwd(),
|
|
323
401
|
from: /** @type {string} */ (options.from),
|
|
324
|
-
set:
|
|
402
|
+
set: setOf(options),
|
|
325
403
|
definition: /** @type {string | undefined} */ (options.definition),
|
|
326
404
|
newDefinition: /** @type {string | undefined} */ (
|
|
327
405
|
options.newDefinition
|
|
@@ -336,9 +414,27 @@ export function registerExperimentalIcon(group, program) {
|
|
|
336
414
|
useDefault: options.default === true,
|
|
337
415
|
variant: /** @type {string | undefined} */ (options.variant),
|
|
338
416
|
id: /** @type {string | undefined} */ (options.id),
|
|
417
|
+
all: options.all === true,
|
|
339
418
|
}),
|
|
340
419
|
result => {
|
|
341
420
|
const cli = getCliInvocation();
|
|
421
|
+
if (result.type === 'icon.addVariants') {
|
|
422
|
+
const {data} = result;
|
|
423
|
+
emit(
|
|
424
|
+
text(
|
|
425
|
+
`[ok] ${data.variant}: ${data.added} icons gained it${data.already > 0 ? `, ${data.already} already had it` : ''}, read from ${data.from}.`,
|
|
426
|
+
),
|
|
427
|
+
...(data.files.length > 0 ? [list(data.files)] : []),
|
|
428
|
+
...(data.missing.length > 0
|
|
429
|
+
? [
|
|
430
|
+
text(
|
|
431
|
+
`${data.missing.length} icons have no ${data.variant} export in ${data.from} and keep none: ${data.missing.join(', ')}`,
|
|
432
|
+
),
|
|
433
|
+
]
|
|
434
|
+
: []),
|
|
435
|
+
);
|
|
436
|
+
return;
|
|
437
|
+
}
|
|
342
438
|
if (result.type === 'icon.definitionMatches') {
|
|
343
439
|
const {matches, newDefinition} = result.data;
|
|
344
440
|
emit(
|
|
@@ -403,22 +499,54 @@ export function registerExperimentalIcon(group, program) {
|
|
|
403
499
|
) => {
|
|
404
500
|
const {root, manifest, files, written, dryRun} = data;
|
|
405
501
|
const state = dryRun ? 'plan' : written ? 'ok' : 'unchanged';
|
|
502
|
+
const refreshed = data.refreshed === true;
|
|
406
503
|
emit(
|
|
407
504
|
section(
|
|
408
|
-
|
|
409
|
-
?
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
|
|
505
|
+
refreshed
|
|
506
|
+
? dryRun
|
|
507
|
+
? `Refresh ${what} plan`
|
|
508
|
+
: `${what[0].toUpperCase()}${what.slice(1)} refreshed`
|
|
509
|
+
: dryRun
|
|
510
|
+
? `New ${what} plan`
|
|
511
|
+
: written
|
|
512
|
+
? `New ${what} added`
|
|
513
|
+
: `New ${what} unchanged`,
|
|
413
514
|
),
|
|
414
515
|
text(`[${state}] ${data.name}`),
|
|
516
|
+
// What the command did (or, in a dry run, would do): never a step
|
|
517
|
+
// left for the author.
|
|
415
518
|
text(
|
|
416
519
|
root != null
|
|
417
|
-
?
|
|
418
|
-
|
|
520
|
+
? root.created
|
|
521
|
+
? `${dryRun ? 'Would declare' : 'Declared'} the experimental.iconSets root ${root.path} in ${manifest}.`
|
|
522
|
+
: `The experimental.iconSets root ${root.path} in ${manifest} is unchanged.`
|
|
523
|
+
: `${dryRun ? 'Would update' : 'Updated'} ${manifest}.`,
|
|
419
524
|
),
|
|
420
525
|
...(files.length > 0 ? [list(files)] : []),
|
|
526
|
+
// What to do next comes before the long lists, so it never scrolls
|
|
527
|
+
// away.
|
|
421
528
|
...(data.notes ?? []).map(note => text(`[next] ${note}`)),
|
|
529
|
+
...(data.mapped && data.mapped.length > 0
|
|
530
|
+
? [
|
|
531
|
+
section(`Mapped by name (${data.mapped.length}, check each)`),
|
|
532
|
+
list(
|
|
533
|
+
data.mapped.map(each => `${each.definition} = ${each.icon}`),
|
|
534
|
+
),
|
|
535
|
+
]
|
|
536
|
+
: []),
|
|
537
|
+
...(data.suggestions && data.suggestions.length > 0
|
|
538
|
+
? [
|
|
539
|
+
section(
|
|
540
|
+
`Suggestions (${data.suggestions.length} for ${new Set(data.suggestions.map(each => each.definition)).size} definitions, not written)`,
|
|
541
|
+
),
|
|
542
|
+
list(
|
|
543
|
+
data.suggestions.map(
|
|
544
|
+
each =>
|
|
545
|
+
`${each.definition} -> ${each.icon} (${each.word}): ${formatCliCommand(`astryx experimental icon map ${each.definition} ${each.icon}`)}`,
|
|
546
|
+
),
|
|
547
|
+
),
|
|
548
|
+
]
|
|
549
|
+
: []),
|
|
422
550
|
);
|
|
423
551
|
};
|
|
424
552
|
|
|
@@ -426,7 +554,7 @@ export function registerExperimentalIcon(group, program) {
|
|
|
426
554
|
fn: iconNewSetFn,
|
|
427
555
|
action: (
|
|
428
556
|
/** @type {string} */ name,
|
|
429
|
-
/** @type {{dryRun?: boolean, from?: string, exclude?: string}} */ options,
|
|
557
|
+
/** @type {{dryRun?: boolean, from?: string, exclude?: string, variants?: string, defaultVariant?: string, displayName?: string, description?: string}} */ options,
|
|
430
558
|
) =>
|
|
431
559
|
run(
|
|
432
560
|
() =>
|
|
@@ -435,6 +563,10 @@ export function registerExperimentalIcon(group, program) {
|
|
|
435
563
|
dryRun: options.dryRun,
|
|
436
564
|
from: options.from,
|
|
437
565
|
exclude: options.exclude,
|
|
566
|
+
variants: options.variants,
|
|
567
|
+
defaultVariant: options.defaultVariant,
|
|
568
|
+
displayName: options.displayName,
|
|
569
|
+
description: options.description,
|
|
438
570
|
}),
|
|
439
571
|
printNew('icon set'),
|
|
440
572
|
),
|
|
@@ -451,7 +583,7 @@ export function registerExperimentalIcon(group, program) {
|
|
|
451
583
|
iconNewDefinition(name, {
|
|
452
584
|
cwd: process.cwd(),
|
|
453
585
|
dryRun: options.dryRun,
|
|
454
|
-
set: options
|
|
586
|
+
set: setOf(options),
|
|
455
587
|
description: options.description,
|
|
456
588
|
words: options.words,
|
|
457
589
|
icon: options.icon,
|
|
@@ -13,6 +13,7 @@ import {cliError} from '../../lib/cli-error.mjs';
|
|
|
13
13
|
import {defineCommand} from '../../lib/define-command.mjs';
|
|
14
14
|
import {doc as experimentalGroup} from '../experimental.doc.mjs';
|
|
15
15
|
import {registerExperimentalIcon} from './icon.mjs';
|
|
16
|
+
import {registerExperimentalRender} from './render.mjs';
|
|
16
17
|
|
|
17
18
|
/** @param {import('commander').Command} program */
|
|
18
19
|
export function registerExperimental(program) {
|
|
@@ -40,4 +41,5 @@ export function registerExperimental(program) {
|
|
|
40
41
|
},
|
|
41
42
|
});
|
|
42
43
|
registerExperimentalIcon(experimental, program);
|
|
44
|
+
registerExperimentalRender(experimental, program);
|
|
43
45
|
}
|
|
@@ -0,0 +1,113 @@
|
|
|
1
|
+
// Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* @file `astryx experimental render` — a page to one self-contained HTML
|
|
5
|
+
* file, and back. Experimental (spec:AST-017 FR27): it is registered only
|
|
6
|
+
* under the `experimental` group.
|
|
7
|
+
*
|
|
8
|
+
* The command surface comes from the colocated CommandDoc via
|
|
9
|
+
* `defineCommand`; this file reads flags, calls `render()`, and prints.
|
|
10
|
+
*
|
|
11
|
+
* Usage:
|
|
12
|
+
* astryx experimental render page.tsx --out page.html
|
|
13
|
+
* astryx experimental render --reverse page.html --out page.tsx
|
|
14
|
+
*/
|
|
15
|
+
|
|
16
|
+
import {getCliInvocation} from '../../../../foundation/env/package-manager.mjs';
|
|
17
|
+
import {jsonOut} from '../../../../foundation/response/json.mjs';
|
|
18
|
+
import {resultSet} from '../../../../foundation/debug/index.mjs';
|
|
19
|
+
import {emit, section, text, record, list} from '../../formatters/index.mjs';
|
|
20
|
+
import {cliError} from '../../lib/cli-error.mjs';
|
|
21
|
+
import {defineCommand} from '../../lib/define-command.mjs';
|
|
22
|
+
import {render as renderApi} from '../../../../api/render/render.mjs';
|
|
23
|
+
import {doc as renderCommand} from '../experimental-render.doc.mjs';
|
|
24
|
+
import {doc as renderFn} from '../../../../api/render/render.doc.mjs';
|
|
25
|
+
|
|
26
|
+
/** @param {number} n */
|
|
27
|
+
const kb = n => (n < 1024 ? `${n} B` : `${(n / 1024).toFixed(1)} KB`);
|
|
28
|
+
|
|
29
|
+
/**
|
|
30
|
+
* Register `render` under the `experimental` group.
|
|
31
|
+
* @param {import('commander').Command} group the `experimental` command
|
|
32
|
+
* @param {import('commander').Command} program the root program
|
|
33
|
+
*/
|
|
34
|
+
export function registerExperimentalRender(group, program) {
|
|
35
|
+
defineCommand(group, renderCommand, {
|
|
36
|
+
fn: renderFn,
|
|
37
|
+
action: async (
|
|
38
|
+
/** @type {string | undefined} */ file,
|
|
39
|
+
/** @type {{out?: string, reverse?: boolean, title?: string, overwrite?: boolean}} */ options,
|
|
40
|
+
) => {
|
|
41
|
+
const json = program.opts().json || false;
|
|
42
|
+
/** @type {Awaited<ReturnType<typeof renderApi>>} */
|
|
43
|
+
let result;
|
|
44
|
+
try {
|
|
45
|
+
result = await renderApi(file ?? '', {
|
|
46
|
+
cwd: process.cwd(),
|
|
47
|
+
out: options.out,
|
|
48
|
+
reverse: options.reverse ?? false,
|
|
49
|
+
title: options.title,
|
|
50
|
+
overwrite: options.overwrite ?? false,
|
|
51
|
+
});
|
|
52
|
+
} catch (e) {
|
|
53
|
+
const err = /** @type {import('../../../../api/error.mjs').AstryxError} */ (e);
|
|
54
|
+
return cliError(err.message, {suggestions: err.suggestions, code: err.code});
|
|
55
|
+
}
|
|
56
|
+
const answered = resultSet({count: 1, resultKind: 'mixed', directMatch: true});
|
|
57
|
+
if (json) {
|
|
58
|
+
jsonOut(result);
|
|
59
|
+
return answered;
|
|
60
|
+
}
|
|
61
|
+
const run = getCliInvocation();
|
|
62
|
+
if (result.type === 'render.page') {
|
|
63
|
+
const d = result.data;
|
|
64
|
+
emit(
|
|
65
|
+
section(`Rendered ${d.input}`),
|
|
66
|
+
record({
|
|
67
|
+
input: d.input,
|
|
68
|
+
output: d.output,
|
|
69
|
+
bytes: kb(d.bytes),
|
|
70
|
+
cssBytes: kb(d.cssBytes),
|
|
71
|
+
classes: d.classes,
|
|
72
|
+
images: d.images,
|
|
73
|
+
files: d.files.join(', '),
|
|
74
|
+
stylesheets: d.stylesheets.join(', ') || 'none',
|
|
75
|
+
}),
|
|
76
|
+
...(d.warnings.length > 0
|
|
77
|
+
? [section('Warnings'), list(d.warnings.map(w => w.message))]
|
|
78
|
+
: []),
|
|
79
|
+
text(`Give it back: ${run} experimental render --reverse ${d.output}`),
|
|
80
|
+
);
|
|
81
|
+
return answered;
|
|
82
|
+
}
|
|
83
|
+
const d = result.data;
|
|
84
|
+
emit(
|
|
85
|
+
section(d.mode === 'embedded' ? `Restored ${d.output}` : `Rebuilt ${d.output}`),
|
|
86
|
+
record({
|
|
87
|
+
input: d.input,
|
|
88
|
+
mode: d.mode,
|
|
89
|
+
exact: d.exact,
|
|
90
|
+
output: d.output,
|
|
91
|
+
files: d.files.join(', '),
|
|
92
|
+
...(d.missing?.length ? {missing: d.missing.join(', ')} : {}),
|
|
93
|
+
...(d.mode === 'rebuilt'
|
|
94
|
+
? {
|
|
95
|
+
components: (d.components ?? []).join(', ') || 'none',
|
|
96
|
+
elements: d.elements ?? 0,
|
|
97
|
+
...(d.omitted?.length ? {omitted: d.omitted.join(', ')} : {}),
|
|
98
|
+
...(d.unknown?.length ? {unknown: d.unknown.join(', ')} : {}),
|
|
99
|
+
}
|
|
100
|
+
: {}),
|
|
101
|
+
}),
|
|
102
|
+
...(d.mode === 'rebuilt'
|
|
103
|
+
? [
|
|
104
|
+
text(
|
|
105
|
+
'The file had no embedded source, so the page was rebuilt from its Astryx markup: text and layout only. Review it before use.',
|
|
106
|
+
),
|
|
107
|
+
]
|
|
108
|
+
: []),
|
|
109
|
+
);
|
|
110
|
+
return answered;
|
|
111
|
+
},
|
|
112
|
+
});
|
|
113
|
+
}
|
|
@@ -11,15 +11,15 @@ export const doc = {
|
|
|
11
11
|
stability: 'experimental',
|
|
12
12
|
summary: 'Register one icon you chose from a library in your icon set',
|
|
13
13
|
description:
|
|
14
|
-
"Run inside an icon-set package. You pick the export; the CLI proves it is a component of --from, read without running it, and never searches the library. Without a definition it lists the icon definitions that fit and the command for each. With --definition it adds the icon and maps the definition to it; --new-definition first adds your set's own definition. Experimental: it may change or be removed in a patch release.",
|
|
14
|
+
"Run inside an icon-set package. You pick the export; the CLI proves it is a component of --from, read without running it, and never searches the library. Without a definition it lists the icon definitions that fit and the command for each. With --definition it adds the icon and maps the definition to it; --new-definition first adds your set's own definition. With --variant <name> --from <module> --all and no export, it adds that variant for every icon whose id the module exports. Experimental: it may change or be removed in a patch release.",
|
|
15
15
|
fn: 'iconAdd',
|
|
16
|
-
args: [{name: 'export', param: 'exportName', required:
|
|
16
|
+
args: [{name: 'export', param: 'exportName', required: false}],
|
|
17
17
|
options: [
|
|
18
18
|
{
|
|
19
19
|
flag: '--from <module>',
|
|
20
20
|
param: 'options.from',
|
|
21
21
|
description:
|
|
22
|
-
'The module the icon is exported from: a package, a subpath, or a
|
|
22
|
+
'The module the icon is exported from: a package, a subpath, or a ./ path to a file inside this package',
|
|
23
23
|
},
|
|
24
24
|
{
|
|
25
25
|
flag: '--definition <name>',
|
|
@@ -55,6 +55,12 @@ export const doc = {
|
|
|
55
55
|
description:
|
|
56
56
|
"Add the export as this variant of an existing icon: one of the set's declared variants, such as solid",
|
|
57
57
|
},
|
|
58
|
+
{
|
|
59
|
+
flag: '--all',
|
|
60
|
+
param: 'options.all',
|
|
61
|
+
description:
|
|
62
|
+
'With --variant and --from, and no export: add that variant for every icon whose id the module exports, in one run',
|
|
63
|
+
},
|
|
58
64
|
{
|
|
59
65
|
flag: '--id <id>',
|
|
60
66
|
param: 'options.id',
|
|
@@ -75,9 +81,13 @@ export const doc = {
|
|
|
75
81
|
label: 'Add and map',
|
|
76
82
|
cli: 'astryx experimental icon add Bin --from @acme/glyph-library --definition delete',
|
|
77
83
|
},
|
|
84
|
+
{
|
|
85
|
+
label: 'Add the solid variant of every icon',
|
|
86
|
+
cli: 'astryx experimental icon add --variant solid --from @heroicons/react/24/solid --all',
|
|
87
|
+
},
|
|
78
88
|
{
|
|
79
89
|
label: 'Add your own definition',
|
|
80
|
-
cli: "astryx experimental icon add
|
|
90
|
+
cli: "astryx experimental icon add Dice5 --from @acme/glyph-library --new-definition random --description 'Pick something at random.' --words dice,shuffle,chance",
|
|
81
91
|
},
|
|
82
92
|
{
|
|
83
93
|
label: 'Add a solid variant',
|
|
@@ -11,10 +11,10 @@ export const doc = {
|
|
|
11
11
|
stability: 'experimental',
|
|
12
12
|
summary: 'Register which icon of your set draws an icon definition',
|
|
13
13
|
description:
|
|
14
|
-
"Run inside an icon-set package. Sets `map[<definition>]
|
|
14
|
+
"Run inside an icon-set package. Sets `map[<definition>]` to the icon's id in the set's data file; name the icon by its id, its export name in any case, or another name its library exports it as (`trash-2` or `Trash2`), never by one word of its id, and the definition by its name or kebab id; `integration check` prints these commands for definitions your set already has a fitting icon for. Experimental: it may change or be removed in a patch release.",
|
|
15
15
|
fn: 'iconMap',
|
|
16
16
|
args: [
|
|
17
|
-
{name: 'definition', param: 'definition', required:
|
|
17
|
+
{name: 'definition', param: 'definition', required: false},
|
|
18
18
|
{name: 'icon', param: 'icon', required: false},
|
|
19
19
|
],
|
|
20
20
|
options: [
|
|
@@ -28,12 +28,22 @@ export const doc = {
|
|
|
28
28
|
param: 'options.remove',
|
|
29
29
|
description: "Remove the definition's entry; takes no icon",
|
|
30
30
|
},
|
|
31
|
+
{
|
|
32
|
+
flag: '--pairs <list>',
|
|
33
|
+
param: 'options.pairs',
|
|
34
|
+
description:
|
|
35
|
+
'Many entries in one write: <definition>=<icon> pairs, comma-separated; checked together, all or none; an existing entry is replaced',
|
|
36
|
+
},
|
|
31
37
|
],
|
|
32
38
|
examples: [
|
|
33
39
|
{
|
|
34
40
|
label: 'Map a definition',
|
|
35
41
|
cli: 'astryx experimental icon map delete trash',
|
|
36
42
|
},
|
|
43
|
+
{
|
|
44
|
+
label: 'Map many at once',
|
|
45
|
+
cli: 'astryx experimental icon map --pairs close=x-mark,error=x-circle,search=magnifying-glass',
|
|
46
|
+
},
|
|
37
47
|
{
|
|
38
48
|
label: 'Remove an entry',
|
|
39
49
|
cli: 'astryx experimental icon map delete --remove',
|
|
@@ -51,7 +51,7 @@ export const doc = {
|
|
|
51
51
|
examples: [
|
|
52
52
|
{
|
|
53
53
|
label: "Add a set's own icon definition",
|
|
54
|
-
cli: "astryx experimental icon new-definition
|
|
54
|
+
cli: "astryx experimental icon new-definition random --description 'Pick something at random.' --words dice,shuffle,chance --icon dice-5",
|
|
55
55
|
},
|
|
56
56
|
],
|
|
57
57
|
outsideProject: 'refuse',
|
|
@@ -11,7 +11,7 @@ export const doc = {
|
|
|
11
11
|
stability: 'experimental',
|
|
12
12
|
summary: 'Start an icon set in your integration package',
|
|
13
13
|
description:
|
|
14
|
-
"Run inside an integration package. Writes the set's folder with its descriptor, its data file, and its generated module, and declares the manifest's `experimental.iconSets` root on first use. With --from it wraps every icon component of a library;
|
|
14
|
+
"Run inside an integration package. Writes the set's folder with its descriptor, its data file, and its generated module, and declares the manifest's `experimental.iconSets` root on first use. With --from it wraps every icon component of a library, records the library and its version as the set's source, copies its license notice, and maps each Astryx icon definition whose name is an icon's id; definitions an icon only shares a word with are listed as suggestions, never written. Run it again to refresh. --variants and --default-variant declare the set's variants. Experimental: it may change or be removed in a patch release.",
|
|
15
15
|
fn: 'iconNewSet',
|
|
16
16
|
args: [
|
|
17
17
|
{
|
|
@@ -39,6 +39,29 @@ export const doc = {
|
|
|
39
39
|
description:
|
|
40
40
|
'With --from: comma-separated export names of the library that are not icons',
|
|
41
41
|
},
|
|
42
|
+
{
|
|
43
|
+
flag: '--variants <list>',
|
|
44
|
+
param: 'options.variants',
|
|
45
|
+
description:
|
|
46
|
+
'Comma-separated variants the set supplies, such as outline,solid',
|
|
47
|
+
},
|
|
48
|
+
{
|
|
49
|
+
flag: '--default-variant <variant>',
|
|
50
|
+
param: 'options.defaultVariant',
|
|
51
|
+
description:
|
|
52
|
+
"With --variants: the variant each icon's own export draws (the first variant when omitted)",
|
|
53
|
+
},
|
|
54
|
+
{
|
|
55
|
+
flag: '--display-name <text>',
|
|
56
|
+
param: 'options.displayName',
|
|
57
|
+
description:
|
|
58
|
+
"The set's display name (the name in title case when omitted)",
|
|
59
|
+
},
|
|
60
|
+
{
|
|
61
|
+
flag: '--description <text>',
|
|
62
|
+
param: 'options.description',
|
|
63
|
+
description: "The set's one-line description",
|
|
64
|
+
},
|
|
42
65
|
],
|
|
43
66
|
examples: [
|
|
44
67
|
{
|
|
@@ -49,6 +72,10 @@ export const doc = {
|
|
|
49
72
|
label: 'Wrap a whole icon library',
|
|
50
73
|
cli: 'astryx experimental icon new-set outline --from @acme/glyph-library',
|
|
51
74
|
},
|
|
75
|
+
{
|
|
76
|
+
label: 'Wrap a library with two variants',
|
|
77
|
+
cli: 'astryx experimental icon new-set heroicons --from @heroicons/react/24/outline --variants outline,solid --default-variant outline',
|
|
78
|
+
},
|
|
52
79
|
{
|
|
53
80
|
label: 'Preview the files',
|
|
54
81
|
cli: 'astryx experimental icon new-set outline --dry-run --json',
|
|
@@ -14,9 +14,9 @@ export const doc = {
|
|
|
14
14
|
namespace: 'cli/commands',
|
|
15
15
|
stability: 'experimental',
|
|
16
16
|
summary:
|
|
17
|
-
'Find an icon by meaning
|
|
17
|
+
'Find an icon by meaning, or build an icon set from a library (guide: astryx docs cli/experimental/icon-sets)',
|
|
18
18
|
description:
|
|
19
|
-
"Terminal front-end to icon(): searches every installed icon set's data file by meaning and prints each match's import line. `<set>/<id>` reads one icon with every variant's import line; --list lists the installed sets and how many icon definitions each one maps. The subcommands author a set: `new-set` starts one in an integration package, `new-definition` adds the set's own icon definition, `add` registers an icon from a library, `map` points an icon definition at an icon, and `use` makes a set the project's. Experimental: it may change or be removed in a patch release.",
|
|
19
|
+
"Terminal front-end to icon(): searches every installed icon set's data file by meaning and prints each match's import line. `<set>/<id>` reads one icon with every variant's import line; --list lists the installed sets and how many icon definitions each one maps. The subcommands author a set: `new-set` starts one in an integration package, `new-definition` adds the set's own icon definition, `add` registers an icon from a library, `map` points an icon definition at an icon, and `use` makes a set the project's. Start a set with `new-set <name> --from <library>`; the guide is `astryx docs cli/experimental/icon-sets`. Experimental: it may change or be removed in a patch release.",
|
|
20
20
|
fn: 'icon',
|
|
21
21
|
// `new-set` and `new-definition` start a set and its own definitions,
|
|
22
22
|
// `add` registers an icon, `map` edits a map entry, and `use` picks the
|
|
@@ -43,6 +43,18 @@ export const doc = {
|
|
|
43
43
|
param: 'options.limit',
|
|
44
44
|
description: 'Max number of matches, a positive integer (default 10)',
|
|
45
45
|
},
|
|
46
|
+
{
|
|
47
|
+
flag: '--definitions',
|
|
48
|
+
param: 'options.definitions',
|
|
49
|
+
description:
|
|
50
|
+
'Every Astryx icon definition, one line each: name, built in or not, description, words',
|
|
51
|
+
},
|
|
52
|
+
{
|
|
53
|
+
flag: '--all-icons',
|
|
54
|
+
param: 'options.allIcons',
|
|
55
|
+
description:
|
|
56
|
+
'With --set and no words: every icon of that set, one line each (id, words, definitions)',
|
|
57
|
+
},
|
|
46
58
|
],
|
|
47
59
|
examples: [
|
|
48
60
|
{label: 'Find by meaning', cli: 'astryx experimental icon delete'},
|
|
@@ -51,6 +63,10 @@ export const doc = {
|
|
|
51
63
|
cli: 'astryx experimental icon outline/trash',
|
|
52
64
|
},
|
|
53
65
|
{label: 'Installed sets', cli: 'astryx experimental icon --list --json'},
|
|
66
|
+
{
|
|
67
|
+
label: 'Every icon of one set',
|
|
68
|
+
cli: 'astryx experimental icon --set outline --all-icons',
|
|
69
|
+
},
|
|
54
70
|
{
|
|
55
71
|
label: 'One set, top 3',
|
|
56
72
|
cli: 'astryx experimental icon arrow --set outline --limit 3',
|