Skip to content

Commit

Permalink
fix type issues
Browse files Browse the repository at this point in the history
  • Loading branch information
dustinsgoodman committed Mar 28, 2024
1 parent 40fc6be commit 3f5a0fe
Show file tree
Hide file tree
Showing 166 changed files with 261 additions and 247 deletions.
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { ContributorBanner as _ContributorBanner } from '@framework/system/src/components/homepage/contributor-banner'
import { ContributorData } from '@framework/system/src/components/homepage/contributor'
import { type ContributorData } from '@framework/system/src/components/homepage/contributor'
import { sprinkles } from '@framework/system/src/sprinkles/sprinkles.css'

export default function ContributorBanner({
Expand Down
28 changes: 14 additions & 14 deletions packages/landing-site/src/layouts/base.astro
Original file line number Diff line number Diff line change
@@ -1,25 +1,25 @@
---
import { fontHeadTags } from "@framework/system/src/globals/font-import.mjs"
import { getContributorsData } from "@framework/system/src/github-util/get-contributors"
import ResourcesInfoBanner from "../components/resources-info-banner"
import ContributorBanner from "../components/contributor-banner"
import Hero from "../components/hero"
import PitchCards from "../components/pitch-cards"
import Footer from "../components/footer"
import "@framework/system/src/globals/global-styles"
import { landingTheme } from "@framework/system/src/themes/themes.css"
import { landingBody } from "@framework/system/src/styles/layouts.css"
import { SocialMetaTags } from "../../../site/src/components/social-meta-tags"
import FontHeadTags from '@framework/system/src/globals/font-import.astro'
import { getContributorsData } from '@framework/system/src/github-util/get-contributors'
import ResourcesInfoBanner from '../components/resources-info-banner'
import ContributorBanner from '../components/contributor-banner'
import Hero from '../components/hero'
import PitchCards from '../components/pitch-cards'
import Footer from '../components/footer'
import '@framework/system/src/globals/global-styles'
import { landingTheme } from '@framework/system/src/themes/themes.css'
import { landingBody } from '@framework/system/src/styles/layouts.css'
import { SocialMetaTags } from '../../../site/src/components/social-meta-tags'
const { title } = Astro.props
const contributorsData = await getContributorsData()
---

<!DOCTYPE html>
<!doctype html>
<html class={landingTheme} lang="en">
<head>
<Fragment set:html={fontHeadTags} />
<FontHeadTags />
<title>{title}</title>
<meta name="robots" content="noindex" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
Expand All @@ -33,7 +33,7 @@ const contributorsData = await getContributorsData()
<meta name="theme-color" content="#ffffff" />
<meta charset="UTF-8" />
{
import.meta.env.VITE_ENVIRONMENT === "production" && (
import.meta.env.VITE_ENVIRONMENT === 'production' && (
<>
<Fragment
set:html={`<script async src="https://www.googletagmanager.com/gtag/js?id=${
Expand Down
9 changes: 6 additions & 3 deletions packages/site/src/layouts/base.astro
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
---
import { Logo } from '@framework/system/src/components/logo'
import { Sidebar } from '@framework/system/src/components/sidebar'
import { fontHeadTags } from '@framework/system/src/globals/font-import.mjs'
import FontHeadTags from '@framework/system/src/globals/font-import.astro'
import '@framework/system/src/globals/global-styles.ts'
import { sprinkles } from '@framework/system/src/sprinkles/sprinkles.css'
import {
Expand All @@ -18,12 +18,15 @@ import { getSearchData } from '@framework/site/src/utils/search-data'
const { title, currentCategory, currentTag, className } = Astro.props
const searchData = await getSearchData(import.meta.env.VITE_FRAMEWORK)
const navData = searchData.map((o) => pick(o, ['name', 'subCategories']))
const themeClass = themes[
`${import.meta.env.VITE_FRAMEWORK}Theme` as keyof typeof themes
] as string
---

<!doctype html>
<html class={themes[`${import.meta.env.VITE_FRAMEWORK}Theme`]} lang="en">
<html class={themeClass} lang="en">
<head>
<Fragment set:html={fontHeadTags} />
<FontHeadTags />
<title>{title}</title>

<meta name="robots" content="noindex" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,6 @@ const title = `${formatFieldValue(tag)} | ${
/>
</head>
<BaseLayout title={title} currentCategory={category} currentTag={tag}>
<h1 className={visuallyHidden}>{title}</h1>
<h1 class={visuallyHidden}>{title}</h1>
<Search client:load siteName={import.meta.env.VITE_FRAMEWORK} {...props} />
</BaseLayout>
2 changes: 1 addition & 1 deletion packages/site/src/pages/index.astro
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import BaseLayout from '../layouts/base.astro'
import Homepage from '../components/homepage'
import { FRAMEWORK_RESOURCES } from '@framework/system/src/globals/global-constants'
import { getCollection, type CollectionEntry } from 'astro:content'
import { type CollectionTypes } from '../content/config'
import { type CollectionTypes } from '@framework/site/src/types'
async function getCollectionData(collectionName: CollectionTypes) {
const collectionData = await getCollection(
Expand Down
4 changes: 2 additions & 2 deletions packages/site/src/pages/search.astro
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
import { formatFieldName } from '@framework/system/src/util/string-utils'
import { visuallyHidden } from '@framework/system/src/styles/utilities.css'
import BaseLayout from '../layouts/base.astro'
import Search from '../components/search'
import SearchComponent from '../components/search'
import { getSearchData } from '@framework/site/src/utils/search-data'
const searchData = await getSearchData(import.meta.env.VITE_FRAMEWORK)
Expand All @@ -18,7 +18,7 @@ const searchData = await getSearchData(import.meta.env.VITE_FRAMEWORK)
</head>
<BaseLayout title="Search">
<h1 class={visuallyHidden}>Search</h1>
<Search
<SearchComponent
data={searchData}
siteName={import.meta.env.VITE_FRAMEWORK}
client:load
Expand Down
8 changes: 4 additions & 4 deletions packages/site/src/utils/search-data.ts
Original file line number Diff line number Diff line change
@@ -1,20 +1,20 @@
import { getCollection, type CollectionEntry } from 'astro:content'
import { AllCategories } from '@framework/system/src/models/all-categories'
import { type AllCategories } from '@framework/system/src/models/all-categories'
import { blogIndexMetadata } from '@framework/system/src/models/blog'
import { bookIndexMetadata } from '@framework/system/src/models/book'
import { communityIndexMetadata } from '@framework/system/src/models/community'
import { courseIndexMetadata } from '@framework/system/src/models/course'
import {
Library,
type Library,
libraryIndexMetadata,
} from '@framework/system/src/models/library'
import { podcastIndexMetadata } from '@framework/system/src/models/podcast'
import { toolIndexMetadata } from '@framework/system/src/models/tool'
import { getTagsByType } from '@framework/site/src/utils/tags'
import {
getTagsByType,
type CollectionTypes,
type Frameworks,
} from '@framework/site/src/content/config'
} from '@framework/site/src/types'

async function getCollectionData(collectionName: CollectionTypes) {
const collectionData = await getCollection(
Expand Down
14 changes: 0 additions & 14 deletions packages/system/.storybook/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -46,18 +46,4 @@ module.exports = {
},
}
},
async previewHead(head) {
const { fontHeadTags } = await import('../src/globals/font-import.mjs')
return `
<style>
@media only percy {
.hide-in-percy {
visibility: hidden;
}
}
</style>
${head}
${fontHeadTags}
`
},
}
2 changes: 1 addition & 1 deletion packages/system/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,6 @@
"scripts": {
"dev": "start-storybook -p 6006",
"build": "build-storybook -o dist",
"percy": "percy storybook ./dist"
"verify": "tsc"
}
}
2 changes: 1 addition & 1 deletion packages/system/src/components/banner-tooltip.stories.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { type Story, type Meta } from '@storybook/react'
import {
BannerTooltip as BannerTooltipComponent,
BannerTooltipProps,
type BannerTooltipProps,
} from './banner-tooltip'

export default {
Expand Down
2 changes: 1 addition & 1 deletion packages/system/src/components/book-decorator.stories.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { type Story, type Meta } from '@storybook/react'
import {
BookDecorator as BookDecoratorComponent,
BookDecoratorProps,
type BookDecoratorProps,
} from './book-decorator'

export default {
Expand Down
4 changes: 2 additions & 2 deletions packages/system/src/components/button.stories.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { Meta, Story } from '@storybook/react'
import { Button as ButtonComponent, ButtonProps } from './button'
import { type Meta, type Story } from '@storybook/react'
import { Button as ButtonComponent, type ButtonProps } from './button'

export default {
title: 'Button',
Expand Down
2 changes: 1 addition & 1 deletion packages/system/src/components/button.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import classNames from 'classnames'
import React from 'react'
import { buttonStyle, ButtonVariants } from './button.css'
import { buttonStyle, type ButtonVariants } from './button.css'
import type * as Polymorphic from '@reach/polymorphic'

export type ButtonProps = {
Expand Down
2 changes: 1 addition & 1 deletion packages/system/src/components/card-divider.stories.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { type Story, type Meta } from '@storybook/react'
import { sprinkles } from '../sprinkles/sprinkles.css'
import {
CardDivider as CardDividerComponent,
CardDividerProps,
type CardDividerProps,
} from './card-divider'

export default {
Expand Down
2 changes: 1 addition & 1 deletion packages/system/src/components/cards/blog-card.stories.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { type Story, type Meta } from '@storybook/react'
import { sprinkles } from '../../sprinkles/sprinkles.css'
import { exampleBlogs } from '../../util/example-content'
import { titleFirstCardGrid } from './card-layouts.css'
import { BlogCard as BlogCardComponent, BlogCardProps } from './blog-card'
import { BlogCard as BlogCardComponent, type BlogCardProps } from './blog-card'

export default {
title: 'Cards/Blog Card',
Expand Down
4 changes: 2 additions & 2 deletions packages/system/src/components/cards/blog-card.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { Blog } from '../../models/blog'
import { ResourceCardProps, ResourceCard } from './resource-card'
import { type Blog } from '../../models/blog'
import { type ResourceCardProps, ResourceCard } from './resource-card'

export type BlogCardProps = Omit<
ResourceCardProps,
Expand Down
2 changes: 1 addition & 1 deletion packages/system/src/components/cards/book-card.stories.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { type Story, type Meta } from '@storybook/react'
import { sprinkles } from '../../sprinkles/sprinkles.css'
import { BookCard as BookCardComponent, BookCardProps } from './book-card'
import { BookCard as BookCardComponent, type BookCardProps } from './book-card'
import { exampleBooks } from '../../util/example-content'
import { imageFirstCardGrid } from './card-layouts.css'

Expand Down
4 changes: 2 additions & 2 deletions packages/system/src/components/cards/book-card.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { Book } from '../../models/book'
import { type Book } from '../../models/book'
import { BulletDivider } from '../bullet-divider'
import { ResourceCard, ResourceCardProps } from './resource-card'
import { ResourceCard, type ResourceCardProps } from './resource-card'

export type BookCardProps = Omit<
ResourceCardProps,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { type Story, type Meta } from '@storybook/react'
import {
CardSelector as CardSelectorComponent,
CardSelectorProps,
type CardSelectorProps,
} from './card-selector'

export default {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { type Story, type Meta } from '@storybook/react'
import {
CommunityCard as CommunityCardComponent,
CommunityCardProps,
type CommunityCardProps,
} from './community-card'
import { sprinkles } from '../../sprinkles/sprinkles.css'
import { exampleCommunities } from '../../util/example-content'
Expand Down
4 changes: 2 additions & 2 deletions packages/system/src/components/cards/community-card.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { Community } from '../../models/community'
import { ResourceCard, ResourceCardProps } from './resource-card'
import { type Community } from '../../models/community'
import { ResourceCard, type ResourceCardProps } from './resource-card'

export type CommunityCardProps = Omit<
ResourceCardProps,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import { exampleCourses } from '../../util/example-content'
import { titleFirstCardGrid } from './card-layouts.css'
import {
CourseCard as CourseCardComponent,
CourseCardProps,
type CourseCardProps,
} from './course-card'

export default {
Expand Down
4 changes: 2 additions & 2 deletions packages/system/src/components/cards/course-card.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { Course } from '../../models/course'
import { ResourceCard, ResourceCardProps } from './resource-card'
import { type Course } from '../../models/course'
import { ResourceCard, type ResourceCardProps } from './resource-card'

export type CourseCardProps = Omit<
ResourceCardProps,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import { exampleLibraries } from '../../util/example-content'
import { titleFirstCardGrid } from './card-layouts.css'
import {
LibraryCard as LibraryCardComponent,
LibraryCardProps,
type LibraryCardProps,
} from './library-card'

export default {
Expand Down
4 changes: 2 additions & 2 deletions packages/system/src/components/cards/library-card.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import classNames from 'classnames'
import { Library } from '../../models/library'
import { type Library } from '../../models/library'
import {
libraryCardBadgeStyle,
libraryPackageLinkStyle,
Expand All @@ -11,7 +11,7 @@ import {
getNpmDownloadsBadge,
} from '../../util/stats-util'
import { track } from '../../util/analytics-utils'
import { ResourceCard, ResourceCardProps } from './resource-card'
import { ResourceCard, type ResourceCardProps } from './resource-card'

export type LibraryCardProps = Omit<
ResourceCardProps,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import { examplePodcasts } from '../../util/example-content'
import { imageFirstCardGrid } from './card-layouts.css'
import {
PodcastCard as PodcastCardComponent,
PodcastCardProps,
type PodcastCardProps,
} from './podcast-card'

export default {
Expand Down
4 changes: 2 additions & 2 deletions packages/system/src/components/cards/podcast-card.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { Podcast } from '../../models/podcast'
import { ResourceCard, ResourceCardProps } from './resource-card'
import { type Podcast } from '../../models/podcast'
import { ResourceCard, type ResourceCardProps } from './resource-card'

export type PodcastCardProps = Omit<
ResourceCardProps,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
import { type Story, type Meta } from '@storybook/react'
import { useState } from 'react'
import { AttributeDefinition } from '../../models/all-categories'
import { type AttributeDefinition } from '../../models/all-categories'
import {
exampleBooks,
exampleCourses,
exampleTags,
} from '../../util/example-content'
import {
ResourceCard as ResourceCardComponent,
ResourceCardProps,
type ResourceCardProps,
} from './resource-card'

export default {
Expand Down
4 changes: 2 additions & 2 deletions packages/system/src/components/cards/resource-card.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import classNames from 'classnames'
import React, { useRef, useState, ReactNode } from 'react'
import { AttributeDefinition } from '../../models/all-categories'
import React, { useRef, useState, type ReactNode } from 'react'
import { type AttributeDefinition } from '../../models/all-categories'
import { sprinkles } from '../../sprinkles/sprinkles.css'
import { formatFieldValue } from '../../util/string-utils'
import { CardDivider } from '../card-divider'
Expand Down
2 changes: 1 addition & 1 deletion packages/system/src/components/cards/tool-card.stories.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { type Story, type Meta } from '@storybook/react'
import { sprinkles } from '../../sprinkles/sprinkles.css'
import { exampleTools } from '../../util/example-content'
import { titleFirstCardGrid } from './card-layouts.css'
import { ToolCard as ToolCardComponent, ToolCardProps } from './tool-card'
import { ToolCard as ToolCardComponent, type ToolCardProps } from './tool-card'

export default {
title: 'Cards/Tool Card',
Expand Down
4 changes: 2 additions & 2 deletions packages/system/src/components/cards/tool-card.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { Tool } from '../../models/tool'
import { ResourceCard, ResourceCardProps } from './resource-card'
import { type Tool } from '../../models/tool'
import { ResourceCard, type ResourceCardProps } from './resource-card'

export type ToolCardProps = Omit<
ResourceCardProps,
Expand Down
2 changes: 1 addition & 1 deletion packages/system/src/components/chip-selector.stories.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { type Story, type Meta } from '@storybook/react'
import {
ChipSelector as ChipSelectorComponent,
ChipSelectorProps,
type ChipSelectorProps,
} from './chip-selector'

export default {
Expand Down
2 changes: 1 addition & 1 deletion packages/system/src/components/chip.stories.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { type Story, type Meta } from '@storybook/react'
import { Chip as ChipComponent, ChipProps } from './chip'
import { Chip as ChipComponent, type ChipProps } from './chip'

export default {
title: 'Chip',
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { type Story, type Meta } from '@storybook/react'
import {
ComparisonTable as ComparisonTableComponent,
ComparisonTableProps,
type ComparisonTableProps,
} from './index'
import { exampleLibraries } from '../../util/example-content'
import { fullscreen } from '../../styles/layouts.css'
Expand Down

0 comments on commit 3f5a0fe

Please sign in to comment.