@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.
Files changed (50) hide show
  1. package/CHANGELOG.md +107 -0
  2. package/api/build/blocks/blocks.d.mts +41 -0
  3. package/api/build/blocks/blocks.mjs +118 -68
  4. package/api/doctor/doctor.d.mts +4 -4
  5. package/api/doctor/doctor.mjs +248 -78
  6. package/api/icon/_authoring.mjs +8 -1
  7. package/api/icon/add/add.mjs +45 -5
  8. package/api/icon/icon.type.d.mts +24 -0
  9. package/api/icon/icon.type.mjs +6 -0
  10. package/api/icon/iconAdd.doc.mjs +1 -1
  11. package/api/icon/map/map.mjs +11 -4
  12. package/api/integration/add-helpers.d.mts +5 -1
  13. package/api/integration/add-helpers.mjs +1 -1
  14. package/api/render/render.doc.mjs +1 -1
  15. package/api/render/render.type.d.mts +1 -1
  16. package/api/render/render.type.mjs +1 -1
  17. package/api/search/ORDERING.md +3 -0
  18. package/api/search/_adapter.d.mts +10 -2
  19. package/api/search/_adapter.mjs +13 -2
  20. package/api/search/_fit-order.d.mts +47 -0
  21. package/api/search/_fit-order.mjs +257 -0
  22. package/api/search/_main-searcher.mjs +15 -5
  23. package/api/template/skeleton/skeleton.mjs +1 -1
  24. package/assets/codemods/transforms/v0.1.0/drop-xds-prefix-imports.mjs +1 -1
  25. package/assets/codemods/transforms/v0.1.0/index.mjs +1 -1
  26. package/assets/docs/tree/icon-sets.doc.mjs +4 -4
  27. package/assets/docs/tree/render-pages.doc.mjs +1 -1
  28. package/assets/templates/blocks/components/Table/RowsVirtualizationHookUsage.doc.mjs +2 -2
  29. package/assets/templates/blocks/components/Table/RowsVirtualizationHookUsage.tsx +13 -7
  30. package/assets/templates/pages/table-grouped/page.tsx +30 -30
  31. package/assets/templates/themes/gothic/gothicTheme.ts +16 -0
  32. package/assets/templates/themes/matcha/matchaTheme.ts +1 -1
  33. package/assets/templates/themes/neutral/neutralTheme.ts +6 -0
  34. package/assets/templates/themes/y2k/y2kPaletteRefs.generated.ts +1 -1
  35. package/assets/templates/themes/y2k/y2kTheme.ts +1 -1
  36. package/clients/cli/commands/experimental/icon.mjs +25 -4
  37. package/clients/cli/commands/experimental-render.doc.mjs +1 -1
  38. package/clients/cli/commands/template.mjs +204 -181
  39. package/foundation/discovery/component-discovery.mjs +1 -1
  40. package/foundation/discovery/icon-set-writer.d.mts +21 -5
  41. package/foundation/discovery/icon-set-writer.mjs +114 -13
  42. package/foundation/discovery/template-adapter.mjs +2 -2
  43. package/foundation/render/page-host.d.mts +4 -0
  44. package/foundation/render/page-host.mjs +45 -0
  45. package/foundation/render/page-worker.mjs +11 -5
  46. package/foundation/render/render-page.d.mts +11 -6
  47. package/foundation/render/render-page.mjs +138 -44
  48. package/foundation/response/error-codes.doc.mjs +1 -1
  49. package/foundation/xle/registry-core.mjs +1 -1
  50. package/package.json +6 -6
