Skip to content

feat(dgeni): add hostDirectives to the API source block#3544

Merged
griest024 merged 1 commit into
graycoreio:developfrom
griest024:feat/dgeni/host-directives
May 6, 2025
Merged

feat(dgeni): add hostDirectives to the API source block#3544
griest024 merged 1 commit into
graycoreio:developfrom
griest024:feat/dgeni/host-directives

Conversation

@griest024
Copy link
Copy Markdown
Member

PR Checklist

Please check if your PR fulfills the following requirements:

PR Type

What kind of change does this PR introduce?

[ ] Bugfix
[x] Feature
[ ] Code style update (formatting, local variables)
[ ] Refactoring (no functional changes, no api changes)
[ ] Build related changes
[ ] CI related changes
[ ] Documentation content changes
[ ] Other... Please describe:

What is the current behavior?

Fixes: #3500

What is the new behavior?

Does this PR introduce a breaking change?

[ ] Yes
[x] No

Other information

@griest024 griest024 added the tools: dgeni @daffodil/tools-dgeni label Mar 6, 2025
@griest024 griest024 requested a review from xelaint March 6, 2025 18:09
@griest024 griest024 requested a review from a team as a code owner March 6, 2025 18:09
@griest024
Copy link
Copy Markdown
Member Author

@xelaint dgeni does not offer us a good way to editorialize the content of hostDirectives so for now I think we should just display what it gives us. LMK if this is a problem and I can do some messy regex parsing to remove what we don't want.

@xelaint
Copy link
Copy Markdown
Member

xelaint commented Mar 6, 2025

Can we not retrieve the inputs, their values, and defaults and pass it into the properties table?

@griest024
Copy link
Copy Markdown
Member Author

Can we not retrieve the inputs, their values, and defaults and pass it into the properties table?

Retrieving the inputs requires regex parsing which becomes very messy, very quickly.

@xelaint xelaint requested a review from damienwebdev March 7, 2025 17:58
@griest024 griest024 force-pushed the feat/dgeni/host-directives branch from f94bfb1 to 423bf42 Compare April 22, 2025 21:33
@griest024 griest024 requested a review from a team as a code owner April 22, 2025 21:33
@griest024
Copy link
Copy Markdown
Member Author

@xelaint I've changed this. it now added host directive inputs and outputs to components

@griest024 griest024 force-pushed the feat/dgeni/host-directives branch 2 times, most recently from fe210a1 to fb0f7b0 Compare April 22, 2025 22:31
@griest024
Copy link
Copy Markdown
Member Author

note to self: consider how inputs and outputs will be inheritied 2 layers deep, i.e. button > button base > statusable

@griest024
Copy link
Copy Markdown
Member Author

don't show host directives in the source block, render the inputs and outputs as if they were declared by the component

@griest024 griest024 assigned griest024 and unassigned xelaint Apr 24, 2025
@griest024 griest024 added the status: wip This PR is WIP. It should be marked as a draft. label Apr 24, 2025
@xelaint
Copy link
Copy Markdown
Member

xelaint commented Apr 24, 2025

don't show host directives in the source block, render the inputs and outputs as if they were declared by the component

Currently:

@Component({
  hostDirectives: [
    {
        directive: DaffColorableDirective,
        inputs: ['color']
    },
  ]
})
class DaffProgressBarComponent {
  @HostBinding() 
  get role(): string
  @HostBinding() 
  get ariaLabel(): string
  @HostBinding() ariaValueMin: string = '0'
  @HostBinding() ariaValueMax: string = '100'
  @HostBinding() 
  get ariaValueNow(): number
}

expected:

class DaffProgressBarComponent {
  @Input() color: DaffPalette
  @HostBinding() 
  get role(): string
  @HostBinding() 
  get ariaLabel(): string
  @HostBinding() ariaValueMin: string = '0'
  @HostBinding() ariaValueMax: string = '100'
  @HostBinding() 
  get ariaValueNow(): number
}

where the values of color are retrieved from DaffPalette.

@griest024 griest024 force-pushed the feat/dgeni/host-directives branch from fb0f7b0 to 8fbd8f6 Compare May 6, 2025 20:50
@griest024
Copy link
Copy Markdown
Member Author

@xelaint ready for review

@griest024 griest024 added status: pending review This PR is awaiting review or response from a reviewer before the author can proceed. and removed status: wip This PR is WIP. It should be marked as a draft. labels May 6, 2025
@griest024 griest024 merged commit 96ffe71 into graycoreio:develop May 6, 2025
9 of 10 checks passed
@gray-bot gray-bot mentioned this pull request May 6, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

status: pending review This PR is awaiting review or response from a reviewer before the author can proceed. tools: dgeni @daffodil/tools-dgeni

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[FEAT] Inputs from hostDirectives in design components should be included in API docs

2 participants