Skip to content

Commit 7d80d8e

Browse files
committed
stricter link check with lychee, update package.json, pre-commit hooks, site metadata and screenshots
1 parent ad07a06 commit 7d80d8e

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

60 files changed

+551
-543
lines changed

.github/workflows/link-check.yml

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -4,18 +4,21 @@ on:
44
workflow_dispatch:
55
schedule:
66
- cron: '0 0 1 * *' # monthly
7+
push:
8+
branches: [main]
9+
pull_request:
10+
branches: [main]
711

812
jobs:
9-
markdown-link-check:
13+
link-check:
1014
runs-on: ubuntu-latest
11-
if: github.repository_owner == 'janosh'
1215
steps:
1316
- name: Check out repo
1417
uses: actions/checkout@v4
1518

16-
- name: Run markdown link check
17-
uses: gaurav-nelson/github-action-markdown-link-check@v1
18-
# docs at https://git.io/JBaKu
19+
- name: Discover broken links
20+
uses: lycheeverse/lychee-action@v2
1921
with:
20-
# sets status code 500 (Internal Server Error) and 503 (Service Unavailable) as alive
21-
config-file: .github/workflows/link-check-config.json
22+
args: --exclude '%7B' --exclude-path ./site/src/sites.yml -- ./**/*.{md,svelte,ts,yml}
23+
env:
24+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

