Compare commits
No commits in common. "8adfa91831584df4586586fe5a7fdb037dc05c4b" and "9426e8e66c2687b3d09ec65224fcdee4bd415fdc" have entirely different histories.
8adfa91831
...
9426e8e66c
5 changed files with 123 additions and 161 deletions
3
.gitignore
vendored
3
.gitignore
vendored
|
|
@ -63,6 +63,3 @@ website/
|
|||
|
||||
# Optional eslint cache
|
||||
.eslintcache
|
||||
|
||||
website/
|
||||
manual/
|
||||
176
package.json
176
package.json
|
|
@ -1,90 +1,90 @@
|
|||
{
|
||||
"name": "@catalystlabs/typedfetch",
|
||||
"version": "0.3.1",
|
||||
"description": "Type-safe HTTP client that doesn't suck - Fetch for humans who have stuff to build",
|
||||
"type": "module",
|
||||
"main": "./dist/index.js",
|
||||
"module": "./dist/index.js",
|
||||
"types": "./dist/index.d.ts",
|
||||
"bin": {
|
||||
"typedfetch": "./dist/cli.js"
|
||||
},
|
||||
"exports": {
|
||||
".": {
|
||||
"import": "./dist/index.js",
|
||||
"require": "./dist/index.cjs",
|
||||
"types": "./dist/index.d.ts"
|
||||
}
|
||||
},
|
||||
"files": [
|
||||
"dist",
|
||||
"README.md",
|
||||
"LICENSE"
|
||||
],
|
||||
"scripts": {
|
||||
"build": "bun run build:clean && bun run build:esm && bun run build:cjs && bun run build:cli && bun run build:types",
|
||||
"build:clean": "rm -rf dist && mkdir dist",
|
||||
"build:esm": "bun build src/index.ts --outdir dist --target browser --format esm",
|
||||
"build:cjs": "esbuild src/index.ts --bundle --outfile=dist/index.cjs --target=node16 --format=cjs --platform=node",
|
||||
"build:cli": "bun build src/cli.ts --outfile dist/cli.js --target node --format esm",
|
||||
"build:types": "tsc --emitDeclarationOnly --outDir dist",
|
||||
"typecheck": "tsc --noEmit",
|
||||
"test": "bun x vitest run",
|
||||
"sync-version": "node scripts/sync-version.js",
|
||||
"prepublishOnly": "bun run build && bun run typecheck"
|
||||
},
|
||||
"keywords": [
|
||||
"http",
|
||||
"fetch",
|
||||
"client",
|
||||
"typescript",
|
||||
"type-safe",
|
||||
"api",
|
||||
"rest",
|
||||
"xhr",
|
||||
"request",
|
||||
"response",
|
||||
"cache",
|
||||
"retry",
|
||||
"resilience",
|
||||
"proxy",
|
||||
"interceptor",
|
||||
"transform"
|
||||
],
|
||||
"author": "TypedFetch Contributors",
|
||||
"license": "MIT",
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "git+https://git.catalystlab.cc/caseycollier/TypeFetched.git"
|
||||
},
|
||||
"bugs": {
|
||||
"url": "https://git.catalystlab.cc/caseycollier/TypeFetched/issues"
|
||||
},
|
||||
"homepage": "https://typedfetch.dev",
|
||||
"devDependencies": {
|
||||
"@types/node": "^20.0.0",
|
||||
"@typescript-eslint/eslint-plugin": "^6.0.0",
|
||||
"@typescript-eslint/parser": "^6.0.0",
|
||||
"esbuild": "^0.19.0",
|
||||
"eslint": "^8.0.0",
|
||||
"gzip-size-cli": "^5.1.0",
|
||||
"typescript": "^5.8.3",
|
||||
"vitest": "^1.0.0"
|
||||
},
|
||||
"peerDependencies": {
|
||||
"typescript": ">=4.7.0"
|
||||
},
|
||||
"peerDependenciesMeta": {
|
||||
"typescript": {
|
||||
"optional": true
|
||||
}
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=16.0.0"
|
||||
},
|
||||
"sideEffects": false,
|
||||
"funding": {
|
||||
"type": "github",
|
||||
"url": "https://github.com/sponsors/typedfetch"
|
||||
}
|
||||
"name": "@catalystlabs/typedfetch",
|
||||
"version": "0.2.0",
|
||||
"description": "Type-safe HTTP client that doesn't suck - Fetch for humans who have stuff to build",
|
||||
"type": "module",
|
||||
"main": "./dist/index.js",
|
||||
"module": "./dist/index.js",
|
||||
"types": "./dist/index.d.ts",
|
||||
"bin": {
|
||||
"typedfetch": "./dist/cli.js"
|
||||
},
|
||||
"exports": {
|
||||
".": {
|
||||
"import": "./dist/index.js",
|
||||
"require": "./dist/index.cjs",
|
||||
"types": "./dist/index.d.ts"
|
||||
}
|
||||
},
|
||||
"files": [
|
||||
"dist",
|
||||
"README.md",
|
||||
"LICENSE"
|
||||
],
|
||||
"scripts": {
|
||||
"build": "bun run build:clean && bun run build:esm && bun run build:cjs && bun run build:cli && bun run build:types",
|
||||
"build:clean": "rm -rf dist && mkdir dist",
|
||||
"build:esm": "bun build src/index.ts --outdir dist --target browser --format esm",
|
||||
"build:cjs": "esbuild src/index.ts --bundle --outfile=dist/index.cjs --target=node16 --format=cjs --platform=node",
|
||||
"build:cli": "bun build src/cli.ts --outfile dist/cli.js --target node --format esm",
|
||||
"build:types": "tsc --emitDeclarationOnly --outDir dist",
|
||||
"typecheck": "tsc --noEmit",
|
||||
"test": "bun x vitest run",
|
||||
"sync-version": "node scripts/sync-version.js",
|
||||
"prepublishOnly": "bun run build && bun run typecheck"
|
||||
},
|
||||
"keywords": [
|
||||
"http",
|
||||
"fetch",
|
||||
"client",
|
||||
"typescript",
|
||||
"type-safe",
|
||||
"api",
|
||||
"rest",
|
||||
"xhr",
|
||||
"request",
|
||||
"response",
|
||||
"cache",
|
||||
"retry",
|
||||
"resilience",
|
||||
"proxy",
|
||||
"interceptor",
|
||||
"transform"
|
||||
],
|
||||
"author": "TypedFetch Contributors",
|
||||
"license": "MIT",
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "git+https://git.catalystlab.cc/caseycollier/TypeFetched.git"
|
||||
},
|
||||
"bugs": {
|
||||
"url": "https://git.catalystlab.cc/caseycollier/TypeFetched/issues"
|
||||
},
|
||||
"homepage": "https://typedfetch.dev",
|
||||
"devDependencies": {
|
||||
"@types/node": "^20.0.0",
|
||||
"@typescript-eslint/eslint-plugin": "^6.0.0",
|
||||
"@typescript-eslint/parser": "^6.0.0",
|
||||
"esbuild": "^0.19.0",
|
||||
"eslint": "^8.0.0",
|
||||
"gzip-size-cli": "^5.1.0",
|
||||
"typescript": "^5.8.3",
|
||||
"vitest": "^1.0.0"
|
||||
},
|
||||
"peerDependencies": {
|
||||
"typescript": ">=4.7.0"
|
||||
},
|
||||
"peerDependenciesMeta": {
|
||||
"typescript": {
|
||||
"optional": true
|
||||
}
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=16.0.0"
|
||||
},
|
||||
"sideEffects": false,
|
||||
"funding": {
|
||||
"type": "github",
|
||||
"url": "https://github.com/sponsors/typedfetch"
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -4,7 +4,6 @@
|
|||
"module": "ESNext",
|
||||
"moduleResolution": "bundler",
|
||||
"allowImportingTsExtensions": true,
|
||||
"noEmit": true,
|
||||
"allowSyntheticDefaultImports": true,
|
||||
"esModuleInterop": true,
|
||||
"forceConsistentCasingInFileNames": true,
|
||||
|
|
|
|||
|
|
@ -16,7 +16,6 @@
|
|||
"@mantine/spotlight": "^8.0.0",
|
||||
"@tabler/icons-react": "^3.26.0",
|
||||
"@vercel/analytics": "^1.5.0",
|
||||
"@vercel/speed-insights": "^1.2.0",
|
||||
"framer-motion": "^11.15.0",
|
||||
"react": "^18.3.1",
|
||||
"react-dom": "^18.3.1",
|
||||
|
|
@ -31,4 +30,4 @@
|
|||
"typescript": "^5.8.3",
|
||||
"vite": "^6.0.7"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -1,4 +1,4 @@
|
|||
import { MantineProvider, Loader, Stack, Text } from '@mantine/core';
|
||||
import { MantineProvider } from '@mantine/core';
|
||||
import { BrowserRouter, Routes, Route } from 'react-router-dom';
|
||||
import { CodeHighlightAdapterProvider } from '@mantine/code-highlight';
|
||||
import { lazy, Suspense } from 'react';
|
||||
|
|
@ -7,7 +7,6 @@ import { shikiAdapter } from './utils/shikiAdapter';
|
|||
import { theme } from './theme';
|
||||
import { LandingPage } from './pages/LandingPage';
|
||||
import { DocsLayout } from './layouts/DocsLayout';
|
||||
import { ErrorBoundary } from './components/ErrorBoundary';
|
||||
|
||||
// Lazy load documentation pages for better performance
|
||||
const GettingStarted = lazy(() => import('./pages/docs/GettingStarted'));
|
||||
|
|
@ -27,16 +26,6 @@ import '@mantine/spotlight/styles.css';
|
|||
import './styles/global.css';
|
||||
import './styles/fonts.css';
|
||||
|
||||
// Loading component for Suspense fallbacks
|
||||
function LoadingFallback() {
|
||||
return (
|
||||
<Stack align="center" justify="center" gap="sm" p="xl" style={{ minHeight: '200px' }}>
|
||||
<Loader size="md" />
|
||||
<Text size="sm" c="dimmed">Loading page...</Text>
|
||||
</Stack>
|
||||
);
|
||||
}
|
||||
|
||||
export function App() {
|
||||
return (
|
||||
<MantineProvider theme={theme} defaultColorScheme="dark">
|
||||
|
|
@ -46,81 +35,59 @@ export function App() {
|
|||
<Route path="/" element={<LandingPage />} />
|
||||
<Route path="/docs" element={<DocsLayout />}>
|
||||
<Route index element={
|
||||
<ErrorBoundary>
|
||||
<Suspense fallback={<LoadingFallback />}>
|
||||
<GettingStarted />
|
||||
</Suspense>
|
||||
</ErrorBoundary>
|
||||
<Suspense fallback={<div>Loading...</div>}>
|
||||
<GettingStarted />
|
||||
</Suspense>
|
||||
} />
|
||||
<Route path="installation" element={
|
||||
<ErrorBoundary>
|
||||
<Suspense fallback={<LoadingFallback />}>
|
||||
<Installation />
|
||||
</Suspense>
|
||||
</ErrorBoundary>
|
||||
<Suspense fallback={<div>Loading...</div>}>
|
||||
<Installation />
|
||||
</Suspense>
|
||||
} />
|
||||
<Route path="basic-usage" element={
|
||||
<ErrorBoundary>
|
||||
<Suspense fallback={<LoadingFallback />}>
|
||||
<BasicUsage />
|
||||
</Suspense>
|
||||
</ErrorBoundary>
|
||||
<Suspense fallback={<div>Loading...</div>}>
|
||||
<BasicUsage />
|
||||
</Suspense>
|
||||
} />
|
||||
<Route path="configuration" element={
|
||||
<ErrorBoundary>
|
||||
<Suspense fallback={<LoadingFallback />}>
|
||||
<Configuration />
|
||||
</Suspense>
|
||||
</ErrorBoundary>
|
||||
<Suspense fallback={<div>Loading...</div>}>
|
||||
<Configuration />
|
||||
</Suspense>
|
||||
} />
|
||||
<Route path="error-handling" element={
|
||||
<ErrorBoundary>
|
||||
<Suspense fallback={<LoadingFallback />}>
|
||||
<ErrorHandling />
|
||||
</Suspense>
|
||||
</ErrorBoundary>
|
||||
<Suspense fallback={<div>Loading...</div>}>
|
||||
<ErrorHandling />
|
||||
</Suspense>
|
||||
} />
|
||||
<Route path="type-inference" element={
|
||||
<ErrorBoundary>
|
||||
<Suspense fallback={<LoadingFallback />}>
|
||||
<TypeInference />
|
||||
</Suspense>
|
||||
</ErrorBoundary>
|
||||
<Suspense fallback={<div>Loading...</div>}>
|
||||
<TypeInference />
|
||||
</Suspense>
|
||||
} />
|
||||
<Route path="caching" element={
|
||||
<ErrorBoundary>
|
||||
<Suspense fallback={<LoadingFallback />}>
|
||||
<Caching />
|
||||
</Suspense>
|
||||
</ErrorBoundary>
|
||||
<Suspense fallback={<div>Loading...</div>}>
|
||||
<Caching />
|
||||
</Suspense>
|
||||
} />
|
||||
<Route path="interceptors" element={
|
||||
<ErrorBoundary>
|
||||
<Suspense fallback={<LoadingFallback />}>
|
||||
<Interceptors />
|
||||
</Suspense>
|
||||
</ErrorBoundary>
|
||||
<Suspense fallback={<div>Loading...</div>}>
|
||||
<Interceptors />
|
||||
</Suspense>
|
||||
} />
|
||||
<Route path="ai-ml-use-cases" element={
|
||||
<ErrorBoundary>
|
||||
<Suspense fallback={<LoadingFallback />}>
|
||||
<AIMLUseCases />
|
||||
</Suspense>
|
||||
</ErrorBoundary>
|
||||
<Suspense fallback={<div>Loading...</div>}>
|
||||
<AIMLUseCases />
|
||||
</Suspense>
|
||||
} />
|
||||
<Route path="axios-comparison" element={
|
||||
<ErrorBoundary>
|
||||
<Suspense fallback={<LoadingFallback />}>
|
||||
<AxiosComparison />
|
||||
</Suspense>
|
||||
</ErrorBoundary>
|
||||
<Suspense fallback={<div>Loading...</div>}>
|
||||
<AxiosComparison />
|
||||
</Suspense>
|
||||
} />
|
||||
<Route path="api-reference" element={
|
||||
<ErrorBoundary>
|
||||
<Suspense fallback={<LoadingFallback />}>
|
||||
<APIReference />
|
||||
</Suspense>
|
||||
</ErrorBoundary>
|
||||
<Suspense fallback={<div>Loading...</div>}>
|
||||
<APIReference />
|
||||
</Suspense>
|
||||
} />
|
||||
</Route>
|
||||
</Routes>
|
||||
|
|
|
|||
Loading…
Reference in a new issue