From a606b34a194d90057bb55503aea33d1419d9e1d4 Mon Sep 17 00:00:00 2001 From: prototypa Date: Mon, 29 Apr 2024 17:51:55 -0400 Subject: [PATCH] Format all files with prettier: npm run format --- .vscode/settings.json | 8 +- astro.config.mjs | 16 +-- package-lock.json | 22 +++- package.json | 3 +- src/components/CustomStyles.astro | 3 +- src/components/Logo.astro | 4 +- src/components/blog/GridItem.astro | 3 +- src/components/blog/ListItem.astro | 4 +- src/components/blog/Tags.astro | 12 +- src/components/common/Analytics.astro | 5 +- src/components/common/ApplyColorMode.astro | 26 ++--- src/components/common/CommonMeta.astro | 2 +- src/components/common/SiteVerification.astro | 4 +- src/components/common/SocialShare.astro | 28 ++++- src/components/common/ToggleMenu.astro | 9 +- src/components/ui/Background.astro | 2 +- src/components/ui/DListItem.astro | 13 +-- src/components/ui/Headline.astro | 35 ++---- src/components/ui/ItemGrid.astro | 16 +-- src/components/ui/ItemGrid2.astro | 103 ++++++------------ src/components/ui/Timeline.astro | 90 ++++++--------- src/components/ui/WidgetWrapper.astro | 14 +-- .../widgets/BlogHighlightedPosts.astro | 20 ++-- src/components/widgets/BlogLatestPosts.astro | 27 +++-- src/components/widgets/Footer.astro | 12 +- src/components/widgets/HeroText.astro | 14 ++- src/components/widgets/Pricing.astro | 3 +- src/components/widgets/Stats.astro | 2 +- src/components/widgets/Steps2.astro | 4 +- .../post/astrowind-template-in-depth.mdx | 2 +- .../post/markdown-elements-demo-post.mdx | 4 +- src/layouts/LandingLayout.astro | 4 +- src/layouts/MarkdownLayout.astro | 4 +- src/layouts/PageLayout.astro | 2 +- src/pages/[...blog]/index.astro | 4 +- src/pages/homes/mobile-app.astro | 2 +- src/pages/homes/personal.astro | 20 ++-- src/pages/homes/saas.astro | 3 +- src/pages/homes/startup.astro | 7 +- src/pages/index.astro | 6 +- src/pages/services.astro | 14 ++- src/types.d.ts | 24 ++-- src/utils/frontmatter.mjs | 4 +- vendor/README.md | 2 +- vendor/integration/index.mjs | 18 ++- vendor/integration/types.d.ts | 12 +- vendor/integration/utils/loadConfig.ts | 2 +- 47 files changed, 298 insertions(+), 340 deletions(-) diff --git a/.vscode/settings.json b/.vscode/settings.json index ee40024..10cdced 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -1,12 +1,6 @@ { "css.customData": ["./vscode.tailwind.json"], - "eslint.validate": [ - "javascript", - "javascriptreact", - "astro", - "typescript", - "typescriptreact" - ], + "eslint.validate": ["javascript", "javascriptreact", "astro", "typescript", "typescriptreact"], "files.associations": { "*.mdx": "markdown" }, diff --git a/astro.config.mjs b/astro.config.mjs index 9505516..c7f072e 100644 --- a/astro.config.mjs +++ b/astro.config.mjs @@ -12,17 +12,17 @@ import compress from '@playform/compress'; import astrowind from './vendor/integration'; -import { readingTimeRemarkPlugin, responsiveTablesRehypePlugin, lazyImagesRehypePlugin } from './src/utils/frontmatter.mjs'; +import { + readingTimeRemarkPlugin, + responsiveTablesRehypePlugin, + lazyImagesRehypePlugin, +} from './src/utils/frontmatter.mjs'; const __dirname = path.dirname(fileURLToPath(import.meta.url)); const hasExternalScripts = false; const whenExternalScripts = (items = []) => - hasExternalScripts - ? Array.isArray(items) - ? items.map((item) => item()) - : [items()] - : []; + hasExternalScripts ? (Array.isArray(items) ? items.map((item) => item()) : [items()]) : []; export default defineConfig({ output: 'static', @@ -70,13 +70,13 @@ export default defineConfig({ }), astrowind({ - config: "./src/config.yaml" + config: './src/config.yaml', }), ], image: { service: squooshImageService(), - domains: ["cdn.pixabay.com"], + domains: ['cdn.pixabay.com'], }, markdown: { diff --git a/package-lock.json b/package-lock.json index f414252..08ab79f 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,6 +1,6 @@ { "name": "@onwidget/astrowind", - "version": "1.0.0-beta.32", + "version": "1.0.0-beta.33", "lockfileVersion": 3, "requires": true, "packages": { @@ -29,6 +29,7 @@ "@iconify-json/tabler": "^1.1.110", "@playform/compress": "0.0.3", "@tailwindcss/typography": "^0.5.13", + "@types/eslint__js": "^8.42.3", "@types/js-yaml": "^4.0.9", "@types/lodash.merge": "^4.6.9", "@typescript-eslint/eslint-plugin": "^7.7.1", @@ -2571,6 +2572,25 @@ "@types/ms": "*" } }, + "node_modules/@types/eslint": { + "version": "8.56.10", + "resolved": "https://registry.npmjs.org/@types/eslint/-/eslint-8.56.10.tgz", + "integrity": "sha512-Shavhk87gCtY2fhXDctcfS3e6FdxWkCx1iUZ9eEUbh7rTqlZT0/IzOkCOVt0fCjcFuZ9FPYfuezTBImfHCDBGQ==", + "dev": true, + "dependencies": { + "@types/estree": "*", + "@types/json-schema": "*" + } + }, + "node_modules/@types/eslint__js": { + "version": "8.42.3", + "resolved": "https://registry.npmjs.org/@types/eslint__js/-/eslint__js-8.42.3.tgz", + "integrity": "sha512-alfG737uhmPdnvkrLdZLcEKJ/B8s9Y4hrZ+YAdzUeoArBlSUERA2E87ROfOaS4jd/C45fzOoZzidLc1IPwLqOw==", + "dev": true, + "dependencies": { + "@types/eslint": "*" + } + }, "node_modules/@types/estree": { "version": "1.0.5", "license": "MIT" diff --git a/package.json b/package.json index 188b867..3a20686 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@onwidget/astrowind", - "version": "1.0.0-beta.32", + "version": "1.0.0-beta.33", "description": "AstroWind: A free template using Astro 4.0 and Tailwind CSS. Astro starter theme.", "type": "module", "private": true, @@ -38,6 +38,7 @@ "@iconify-json/tabler": "^1.1.110", "@playform/compress": "0.0.3", "@tailwindcss/typography": "^0.5.13", + "@types/eslint__js": "^8.42.3", "@types/js-yaml": "^4.0.9", "@types/lodash.merge": "^4.6.9", "@typescript-eslint/eslint-plugin": "^7.7.1", diff --git a/src/components/CustomStyles.astro b/src/components/CustomStyles.astro index 26ce2db..b17d3ae 100644 --- a/src/components/CustomStyles.astro +++ b/src/components/CustomStyles.astro @@ -17,7 +17,6 @@ import '@fontsource-variable/inter'; // Oswald // 'Space Grotesk' // Urbanist - --- \ No newline at end of file + diff --git a/src/components/Logo.astro b/src/components/Logo.astro index ae9b9fd..8469792 100644 --- a/src/components/Logo.astro +++ b/src/components/Logo.astro @@ -2,6 +2,8 @@ import { SITE } from 'astrowind:config'; --- - + 🚀 {SITE?.name} diff --git a/src/components/blog/GridItem.astro b/src/components/blog/GridItem.astro index 3625a68..2b3ba44 100644 --- a/src/components/blog/GridItem.astro +++ b/src/components/blog/GridItem.astro @@ -7,13 +7,12 @@ import Image from '~/components/common/Image.astro'; import { findImage } from '~/utils/images'; import { getPermalink } from '~/utils/permalinks'; - export interface Props { post: Post; } const { post } = Astro.props; -const image = (await findImage(post.image)); +const image = await findImage(post.image); ---
diff --git a/src/components/blog/ListItem.astro b/src/components/blog/ListItem.astro index dc964d2..db4dac5 100644 --- a/src/components/blog/ListItem.astro +++ b/src/components/blog/ListItem.astro @@ -53,8 +53,7 @@ const link = APP_BLOG?.post?.isEnabled ? getPermalink(post.permalink, 'post') : post.author && ( <> {' '} - ·{' '} - + · {post.author.replaceAll('-', ' ')} ) @@ -70,7 +69,6 @@ const link = APP_BLOG?.post?.isEnabled ? getPermalink(post.permalink, 'post') : ) } -

diff --git a/src/components/blog/Tags.astro b/src/components/blog/Tags.astro index 636a5de..30b09e2 100644 --- a/src/components/blog/Tags.astro +++ b/src/components/blog/Tags.astro @@ -1,12 +1,12 @@ --- import { getPermalink } from '~/utils/permalinks'; -import { APP_BLOG } from 'astrowind:config'; +import { APP_BLOG } from 'astrowind:config'; import type { Post } from '~/types'; export interface Props { tags: Post['tags']; - class?: string; + class?: string; title?: string | undefined; isCategory?: boolean; } @@ -18,7 +18,11 @@ const { tags, class: className = 'text-sm', title = undefined, isCategory = fals tags && Array.isArray(tags) && ( <> <> - {title !== undefined && {title}} + {title !== undefined && ( + + {title} + + )}

-
\ No newline at end of file + +
+
diff --git a/src/components/ui/Headline.astro b/src/components/ui/Headline.astro index d2646a5..621b23d 100644 --- a/src/components/ui/Headline.astro +++ b/src/components/ui/Headline.astro @@ -1,48 +1,35 @@ --- -import type { Headline as Props } from "~/types"; -import { twMerge } from "tailwind-merge"; +import type { Headline as Props } from '~/types'; +import { twMerge } from 'tailwind-merge'; const { - title = await Astro.slots.render("title"), - subtitle = await Astro.slots.render("subtitle"), + title = await Astro.slots.render('title'), + subtitle = await Astro.slots.render('subtitle'), tagline, classes = {}, } = Astro.props; const { - container: containerClass = "max-w-3xl", - title: titleClass = "text-3xl md:text-4xl ", - subtitle: subtitleClass = "text-xl", + container: containerClass = 'max-w-3xl', + title: titleClass = 'text-3xl md:text-4xl ', + subtitle: subtitleClass = 'text-xl', } = classes; --- { (title || subtitle || tagline) && ( -
+
{tagline && ( -

+

)} {title && (

)} - {subtitle && ( -

- )} + {subtitle &&

}

) } diff --git a/src/components/ui/ItemGrid.astro b/src/components/ui/ItemGrid.astro index 7fc1b89..fe560a3 100644 --- a/src/components/ui/ItemGrid.astro +++ b/src/components/ui/ItemGrid.astro @@ -24,10 +24,10 @@ const { columns === 4 ? 'lg:grid-cols-4 md:grid-cols-3 sm:grid-cols-2' : columns === 3 - ? 'lg:grid-cols-3 sm:grid-cols-2' - : columns === 2 - ? 'sm:grid-cols-2 ' - : '' + ? 'lg:grid-cols-3 sm:grid-cols-2' + : columns === 2 + ? 'sm:grid-cols-2 ' + : '' }`, containerClass )} @@ -52,13 +52,7 @@ const { /> )} {callToAction && ( -
+
)} diff --git a/src/components/ui/ItemGrid2.astro b/src/components/ui/ItemGrid2.astro index f3c683b..34a902e 100644 --- a/src/components/ui/ItemGrid2.astro +++ b/src/components/ui/ItemGrid2.astro @@ -1,23 +1,18 @@ --- -import type { ItemGrid as Props } from "~/types"; -import { Icon } from "astro-icon/components"; -import { twMerge } from "tailwind-merge"; -import Button from "./Button.astro"; +import type { ItemGrid as Props } from '~/types'; +import { Icon } from 'astro-icon/components'; +import { twMerge } from 'tailwind-merge'; +import Button from './Button.astro'; + +const { items = [], columns, defaultIcon = '', classes = {} } = Astro.props; const { - items = [], - columns, - defaultIcon = "", - classes = {}, -} = Astro.props; - -const { - container: containerClass = "", + container: containerClass = '', // container: containerClass = "sm:grid-cols-1 md:grid-cols-2 lg:grid-cols-3", - panel: panelClass = "", - title: titleClass = "", - description: descriptionClass = "", - icon: defaultIconClass = "text-primary", + panel: panelClass = '', + title: titleClass = '', + description: descriptionClass = '', + icon: defaultIconClass = 'text-primary', } = classes; --- @@ -27,68 +22,32 @@ const { class={twMerge( `grid gap-8 gap-x-12 sm:gap-y-8 ${ columns === 4 - ? "lg:grid-cols-4 md:grid-cols-3 sm:grid-cols-2" + ? 'lg:grid-cols-4 md:grid-cols-3 sm:grid-cols-2' : columns === 3 - ? "lg:grid-cols-3 sm:grid-cols-2" - : columns === 2 - ? "sm:grid-cols-2 " - : "" + ? 'lg:grid-cols-3 sm:grid-cols-2' + : columns === 2 + ? 'sm:grid-cols-2 ' + : '' }`, containerClass )} > - {items.map( - ({ - title, - description, - icon, - callToAction, - classes: itemClasses = {}, - }) => ( -
- {(icon || defaultIcon) && ( - - )} -
- {title} + {items.map(({ title, description, icon, callToAction, classes: itemClasses = {} }) => ( +
+ {(icon || defaultIcon) && ( + + )} +
{title}
+ {description && ( +

+ )} + {callToAction && ( +

+
- {description && ( -

- )} - {callToAction && ( -

-
- )} -
- ) - )} + )} +
+ ))}
) } diff --git a/src/components/ui/Timeline.astro b/src/components/ui/Timeline.astro index b393b50..8154604 100644 --- a/src/components/ui/Timeline.astro +++ b/src/components/ui/Timeline.astro @@ -1,7 +1,7 @@ --- -import { Icon } from "astro-icon/components"; -import { twMerge } from "tailwind-merge"; -import type { Item } from "~/types"; +import { Icon } from 'astro-icon/components'; +import { twMerge } from 'tailwind-merge'; +import type { Item } from '~/types'; export interface Props { items?: Array; @@ -12,71 +12,43 @@ export interface Props { const { items = [], classes = {}, defaultIcon } = Astro.props as Props; const { - container: containerClass = "", - panel: panelClass = "", - title: titleClass = "", - description: descriptionClass = "", - icon: defaultIconClass = "text-primary dark:text-slate-200 border-primary dark:border-blue-700", + container: containerClass = '', + panel: panelClass = '', + title: titleClass = '', + description: descriptionClass = '', + icon: defaultIconClass = 'text-primary dark:text-slate-200 border-primary dark:border-blue-700', } = classes; --- { items && items.length && (
- {items.map( - ( - { title, description, icon, classes: itemClasses = {} }, - index = 0 - ) => ( -
-
-
-
- {(icon || defaultIcon) && ( - - )} -
+ {items.map(({ title, description, icon, classes: itemClasses = {} }, index = 0) => ( +
+
+
+
+ {(icon || defaultIcon) && ( + + )}
- {index !== items.length - 1 && ( -
- )} -
-
- {title && ( -

- )} - {description && ( -

- )}

+ {index !== items.length - 1 &&
}
- ) - )} +
+ {title &&

} + {description && ( +

+ )} +

+
+ ))}
) } diff --git a/src/components/ui/WidgetWrapper.astro b/src/components/ui/WidgetWrapper.astro index 3ae1758..a53df1d 100644 --- a/src/components/ui/WidgetWrapper.astro +++ b/src/components/ui/WidgetWrapper.astro @@ -1,15 +1,15 @@ --- -import type { HTMLTag } from "astro/types"; -import type { Widget } from "~/types"; -import { twMerge } from "tailwind-merge"; -import Background from "./Background.astro"; +import type { HTMLTag } from 'astro/types'; +import type { Widget } from '~/types'; +import { twMerge } from 'tailwind-merge'; +import Background from './Background.astro'; export interface Props extends Widget { containerClass?: string; - ["as"]?: HTMLTag; + ['as']?: HTMLTag; } -const { id, isDark = false, containerClass = "", bg, as = "section" } = Astro.props; +const { id, isDark = false, containerClass = '', bg, as = 'section' } = Astro.props; const WrapperTag = as; --- @@ -22,7 +22,7 @@ const WrapperTag = as;
diff --git a/src/components/widgets/BlogHighlightedPosts.astro b/src/components/widgets/BlogHighlightedPosts.astro index 3f98673..75f35a9 100644 --- a/src/components/widgets/BlogHighlightedPosts.astro +++ b/src/components/widgets/BlogHighlightedPosts.astro @@ -1,12 +1,12 @@ --- -import { APP_BLOG } from "astrowind:config"; +import { APP_BLOG } from 'astrowind:config'; -import Grid from "~/components/blog/Grid.astro"; +import Grid from '~/components/blog/Grid.astro'; -import { getBlogPermalink } from "~/utils/permalinks"; -import { findPostsByIds } from "~/utils/blog"; -import WidgetWrapper from "~/components/ui/WidgetWrapper.astro"; -import type { Widget } from "~/types"; +import { getBlogPermalink } from '~/utils/permalinks'; +import { findPostsByIds } from '~/utils/blog'; +import WidgetWrapper from '~/components/ui/WidgetWrapper.astro'; +import type { Widget } from '~/types'; export interface Props extends Widget { title?: string; @@ -17,16 +17,16 @@ export interface Props extends Widget { } const { - title = await Astro.slots.render("title"), - linkText = "View all posts", + title = await Astro.slots.render('title'), + linkText = 'View all posts', linkUrl = getBlogPermalink(), - information = await Astro.slots.render("information"), + information = await Astro.slots.render('information'), postIds = [], id, isDark = false, classes = {}, - bg = await Astro.slots.render("bg"), + bg = await Astro.slots.render('bg'), } = Astro.props; const posts = APP_BLOG.isEnabled ? await findPostsByIds(postIds) : []; diff --git a/src/components/widgets/BlogLatestPosts.astro b/src/components/widgets/BlogLatestPosts.astro index 407a310..242c686 100644 --- a/src/components/widgets/BlogLatestPosts.astro +++ b/src/components/widgets/BlogLatestPosts.astro @@ -1,13 +1,13 @@ --- -import { APP_BLOG } from "astrowind:config"; +import { APP_BLOG } from 'astrowind:config'; -import Grid from "~/components/blog/Grid.astro"; +import Grid from '~/components/blog/Grid.astro'; -import { getBlogPermalink } from "~/utils/permalinks"; -import { findLatestPosts } from "~/utils/blog"; -import WidgetWrapper from "~/components/ui/WidgetWrapper.astro"; -import type { Widget } from "~/types"; -import Button from "../ui/Button.astro"; +import { getBlogPermalink } from '~/utils/permalinks'; +import { findLatestPosts } from '~/utils/blog'; +import WidgetWrapper from '~/components/ui/WidgetWrapper.astro'; +import type { Widget } from '~/types'; +import Button from '../ui/Button.astro'; export interface Props extends Widget { title?: string; @@ -18,16 +18,16 @@ export interface Props extends Widget { } const { - title = await Astro.slots.render("title"), - linkText = "View all posts", + title = await Astro.slots.render('title'), + linkText = 'View all posts', linkUrl = getBlogPermalink(), - information = await Astro.slots.render("information"), + information = await Astro.slots.render('information'), count = 4, id, isDark = false, classes = {}, - bg = await Astro.slots.render("bg"), + bg = await Astro.slots.render('bg'), } = Astro.props; const posts = APP_BLOG.isEnabled ? await findLatestPosts({ count }) : []; @@ -44,7 +44,10 @@ const posts = APP_BLOG.isEnabled ? await findLatestPosts({ count }) : []; set:html={title} /> {APP_BLOG.list.isEnabled && linkText && linkUrl && ( - + )}
)} diff --git a/src/components/widgets/Footer.astro b/src/components/widgets/Footer.astro index 0831687..2b7fb6e 100644 --- a/src/components/widgets/Footer.astro +++ b/src/components/widgets/Footer.astro @@ -38,12 +38,12 @@ const { socialLinks = [], secondaryLinks = [], links = [], footNote = '', theme { secondaryLinks.map(({ text, href }, index) => ( <> - {index !== 0 ? ' · ' : ''} - + {index !== 0 ? ' · ' : ''} + )) } diff --git a/src/components/widgets/HeroText.astro b/src/components/widgets/HeroText.astro index 57d8627..f87817a 100644 --- a/src/components/widgets/HeroText.astro +++ b/src/components/widgets/HeroText.astro @@ -27,12 +27,14 @@ const {
- {tagline && ( -

- )} + { + tagline && ( +

+ ) + } { title && (

) : ( - callToAction && callToAction.href &&

)} diff --git a/src/components/widgets/Stats.astro b/src/components/widgets/Stats.astro index 51b1e80..709fdd2 100644 --- a/src/components/widgets/Stats.astro +++ b/src/components/widgets/Stats.astro @@ -23,7 +23,7 @@ const { { stats && stats.map(({ amount, title, icon }) => ( -
+
{icon && (
diff --git a/src/components/widgets/Steps2.astro b/src/components/widgets/Steps2.astro index 4613e84..8f7afb5 100644 --- a/src/components/widgets/Steps2.astro +++ b/src/components/widgets/Steps2.astro @@ -42,9 +42,7 @@ const { ) : ( callToAction && callToAction.text && - callToAction.href && ( -
diff --git a/src/content/post/astrowind-template-in-depth.mdx b/src/content/post/astrowind-template-in-depth.mdx index 7b5c142..e7c4dd8 100644 --- a/src/content/post/astrowind-template-in-depth.mdx +++ b/src/content/post/astrowind-template-in-depth.mdx @@ -199,7 +199,7 @@ const { subtitle = await Astro.slots.render('subtitle') } = Astro.props; //... {subtitle &&

} - //... +//... ``` There's a lot to wrap your head around, here. diff --git a/src/content/post/markdown-elements-demo-post.mdx b/src/content/post/markdown-elements-demo-post.mdx index 447b08d..a55669d 100644 --- a/src/content/post/markdown-elements-demo-post.mdx +++ b/src/content/post/markdown-elements-demo-post.mdx @@ -197,8 +197,8 @@ import Logo from "~/components/Logo.astro"; -### Vimeo +### Vimeo -[[Top]](#top) \ No newline at end of file +[[Top]](#top) diff --git a/src/layouts/LandingLayout.astro b/src/layouts/LandingLayout.astro index f9140e9..0554afa 100644 --- a/src/layouts/LandingLayout.astro +++ b/src/layouts/LandingLayout.astro @@ -23,7 +23,7 @@ const { metadata } = Astro.props; actions={[ { text: 'Download', - href: 'https://github.com/onwidget/astrowind' + href: 'https://github.com/onwidget/astrowind', }, ]} showToggleTheme @@ -32,4 +32,4 @@ const { metadata } = Astro.props; - \ No newline at end of file + diff --git a/src/layouts/MarkdownLayout.astro b/src/layouts/MarkdownLayout.astro index 0f6a5f8..ae6e9b0 100644 --- a/src/layouts/MarkdownLayout.astro +++ b/src/layouts/MarkdownLayout.astro @@ -5,8 +5,8 @@ import type { MetaData } from '~/types'; export interface Props { frontmatter: { - title?: string - } + title?: string; + }; } const { frontmatter } = Astro.props; diff --git a/src/layouts/PageLayout.astro b/src/layouts/PageLayout.astro index 749691c..e3bc4da 100644 --- a/src/layouts/PageLayout.astro +++ b/src/layouts/PageLayout.astro @@ -28,4 +28,4 @@ const { metadata } = Astro.props;