Skip to content

Commit

Permalink
initial
Browse files Browse the repository at this point in the history
  • Loading branch information
thejackshelton committed Dec 25, 2024
1 parent 7029713 commit 8a8e97f
Show file tree
Hide file tree
Showing 25 changed files with 542 additions and 469 deletions.
1 change: 1 addition & 0 deletions apps/website/.astro/content-assets.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export default new Map();
1 change: 1 addition & 0 deletions apps/website/.astro/content-modules.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export default new Map();
155 changes: 155 additions & 0 deletions apps/website/.astro/content.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,155 @@
declare module 'astro:content' {
export interface RenderResult {
Content: import('astro/runtime/server/index.js').AstroComponentFactory;
headings: import('astro').MarkdownHeading[];
remarkPluginFrontmatter: Record<string, any>;
}
interface Render {
'.md': Promise<RenderResult>;
}

export interface RenderedContent {
html: string;
metadata?: {
imagePaths: Array<string>;
[key: string]: unknown;
};
}
}

declare module 'astro:content' {
type Flatten<T> = T extends { [K: string]: infer U } ? U : never;

export type CollectionKey = keyof AnyEntryMap;
export type CollectionEntry<C extends CollectionKey> = Flatten<AnyEntryMap[C]>;

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<
ContentEntryMap[C]
>['slug'];

/** @deprecated Use `getEntry` instead. */
export function getEntryBySlug<
C extends keyof ContentEntryMap,
E extends ValidContentEntrySlug<C> | (string & {}),
>(
collection: C,
// Note that this has to accept a regular string too, for SSR
entrySlug: E,
): E extends ValidContentEntrySlug<C>
? Promise<CollectionEntry<C>>
: Promise<CollectionEntry<C> | undefined>;

/** @deprecated Use `getEntry` instead. */
export function getDataEntryById<C extends keyof DataEntryMap, E extends keyof DataEntryMap[C]>(
collection: C,
entryId: E,
): Promise<CollectionEntry<C>>;

export function getCollection<C extends keyof AnyEntryMap, E extends CollectionEntry<C>>(
collection: C,
filter?: (entry: CollectionEntry<C>) => entry is E,
): Promise<E[]>;
export function getCollection<C extends keyof AnyEntryMap>(
collection: C,
filter?: (entry: CollectionEntry<C>) => unknown,
): Promise<CollectionEntry<C>[]>;

export function getEntry<
C extends keyof ContentEntryMap,
E extends ValidContentEntrySlug<C> | (string & {}),
>(entry: {
collection: C;
slug: E;
}): E extends ValidContentEntrySlug<C>
? Promise<CollectionEntry<C>>
: Promise<CollectionEntry<C> | undefined>;
export function getEntry<
C extends keyof DataEntryMap,
E extends keyof DataEntryMap[C] | (string & {}),
>(entry: {
collection: C;
id: E;
}): E extends keyof DataEntryMap[C]
? Promise<DataEntryMap[C][E]>
: Promise<CollectionEntry<C> | undefined>;
export function getEntry<
C extends keyof ContentEntryMap,
E extends ValidContentEntrySlug<C> | (string & {}),
>(
collection: C,
slug: E,
): E extends ValidContentEntrySlug<C>
? Promise<CollectionEntry<C>>
: Promise<CollectionEntry<C> | undefined>;
export function getEntry<
C extends keyof DataEntryMap,
E extends keyof DataEntryMap[C] | (string & {}),
>(
collection: C,
id: E,
): E extends keyof DataEntryMap[C]
? string extends keyof DataEntryMap[C]
? Promise<DataEntryMap[C][E]> | undefined
: Promise<DataEntryMap[C][E]>
: Promise<CollectionEntry<C> | undefined>;

/** Resolve an array of entry references from the same collection */
export function getEntries<C extends keyof ContentEntryMap>(
entries: {
collection: C;
slug: ValidContentEntrySlug<C>;
}[],
): Promise<CollectionEntry<C>[]>;
export function getEntries<C extends keyof DataEntryMap>(
entries: {
collection: C;
id: keyof DataEntryMap[C];
}[],
): Promise<CollectionEntry<C>[]>;

export function render<C extends keyof AnyEntryMap>(
entry: AnyEntryMap[C][string],
): Promise<RenderResult>;

export function reference<C extends keyof AnyEntryMap>(
collection: C,
): import('astro/zod').ZodEffects<
import('astro/zod').ZodString,
C extends keyof ContentEntryMap
? {
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.
// Invalid collection names will be caught at build time.
export function reference<C extends string>(
collection: C,
): import('astro/zod').ZodEffects<import('astro/zod').ZodString, never>;

type ReturnTypeOrOriginal<T> = T extends (...args: any[]) => infer R ? R : T;
type InferEntrySchema<C extends keyof AnyEntryMap> = import('astro/zod').infer<
ReturnTypeOrOriginal<Required<ContentConfig['collections'][C]>['schema']>
>;

type ContentEntryMap = {

};

type DataEntryMap = {

};

type AnyEntryMap = ContentEntryMap & DataEntryMap;

export type ContentConfig = typeof import("../src/content.config.mjs");
}
1 change: 1 addition & 0 deletions apps/website/.astro/data-store.json
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
[["Map",1,2],"meta::meta",["Map",3,4,5,6],"astro-version","5.1.1","astro-config-digest","{\"root\":{},\"srcDir\":{},\"publicDir\":{},\"outDir\":{},\"cacheDir\":{},\"compressHTML\":true,\"base\":\"/\",\"trailingSlash\":\"ignore\",\"output\":\"static\",\"scopedStyleStrategy\":\"attribute\",\"build\":{\"format\":\"directory\",\"client\":{},\"server\":{},\"assets\":\"_astro\",\"serverEntry\":\"entry.mjs\",\"redirects\":true,\"inlineStylesheets\":\"auto\",\"concurrency\":1},\"server\":{\"open\":false,\"host\":false,\"port\":4321,\"streaming\":true},\"redirects\":{},\"image\":{\"endpoint\":{\"route\":\"/_image\"},\"service\":{\"entrypoint\":\"astro/assets/services/sharp\",\"config\":{}},\"domains\":[],\"remotePatterns\":[]},\"devToolbar\":{\"enabled\":true},\"markdown\":{\"syntaxHighlight\":\"shiki\",\"shikiConfig\":{\"langs\":[],\"langAlias\":{},\"theme\":\"github-dark\",\"themes\":{},\"wrap\":false,\"transformers\":[]},\"remarkPlugins\":[],\"rehypePlugins\":[],\"remarkRehype\":{},\"gfm\":true,\"smartypants\":true},\"security\":{\"checkOrigin\":true},\"env\":{\"schema\":{},\"validateSecrets\":false},\"experimental\":{\"clientPrerender\":false,\"contentIntellisense\":false,\"responsiveImages\":false},\"legacy\":{\"collections\":false}}"]
5 changes: 5 additions & 0 deletions apps/website/.astro/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"_variables": {
"lastUpdateCheck": 1735146562968
}
}
2 changes: 2 additions & 0 deletions apps/website/.astro/types.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
/// <reference types="astro/client" />
/// <reference path="content.d.ts" />
21 changes: 0 additions & 21 deletions apps/website/.gitignore

