Skip to content

Commit

Permalink
Sync with hello-astro
Browse files Browse the repository at this point in the history
  • Loading branch information
ChristineTham committed Mar 31, 2024
1 parent 302996c commit eca3af0
Show file tree
Hide file tree
Showing 740 changed files with 10,643 additions and 4,151 deletions.
3,247 changes: 3,247 additions & 0 deletions .astro/icon.d.ts

Large diffs are not rendered by default.

89 changes: 13 additions & 76 deletions .astro/types.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,76 +19,13 @@ declare module 'astro:content' {
}

declare module 'astro:content' {
export { z } from 'astro/zod';
export type CollectionEntry<C extends keyof AnyEntryMap> = AnyEntryMap[C][keyof AnyEntryMap[C]];
type Flatten<T> = T extends { [K: string]: infer U } ? U : never;

// TODO: Remove this when having this fallback is no longer relevant. 2.3? 3.0? - erika, 2023-04-04
/**
* @deprecated
* `astro:content` no longer provide `image()`.
*
* Please use it through `schema`, like such:
* ```ts
* import { defineCollection, z } from "astro:content";
*
* defineCollection({
* schema: ({ image }) =>
* z.object({
* image: image(),
* }),
* });
* ```
*/
export const image: never;
export type CollectionKey = keyof AnyEntryMap;
export type CollectionEntry<C extends CollectionKey> = Flatten<AnyEntryMap[C]>;

// This needs to be in sync with ImageMetadata
export type ImageFunction = () => import('astro/zod').ZodObject<{
src: import('astro/zod').ZodString;
width: import('astro/zod').ZodNumber;
height: import('astro/zod').ZodNumber;
format: import('astro/zod').ZodUnion<
[
import('astro/zod').ZodLiteral<'png'>,
import('astro/zod').ZodLiteral<'jpg'>,
import('astro/zod').ZodLiteral<'jpeg'>,
import('astro/zod').ZodLiteral<'tiff'>,
import('astro/zod').ZodLiteral<'webp'>,
import('astro/zod').ZodLiteral<'gif'>,
import('astro/zod').ZodLiteral<'svg'>
]
>;
}>;

type BaseSchemaWithoutEffects =
| import('astro/zod').AnyZodObject
| import('astro/zod').ZodUnion<import('astro/zod').AnyZodObject[]>
| import('astro/zod').ZodDiscriminatedUnion<string, import('astro/zod').AnyZodObject[]>
| import('astro/zod').ZodIntersection<
import('astro/zod').AnyZodObject,
import('astro/zod').AnyZodObject
>;

type BaseSchema =
| BaseSchemaWithoutEffects
| import('astro/zod').ZodEffects<BaseSchemaWithoutEffects>;

export type SchemaContext = { image: ImageFunction };

type DataCollectionConfig<S extends BaseSchema> = {
type: 'data';
schema?: S | ((context: SchemaContext) => S);
};

type ContentCollectionConfig<S extends BaseSchema> = {
type?: 'content';
schema?: S | ((context: SchemaContext) => S);
};

type CollectionConfig<S> = ContentCollectionConfig<S> | DataCollectionConfig<S>;

export function defineCollection<S extends BaseSchema>(
input: CollectionConfig<S>
): CollectionConfig<S>;
export type ContentCollectionKey = keyof ContentEntryMap;
export type DataCollectionKey = keyof DataEntryMap;

type AllValuesOf<T> = T extends any ? T[keyof T] : never;
type ValidContentEntrySlug<C extends keyof ContentEntryMap> = AllValuesOf<
Expand All @@ -97,7 +34,7 @@ declare module 'astro:content' {

export function getEntryBySlug<
C extends keyof ContentEntryMap,
E extends ValidContentEntrySlug<C> | (string & {})
E extends ValidContentEntrySlug<C> | (string & {}),
>(
collection: C,
// Note that this has to accept a regular string too, for SSR
Expand All @@ -122,7 +59,7 @@ declare module 'astro:content' {

export function getEntry<
C extends keyof ContentEntryMap,
E extends ValidContentEntrySlug<C> | (string & {})
E extends ValidContentEntrySlug<C> | (string & {}),
>(entry: {
collection: C;
slug: E;
Expand All @@ -131,7 +68,7 @@ declare module 'astro:content' {
: Promise<CollectionEntry<C> | undefined>;
export function getEntry<
C extends keyof DataEntryMap,
E extends keyof DataEntryMap[C] | (string & {})
E extends keyof DataEntryMap[C] | (string & {}),
>(entry: {
collection: C;
id: E;
Expand All @@ -140,7 +77,7 @@ declare module 'astro:content' {
: Promise<CollectionEntry<C> | undefined>;
export function getEntry<
C extends keyof ContentEntryMap,
E extends ValidContentEntrySlug<C> | (string & {})
E extends ValidContentEntrySlug<C> | (string & {}),
>(
collection: C,
slug: E
Expand All @@ -149,7 +86,7 @@ declare module 'astro:content' {
: Promise<CollectionEntry<C> | undefined>;
export function getEntry<
C extends keyof DataEntryMap,
E extends keyof DataEntryMap[C] | (string & {})
E extends keyof DataEntryMap[C] | (string & {}),
>(
collection: C,
id: E
Expand Down Expand Up @@ -179,11 +116,11 @@ declare module 'astro:content' {
? {
collection: C;
slug: ValidContentEntrySlug<C>;
}
}
: {
collection: C;
id: keyof DataEntryMap[C];
}
}
>;
// Allow generic `string` to avoid excessive type errors in the config
// if `dev` is not running to update as you edit.
Expand Down Expand Up @@ -5228,5 +5165,5 @@ declare module 'astro:content' {

type AnyEntryMap = ContentEntryMap & DataEntryMap;

type ContentConfig = typeof import("../src/content/config");
export type ContentConfig = typeof import("../src/content/config.js");
}
32 changes: 32 additions & 0 deletions .eslintrc.cjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
/** @type {import("eslint").Linter.Config} */
module.exports = {
extends: [
'plugin:css/recommended',
'plugin:mdx/recommended',
'plugin:markdown/recommended-legacy',
'plugin:astro/recommended'
],
"plugins": [
"css"
],
parser: '@typescript-eslint/parser',
parserOptions: {
tsconfigRootDir: __dirname,
sourceType: 'module',
ecmaVersion: 'latest'
},
overrides: [
{
files: ['*.astro'],
parser: 'astro-eslint-parser',
parserOptions: {
parser: '@typescript-eslint/parser',
extraFileExtensions: ['.astro']
},
rules: {
// override/add rules settings here, such as:
// "astro/no-set-html-directive": "error"
}
}
]
}
12 changes: 6 additions & 6 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,12 +19,12 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Checkout your repository using git
uses: actions/checkout@v3
uses: actions/checkout@v4
- name: Install, build, and upload your site
uses: withastro/action@v0
with:
package-manager: pnpm
node-version: 18
uses: withastro/action@v2
# with:
# package-manager: pnpm
# node-version: 18
# path: . # The root location of your Astro project inside the repository. (optional)

deploy:
Expand All @@ -36,4 +36,4 @@ jobs:
steps:
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v1
uses: actions/deploy-pages@v4
13 changes: 0 additions & 13 deletions .prettierrc.json

This file was deleted.

1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
# Chris Tham Personal Web Site

![deploy](https://github.com/ChristineTham/christinetham.github.io/actions/workflows/deploy.yml/badge.svg)

This is my personal blog/web site written in Markdown and [Astro](https://astro.build) using the [Hello Astro](https://github.com/hellotham/hello-astro) starter as a template.
Expand Down
16 changes: 3 additions & 13 deletions astro.config.mjs
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
import { defineConfig, sharpImageService } from 'astro/config'
import { defineConfig } from 'astro/config'
import tailwind from '@astrojs/tailwind'
import sitemap from '@astrojs/sitemap'
import mdx from '@astrojs/mdx'
import alpinejs from '@astrojs/alpinejs'
import robotsTxt from 'astro-robots-txt'
import icon from "astro-icon";

import remarkMath from 'remark-math'
import rehypeKatex from 'rehype-katex'
Expand All @@ -13,19 +14,8 @@ import { remarkDiagram } from './remark-plugins/remark-diagram.mjs';

// https://astro.build/config
export default defineConfig({
experimental: {
assets: true
},
image: {
service: sharpImageService(),
},
vite: {
ssr: {
external: ['svgo'],
},
},
site: 'https://christham.net',
integrations: [tailwind(), sitemap(), mdx(), alpinejs(), robotsTxt()],
integrations: [icon(), tailwind(), sitemap(), mdx(), alpinejs(), robotsTxt()],
markdown: {
extendDefaultPlugins: true,
remarkPlugins: [
Expand Down
78 changes: 46 additions & 32 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,53 +4,67 @@
"version": "1.0.0",
"scripts": {
"dev": "astro dev",
"clean": "rm -rf node_modules .astro dist",
"start": "astro dev",
"build": "astro build",
"preview": "astro preview",
"format": "prettier --write src/content",
"lint": "astro check",
"check": "astro check",
"lint": "pnpm run lint:prettier ; pnpm run lint:eslint",
"lint:prettier": "prettier --write \"src/**/*.{js,jsx,ts,tsx,md,mdx,astro}\"",
"lint:eslint": "eslint --fix \"src/**/*.{js,ts,jsx,tsx,astro}\"",
"astro": "astro"
},
"devDependencies": {
"@akebifiky/remark-simple-plantuml": "^1.0.2",
"@astrojs/alpinejs": "^0.2.2",
"@astrojs/mdx": "^0.19.4",
"@astrojs/rss": "^2.4.3",
"@astrojs/sitemap": "^1.3.1",
"@astrojs/tailwind": "^3.1.3",
"@astrojs/alpinejs": "^0.4.0",
"@astrojs/mdx": "^2.2.2",
"@astrojs/rss": "^4.0.5",
"@astrojs/sitemap": "^3.1.2",
"@astrojs/tailwind": "^5.1.0",
"@tailwindcss/aspect-ratio": "^0.4.2",
"@tailwindcss/forms": "^0.5.3",
"@tailwindcss/line-clamp": "^0.4.4",
"@tailwindcss/typography": "^0.5.9",
"@types/alpinejs": "^3.7.1",
"@types/leaflet": "^1.9.3",
"@types/photoswipe": "^4.1.2",
"alpinejs": "^3.12.1",
"astro": "^2.5.5",
"astro-robots-txt": "^0.5.0",
"@tailwindcss/forms": "^0.5.7",
"@tailwindcss/typography": "^0.5.12",
"@types/alpinejs": "^3.13.10",
"@types/leaflet": "^1.9.8",
"@typescript-eslint/parser": "^7.4.0",
"alpinejs": "^3.13.7",
"astro": "^4.5.12",
"astro-robots-txt": "^1.0.0",
"eslint": "^8.57.0",
"eslint-plugin-astro": "^0.33.1",
"eslint-plugin-css": "^0.9.2",
"eslint-plugin-jsx-a11y": "^6.8.0",
"eslint-plugin-markdown": "^4.0.1",
"eslint-plugin-mdx": "^3.1.5",
"exifr": "^7.1.3",
"mdast-util-to-string": "^3.2.0",
"postcss": "^8.4.23",
"prettier-plugin-astro": "^0.9.0",
"mdast-util-to-string": "^4.0.0",
"postcss": "^8.4.38",
"prettier": "^3.2.5",
"prettier-config-standard": "^7.0.0",
"prettier-plugin-astro": "^0.13.0",
"prettier-plugin-tailwindcss": "^0.5.13",
"reading-time": "^1.5.0",
"rehype-katex": "^6.0.3",
"remark-math": "^5.1.1",
"rollup": "^3.23.0",
"rehype-katex": "^7.0.0",
"remark-math": "^6.0.0",
"rollup": "^4.13.2",
"schema-dts": "^1.1.2",
"sharp": "^0.32.1",
"tailwindcss": "^3.3.2",
"typescript": "^5.0.4",
"unist-util-visit": "^4.1.2"
"sharp": "^0.33.3",
"tailwindcss": "^3.4.3",
"typescript": "^5.4.3",
"unist-util-visit": "^5.0.0"
},
"dependencies": {
"astro-icon": "^0.8.0",
"astro-seo": "^0.7.2",
"@iconify-json/bi": "^1.1.23",
"@iconify-json/heroicons": "^1.1.20",
"astro-icon": "^1.1.0",
"astro-seo": "^0.8.3",
"hero-patterns": "^2.1.0",
"katex": "^0.16.7",
"katex": "^0.16.10",
"leaflet": "^1.9.4",
"lunr": "^2.3.9",
"photoswipe": "^5.3.7",
"photoswipe": "^5.4.3",
"photoswipe-dynamic-caption-plugin": "^1.2.7",
"swiper": "^9.3.2"
}
"swiper": "^11.1.0"
},
"packageManager": "[email protected]+sha256.4b4efa12490e5055d59b9b9fc9438b7d581a6b7af3b5675eb5c5f447cee1a589"
}
Loading

0 comments on commit eca3af0

Please sign in to comment.