Skip to content

Commit

Permalink
Hello astro
Browse files Browse the repository at this point in the history
  • Loading branch information
syxc committed Aug 22, 2024
1 parent 8332b99 commit 3a197be
Show file tree
Hide file tree
Showing 23 changed files with 5,786 additions and 124 deletions.
10 changes: 10 additions & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
* text=auto eol=lf
*.bat text eol=crlf

*.png binary
*.jpg binary
*.jpeg binary
*.webp binary

# Linguist language overrides
**/.zed/settings.json linguist-language=JSON5
48 changes: 48 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
name: CI

on:
pull_request:
types:
- opened
- edited
- synchronize
- reopened
workflow_call:
push:
branches: ['master']

jobs:
build:
name: Code standards & build
runs-on: ubuntu-latest
timeout-minutes: 3

strategy:
matrix:
node-version: [18.x]

steps:
- name: '☁️ Checkout repository'
uses: actions/checkout@v4

- name: '🔧 Setup Node.js ${{ matrix.node-version }}'
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node-version }}

- name: '📦 Install pnpm'
uses: pnpm/action-setup@v2
with:
version: 9

- name: '📦 Install dependencies'
run: pnpm install --frozen-lockfile

- name: '📝 Checking code format'
run: pnpm run format:check

- name: '🔎 Lint code'
run: pnpm run lint

- name: '🚀 Build the project'
run: pnpm run build
141 changes: 18 additions & 123 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,130 +1,25 @@
# Logs
logs
*.log
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

# Runtime data
pids
*.pid
*.seed
*.pid.lock

# Directory for instrumented libs generated by jscoverage/JSCover
lib-cov

# Coverage directory used by tools like istanbul
coverage
*.lcov

# nyc test coverage
.nyc_output

# Grunt intermediate storage (https://gruntjs.com/creating-plugins#storing-task-files)
.grunt
# build output
dist/
# generated types
.astro/

# Bower dependency directory (https://bower.io/)
bower_components

# node-waf configuration
.lock-wscript

# Compiled binary addons (https://nodejs.org/api/addons.html)
build/Release

# Dependency directories
# dependencies
node_modules/
jspm_packages/

# Snowpack dependency directory (https://snowpack.dev/)
web_modules/

# TypeScript cache
*.tsbuildinfo

# Optional npm cache directory
.npm

# Optional eslint cache
.eslintcache

# Optional stylelint cache
.stylelintcache
.pnpm-store/

# Microbundle cache
.rpt2_cache/
.rts2_cache_cjs/
.rts2_cache_es/
.rts2_cache_umd/

# Optional REPL history
.node_repl_history

# Output of 'npm pack'
*.tgz

# Yarn Integrity file
.yarn-integrity
# logs
npm-debug.log*
yarn-debug.log*
yarn-error.log*
pnpm-debug.log*

# dotenv environment variable files
# environment variables
.env
.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
dist

# Gatsby files
.cache/
# Comment in the public line in if your project uses Gatsby and not Next.js
# https://nextjs.org/blog/next-9-1#public-directory-support
# public

# vuepress build output
.vuepress/dist

# vuepress v2.x temp and cache directory
.temp
.cache

# Docusaurus cache and generated files
.docusaurus

# Serverless directories
.serverless/

# FuseBox cache
.fusebox/

# DynamoDB Local files
.dynamodb/

# TernJS port file
.tern-port
.env.production

# Stores VSCode versions used for testing VSCode extensions
.vscode-test
# os files
.DS_Store
Thumbs.db

# yarn v2
.yarn/cache
.yarn/unplugged
.yarn/build-state.yml
.yarn/install-state.gz
.pnp.*
# lefthook
lefthook-local.yml
5 changes: 5 additions & 0 deletions .npmrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
prefer-workspace-packages=true
link-workspace-packages=true
# This prevents the examples to have the `workspace:` prefix
save-workspace-protocol=false
auto-install-peers=false
1 change: 1 addition & 0 deletions .nvmrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
18.20.4
19 changes: 19 additions & 0 deletions .prettierignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
# Ignore everything
/*
/src/content/**/*.md
/src/content/docs/**/*

# Except these files & folders
!/.vscode
!/.zed
!/src
!/public
!/.github
!tsconfig.json
!astro.config.ts
!astro.config.mjs
!package.json
!.prettierrc
!.prettierrc.js
!eslint.config.mjs
!lefthook.yml
27 changes: 27 additions & 0 deletions .prettierrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
/**
* @see https://prettier.io/docs/en/configuration.html
* @type {import("prettier").Config}
*/
const config = {
tabWidth: 2,
useTabs: false,
semi: true,
singleQuote: true,
jsxSingleQuote: true,
bracketSpacing: true,
trailingComma: 'es5',
arrowParens: 'avoid',
endOfLine: 'lf',
printWidth: 100,
plugins: ['prettier-plugin-astro'],
overrides: [
{
files: '*.astro',
options: {
parser: 'astro',
},
},
],
};

module.exports = config;
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"
}
]
}
33 changes: 33 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
{
"editor.formatOnSave": true,
"editor.formatOnSaveMode": "file",
"editor.defaultFormatter": "esbenp.prettier-vscode",
"[javascript]": {
"editor.defaultFormatter": "esbenp.prettier-vscode"
},
"[typescript]": {
"editor.defaultFormatter": "esbenp.prettier-vscode"
},
"[javascriptreact]": {
"editor.defaultFormatter": "esbenp.prettier-vscode"
},
"[typescriptreact]": {
"editor.defaultFormatter": "esbenp.prettier-vscode"
},
"[json]": {
"editor.defaultFormatter": "esbenp.prettier-vscode"
},
"[jsonc]": {
"editor.defaultFormatter": "esbenp.prettier-vscode"
},
"prettier.documentSelectors": ["**/*.astro"],
"[astro]": {
"editor.defaultFormatter": "esbenp.prettier-vscode"
},
"[markdown]": {
"editor.formatOnSave": false
},
"[mdx]": {
"editor.formatOnSave": false
}
}
31 changes: 31 additions & 0 deletions .zed/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
{
"formatter": "auto",
"format_on_save": "on",
"tab_size": 2,
"hard_tabs": false,
"preferred_line_length": 100,
"ensure_final_newline_on_save": true,
"remove_trailing_whitespace_on_save": true,
// Zed's Prettier integration settings.
"prettier": {
"allowed": true,
"plugins": ["prettier-plugin-astro", "@prettier/plugin-xml", "..."],
// Format config
"tabWidth": 2,
"useTabs": false,
"semi": true,
"singleQuote": true,
"jsxSingleQuote": true,
"bracketSpacing": true,
"trailingComma": "es5",
"arrowParens": "avoid",
"endOfLine": "lf",
"printWidth": 100
},
"languages": {
"Markdown": {
"format_on_save": "off",
"remove_trailing_whitespace_on_save": false
}
}
}
Loading

0 comments on commit 3a197be

Please sign in to comment.