Skip to content

Commit

Permalink
refactor(style): 🔥 move from NextJS to Astro
Browse files Browse the repository at this point in the history
BREAKING CHANGE: - remove all React components with minor functionality loss
  • Loading branch information
vanntile committed Apr 10, 2022
1 parent bad5d5d commit 331162a
Show file tree
Hide file tree
Showing 101 changed files with 12,610 additions and 15,610 deletions.
File renamed without changes.
15 changes: 0 additions & 15 deletions .eslintignore

This file was deleted.

60 changes: 0 additions & 60 deletions .eslintrc

This file was deleted.

68 changes: 50 additions & 18 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@

# Created by https://www.toptal.com/developers/gitignore/api/macos,react,node
# Edit at https://www.toptal.com/developers/gitignore?templates=macos,react,node
# Created by https://www.toptal.com/developers/gitignore/api/macos,node,visualstudiocode
# Edit at https://www.toptal.com/developers/gitignore?templates=macos,node,visualstudiocode

### macOS ###
# General
Expand Down Expand Up @@ -39,6 +39,7 @@ npm-debug.log*
yarn-debug.log*
yarn-error.log*
lerna-debug.log*
.pnpm-debug.log*

# Diagnostic reports (https://nodejs.org/api/report.html)
report.[0-9]*.[0-9]*.[0-9]*.[0-9]*.json
Expand Down Expand Up @@ -75,8 +76,8 @@ build/Release
node_modules/
jspm_packages/

# TypeScript v1 declaration files
typings/
# Snowpack dependency directory (https://snowpack.dev/)
web_modules/

# TypeScript cache
*.tsbuildinfo
Expand Down Expand Up @@ -105,17 +106,20 @@ typings/
# Yarn Integrity file
.yarn-integrity

# dotenv environment variables file
# dotenv environment variable files
.env
.env.test
.env*.local
.env.development.local
.env.test.local
.env.production.local
.env.local

# parcel-bundler cache (https://parceljs.org/)
.cache
.parcel-cache

# Next.js build output
.next
out

# Nuxt.js build / generate output
.nuxt
Expand All @@ -130,6 +134,12 @@ dist
# vuepress build output
.vuepress/dist

# vuepress v2.x temp and cache directory
.temp

# Docusaurus cache and generated files
.docusaurus

# Serverless directories
.serverless/

Expand All @@ -145,19 +155,41 @@ dist
# Stores VSCode versions used for testing VSCode extensions
.vscode-test

### react ###
.DS_*
**/*.backup.*
**/*.back.*
# yarn v2
.yarn/cache
.yarn/unplugged
.yarn/build-state.yml
.yarn/install-state.gz
.pnp.*

### Node Patch ###
# Serverless Webpack directories
.webpack/

# Optional stylelint cache

# SvelteKit build / generate output
.svelte-kit

