@bspk/ui 1.1.30 → 1.1.31

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 (3) hide show
  1. package/meta-types.ts +1 -0
  2. package/meta.ts +15 -2
  3. package/package.json +1 -1
package/meta-types.ts CHANGED
@@ -14,6 +14,7 @@ export type TypeMeta = BaseMeta & {
14
14
  id: string;
15
15
  references?: string[];
16
16
  properties?: TypeProperty[];
17
+ components?: string[];
17
18
  };
18
19
 
19
20
  export type TypeProperty = {
package/meta.ts CHANGED
@@ -401,6 +401,7 @@ function generateTypes() {
401
401
  properties,
402
402
  id: kebabCase(definitionName),
403
403
  description: definition.description,
404
+ components: componentFile?.name ? [componentFile.name] : [],
404
405
  });
405
406
  });
406
407
 
@@ -414,7 +415,18 @@ function generateTypes() {
414
415
  )
415
416
  ?.filter((name, index, arr) => arr.indexOf(name) === index);
416
417
 
417
- if (references && references.length > 0) nextType.references = references;
418
+ if (!references || references.length === 0) return;
419
+
420
+ nextType.references = references;
421
+
422
+ if (!nextType.components || nextType.components.length === 0) return;
423
+
424
+ nextTypes
425
+ .filter((t) => references.includes(t.name))
426
+ .forEach((t) => {
427
+ t.components = t.components || [];
428
+ t.components.push(...nextType.components!);
429
+ });
418
430
  });
419
431
 
420
432
  const duplicateIds = nextTypes.flatMap((t) => t.id).filter((id, index, arr) => arr.indexOf(id) !== index);
@@ -428,8 +440,9 @@ function generateTypes() {
428
440
  return nextTypes;
429
441
  }
430
442
 
443
+ let componentsMeta: ComponentMeta[] = [];
431
444
  async function createMeta() {
432
- const componentsMeta: ComponentMeta[] = componentFiles
445
+ componentsMeta = componentFiles
433
446
  .flatMap((component) => generateComponentMeta(component) || [])
434
447
  // filter out dependencies that aren't components
435
448
  .map((m, _, arr): ComponentMeta => {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@bspk/ui",
3
- "version": "1.1.30",
3
+ "version": "1.1.31",
4
4
  "license": "CC-BY-4.0",
5
5
  "type": "module",
6
6
  "files": [