Skip to content

Commit

Permalink
feat: set up Astro to expose data via endpoints
Browse files Browse the repository at this point in the history
  • Loading branch information
kripod committed Apr 13, 2024
1 parent 2f583b5 commit 6df28c7
Show file tree
Hide file tree
Showing 20 changed files with 5,009 additions and 54 deletions.
25 changes: 25 additions & 0 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
name: CI
on:
push:
branches:
- main
pull_request:

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: ${{ github.ref != 'refs/heads/main' }}

jobs:
build-lint-test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: pnpm/action-setup@v3
- uses: actions/setup-node@v4
with:
node-version-file: .nvmrc
cache: pnpm
- run: pnpm install
- run: pnpm run build
- run: pnpm run lint
- run: pnpm run --if-present test
5 changes: 5 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
node_modules/
dist/
.astro/
.wrangler/
*.log*
.env.local
.env.*.local
.DS_Store
3 changes: 3 additions & 0 deletions .prettierrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"plugins": ["prettier-plugin-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",
"EditorConfig.EditorConfig",
"esbenp.prettier-vscode",
"GitHub.vscode-github-actions",
"unifiedjs.vscode-mdx"
]
}
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": "pnpm exec astro dev",
"name": "Development server",
"request": "launch",
"type": "node-terminal"
}
]
}
4 changes: 4 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
"editor.defaultFormatter": "esbenp.prettier-vscode",
"editor.formatOnSave": true
}
14 changes: 14 additions & 0 deletions astro.config.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
import starlight from "@astrojs/starlight";
import { defineConfig } from "astro/config";

export default defineConfig({
integrations: [
starlight({
title: "FX Rates HU",
social: {
github: "https://github.com/kripod/fx-rates-hu",
},
pagefind: false,
}),
],
});
16 changes: 11 additions & 5 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,21 +3,27 @@
"private": true,
"type": "module",
"scripts": {
"dev": "node --watch ./src/index.js",
"start": "node ./src/index.js",
"dev": "astro dev",
"build": "astro build",
"preview": "astro preview",
"clean": "git clean --interactive -dx --exclude .env.local --exclude \".env.*.local\" --exclude node_modules/",
"lint": "pnpm run \"/^lint:(?!fix)/\"",
"lint:astro": "astro check",
"lint:format": "prettier --check .",
"lint:types": "tsc --noEmit",
"lint:fix": "pnpm run \"/^lint:fix:/\"",
"lint:fix:format": "prettier --write ."
},
"dependencies": {
"@astrojs/starlight": "^0.21.5",
"astro": "^4.6.1",
"xlsx": "https://cdn.sheetjs.com/xlsx-0.20.1/xlsx-0.20.1.tgz"
},
"devDependencies": {
"@types/node": "^20.12.3",
"@astrojs/check": "^0.5.10",
"@types/node": "^20.12.7",
"prettier": "^3.2.5",
"typescript": "^5.4.3"
"prettier-plugin-astro": "^0.13.0",
"typescript": "^5.4.5"
},
"packageManager": "[email protected]"
}
Loading

0 comments on commit 6df28c7

Please sign in to comment.