-
Notifications
You must be signed in to change notification settings - Fork 50
Website: enable TypeScript & gts format
#3380
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
shleewhite
wants to merge
8
commits into
main
Choose a base branch
from
spike/ts-website
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+1,483
−638
Open
Changes from 6 commits
Commits
Show all changes
8 commits
Select commit
Hold shift + click to select a range
95b6529
feat: set up typescript, glint in the website
39afeb3
feat: convert some docs components to gts
5287d0c
chore: add js files for template only components
4dadba9
feat: convert route to typescript
00e8b88
chore: surpress errors in head template file
c70a9f1
fix: build error
102840f
fix: simplify componentapi signature
8b94835
chore: update ember-cli
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,22 @@ | ||
| /** | ||
| * Copyright (c) HashiCorp, Inc. | ||
| * SPDX-License-Identifier: MPL-2.0 | ||
| */ | ||
| import type { TemplateOnlyComponent } from '@ember/component/template-only'; | ||
| import { LinkTo } from '@ember/routing'; | ||
|
|
||
| const DocA11ySupport: TemplateOnlyComponent = <template> | ||
| <h2 | ||
| class="doc-text-h2 doc-page-sidecar-scroll-margin-top" | ||
| id="support" | ||
| >Support</h2> | ||
| <p class="doc-text-body">If any accessibility issues have been found within | ||
| this component, let us know by | ||
| <LinkTo | ||
| class="doc-link-generic" | ||
| @route="show" | ||
| @model="about/support" | ||
| >submitting an issue</LinkTo>.</p> | ||
| </template>; | ||
|
|
||
| export default DocA11ySupport; |
This file was deleted.
Oops, something went wrong.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,20 @@ | ||
| /** | ||
| * Copyright (c) HashiCorp, Inc. | ||
| * SPDX-License-Identifier: MPL-2.0 | ||
| */ | ||
| import type { TemplateOnlyComponent } from '@ember/component/template-only'; | ||
|
|
||
| interface DocBadgeGroupSignature { | ||
| Blocks: { | ||
| default: []; | ||
| }; | ||
| Element: HTMLDivElement; | ||
| } | ||
|
|
||
| const DocBadgeGroup: TemplateOnlyComponent<DocBadgeGroupSignature> = <template> | ||
| <div class="doc-badge-group" ...attributes> | ||
| {{yield}} | ||
| </div> | ||
| </template>; | ||
|
|
||
| export default DocBadgeGroup; |
This file was deleted.
Oops, something went wrong.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,30 @@ | ||
| /** | ||
| * Copyright (c) HashiCorp, Inc. | ||
| * SPDX-License-Identifier: MPL-2.0 | ||
| */ | ||
| import type { TemplateOnlyComponent } from '@ember/component/template-only'; | ||
| import type { ComponentLike } from '@glint/template'; | ||
| import { hash } from '@ember/helper'; | ||
|
|
||
| import DocComponentApiProperty from 'website/components/doc/component-api/property'; | ||
| import type { DocComponentApiPropertySignature } from 'website/components/doc/component-api/property'; | ||
|
|
||
| interface DocComponentApiSignature { | ||
| Blocks: { | ||
| default: [ | ||
| { | ||
| Property: ComponentLike<DocComponentApiPropertySignature>; | ||
| }, | ||
| ]; | ||
| }; | ||
| Element: HTMLDivElement; | ||
| } | ||
|
|
||
| const DocComponentApi: TemplateOnlyComponent<DocComponentApiSignature> = | ||
| <template> | ||
| <div class="doc-component-api" ...attributes> | ||
| {{yield (hash Property=DocComponentApiProperty)}} | ||
| </div> | ||
| </template>; | ||
|
|
||
| export default DocComponentApi; | ||
This file was deleted.
Oops, something went wrong.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,91 @@ | ||
| /** | ||
| * Copyright (c) HashiCorp, Inc. | ||
| * SPDX-License-Identifier: MPL-2.0 | ||
| */ | ||
| import type { TemplateOnlyComponent } from '@ember/component/template-only'; | ||
| import { or, eq } from 'ember-truth-helpers'; | ||
| import type { WithBoundArgs } from '@glint/template'; | ||
| import { hash } from '@ember/helper'; | ||
|
|
||
| import DocBadge from 'website/components/doc/badge'; | ||
| import DocBanner from 'website/components/doc/banner'; | ||
|
|
||
| export interface DocComponentApiPropertySignature { | ||
| Args: { | ||
| name?: string; | ||
| type?: string; | ||
| required?: boolean; | ||
| deprecated?: boolean; | ||
| values?: string[]; | ||
| default?: string; | ||
| valueNote?: string; | ||
| }; | ||
| Blocks: { | ||
| default: [ | ||
| { | ||
| Banner: WithBoundArgs<typeof DocBanner, 'type'>; | ||
| }, | ||
| ]; | ||
| }; | ||
| Element: HTMLDivElement; | ||
| } | ||
|
|
||
| const DocComponentApiProperty: TemplateOnlyComponent<DocComponentApiPropertySignature> = | ||
| <template> | ||
| <div class="doc-component-api__property"> | ||
| {{#if @name}} | ||
| <div class="doc-component-api__property-info"> | ||
| <code class="doc-component-api__property-name">{{@name}}</code> | ||
| {{#if @type}} | ||
| <code class="doc-component-api__property-type">{{@type}}</code> | ||
| {{/if}} | ||
| {{#if @required}} | ||
| {{! @glint-expect-error - component not typed yet }} | ||
| <DocBadge @type="critical-inverted">Required</DocBadge> | ||
| {{/if}} | ||
| {{#if @deprecated}} | ||
| {{! @glint-expect-error - component not typed yet }} | ||
| <DocBadge @type="warning">Deprecated</DocBadge> | ||
| {{/if}} | ||
| </div> | ||
| {{/if}} | ||
| {{#if (or @values @valueNote)}} | ||
| {{#if @values}} | ||
| <ul class="doc-component-api__property-values" role="list"> | ||
| {{#each @values as |value|}} | ||
| <li | ||
| class="doc-component-api__property-value | ||
| {{if | ||
| (eq @default value) | ||
| 'doc-component-api__property-value--default' | ||
| }}" | ||
| > | ||
| {{value}}{{#if (eq @default value)}} | ||
| <span class="doc-sr-only">(default)</span>{{/if}} | ||
| </li> | ||
| {{/each}} | ||
| </ul> | ||
| {{else if @valueNote}} | ||
| <div class="doc-component-api__property-values"> | ||
| {{@valueNote}} | ||
| </div> | ||
| {{/if}} | ||
| {{else if @default}} | ||
| <ul class="doc-component-api__property-values" role="list"> | ||
| <li | ||
| class="doc-component-api__property-value doc-component-api__property-value--default" | ||
| > | ||
| {{@default}} | ||
| <span class="doc-sr-only">(default)</span> | ||
| </li> | ||
| </ul> | ||
| {{/if}} | ||
| {{#if (has-block)}} | ||
| <div class="doc-component-api__property-description"> | ||
| {{yield (hash Banner=(component DocBanner type="warning"))}} | ||
| </div> | ||
| {{/if}} | ||
| </div> | ||
| </template>; | ||
|
|
||
| export default DocComponentApiProperty; |
This file was deleted.
Oops, something went wrong.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,48 @@ | ||
| /** | ||
| * Copyright (c) HashiCorp, Inc. | ||
| * SPDX-License-Identifier: MPL-2.0 | ||
| */ | ||
| import type { TemplateOnlyComponent } from '@ember/component/template-only'; | ||
|
|
||
| import DocCopyButton from 'website/components/doc/copy-button'; | ||
|
|
||
| interface DocFontHelpersListSignature { | ||
| Args: { | ||
| items: Array<{ | ||
| previewClass: string; | ||
| previewText: string; | ||
| copyText?: string; | ||
| otherText?: string; | ||
| }>; | ||
| }; | ||
| } | ||
|
|
||
| const DocFontHelpersList: TemplateOnlyComponent<DocFontHelpersListSignature> = | ||
| <template> | ||
| <ul class="doc-font-helpers-list" role="list"> | ||
| {{#each @items as |item|}} | ||
| {{! role="listitem" is needed here because the class sets display: contents and some browsers and assistive technologies will ignore the implied role }} | ||
| <li class="doc-font-helpers-list__item" role="listitem"> | ||
| <div | ||
| class="doc-font-helpers-list__preview {{item.previewClass}}" | ||
| >{{item.previewText}}</div> | ||
| <div class="doc-font-helpers-list__content"> | ||
| {{#if item.copyText}} | ||
| <DocCopyButton | ||
| @textToShow=".{{item.copyText}}" | ||
| @textToCopy={{item.copyText}} | ||
| @type="ghost" | ||
| /> | ||
| {{/if}} | ||
| {{#if item.otherText}} | ||
| <code | ||
| class="doc-font-helpers-list__simple-code" | ||
| >{{item.otherText}}</code> | ||
| {{/if}} | ||
| </div> | ||
| </li> | ||
| {{/each}} | ||
| </ul> | ||
| </template>; | ||
|
|
||
| export default DocFontHelpersList; |
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.