Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
39 changes: 39 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
name: CI

on:
pull_request:
branches: ["main"]
push:
branches: ["main"]

jobs:
lint-and-build:
name: Lint, Type Check, and Build
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4

- name: Setup Node
uses: actions/setup-node@v4
with:
node-version: "20"
cache: "npm"
cache-dependency-path: package-lock.json

- name: Install dependencies
run: npm ci

- name: Check formatting (non-blocking)
run: npm run format
continue-on-error: true

- name: Type check
run: npm run typecheck

- name: Astro check
run: npm run check

- name: Build
run: npm run build

6 changes: 6 additions & 0 deletions .husky/pre-commit
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
#!/bin/sh
. "$(dirname "$0")/_/husky.sh"

# Run lint-staged for staged files
npx --no-install lint-staged

24 changes: 24 additions & 0 deletions Readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,17 @@ To run the repository locally and explore the website on your machine, follow th
5. **Open Your Browser:**
Visit [http://localhost:4321](http://localhost:4321) to view the Akash Network website locally.

### Developer Scripts

The following scripts are available for development and quality checks:

- **`npm run check`** - Run Astro type and content checks
- **`npm run typecheck`** - Run TypeScript type checking (no emit)
- **`npm run format`** - Check code formatting with Prettier
- **`npm run format:write`** - Format code with Prettier (writes changes)

These scripts are also run automatically in CI on pull requests and pushes to main.

## Contribution Guidelines

Before contributing to the project, please adhere to the following guidelines to ensure the project's integrity and maintainability.
Expand Down Expand Up @@ -123,6 +134,19 @@ Each commit message should carry a meaningful structure, commencing with a type
- Utilize the imperative mood (e.g., "add," "fix," "update") in the description.
- Provide context in the description when necessary..

### Developer Scripts

Run local checks and formatting:

```bash
npm run check # Astro type and content validation
npm run typecheck # TypeScript type checks (no emit)
npm run format # Prettier format check (read-only)
npm run format:write # Prettier format and fix files
```

These scripts are automatically run in CI on pull requests. Always run `npm run format:write` before committing to ensure consistent code style.

### How to Contribute to the Akash Website

## How to write a blog
Expand Down
4 changes: 1 addition & 3 deletions astro.config.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,7 @@ export default defineConfig({
},
integrations: [
tailwind(),
sitemap({
lastmod: new Date("2024-06-27"),
}),
sitemap(),
react(),
astroExpressiveCode({
themes: ["light-plus", "dark-plus"],
Expand Down
20 changes: 14 additions & 6 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,16 @@
"start": "astro dev",
"build": "astro build",
"preview": "astro preview",
"astro": "astro"
"astro": "astro",
"check": "astro check",
"typecheck": "tsc --noEmit",
"format": "prettier --check .",
"format:write": "prettier --write .",
"prepare": "husky"
},
"dependencies": {
"@astrojs/check": "^0.9.4",
"@astrojs/mdx": "^2.0.2",
"@astrojs/partytown": "^2.0.4",
"@astrojs/react": "^3.0.8",
"@astrojs/rss": "^4.0.11",
"@astrojs/sitemap": "^3.1.4",
Expand Down Expand Up @@ -42,12 +46,8 @@
"@tailwindcss/typography": "^0.5.10",
"@tanstack/react-query": "^4.29.7",
"@tanstack/react-query-devtools": "^4.32.6",
"@types/lodash": "^4.17.7",
"@types/react": "^18.0.21",
"@types/react-dom": "^18.0.6",
"astro": "^4.0.7",
"astro-expressive-code": "^0.30.1",
"astro-robots-txt": "^1.0.0",
"axios": "^1.6.0",
"class-variance-authority": "^0.7.0",
"clsx": "^2.0.0",
Expand Down Expand Up @@ -82,9 +82,17 @@
"zustand": "^4.5.2"
},
"devDependencies": {
"husky": "^9.1.6",
"lint-staged": "^15.2.7",
"@types/lodash": "^4.17.7",
"@types/react": "^18.0.21",
"@types/react-dom": "^18.0.6",
"@types/react-simple-maps": "^3.0.4",
"prettier": "^3.0.3",
"prettier-plugin-astro": "^0.12.0",
"prettier-plugin-tailwindcss": "^0.5.4"
},
"lint-staged": {
"*.{js,jsx,ts,tsx,astro,css,md,mdx,json,yml,yaml}": "prettier --write"
}
}