Skip to content

Commit

Permalink
add astro react with component library example
Browse files Browse the repository at this point in the history
  • Loading branch information
KevinVandy committed Feb 15, 2025
1 parent 938c9b8 commit 87b920e
Show file tree
Hide file tree
Showing 26 changed files with 674 additions and 239 deletions.
2 changes: 1 addition & 1 deletion apps/0-json-server/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
"type": "module",
"scripts": {
"dev0": "pnpm serve",
"serve": "json-server --watch db.json --delay 800 --port 3300"
"serve": "json-server --watch db.json --delay 0 --port 3300"
},
"dependencies": {
"json-server": "0.17.4"
Expand Down
2 changes: 1 addition & 1 deletion apps/2-ssg/2-1-nextjs-ssg/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,13 @@
"@mantine/core": "7.16.3",
"@mantine/hooks": "7.16.3",
"@tabler/icons-react": "^3.30.0",
"@tanstack/react-query": "^5.66.0",
"mantine-react-table": "^2.0.0-beta.6",
"next": "15.1.7",
"react": "^19",
"react-dom": "^19"
},
"devDependencies": {
"@tanstack/react-query": "^5.66.0",
"@tanstack/react-query-devtools": "^5.66.0",
"@types/node": "^22",
"@types/react": "^19",
Expand Down
4 changes: 2 additions & 2 deletions apps/2-ssg/2-2-astro-ssg/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@
"type": "module",
"version": "0.0.1",
"scripts": {
"dev": "astro dev --port 3332",
"dev": "astro dev --port 3322",
"build": "astro build",
"preview": "astro preview --port 3332",
"preview": "astro preview --port 3322",
"astro": "astro"
},
"dependencies": {
Expand Down
209 changes: 0 additions & 209 deletions apps/2-ssg/2-2-astro-ssg/src/components/Welcome.astro

This file was deleted.

24 changes: 24 additions & 0 deletions apps/2-ssg/2-3-astro-react-ssg/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
# build output
dist/

# generated types
.astro/

# dependencies
node_modules/

# logs
npm-debug.log*
yarn-debug.log*
yarn-error.log*
pnpm-debug.log*

# environment variables
.env
.env.production

# macOS-specific files
.DS_Store

# jetbrains setting folder
.idea/
4 changes: 4 additions & 0 deletions apps/2-ssg/2-3-astro-react-ssg/.vscode/extensions.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
"recommendations": ["astro-build.astro-vscode"],
"unwantedRecommendations": []
}
11 changes: 11 additions & 0 deletions apps/2-ssg/2-3-astro-react-ssg/.vscode/launch.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
{
"version": "0.2.0",
"configurations": [
{
"command": "./node_modules/.bin/astro dev",
"name": "Development server",
"request": "launch",
"type": "node-terminal"
}
]
}
48 changes: 48 additions & 0 deletions apps/2-ssg/2-3-astro-react-ssg/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
# Astro Starter Kit: Basics

```sh
npm create astro@latest -- --template basics
```

[![Open in StackBlitz](https://developer.stackblitz.com/img/open_in_stackblitz.svg)](https://stackblitz.com/github/withastro/astro/tree/latest/examples/basics)
[![Open with CodeSandbox](https://assets.codesandbox.io/github/button-edit-lime.svg)](https://codesandbox.io/p/sandbox/github/withastro/astro/tree/latest/examples/basics)
[![Open in GitHub Codespaces](https://github.com/codespaces/badge.svg)](https://codespaces.new/withastro/astro?devcontainer_path=.devcontainer/basics/devcontainer.json)

> 🧑‍🚀 **Seasoned astronaut?** Delete this file. Have fun!
![just-the-basics](https://github.com/withastro/astro/assets/2244813/a0a5533c-a856-4198-8470-2d67b1d7c554)

## 🚀 Project Structure

Inside of your Astro project, you'll see the following folders and files:

```text
/
├── public/
│ └── favicon.svg
├── src/
│ ├── layouts/
│ │ └── Layout.astro
│ └── pages/
│ └── index.astro
└── package.json
```

To learn more about the folder structure of an Astro project, refer to [our guide on project structure](https://docs.astro.build/en/basics/project-structure/).

## 🧞 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 |

## 👀 Want to learn more?

Feel free to check [our documentation](https://docs.astro.build) or jump into our [Discord server](https://astro.build/chat).
9 changes: 9 additions & 0 deletions apps/2-ssg/2-3-astro-react-ssg/astro.config.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
// @ts-check
import { defineConfig } from "astro/config";

import react from "@astrojs/react";

// https://astro.build/config
export default defineConfig({
integrations: [react()],
});
29 changes: 29 additions & 0 deletions apps/2-ssg/2-3-astro-react-ssg/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
{
"name": "2-3-astro-react-ssg",
"type": "module",
"version": "0.0.1",
"scripts": {
"dev": "astro dev --port 3323",
"build": "astro build",
"preview": "astro preview --port 3323",
"astro": "astro"
},
"dependencies": {
"@astrojs/react": "^4.2.0",
"@mantine/core": "7.16.3",
"@mantine/hooks": "7.16.3",
"@tabler/icons-react": "^3.30.0",
"@tailwindcss/vite": "^4.0.6",
"astro": "^5.2.5",
"mantine-react-table": "2.0.0-beta.8",
"react": "^19.0.0",
"react-dom": "^19.0.0"
},
"devDependencies": {
"postcss": "^8.5.2",
"postcss-preset-mantine": "1.17.0",
"postcss-simple-vars": "^7.0.1",
"@types/react": "^19.0.8",
"@types/react-dom": "^19.0.3"
}
}
14 changes: 14 additions & 0 deletions apps/2-ssg/2-3-astro-react-ssg/postcss.config.cjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
module.exports = {
plugins: {
"postcss-preset-mantine": {},
"postcss-simple-vars": {
variables: {
"mantine-breakpoint-xs": "36em",
"mantine-breakpoint-sm": "48em",
"mantine-breakpoint-md": "62em",
"mantine-breakpoint-lg": "75em",
"mantine-breakpoint-xl": "88em",
},
},
},
};
Loading

0 comments on commit 87b920e

Please sign in to comment.