@@ -100,7 +100,7 @@ const PRIORITY_COLOR: Record<
100
100
  const allTasks: TaskRow[] = [
101
101
  {
102
102
  id: '1',
103
- taskId: 'T235040469',
103
+ taskId: 'TASK-1001',
104
104
  title: 'Update user interface',
105
105
  subtitle: 'Update payment gateway integration',
106
106
  status: 'in_progress',
@@ -115,7 +115,7 @@ const allTasks: TaskRow[] = [
115
115
  },
116
116
  {
117
117
  id: '2',
118
- taskId: 'T235040470',
118
+ taskId: 'TASK-1002',
119
119
  title: 'Use Projects to organize work for features or releases',
120
120
  subtitle: '',
121
121
  status: 'in_progress',
@@ -130,7 +130,7 @@ const allTasks: TaskRow[] = [
130
130
  },
131
131
  {
132
132
  id: '3',
133
- taskId: 'T235040471',
133
+ taskId: 'TASK-1003',
134
134
  title: 'Use Cycles to focus work over n-weeks',
135
135
  subtitle: '',
136
136
  status: 'in_progress',
@@ -145,7 +145,7 @@ const allTasks: TaskRow[] = [
145
145
  },
146
146
  {
147
147
  id: '4',
148
- taskId: 'T235040472',
148
+ taskId: 'TASK-1004',
149
149
  title: 'Testing code',
150
150
  subtitle: 'Update payment gateway integration',
151
151
  status: 'todo',
@@ -160,7 +160,7 @@ const allTasks: TaskRow[] = [
160
160
  },
161
161
  {
162
162
  id: '5',
163
- taskId: 'T235040473',
163
+ taskId: 'TASK-1005',
164
164
  title: 'Update backend code',
165
165
  subtitle: 'Update payment gateway integration',
166
166
  status: 'todo',
@@ -175,7 +175,7 @@ const allTasks: TaskRow[] = [
175
175
  },
176
176
  {
177
177
  id: '6',
178
- taskId: 'T235040474',
178
+ taskId: 'TASK-1006',
179
179
  title: 'Update front end code',
180
180
  subtitle: 'Update payment gateway integration',
181
181
  status: 'todo',
@@ -190,7 +190,7 @@ const allTasks: TaskRow[] = [
190
190
  },
191
191
  {
192
192
  id: '7',
193
- taskId: 'T235040475',
193
+ taskId: 'TASK-1007',
194
194
  title: 'Update payment gateway integration',
195
195
  subtitle: '',
196
196
  status: 'todo',
@@ -205,7 +205,7 @@ const allTasks: TaskRow[] = [
205
205
  },
206
206
  {
207
207
  id: '8',
208
- taskId: 'T235040476',
208
+ taskId: 'TASK-1008',
209
209
  title: 'Update payment gateway backend code',
210
210
  subtitle: '',
211
211
  status: 'todo',
@@ -220,7 +220,7 @@ const allTasks: TaskRow[] = [
220
220
  },
221
221
  {
222
222
  id: '9',
223
- taskId: 'T235040477',
223
+ taskId: 'TASK-1009',
224
224
  title: 'Invite your teammates',
225
225
  subtitle: '',
226
226
  status: 'todo',
@@ -235,7 +235,7 @@ const allTasks: TaskRow[] = [
235
235
  },
236
236
  {
237
237
  id: '10',
238
- taskId: 'T235040478',
238
+ taskId: 'TASK-1010',
239
239
  title: 'Next steps',
240
240
  subtitle: '',
241
241
  status: 'todo',
@@ -250,7 +250,7 @@ const allTasks: TaskRow[] = [
250
250
  },
251
251
  {
252
252
  id: '11',
253
- taskId: 'T235040479',
253
+ taskId: 'TASK-1011',
254
254
  title: 'Welcome to Linear',
255
255
  subtitle: '',
256
256
  status: 'backlog',
@@ -265,7 +265,7 @@ const allTasks: TaskRow[] = [
265
265
  },
266
266
  {
267
267
  id: '12',
268
- taskId: 'T235040480',
268
+ taskId: 'TASK-1012',
269
269
  title: 'Connect GitHub or GitLab',
270
270
  subtitle: '',
271
271
  status: 'backlog',
@@ -280,7 +280,7 @@ const allTasks: TaskRow[] = [
280
280
  },
281
281
  {
282
282
  id: '13',
283
- taskId: 'T235040481',
283
+ taskId: 'TASK-1013',
284
284
  title: 'Customize settings',
285
285
  subtitle: '',
286
286
  status: 'backlog',
@@ -295,7 +295,7 @@ const allTasks: TaskRow[] = [
295
295
  },
296
296
  {
297
297
  id: '14',
298
- taskId: 'T235040482',
298
+ taskId: 'TASK-1014',
299
299
  title: 'Try 3 ways to navigate: Command menu, keyboard or mouse',
300
300
  subtitle: '',
301
301
  status: 'done',
@@ -310,7 +310,7 @@ const allTasks: TaskRow[] = [
310
310
  },
311
311
  {
312
312
  id: '15',
313
- taskId: 'T235040483',
313
+ taskId: 'TASK-1015',
314
314
  title: 'Connect to Slack',
315
315
  subtitle: '',
316
316
  status: 'done',
@@ -325,7 +325,7 @@ const allTasks: TaskRow[] = [
325
325
  },
326
326
  {
327
327
  id: '16',
328
- taskId: 'T235040484',
328
+ taskId: 'TASK-1016',
329
329
  title: 'Migrate database schema to v2',
330
330
  subtitle: 'Payment gateway integration',
331
331
  status: 'in_progress',
@@ -340,7 +340,7 @@ const allTasks: TaskRow[] = [
340
340
  },
341
341
  {
342
342
  id: '17',
343
- taskId: 'T235040485',
343
+ taskId: 'TASK-1017',
344
344
  title: 'Write integration tests for checkout flow',
345
345
  subtitle: '',
346
346
  status: 'in_progress',
@@ -355,7 +355,7 @@ const allTasks: TaskRow[] = [
355
355
  },
356
356
  {
357
357
  id: '18',
358
- taskId: 'T235040486',
358
+ taskId: 'TASK-1018',
359
359
  title: 'Set up CI/CD pipeline for staging',
360
360
  subtitle: '',
361
361
  status: 'in_progress',
@@ -370,7 +370,7 @@ const allTasks: TaskRow[] = [
370
370
  },
371
371
  {
372
372
  id: '19',
373
- taskId: 'T235040487',
373
+ taskId: 'TASK-1019',
374
374
  title: 'Add rate limiting to public API endpoints',
375
375
  subtitle: '',
376
376
  status: 'todo',
@@ -385,7 +385,7 @@ const allTasks: TaskRow[] = [
385
385
  },
386
386
  {
387
387
  id: '20',
388
- taskId: 'T235040488',
388
+ taskId: 'TASK-1020',
389
389
  title: 'Refactor auth middleware to support OAuth2',
390
390
  subtitle: '',
391
391
  status: 'todo',
@@ -400,7 +400,7 @@ const allTasks: TaskRow[] = [
400
400
  },
401
401
  {
402
402
  id: '21',
403
- taskId: 'T235040489',
403
+ taskId: 'TASK-1021',
404
404
  title: 'Design error pages for 404 and 500',
405
405
  subtitle: '',
406
406
  status: 'todo',
@@ -415,7 +415,7 @@ const allTasks: TaskRow[] = [
415
415
  },
416
416
  {
417
417
  id: '22',
418
- taskId: 'T235040490',
418
+ taskId: 'TASK-1022',
419
419
  title: 'Audit third-party dependencies for vulnerabilities',
420
420
  subtitle: '',
421
421
  status: 'todo',
@@ -430,7 +430,7 @@ const allTasks: TaskRow[] = [
430
430
  },
431
431
  {
432
432
  id: '23',
433
- taskId: 'T235040491',
433
+ taskId: 'TASK-1023',
434
434
  title: 'Implement webhook retry logic with exponential backoff',
435
435
  subtitle: 'Payment gateway integration',
436
436
  status: 'todo',
@@ -445,7 +445,7 @@ const allTasks: TaskRow[] = [
445
445
  },
446
446
  {
447
447
  id: '24',
448
- taskId: 'T235040492',
448
+ taskId: 'TASK-1024',
449
449
  title: 'Add dark mode support to dashboard',
450
450
  subtitle: '',
451
451
  status: 'backlog',
@@ -460,7 +460,7 @@ const allTasks: TaskRow[] = [
460
460
  },
461
461
  {
462
462
  id: '25',
463
- taskId: 'T235040493',
463
+ taskId: 'TASK-1025',
464
464
  title: 'Create onboarding flow for new team members',
465
465
  subtitle: '',
466
466
  status: 'backlog',
@@ -475,7 +475,7 @@ const allTasks: TaskRow[] = [
475
475
  },
476
476
  {
477
477
  id: '26',
478
- taskId: 'T235040494',
478
+ taskId: 'TASK-1026',
479
479
  title: 'Set up error tracking with Sentry',
480
480
  subtitle: '',
481
481
  status: 'backlog',
@@ -490,7 +490,7 @@ const allTasks: TaskRow[] = [
490
490
  },
491
491
  {
492
492
  id: '27',
493
- taskId: 'T235040495',
493
+ taskId: 'TASK-1027',
494
494
  title: 'Improve search performance with indexing',
495
495
  subtitle: '',
496
496
  status: 'backlog',
@@ -505,7 +505,7 @@ const allTasks: TaskRow[] = [
505
505
  },
506
506
  {
507
507
  id: '28',
508
- taskId: 'T235040496',
508
+ taskId: 'TASK-1028',
509
509
  title: 'Write API documentation for v2 endpoints',
510
510
  subtitle: '',
511
511
  status: 'done',
@@ -520,7 +520,7 @@ const allTasks: TaskRow[] = [
520
520
  },
521
521
  {
522
522
  id: '29',
523
- taskId: 'T235040497',
523
+ taskId: 'TASK-1029',
524
524
  title: 'Set up staging environment',
525
525
  subtitle: '',
526
526
  status: 'done',
@@ -535,7 +535,7 @@ const allTasks: TaskRow[] = [
535
535
  },
536
536
  {
537
537
  id: '30',
538
- taskId: 'T235040498',
538
+ taskId: 'TASK-1030',
539
539
  title: 'Fix flaky end-to-end tests in CI',
540
540
  subtitle: '',
541
541
  status: 'done',
@@ -395,6 +395,22 @@ export const gothicTheme = defineTheme({
395
395
  },
396
396
  },
397
397
 
398
+ // Gothic's accent text and icons are one light color. On a media surface
399
+ // they follow that surface's accent, so a dark surface inside a light one
400
+ // gets its light accent back.
401
+ onDark: {
402
+ tokens: {
403
+ '--color-text-accent': 'var(--color-accent)',
404
+ '--color-icon-accent': 'var(--color-accent)',
405
+ },
406
+ },
407
+ onLight: {
408
+ tokens: {
409
+ '--color-text-accent': 'var(--color-accent)',
410
+ '--color-icon-accent': 'var(--color-accent)',
411
+ },
412
+ },
413
+
398
414
  icons: gothicIconRegistry,
399
415
  });
400
416
 
@@ -97,7 +97,7 @@ export const matchaTheme = defineTheme({
97
97
 
98
98
  // Text
99
99
  '--color-text-primary': [neutral.light[20], neutral.dark[75]],
100
- '--color-text-secondary': [neutral.light[40], neutral.dark[60]],
100
+ '--color-text-secondary': [neutral.light[30], neutral.dark[60]],
101
101
  '--color-text-disabled': [neutral.light[75], neutral.dark[30]],
102
102
  '--color-text-accent': [neutral.light[20], neutral.dark[75]],
103
103
  '--color-on-dark': neutral.light[100],
@@ -361,7 +361,13 @@ export const neutralTheme = defineTheme({
361
361
  padding: 'var(--spacing-1)',
362
362
  },
363
363
  },
364
+ // An unselected label sits on the translucent track, which lifts the
365
+ // page under it. In dark mode secondary text falls under 4.5:1 on the
366
+ // track over the surface, so it takes the same next stop.
364
367
  'segmented-control-item': {
368
+ base: {
369
+ '--color-text-secondary': `light-dark(${neutral.light[30]}, ${neutral.dark[80]})`,
370
+ },
365
371
  'size:sm': {
366
372
  height: 'calc(var(--size-element-sm) - 8px)',
367
373
  },
@@ -15,7 +15,7 @@ export const y2kPaletteRefs = {
15
15
  dark: {20: '#2a3600', 65: '#95b041', 75: '#b5d263', 80: '#c5e17a'},
16
16
  },
17
17
  neutral: {
18
- light: {15: '#2d241b', 20: '#382e24', 30: '#4f453b', 40: '#675d52', 80: '#d1c5b8', 85: '#dfd5c9', 90: '#f1e6db', 95: '#fff6ed', 100: '#ffffff'},
18
+ light: {15: '#2d241b', 20: '#382e24', 30: '#4f453b', 35: '#5a5146', 40: '#675d52', 80: '#d1c5b8', 85: '#dfd5c9', 90: '#f1e6db', 95: '#fff6ed', 100: '#ffffff'},
19
19
  dark: {0: '#000000', 5: '#0e0f1a', 10: '#16182b', 20: '#1f2238', 25: '#2c3048', 35: '#4a4f6b', 45: '#636889', 70: '#a6acd6', 85: '#d0d4eb', 90: '#dfe2f3', 95: '#edeffc'},
20
20
  },
21
21
  orange: {
@@ -182,7 +182,7 @@ export const y2kTheme = defineTheme({
182
182
 
183
183
  // Text
184
184
  '--color-text-primary': [neutral.light[15], neutral.dark[95]],
185
- '--color-text-secondary': [neutral.light[40], neutral.dark[70]],
185
+ '--color-text-secondary': [neutral.light[35], neutral.dark[70]],
186
186
  '--color-text-disabled': [neutral.light[80], neutral.dark[35]],
187
187
  '--color-text-accent': [neutral.light[15], neutral.dark[95]],
188
188
  '--color-on-dark': neutral.light[100],
@@ -59,6 +59,20 @@ const defaultVariantText = value =>
59
59
  /** @param {unknown} value */
60
60
  const variantsText = value => (Array.isArray(value) ? value.join('/') : '');
61
61
 
62
+ /**
63
+ * The receipt line for a data file whose `module` the command rewrote after
64
+ * a package rename.
65
+ * @param {{moduleUpdate?: {previous: string, module: string}, dryRun?: boolean}} data
66
+ */
67
+ const moduleUpdateLines = data =>
68
+ data.moduleUpdate
69
+ ? [
70
+ text(
71
+ `${data.dryRun ? '[plan] Would update' : '[ok] Updated'} module to "${data.moduleUpdate.module}" (was "${data.moduleUpdate.previous}"), from the package name in package.json.`,
72
+ ),
73
+ ]
74
+ : [];
75
+
62
76
  /**
63
77
  * Register `icon` and its subcommands under the `experimental` group.
64
78
  * @param {import('commander').Command} group the `experimental` command
@@ -376,20 +390,24 @@ export function registerExperimentalIcon(group, program) {
376
390
  (
377
391
  /** @type {{definition: string, icon: string, previous: string | null}} */ each,
378
392
  ) =>
379
- `${each.definition} = "${each.icon}"${each.previous && each.previous !== each.icon ? ` (was "${each.previous}")` : ''}`,
393
+ `${each.definition} = "${each.icon}"${each.previous === each.icon ? ' (unchanged)' : each.previous ? ` (was "${each.previous}")` : ' (was not mapped)'}`,
380
394
  ),
381
395
  ),
396
+ ...moduleUpdateLines(data),
382
397
  )
383
398
  : emit(
399
+ // The entry line reads `previous` and `icon`: a write can
400
+ // come from a package rename alone.
384
401
  text(
385
402
  data.icon == null
386
- ? data.changed
403
+ ? data.previous != null
387
404
  ? `[ok] Removed map.${data.definition} (was "${data.previous}") from ${data.file}.`
388
405
  : `[ok] ${data.file} has no map.${data.definition}.`
389
- : data.changed
406
+ : data.previous !== data.icon
390
407
  ? `[ok] map.${data.definition} = "${data.icon}" in ${data.file}${data.previous ? ` (was "${data.previous}")` : ''}.`
391
408
  : `[ok] map.${data.definition} is already "${data.icon}".`,
392
409
  ),
410
+ ...moduleUpdateLines(data),
393
411
  ),
394
412
  ),
395
413
  });
@@ -430,6 +448,7 @@ export function registerExperimentalIcon(group, program) {
430
448
  text(
431
449
  `[ok] ${data.variant}: ${data.added} icons gained it${data.already > 0 ? `, ${data.already} already had it` : ''}, read from ${data.from}.`,
432
450
  ),
451
+ ...moduleUpdateLines(data),
433
452
  ...(data.files.length > 0 ? [list(data.files)] : []),
434
453
  ...(data.missing.length > 0
435
454
  ? [
@@ -488,10 +507,11 @@ export function registerExperimentalIcon(group, program) {
488
507
  const {data} = result;
489
508
  emit(
490
509
  text(
491
- data.changed
510
+ data.added
492
511
  ? `[ok] Added ${data.icon.export} as "${data.icon.id}"${data.variant ? ` (variant ${data.variant})` : ''}${data.definition ? `, map.${data.definition} = "${data.icon.id}"` : ''}.`
493
512
  : `[ok] ${data.icon.export} is already "${data.icon.id}"${data.definition ? ` and map.${data.definition} names it` : ''}.`,
494
513
  ),
514
+ ...moduleUpdateLines(data),
495
515
  ...(data.files.length > 0 ? [list(data.files)] : []),
496
516
  ...(data.note ? [text(`[next] ${data.note}`)] : []),
497
517
  );
@@ -543,6 +563,7 @@ export function registerExperimentalIcon(group, program) {
543
563
  : `The experimental.iconSets root ${root.path} in ${manifest} is unchanged.`
544
564
  : `${dryRun ? 'Would update' : 'Updated'} ${manifest}.`,
545
565
  ),
566
+ ...moduleUpdateLines(data),
546
567
  ...(files.length > 0 ? [list(files)] : []),
547
568
  // What to do next comes before the long lists, so it never scrolls
548
569
  // away.
@@ -53,7 +53,7 @@ export const doc = {
53
53
  {code: 0, when: 'the file was written (warnings included)'},
54
54
  {
55
55
  code: 1,
56
- when: 'no file, a wrong extension, a missing file, a page that does not compile, has no default export, imports a package that is not installed, reads a browser API while rendering, throws, or takes over 60 seconds; a file to write outside the current folder; with --reverse, an existing output without --overwrite, a damaged embedded source, or HTML that is not an Astryx page',
56
+ when: 'no file, a wrong extension, a missing file, a page that does not compile, has no default export, imports a package that is not installed, reads a browser API while rendering, throws, crashes Node, or takes over 60 seconds; a file to write outside the current folder; with --reverse, an existing output without --overwrite, a damaged embedded source, or HTML that is not an Astryx page',
57
57
  },
58
58
  ],
59
59
  related: ['template', 'build'],