Skip to content

Commit

Permalink
Map reference types to type-aliases (#297)
Browse files Browse the repository at this point in the history
  • Loading branch information
Blackbaud-SteveBrush committed Jan 30, 2025
1 parent 8158bfe commit c6bd82c
Show file tree
Hide file tree
Showing 5 changed files with 37 additions and 1 deletion.
8 changes: 8 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,13 @@
# Changelog

## 12.0.0-alpha.1 (2025-01-30)

- Map reference types to type-aliases. ([#297](https://github.com/blackbaud/skyux-docs-tools/pull/297)) []()

## 11.2.1 (2025-01-30)

- Map reference types to type-aliases. [#297](https://github.com/blackbaud/skyux-docs-tools/pull/297)

## 12.0.0-alpha.0 (2025-01-14)

### ⚠ BREAKING CHANGES
Expand Down
2 changes: 1 addition & 1 deletion projects/docs-tools/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@skyux/docs-tools",
"version": "12.0.0-alpha.0",
"version": "12.0.0-alpha.1",
"peerDependencies": {
"@angular/common": "^19.0.6",
"@angular/core": "^19.0.6",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -671,4 +671,30 @@ describe('Type definitions service', function () {

expect(result.hasPreviewFeatures).toBeTrue();
});

it('should consider a "reference" type as a type alias', () => {
const serviceAndAdapter = getServiceAndAdapter({
anchorIds: {},
typeDefinitions: [
{
anchorId: '',
name: 'MyReferenceType',
kind: TypeDocKind.Reference,
sources: [
{
fileName:
'src/app/public/modules/_documentation-test/foo-reference.ts',
},
],
},
],
});

const service = serviceAndAdapter.service;
const result = service.getTypeDefinitions(
'/src/app/public/modules/_documentation-test/',
);

expect(result.typeAliases[0].name).toEqual('MyReferenceType');
});
});
Original file line number Diff line number Diff line change
Expand Up @@ -124,6 +124,7 @@ export class SkyDocsTypeDefinitionsService {
types.enumerations.push(enumType);
types.hasPreviewFeatures ||= enumType.hasPreviewFeatures;
break;
case TypeDocKind.Reference:
case TypeDocKind.TypeAlias:
const typeAliasType = this.adapter.toTypeAliasDefinition(item);
types.typeAliases.push(typeAliasType);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -173,6 +173,7 @@ export interface TypeDocEntry {
| TypeDocKind.Class
| TypeDocKind.Enum
| TypeDocKind.Interface
| TypeDocKind.Reference
| TypeDocKind.TypeAlias;

indexSignature?: TypeDocSignature;
Expand Down

0 comments on commit c6bd82c

Please sign in to comment.