Skip to content

Commit

Permalink
Astro
Browse files Browse the repository at this point in the history
  • Loading branch information
wxh06 committed Mar 23, 2023
1 parent 9ea2788 commit 3330073
Show file tree
Hide file tree
Showing 39 changed files with 3,609 additions and 1,896 deletions.
8 changes: 3 additions & 5 deletions .eslintignore
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
node_modules/
dist/
.vercel/

!.*rc.js
!.*rc.mjs
!.*rc.cjs

.next/
out/
!.*rc.[mc]js
26 changes: 26 additions & 0 deletions .eslintrc.cjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
/** @type {import("eslint").Linter.Config} */
module.exports = {
extends: [
"eslint:recommended",
"airbnb-base",
"plugin:astro/recommended",
"plugin:astro/jsx-a11y-strict",
"prettier",
],
rules: { "import/no-unresolved": [2, { ignore: ["^@astrojs/"] }] },
overrides: [
{
// Define the configuration for `.astro` file.
files: ["*.astro"],
// Allows Astro components to be parsed.
parser: "astro-eslint-parser",
// Parse the script in `.astro` as TypeScript by adding the following configuration.
// It's the setting you need when using TypeScript.
parserOptions: {
parser: "@typescript-eslint/parser",
project: "tsconfig.json",
extraFileExtensions: [".astro"],
},
},
],
};
35 changes: 0 additions & 35 deletions .eslintrc.json

This file was deleted.

42 changes: 15 additions & 27 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,36 +1,24 @@
# See https://help.github.com/articles/ignoring-files/ for more about ignoring files.
# build output
dist/

# dependencies
/node_modules
/.pnp
.pnp.js

# testing
/coverage

# next.js
/.next/
/out/
# generated types
.astro/

# production
/build

# misc
.DS_Store
*.pem
# dependencies
node_modules/

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

# local env files
.env*.local
# environment variables
.env
.env.production

# vercel
.vercel
# macOS-specific files
.DS_Store

# typescript
*.tsbuildinfo
next-env.d.ts
# vercel
.vercel/
5 changes: 2 additions & 3 deletions .lintstagedrc.cjs
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
const eslint = "eslint --fix";
const prettier = "prettier --write";
const prettierCheck = "prettier --check";

module.exports = {
"*.{js,mjs,cjs,jsx,ts,mts,cts,tsx,vue}": [eslint, prettierCheck],
"*.{md,css,scss,json,yml,yaml,gql,graphql}": prettier,
"*.{astro,js,mjs,cjs,ts}": [prettier, eslint],
"*.{md,html,json,yml,yaml}": prettier,
};
1 change: 0 additions & 1 deletion .node-version

This file was deleted.

6 changes: 2 additions & 4 deletions .prettierignore
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
node_modules/

dist/
.vercel/
pnpm-lock.yaml

.next/
out/
14 changes: 12 additions & 2 deletions .prettierrc.cjs
Original file line number Diff line number Diff line change
@@ -1,4 +1,14 @@
/* eslint-disable global-require */
module.exports = {
plugins: [require("prettier-plugin-tailwindcss")],
plugins: [
require.resolve("prettier-plugin-astro"),
require.resolve("prettier-plugin-tailwindcss"),
],
overrides: [
{
files: "*.astro",
options: {
parser: "astro",
},
},
],
};
9 changes: 9 additions & 0 deletions .vscode/extensions.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
{
"recommendations": [
"astro-build.astro-vscode",
"bradlc.vscode-tailwindcss",
"dbaeumer.vscode-eslint",
"esbenp.prettier-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"
}
]
}
5 changes: 0 additions & 5 deletions .vscode/settings.json

This file was deleted.

60 changes: 40 additions & 20 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,34 +1,54 @@
This is a [Next.js](https://nextjs.org/) project bootstrapped with [`create-next-app`](https://github.com/vercel/next.js/tree/canary/packages/create-next-app).
# Astro Starter Kit: Basics

## Getting Started
```
npm create astro@latest -- --template basics
```

First, run the development server:
[![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)

```bash
npm run dev
# or
yarn dev
```
> 🧑‍🚀 **Seasoned astronaut?** Delete this file. Have fun!
Open [http://localhost:3000](http://localhost:3000) with your browser to see the result.
![basics](https://user-images.githubusercontent.com/4677417/186188965-73453154-fdec-4d6b-9c34-cb35c248ae5b.png)

You can start editing the page by modifying `pages/index.tsx`. The page auto-updates as you edit the file.
## 🚀 Project Structure

[API routes](https://nextjs.org/docs/api-routes/introduction) can be accessed on [http://localhost:3000/api/hello](http://localhost:3000/api/hello). This endpoint can be edited in `pages/api/hello.ts`.
Inside of your Astro project, you'll see the following folders and files:

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

The `pages/api` directory is mapped to `/api/*`. Files in this directory are treated as [API routes](https://nextjs.org/docs/api-routes/introduction) instead of React pages.
Astro looks for `.astro` or `.md` files in the `src/pages/` directory. Each page is exposed as a route based on its file name.

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

To learn more about Next.js, take a look at the following resources:
Any static assets, like images, can be placed in the `public/` directory.

- [Next.js Documentation](https://nextjs.org/docs) - learn about Next.js features and API.
- [Learn Next.js](https://nextjs.org/learn) - an interactive Next.js tutorial.
## 🧞 Commands

You can check out [the Next.js GitHub repository](https://github.com/vercel/next.js/) - your feedback and contributions are welcome!
All commands are run from the root of the project, from a terminal:

## Deploy on Vercel
| Command | Action |
| :--------------------- | :----------------------------------------------- |
| `npm install` | Installs dependencies |
| `npm run dev` | Starts local dev server at `localhost:3000` |
| `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 |

The easiest way to deploy your Next.js app is to use the [Vercel Platform](https://vercel.com/new?utm_medium=default-template&filter=next.js&utm_source=create-next-app&utm_campaign=create-next-app-readme) from the creators of Next.js.
## 👀 Want to learn more?

Check out our [Next.js deployment documentation](https://nextjs.org/docs/deployment) for more details.
Feel free to check [our documentation](https://docs.astro.build) or jump into our [Discord server](https://astro.build/chat).
32 changes: 0 additions & 32 deletions app/(layout)/Navbar.tsx

This file was deleted.

1 comment on commit 3330073

@vercel
Copy link

@vercel vercel bot commented on 3330073 Mar 23, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Successfully deployed to the following URLs:

wxh-im – ./

wxh-im-git-main-wangxinhe.vercel.app
wxh-im-wangxinhe.vercel.app
wxh-im.vercel.app
wxh.im

Please sign in to comment.