Skip to content

Commit

Permalink
Initial version
Browse files Browse the repository at this point in the history
  • Loading branch information
ChristineTham committed May 23, 2023
1 parent b31fdc5 commit 064fbc5
Show file tree
Hide file tree
Showing 31 changed files with 5,168 additions and 2 deletions.
24 changes: 24 additions & 0 deletions .eslintrc.cjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
/** @type {import("eslint").Linter.Config} */
module.exports = {
extends: ['plugin:astro/recommended'],
parser: '@typescript-eslint/parser',
parserOptions: {
tsconfigRootDir: __dirname,
sourceType: 'module',
ecmaVersion: 'latest'
},
overrides: [
{
files: ['*.astro'],
parser: 'astro-eslint-parser',
parserOptions: {
parser: '@typescript-eslint/parser',
extraFileExtensions: ['.astro']
},
rules: {
// override/add rules settings here, such as:
// "astro/no-set-html-directive": "error"
}
}
]
}
21 changes: 21 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
# 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
9 changes: 9 additions & 0 deletions .prettierrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
{
"useTabs": false,
"singleQuote": true,
"trailingComma": "none",
"semi": false,
"printWidth": 100,
"plugins": ["prettier-plugin-astro", "prettier-plugin-tailwindcss"],
"pluginSearchDirs": false
}
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": []
}
11 changes: 11 additions & 0 deletions .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"
}
]
}
13 changes: 13 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
{
"eslint.validate": [
"javascript",
"javascriptreact",
"astro",
"typescript",
"typescriptreact"
],
"prettier.documentSelectors": ["**/*.astro"],
"[astro]": {
"editor.defaultFormatter": "esbenp.prettier-vscode"
}
}
51 changes: 49 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,2 +1,49 @@
# astro-base
Base template for Astro projects
# Astro Base

Minimal [Astro](https://astro.build) starter for new projects. MIT licence.

Uses:

- [Typescript](https://www.typescriptlang.org/)
- [Prettier](https://prettier.io/)
- [ESLint](https://eslint.org/)
- [UnoCSS](https://unocss.dev/)
- `@astrojs/sitemap` and `@astrojs/rss` preintegrated
- Heroicons and SVG Logos preloaded via [Iconify](https://iconify.design/)

## 🚀 Project Structure

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 |
| :------------------------ | :----------------------------------------------- |
| `pnpm install` | Installs dependencies |
| `pnpm run dev` | Starts local dev server at `localhost:3000` |
| `pnpm run build` | Build your production site to `./dist/` |
| `pnpm run preview` | Preview your build locally, before deploying |
| `pnpm run astro ...` | Run CLI commands like `astro add`, `astro check` |
| `pnpm run astro -- --help` | Get help using the Astro CLI |
17 changes: 17 additions & 0 deletions astro.config.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
import { defineConfig } from 'astro/config'
import UnoCSS from 'unocss/astro'
import sitemap from "@astrojs/sitemap"

// https://astro.build/config
export default defineConfig({
experimental: {
assets: true
},
site: 'https://astro-base.netlify.app',
integrations: [
UnoCSS({
injectReset: true
}),
sitemap()
]
});
11 changes: 11 additions & 0 deletions netlify.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
[dev]
targetPort = 3000
command = "pnpm run dev"

[build]
command = "pnpm run build"
functions = "netlify/functions"
publish = "dist"

[functions]
node_bundler = "esbuild"
37 changes: 37 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
{
"name": "astro-base",
"type": "module",
"version": "0.0.1",
"scripts": {
"dev": "astro dev",
"start": "astro dev",
"build": "astro build; prettier --write \"dist/**/*.{js,html,css}\"",
"preview": "astro preview",
"lint": "pnpm run lint:prettier && pnpm run lint:eslint",
"lint:prettier": "prettier --write \"src/**/*.{js,jsx,ts,tsx,md,mdx,astro}\"",
"lint:eslint": "eslint --fix \"src/**/*.{js,ts,jsx,tsx,astro}\""
},
"dependencies": {
"@astrojs/rss": "^2.4.3",
"@astrojs/sitemap": "^1.3.1",
"astro": "^2.5.3"
},
"devDependencies": {
"@iconify-json/heroicons": "^1.1.10",
"@iconify-json/logos": "^1.1.31",
"@julr/unocss-preset-forms": "^0.0.5",
"@types/node": "^20.2.3",
"@typescript-eslint/parser": "^5.59.7",
"@unocss/reset": "^0.52.1",
"eslint": "^8.41.0",
"eslint-plugin-astro": "^0.27.0",
"eslint-plugin-jsx-a11y": "^6.7.1",
"prettier": "^2.8.8",
"prettier-config-standard": "^5.0.0",
"prettier-plugin-astro": "^0.9.0",
"prettier-plugin-tailwindcss": "^0.3.0",
"typescript": "^5.0.4",
"unocss": "^0.52.1",
"vite": "^4.3.8"
}
}
Loading

0 comments on commit 064fbc5

Please sign in to comment.