Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions docs/config.json
Original file line number Diff line number Diff line change
Expand Up @@ -863,6 +863,10 @@
{
"label": "Solid Start",
"to": "framework/solid/examples/solid-start-streaming"
},
{
"label": "Astro",
"to": "framework/solid/examples/astro"
}
]
},
Expand Down
25 changes: 25 additions & 0 deletions examples/solid/astro/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
# build output
dist/
.vercel/
# 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/
47 changes: 47 additions & 0 deletions examples/solid/astro/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
# Astro Starter Kit: Minimal

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

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

> 🧑‍🚀 **Seasoned astronaut?** Delete this file. Have fun!

## 🚀 Project Structure

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

```text
/
├── public/
├── src/
│ └── pages/
│ └── index.astro
└── package.json
```

Astro looks for `.astro` or `.md` files in the `src/pages/` directory. Each page is exposed as a route based on its file name.

There's nothing special about `src/components/`, but that's where we like to put any Astro/React/Vue/Svelte/Preact components.

Any static assets, like images, can be placed in the `public/` directory.

## 🧞 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).
12 changes: 12 additions & 0 deletions examples/solid/astro/astro.config.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
import { defineConfig } from 'astro/config'
import solidJs from '@astrojs/solid-js'
import tailwind from '@astrojs/tailwind'
import node from '@astrojs/node'
// https://astro.build/config
export default defineConfig({
output: 'server',
integrations: [solidJs(), tailwind()],
adapter: node({
mode: 'standalone',
}),
})
25 changes: 25 additions & 0 deletions examples/solid/astro/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
{
"name": "solid-query-astro-example",
"type": "module",
"version": "0.0.1",
"scripts": {
"dev": "astro dev",
"start": "astro dev",
"build": "astro check && astro build",
"preview": "astro preview",
"astro": "astro"
},
"dependencies": {
"@astrojs/check": "^0.5.10",
"@astrojs/solid-js": "^4.1.0",
"@astrojs/tailwind": "^5.1.0",
"@astrojs/vercel": "^7.5.3",
"@astrojs/node": "^8.2.5",
"@tanstack/solid-query": "^5.30.4",
"@tanstack/solid-query-devtools": "^5.30.4",
"astro": "^4.6.1",
"solid-js": "^1.8.14",
"tailwindcss": "^3.4.1",
"typescript": "5.2.2"
}
}
9 changes: 9 additions & 0 deletions examples/solid/astro/public/favicon.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
20 changes: 20 additions & 0 deletions examples/solid/astro/src/components/Link.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
export const Link = (props: {
href: string
children: any
class?: string
}) => {
// Links doing client-side navigation
return (
<a
href={props.href}
onClick={(e) => {
e.preventDefault()
history.pushState({}, '', props.href)
window.dispatchEvent(new PopStateEvent('popstate'))
}}
class={props.class}
>
{props.children}
</a>
)
}
Loading