Skip to content

Commit

Permalink
Improve type checking job (withastro#1831)
Browse files Browse the repository at this point in the history
  • Loading branch information
HiDeoo committed May 7, 2024
1 parent 0e95895 commit dc2be71
Show file tree
Hide file tree
Showing 8 changed files with 345 additions and 15 deletions.
5 changes: 4 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -18,4 +18,7 @@ pnpm-debug.log*
__coverage__/

# Vercel output
.vercel
.vercel

# Created by @astrojs/check
/src/
7 changes: 4 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,18 +8,19 @@
"size": "size-limit",
"version": "pnpm changeset version && pnpm i --no-frozen-lockfile",
"format": "prettier -w --cache --plugin prettier-plugin-astro .",
"typecheck": "tsc -p tsconfig.typecheck.json"
"typecheck": "astro check"
},
"license": "MIT",
"devDependencies": {
"@astrojs/check": "^0.5.10",
"@changesets/changelog-github": "^0.4.8",
"@changesets/cli": "^2.26.1",
"@size-limit/file": "^8.2.4",
"astro": "^4.3.5",
"prettier": "^3.0.0",
"prettier-plugin-astro": "^0.13.0",
"typescript": "^5.4.5",
"size-limit": "^8.2.4"
"size-limit": "^8.2.4",
"typescript": "^5.4.5"
},
"packageManager": "pnpm@8.7.4",
"size-limit": [
Expand Down
1 change: 1 addition & 0 deletions packages/starlight/404.astro
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ const fallbackEntry: StarlightDocsEntry = {
hero: { tagline: t('404.text'), actions: [] },
pagefind: false,
sidebar: { hidden: false, attrs: {} },
draft: false,
},
render: async () => ({
Content: EmptyContent,
Expand Down
2 changes: 1 addition & 1 deletion packages/starlight/components/CallToAction.astro
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ interface Props {
variant: 'primary' | 'secondary' | 'minimal';
link: string;
icon?: undefined | { type: 'icon'; name: keyof typeof Icons } | { type: 'raw'; html: string };
attrs?: Omit<HTMLAttributes<'a'>, 'href'>;
attrs?: Omit<HTMLAttributes<'a'>, 'href'> | undefined;
}
const { link, variant, icon } = Astro.props;
Expand Down
2 changes: 1 addition & 1 deletion packages/starlight/integrations/expressive-code/index.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import {
astroExpressiveCode,
type AstroExpressiveCodeOptions,
addClassName,
type CustomConfigPreprocessors,
} from 'astro-expressive-code';
import { addClassName } from 'astro-expressive-code/hast';
import type { AstroIntegration } from 'astro';
import type { StarlightConfig } from '../../types';
import type { createTranslationSystemFromFs } from '../../utils/translations-fs';
Expand Down
9 changes: 4 additions & 5 deletions packages/tailwind/__tests__/tailwind.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,12 @@ import { test, expect, describe, vi } from 'vitest';
import StarlightTailwindPlugin from '..';

/** Generate a CSS string based on the passed CSS and HTML content. */
const generatePluginCss = ({
const generatePluginCss = async ({
css = '@tailwind base;',
html = '',
config = {},
}: { css?: string; html?: string; config?: Partial<Config> } = {}): Promise<string> => {
return postcss(
const result = await postcss(
tailwindcss({
// Enable Starlight plugin.
plugins: [StarlightTailwindPlugin()],
Expand All @@ -19,9 +19,8 @@ const generatePluginCss = ({
// Spread in any custom Tailwind config.
...config,
})
)
.process(css, { from: '' })
.then((result) => result.css);
).process(css, { from: '' });
return result.css;
};

describe('@tailwind base;', async () => {
Expand Down
Loading

0 comments on commit dc2be71

Please sign in to comment.