diff --git a/.gitignore b/.gitignore index d3387e00..81a1a954 100644 --- a/.gitignore +++ b/.gitignore @@ -8,11 +8,21 @@ yarn.lock .vercel .output .vinxi +.tanstack-start/build +.nitro/* +.netlify/* /build/ /api/ /server/build /public/build -.vinxi + # Sentry Config File .env.sentry-build-plugin +dist +.vscode/ +.env.local + +# Content Collections generated files +.content-collections + diff --git a/.prettierignore b/.prettierignore index fd1b50a5..b40caf3a 100644 --- a/.prettierignore +++ b/.prettierignore @@ -2,4 +2,6 @@ **/build **/public pnpm-lock.yaml -routeTree.gen.ts \ No newline at end of file +routeTree.gen.ts +convex/_generated +convex/README.md \ No newline at end of file diff --git a/.tanstack-start/server-routes/routeTree.gen.ts b/.tanstack-start/server-routes/routeTree.gen.ts new file mode 100644 index 00000000..b24ca836 --- /dev/null +++ b/.tanstack-start/server-routes/routeTree.gen.ts @@ -0,0 +1,153 @@ +/* eslint-disable */ + +// @ts-nocheck + +// noinspection JSUnusedGlobalSymbols + +// This file was automatically generated by TanStack Router. +// You should NOT make any changes in this file as it will be overwritten. +// Additionally, you should also exclude this file from your linter and/or formatter to prevent it from being checked or modified. + +// Import Routes + +import type { + FileRoutesByPath, + CreateServerFileRoute, +} from '@tanstack/react-start/server' +import { + createServerRoute, + createServerFileRoute, +} from '@tanstack/react-start/server' + +import { ServerRoute as LibraryIdVersionDocsChar123Char125DotmdRouteImport } from './../../src/routes/$libraryId/$version.docs.{$}[.]md' +import { ServerRoute as LibraryIdVersionDocsFrameworkFrameworkChar123Char125DotmdRouteImport } from './../../src/routes/$libraryId/$version.docs.framework.$framework.{$}[.]md' + +// Create/Update Routes + +const rootRoute = createServerRoute() + +const LibraryIdVersionDocsChar123Char125DotmdRoute = + LibraryIdVersionDocsChar123Char125DotmdRouteImport.update({ + id: '/$libraryId/$version/docs/{$}.md', + path: '/$libraryId/$version/docs/{$}.md', + getParentRoute: () => rootRoute, + } as any) + +const LibraryIdVersionDocsFrameworkFrameworkChar123Char125DotmdRoute = + LibraryIdVersionDocsFrameworkFrameworkChar123Char125DotmdRouteImport.update({ + id: '/$libraryId/$version/docs/framework/$framework/{$}.md', + path: '/$libraryId/$version/docs/framework/$framework/{$}.md', + getParentRoute: () => rootRoute, + } as any) + +// Populate the FileRoutesByPath interface + +declare module '@tanstack/react-start/server' { + interface FileRoutesByPath { + '/$libraryId/$version/docs/{$}.md': { + id: '/$libraryId/$version/docs/{$}.md' + path: '/$libraryId/$version/docs/{$}.md' + fullPath: '/$libraryId/$version/docs/{$}.md' + preLoaderRoute: typeof LibraryIdVersionDocsChar123Char125DotmdRouteImport + parentRoute: typeof rootRoute + } + '/$libraryId/$version/docs/framework/$framework/{$}.md': { + id: '/$libraryId/$version/docs/framework/$framework/{$}.md' + path: '/$libraryId/$version/docs/framework/$framework/{$}.md' + fullPath: '/$libraryId/$version/docs/framework/$framework/{$}.md' + preLoaderRoute: typeof LibraryIdVersionDocsFrameworkFrameworkChar123Char125DotmdRouteImport + parentRoute: typeof rootRoute + } + } +} + +// Add type-safety to the createFileRoute function across the route tree + +declare module './../../src/routes/$libraryId/$version.docs.{$}[.]md' { + const createServerFileRoute: CreateServerFileRoute< + FileRoutesByPath['/$libraryId/$version/docs/{$}.md']['parentRoute'], + FileRoutesByPath['/$libraryId/$version/docs/{$}.md']['id'], + FileRoutesByPath['/$libraryId/$version/docs/{$}.md']['path'], + FileRoutesByPath['/$libraryId/$version/docs/{$}.md']['fullPath'], + unknown + > +} +declare module './../../src/routes/$libraryId/$version.docs.framework.$framework.{$}[.]md' { + const createServerFileRoute: CreateServerFileRoute< + FileRoutesByPath['/$libraryId/$version/docs/framework/$framework/{$}.md']['parentRoute'], + FileRoutesByPath['/$libraryId/$version/docs/framework/$framework/{$}.md']['id'], + FileRoutesByPath['/$libraryId/$version/docs/framework/$framework/{$}.md']['path'], + FileRoutesByPath['/$libraryId/$version/docs/framework/$framework/{$}.md']['fullPath'], + unknown + > +} + +// Create and export the route tree + +export interface FileRoutesByFullPath { + '/$libraryId/$version/docs/{$}.md': typeof LibraryIdVersionDocsChar123Char125DotmdRoute + '/$libraryId/$version/docs/framework/$framework/{$}.md': typeof LibraryIdVersionDocsFrameworkFrameworkChar123Char125DotmdRoute +} + +export interface FileRoutesByTo { + '/$libraryId/$version/docs/{$}.md': typeof LibraryIdVersionDocsChar123Char125DotmdRoute + '/$libraryId/$version/docs/framework/$framework/{$}.md': typeof LibraryIdVersionDocsFrameworkFrameworkChar123Char125DotmdRoute +} + +export interface FileRoutesById { + __root__: typeof rootRoute + '/$libraryId/$version/docs/{$}.md': typeof LibraryIdVersionDocsChar123Char125DotmdRoute + '/$libraryId/$version/docs/framework/$framework/{$}.md': typeof LibraryIdVersionDocsFrameworkFrameworkChar123Char125DotmdRoute +} + +export interface FileRouteTypes { + fileRoutesByFullPath: FileRoutesByFullPath + fullPaths: + | '/$libraryId/$version/docs/{$}.md' + | '/$libraryId/$version/docs/framework/$framework/{$}.md' + fileRoutesByTo: FileRoutesByTo + to: + | '/$libraryId/$version/docs/{$}.md' + | '/$libraryId/$version/docs/framework/$framework/{$}.md' + id: + | '__root__' + | '/$libraryId/$version/docs/{$}.md' + | '/$libraryId/$version/docs/framework/$framework/{$}.md' + fileRoutesById: FileRoutesById +} + +export interface RootRouteChildren { + LibraryIdVersionDocsChar123Char125DotmdRoute: typeof LibraryIdVersionDocsChar123Char125DotmdRoute + LibraryIdVersionDocsFrameworkFrameworkChar123Char125DotmdRoute: typeof LibraryIdVersionDocsFrameworkFrameworkChar123Char125DotmdRoute +} + +const rootRouteChildren: RootRouteChildren = { + LibraryIdVersionDocsChar123Char125DotmdRoute: + LibraryIdVersionDocsChar123Char125DotmdRoute, + LibraryIdVersionDocsFrameworkFrameworkChar123Char125DotmdRoute: + LibraryIdVersionDocsFrameworkFrameworkChar123Char125DotmdRoute, +} + +export const routeTree = rootRoute + ._addFileChildren(rootRouteChildren) + ._addFileTypes() + +/* ROUTE_MANIFEST_START +{ + "routes": { + "__root__": { + "filePath": "__root.tsx", + "children": [ + "/$libraryId/$version/docs/{$}.md", + "/$libraryId/$version/docs/framework/$framework/{$}.md" + ] + }, + "/$libraryId/$version/docs/{$}.md": { + "filePath": "$libraryId/$version.docs.{$}[.]md.tsx" + }, + "/$libraryId/$version/docs/framework/$framework/{$}.md": { + "filePath": "$libraryId/$version.docs.framework.$framework.{$}[.]md.tsx" + } + } +} +ROUTE_MANIFEST_END */ diff --git a/README.md b/README.md index eb580a5b..90cba4aa 100644 --- a/README.md +++ b/README.md @@ -4,9 +4,9 @@ This site is built with TanStack Router! - [TanStack Router Docs](https://tanstack.com/router) -It's deployed automagically with Vercel! +It's deployed automagically with Netlify! -- [Vercel](https://vercel.com/) +- [Netlify](https://netlify.com/) ## Development diff --git a/app.config.ts b/app.config.ts deleted file mode 100644 index 4ae3ac67..00000000 --- a/app.config.ts +++ /dev/null @@ -1,22 +0,0 @@ -import { sentryVitePlugin } from '@sentry/vite-plugin' -import { defineConfig } from '@tanstack/start/config' -import tsConfigPaths from 'vite-tsconfig-paths' - -export default defineConfig({ - vite: { - plugins: () => [tsConfigPaths()], - }, - routers: { - client: { - vite: { - plugins: () => [ - sentryVitePlugin({ - authToken: process.env.SENTRY_AUTH_TOKEN, - org: 'tanstack', - project: 'tanstack-com', - }), - ], - }, - }, - }, -}) diff --git a/app/client.tsx b/app/client.tsx deleted file mode 100644 index 9b47768b..00000000 --- a/app/client.tsx +++ /dev/null @@ -1,8 +0,0 @@ -import { hydrateRoot } from 'react-dom/client' -import { StartClient } from '@tanstack/start' -import { createRouter } from './router' -import './utils/sentry' - -const router = createRouter() - -hydrateRoot(document.getElementById('root')!, ) diff --git a/app/components/ClientOnlySearchButton.tsx b/app/components/ClientOnlySearchButton.tsx deleted file mode 100644 index 0037a836..00000000 --- a/app/components/ClientOnlySearchButton.tsx +++ /dev/null @@ -1,30 +0,0 @@ -import * as React from 'react' -import { Suspense } from 'react' -import { ImSpinner2 } from 'react-icons/im' - -const LazySearchButton = React.lazy(() => - import('@orama/searchbox').then((mod) => ({ default: mod.SearchButton })) -) - -let defaultMounted = false - -export function ClientOnlySearchButton(props: any) { - const [mounted, setMounted] = React.useState(defaultMounted) - - React.useEffect(() => { - defaultMounted = true - setMounted(defaultMounted) - }, []) - - return ( - - {mounted ? ( - - ) : ( -
- -
- )} -
- ) -} diff --git a/app/components/Doc.tsx b/app/components/Doc.tsx deleted file mode 100644 index 138a10e2..00000000 --- a/app/components/Doc.tsx +++ /dev/null @@ -1,40 +0,0 @@ -import { FaEdit } from 'react-icons/fa' -import { DocTitle } from '~/components/DocTitle' -import { Markdown } from '~/components/Markdown' - -export function Doc({ - title, - content, - repo, - branch, - filePath, -}: { - title: string - content: string - repo: string - branch: string - filePath: string -}) { - return ( -
- {title ? {title} : null} -
-
-
-
- -
-
-
- -
-
- ) -} diff --git a/app/components/DocsCalloutQueryGG.tsx b/app/components/DocsCalloutQueryGG.tsx deleted file mode 100644 index b9d1b58f..00000000 --- a/app/components/DocsCalloutQueryGG.tsx +++ /dev/null @@ -1,28 +0,0 @@ -import { LogoQueryGGSmall } from '~/components/LogoQueryGGSmall' - -export function DocsCalloutQueryGG(props: React.HTMLProps) { - return ( -
-
-
- Want to Skip the Docs? -
- - -
- “This course is the best way to learn how to use React Query in - real-world applications.” - —Tanner Linsley -
- - Get the course - -
-
- ) -} diff --git a/app/components/MarkdownLink.tsx b/app/components/MarkdownLink.tsx deleted file mode 100644 index 23d4acbd..00000000 --- a/app/components/MarkdownLink.tsx +++ /dev/null @@ -1,18 +0,0 @@ -import { Link } from '@tanstack/react-router' -import type { HTMLProps } from 'react' - -export function MarkdownLink(props: HTMLProps) { - if ((props as { href: string }).href?.startsWith('http')) { - return - } - - return ( - - ) -} diff --git a/app/components/Orama.tsx b/app/components/Orama.tsx deleted file mode 100644 index f8d69af0..00000000 --- a/app/components/Orama.tsx +++ /dev/null @@ -1,38 +0,0 @@ -import type { - RegisterSearchButtonProps, - RegisterSearchBoxProps, -} from '@orama/searchbox' -import { OramaClient } from '@oramacloud/client' -import '@orama/searchbox/dist/index.css' - -const oramaInstance = new OramaClient({ - // The search endpoint for the Orama index - endpoint: 'https://cloud.orama.run/v1/indexes/tanstack-dev-ur0ppd', - // The public API key for performing search. This is commit-safe. - api_key: 'xqfn8QcuImADRGPIlhWTo9cT5UNiqPDj', -}) - -export const searchBoxParams: RegisterSearchBoxProps = { - oramaInstance, - colorScheme: 'system', - backdrop: true, - facetProperty: 'category', - resultsMap: { - description: 'content', - }, - themeConfig: { - light: {}, - dark: { - '--backdrop-bg-color': '#0d103591', - }, - }, - searchMode: 'hybrid', - searchParams: { - threshold: 0, - }, -} - -export const searchButtonParams: RegisterSearchButtonProps = { - colorScheme: 'system', - fullWidth: true, -} diff --git a/app/components/QueryGGBanner.tsx b/app/components/QueryGGBanner.tsx deleted file mode 100644 index 2c3290af..00000000 --- a/app/components/QueryGGBanner.tsx +++ /dev/null @@ -1,34 +0,0 @@ -import { IoIosClose } from 'react-icons/io' -import { useLocalStorage } from '~/utils/useLocalStorage' -import { useClientOnlyRender } from '~/utils/useClientOnlyRender' - -export function QueryGGBanner() { - const [hidden, setHidden] = useLocalStorage('pppbanner-hidden', false) - - if (!useClientOnlyRender()) { - return null - } - - return ( - <> - {!hidden && ( -
-

- Want to skip the docs? Check out{' '} - - query.gg - {' '} - – the simplest way to master React Query. -

- -
- )} - - ) -} diff --git a/app/images/ag-grid.png b/app/images/ag-grid.png deleted file mode 100644 index 93914f0a..00000000 Binary files a/app/images/ag-grid.png and /dev/null differ diff --git a/app/images/angular-logo.svg b/app/images/angular-logo.svg deleted file mode 100644 index 01fcd41a..00000000 --- a/app/images/angular-logo.svg +++ /dev/null @@ -1,27 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - diff --git a/app/images/bytes-uidotdev.png b/app/images/bytes-uidotdev.png deleted file mode 100644 index 4181825a..00000000 Binary files a/app/images/bytes-uidotdev.png and /dev/null differ diff --git a/app/images/bytes.svg b/app/images/bytes.svg deleted file mode 100644 index f0d35869..00000000 --- a/app/images/bytes.svg +++ /dev/null @@ -1,15 +0,0 @@ - - - - - - - - - - - - - - - diff --git a/app/images/discord-logo-white.svg b/app/images/discord-logo-white.svg deleted file mode 100644 index 13dd3805..00000000 --- a/app/images/discord-logo-white.svg +++ /dev/null @@ -1,9 +0,0 @@ - - - - Codestin Search App - Created with Sketch. - - - - \ No newline at end of file diff --git a/app/images/header-left-overlay.svg b/app/images/header-left-overlay.svg deleted file mode 100644 index 6a89649f..00000000 --- a/app/images/header-left-overlay.svg +++ /dev/null @@ -1,32 +0,0 @@ - - - - Codestin Search App - Created with Sketch. - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/app/images/javascript-logo-white.svg b/app/images/javascript-logo-white.svg deleted file mode 100644 index 196c77bb..00000000 --- a/app/images/javascript-logo-white.svg +++ /dev/null @@ -1,11 +0,0 @@ - - - - Codestin Search App - Created with Sketch. - - - - - - \ No newline at end of file diff --git a/app/images/js-logo.svg b/app/images/js-logo.svg deleted file mode 100644 index 9650ca78..00000000 --- a/app/images/js-logo.svg +++ /dev/null @@ -1,4 +0,0 @@ - - - - \ No newline at end of file diff --git a/app/images/lit-logo.svg b/app/images/lit-logo.svg deleted file mode 100644 index e737a43c..00000000 --- a/app/images/lit-logo.svg +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - - - - - - - - diff --git a/app/images/logo-600w.png b/app/images/logo-600w.png deleted file mode 100644 index ec5d6214..00000000 Binary files a/app/images/logo-600w.png and /dev/null differ diff --git a/app/images/logo-color-100w.png b/app/images/logo-color-100w.png deleted file mode 100644 index 35c7301a..00000000 Binary files a/app/images/logo-color-100w.png and /dev/null differ diff --git a/app/images/logo-color-600w.png b/app/images/logo-color-600w.png deleted file mode 100644 index ec5d6214..00000000 Binary files a/app/images/logo-color-600w.png and /dev/null differ diff --git a/app/images/logo-white.svg b/app/images/logo-white.svg deleted file mode 100644 index 009b679a..00000000 --- a/app/images/logo-white.svg +++ /dev/null @@ -1,11 +0,0 @@ - - - - Codestin Search App - Created with Sketch. - - - - - - \ No newline at end of file diff --git a/app/images/nozzle.png b/app/images/nozzle.png deleted file mode 100644 index 52eafa2b..00000000 Binary files a/app/images/nozzle.png and /dev/null differ diff --git a/app/images/og.png b/app/images/og.png deleted file mode 100644 index 5da7e7f8..00000000 Binary files a/app/images/og.png and /dev/null differ diff --git a/app/images/people/corbincrutchley.jpeg b/app/images/people/corbincrutchley.jpeg deleted file mode 100644 index 9ea05a0f..00000000 Binary files a/app/images/people/corbincrutchley.jpeg and /dev/null differ diff --git a/app/images/people/dominikdorfmeister.jpg b/app/images/people/dominikdorfmeister.jpg deleted file mode 100644 index 0ec1a14a..00000000 Binary files a/app/images/people/dominikdorfmeister.jpg and /dev/null differ diff --git a/app/images/people/kevinvancott.jpeg b/app/images/people/kevinvancott.jpeg deleted file mode 100644 index eeae2942..00000000 Binary files a/app/images/people/kevinvancott.jpeg and /dev/null differ diff --git a/app/images/people/tannerlinsley.jpeg b/app/images/people/tannerlinsley.jpeg deleted file mode 100644 index d27bf892..00000000 Binary files a/app/images/people/tannerlinsley.jpeg and /dev/null differ diff --git a/app/images/qwik-logo.svg b/app/images/qwik-logo.svg deleted file mode 100644 index bc6ec5bd..00000000 --- a/app/images/qwik-logo.svg +++ /dev/null @@ -1,5 +0,0 @@ - - - - - diff --git a/app/images/react-logo-white.svg b/app/images/react-logo-white.svg deleted file mode 100644 index 0168678d..00000000 --- a/app/images/react-logo-white.svg +++ /dev/null @@ -1,11 +0,0 @@ - - - - Codestin Search App - Created with Sketch. - - - - - - \ No newline at end of file diff --git a/app/images/react-logo.svg b/app/images/react-logo.svg deleted file mode 100644 index a0d5b3de..00000000 --- a/app/images/react-logo.svg +++ /dev/null @@ -1,11 +0,0 @@ - - Codestin Search App - - - - - - - diff --git a/app/images/solid-logo.svg b/app/images/solid-logo.svg deleted file mode 100644 index 1c988d43..00000000 --- a/app/images/solid-logo.svg +++ /dev/null @@ -1,28 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/app/images/svelte-logo.svg b/app/images/svelte-logo.svg deleted file mode 100644 index 1779853a..00000000 --- a/app/images/svelte-logo.svg +++ /dev/null @@ -1,4 +0,0 @@ - - - - diff --git a/app/libraries/config.ts b/app/libraries/config.ts deleted file mode 100644 index 3ab6694e..00000000 --- a/app/libraries/config.ts +++ /dev/null @@ -1,22 +0,0 @@ -import { Library } from '.' - -export const configProject: Library = { - id: 'config', - name: 'TanStack Config', - cardStyles: `shadow-xl shadow-slate-700/20 dark:shadow-lg dark:shadow-slate-500/30 text-slate-500 border-2 border-transparent hover:border-current`, - to: '/config', - tagline: `Configuration and tools for publishing and maintaining high-quality JavaScript packages`, - description: `The build and publish utilities used by all of our projects. Use it if you dare!`, - ogImage: 'https://github.com/tanstack/config/raw/main/media/repo-header.png', - // badge: 'new', - bgStyle: 'bg-slate-500', - textStyle: 'text-slate-500', - repo: 'tanstack/config', - latestBranch: 'main', - latestVersion: 'v0', - availableVersions: ['v0'], - colorFrom: 'from-gray-500', - colorTo: 'to-gray-700', - textColor: 'text-gray-700', - frameworks: [], -} diff --git a/app/libraries/form.ts b/app/libraries/form.ts deleted file mode 100644 index 96ce6c19..00000000 --- a/app/libraries/form.ts +++ /dev/null @@ -1,23 +0,0 @@ -import { Library } from '.' - -export const formProject: Library = { - id: 'form', - name: 'TanStack Form', - cardStyles: `shadow-xl shadow-yellow-700/20 dark:shadow-lg dark:shadow-yellow-500/30 text-yellow-500 border-2 border-transparent hover:border-current`, - to: '/form', - tagline: `Headless UI for building performant and type-safe forms`, - description: `Headless, performant, and type-safe form state management for TS/JS, React, Vue, Angular, Solid and Lit`, - ogImage: 'https://github.com/tanstack/form/raw/main/media/repo-header.png', - badge: 'new', - bgStyle: 'bg-yellow-500', - textStyle: 'text-yellow-500', - repo: 'tanstack/form', - latestBranch: 'main', - latestVersion: 'v0', - availableVersions: ['v0'], - colorFrom: 'from-yellow-500', - colorTo: 'to-yellow-600', - textColor: 'text-yellow-600', - frameworks: ['react', 'vue', 'angular', 'solid', 'lit'], - scarfId: '72ec4452-5d77-427c-b44a-57515d2d83aa', -} diff --git a/app/libraries/index.tsx b/app/libraries/index.tsx deleted file mode 100644 index 72684c12..00000000 --- a/app/libraries/index.tsx +++ /dev/null @@ -1,96 +0,0 @@ -import reactLogo from '~/images/react-logo.svg' -import solidLogo from '~/images/solid-logo.svg' -import vueLogo from '~/images/vue-logo.svg' -import angularLogo from '~/images/angular-logo.svg' -import svelteLogo from '~/images/svelte-logo.svg' -import litLogo from '~/images/lit-logo.svg' -import qwikLogo from '~/images/qwik-logo.svg' -import jsLogo from '~/images/js-logo.svg' -import { queryProject } from './query' -import { formProject } from './form' -import { configProject } from './config' -import { routerProject } from './router' -import { startProject } from './start' -import { tableProject } from './table' -import { virtualProject } from './virtual' -import { rangerProject } from './ranger' -import { storeProject } from './store' -import invariant from 'tiny-invariant' -import { notFound } from '@tanstack/react-router' - -export const frameworkOptions = [ - { label: 'React', value: 'react', logo: reactLogo }, - { label: 'Vue', value: 'vue', logo: vueLogo }, - { label: 'Angular', value: 'angular', logo: angularLogo }, - { label: 'Solid', value: 'solid', logo: solidLogo }, - { label: 'Lit', value: 'lit', logo: litLogo }, - { label: 'Svelte', value: 'svelte', logo: svelteLogo }, - { label: 'Qwik', value: 'qwik', logo: qwikLogo }, - { label: 'Vanilla', value: 'vanilla', logo: jsLogo }, -] as const - -export type Framework = (typeof frameworkOptions)[number]['value'] - -export type Library = { - id: string - name: string - cardStyles: string - to: string - tagline: string - description: string - ogImage?: string - bgStyle: string - textStyle: string - badge?: 'new' | 'soon' - repo: string - latestBranch: string - latestVersion: string - availableVersions: string[] - colorFrom: string - colorTo: string - textColor: string - frameworks: Framework[] - scarfId?: string - defaultDocs?: string - handleRedirects?: (href: string) => void - hideCodesandboxUrl?: true - hideStackblitzUrl?: true -} - -export const libraries = [ - startProject, - routerProject, - queryProject, - tableProject, - formProject, - virtualProject, - rangerProject, - storeProject, - configProject, -] - -export function getLibrary(id: string) { - const library = libraries.find((d) => d.id === id) - - if (!library) { - throw notFound() - } - - return library -} - -export function getFrameworkOptions(frameworkStrs: Framework[]) { - return frameworkOptions.filter((d) => frameworkStrs.includes(d.value)) -} - -export function getBranch(library: Library, argVersion?: string) { - const version = argVersion || library.latestVersion - - const resolvedVersion = ['latest', library.latestVersion].includes(version) - ? library.latestBranch - : version - - invariant(resolvedVersion, `Could not resolve version for ${library.name}`) - - return resolvedVersion -} diff --git a/app/libraries/ranger.ts b/app/libraries/ranger.ts deleted file mode 100644 index 56dc14a1..00000000 --- a/app/libraries/ranger.ts +++ /dev/null @@ -1,24 +0,0 @@ -import { Library } from '.' - -export const rangerProject: Library = { - id: 'ranger', - name: 'TanStack Ranger', - cardStyles: `shadow-xl shadow-pink-700/20 dark:shadow-lg dark:shadow-pink-500/30 text-pink-500 border-2 border-transparent hover:border-current`, - to: '/ranger', - tagline: `Headless range and multi-range slider utilities.`, - description: `Headless, lightweight, and extensible primitives for building range and multi-range sliders.`, - ogImage: 'https://github.com/tanstack/ranger/raw/main/media/headerv1.png', - // badge: 'new', - bgStyle: 'bg-pink-500', - textStyle: 'text-pink-500', - repo: 'tanstack/ranger', - latestBranch: 'main', - latestVersion: 'v0', - availableVersions: ['v0'], - colorFrom: 'from-pink-400', - colorTo: 'to-pink-500', - textColor: 'text-pink-500', - frameworks: ['react'], - defaultDocs: 'framework/react/overview', - scarfId: 'dd278e06-bb3f-420c-85c6-6e42d14d8f61', -} diff --git a/app/libraries/router.ts b/app/libraries/router.ts deleted file mode 100644 index 02a4047f..00000000 --- a/app/libraries/router.ts +++ /dev/null @@ -1,25 +0,0 @@ -import { Library } from '.' - -export const routerProject: Library = { - id: 'router', - name: 'TanStack Router', - cardStyles: `shadow-xl shadow-emerald-700/20 dark:shadow-lg dark:shadow-emerald-500/30 text-emerald-500 dark:text-emerald-400 border-2 border-transparent hover:border-current`, - to: '/router', - tagline: `Type-safe Routing for React applications.`, - description: `A powerful React router for client-side and full-stack react applications. Fully type-safe APIs, first-class search-params for managing state in the URL and seamless integration with the existing React ecosystem.`, - ogImage: 'https://github.com/tanstack/router/raw/main/media/header.png', - bgStyle: 'bg-emerald-500', - textStyle: 'text-emerald-500', - badge: 'new', - repo: 'tanstack/router', - latestBranch: 'main', - latestVersion: 'v1', - availableVersions: ['v1'], - colorFrom: 'from-lime-500', - colorTo: 'to-emerald-500', - textColor: 'text-emerald-500', - frameworks: ['react'], - scarfId: '3d14fff2-f326-4929-b5e1-6ecf953d24f4', - defaultDocs: 'framework/react/overview', - hideCodesandboxUrl: true, -} diff --git a/app/libraries/start.ts b/app/libraries/start.ts deleted file mode 100644 index 3dccac79..00000000 --- a/app/libraries/start.ts +++ /dev/null @@ -1,22 +0,0 @@ -import { Library } from '.' - -export const startProject: Library = { - id: 'start', - name: 'TanStack Start', - cardStyles: `shadow-xl shadow-cyan-500/20 dark:shadow-lg dark:shadow-cyan-500/30 text-cyan-500 dark:text-white-400 border-2 border-transparent hover:border-current`, - to: '/start', - tagline: `Full-stack React Framework powered by TanStack Router`, - description: `Full-document SSR, Streaming, Server Functions, bundling and more, powered by TanStack Router, Vinxi, and Nitro and ready to deploy to your favorite hosting provider.`, - bgStyle: 'bg-cyan-500', - textStyle: 'text-cyan-500', - badge: 'soon', - repo: 'tanstack/start', - latestBranch: 'main', - latestVersion: 'v0', - availableVersions: ['v0'], - colorFrom: 'from-cyan-500', - colorTo: 'to-cyan-600', - textColor: 'text-cyan-600', - frameworks: ['react'], - scarfId: 'b6e2134f-e805-401d-95c3-2a7765d49a3d', -} diff --git a/app/libraries/store.ts b/app/libraries/store.ts deleted file mode 100644 index fb11ef7a..00000000 --- a/app/libraries/store.ts +++ /dev/null @@ -1,24 +0,0 @@ -import { Library } from '.' - -export const storeProject: Library = { - id: 'store', - name: 'TanStack Store', - cardStyles: `shadow-xl shadow-stone-700/20 dark:shadow-lg dark:shadow-stone-500/20 text-stone-500 dark:text-stone-400 border-2 border-transparent hover:border-current`, - to: '/store', - tagline: `Framework agnostic data store with reactive framework adapters`, - description: `The immutable-reactive data store that powers the core of TanStack libraries and their framework adapters.`, - ogImage: 'https://github.com/tanstack/store/raw/main/media/repo-header.png', - // badge: 'new', - bgStyle: 'bg-stone-700', - textStyle: 'text-stone-500', - repo: 'tanstack/store', - latestBranch: 'main', - latestVersion: 'v0', - availableVersions: ['v0'], - colorFrom: 'from-stone-500', - colorTo: 'to-stone-700', - textColor: 'text-stone-700', - frameworks: ['react', 'solid', 'svelte', 'vue', 'angular'], - scarfId: '302d0fef-cb3f-43c6-b45c-f055b9745edb', - defaultDocs: 'overview', -} diff --git a/app/libraries/virtual.ts b/app/libraries/virtual.ts deleted file mode 100644 index 9768eeef..00000000 --- a/app/libraries/virtual.ts +++ /dev/null @@ -1,23 +0,0 @@ -import { Library } from '.' - -export const virtualProject: Library = { - id: 'virtual', - name: 'TanStack Virtual', - cardStyles: `shadow-xl shadow-purple-700/20 dark:shadow-lg dark:shadow-purple-500/30 text-purple-500 border-2 border-transparent hover:border-current`, - to: '/virtual', - tagline: `Headless UI for Virtualizing Large Element Lists`, - description: `Virtualize only the visible content for massive scrollable DOM nodes at 60FPS in TS/JS, React, Vue, Solid & Svelte while retaining 100% control over markup and styles.`, - ogImage: 'https://github.com/tanstack/query/raw/main/media/header.png', - bgStyle: 'bg-purple-500', - textStyle: 'text-purple-500', - repo: 'tanstack/virtual', - latestBranch: 'main', - latestVersion: 'v3', - availableVersions: ['v3'], - colorFrom: 'from-purple-500', - colorTo: 'to-violet-600', - textColor: 'text-purple-600', - frameworks: ['react', 'solid', 'vue', 'svelte'], - defaultDocs: 'framework/react/overview', - scarfId: '32372eb1-91e0-48e7-8df1-4808a7be6b94', -} diff --git a/app/old-routes/-remix.entry.server.tsx b/app/old-routes/-remix.entry.server.tsx deleted file mode 100644 index d9f3120a..00000000 --- a/app/old-routes/-remix.entry.server.tsx +++ /dev/null @@ -1,137 +0,0 @@ -/** - * By default, Remix will handle generating the HTTP Response for you. - * You are free to delete this file if you'd like to, but if you ever want it revealed again, you can run `npx remix reveal` ✨ - * For more information, see https://remix.run/file-conventions/entry.server - */ - -import { PassThrough } from 'node:stream' - -import type { AppLoadContext, EntryContext } from '@remix-run/node' -import { createReadableStreamFromReadable } from '@remix-run/node' -import { RemixServer } from '@tanstack/react-router' -import isbot from 'isbot' -import { renderToPipeableStream } from 'react-dom/server' - -const ABORT_DELAY = 5_000 - -export default function handleRequest( - request: Request, - responseStatusCode: number, - responseHeaders: Headers, - remixContext: EntryContext, - loadContext: AppLoadContext -) { - return isbot(request.headers.get('user-agent')) - ? handleBotRequest( - request, - responseStatusCode, - responseHeaders, - remixContext - ) - : handleBrowserRequest( - request, - responseStatusCode, - responseHeaders, - remixContext - ) -} - -function handleBotRequest( - request: Request, - responseStatusCode: number, - responseHeaders: Headers, - remixContext: EntryContext -) { - return new Promise((resolve, reject) => { - let shellRendered = false - const { pipe, abort } = renderToPipeableStream( - , - { - onAllReady() { - shellRendered = true - const body = new PassThrough() - const stream = createReadableStreamFromReadable(body) - - responseHeaders.set('Content-Type', 'text/html') - - resolve( - new Response(stream, { - headers: responseHeaders, - status: responseStatusCode, - }) - ) - - pipe(body) - }, - onShellError(error: unknown) { - reject(error) - }, - onError(error: unknown) { - responseStatusCode = 500 - // Log streaming rendering errors from inside the shell. Don't log - // errors encountered during initial shell rendering since they'll - // reject and get logged in handleDocumentRequest. - if (shellRendered) { - console.error(error) - } - }, - } - ) - - setTimeout(abort, ABORT_DELAY) - }) -} - -function handleBrowserRequest( - request: Request, - responseStatusCode: number, - responseHeaders: Headers, - remixContext: EntryContext -) { - return new Promise((resolve, reject) => { - let shellRendered = false - const { pipe, abort } = renderToPipeableStream( - , - { - onShellReady() { - shellRendered = true - const body = new PassThrough() - const stream = createReadableStreamFromReadable(body) - - responseHeaders.set('Content-Type', 'text/html') - - resolve( - new Response(stream, { - headers: responseHeaders, - status: responseStatusCode, - }) - ) - - pipe(body) - }, - onShellError(error: unknown) { - reject(error) - }, - onError(error: unknown) { - responseStatusCode = 500 - // Log streaming rendering errors from inside the shell. Don't log - // errors encountered during initial shell rendering since they'll - // reject and get logged in handleDocumentRequest. - if (shellRendered) { - console.error(error) - } - }, - } - ) - - setTimeout(abort, ABORT_DELAY) - }) -} diff --git a/app/old-routes/api.github-sponsors-webhook.ts b/app/old-routes/api.github-sponsors-webhook.ts deleted file mode 100644 index 2133d622..00000000 --- a/app/old-routes/api.github-sponsors-webhook.ts +++ /dev/null @@ -1,81 +0,0 @@ -import crypto from 'node:crypto' -import type { ActionFunction } from '@remix-run/node' - -import { - sponsorCreated, - sponsorCancelled, - sponsorEdited, -} from '~/server/sponsors' - -async function verifySecret(req: Request) { - const sig = req.headers.get('x-hub-signature') || '' - const hmac = crypto.createHmac( - 'sha1', - process.env.GITHUB_SPONSORS_WEBHOOK_SECRET as any - ) - const digest = Buffer.from( - 'sha1=' + hmac.update(JSON.stringify(req.body)).digest('hex'), - 'utf8' - ) - const checksum = Buffer.from(sig, 'utf8') - if ( - checksum.length !== digest.length || - !crypto.timingSafeEqual(digest, checksum) - ) { - throw new Error( - `Request body digest (${digest}) did not match x-hub-signature (${checksum})` - ) - } -} - -export const action: ActionFunction = async (ctx) => { - await verifySecret(ctx.request) - - const githubEvent = ctx.request.headers.get('x-github-event') - const id = ctx.request.headers.get('x-github-delivery') - - if (!githubEvent) { - throw new Response('No X-Github-Event found on request', { - status: 400, - }) - } - - if (!id) { - throw new Response('No X-Github-Delivery found on request', { - status: 400, - }) - } - - const event = await ctx.request.json() - - if (!event?.action) { - throw new Error('No event body action found on request') - } - - if (event.action == 'created') { - sponsorCreated({ - login: event.sponsorship.sponsor.login, - newTier: event.sponsorship.tier, - }) - return new Response('Created', { status: 200 }) - } - - if (event.action == 'cancelled') { - sponsorCancelled({ - login: event.sponsorship.sponsor.login, - oldTier: event.sponsorship.tier, - }) - return new Response('Cancelled', { status: 200 }) - } - - if (event.action == 'tier_changed') { - sponsorEdited({ - login: event.sponsorship.sponsor.login, - oldTier: event.changes.tier, - newTier: event.sponsorship.tier, - }) - return new Response('Updated', { status: 200 }) - } - - return new Response('OK', { status: 200 }) -} diff --git a/app/old-routes/api.link-discord-github.ts b/app/old-routes/api.link-discord-github.ts deleted file mode 100644 index 8fdbe6a4..00000000 --- a/app/old-routes/api.link-discord-github.ts +++ /dev/null @@ -1,34 +0,0 @@ -import { linkGithubAndDiscordUser } from '~/server/discord-github' -import { exchangeDiscordCodeForToken } from '~/server/discord' -import { exchangeGithubCodeForToken } from '~/server/github' -import type { ActionFunction } from '@remix-run/node' - -export const action: ActionFunction = async (ctx) => { - const { discordCode, githubCode, githubState, redirectUrl } = - await ctx.request.json() - - try { - let [githubToken, discordToken] = await Promise.all([ - exchangeGithubCodeForToken({ - code: githubCode, - state: githubState, - redirectUrl, - }), - exchangeDiscordCodeForToken({ - code: discordCode, - redirectUrl, - }), - ]) - - const message = await linkGithubAndDiscordUser({ - githubToken, - discordToken, - }) - - return { message } - } catch (err: any) { - return new Response(JSON.stringify({ error: err.message }), { - status: 400, - }) - } -} diff --git a/app/old-routes/sponsor-login.tsx b/app/old-routes/sponsor-login.tsx deleted file mode 100644 index e2cb1f81..00000000 --- a/app/old-routes/sponsor-login.tsx +++ /dev/null @@ -1,201 +0,0 @@ -import React from 'react' -import * as qss from 'qss' -import { FaGithub, FaDiscord, FaPlug, FaCheck } from 'react-icons/fa' - -import useSessionStorage from '~/hooks/useSessionStorage' -import axios from 'axios' - -const discordClientID = '725855554362146899' -const githubClientID = 'Iv1.3aa8d13a4a3fde91' - -const discordOauthStateKey = 'discord_oauth_state' -const githubOauthStateKey = 'github_oauth_state' - -const discordOauthCodeKey = 'discord_oauth_token' -const githubOauthCodeKey = 'github_oauth_token' - -const discordScope = 'identify guilds.join' - -const githubScope = 'user' - -const getbuttonStyles = () => ` - px-4 py-2 - cursor-pointer - rounded-lg - flex items-center gap-2 -` - -export default function SponsorsLogin() { - const [loadingMessage, setIsLoading] = React.useState( - 'Loading...' - ) - const [error, setError] = React.useState(null) - const [message, setMessage] = React.useState(null) - const [discordState, setDiscordState] = - useSessionStorage(discordOauthStateKey) - const [githubState, setGithubState] = useSessionStorage(githubOauthStateKey) - const [discordCode, setDiscordCode] = useSessionStorage(discordOauthCodeKey) - const [githubCode, setGithubCode] = useSessionStorage(githubOauthCodeKey) - - const loginToDiscord = async () => { - setError(null) - const state = generateState() - setDiscordState(state) - window.location = `https://discord.com/oauth2/authorize?response_type=code&client_id=${discordClientID}&state=${state}&scope=${discordScope}&redirect_uri=${getRedirectUrl()}` - } - - const loginToGithub = async () => { - setError(null) - const state = generateState() - setGithubState(state) - window.location = `https://github.com/login/oauth/authorize?response_type=code&client_id=${githubClientID}&state=${state}&scope=${githubScope}&redirect_uri=${getRedirectUrl()}` - } - - const linkAccounts = async () => { - setIsLoading('Linking accounts...') - - try { - const { - data: { message, error }, - } = await axios.post('/api/link-discord-github', { - discordCode, - discordState, - githubCode, - githubState, - redirectUrl: getRedirectUrl(), - }) - - if (error) { - setError(error) - } else { - setMessage(message) - } - } catch (err) { - setError(err) - } finally { - setDiscordCode(null) - setGithubCode(null) - setIsLoading(false) - } - } - - React.useEffect(() => { - setIsLoading(false) - - const search = window.location.search.substring(1) - - if (search) { - let { code, state } = qss.decode(search) - - state = state + '' - - if (state === githubState) { - setGithubCode(code) - } else if (state === discordState) { - setDiscordCode(code) - } - - window.location = getRedirectUrl() - } - }, []) - - return ( -
- {error ? ( -
-

{error}

-
- ) : message ? ( -
-

{message}

-
- ) : null} -
-
-

Sponsor Log-in

-
-
- {loadingMessage ? ( -
{loadingMessage}
- ) : ( -
-
- - -
- {githubCode && discordCode ? ( -
- -
- ) : null} -
- )} -
-
-
-

- Not a sponsor yet?{' '} - - Sign up here! - -

-
-
-
- ) -} - -function generateState() { - return `st_${(Math.random() + '').replace('.', '')}` -} - -function getRedirectUrl() { - return window.location.origin + window.location.pathname -} diff --git a/app/routeTree.gen.ts b/app/routeTree.gen.ts deleted file mode 100644 index d9afd48f..00000000 --- a/app/routeTree.gen.ts +++ /dev/null @@ -1,611 +0,0 @@ -/* prettier-ignore-start */ - -/* eslint-disable */ - -// @ts-nocheck - -// noinspection JSUnusedGlobalSymbols - -// This file is auto-generated by TanStack Router - -// Import Routes - -import { Route as rootRoute } from './routes/__root' -import { Route as SponsorsEmbedImport } from './routes/sponsors-embed' -import { Route as MerchImport } from './routes/merch' -import { Route as LoginImport } from './routes/login' -import { Route as DashboardImport } from './routes/dashboard' -import { Route as BlogImport } from './routes/blog' -import { Route as LibrariesImport } from './routes/_libraries' -import { Route as LibraryIdImport } from './routes/$libraryId' -import { Route as BlogIndexImport } from './routes/blog.index' -import { Route as LibrariesIndexImport } from './routes/_libraries.index' -import { Route as LibraryIdIndexImport } from './routes/$libraryId.index' -import { Route as BlogSplatImport } from './routes/blog.$' -import { Route as LibrariesSupportImport } from './routes/_libraries.support' -import { Route as LibrariesLearnImport } from './routes/_libraries.learn' -import { Route as LibrariesDedicatedSupportImport } from './routes/_libraries.dedicated-support' -import { Route as LibraryIdVersionImport } from './routes/$libraryId.$version' -import { Route as LibraryIdVersionDocsImport } from './routes/$libraryId.$version.docs' -import { Route as LibrariesVirtualVersionIndexImport } from './routes/_libraries.virtual.$version.index' -import { Route as LibrariesTableVersionIndexImport } from './routes/_libraries.table.$version.index' -import { Route as LibrariesStoreVersionIndexImport } from './routes/_libraries.store.$version.index' -import { Route as LibrariesStartVersionIndexImport } from './routes/_libraries.start.$version.index' -import { Route as LibrariesRouterVersionIndexImport } from './routes/_libraries.router.$version.index' -import { Route as LibrariesRangerVersionIndexImport } from './routes/_libraries.ranger.$version.index' -import { Route as LibrariesQueryVersionIndexImport } from './routes/_libraries.query.$version.index' -import { Route as LibrariesFormVersionIndexImport } from './routes/_libraries.form.$version.index' -import { Route as LibrariesConfigVersionIndexImport } from './routes/_libraries.config.$version.index' -import { Route as LibraryIdVersionDocsIndexImport } from './routes/$libraryId.$version.docs.index' -import { Route as LibraryIdVersionDocsSplatImport } from './routes/$libraryId.$version.docs.$' -import { Route as LibraryIdVersionDocsFrameworkFrameworkSplatImport } from './routes/$libraryId.$version.docs.framework.$framework.$' -import { Route as LibraryIdVersionDocsFrameworkFrameworkExamplesSplatImport } from './routes/$libraryId.$version.docs.framework.$framework.examples.$' - -// Create/Update Routes - -const SponsorsEmbedRoute = SponsorsEmbedImport.update({ - path: '/sponsors-embed', - getParentRoute: () => rootRoute, -} as any) - -const MerchRoute = MerchImport.update({ - path: '/merch', - getParentRoute: () => rootRoute, -} as any) - -const LoginRoute = LoginImport.update({ - path: '/login', - getParentRoute: () => rootRoute, -} as any) - -const DashboardRoute = DashboardImport.update({ - path: '/dashboard', - getParentRoute: () => rootRoute, -} as any) - -const BlogRoute = BlogImport.update({ - path: '/blog', - getParentRoute: () => rootRoute, -} as any) - -const LibrariesRoute = LibrariesImport.update({ - id: '/_libraries', - getParentRoute: () => rootRoute, -} as any) - -const LibraryIdRoute = LibraryIdImport.update({ - path: '/$libraryId', - getParentRoute: () => rootRoute, -} as any) - -const BlogIndexRoute = BlogIndexImport.update({ - path: '/', - getParentRoute: () => BlogRoute, -} as any) - -const LibrariesIndexRoute = LibrariesIndexImport.update({ - path: '/', - getParentRoute: () => LibrariesRoute, -} as any) - -const LibraryIdIndexRoute = LibraryIdIndexImport.update({ - path: '/', - getParentRoute: () => LibraryIdRoute, -} as any) - -const BlogSplatRoute = BlogSplatImport.update({ - path: '/$', - getParentRoute: () => BlogRoute, -} as any) - -const LibrariesSupportRoute = LibrariesSupportImport.update({ - path: '/support', - getParentRoute: () => LibrariesRoute, -} as any) - -const LibrariesLearnRoute = LibrariesLearnImport.update({ - path: '/learn', - getParentRoute: () => LibrariesRoute, -} as any) - -const LibrariesDedicatedSupportRoute = LibrariesDedicatedSupportImport.update({ - path: '/dedicated-support', - getParentRoute: () => LibrariesRoute, -} as any) - -const LibraryIdVersionRoute = LibraryIdVersionImport.update({ - path: '/$version', - getParentRoute: () => LibraryIdRoute, -} as any) - -const LibraryIdVersionDocsRoute = LibraryIdVersionDocsImport.update({ - path: '/docs', - getParentRoute: () => LibraryIdVersionRoute, -} as any) - -const LibrariesVirtualVersionIndexRoute = - LibrariesVirtualVersionIndexImport.update({ - path: '/virtual/$version/', - getParentRoute: () => LibrariesRoute, - } as any) - -const LibrariesTableVersionIndexRoute = LibrariesTableVersionIndexImport.update( - { - path: '/table/$version/', - getParentRoute: () => LibrariesRoute, - } as any, -) - -const LibrariesStoreVersionIndexRoute = LibrariesStoreVersionIndexImport.update( - { - path: '/store/$version/', - getParentRoute: () => LibrariesRoute, - } as any, -) - -const LibrariesStartVersionIndexRoute = LibrariesStartVersionIndexImport.update( - { - path: '/start/$version/', - getParentRoute: () => LibrariesRoute, - } as any, -) - -const LibrariesRouterVersionIndexRoute = - LibrariesRouterVersionIndexImport.update({ - path: '/router/$version/', - getParentRoute: () => LibrariesRoute, - } as any) - -const LibrariesRangerVersionIndexRoute = - LibrariesRangerVersionIndexImport.update({ - path: '/ranger/$version/', - getParentRoute: () => LibrariesRoute, - } as any) - -const LibrariesQueryVersionIndexRoute = LibrariesQueryVersionIndexImport.update( - { - path: '/query/$version/', - getParentRoute: () => LibrariesRoute, - } as any, -) - -const LibrariesFormVersionIndexRoute = LibrariesFormVersionIndexImport.update({ - path: '/form/$version/', - getParentRoute: () => LibrariesRoute, -} as any) - -const LibrariesConfigVersionIndexRoute = - LibrariesConfigVersionIndexImport.update({ - path: '/config/$version/', - getParentRoute: () => LibrariesRoute, - } as any) - -const LibraryIdVersionDocsIndexRoute = LibraryIdVersionDocsIndexImport.update({ - path: '/', - getParentRoute: () => LibraryIdVersionDocsRoute, -} as any) - -const LibraryIdVersionDocsSplatRoute = LibraryIdVersionDocsSplatImport.update({ - path: '/$', - getParentRoute: () => LibraryIdVersionDocsRoute, -} as any) - -const LibraryIdVersionDocsFrameworkFrameworkSplatRoute = - LibraryIdVersionDocsFrameworkFrameworkSplatImport.update({ - path: '/framework/$framework/$', - getParentRoute: () => LibraryIdVersionDocsRoute, - } as any) - -const LibraryIdVersionDocsFrameworkFrameworkExamplesSplatRoute = - LibraryIdVersionDocsFrameworkFrameworkExamplesSplatImport.update({ - path: '/framework/$framework/examples/$', - getParentRoute: () => LibraryIdVersionDocsRoute, - } as any) - -// Populate the FileRoutesByPath interface - -declare module '@tanstack/react-router' { - interface FileRoutesByPath { - '/$libraryId': { - id: '/$libraryId' - path: '/$libraryId' - fullPath: '/$libraryId' - preLoaderRoute: typeof LibraryIdImport - parentRoute: typeof rootRoute - } - '/_libraries': { - id: '/_libraries' - path: '' - fullPath: '' - preLoaderRoute: typeof LibrariesImport - parentRoute: typeof rootRoute - } - '/blog': { - id: '/blog' - path: '/blog' - fullPath: '/blog' - preLoaderRoute: typeof BlogImport - parentRoute: typeof rootRoute - } - '/dashboard': { - id: '/dashboard' - path: '/dashboard' - fullPath: '/dashboard' - preLoaderRoute: typeof DashboardImport - parentRoute: typeof rootRoute - } - '/login': { - id: '/login' - path: '/login' - fullPath: '/login' - preLoaderRoute: typeof LoginImport - parentRoute: typeof rootRoute - } - '/merch': { - id: '/merch' - path: '/merch' - fullPath: '/merch' - preLoaderRoute: typeof MerchImport - parentRoute: typeof rootRoute - } - '/sponsors-embed': { - id: '/sponsors-embed' - path: '/sponsors-embed' - fullPath: '/sponsors-embed' - preLoaderRoute: typeof SponsorsEmbedImport - parentRoute: typeof rootRoute - } - '/$libraryId/$version': { - id: '/$libraryId/$version' - path: '/$version' - fullPath: '/$libraryId/$version' - preLoaderRoute: typeof LibraryIdVersionImport - parentRoute: typeof LibraryIdImport - } - '/_libraries/dedicated-support': { - id: '/_libraries/dedicated-support' - path: '/dedicated-support' - fullPath: '/dedicated-support' - preLoaderRoute: typeof LibrariesDedicatedSupportImport - parentRoute: typeof LibrariesImport - } - '/_libraries/learn': { - id: '/_libraries/learn' - path: '/learn' - fullPath: '/learn' - preLoaderRoute: typeof LibrariesLearnImport - parentRoute: typeof LibrariesImport - } - '/_libraries/support': { - id: '/_libraries/support' - path: '/support' - fullPath: '/support' - preLoaderRoute: typeof LibrariesSupportImport - parentRoute: typeof LibrariesImport - } - '/blog/$': { - id: '/blog/$' - path: '/$' - fullPath: '/blog/$' - preLoaderRoute: typeof BlogSplatImport - parentRoute: typeof BlogImport - } - '/$libraryId/': { - id: '/$libraryId/' - path: '/' - fullPath: '/$libraryId/' - preLoaderRoute: typeof LibraryIdIndexImport - parentRoute: typeof LibraryIdImport - } - '/_libraries/': { - id: '/_libraries/' - path: '/' - fullPath: '/' - preLoaderRoute: typeof LibrariesIndexImport - parentRoute: typeof LibrariesImport - } - '/blog/': { - id: '/blog/' - path: '/' - fullPath: '/blog/' - preLoaderRoute: typeof BlogIndexImport - parentRoute: typeof BlogImport - } - '/$libraryId/$version/docs': { - id: '/$libraryId/$version/docs' - path: '/docs' - fullPath: '/$libraryId/$version/docs' - preLoaderRoute: typeof LibraryIdVersionDocsImport - parentRoute: typeof LibraryIdVersionImport - } - '/$libraryId/$version/docs/$': { - id: '/$libraryId/$version/docs/$' - path: '/$' - fullPath: '/$libraryId/$version/docs/$' - preLoaderRoute: typeof LibraryIdVersionDocsSplatImport - parentRoute: typeof LibraryIdVersionDocsImport - } - '/$libraryId/$version/docs/': { - id: '/$libraryId/$version/docs/' - path: '/' - fullPath: '/$libraryId/$version/docs/' - preLoaderRoute: typeof LibraryIdVersionDocsIndexImport - parentRoute: typeof LibraryIdVersionDocsImport - } - '/_libraries/config/$version/': { - id: '/_libraries/config/$version/' - path: '/config/$version' - fullPath: '/config/$version' - preLoaderRoute: typeof LibrariesConfigVersionIndexImport - parentRoute: typeof LibrariesImport - } - '/_libraries/form/$version/': { - id: '/_libraries/form/$version/' - path: '/form/$version' - fullPath: '/form/$version' - preLoaderRoute: typeof LibrariesFormVersionIndexImport - parentRoute: typeof LibrariesImport - } - '/_libraries/query/$version/': { - id: '/_libraries/query/$version/' - path: '/query/$version' - fullPath: '/query/$version' - preLoaderRoute: typeof LibrariesQueryVersionIndexImport - parentRoute: typeof LibrariesImport - } - '/_libraries/ranger/$version/': { - id: '/_libraries/ranger/$version/' - path: '/ranger/$version' - fullPath: '/ranger/$version' - preLoaderRoute: typeof LibrariesRangerVersionIndexImport - parentRoute: typeof LibrariesImport - } - '/_libraries/router/$version/': { - id: '/_libraries/router/$version/' - path: '/router/$version' - fullPath: '/router/$version' - preLoaderRoute: typeof LibrariesRouterVersionIndexImport - parentRoute: typeof LibrariesImport - } - '/_libraries/start/$version/': { - id: '/_libraries/start/$version/' - path: '/start/$version' - fullPath: '/start/$version' - preLoaderRoute: typeof LibrariesStartVersionIndexImport - parentRoute: typeof LibrariesImport - } - '/_libraries/store/$version/': { - id: '/_libraries/store/$version/' - path: '/store/$version' - fullPath: '/store/$version' - preLoaderRoute: typeof LibrariesStoreVersionIndexImport - parentRoute: typeof LibrariesImport - } - '/_libraries/table/$version/': { - id: '/_libraries/table/$version/' - path: '/table/$version' - fullPath: '/table/$version' - preLoaderRoute: typeof LibrariesTableVersionIndexImport - parentRoute: typeof LibrariesImport - } - '/_libraries/virtual/$version/': { - id: '/_libraries/virtual/$version/' - path: '/virtual/$version' - fullPath: '/virtual/$version' - preLoaderRoute: typeof LibrariesVirtualVersionIndexImport - parentRoute: typeof LibrariesImport - } - '/$libraryId/$version/docs/framework/$framework/$': { - id: '/$libraryId/$version/docs/framework/$framework/$' - path: '/framework/$framework/$' - fullPath: '/$libraryId/$version/docs/framework/$framework/$' - preLoaderRoute: typeof LibraryIdVersionDocsFrameworkFrameworkSplatImport - parentRoute: typeof LibraryIdVersionDocsImport - } - '/$libraryId/$version/docs/framework/$framework/examples/$': { - id: '/$libraryId/$version/docs/framework/$framework/examples/$' - path: '/framework/$framework/examples/$' - fullPath: '/$libraryId/$version/docs/framework/$framework/examples/$' - preLoaderRoute: typeof LibraryIdVersionDocsFrameworkFrameworkExamplesSplatImport - parentRoute: typeof LibraryIdVersionDocsImport - } - } -} - -// Create and export the route tree - -export const routeTree = rootRoute.addChildren({ - LibraryIdRoute: LibraryIdRoute.addChildren({ - LibraryIdVersionRoute: LibraryIdVersionRoute.addChildren({ - LibraryIdVersionDocsRoute: LibraryIdVersionDocsRoute.addChildren({ - LibraryIdVersionDocsSplatRoute, - LibraryIdVersionDocsIndexRoute, - LibraryIdVersionDocsFrameworkFrameworkSplatRoute, - LibraryIdVersionDocsFrameworkFrameworkExamplesSplatRoute, - }), - }), - LibraryIdIndexRoute, - }), - LibrariesRoute: LibrariesRoute.addChildren({ - LibrariesDedicatedSupportRoute, - LibrariesLearnRoute, - LibrariesSupportRoute, - LibrariesIndexRoute, - LibrariesConfigVersionIndexRoute, - LibrariesFormVersionIndexRoute, - LibrariesQueryVersionIndexRoute, - LibrariesRangerVersionIndexRoute, - LibrariesRouterVersionIndexRoute, - LibrariesStartVersionIndexRoute, - LibrariesStoreVersionIndexRoute, - LibrariesTableVersionIndexRoute, - LibrariesVirtualVersionIndexRoute, - }), - BlogRoute: BlogRoute.addChildren({ BlogSplatRoute, BlogIndexRoute }), - DashboardRoute, - LoginRoute, - MerchRoute, - SponsorsEmbedRoute, -}) - -/* prettier-ignore-end */ - -/* ROUTE_MANIFEST_START -{ - "routes": { - "__root__": { - "filePath": "__root.tsx", - "children": [ - "/$libraryId", - "/_libraries", - "/blog", - "/dashboard", - "/login", - "/merch", - "/sponsors-embed" - ] - }, - "/$libraryId": { - "filePath": "$libraryId.tsx", - "children": [ - "/$libraryId/$version", - "/$libraryId/" - ] - }, - "/_libraries": { - "filePath": "_libraries.tsx", - "children": [ - "/_libraries/dedicated-support", - "/_libraries/learn", - "/_libraries/support", - "/_libraries/", - "/_libraries/config/$version/", - "/_libraries/form/$version/", - "/_libraries/query/$version/", - "/_libraries/ranger/$version/", - "/_libraries/router/$version/", - "/_libraries/start/$version/", - "/_libraries/store/$version/", - "/_libraries/table/$version/", - "/_libraries/virtual/$version/" - ] - }, - "/blog": { - "filePath": "blog.tsx", - "children": [ - "/blog/$", - "/blog/" - ] - }, - "/dashboard": { - "filePath": "dashboard.tsx" - }, - "/login": { - "filePath": "login.tsx" - }, - "/merch": { - "filePath": "merch.tsx" - }, - "/sponsors-embed": { - "filePath": "sponsors-embed.tsx" - }, - "/$libraryId/$version": { - "filePath": "$libraryId.$version.tsx", - "parent": "/$libraryId", - "children": [ - "/$libraryId/$version/docs" - ] - }, - "/_libraries/dedicated-support": { - "filePath": "_libraries.dedicated-support.tsx", - "parent": "/_libraries" - }, - "/_libraries/learn": { - "filePath": "_libraries.learn.tsx", - "parent": "/_libraries" - }, - "/_libraries/support": { - "filePath": "_libraries.support.tsx", - "parent": "/_libraries" - }, - "/blog/$": { - "filePath": "blog.$.tsx", - "parent": "/blog" - }, - "/$libraryId/": { - "filePath": "$libraryId.index.tsx", - "parent": "/$libraryId" - }, - "/_libraries/": { - "filePath": "_libraries.index.tsx", - "parent": "/_libraries" - }, - "/blog/": { - "filePath": "blog.index.tsx", - "parent": "/blog" - }, - "/$libraryId/$version/docs": { - "filePath": "$libraryId.$version.docs.tsx", - "parent": "/$libraryId/$version", - "children": [ - "/$libraryId/$version/docs/$", - "/$libraryId/$version/docs/", - "/$libraryId/$version/docs/framework/$framework/$", - "/$libraryId/$version/docs/framework/$framework/examples/$" - ] - }, - "/$libraryId/$version/docs/$": { - "filePath": "$libraryId.$version.docs.$.tsx", - "parent": "/$libraryId/$version/docs" - }, - "/$libraryId/$version/docs/": { - "filePath": "$libraryId.$version.docs.index.tsx", - "parent": "/$libraryId/$version/docs" - }, - "/_libraries/config/$version/": { - "filePath": "_libraries.config.$version.index.tsx", - "parent": "/_libraries" - }, - "/_libraries/form/$version/": { - "filePath": "_libraries.form.$version.index.tsx", - "parent": "/_libraries" - }, - "/_libraries/query/$version/": { - "filePath": "_libraries.query.$version.index.tsx", - "parent": "/_libraries" - }, - "/_libraries/ranger/$version/": { - "filePath": "_libraries.ranger.$version.index.tsx", - "parent": "/_libraries" - }, - "/_libraries/router/$version/": { - "filePath": "_libraries.router.$version.index.tsx", - "parent": "/_libraries" - }, - "/_libraries/start/$version/": { - "filePath": "_libraries.start.$version.index.tsx", - "parent": "/_libraries" - }, - "/_libraries/store/$version/": { - "filePath": "_libraries.store.$version.index.tsx", - "parent": "/_libraries" - }, - "/_libraries/table/$version/": { - "filePath": "_libraries.table.$version.index.tsx", - "parent": "/_libraries" - }, - "/_libraries/virtual/$version/": { - "filePath": "_libraries.virtual.$version.index.tsx", - "parent": "/_libraries" - }, - "/$libraryId/$version/docs/framework/$framework/$": { - "filePath": "$libraryId.$version.docs.framework.$framework.$.tsx", - "parent": "/$libraryId/$version/docs" - }, - "/$libraryId/$version/docs/framework/$framework/examples/$": { - "filePath": "$libraryId.$version.docs.framework.$framework.examples.$.tsx", - "parent": "/$libraryId/$version/docs" - } - } -} -ROUTE_MANIFEST_END */ diff --git a/app/router.tsx b/app/router.tsx deleted file mode 100644 index 50234df3..00000000 --- a/app/router.tsx +++ /dev/null @@ -1,41 +0,0 @@ -import { createRouter as TanStackCreateRouter } from '@tanstack/react-router' -import { routeTree } from './routeTree.gen' -import { DefaultCatchBoundary } from './components/DefaultCatchBoundary' -import { NotFound } from './components/NotFound' - -export function createRouter() { - const router = TanStackCreateRouter({ - routeTree, - defaultPreload: 'intent', - defaultErrorComponent: DefaultCatchBoundary, - defaultStaleTime: 1, - defaultNotFoundComponent: () => { - return - }, - context: { - assets: [], - }, - }) - - router.subscribe('onResolved', () => { - try { - ;(window as any)._carbonads?.refresh?.() - document.querySelectorAll('[id^="carbonads_"]').forEach((el, i) => { - if (i > 0) { - el.remove() - } - }) - } catch {} - }) - - return router -} - -declare module '@tanstack/react-router' { - interface Register { - router: ReturnType - } - interface StaticDataRouteOption { - baseParent?: boolean - } -} diff --git a/app/routes/$libraryId.$version.docs.$.tsx b/app/routes/$libraryId.$version.docs.$.tsx deleted file mode 100644 index 7f3643c4..00000000 --- a/app/routes/$libraryId.$version.docs.$.tsx +++ /dev/null @@ -1,47 +0,0 @@ -import { createFileRoute } from '@tanstack/react-router' -import { seo } from '~/utils/seo' -import { Doc } from '~/components/Doc' -import { loadDocs } from '~/utils/docs' -import { getBranch, getLibrary } from '~/libraries' - -export const Route = createFileRoute('/$libraryId/$version/docs/$')({ - loader: (ctx) => { - const { _splat: docsPath, version, libraryId } = ctx.params - const library = getLibrary(libraryId) - - return loadDocs({ - repo: library.repo, - branch: getBranch(library, version), - docsPath: `docs/${docsPath}`, - currentPath: ctx.location.pathname, - redirectPath: `/${library.id}/${version}/docs/overview`, - }) - }, - meta: ({ loaderData, params }) => { - const { libraryId } = params - const library = getLibrary(libraryId) - - return seo({ - title: `${loaderData?.title} | ${library.name} Docs`, - description: loaderData?.description, - }) - }, - component: Docs, -}) - -function Docs() { - const { version, libraryId } = Route.useParams() - const { title, content, filePath } = Route.useLoaderData() - const library = getLibrary(libraryId) - const branch = getBranch(library, version) - - return ( - - ) -} diff --git a/app/routes/$libraryId.$version.docs.framework.$framework.examples.$.tsx b/app/routes/$libraryId.$version.docs.framework.$framework.examples.$.tsx deleted file mode 100644 index eedded4c..00000000 --- a/app/routes/$libraryId.$version.docs.framework.$framework.examples.$.tsx +++ /dev/null @@ -1,111 +0,0 @@ -import { createFileRoute } from '@tanstack/react-router' -import React from 'react' - -import { FaExternalLinkAlt } from 'react-icons/fa' -import { DocTitle } from '~/components/DocTitle' -import { getBranch, getLibrary } from '~/libraries' -import { getInitialSandboxFileName } from '~/utils/sandbox' -import { seo } from '~/utils/seo' -import { capitalize, slugToTitle } from '~/utils/utils' - -export const Route = createFileRoute( - '/$libraryId/$version/docs/framework/$framework/examples/$' -)({ - meta: ({ params }) => { - const library = getLibrary(params.libraryId) - - return seo({ - title: `${capitalize(params.framework)} ${library.name} ${slugToTitle( - params._splat - )} Example | ${library.name} Docs`, - description: `An example showing how to implement ${slugToTitle( - params._splat - )} in ${capitalize(params.framework)} using ${library.name}.`, - }) - }, - component: Example, -}) - -export default function Example() { - const { version, framework, _splat, libraryId } = Route.useParams() - const library = getLibrary(libraryId) - const branch = getBranch(library, version) - - const examplePath = [framework, _splat].join('/') - - const [isDark, setIsDark] = React.useState(true) - - React.useEffect(() => { - setIsDark(window.matchMedia?.(`(prefers-color-scheme: dark)`).matches) - }, []) - - const sandboxFirstFileName = getInitialSandboxFileName(framework, libraryId) - - const githubUrl = `https://github.com/${library.repo}/tree/${branch}/examples/${examplePath}` - // preset=node can be removed once Stackblitz runs Angular as webcontainer by default - // See https://github.com/stackblitz/core/issues/2957 - const stackBlitzUrl = `https://stackblitz.com/github/${ - library.repo - }/tree/${branch}/examples/${examplePath}?embed=1&theme=${ - isDark ? 'dark' : 'light' - }&preset=node&file=${sandboxFirstFileName}` - const codesandboxUrl = `https://codesandbox.io/p/devbox/github/${ - library.repo - }/tree/${branch}/examples/${examplePath}?embed=1&theme=${ - isDark ? 'dark' : 'light' - }&file=${sandboxFirstFileName}` - - const hideCodesandbox = library.hideCodesandboxUrl - const hideStackblitz = library.hideStackblitzUrl - - return ( -
-
- - - {capitalize(framework)} Example: {slugToTitle(_splat)} - -
- - Github - - {!hideStackblitz ? ( - - StackBlitz - - ) : null} - {!hideCodesandbox ? ( - - CodeSandbox - - ) : null} -
-
-
-
-