diff --git a/website/bun.lockb b/website/bun.lockb index 8376cc3..e99d10a 100755 Binary files a/website/bun.lockb and b/website/bun.lockb differ diff --git a/website/eslint.config.js b/website/eslint.config.js index 62dbd03..b36887c 100644 --- a/website/eslint.config.js +++ b/website/eslint.config.js @@ -1,33 +1,33 @@ -import js from '@eslint/js'; -import ts from 'typescript-eslint'; -import svelte from 'eslint-plugin-svelte'; -import prettier from 'eslint-config-prettier'; -import globals from 'globals'; +import js from "@eslint/js" +import ts from "typescript-eslint" +import svelte from "eslint-plugin-svelte" +import prettier from "eslint-config-prettier" +import globals from "globals" /** @type {import('eslint').Linter.Config[]} */ export default [ js.configs.recommended, ...ts.configs.recommended, - ...svelte.configs['flat/recommended'], + ...svelte.configs["flat/recommended"], prettier, - ...svelte.configs['flat/prettier'], + ...svelte.configs["flat/prettier"], { languageOptions: { globals: { ...globals.browser, - ...globals.node - } - } + ...globals.node, + }, + }, }, { - files: ['**/*.svelte'], + files: ["**/*.svelte"], languageOptions: { parserOptions: { - parser: ts.parser - } - } + parser: ts.parser, + }, + }, }, { - ignores: ['build/', '.svelte-kit/', 'dist/'] - } -]; + ignores: ["build/", ".svelte-kit/", "dist/"], + }, +] diff --git a/website/package.json b/website/package.json index 1591f04..8f26b4b 100644 --- a/website/package.json +++ b/website/package.json @@ -33,5 +33,9 @@ "typescript-eslint": "^8.0.0", "vite": "^5.0.3" }, - "type": "module" + "type": "module", + "dependencies": { + "@fontsource-variable/nunito-sans": "^5.0.14", + "date-fns": "^3.6.0" + } } diff --git a/website/postcss.config.js b/website/postcss.config.js index 0f77216..1a52624 100644 --- a/website/postcss.config.js +++ b/website/postcss.config.js @@ -1,6 +1,6 @@ export default { plugins: { tailwindcss: {}, - autoprefixer: {} - } -}; + autoprefixer: {}, + }, +} diff --git a/website/src/app.css b/website/src/app.css index a31e444..2bf5b4f 100644 --- a/website/src/app.css +++ b/website/src/app.css @@ -1,3 +1,45 @@ -@import 'tailwindcss/base'; -@import 'tailwindcss/components'; -@import 'tailwindcss/utilities'; +@import "tailwindcss/base"; +@import "tailwindcss/components"; +@import "tailwindcss/utilities"; + +:root { +} + +@media (prefers-color-scheme: dark) { + :root { + --color-background: 10 7 4; + --color-card: 28 22 17; + --color-card-hover: 40 32 25; + + --color-body: 198 167 140; + --color-heading: 227 213 200; + --color-light: 255 255 255; + + --color-input-bg: 22 15 8; + --color-input-border: 82 60 41; + --color-placeholder: 169 147 128; + + --color-primary: 241 157 30; + --color-primary-hover: 255 172 42; + --color-primary-fg: var(--color-background); + } +} + +html { + scroll-padding-top: theme(spacing.16); +} + +body { + background-color: theme(colors.background); + color: theme(colors.body); +} + +@keyframes cursor-blink { + 0%, + 100% { + opacity: 1; + } + 50% { + opacity: 0; + } +} diff --git a/website/src/app.d.ts b/website/src/app.d.ts index 743f07b..f70d0e1 100644 --- a/website/src/app.d.ts +++ b/website/src/app.d.ts @@ -10,4 +10,4 @@ declare global { } } -export {}; +export {} diff --git a/website/src/lib/registry-api.ts b/website/src/lib/registry-api.ts new file mode 100644 index 0000000..aa5a7d1 --- /dev/null +++ b/website/src/lib/registry-api.ts @@ -0,0 +1,31 @@ +import { PUBLIC_REGISTRY_URL } from "$env/static/public" + +export type PackageResponse = { + name: string + version: string + target: TargetInfo + description: string + published_at: string + license: string +} + +export type TargetInfo = { + kind: TargetKind + lib: boolean + bin: boolean +} + +export type TargetKind = "roblox" | "lune" | "luau" + +export async function fetchRegistry( + path: string, + fetcher: typeof fetch, + options?: RequestInit, +): Promise { + const response = await fetcher(new URL(path, PUBLIC_REGISTRY_URL), options) + if (!response.ok) { + throw new Error(`Failed to fetch from registry: ${response.status} ${response.statusText}`) + } + + return response.json() +} diff --git a/website/src/routes/+layout.server.ts b/website/src/routes/+layout.server.ts new file mode 100644 index 0000000..19f1a3a --- /dev/null +++ b/website/src/routes/+layout.server.ts @@ -0,0 +1,9 @@ +import { ISR_BYPASS_TOKEN } from "$env/static/private" +import type { Config } from "@sveltejs/adapter-vercel" + +export const config: Config = { + isr: { + expiration: 30 * 60, + bypassToken: ISR_BYPASS_TOKEN, + }, +} diff --git a/website/src/routes/+layout.svelte b/website/src/routes/+layout.svelte index e551b53..ed8e2ef 100644 --- a/website/src/routes/+layout.svelte +++ b/website/src/routes/+layout.svelte @@ -1,4 +1,5 @@ diff --git a/website/src/routes/+page.server.ts b/website/src/routes/+page.server.ts new file mode 100644 index 0000000..df30f7d --- /dev/null +++ b/website/src/routes/+page.server.ts @@ -0,0 +1,8 @@ +import { fetchRegistry, type PackageResponse } from "$lib/registry-api" +import type { PageServerLoad } from "./$types" + +export const load: PageServerLoad = async ({ fetch }) => { + const packages = await fetchRegistry("search", fetch) + + return { packages } +} diff --git a/website/src/routes/+page.svelte b/website/src/routes/+page.svelte index 5982b0a..7553156 100644 --- a/website/src/routes/+page.svelte +++ b/website/src/routes/+page.svelte @@ -1,2 +1,40 @@ -

