@astryxdesign/cli 0.7.12-canary.f36bd72 → 0.7.12
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/CHANGELOG.md +107 -0
- package/api/build/blocks/blocks.d.mts +41 -0
- package/api/build/blocks/blocks.mjs +118 -68
- package/api/doctor/doctor.d.mts +4 -4
- package/api/doctor/doctor.mjs +248 -78
- package/api/icon/_authoring.mjs +8 -1
- package/api/icon/add/add.mjs +45 -5
- package/api/icon/icon.type.d.mts +24 -0
- package/api/icon/icon.type.mjs +6 -0
- package/api/icon/iconAdd.doc.mjs +1 -1
- package/api/icon/map/map.mjs +11 -4
- package/api/integration/add-helpers.d.mts +5 -1
- package/api/integration/add-helpers.mjs +1 -1
- package/api/render/render.doc.mjs +1 -1
- package/api/render/render.type.d.mts +1 -1
- package/api/render/render.type.mjs +1 -1
- package/api/search/ORDERING.md +3 -0
- package/api/search/_adapter.d.mts +10 -2
- package/api/search/_adapter.mjs +13 -2
- package/api/search/_fit-order.d.mts +47 -0
- package/api/search/_fit-order.mjs +257 -0
- package/api/search/_main-searcher.mjs +15 -5
- package/api/template/skeleton/skeleton.mjs +1 -1
- package/assets/codemods/transforms/v0.1.0/drop-xds-prefix-imports.mjs +1 -1
- package/assets/codemods/transforms/v0.1.0/index.mjs +1 -1
- package/assets/docs/tree/icon-sets.doc.mjs +4 -4
- package/assets/docs/tree/render-pages.doc.mjs +1 -1
- package/assets/templates/blocks/components/Table/RowsVirtualizationHookUsage.doc.mjs +2 -2
- package/assets/templates/blocks/components/Table/RowsVirtualizationHookUsage.tsx +13 -7
- package/assets/templates/pages/table-grouped/page.tsx +30 -30
- package/assets/templates/themes/gothic/gothicTheme.ts +16 -0
- package/assets/templates/themes/matcha/matchaTheme.ts +1 -1
- package/assets/templates/themes/neutral/neutralTheme.ts +6 -0
- package/assets/templates/themes/y2k/y2kPaletteRefs.generated.ts +1 -1
- package/assets/templates/themes/y2k/y2kTheme.ts +1 -1
- package/clients/cli/commands/experimental/icon.mjs +25 -4
- package/clients/cli/commands/experimental-render.doc.mjs +1 -1
- package/clients/cli/commands/template.mjs +204 -181
- package/foundation/discovery/component-discovery.mjs +1 -1
- package/foundation/discovery/icon-set-writer.d.mts +21 -5
- package/foundation/discovery/icon-set-writer.mjs +114 -13
- package/foundation/discovery/template-adapter.mjs +2 -2
- package/foundation/render/page-host.d.mts +4 -0
- package/foundation/render/page-host.mjs +45 -0
- package/foundation/render/page-worker.mjs +11 -5
- package/foundation/render/render-page.d.mts +11 -6
- package/foundation/render/render-page.mjs +138 -44
- package/foundation/response/error-codes.doc.mjs +1 -1
- package/foundation/xle/registry-core.mjs +1 -1
- package/package.json +6 -6
|
@@ -5,7 +5,14 @@
|
|
|
5
5
|
*/
|
|
6
6
|
|
|
7
7
|
import {jsonOut} from '../../../foundation/response/json.mjs';
|
|
8
|
-
import {
|
|
8
|
+
import {
|
|
9
|
+
emit,
|
|
10
|
+
section,
|
|
11
|
+
text,
|
|
12
|
+
records,
|
|
13
|
+
code,
|
|
14
|
+
record,
|
|
15
|
+
} from '../formatters/index.mjs';
|
|
9
16
|
import {cliError, rejectEmptyArgument} from '../lib/cli-error.mjs';
|
|
10
17
|
import {template as templateApi} from '../../../api/template/template.mjs';
|
|
11
18
|
import {Project} from '../../../foundation/config/project.mjs';
|
|
@@ -16,7 +23,10 @@ import {NO_RESULT_SET, resultSet} from '../../../foundation/debug/index.mjs';
|
|
|
16
23
|
import {doc as templateCommand} from './template.doc.mjs';
|
|
17
24
|
import {doc as templateFn} from '../../../api/template/template.doc.mjs';
|
|
18
25
|
|
|
19
|
-
export {
|
|
26
|
+
export {
|
|
27
|
+
discoverTemplates,
|
|
28
|
+
listTemplates,
|
|
29
|
+
} from '../../../api/template/template.mjs';
|
|
20
30
|
|
|
21
31
|
/**
|
|
22
32
|
* The discriminated response returned by the template API. The api layer
|
|
@@ -112,94 +122,134 @@ export function registerTemplate(program) {
|
|
|
112
122
|
* @param {{list?: boolean, type?: string, package?: string, skeleton?: boolean, cdn?: boolean | string, overwrite?: boolean}} options
|
|
113
123
|
*/
|
|
114
124
|
async (name, targetPath, options) => {
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
125
|
+
const usesName = !options.cdn && !options.list;
|
|
126
|
+
const usesPath = options.cdn
|
|
127
|
+
? typeof options.cdn !== 'string'
|
|
128
|
+
: !options.list && !options.skeleton;
|
|
129
|
+
if (usesName) rejectEmptyArgument('name', name, 'astryx template');
|
|
130
|
+
if (usesPath)
|
|
131
|
+
rejectEmptyArgument('path', targetPath, 'astryx template');
|
|
132
|
+
const json = program.opts().json || false;
|
|
133
|
+
const run = getCliInvocation();
|
|
123
134
|
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
135
|
+
// Non-blocking nudge: if any configured integration has validation
|
|
136
|
+
// issues, print one compact line to stderr pointing at
|
|
137
|
+
// doctor integration validate. Best-effort; suppressed in --json mode.
|
|
138
|
+
try {
|
|
139
|
+
const project = await Project.load(process.cwd());
|
|
140
|
+
await warnOnIntegrationIssues(project, {json});
|
|
141
|
+
} catch {
|
|
142
|
+
// Never let the nudge break the command.
|
|
143
|
+
}
|
|
133
144
|
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
145
|
+
/** @type {TemplateResponse} */
|
|
146
|
+
let result;
|
|
147
|
+
try {
|
|
148
|
+
result = /** @type {TemplateResponse} */ (
|
|
149
|
+
await templateApi(name, {
|
|
150
|
+
list: options.list,
|
|
151
|
+
skeleton: options.skeleton,
|
|
152
|
+
cdn: options.cdn,
|
|
153
|
+
type: /** @type {'page' | 'block' | undefined} */ (options.type),
|
|
154
|
+
package: options.package,
|
|
155
|
+
targetPath,
|
|
156
|
+
overwrite: options.overwrite,
|
|
157
|
+
cwd: process.cwd(),
|
|
158
|
+
})
|
|
159
|
+
);
|
|
160
|
+
} catch (e) {
|
|
161
|
+
// template API throws structured errors with {name, reason} suggestions —
|
|
162
|
+
// pass them through untouched so the CLI envelope matches the API.
|
|
163
|
+
const err =
|
|
164
|
+
/** @type {import('../../../api/error.mjs').AstryxError} */ (e);
|
|
165
|
+
return cliError(err.message, {
|
|
166
|
+
suggestions: err.suggestions || [],
|
|
167
|
+
code: err.code,
|
|
168
|
+
});
|
|
169
|
+
}
|
|
155
170
|
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
171
|
+
const answered = summarize(result);
|
|
172
|
+
if (json) {
|
|
173
|
+
jsonOut(result);
|
|
174
|
+
return answered;
|
|
175
|
+
}
|
|
161
176
|
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
177
|
+
switch (result.type) {
|
|
178
|
+
case 'template.list': {
|
|
179
|
+
const pages = result.data.filter(t => t.type === 'page');
|
|
180
|
+
const blocks = result.data.filter(t => t.type === 'block');
|
|
166
181
|
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
+
// Bare `template` (no --list, no name) shows a grouped summary so a
|
|
183
|
+
// no-context agent or terminal doesn't receive 150 KB of catalog. The
|
|
184
|
+
// full catalog stays reachable via `template --list`.
|
|
185
|
+
if (!options.list && !name) {
|
|
186
|
+
/** @param {import('../../../api/template/template.type.mjs').TemplateListEntry[]} items */
|
|
187
|
+
const grouped = items => {
|
|
188
|
+
/** @type {Map<string, string[]>} */
|
|
189
|
+
const groups = new Map();
|
|
190
|
+
for (const t of items) {
|
|
191
|
+
const cat = t.category || 'Other';
|
|
192
|
+
const list = groups.get(cat);
|
|
193
|
+
if (list) {
|
|
194
|
+
list.push(t.id);
|
|
195
|
+
} else {
|
|
196
|
+
groups.set(cat, [t.id]);
|
|
197
|
+
}
|
|
198
|
+
}
|
|
199
|
+
/** @type {string[]} */
|
|
200
|
+
const lines = [];
|
|
201
|
+
for (const [cat, ids] of groups) {
|
|
202
|
+
lines.push(`${cat}: ${ids.join(', ')}`);
|
|
182
203
|
}
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
204
|
+
return lines.join('\n');
|
|
205
|
+
};
|
|
206
|
+
emit(
|
|
207
|
+
pages.length > 0 && section(`Page Templates (${pages.length})`),
|
|
208
|
+
pages.length > 0 && text(grouped(pages)),
|
|
209
|
+
blocks.length > 0 &&
|
|
210
|
+
section(`Block Templates (${blocks.length})`),
|
|
211
|
+
blocks.length > 0 && text(grouped(blocks)),
|
|
212
|
+
section('Usage'),
|
|
213
|
+
text(
|
|
214
|
+
[
|
|
215
|
+
`${run} template <id> Show full source`,
|
|
216
|
+
`${run} template <id> [target-path] Scaffold page or block`,
|
|
217
|
+
`${run} template <id> --skeleton Layout reference`,
|
|
218
|
+
`${run} template --list Full catalog with descriptions`,
|
|
219
|
+
`${run} template --list --type block List only blocks`,
|
|
220
|
+
`${run} template --list --package <pkg> List from one package`,
|
|
221
|
+
`${run} template --cdn CDN starter page, no build step`,
|
|
222
|
+
].join('\n'),
|
|
223
|
+
),
|
|
224
|
+
);
|
|
225
|
+
break;
|
|
226
|
+
}
|
|
227
|
+
|
|
228
|
+
// Project each entry to its JSON-mirroring fields; the WIP marker is
|
|
229
|
+
// folded into `name` (as before) and the package is shown only when it
|
|
230
|
+
// isn't the built-in core package.
|
|
231
|
+
/** @param {import('../../../api/template/template.type.mjs').TemplateListEntry} t */
|
|
232
|
+
const toRow = t => ({
|
|
233
|
+
id: t.id,
|
|
234
|
+
name: t.isReady ? t.name : `${t.name} (WIP)`,
|
|
235
|
+
description: t.description,
|
|
236
|
+
package:
|
|
237
|
+
t.package && t.package !== '@astryxdesign/core'
|
|
238
|
+
? t.package
|
|
239
|
+
: '',
|
|
240
|
+
replaces: t.replaces ?? '',
|
|
241
|
+
});
|
|
242
|
+
const fields = ['id', 'name', 'description', 'package', 'replaces'];
|
|
191
243
|
emit(
|
|
192
|
-
pages.length > 0 && section(
|
|
193
|
-
pages.length > 0 &&
|
|
194
|
-
blocks.length > 0 && section(
|
|
195
|
-
blocks.length > 0 &&
|
|
244
|
+
pages.length > 0 && section('Page Templates'),
|
|
245
|
+
pages.length > 0 && records(pages.map(toRow), {fields}),
|
|
246
|
+
blocks.length > 0 && section('Block Templates'),
|
|
247
|
+
blocks.length > 0 && records(blocks.map(toRow), {fields}),
|
|
196
248
|
section('Usage'),
|
|
197
249
|
text(
|
|
198
250
|
[
|
|
199
|
-
`${run} template <id> Show full source`,
|
|
200
251
|
`${run} template <id> [target-path] Scaffold page or block`,
|
|
201
252
|
`${run} template <id> --skeleton Layout reference`,
|
|
202
|
-
`${run} template --list Full catalog with descriptions`,
|
|
203
253
|
`${run} template --list --type block List only blocks`,
|
|
204
254
|
`${run} template --list --package <pkg> List from one package`,
|
|
205
255
|
`${run} template --cdn CDN starter page, no build step`,
|
|
@@ -209,119 +259,92 @@ export function registerTemplate(program) {
|
|
|
209
259
|
break;
|
|
210
260
|
}
|
|
211
261
|
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
blocks.length > 0 && records(blocks.map(toRow), {fields}),
|
|
230
|
-
section('Usage'),
|
|
231
|
-
text(
|
|
232
|
-
[
|
|
233
|
-
`${run} template <id> [target-path] Scaffold page or block`,
|
|
234
|
-
`${run} template <id> --skeleton Layout reference`,
|
|
235
|
-
`${run} template --list --type block List only blocks`,
|
|
236
|
-
`${run} template --list --package <pkg> List from one package`,
|
|
237
|
-
`${run} template --cdn CDN starter page, no build step`,
|
|
238
|
-
].join('\n'),
|
|
239
|
-
),
|
|
240
|
-
);
|
|
241
|
-
break;
|
|
242
|
-
}
|
|
262
|
+
case 'template.skeleton': {
|
|
263
|
+
const {
|
|
264
|
+
template: tName,
|
|
265
|
+
description,
|
|
266
|
+
components,
|
|
267
|
+
skeleton,
|
|
268
|
+
} = result.data;
|
|
269
|
+
emit(
|
|
270
|
+
record({package: result.package}),
|
|
271
|
+
text(
|
|
272
|
+
`# ${tName}${description ? ' — ' + description : ''}\n` +
|
|
273
|
+
`# Components: ${components.join(', ')}`,
|
|
274
|
+
),
|
|
275
|
+
code(skeleton),
|
|
276
|
+
);
|
|
277
|
+
break;
|
|
278
|
+
}
|
|
243
279
|
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
)
|
|
252
|
-
code(
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
280
|
+
case 'template.show': {
|
|
281
|
+
// Source must survive piping byte-for-byte, so the package it comes
|
|
282
|
+
// from (cli-surface INV28) and the note about replaced demo media go
|
|
283
|
+
// to stderr, the note in the copy receipt's words. (Text mode only:
|
|
284
|
+
// --json returned above with both in the envelope.)
|
|
285
|
+
const {source, demoMediaReplaced, demoContentReplaced, icons} =
|
|
286
|
+
result.data;
|
|
287
|
+
console.error(`package: ${result.package}`);
|
|
288
|
+
emit(code(source));
|
|
289
|
+
if (demoMediaReplaced > 0) {
|
|
290
|
+
console.error(
|
|
291
|
+
`Replaced ${demoMediaReplaced} Astryx demo media reference${demoMediaReplaced === 1 ? '' : 's'}: ` +
|
|
292
|
+
'images now show a neutral placeholder and videos have an empty source. Supply your own media there.',
|
|
293
|
+
);
|
|
294
|
+
}
|
|
295
|
+
if (demoContentReplaced > 0) {
|
|
296
|
+
console.error(demoContentNote(demoContentReplaced));
|
|
297
|
+
}
|
|
298
|
+
// The icon report goes to stderr too, so stdout stays the source.
|
|
299
|
+
for (const line of iconLines(icons)) console.error(line);
|
|
300
|
+
break;
|
|
301
|
+
}
|
|
256
302
|
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
303
|
+
case 'template.copy': {
|
|
304
|
+
const {
|
|
305
|
+
outputDir,
|
|
306
|
+
fileName,
|
|
307
|
+
demoMediaReplaced,
|
|
308
|
+
demoContentReplaced,
|
|
309
|
+
notes,
|
|
310
|
+
icons,
|
|
311
|
+
} = result.data;
|
|
312
|
+
const file = `${outputDir}/${fileName}`;
|
|
313
|
+
const iconText = iconLines(icons);
|
|
314
|
+
emit(
|
|
315
|
+
text(`Copied template to ${file}`),
|
|
316
|
+
record({package: result.package}),
|
|
317
|
+
demoMediaReplaced > 0 &&
|
|
318
|
+
text(
|
|
319
|
+
`Replaced ${demoMediaReplaced} Astryx demo media reference${demoMediaReplaced === 1 ? '' : 's'} in ${file}: ` +
|
|
320
|
+
'images now show a neutral placeholder and videos have an empty source. Supply your own media there.',
|
|
321
|
+
),
|
|
322
|
+
demoContentReplaced > 0 &&
|
|
323
|
+
text(demoContentNote(demoContentReplaced, file)),
|
|
324
|
+
...notes.map(/** @param {string} note */ note => text(note)),
|
|
325
|
+
iconText.length > 0 && text(iconText.join('\n')),
|
|
270
326
|
);
|
|
327
|
+
break;
|
|
271
328
|
}
|
|
272
|
-
if (demoContentReplaced > 0) {
|
|
273
|
-
console.error(demoContentNote(demoContentReplaced));
|
|
274
|
-
}
|
|
275
|
-
// The icon report goes to stderr too, so stdout stays the source.
|
|
276
|
-
for (const line of iconLines(icons)) console.error(line);
|
|
277
|
-
break;
|
|
278
|
-
}
|
|
279
329
|
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
const iconText = iconLines(icons);
|
|
291
|
-
emit(
|
|
292
|
-
text(`Copied template to ${file}`),
|
|
293
|
-
record({package: result.package}),
|
|
294
|
-
demoMediaReplaced > 0 &&
|
|
330
|
+
case 'template.cdn': {
|
|
331
|
+
if (!result.data.written) {
|
|
332
|
+
emit(
|
|
333
|
+
text(`[skip] ${result.data.path} already exists — left as is.`),
|
|
334
|
+
text('Pass --overwrite to replace it with a fresh copy.'),
|
|
335
|
+
);
|
|
336
|
+
break;
|
|
337
|
+
}
|
|
338
|
+
emit(
|
|
339
|
+
text(`[ok] Wrote ${result.data.path}`),
|
|
295
340
|
text(
|
|
296
|
-
`
|
|
297
|
-
'images now show a neutral placeholder and videos have an empty source. Supply your own media there.',
|
|
341
|
+
`Open it in a browser — no bundler, no install, no build step. Every CDN URL is pinned to ${result.data.version}, and the annotations mark the parts that are load-bearing.`,
|
|
298
342
|
),
|
|
299
|
-
demoContentReplaced > 0 &&
|
|
300
|
-
text(demoContentNote(demoContentReplaced, file)),
|
|
301
|
-
...notes.map(/** @param {string} note */ note => text(note)),
|
|
302
|
-
iconText.length > 0 && text(iconText.join('\n')),
|
|
303
|
-
);
|
|
304
|
-
break;
|
|
305
|
-
}
|
|
306
|
-
|
|
307
|
-
case 'template.cdn': {
|
|
308
|
-
if (!result.data.written) {
|
|
309
|
-
emit(
|
|
310
|
-
text(`[skip] ${result.data.path} already exists — left as is.`),
|
|
311
|
-
text('Pass --overwrite to replace it with a fresh copy.'),
|
|
312
343
|
);
|
|
313
344
|
break;
|
|
314
345
|
}
|
|
315
|
-
emit(
|
|
316
|
-
text(`[ok] Wrote ${result.data.path}`),
|
|
317
|
-
text(
|
|
318
|
-
`Open it in a browser — no bundler, no install, no build step. Every CDN URL is pinned to ${result.data.version}, and the annotations mark the parts that are load-bearing.`,
|
|
319
|
-
),
|
|
320
|
-
);
|
|
321
|
-
break;
|
|
322
346
|
}
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
},
|
|
347
|
+
return answered;
|
|
348
|
+
},
|
|
326
349
|
});
|
|
327
350
|
}
|
|
@@ -41,7 +41,7 @@ export const CORE_PACKAGE = CORE_PROVIDER_ID;
|
|
|
41
41
|
const INTEGRATION_DOC_SUFFIXES = ['.doc.ts', '.doc.mjs', '.doc.js'];
|
|
42
42
|
|
|
43
43
|
// Component source files are named `XDS{Name}.tsx` today. The XDS-prefix
|
|
44
|
-
// migration (
|
|
44
|
+
// migration (phase 4) renames them to the bare `{Name}.tsx` form, so
|
|
45
45
|
// discovery must recognize BOTH. The `XDS` prefix has historically doubled as
|
|
46
46
|
// a "this is a top-level component" marker, so naively matching all PascalCase
|
|
47
47
|
// `.tsx` files would surface internal helpers that happen to be PascalCase
|
|
@@ -11,7 +11,10 @@
|
|
|
11
11
|
export function iconIdOf(name: string): string;
|
|
12
12
|
/**
|
|
13
13
|
* The name an icon set exports an icon as: PascalCase ending in `Icon`
|
|
14
|
-
* (`Trash2` → `Trash2Icon`; `TrashIcon` stays).
|
|
14
|
+
* (`Trash2` → `Trash2Icon`; `TrashIcon` stays). A JavaScript name cannot
|
|
15
|
+
* start with a digit, so a name that starts with one is refused.
|
|
16
|
+
* {@link iconNaming} keeps a library prefix to prevent this (`fa0` →
|
|
17
|
+
* `Fa0Icon`).
|
|
15
18
|
* @param {string} name
|
|
16
19
|
*/
|
|
17
20
|
export function iconExportName(name: string): string;
|
|
@@ -27,7 +30,11 @@ export function variantExportName(iconName: string, variant: string): string;
|
|
|
27
30
|
* `selector` names, else the only set.
|
|
28
31
|
* @param {string} cwd
|
|
29
32
|
* @param {string} [selector] a set name
|
|
30
|
-
*
|
|
33
|
+
* The set's `module` names the package as package.json names it now;
|
|
34
|
+
* `moduleRenamed` says the data file still names an old name, so a command
|
|
35
|
+
* writes the data file even when nothing else changes; `moduleUpdate` gives
|
|
36
|
+
* the old and the new name for the receipt, else null.
|
|
37
|
+
* @returns {Promise<{packageDir: string, pkg: Record<string, any>, root: string, set: DiscoveredIconSet, sets: DiscoveredIconSet[], moduleRenamed: boolean, moduleUpdate: {previous: string, module: string} | null}>}
|
|
31
38
|
*/
|
|
32
39
|
export function findLocalIconSet(cwd: string, selector?: string): Promise<{
|
|
33
40
|
packageDir: string;
|
|
@@ -35,6 +42,11 @@ export function findLocalIconSet(cwd: string, selector?: string): Promise<{
|
|
|
35
42
|
root: string;
|
|
36
43
|
set: DiscoveredIconSet;
|
|
37
44
|
sets: DiscoveredIconSet[];
|
|
45
|
+
moduleRenamed: boolean;
|
|
46
|
+
moduleUpdate: {
|
|
47
|
+
previous: string;
|
|
48
|
+
module: string;
|
|
49
|
+
} | null;
|
|
38
50
|
}>;
|
|
39
51
|
/**
|
|
40
52
|
* A data file's text, in one fixed shape: fields in schema order, `map` keys
|
|
@@ -147,7 +159,9 @@ export function nonIconExports(file: string, options?: {
|
|
|
147
159
|
export function libraryPrefix(names: string[]): string[];
|
|
148
160
|
/**
|
|
149
161
|
* An export's id and the name the set exports it as, with the library prefix
|
|
150
|
-
* left out: `featherEye` with prefix `feather` is id `eye`, `EyeIcon`.
|
|
162
|
+
* left out: `featherEye` with prefix `feather` is id `eye`, `EyeIcon`. A
|
|
163
|
+
* name that would start with a digit keeps the prefix (`fa500px` is
|
|
164
|
+
* `fa-500px`, `Fa500pxIcon`).
|
|
151
165
|
* @param {string} name
|
|
152
166
|
* @param {string[]} prefix
|
|
153
167
|
* @returns {{id: string, name: string}}
|
|
@@ -371,7 +385,7 @@ export function writeDefinitionFile(set: DiscoveredIconSet, doc: {
|
|
|
371
385
|
/**
|
|
372
386
|
* Whether a generated declaration file declares what its generated module
|
|
373
387
|
* gives, statement by statement however a formatter left either file
|
|
374
|
-
* ({@link
|
|
388
|
+
* ({@link statementTrees}); the header comment is ignored.
|
|
375
389
|
* @param {string} actual the declaration file as it is
|
|
376
390
|
* @param {string} expected {@link generatedTypesText} for the module
|
|
377
391
|
* @param {string} label the declaration file's path, for a parse error
|
|
@@ -442,11 +456,13 @@ export function generatedNamesOf(packageDir: string, generated: string, from: st
|
|
|
442
456
|
* differently; and a refresh changes only the icons its module supplies.
|
|
443
457
|
* @param {string} packageDir
|
|
444
458
|
* @param {string} generated
|
|
445
|
-
* @returns {Map<string, {module: string, source: string}>}
|
|
459
|
+
* @returns {Map<string, {module: string, source: string, adapt: boolean}>}
|
|
460
|
+
* `adapt`: the set's adapter turns the export into a component
|
|
446
461
|
*/
|
|
447
462
|
export function generatedOrigins(packageDir: string, generated: string): Map<string, {
|
|
448
463
|
module: string;
|
|
449
464
|
source: string;
|
|
465
|
+
adapt: boolean;
|
|
450
466
|
}>;
|
|
451
467
|
/**
|
|
452
468
|
* Whether two module specifiers name the same module: the same package
|