Set up prettier

This commit is contained in:
hexaheximal 2025-07-30 11:29:36 -04:00
commit 7c4ba81ef3
Signed by: hexaheximal
GPG key ID: 66512C568C93CD3D
7 changed files with 4953 additions and 49 deletions

View file

@ -1,50 +1,50 @@
name: Deploy to Pages name: Deploy to Pages
on: on:
push: push:
branches: ["main"] branches: ["main"]
workflow_dispatch: workflow_dispatch:
permissions: permissions:
contents: read contents: read
pages: write pages: write
id-token: write id-token: write
concurrency: concurrency:
group: "pages" group: "pages"
cancel-in-progress: false cancel-in-progress: false
jobs: jobs:
build: build:
name: Build name: Build
runs-on: ubuntu-latest runs-on: ubuntu-latest
steps: steps:
- uses: actions/checkout@v4 - uses: actions/checkout@v4
- name: Setup Node - name: Setup Node
uses: actions/setup-node@v4 uses: actions/setup-node@v4
with: with:
node-version: "20" node-version: "20"
- name: Install dependencies - name: Install dependencies
run: npm i run: npm i
- name: Build with Astro - name: Build with Astro
run: npm run astro build run: npm run astro build
- name: Upload artifact - name: Upload artifact
uses: actions/upload-pages-artifact@v3 uses: actions/upload-pages-artifact@v3
with: with:
path: dist path: dist
deploy: deploy:
environment: environment:
name: github-pages name: github-pages
url: ${{ steps.deployment.outputs.page_url }} url: ${{ steps.deployment.outputs.page_url }}
needs: build needs: build
runs-on: ubuntu-latest runs-on: ubuntu-latest
name: Deploy name: Deploy
steps: steps:
- name: Deploy to GitHub Pages - name: Deploy to GitHub Pages
id: deployment id: deployment
uses: actions/deploy-pages@v4 uses: actions/deploy-pages@v4

6
.prettierrc Normal file
View file

@ -0,0 +1,6 @@
{
"plugins": ["prettier-plugin-astro"],
"tabWidth": 4,
"semi": false,
"overrides": [{ "files": "*.astro", "options": { "parser": "astro" } }]
}

View file

@ -1,4 +1,4 @@
{ {
"recommendations": ["astro-build.astro-vscode"], "recommendations": ["astro-build.astro-vscode"],
"unwantedRecommendations": [] "unwantedRecommendations": []
} }

4896
package-lock.json generated Normal file

File diff suppressed because it is too large Load diff

View file

@ -9,9 +9,11 @@
"astro": "astro" "astro": "astro"
}, },
"devDependencies": { "devDependencies": {
"@astrojs/starlight": "^0.34.3",
"astro": "^5.1.8", "astro": "^5.1.8",
"prettier": "^3.6.2",
"prettier-plugin-astro": "^0.14.1",
"sharp": "^0.33.5", "sharp": "^0.33.5",
"starlight": "^0.3.9", "starlight": "^0.3.9"
"@astrojs/starlight": "^0.34.3"
} }
} }

View file

@ -36,7 +36,7 @@ import "../styles/login.css"
const params = new URLSearchParams(window.location.search) const params = new URLSearchParams(window.location.search)
for (const name of ["redirect_uri", "state", "nonce"]) { for (const name of ["redirect_uri", "state", "nonce"]) {
const input = document.querySelector( const input = document.querySelector(
`input[name="${name}"]` `input[name="${name}"]`,
) as HTMLInputElement ) as HTMLInputElement
if (input && params.has(name)) input.value = params.get(name)! if (input && params.has(name)) input.value = params.get(name)!
} }
@ -72,7 +72,7 @@ import "../styles/login.css"
identifier: { type: "m.id.user", user: username }, identifier: { type: "m.id.user", user: username },
password, password,
}), }),
} },
) )
if (!res.ok) { if (!res.ok) {
@ -82,12 +82,12 @@ import "../styles/login.css"
const data = await res.json() const data = await res.json()
const id = form.querySelector( const id = form.querySelector(
'input[name="user_id"]' 'input[name="user_id"]',
) as HTMLInputElement ) as HTMLInputElement
id.value = data.user_id id.value = data.user_id
const token = form.querySelector( const token = form.querySelector(
'input[name="access_token"]' 'input[name="access_token"]',
) as HTMLInputElement ) as HTMLInputElement
token.value = data.access_token token.value = data.access_token

View file

@ -1,5 +1,5 @@
{ {
"extends": "astro/tsconfigs/strict", "extends": "astro/tsconfigs/strict",
"include": [".astro/types.d.ts", "**/*"], "include": [".astro/types.d.ts", "**/*"],
"exclude": ["dist"] "exclude": ["dist"]
} }