Skip to content

Commit

Permalink
Merge pull request #2 from ff6347/refactor/astro
Browse files Browse the repository at this point in the history
refactor/astro
  • Loading branch information
ff6347 authored Nov 8, 2023
2 parents a371563 + ad067fd commit 1699d4a
Show file tree
Hide file tree
Showing 36 changed files with 166,297 additions and 3,480 deletions.
15 changes: 11 additions & 4 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,9 @@ web_modules/
.env.test.local
.env.production.local
.env.local
.envrc
.env*
.env.production
# parcel-bundler cache (https://parceljs.org/)
.cache
.parcel-cache
Expand Down Expand Up @@ -109,9 +112,13 @@ out
.yarn/build-state.yml
.yarn/install-state.gz
.pnp.*

.envrc
.env*

# Local Netlify folder
.netlify
# build output
dist/
# generated types
.astro/
# dependencies
# logs

# macOS-specific files
4 changes: 4 additions & 0 deletions .vscode/extensions.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
"recommendations": ["astro-build.astro-vscode"],
"unwantedRecommendations": []
}
56 changes: 50 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,54 @@
# P5 Code Sandbox
# Astro Starter Kit: Basics

Small experiment to have a code sandbox for testing p5.js code. Based on [this blog](https://joyofcode.xyz/create-a-coding-sandbox) post "Create a JavaScript Code Sandbox" by Matija.
```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)

## Development
## 🚀 Project Structure

```bash
npm ci
npm run dev
Inside of your Astro project, you'll see the following folders and files:

```text
/
├── public/
│ └── favicon.svg
├── src/
│ ├── components/
│ │ └── Card.astro
│ ├── layouts/
│ │ └── Layout.astro
│ └── 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).
10 changes: 10 additions & 0 deletions astro.config.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
import { defineConfig } from "astro/config";
import netlify from "@astrojs/netlify/functions";
import react from "@astrojs/react";

// https://astro.build/config
export default defineConfig({
integrations: [react()],
output: "server",
adapter: netlify(),
});
22 changes: 2 additions & 20 deletions netlify.toml
Original file line number Diff line number Diff line change
@@ -1,21 +1,3 @@
# example netlify.toml
[build]
command = "npm run build"
functions = "netlify/functions"
publish = "dist"

## Uncomment to use this redirect for Single Page Applications like create-react-app.
## Not needed for static site generators.
#[[redirects]]
# from = "/*"
# to = "/index.html"
# status = 200

## (optional) Settings for Netlify Dev
## https://github.com/netlify/cli/blob/main/docs/netlify-dev.md#project-detection
#[dev]
# command = "yarn start" # Command to start your dev server
# port = 3000 # Port that the dev server will be listening on
# publish = "dist" # Folder with the static content for _redirect file

## more info on configuring this file: https://docs.netlify.com/configure-builds/file-based-configuration/
command = "export PUBLIC_BASE_URL=$DEPLOY_URL && npm run build"
publish = "dist"
Loading

0 comments on commit 1699d4a

Please sign in to comment.