.github/workflows/test.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,4 +12,6 @@ jobs:
1212
uses: janosh/workflows/.github/workflows/npm-test.yml@main
1313
with:
1414
working-directory: site
15+
test-cmd: ''
1516
install-e2e: npx playwright install chromium
17+
e2e-test-cmd: npx playwright test tests/*.ts

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,3 +7,6 @@ build
77

88
# secrets
99
.env
10+
11+
# tests
12+
test-results

.pre-commit-config.yaml

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ repos:
3131
- svelte
3232

3333
- repo: https://github.com/adrienverge/yamllint
34-
rev: v1.35.1
34+
rev: v1.37.1
3535
hooks:
3636
- id: yamllint
3737
args: [--config-file, .github/yamllint.yml]
@@ -53,8 +53,16 @@ repos:
5353
args: [--ignore-words-list, 'ons,linz', --check-filenames]
5454
stages: [pre-commit, commit-msg]
5555

56+
- repo: https://github.com/crate-ci/typos
57+
rev: v1.32.0
58+
hooks:
59+
- id: typos
60+
types: [text]
61+
args: []
62+
exclude: ^site/src/sites.yml|.pre-commit-config.yaml$
63+
5664
- repo: https://github.com/pre-commit/mirrors-eslint
57-
rev: v9.20.1
65+
rev: v9.27.0
5866
hooks:
5967
- id: eslint
6068
types: [file]

readme.md

Lines changed: 195 additions & 205 deletions
Large diffs are not rendered by default.

site/package.json

Lines changed: 20 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -17,31 +17,31 @@
1717
"test": "playwright test tests/*.test.ts"
1818
},
1919
"devDependencies": {
20-
"@iconify/svelte": "^4.2.0",
21-
"@playwright/test": "^1.50.1",
20+
"@iconify/svelte": "^5.0.0",
21+
"@playwright/test": "^1.52.0",
2222
"@rollup/plugin-yaml": "^4.1.2",
23-
"@stylistic/eslint-plugin": "^4.0.1",
23+
"@stylistic/eslint-plugin": "^4.2.0",
2424
"@sveltejs/adapter-static": "^3.0.8",
25-
"@sveltejs/kit": "^2.17.2",
25+
"@sveltejs/kit": "^2.21.0",
2626
"@sveltejs/vite-plugin-svelte": "^5.0.3",
27-
"dotenv": "^16.4.7",
28-
"eslint": "^9.20.1",
29-
"eslint-plugin-svelte": "^2.46.1",
27+
"dotenv": "^16.5.0",
28+
"eslint": "^9.27.0",
29+
"eslint-plugin-svelte": "^3.8.1",
3030
"js-yaml": "^4.1.0",
31-
"marked": "^15.0.7",
32-
"prettier": "^3.5.1",
33-
"prettier-plugin-svelte": "^3.3.3",
34-
"puppeteer": "^24.2.1",
35-
"sharp": "^0.33.5",
36-
"svelte": "^5.20.2",
37-
"svelte-check": "^4.1.4",
38-
"svelte-multiselect": "11.0.0-rc.1",
31+
"marked": "^15.0.11",
32+
"prettier": "^3.5.3",
33+
"prettier-plugin-svelte": "^3.4.0",
34+
"puppeteer": "^24.8.2",
35+
"sharp": "^0.34.1",
36+
"svelte": "^5.30.2",
37+
"svelte-check": "^4.2.1",
38+
"svelte-multiselect": "11.1.0",
3939
"svelte-preprocess": "^6.0.3",
40-
"svelte-zoo": "^0.4.17",
41-
"svelte2tsx": "^0.7.34",
42-
"typescript": "5.7.3",
43-
"typescript-eslint": "^8.24.1",
44-
"vite": "^6.1.1"
40+
"svelte-zoo": "^0.4.18",
41+
"svelte2tsx": "^0.7.39",
42+
"typescript": "5.8.3",
43+
"typescript-eslint": "^8.32.1",
44+
"vite": "^6.3.5"
4545
},
4646
"keywords": [
4747
"sveltekit",

site/src/lib/ContributorList.svelte

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,11 @@
44
interface Props {
55
contributors: RepoContributor[]
66
}
7-
87
let { contributors }: Props = $props()
98
</script>
109

1110
<ul class="contributors">
12-
{#each contributors as { avatar_url, html_url, login }}
11+
{#each contributors as { avatar_url, html_url, login } (JSON.stringify(login))}
1312
<li>
1413
<a href={html_url}>
1514
<img src={avatar_url} alt={login} />

site/src/lib/Screenshot.svelte

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,10 @@
1414
1515
const slugify = (title: string) => title.toLowerCase().replaceAll(` `, `-`)
1616
17-
const base = `https://raw.githubusercontent.com/janosh/awesome-sveltekit/main/site/static`
18-
let src = $derived(`${dev ? `` : base}/screenshots/${slugify(title)}${resolution}.avif`)
17+
const base_url = `https://github.com/janosh/awesome-sveltekit/raw/main/site/static`
18+
let src = $derived(
19+
`${dev ? `` : base_url}/screenshots/${slugify(title)}${resolution}.avif`,
20+
)
1921
</script>
2022

2123
<img {src} alt="Screenshot of {title}" {width} {height} {style} />

site/src/lib/SiteDetails.svelte

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@
7171
{/if}
7272
{#if contributors.length > 1}
7373
<ol class="contributors">
74-
{#each contributors as person}
74+
{#each contributors as person (person.name)}
7575
<li>
7676
<Person {person} />
7777
</li>
@@ -105,7 +105,7 @@
105105
<hr />
106106
<p class="tags flex">
107107
<Icon icon="octicon:tag" />&ensp;Tags&emsp;
108-
{#each tags as tag}
108+
{#each tags as tag (tag)}
109109
<span>{tag}</span>
110110
{/each}
111111
</p>
@@ -114,7 +114,7 @@
114114
<hr />
115115
<p class="uses flex">
116116
<Icon icon="octicon:stack-16" />&ensp;Uses&emsp;
117-
{#each tools as [tool, href]}
117+
{#each tools as [tool, href] (tool)}
118118
<a {href}>{tool}</a>
119119
{/each}
120120
</p>

site/src/lib/SitePreview.svelte

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,12 +8,12 @@
88
site: Site
99
idx?: number
1010
tags?: boolean
11-
style?: string | null
11+
[key: string]: unknown
1212
}
13-
let { site, idx = 0, tags = false, style = null }: Props = $props()
13+
let { site, idx = 0, tags = false, ...rest }: Props = $props()
1414
</script>
1515

16-
<a href={site.slug} {style}>
16+
<a href={site.slug} {...rest}>
1717
<Screenshot title={site.title} resolution=".small" style="cursor: pointer;" />
1818
</a>
1919
<div class="flex">
@@ -30,7 +30,7 @@
3030
{#if tags}
3131
<p class="tags flex">
3232
<Icon icon="octicon:tag" style="margin: 0 1ex 0 0;" />
33-
{#each site.tags as tag}
33+
{#each site.tags as tag (tag)}
3434
<small class:active={$filter_tags.find((t) => t.label === tag)}>
3535
{tag}
3636
</small>

0 commit comments

Comments
 (0)