Skip to content

Commit 203db96

Browse files
committed
chore: adding astro project
1 parent dd71c73 commit 203db96

18 files changed

+3074
-32
lines changed

.vscode/settings.json

+5
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,11 @@
2020
},
2121
"scminput": true
2222
},
23+
"files.associations": {
24+
"*.excalidraw": "json",
25+
"*.excalidrawlib": "json",
26+
"*.mdx": "markdown"
27+
},
2328
"ltex.enabled": [
2429
"bibtex",
2530
"context",

github-page/package.json

+1-2
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,7 @@
33
"version": "0.0.0",
44
"private": true,
55
"scripts": {
6-
"build": "docusaurus build",
7-
"build:doc": "echo no-op",
6+
"build:doc": "docusaurus build",
87
"clear": "docusaurus clear",
98
"deploy": "docusaurus deploy",
109
"docusaurus": "docusaurus",

package.json

+2-3
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
{
2-
"name": "typescript-guidelines",
32
"private": true,
43
"author": {
54
"name": "Homa Wong (unional)",
@@ -8,10 +7,10 @@
87
},
98
"scripts": {
109
"build": "turbo run build",
11-
"build:doc": "turbo run build && pnpm page build",
10+
"build:doc": "turbo run build:doc",
1211
"lint": "turbo run lint",
1312
"page": "pnpm --filter github-page",
14-
"verify": "turbo run verify"
13+
"verify": "turbo run lint build build:doc depcheck coverage size"
1514
},
1615
"devDependencies": {
1716
"turbo": "^1.6.3"

page/.gitignore

+20
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
# build output
2+
dist/
3+
.output/
4+
5+
# dependencies
6+
node_modules/
7+
8+
# logs
9+
npm-debug.log*
10+
yarn-debug.log*
11+
yarn-error.log*
12+
pnpm-debug.log*
13+
14+
15+
# environment variables
16+
.env
17+
.env.production
18+
19+
# macOS-specific files
20+
.DS_Store

page/.vscode/extensions.json

+4
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
{
2+
"recommendations": ["astro-build.astro-vscode"],
3+
"unwantedRecommendations": []
4+
}

page/.vscode/launch.json

+11
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
{
2+
"version": "0.2.0",
3+
"configurations": [
4+
{
5+
"command": "./node_modules/.bin/astro dev",
6+
"name": "Development server",
7+
"request": "launch",
8+
"type": "node-terminal"
9+
}
10+
]
11+
}

page/README.md

+50
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
# Welcome to [Astro](https://astro.build)
2+
3+
[![Open in StackBlitz](https://developer.stackblitz.com/img/open_in_stackblitz.svg)](https://stackblitz.com/github/withastro/astro/tree/latest/examples/basics)
4+
[![Open with CodeSandbox](https://assets.codesandbox.io/github/button-edit-lime.svg)](https://codesandbox.io/s/github/withastro/astro/tree/latest/examples/basics)
5+
6+
> 🧑‍🚀 **Seasoned astronaut?** Delete this file. Have fun!
7+
8+
![basics](https://user-images.githubusercontent.com/4677417/186188965-73453154-fdec-4d6b-9c34-cb35c248ae5b.png)
9+
10+
11+
## 🚀 Project Structure
12+
13+
Inside of your Astro project, you'll see the following folders and files:
14+
15+
```
16+
/
17+
├── public/
18+
│ └── favicon.svg
19+
├── src/
20+
│ ├── components/
21+
│ │ └── Card.astro
22+
│ ├── layouts/
23+
│ │ └── Layout.astro
24+
│ └── pages/
25+
│ └── index.astro
26+
└── package.json
27+
```
28+
29+
Astro looks for `.astro` or `.md` files in the `src/pages/` directory. Each page is exposed as a route based on its file name.
30+
31+
There's nothing special about `src/components/`, but that's where we like to put any Astro/React/Vue/Svelte/Preact components.
32+
33+
Any static assets, like images, can be placed in the `public/` directory.
34+
35+
## 🧞 Commands
36+
37+
All commands are run from the root of the project, from a terminal:
38+
39+
| Command | Action |
40+
| :--------------------- | :------------------------------------------------- |
41+
| `npm install` | Installs dependencies |
42+
| `npm run dev` | Starts local dev server at `localhost:3000` |
43+
| `npm run build` | Build your production site to `./dist/` |
44+
| `npm run preview` | Preview your build locally, before deploying |
45+
| `npm run astro ...` | Run CLI commands like `astro add`, `astro preview` |
46+
| `npm run astro --help` | Get help using the Astro CLI |
47+
48+
## 👀 Want to learn more?
49+
50+
Feel free to check [our documentation](https://docs.astro.build) or jump into our [Discord server](https://astro.build/chat).

page/astro.config.mjs

+12
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
import { defineConfig } from 'astro/config';
2+
3+
// https://astro.build/config
4+
import solidJs from "@astrojs/solid-js";
5+
6+
// https://astro.build/config
7+
import mdx from "@astrojs/mdx";
8+
9+
// https://astro.build/config
10+
export default defineConfig({
11+
integrations: [solidJs(), mdx()]
12+
});

page/package.json

+20
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
{
2+
"name": "@example/basics",
3+
"type": "module",
4+
"version": "0.0.1",
5+
"private": true,
6+
"scripts": {
7+
"astro": "astro",
8+
"dev": "astro dev",
9+
"start": "astro dev",
10+
"build": "astro build",
11+
"preview": "astro preview",
12+
"test": "astro check && tsc --noEmit"
13+
},
14+
"dependencies": {
15+
"@astrojs/mdx": "^0.12.0",
16+
"@astrojs/solid-js": "^1.2.3",
17+
"astro": "^1.6.11",
18+
"solid-js": "^1.4.3"
19+
}
20+
}

page/public/favicon.svg

+13
Loading

page/src/components/Card.astro

+62
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,62 @@
1+
---
2+
export interface Props {
3+
title: string;
4+
body: string;
5+
href: string;
6+
}
7+
8+
const { href, title, body } = Astro.props;
9+
---
10+
11+
<li class="link-card">
12+
<a href={href}>
13+
<h2>
14+
{title}
15+
<span>&rarr;</span>
16+
</h2>
17+
<p>
18+
{body}
19+
</p>
20+
</a>
21+
</li>
22+
<style>
23+
.link-card {
24+
list-style: none;
25+
display: flex;
26+
padding: 0.15rem;
27+
background-color: white;
28+
background-image: var(--accent-gradient);
29+
background-size: 400%;
30+
border-radius: 0.5rem;
31+
background-position: 100%;
32+
transition: background-position 0.6s cubic-bezier(0.22, 1, 0.36, 1);
33+
box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -2px rgba(0, 0, 0, 0.1);
34+
}
35+
36+
.link-card > a {
37+
width: 100%;
38+
text-decoration: none;
39+
line-height: 1.4;
40+
padding: 1rem 1.3rem;
41+
border-radius: 0.35rem;
42+
color: #111;
43+
background-color: white;
44+
opacity: 0.8;
45+
}
46+
h2 {
47+
margin: 0;
48+
font-size: 1.25rem;
49+
transition: color 0.6s cubic-bezier(0.22, 1, 0.36, 1);
50+
}
51+
p {
52+
margin-top: 0.5rem;
53+
margin-bottom: 0;
54+
color: #444;
55+
}
56+
.link-card:is(:hover, :focus-within) {
57+
background-position: 0;
58+
}
59+
.link-card:is(:hover, :focus-within) h2 {
60+
color: rgb(var(--accent));
61+
}
62+
</style>

page/src/env.d.ts

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
/// <reference types="astro/client" />

page/src/layouts/Layout.astro

+35
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
---
2+
export interface Props {
3+
title: string;
4+
}
5+
6+
const { title } = Astro.props;
7+
---
8+
9+
<!DOCTYPE html>
10+
<html lang="en">
11+
<head>
12+
<meta charset="UTF-8" />
13+
<meta name="viewport" content="width=device-width" />
14+
<link rel="icon" type="image/svg+xml" href="/favicon.svg" />
15+
<meta name="generator" content={Astro.generator} />
16+
<title>{title}</title>
17+
</head>
18+
<body>
19+
<slot />
20+
</body>
21+
</html>
22+
<style is:global>
23+
:root {
24+
--accent: 124, 58, 237;
25+
--accent-gradient: linear-gradient(45deg, rgb(var(--accent)), #da62c4 30%, white 60%);
26+
}
27+
html {
28+
font-family: system-ui, sans-serif;
29+
background-color: #F6F6F6;
30+
}
31+
code {
32+
font-family: Menlo, Monaco, Lucida Console, Liberation Mono, DejaVu Sans Mono,
33+
Bitstream Vera Sans Mono, Courier New, monospace;
34+
}
35+
</style>

page/src/pages/index.astro

+82
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,82 @@
1+
---
2+
import Layout from "../layouts/Layout.astro";
3+
import Card from "../components/Card.astro";
4+
---
5+
6+
<Layout title="Welcome to Astro.">
7+
<main>
8+
<h1>Welcome to <span class="text-gradient">Astro</span></h1>
9+
<p class="instructions">
10+
To get started, open the directory <code>src/pages</code> in your project.<br
11+
/>
12+
<strong>Code Challenge:</strong> Tweak the "Welcome to Astro" message above.
13+
</p>
14+
<ul role="list" class="link-card-grid">
15+
<Card
16+
href="https://docs.astro.build/"
17+
title="Documentation"
18+
body="Learn how Astro works and explore the official API docs."
19+
/>
20+
<Card
21+
href="https://astro.build/integrations/"
22+
title="Integrations"
23+
body="Supercharge your project with new frameworks and libraries."
24+
/>
25+
<Card
26+
href="https://astro.build/themes/"
27+
title="Themes"
28+
body="Explore a galaxy of community-built starter themes."
29+
/>
30+
<Card
31+
href="https://astro.build/chat/"
32+
title="Community"
33+
body="Come say hi to our amazing Discord community. ❤️"
34+
/>
35+
</ul>
36+
</main>
37+
</Layout>
38+
39+
<style>
40+
main {
41+
margin: auto;
42+
padding: 1.5rem;
43+
max-width: 60ch;
44+
}
45+
h1 {
46+
font-size: 3rem;
47+
font-weight: 800;
48+
margin: 0;
49+
}
50+
.text-gradient {
51+
background-image: var(--accent-gradient);
52+
-webkit-background-clip: text;
53+
-webkit-text-fill-color: transparent;
54+
background-size: 400%;
55+
background-position: 0%;
56+
}
57+
.instructions {
58+
line-height: 1.6;
59+
margin: 1rem 0;
60+
border: 1px solid rgba(var(--accent), 25%);
61+
background-color: white;
62+
padding: 1rem;
63+
border-radius: 0.4rem;
64+
}
65+
.instructions code {
66+
font-size: 0.875em;
67+
font-weight: bold;
68+
background: rgba(var(--accent), 12%);
69+
color: rgb(var(--accent));
70+
border-radius: 4px;
71+
padding: 0.3em 0.45em;
72+
}
73+
.instructions strong {
74+
color: rgb(var(--accent));
75+
}
76+
.link-card-grid {
77+
display: grid;
78+
grid-template-columns: repeat(auto-fit, minmax(24ch, 1fr));
79+
gap: 1rem;
80+
padding: 0;
81+
}
82+
</style>

page/tsconfig.json

+7
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
{
2+
"extends": "astro/tsconfigs/strict",
3+
"compilerOptions": {
4+
"jsx": "preserve",
5+
"jsxImportSource": "solid-js"
6+
}
7+
}

0 commit comments

Comments
 (0)