create-starbase 5.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +94 -0
- package/dist/index.d.ts +2 -0
- package/package.json +54 -0
- package/template/.claude/commands/audit.md +14 -0
- package/template/.claude/commands/review.md +23 -0
- package/template/.editorconfig +14 -0
- package/template/.env +1 -0
- package/template/.env.example +1 -0
- package/template/.nvmrc +1 -0
- package/template/.prettierignore +12 -0
- package/template/.prettierrc.json +7 -0
- package/template/.vscode/extensions.json +8 -0
- package/template/.vscode/settings.json +48 -0
- package/template/CLAUDE.md +109 -0
- package/template/README.md +46 -0
- package/template/eslint.config.js +27 -0
- package/template/index.html +47 -0
- package/template/package.json +51 -0
- package/template/src/lib/queries/github.ts +13 -0
- package/template/src/lib/queries/index.ts +1 -0
- package/template/src/lib/theme/app.css +3 -0
- package/template/src/lib/theme/base.css +37 -0
- package/template/src/lib/theme/tailwind.css +167 -0
- package/template/src/lib/utils/cn.ts +16 -0
- package/template/src/lib/utils/darkMode.ts +44 -0
- package/template/src/lib/utils/index.ts +2 -0
- package/template/src/main.tsx +38 -0
- package/template/src/routeTree.gen.ts +77 -0
- package/template/src/routes/__root.tsx +49 -0
- package/template/src/routes/index.tsx +29 -0
- package/template/src/routes/liftoff.tsx +22 -0
- package/template/src/ui/atoms/Button.tsx +106 -0
- package/template/src/ui/atoms/Code.tsx +52 -0
- package/template/src/ui/atoms/Link.tsx +78 -0
- package/template/src/ui/atoms/StarbaseLogo.tsx +19 -0
- package/template/src/ui/molecules/DarkModeToggle.tsx +29 -0
- package/template/src/ui/molecules/PageHeader.tsx +35 -0
- package/template/src/ui/molecules/Stargazers.tsx +24 -0
- package/template/src/ui/organisms/.gitkeep +0 -0
- package/template/src/ui/templates/.gitkeep +0 -0
- package/template/tsconfig.app.json +39 -0
- package/template/tsconfig.json +7 -0
- package/template/tsconfig.node.json +26 -0
- package/template/vite.config.ts +27 -0
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import type { SVGProps } from 'react';
|
|
2
|
+
import { cn } from 'utils';
|
|
3
|
+
|
|
4
|
+
export function StarbaseLogo({ className, ...props }: SVGProps<SVGSVGElement>) {
|
|
5
|
+
return (
|
|
6
|
+
<svg
|
|
7
|
+
xmlns="http://www.w3.org/2000/svg"
|
|
8
|
+
viewBox="0 0 576 512"
|
|
9
|
+
aria-hidden="true"
|
|
10
|
+
className={cn('fill-red-500 stroke-black', className)}
|
|
11
|
+
{...props}
|
|
12
|
+
>
|
|
13
|
+
<path
|
|
14
|
+
strokeWidth={30}
|
|
15
|
+
d="M316.9 18C311.6 7 300.4 0 288.1 0s-23.4 7-28.8 18L195 150.3 51.4 171.5c-12 1.8-22 10.2-25.7 21.7s-.7 24.2 7.9 32.7L137.8 329 113.2 474.7c-2 12 3 24.2 12.9 31.3s23 8 33.8 2.3l128.3-68.5 128.3 68.5c10.8 5.7 23.9 4.9 33.8-2.3s14.9-19.3 12.9-31.3L438.5 329 542.7 225.9c8.6-8.5 11.7-21.2 7.9-32.7s-13.7-19.9-25.7-21.7L381.2 150.3 316.9 18z"
|
|
16
|
+
/>
|
|
17
|
+
</svg>
|
|
18
|
+
);
|
|
19
|
+
}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { useCallback, useState } from 'react';
|
|
2
|
+
import { LuMoon, LuSun } from 'react-icons/lu';
|
|
3
|
+
import { Button } from 'atoms/Button';
|
|
4
|
+
import { darkMode } from 'utils';
|
|
5
|
+
|
|
6
|
+
export function DarkModeToggle() {
|
|
7
|
+
const [isDark, setIsDark] = useState(
|
|
8
|
+
() => darkMode.getEffectiveTheme(darkMode.getThemePreference()) === 'dark',
|
|
9
|
+
);
|
|
10
|
+
|
|
11
|
+
const toggle = useCallback(() => {
|
|
12
|
+
const next = isDark ? 'light' : 'dark';
|
|
13
|
+
darkMode.setThemePreference(next);
|
|
14
|
+
darkMode.applyTheme(next);
|
|
15
|
+
setIsDark(next === 'dark');
|
|
16
|
+
}, [isDark]);
|
|
17
|
+
|
|
18
|
+
return (
|
|
19
|
+
<Button
|
|
20
|
+
variant="ghost"
|
|
21
|
+
iconOnly
|
|
22
|
+
size="sm"
|
|
23
|
+
onClick={toggle}
|
|
24
|
+
aria-label={isDark ? 'Switch to light mode' : 'Switch to dark mode'}
|
|
25
|
+
>
|
|
26
|
+
{isDark ? <LuSun size={16} /> : <LuMoon size={16} />}
|
|
27
|
+
</Button>
|
|
28
|
+
);
|
|
29
|
+
}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import { motion, useReducedMotion } from 'motion/react';
|
|
2
|
+
import { useLocation } from '@tanstack/react-router';
|
|
3
|
+
import { StarbaseLogo } from 'atoms/StarbaseLogo';
|
|
4
|
+
|
|
5
|
+
interface PageHeaderProps {
|
|
6
|
+
title: string;
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
export function PageHeader({ title }: PageHeaderProps) {
|
|
10
|
+
const { pathname } = useLocation();
|
|
11
|
+
const prefersReducedMotion = useReducedMotion();
|
|
12
|
+
|
|
13
|
+
return (
|
|
14
|
+
<header className="flex flex-col items-center gap-4">
|
|
15
|
+
<motion.div
|
|
16
|
+
key={pathname}
|
|
17
|
+
initial={prefersReducedMotion ? false : { y: -20, rotate: 12 }}
|
|
18
|
+
animate={{ y: 0, rotate: [16, 8, 14, 10, 12] }}
|
|
19
|
+
transition={
|
|
20
|
+
prefersReducedMotion
|
|
21
|
+
? { duration: 0 }
|
|
22
|
+
: { duration: 0.5, ease: 'easeOut' }
|
|
23
|
+
}
|
|
24
|
+
whileHover={
|
|
25
|
+
prefersReducedMotion
|
|
26
|
+
? undefined
|
|
27
|
+
: { rotate: [12, 4, 20, 6, 18, 9, 15, 12] }
|
|
28
|
+
}
|
|
29
|
+
>
|
|
30
|
+
<StarbaseLogo className="size-12" />
|
|
31
|
+
</motion.div>
|
|
32
|
+
<h1 className="text-sb-fg-title">{title}</h1>
|
|
33
|
+
</header>
|
|
34
|
+
);
|
|
35
|
+
}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { useQuery } from '@tanstack/react-query';
|
|
2
|
+
import { github } from 'queries';
|
|
3
|
+
import { Link } from 'atoms/Link';
|
|
4
|
+
|
|
5
|
+
export function Stargazers() {
|
|
6
|
+
const { data } = useQuery({
|
|
7
|
+
...github.starbaseRepoQueryOptions(),
|
|
8
|
+
retry: false,
|
|
9
|
+
});
|
|
10
|
+
|
|
11
|
+
return (
|
|
12
|
+
<Link
|
|
13
|
+
href="https://github.com/bstaruk/starbase"
|
|
14
|
+
target="_blank"
|
|
15
|
+
rel="noopener noreferrer"
|
|
16
|
+
variant="fg-subtle"
|
|
17
|
+
>
|
|
18
|
+
{data
|
|
19
|
+
? `${data.stargazers_count.toLocaleString()} stargazers on GitHub`
|
|
20
|
+
: 'find us on GitHub'}
|
|
21
|
+
<span className="sr-only"> (opens in new tab)</span>
|
|
22
|
+
</Link>
|
|
23
|
+
);
|
|
24
|
+
}
|
|
File without changes
|
|
File without changes
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
{
|
|
2
|
+
"compilerOptions": {
|
|
3
|
+
"tsBuildInfoFile": "./node_modules/.tmp/tsconfig.app.tsbuildinfo",
|
|
4
|
+
"target": "ES2022",
|
|
5
|
+
"useDefineForClassFields": true,
|
|
6
|
+
"lib": ["ES2022", "DOM", "DOM.Iterable"],
|
|
7
|
+
"module": "ESNext",
|
|
8
|
+
"types": ["vite/client"],
|
|
9
|
+
"skipLibCheck": true,
|
|
10
|
+
|
|
11
|
+
/* Bundler mode */
|
|
12
|
+
"moduleResolution": "bundler",
|
|
13
|
+
"allowImportingTsExtensions": true,
|
|
14
|
+
"verbatimModuleSyntax": true,
|
|
15
|
+
"moduleDetection": "force",
|
|
16
|
+
"noEmit": true,
|
|
17
|
+
"jsx": "react-jsx",
|
|
18
|
+
|
|
19
|
+
/* Linting */
|
|
20
|
+
"strict": true,
|
|
21
|
+
"noUnusedLocals": true,
|
|
22
|
+
"noUnusedParameters": true,
|
|
23
|
+
"erasableSyntaxOnly": true,
|
|
24
|
+
"noFallthroughCasesInSwitch": true,
|
|
25
|
+
"noUncheckedSideEffectImports": true,
|
|
26
|
+
|
|
27
|
+
/* Path Aliases */
|
|
28
|
+
"baseUrl": ".",
|
|
29
|
+
"paths": {
|
|
30
|
+
"queries": ["src/lib/queries/index.ts"],
|
|
31
|
+
"utils": ["src/lib/utils/index.ts"],
|
|
32
|
+
"atoms/*": ["src/ui/atoms/*"],
|
|
33
|
+
"molecules/*": ["src/ui/molecules/*"],
|
|
34
|
+
"organisms/*": ["src/ui/organisms/*"],
|
|
35
|
+
"templates/*": ["src/ui/templates/*"]
|
|
36
|
+
}
|
|
37
|
+
},
|
|
38
|
+
"include": ["src"]
|
|
39
|
+
}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
{
|
|
2
|
+
"compilerOptions": {
|
|
3
|
+
"tsBuildInfoFile": "./node_modules/.tmp/tsconfig.node.tsbuildinfo",
|
|
4
|
+
"target": "ES2023",
|
|
5
|
+
"lib": ["ES2023"],
|
|
6
|
+
"module": "ESNext",
|
|
7
|
+
"types": ["node"],
|
|
8
|
+
"skipLibCheck": true,
|
|
9
|
+
|
|
10
|
+
/* Bundler mode */
|
|
11
|
+
"moduleResolution": "bundler",
|
|
12
|
+
"allowImportingTsExtensions": true,
|
|
13
|
+
"verbatimModuleSyntax": true,
|
|
14
|
+
"moduleDetection": "force",
|
|
15
|
+
"noEmit": true,
|
|
16
|
+
|
|
17
|
+
/* Linting */
|
|
18
|
+
"strict": true,
|
|
19
|
+
"noUnusedLocals": true,
|
|
20
|
+
"noUnusedParameters": true,
|
|
21
|
+
"erasableSyntaxOnly": true,
|
|
22
|
+
"noFallthroughCasesInSwitch": true,
|
|
23
|
+
"noUncheckedSideEffectImports": true
|
|
24
|
+
},
|
|
25
|
+
"include": ["vite.config.ts"]
|
|
26
|
+
}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import path from 'path';
|
|
2
|
+
import { defineConfig } from 'vite';
|
|
3
|
+
import { tanstackRouter } from '@tanstack/router-plugin/vite';
|
|
4
|
+
import react from '@vitejs/plugin-react';
|
|
5
|
+
import tailwindcss from '@tailwindcss/vite';
|
|
6
|
+
|
|
7
|
+
// https://vite.dev/config/
|
|
8
|
+
export default defineConfig({
|
|
9
|
+
plugins: [
|
|
10
|
+
tanstackRouter({ target: 'react', autoCodeSplitting: true }),
|
|
11
|
+
react(),
|
|
12
|
+
tailwindcss(),
|
|
13
|
+
],
|
|
14
|
+
resolve: {
|
|
15
|
+
alias: {
|
|
16
|
+
queries: path.resolve(__dirname, 'src/lib/queries'),
|
|
17
|
+
utils: path.resolve(__dirname, 'src/lib/utils'),
|
|
18
|
+
atoms: path.resolve(__dirname, 'src/ui/atoms'),
|
|
19
|
+
molecules: path.resolve(__dirname, 'src/ui/molecules'),
|
|
20
|
+
organisms: path.resolve(__dirname, 'src/ui/organisms'),
|
|
21
|
+
templates: path.resolve(__dirname, 'src/ui/templates'),
|
|
22
|
+
},
|
|
23
|
+
},
|
|
24
|
+
server: {
|
|
25
|
+
port: 3000,
|
|
26
|
+
},
|
|
27
|
+
});
|