This file was deleted.

2 changes: 1 addition & 1 deletion apps/website/.vscode/extensions.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{
"recommendations": ["astro-build.astro-vscode"],
"recommendations": ["astro-build.astro-vscode", "biomejs.biome"],
"unwantedRecommendations": []
}
81 changes: 48 additions & 33 deletions apps/website/README.md
Original file line number Diff line number Diff line change
@@ -1,54 +1,69 @@
# Starlight Starter Kit: Basics

[![Built with Starlight](https://astro.badg.es/v2/built-with-starlight/tiny.svg)](https://starlight.astro.build)
# [@QwikDev/astro](https://github.com/QwikDev/astro) Starter Kit

```
npm create astro@latest -- --template starlight
```
## Overview

[![Open in StackBlitz](https://developer.stackblitz.com/img/open_in_stackblitz.svg)](https://stackblitz.com/github/withastro/starlight/tree/main/examples/basics)
[![Open with CodeSandbox](https://assets.codesandbox.io/github/button-edit-lime.svg)](https://codesandbox.io/p/sandbox/github/withastro/starlight/tree/main/examples/basics)
[![Deploy with Vercel](https://vercel.com/button)](https://vercel.com/new/clone?repository-url=https%3A%2F%2Fgithub.com%2Fwithastro%2Fstarlight%2Ftree%2Fmain%2Fexamples%2Fbasics&project-name=my-starlight-docs&repository-name=my-starlight-docs)

> 🧑‍🚀 **Seasoned astronaut?** Delete this file. Have fun!
Welcome to the [@QwikDev/astro](https://github.com/QwikDev/astro) starter kit! This kit enables seamless integration of Qwik components into your Astro projects, combining the efficiency of Qwik's component-based architecture with the flexibility of Astro's static site generation.

## 🚀 Project Structure

Inside of your Astro + Starlight project, you'll see the following folders and files:
Inside of your [Qwik](https://qwik.dev/) + [Astro](https://astro.build/) project, you'll see the following folders and files:

```
.
```text
/
├── public/
│ └── favicon.svg
├── src/
│ ├── assets/
│ ├── content/
│ │ ├── docs/
│ │ └── config.ts
│ └── env.d.ts
├── astro.config.mjs
├── package.json
└── tsconfig.json
│ │ ├── astro.svg
│ │ └── qwik.svg
│ ├── components/
│ │ ├── counter.module.css
│ │ └── counter.tsx
│ ├── layouts/
│ │ └── Layout.astro
│ ├── pages/
│ │ └── index.astro
│ └── styles/
│ └── globals.css
└── package.json
```

Starlight looks for `.md` or `.mdx` files in the `src/content/docs/` directory. Each file is exposed as a route based on its file name.
- **public/** : This directory contains static resources such as images, accessible from the root of your deployed site.

Images can be added to `src/assets/` and embedded in Markdown with a relative link.
- **src/** : This directory is the core of your Qwik + Astro application. Here's an overview of its structure:

Static assets, like favicons, can be placed in the `public/` directory.
- **assets/** : This directory is for resources such as images, SVG files, etc.

- **components/** : Qwik components are stored here. Use this directory to organize and create reusable components for your application.

- **layouts/** : Astro layouts reside in this directory. Layout files define the overall structure of your pages.

- **pages/** : This directory contains the pages of your Astro application. Each file with the `.astro` or `.md` extension is exposed as a route based on its file name.

- **styles/** : Global style files for your application are stored here, such as `globals.css`.

## 🧞 Commands

All commands are run from the root of the project, from a terminal:

| Command | Action |
| :------------------------ | :----------------------------------------------- |
| `npm install` | Installs dependencies |
| `npm run dev` | Starts local dev server at `localhost:4321` |
| `npm run build` | Build your production site to `./dist/` |
| `npm run preview` | Preview your build locally, before deploying |
| `npm run astro ...` | Run CLI commands like `astro add`, `astro check` |
| `npm run astro -- --help` | Get help using the Astro CLI |
| Command | Action |
| :------------------- | :----------------------------------------------|
| `pnpm install` | Installs dependencies |
| `pnpm start` | Starts local dev server at `localhost:4321` |
| `pnpm build` | Build your production site to `./dist/` |
| `pnpm preview` | Preview your build locally, before deploying |
| `pnpm astro ...` | Run CLI commands like `astro add`, `astro check` |
| `pnpm astro -- --help` | Get help using the Astro CLI |

## 📚 References

- [Astro Documentation](https://astro.build/) - Explore more about Astro.

- [Qwik Documentation](https://qwik.dev/) - Learn about Qwik and its features.

- [Astro GitHub Repository](https://github.com/withastro/astro) - Contribute or report issues to the Astro project.

## 👀 Want to learn more?
- [Qwik GitHub Repository](https://github.com/BuilderIO/qwik) - Contribute or report issues to the Qwik project.

Check out [Starlight’s docs](https://starlight.astro.build/), read [the Astro documentation](https://docs.astro.build), or jump into the [Astro Discord server](https://astro.build/chat).
- [Qwik + Astro GitHub Repository](https://github.com/QwikDev/astro) - Explore and contribute to the @QwikDev/astro integration project.
34 changes: 2 additions & 32 deletions apps/website/astro.config.ts
Original file line number Diff line number Diff line change
@@ -1,37 +1,7 @@
import starlight from "@astrojs/starlight";
import qwikdev from "@qwikdev/astro";
import { defineConfig } from "astro/config";

// https://astro.build/config
export default defineConfig({
compressHTML: true,
integrations: [
starlight({
title: "Qwik 💜 Astro",
logo: {
src: "./src/assets/qwik-astro.svg",
alt: "Qwik + Astro Logo",
replacesTitle: false
},
social: {
github: "https://github.com/QwikDev/astro"
},
editLink: {
baseUrl: "https://github.com/QwikDev/astro/edit/main/apps/website/"
},
sidebar: [
{
label: "Home",
link: "/"
},
{
label: "Guides",
items: [{ label: "Getting Started", link: "/guides/" }]
},
{
label: "Reference",
autogenerate: { directory: "reference" }
}
]
})
]
integrations: [qwikdev()],
});
34 changes: 21 additions & 13 deletions apps/website/package.json
Original file line number Diff line number Diff line change
@@ -1,21 +1,29 @@
{
"name": "@qwikdev/astro-website",
"private": true,
"name": "website",
"type": "module",
"version": "0.0.1",
"private": true,
"scripts": {
"astro": "astro",
"sync": "astro sync",
"build": "pnpm fix && astro build",
"check": "biome ci . && astro check",
"check.format": "biome format .",
"check.lint": "biome check .",
"dev": "astro dev",
"start": "astro dev --open",
"build": "astro check && astro build",
"preview": "astro preview",
"astro": "astro"
"fix": "pnpm lint && pnpm format",
"format": "biome format --write .",
"lint": "biome check --apply-unsafe .",
"preview": "pnpm build && astro preview",
"prod": "pnpm check && astro build",
"start": "astro dev --open"
},
"dependencies": {
"@astrojs/check": "^0.5.10",
"@astrojs/starlight": "^0.21.5",
"@qwikdev/astro": "workspace:*",
"astro": "^4.16.18",
"sharp": "^0.32.6",
"typescript": "^5.7.2"
"@astrojs/check": "^0.9.4",
"@builder.io/qwik": "^1.12",
"@qwikdev/astro": "^0.7",
"astro": "^5.1"
},
"devDependencies": {
"@biomejs/biome": "^1.7.0"
}
}
Loading

0 comments on commit 8a8e97f

Please sign in to comment.