feat: enhance README and website configuration with new MinIO setup and error handling for GitHub stars fetch
This commit is contained in:
@@ -6,6 +6,7 @@
|
||||
"dev": "vite dev --port 5174",
|
||||
"build": "vite build",
|
||||
"preview": "vite preview",
|
||||
"start": "node build",
|
||||
"check": "svelte-kit sync && svelte-check --tsconfig ./jsconfig.json",
|
||||
"check:watch": "svelte-kit sync && svelte-check --tsconfig ./jsconfig.json --watch",
|
||||
"format": "prettier --write .",
|
||||
@@ -13,7 +14,7 @@
|
||||
},
|
||||
"devDependencies": {
|
||||
"@cio/tsconfig": "workspace:*",
|
||||
"@sveltejs/adapter-auto": "^3.0.0",
|
||||
"@sveltejs/adapter-node": "^2.0.0",
|
||||
"@sveltejs/adapter-vercel": "^4.0.0",
|
||||
"@sveltejs/kit": "^2.5.27",
|
||||
"@sveltejs/vite-plugin-svelte": "^4.0.0",
|
||||
|
||||
@@ -1,6 +1,8 @@
|
||||
import { redirect } from '@sveltejs/kit';
|
||||
import { client } from '$lib/utils/posthog';
|
||||
|
||||
export const prerender = false;
|
||||
|
||||
export const load = ({ request }) => {
|
||||
client.capture({
|
||||
distinctId: request.headers.get('x-forwarded-for') || new Date().getTime().toString(),
|
||||
|
||||
@@ -1,5 +1,7 @@
|
||||
import { redirect } from '@sveltejs/kit';
|
||||
|
||||
export const prerender = false;
|
||||
|
||||
export const load = async () => {
|
||||
redirect(307, 'https://docs.google.com/presentation/d/1eqvNPNk167ZcP21gZGVAatdDpWAFL9lfmWJHHrzsVFc');
|
||||
};
|
||||
|
||||
@@ -1,6 +1,8 @@
|
||||
import { redirect } from '@sveltejs/kit';
|
||||
import { client } from '$lib/utils/posthog';
|
||||
|
||||
export const prerender = false;
|
||||
|
||||
export const load = ({ request }) => {
|
||||
client.capture({
|
||||
distinctId: request.headers.get('x-forwarded-for') || new Date().getTime().toString(),
|
||||
|
||||
@@ -1,6 +1,8 @@
|
||||
import { redirect } from '@sveltejs/kit';
|
||||
import { client } from '$lib/utils/posthog';
|
||||
|
||||
export const prerender = false;
|
||||
|
||||
export const load = async ({ request }) => {
|
||||
client.capture({
|
||||
distinctId: request.headers.get('x-forwarded-for') || new Date().getTime().toString(),
|
||||
|
||||
@@ -1,5 +1,7 @@
|
||||
import { redirect } from '@sveltejs/kit';
|
||||
|
||||
export const prerender = false;
|
||||
|
||||
export const load = async () => {
|
||||
redirect(307, 'https://t.me/thebestafricans');
|
||||
};
|
||||
|
||||
@@ -1,6 +1,8 @@
|
||||
import { dev } from '$app/environment';
|
||||
import { redirect } from '@sveltejs/kit';
|
||||
|
||||
export const prerender = false;
|
||||
|
||||
export const load = async () => {
|
||||
const url = dev ? 'http://localhost:5173' : 'https://app.classroomio.com';
|
||||
|
||||
|
||||
@@ -1,5 +1,7 @@
|
||||
import { redirect } from '@sveltejs/kit';
|
||||
|
||||
export const prerender = false;
|
||||
|
||||
export const load = async () => {
|
||||
redirect(307, 'https://www.producthunt.com/posts/classroomio-2');
|
||||
};
|
||||
|
||||
@@ -1,6 +1,8 @@
|
||||
import { redirect } from '@sveltejs/kit';
|
||||
import { client } from '$lib/utils/posthog';
|
||||
|
||||
export const prerender = false;
|
||||
|
||||
export const load = async ({ request }) => {
|
||||
client.capture({
|
||||
distinctId: request.headers.get('x-forwarded-for') || new Date().getTime().toString(),
|
||||
|
||||
@@ -1,6 +1,8 @@
|
||||
import { client } from '$lib/utils/posthog';
|
||||
import { redirect } from '@sveltejs/kit';
|
||||
|
||||
export const prerender = false;
|
||||
|
||||
export const load = ({ request, url }) => {
|
||||
client.capture({
|
||||
distinctId: request.headers.get('x-forwarded-for') || new Date().getTime().toString(),
|
||||
|
||||
@@ -1,6 +1,8 @@
|
||||
import { redirect } from '@sveltejs/kit';
|
||||
import { client } from '$lib/utils/posthog';
|
||||
|
||||
export const prerender = false;
|
||||
|
||||
export const load = async ({ request }) => {
|
||||
client.capture({
|
||||
distinctId: request.headers.get('x-forwarded-for') || new Date().getTime().toString(),
|
||||
|
||||
@@ -1,5 +1,7 @@
|
||||
import { redirect } from '@sveltejs/kit';
|
||||
|
||||
export const prerender = false;
|
||||
|
||||
export const load = async () => {
|
||||
redirect(307, 'https://form.classroomio.com/f/1v25DtmN');
|
||||
};
|
||||
|
||||
@@ -27,9 +27,15 @@ async function getStars() {
|
||||
|
||||
console.log('Fetching stars from GitHub');
|
||||
|
||||
const response = await fetch('https://api.github.com/repos/classroomio/classroomio');
|
||||
const data = await response.json();
|
||||
const stars = data?.stargazers_count || 0;
|
||||
let stars = 0;
|
||||
|
||||
try {
|
||||
const response = await fetch('https://api.github.com/repos/classroomio/classroomio');
|
||||
const data = await response.json();
|
||||
stars = data?.stargazers_count || 0;
|
||||
} catch (error) {
|
||||
console.log('error fetching stars', error);
|
||||
}
|
||||
|
||||
starsCache.set(CACHE_KEY, { stars, lastUpdated: now });
|
||||
|
||||
|
||||
@@ -1,5 +1,7 @@
|
||||
import { redirect } from '@sveltejs/kit';
|
||||
|
||||
export const prerender = false;
|
||||
|
||||
export const load = ({ request }) => {
|
||||
redirect(307, 'https://heyform.net/f/1qkguGkN');
|
||||
};
|
||||
|
||||
@@ -1,16 +1,17 @@
|
||||
import adapterNode from '@sveltejs/adapter-auto';
|
||||
import adapterVercel from '@sveltejs/adapter-vercel';
|
||||
import { vitePreprocess } from '@sveltejs/vite-plugin-svelte';
|
||||
import { fileURLToPath } from 'node:url';
|
||||
import { dirname } from 'node:path';
|
||||
import { mdsvex, escapeSvelte } from 'mdsvex';
|
||||
import path from 'path';
|
||||
import shiki from 'shiki';
|
||||
import remarkUnwrapImages from 'remark-unwrap-images';
|
||||
import remarkToc from 'remark-toc';
|
||||
import rehypeSlug from 'rehype-slug';
|
||||
import { escapeSvelte, mdsvex } from 'mdsvex';
|
||||
|
||||
const useNodeAdapter = process.env.PUBLIC_IS_SELFHOSTED === 'true';
|
||||
import adapterNode from '@sveltejs/adapter-node';
|
||||
import adapterVercel from '@sveltejs/adapter-vercel';
|
||||
import { dirname } from 'node:path';
|
||||
import { fileURLToPath } from 'node:url';
|
||||
import path from 'path';
|
||||
import rehypeSlug from 'rehype-slug';
|
||||
import remarkToc from 'remark-toc';
|
||||
import remarkUnwrapImages from 'remark-unwrap-images';
|
||||
import shiki from 'shiki';
|
||||
import { vitePreprocess } from '@sveltejs/vite-plugin-svelte';
|
||||
|
||||
const useNodeAdapter = process.env.VERCEL !== '1' && process.env.VERCEL !== 'true';
|
||||
|
||||
/** @type {import('@sveltejs/kit').Config}*/
|
||||
|
||||
|
||||
Reference in New Issue
Block a user