### VisualStudioCode ###
.vscode/*
!.vscode/settings.json
!.vscode/tasks.json
!.vscode/launch.json
!.vscode/extensions.json
!.vscode/*.code-snippets

node_modules
# Local History for Visual Studio Code
.history/

*.sublime*
# Built Visual Studio Code Extensions
*.vsix

psd
thumb
sketch
### VisualStudioCode Patch ###
# Ignore all local history of files
.history
.ionide

# End of https://www.toptal.com/developers/gitignore/api/macos,react,node
# Support for Project snippet scope

snippets
# End of https://www.toptal.com/developers/gitignore/api/macos,node,visualstudiocode
1 change: 0 additions & 1 deletion .husky/.gitignore

This file was deleted.

2 changes: 1 addition & 1 deletion .husky/commit-msg
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/bin/sh
. "$(dirname "$0")/_/husky.sh"

npx commitlint --edit
npx commitlint --config .commitlintrc.cjs --edit
20 changes: 2 additions & 18 deletions .stylelintrc
Original file line number Diff line number Diff line change
Expand Up @@ -4,26 +4,10 @@
"at-rule-no-unknown": [
true,
{
"ignoreAtRules": [
"extends",
"tailwind",
"layer",
"screen",
"variants",
"media"
]
"ignoreAtRules": ["extends", "tailwind", "layer", "screen", "variants", "media"]
}
],
"block-no-empty": null,
"unit-whitelist": [
"em",
"rem",
"s",
"px",
"%",
"vh",
"deg",
"ms"
]
"unit-allowed-list": ["em", "rem", "s", "px", "%", "vh", "deg", "ms"]
}
}
20 changes: 11 additions & 9 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,20 +3,22 @@
".czrc": "jsonc",
".stylelintrc": "jsonc"
},
"material-icon-theme.folders.associations": {
"types": "typescript",
"blog": "docs",
"posts": "markdown"
},
"material-icon-theme.files.associations": {
"next.config.js": "vercel"
},
"tailwindCSS.includeLanguages": {
"typescript": "javascript"
"typescript": "javascript",
"astro": "html"
},
"css.validate": false,
"stylelint.enable": true,
"editor.quickSuggestions": {
"strings": true
},
"editor.formatOnSave": true,
"headwind.classRegex": {
"astro": "\\bclass\\s*=\\s*[\\\"\\']([_a-zA-Z0-9\\s\\-\\:\\/]+)[\\\"\\']",
"html": "\\bclass\\s*=\\s*[\\\"\\']([_a-zA-Z0-9\\s\\-\\:\\/]+)[\\\"\\']",
"javascriptreact": "(?:\\bclassName\\s*=\\s*[\\\"\\']([_a-zA-Z0-9\\s\\-\\:\\/]+)[\\\"\\'])|(?:\\btw\\s*`([_a-zA-Z0-9\\s\\-\\:\\/]*)`)"
},
"[markdown]": {
"tailwindCSS.validate": false
}
}
1 change: 0 additions & 1 deletion Procfile

This file was deleted.

58 changes: 35 additions & 23 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,31 +1,43 @@
# vanntile's portfolio
# Welcome to [Astro](https://astro.build)

[![Open in StackBlitz](https://developer.stackblitz.com/img/open_in_stackblitz.svg)](https://stackblitz.com/github/withastro/astro/tree/latest/examples/starter)

[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)
[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)
[![npm type definitions](https://img.shields.io/npm/types/typescript)](https://github.com/Microsoft/TypeScript)
> 🧑‍🚀 **Seasoned astronaut?** Delete this file. Have fun!
A NextJS MDX personal [portfolio site](https://vanntile.com). Here's a cookie 🍪.
## 🚀 Project Structure

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

It currently integrates the following:
```
/
├── public/
│ ├── robots.txt
│ └── favicon.ico
├── src/
│ ├── components/
│ │ └── Tour.astro
│ └── pages/
│ └── index.astro
└── package.json
```

- commitizen, cz-emoji, commitlint
- standard-version
- husky v6
- Prettier configuration
- TypeScript
- Module alias
- NextJS (React framework)
- React tabs (accessible and usable)
- TailwindCSS & PostCSS
- MDX, remark, rehype, mdx-prism (and @next/mdx)
- restrictive CSP
- Next API
- Mailgun.js & rate limiting (with lru-cache)
Astro looks for `.astro` or `.md` files in the `src/pages/` directory. Each page is exposed as a route based on its file name.

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

- [x]: content: add 2 articles
- [ ]: content: add brand book in the 'Design deck'
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:3000` |
| `npm run build` | Build your production site to `./dist/` |
| `npm run preview` | Preview your build locally, before deploying |

## 👀 Want to learn more?

Feel free to check [our documentation](https://github.com/withastro/astro) or jump into our [Discord server](https://astro.build/chat).
38 changes: 38 additions & 0 deletions astro.config.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
import tailwind from '@astrojs/tailwind'
import { defineConfig } from 'astro/config'

// https://astro.build/config
export default defineConfig({
site: 'https://vanntile.com',
markdown: {
mode: 'mdx',
syntaxHighlight: 'prism',
remarkPlugins: [
[
'remark-toc',
{
tight: true,
ordered: true,
},
],
'remark-code-titles',
'remark-slug',
'remark-hint',
'remark-html',
],
rehypePlugins: [
[
'rehype-autolink-headings',
{
behavior: 'prepend',
properties: {
ariaLabel: 'Anchor',
tabIndex: -1,
className: ['icon-link'],
},
},
],
],
},
integrations: [tailwind({ config: { applyAstroPreset: false, applyBaseStyles: false } })],
})
15 changes: 0 additions & 15 deletions components/AnimatedHeader.tsx

This file was deleted.

Loading

0 comments on commit 331162a

Please sign in to comment.