Compare commits
No commits in common. "main" and "v1.3.78" have entirely different histories.
8 changed files with 40 additions and 84 deletions
31
README.md
31
README.md
|
|
@ -22,30 +22,13 @@ $ pnpm i
|
|||
|
||||
## Commands
|
||||
|
||||
| Command | Action |
|
||||
| ----------------------------- | ---------------------------------------------- |
|
||||
| `pnpm run dev` | start dev server |
|
||||
| `pnpm run build` | generate static files to `dist` directory |
|
||||
| `pnpm run deploy` | upload to my server |
|
||||
| `pnpm run prep:now` | back up and clear current `now page` constants |
|
||||
| `pnpm run patch:build:deploy` | increment version, build, then upload |
|
||||
|
||||
## Testing
|
||||
|
||||
This project uses Vitest for unit tests. The test script is defined in `package.json` as `vitest run .`.
|
||||
|
||||
Run tests locally with pnpm (recommended):
|
||||
|
||||
```bash
|
||||
# install dependencies (if you haven't already)
|
||||
pnpm i
|
||||
|
||||
# run tests once
|
||||
pnpm test
|
||||
|
||||
# run Vitest in interactive/watch mode
|
||||
pnpm exec vitest
|
||||
```
|
||||
| Command | Action |
|
||||
| ------------------- | ---------------------------------------------- |
|
||||
| `pnpm run dev` | start dev server |
|
||||
| `pnpm run build` | generate static files to `dist` directory |
|
||||
| `pnpm run deploy` | upload to my server |
|
||||
| `pnpm run prep:now` | back up and clear current `now page` constants |
|
||||
| `pnpm run patch:build:deploy` | increment version, build, then upload |
|
||||
|
||||
## Deployment
|
||||
|
||||
|
|
|
|||
16
package.json
16
package.json
|
|
@ -1,7 +1,7 @@
|
|||
{
|
||||
"name": "@ayco/personal-website",
|
||||
"type": "module",
|
||||
"version": "1.3.83",
|
||||
"version": "1.3.78",
|
||||
"private": true,
|
||||
"scripts": {
|
||||
"astro": "astro",
|
||||
|
|
@ -11,9 +11,8 @@
|
|||
"preview": "astro preview",
|
||||
"lint": "eslint . --config eslint.config.mjs --cache",
|
||||
"lint:fix": "eslint . --config eslint.config.mjs --fix",
|
||||
"fmt": "prettier . --config prettier.config.mjs --check",
|
||||
"fmt:fix": "prettier . --config prettier.config.mjs --write",
|
||||
"check": "npm run fmt && npm run lint",
|
||||
"format": "prettier . --write",
|
||||
"check": "npm run format && npm run lint",
|
||||
"deploy": "eval $(grep '^HOST' .env) && scp -r dist ayo@$HOST:~/ayco.io-flask",
|
||||
"patch:build:deploy": "npm version patch && npm run build && npm run deploy",
|
||||
"pbd": "npm run patch:build:deploy",
|
||||
|
|
@ -52,7 +51,6 @@
|
|||
"rehype-stringify": "^10.0.1",
|
||||
"remark-parse": "^11.0.0",
|
||||
"remark-rehype": "^11.1.2",
|
||||
"sharp": "^0.34.5",
|
||||
"tslib": "^2.8.1",
|
||||
"typescript": "^6.0.3",
|
||||
"typescript-eslint": "^8.59.3",
|
||||
|
|
@ -63,14 +61,14 @@
|
|||
},
|
||||
"lint-staged": {
|
||||
"*.{js,mjs,astro,ts}": [
|
||||
"prettier . --config prettier.config.mjs --write",
|
||||
"eslint . --config eslint.config.mjs --fix"
|
||||
"prettier --write",
|
||||
"eslint --fix"
|
||||
],
|
||||
"*.json": [
|
||||
"prettier . --config prettier.config.mjs --write"
|
||||
"prettier --write"
|
||||
]
|
||||
},
|
||||
"packageManager": "pnpm@11.5.2+sha512.71c631e382066efc25625d5cf029075de07b61b37f6e27350fbd84b1bda5864c8c1967adc280776b45c30a715c0359a3be08fef42d5bb09e2b99029979692916",
|
||||
"packageManager": "pnpm@11.2.2",
|
||||
"dependencies": {
|
||||
"@ayo-run/status-indicator": "^2.1.2",
|
||||
"web-component-base": "^4.1.2"
|
||||
|
|
|
|||
|
|
@ -96,9 +96,6 @@ importers:
|
|||
remark-rehype:
|
||||
specifier: ^11.1.2
|
||||
version: 11.1.2
|
||||
sharp:
|
||||
specifier: ^0.34.5
|
||||
version: 0.34.5
|
||||
tslib:
|
||||
specifier: ^2.8.1
|
||||
version: 2.8.1
|
||||
|
|
@ -3258,7 +3255,8 @@ snapshots:
|
|||
transitivePeerDependencies:
|
||||
- supports-color
|
||||
|
||||
'@img/colour@1.1.0': {}
|
||||
'@img/colour@1.1.0':
|
||||
optional: true
|
||||
|
||||
'@img/sharp-darwin-arm64@0.34.5':
|
||||
optionalDependencies:
|
||||
|
|
@ -4124,7 +4122,8 @@ snapshots:
|
|||
|
||||
destr@2.0.5: {}
|
||||
|
||||
detect-libc@2.1.2: {}
|
||||
detect-libc@2.1.2:
|
||||
optional: true
|
||||
|
||||
devalue@5.8.1: {}
|
||||
|
||||
|
|
@ -5776,6 +5775,7 @@ snapshots:
|
|||
'@img/sharp-win32-arm64': 0.34.5
|
||||
'@img/sharp-win32-ia32': 0.34.5
|
||||
'@img/sharp-win32-x64': 0.34.5
|
||||
optional: true
|
||||
|
||||
shebang-command@2.0.0:
|
||||
dependencies:
|
||||
|
|
|
|||
|
|
@ -57,7 +57,7 @@ export const footerLinks: Link[] = [
|
|||
},
|
||||
{
|
||||
text: 'Mastodon',
|
||||
url: 'https://elk.zone/m.webtoo.ls/@ayo',
|
||||
url: 'https://main.elk.zone/social.ayco.io/@ayo',
|
||||
icon: 'mastodon',
|
||||
},
|
||||
{
|
||||
|
|
|
|||
|
|
@ -15,7 +15,7 @@ import { getImage } from 'astro:assets'
|
|||
|
||||
// fetch mastodon account
|
||||
const response = await fetch(
|
||||
'https://m.webtoo.ls/api/v1/accounts/lookup?acct=ayo'
|
||||
'https://social.ayco.io/api/v1/accounts/lookup?acct=ayo'
|
||||
)
|
||||
const data = await response.json()
|
||||
const { avatar } = data
|
||||
|
|
|
|||
|
|
@ -8,7 +8,7 @@ import { Picture } from 'astro:assets'
|
|||
|
||||
// fetch mastodon account
|
||||
const response = await fetch(
|
||||
'https://m.webtoo.ls/api/v1/accounts/lookup?acct=ayo'
|
||||
'https://social.ayco.io/api/v1/accounts/lookup?acct=ayo'
|
||||
)
|
||||
const data = await response.json()
|
||||
const { avatar, note } = data
|
||||
|
|
@ -38,9 +38,7 @@ const avatarSize = 150
|
|||
</h1>
|
||||
|
||||
<a href="/now" class="now-wrapper action primary">
|
||||
<span class="now-label">
|
||||
<status-indicator status="active" pulse> now </status-indicator>
|
||||
</span>
|
||||
<span class="now-label">now</span>
|
||||
<span class="status">{now.title}</span>
|
||||
</a>
|
||||
</div>
|
||||
|
|
@ -95,7 +93,6 @@ const avatarSize = 150
|
|||
|
||||
&.primary {
|
||||
border: 1px solid rgba(255, 255, 255, 0.2);
|
||||
border-style: dotted;
|
||||
border-radius: 40px;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -38,8 +38,8 @@ AP0YLC768PFTBm9CM5T1BE0xjJ7s4dZSrVoI4n8RSe1nCA==
|
|||
</div>
|
||||
<p>Expiry Date: 2027-05-30</p>
|
||||
<p>
|
||||
Fingerprint: <code>17F1 3D5E 8FF7 372B 1354 5C38 65E6 BF64 1529 3C65</code
|
||||
>
|
||||
Fingerprint: <code
|
||||
>17F1 3D5E 8FF7 372B 1354 5C38 65E6 BF64 1529 3C65</code>
|
||||
</p>
|
||||
|
||||
<p></p>
|
||||
|
|
@ -49,29 +49,21 @@ AP0YLC768PFTBm9CM5T1BE0xjJ7s4dZSrVoI4n8RSe1nCA==
|
|||
|
||||
<script>
|
||||
/* Clipboard copy logic */
|
||||
const copyBtn = document.querySelector('.copy-btn')
|
||||
if (copyBtn) {
|
||||
copyBtn.addEventListener('click', async () => {
|
||||
const keyText = (
|
||||
document.querySelector('#public-key code') as HTMLElement
|
||||
)?.innerText.trim()
|
||||
if (!keyText) return
|
||||
try {
|
||||
await navigator.clipboard.writeText(keyText)
|
||||
const btn = document.querySelector('.copy-btn')
|
||||
if (btn) {
|
||||
const original = btn.textContent
|
||||
btn.textContent = 'Copied!'
|
||||
setTimeout(() => {
|
||||
btn.textContent = original
|
||||
}, 2000)
|
||||
}
|
||||
} catch (err) {
|
||||
console.error('Copy failed', err)
|
||||
alert('Unable to copy the key. Please copy it manually.')
|
||||
}
|
||||
})
|
||||
}
|
||||
document.querySelector('.copy-btn').addEventListener('click', async () => {
|
||||
const keyText = document.querySelector('#public-key code').innerText.trim()
|
||||
try {
|
||||
await navigator.clipboard.writeText(keyText)
|
||||
const btn = document.querySelector('.copy-btn')
|
||||
const original = btn.textContent
|
||||
btn.textContent = 'Copied!'
|
||||
setTimeout(() => {
|
||||
btn.textContent = original
|
||||
}, 2000)
|
||||
} catch (err) {
|
||||
console.error('Copy failed', err)
|
||||
alert('Unable to copy the key. Please copy it manually.')
|
||||
}
|
||||
})
|
||||
</script>
|
||||
|
||||
<style>
|
||||
|
|
|
|||
|
|
@ -1,14 +0,0 @@
|
|||
import { defineConfig } from 'vitest/config'
|
||||
|
||||
// Exclude generated files and heavy folders from the watcher to avoid
|
||||
// continuous re-runs when build output or other tools touch files.
|
||||
export default defineConfig({
|
||||
test: {
|
||||
globals: true,
|
||||
environment: 'node',
|
||||
exclude: ['dist/**', 'public/**', 'node_modules/**'],
|
||||
},
|
||||
watch: {
|
||||
exclude: ['dist/**', 'public/**', 'node_modules/**', '.git/**'],
|
||||
},
|
||||
})
|
||||
Loading…
Reference in a new issue