Skip to content

Commit 70b2cb0

Browse files
feat!: v2 (#48)
1 parent 66209d1 commit 70b2cb0

Some content is hidden

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

71 files changed

+2528
-1948
lines changed

.env.example

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,4 @@
1-
PUBLIC_GITHUB_TOKEN=your_github_token
1+
KV_REST_API_TOKEN=your_kv_token
2+
KV_REST_API_URL="https://your.api/url"
3+
GITHUB_TOKEN=your_github_token
4+
PUBLIC_POSTHOG_TOKEN=your_posthog_token

README.md

Lines changed: 11 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# svelte-changelog
22

3-
[svelte-changelog.vercel.app](https://svelte-changelog.vercel.app/)
3+
[svelte-changelog.dev](https://svelte-changelog.dev)
44

55
Made with SvelteKit, TailwindCSS & shadcn-svelte.
66

@@ -13,36 +13,19 @@ Made with SvelteKit, TailwindCSS & shadcn-svelte.
1313
- Dynamically computed badges to indicate whether a package is the Latest, a Major version, a Prerelease, or a Maintenance version
1414
- Hover popups at multiple places across the site
1515
- "What's new" banner to keep users updated about the latest changes to the website
16-
- Authenticate with GitHub to bypass rate limits and get access to more features
17-
- Optional use of a GitHub token to avoid rate limiting in dev mode in a `.env` file (see `.env.example`)
16+
- ...and more!
1817

1918
## How does it work?
2019

21-
The site makes requests to the GitHub API on the client side to get the latest releases for all the packages.
22-
As such, the data is fresh from GitHub every time you refresh the page.
20+
The site makes requests to the GitHub API on the server side to get the latest releases for all the packages.
21+
It smartly caches the data, frequently invalidating it to always be up to date while avoiding hitting GitHub as
22+
much as possible.
2323

2424
Some computations are made to generate the badges, but everything else is a simple cosmetic
2525
wrapper around GitHub releases.
2626
**No data alteration is performed by the site other than for styling and rendering purposes**.
2727

28-
### What is that "Log in with GitHub" button?
29-
30-
With the growing amount of features and supported packages, the site went from requesting the GitHub API
31-
very few times to request it a lot.
32-
As such, the rate limit of the GitHub API was quickly reached, and the site became hard to browse.
33-
34-
To solve this issue, I [initially implemented](https://github.com/WarningImHack3r/svelte-changelog/commit/f28218cbf3d57d509e771520e8c02a610dab4b95) a way to input a GitHub token in the website settings.
35-
This became [the next week](https://github.com/WarningImHack3r/svelte-changelog/pull/27) a full-fledged authentication system with GitHub OAuth, which is what you see today.
36-
37-
**By logging in with GitHub, you can browse the site (almost) without any rate limit issues**.
38-
You will also get access to more features, such as the ability to see the details of a pull request
39-
or issue directly on the site.
40-
41-
The site does not store any data about you. The only thing the login system does is store the token given
42-
by the GitHub authentication process in the browser's local storage to use it for the GitHub API requests.
43-
44-
Logging in is entirely optional but highly recommended. You can remove the token from the website at any time
45-
by clicking the "Log out" button in your avatar dropdown.
28+
For more info, visit the [v2 release blog](https://svelte-changelog.dev/blog/v2).
4629

4730
## Missing a package?
4831

@@ -57,15 +40,15 @@ If you think I missed a package, you can either open an issue or directly contri
5740

5841
### How to contribute
5942

60-
Fork the repo, edit the `/src/routes/+layout.ts` file, and open a PR.
43+
Fork the repo, edit the `/src/lib/repositories.ts` file, and open a PR.
6144
**If the repo is not in the `sveltejs` GitHub organization, please open an issue instead.**
6245

6346
The code architecture is made to be as flexible as possible, here's how it works:
6447

6548
```typescript
66-
const repos: Record<Tab, { name: string; repos: Repo[] }> = {
67-
svelte: ...,
68-
kit: ...,
49+
export const repos = {
50+
svelte: {/* ... */},
51+
kit: {/* ... */},
6952
others: {
7053
name: "Other",
7154
repos: [
@@ -76,7 +59,7 @@ const repos: Record<Tab, { name: string; repos: Repo[] }> = {
7659
changesMode: "releases", // Optional line, the way to get the changes; either "releases" or "changelog", defaults to "releases"
7760
repoName: "your-repo", // The name of the repo on GitHub, as it appears in the URL: https://github.com/sveltejs/your-repo
7861
dataFilter: ({ tag_name }) => true, // Optional line, return false to exclude a version from its tag name
79-
versionFromTag: tag => "...", // Return the version from the tag name; must be a valid semver
62+
metadataFromTag: tag => ["package-name", "2.4.3"], // Return the package name and version from the tag name; the version must be a valid semver without any leading "v"
8063
changelogContentsReplacer: contents => contents, // Optional line, replace the contents of the changelog file before parsing it; only used if `changesMode` is "changelog"
8164
}
8265
]

eslint.config.js

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,11 @@ export default tseslint.config(
3030
}
3131
}
3232
},
33+
{
34+
rules: {
35+
"@typescript-eslint/no-unused-vars": ["error", { ignoreRestSiblings: true }]
36+
}
37+
},
3338
{
3439
ignores: ["build/", ".svelte-kit/", "dist/", "src/lib/components/ui/", "src/lib/utils.[jt]s"]
3540
}

package.json

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,12 @@
1515
},
1616
"devDependencies": {
1717
"@eslint/js": "^9.22.0",
18+
"@fontsource/dm-serif-display": "^5.2.5",
19+
"@fontsource/pretendard": "^5.2.5",
1820
"@lucide/svelte": "^0.483.0",
1921
"@neoconfetti/svelte": "^2.2.2",
2022
"@octokit/graphql-schema": "^15.26.0",
23+
"@prgm/sveltekit-progress-bar": "^3.0.2",
2124
"@shikijs/langs": "^3.2.1",
2225
"@shikijs/rehype": "^3.2.1",
2326
"@shikijs/themes": "^3.2.1",
@@ -28,9 +31,10 @@
2831
"@tailwindcss/vite": "^4.0.14",
2932
"@total-typescript/ts-reset": "^0.6.1",
3033
"@types/eslint-config-prettier": "^6.11.3",
34+
"@types/node": "^22.13.13",
3135
"@types/semver": "^7.5.8",
36+
"@upstash/redis": "^1.34.6",
3237
"@vercel/speed-insights": "^1.2.0",
33-
"arctic": "^3.5.0",
3438
"bits-ui": "^1.3.13",
3539
"clsx": "^2.1.1",
3640
"eslint": "^9.22.0",
@@ -39,6 +43,7 @@
3943
"globals": "^16.0.0",
4044
"mode-watcher": "^0.5.1",
4145
"octokit": "^4.1.2",
46+
"posthog-js": "^1.235.4",
4247
"prettier": "^3.5.3",
4348
"prettier-plugin-svelte": "^3.3.3",
4449
"prettier-plugin-tailwindcss": "^0.6.11",
@@ -49,9 +54,7 @@
4954
"svelte-check": "^4.1.5",
5055
"svelte-exmarkdown": "^4.0.3",
5156
"svelte-meta-tags": "^4.2.0",
52-
"svelte-persisted-store": "^0.12.0",
5357
"svelte-sonner": "^0.3.28",
54-
"sveltekit-search-params": "^3.0.0",
5558
"tailwind-merge": "^3.0.2",
5659
"tailwind-variants": "^1.0.0",
5760
"tailwindcss": "^4.0.14",
@@ -65,6 +68,7 @@
6568
"pnpm": {
6669
"onlyBuiltDependencies": [
6770
"@vercel/speed-insights",
71+
"core-js",
6872
"esbuild"
6973
]
7074
},

0 commit comments

Comments
 (0)