Welcome to SvelteKit

-

Visit kit.svelte.dev to read the documentation

+ + + + +
+

+ Recently Published +

+ +
+ {#each data.packages as pkg} + {@const [scope, name] = pkg.name.split("/")} + {@const targetName = pkg.target.kind[0].toUpperCase() + pkg.target.kind.slice(1)} + +
+

+ + {scope}/{name} + +

+
v{pkg.version} ยท {targetName}
+

{pkg.description}

+
+ +
+
+ {/each} +
+
diff --git a/website/src/routes/Hero.svelte b/website/src/routes/Hero.svelte new file mode 100644 index 0000000..b2acc55 --- /dev/null +++ b/website/src/routes/Hero.svelte @@ -0,0 +1,90 @@ + + +
+

+ Manage your packages
+ for Luau + +

+ +

+ A package manager for the Luau programming language, supporting multiple runtimes including + Roblox and Lune. +

+ + + Get Started + +
diff --git a/website/svelte.config.js b/website/svelte.config.js index 3850651..1509ec2 100644 --- a/website/svelte.config.js +++ b/website/svelte.config.js @@ -1,16 +1,16 @@ -import { mdsvex } from 'mdsvex'; -import { vitePreprocess } from '@sveltejs/vite-plugin-svelte'; -import adapter from '@sveltejs/adapter-vercel'; +import { mdsvex } from "mdsvex" +import { vitePreprocess } from "@sveltejs/vite-plugin-svelte" +import adapter from "@sveltejs/adapter-vercel" /** @type {import('@sveltejs/kit').Config} */ const config = { preprocess: [vitePreprocess(), mdsvex()], kit: { - adapter: adapter({}) + adapter: adapter({}), }, - extensions: ['.svelte', '.svx'] -}; + extensions: [".svelte", ".svx"], +} -export default config; +export default config diff --git a/website/tailwind.config.ts b/website/tailwind.config.ts index d4e76e3..3102833 100644 --- a/website/tailwind.config.ts +++ b/website/tailwind.config.ts @@ -1,12 +1,48 @@ -import type { Config } from 'tailwindcss'; +import type { Config } from "tailwindcss" +import defaultTheme from "tailwindcss/defaultTheme" export default { - content: ['./src/**/*.{html,js,svelte,ts}'], + content: ["./src/**/*.{html,js,svelte,ts}"], theme: { - extend: {} + extend: { + fontFamily: { + sans: ["Nunito Sans Variable", ...defaultTheme.fontFamily.sans], + }, + colors: { + background: "rgb(var(--color-background) / )", + card: { + DEFAULT: "rgb(var(--color-card) / )", + hover: "rgb(var(--color-card-hover) / )", + }, + + body: "rgb(var(--color-body) / )", + heading: "rgb(var(--color-heading) / )", + light: "rgb(var(--color-light) / )", + + input: { + bg: "rgb(var(--color-input-bg) / )", + border: "rgb(var(--color-input-border) / )", + }, + placeholder: "rgb(var(--color-placeholder) / )", + + primary: { + DEFAULT: "rgb(var(--color-primary) / )", + hover: "rgb(var(--color-primary-hover) / )", + fg: "rgb(var(--color-primary-fg) / )", + }, + }, + animation: { + "cursor-blink": "cursor-blink 1s ease-in-out 500ms infinite", + }, + borderRadius: { + none: "0", + sm: `${4 / 16}rem`, + DEFAULT: `${8 / 16}rem`, + }, + }, }, // eslint-disable-next-line @typescript-eslint/no-require-imports - plugins: [require('@tailwindcss/typography')] -} as Config; + plugins: [require("@tailwindcss/typography")], +} as Config diff --git a/website/vite.config.ts b/website/vite.config.ts index bbf8c7d..c3c83b8 100644 --- a/website/vite.config.ts +++ b/website/vite.config.ts @@ -1,6 +1,6 @@ -import { sveltekit } from '@sveltejs/kit/vite'; -import { defineConfig } from 'vite'; +import { sveltekit } from "@sveltejs/kit/vite" +import { defineConfig } from "vite" export default defineConfig({ - plugins: [sveltekit()] -}); + plugins: [sveltekit()], +})