virastack 0.0.1 → 1.0.1
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/LICENSE +1 -1
- package/README.md +94 -18
- package/bin/virastack.js +7 -0
- package/package.json +43 -9
- package/src/commands/add.js +64 -0
- package/src/commands/init.js +286 -0
- package/src/i18n.js +231 -0
- package/src/index.js +64 -0
- package/src/utils/args.js +60 -0
- package/src/utils/copy-template.js +81 -0
- package/src/utils/exec.js +29 -0
- package/src/utils/git.js +38 -0
- package/src/utils/is-online.js +14 -0
- package/src/utils/package-info.js +12 -0
- package/src/utils/package-manager.js +33 -0
- package/src/utils/setup-env.js +25 -0
- package/src/utils/telemetry.js +86 -0
- package/src/utils/tools.js +48 -0
- package/src/utils/update-package-json.js +44 -0
- package/src/utils/update-readme.js +25 -0
- package/src/utils/validate-project-name.js +26 -0
- package/templates/nextjs/.changeset/README.md +8 -0
- package/templates/nextjs/.changeset/config.json +11 -0
- package/templates/nextjs/.env.example +6 -0
- package/templates/nextjs/.env.local +6 -0
- package/templates/nextjs/.eslintcache +1 -0
- package/templates/nextjs/.github/workflows/ci.yml +41 -0
- package/templates/nextjs/.husky/commit-msg +1 -0
- package/templates/nextjs/.husky/pre-commit +1 -0
- package/templates/nextjs/.husky/pre-push +1 -0
- package/templates/nextjs/.prettierignore +6 -0
- package/templates/nextjs/.prettierrc +42 -0
- package/templates/nextjs/.vscode/extensions.json +7 -0
- package/templates/nextjs/.vscode/settings.json +20 -0
- package/templates/nextjs/LICENSE +21 -0
- package/templates/nextjs/README.md +202 -0
- package/templates/nextjs/_gitignore +45 -0
- package/templates/nextjs/commitlint.config.js +6 -0
- package/templates/nextjs/eslint.config.mjs +27 -0
- package/templates/nextjs/knip.config.js +25 -0
- package/templates/nextjs/next-env.d.ts +6 -0
- package/templates/nextjs/next.config.ts +39 -0
- package/templates/nextjs/package.json +115 -0
- package/templates/nextjs/pnpm-lock.yaml +6467 -0
- package/templates/nextjs/pnpm-workspace.yaml +3 -0
- package/templates/nextjs/postcss.config.mjs +7 -0
- package/templates/nextjs/public/favicon.ico +0 -0
- package/templates/nextjs/public/llms.txt +96 -0
- package/templates/nextjs/public/logo.png +0 -0
- package/templates/nextjs/public/logo.webp +0 -0
- package/templates/nextjs/public/og.png +0 -0
- package/templates/nextjs/src/app/error.tsx +34 -0
- package/templates/nextjs/src/app/favicon.ico +0 -0
- package/templates/nextjs/src/app/global-error.tsx +32 -0
- package/templates/nextjs/src/app/layout.tsx +37 -0
- package/templates/nextjs/src/app/loading.tsx +12 -0
- package/templates/nextjs/src/app/manifest.ts +22 -0
- package/templates/nextjs/src/app/not-found.tsx +18 -0
- package/templates/nextjs/src/app/page.tsx +5 -0
- package/templates/nextjs/src/app/robots.ts +13 -0
- package/templates/nextjs/src/app/sitemap.ts +14 -0
- package/templates/nextjs/src/components/shared/ThemeToggle.tsx +30 -0
- package/templates/nextjs/src/components/ui/avatar.tsx +54 -0
- package/templates/nextjs/src/components/ui/button.tsx +46 -0
- package/templates/nextjs/src/components/ui/dialog.tsx +107 -0
- package/templates/nextjs/src/components/ui/field.tsx +24 -0
- package/templates/nextjs/src/components/ui/index.ts +27 -0
- package/templates/nextjs/src/components/ui/input.tsx +23 -0
- package/templates/nextjs/src/components/ui/label.tsx +17 -0
- package/templates/nextjs/src/components/ui/skeleton.tsx +13 -0
- package/templates/nextjs/src/components/ui/table.tsx +94 -0
- package/templates/nextjs/src/components/ui/tabs.tsx +46 -0
- package/templates/nextjs/src/config/seo.config.ts +37 -0
- package/templates/nextjs/src/config/site.config.ts +15 -0
- package/templates/nextjs/src/constants/index.ts +5 -0
- package/templates/nextjs/src/env.ts +41 -0
- package/templates/nextjs/src/features/landing/api/get-users.api.ts +7 -0
- package/templates/nextjs/src/features/landing/api/index.ts +2 -0
- package/templates/nextjs/src/features/landing/api/query-keys.ts +7 -0
- package/templates/nextjs/src/features/landing/components/CartDemo.tsx +66 -0
- package/templates/nextjs/src/features/landing/components/Features.tsx +39 -0
- package/templates/nextjs/src/features/landing/components/Hero.tsx +65 -0
- package/templates/nextjs/src/features/landing/components/LandingPage.tsx +17 -0
- package/templates/nextjs/src/features/landing/components/ProjectFormDemo.tsx +62 -0
- package/templates/nextjs/src/features/landing/components/Reveal.tsx +83 -0
- package/templates/nextjs/src/features/landing/components/Showcase.tsx +66 -0
- package/templates/nextjs/src/features/landing/components/UsersDemo.tsx +188 -0
- package/templates/nextjs/src/features/landing/data/features.data.tsx +47 -0
- package/templates/nextjs/src/features/landing/data/index.ts +1 -0
- package/templates/nextjs/src/features/landing/helpers/get-initials.ts +15 -0
- package/templates/nextjs/src/features/landing/helpers/index.ts +7 -0
- package/templates/nextjs/src/features/landing/helpers/motion.ts +21 -0
- package/templates/nextjs/src/features/landing/hooks/index.ts +1 -0
- package/templates/nextjs/src/features/landing/hooks/use-users.ts +16 -0
- package/templates/nextjs/src/features/landing/icons/index.ts +6 -0
- package/templates/nextjs/src/features/landing/icons/nextjs.tsx +68 -0
- package/templates/nextjs/src/features/landing/icons/react-hook-form.tsx +18 -0
- package/templates/nextjs/src/features/landing/icons/react.tsx +20 -0
- package/templates/nextjs/src/features/landing/icons/tailwind.tsx +14 -0
- package/templates/nextjs/src/features/landing/icons/tanstack.tsx +321 -0
- package/templates/nextjs/src/features/landing/icons/typescript.tsx +16 -0
- package/templates/nextjs/src/features/landing/index.ts +1 -0
- package/templates/nextjs/src/features/landing/schemas/index.ts +1 -0
- package/templates/nextjs/src/features/landing/schemas/project.schema.ts +7 -0
- package/templates/nextjs/src/features/landing/stores/counter.store.ts +18 -0
- package/templates/nextjs/src/features/landing/stores/index.ts +1 -0
- package/templates/nextjs/src/features/landing/types/index.ts +1 -0
- package/templates/nextjs/src/features/landing/types/user.types.ts +9 -0
- package/templates/nextjs/src/helpers/format-date.ts +13 -0
- package/templates/nextjs/src/helpers/index.ts +1 -0
- package/templates/nextjs/src/hooks/index.ts +5 -0
- package/templates/nextjs/src/lib/api.ts +97 -0
- package/templates/nextjs/src/lib/query-client.ts +18 -0
- package/templates/nextjs/src/lib/utils.ts +12 -0
- package/templates/nextjs/src/providers/Providers.tsx +15 -0
- package/templates/nextjs/src/providers/QueryProvider.tsx +19 -0
- package/templates/nextjs/src/providers/ThemeProvider.tsx +9 -0
- package/templates/nextjs/src/providers/index.ts +1 -0
- package/templates/nextjs/src/proxy.ts +6 -0
- package/templates/nextjs/src/schemas/index.ts +5 -0
- package/templates/nextjs/src/stores/index.ts +5 -0
- package/templates/nextjs/src/styles/tailwind.css +122 -0
- package/templates/nextjs/src/types/site-config.types.ts +10 -0
- package/templates/nextjs/tsconfig.json +45 -0
- package/templates/nextjs/tsconfig.tsbuildinfo +1 -0
- package/templates/tanstack/.changeset/README.md +8 -0
- package/templates/tanstack/.changeset/config.json +11 -0
- package/templates/tanstack/.env.example +6 -0
- package/templates/tanstack/.env.local +6 -0
- package/templates/tanstack/.eslintcache +1 -0
- package/templates/tanstack/.github/workflows/ci.yml +41 -0
- package/templates/tanstack/.husky/commit-msg +1 -0
- package/templates/tanstack/.husky/pre-commit +1 -0
- package/templates/tanstack/.husky/pre-push +1 -0
- package/templates/tanstack/.prettierignore +7 -0
- package/templates/tanstack/.prettierrc +41 -0
- package/templates/tanstack/.vscode/extensions.json +7 -0
- package/templates/tanstack/.vscode/settings.json +22 -0
- package/templates/tanstack/LICENSE +21 -0
- package/templates/tanstack/README.md +204 -0
- package/templates/tanstack/_gitignore +52 -0
- package/templates/tanstack/commitlint.config.js +6 -0
- package/templates/tanstack/eslint.config.js +28 -0
- package/templates/tanstack/knip.config.js +22 -0
- package/templates/tanstack/package.json +130 -0
- package/templates/tanstack/pnpm-lock.yaml +5835 -0
- package/templates/tanstack/pnpm-workspace.yaml +3 -0
- package/templates/tanstack/public/favicon.ico +0 -0
- package/templates/tanstack/public/llms.txt +86 -0
- package/templates/tanstack/public/logo.png +0 -0
- package/templates/tanstack/public/logo.webp +0 -0
- package/templates/tanstack/public/og.png +0 -0
- package/templates/tanstack/src/components/shared/DefaultCatchBoundary.tsx +36 -0
- package/templates/tanstack/src/components/shared/NotFound.tsx +18 -0
- package/templates/tanstack/src/components/shared/Pending.tsx +13 -0
- package/templates/tanstack/src/components/shared/ThemeToggle.tsx +31 -0
- package/templates/tanstack/src/components/ui/avatar.tsx +52 -0
- package/templates/tanstack/src/components/ui/button.tsx +47 -0
- package/templates/tanstack/src/components/ui/dialog.tsx +107 -0
- package/templates/tanstack/src/components/ui/field.tsx +24 -0
- package/templates/tanstack/src/components/ui/index.ts +27 -0
- package/templates/tanstack/src/components/ui/input.tsx +23 -0
- package/templates/tanstack/src/components/ui/label.tsx +17 -0
- package/templates/tanstack/src/components/ui/skeleton.tsx +13 -0
- package/templates/tanstack/src/components/ui/table.tsx +94 -0
- package/templates/tanstack/src/components/ui/tabs.tsx +46 -0
- package/templates/tanstack/src/config/seo.config.ts +52 -0
- package/templates/tanstack/src/config/site.config.ts +15 -0
- package/templates/tanstack/src/constants/index.ts +5 -0
- package/templates/tanstack/src/env.ts +47 -0
- package/templates/tanstack/src/features/landing/api/get-users.api.ts +7 -0
- package/templates/tanstack/src/features/landing/api/index.ts +2 -0
- package/templates/tanstack/src/features/landing/api/query-keys.ts +7 -0
- package/templates/tanstack/src/features/landing/components/CartDemo.tsx +66 -0
- package/templates/tanstack/src/features/landing/components/Features.tsx +39 -0
- package/templates/tanstack/src/features/landing/components/Hero.tsx +63 -0
- package/templates/tanstack/src/features/landing/components/LandingPage.tsx +17 -0
- package/templates/tanstack/src/features/landing/components/ProjectFormDemo.tsx +63 -0
- package/templates/tanstack/src/features/landing/components/Reveal.tsx +83 -0
- package/templates/tanstack/src/features/landing/components/Showcase.tsx +66 -0
- package/templates/tanstack/src/features/landing/components/UsersDemo.tsx +191 -0
- package/templates/tanstack/src/features/landing/data/features.data.tsx +45 -0
- package/templates/tanstack/src/features/landing/data/index.ts +1 -0
- package/templates/tanstack/src/features/landing/helpers/get-initials.ts +15 -0
- package/templates/tanstack/src/features/landing/helpers/index.ts +7 -0
- package/templates/tanstack/src/features/landing/helpers/motion.ts +21 -0
- package/templates/tanstack/src/features/landing/hooks/index.ts +1 -0
- package/templates/tanstack/src/features/landing/hooks/use-users.ts +19 -0
- package/templates/tanstack/src/features/landing/icons/index.ts +5 -0
- package/templates/tanstack/src/features/landing/icons/react-hook-form.tsx +18 -0
- package/templates/tanstack/src/features/landing/icons/react.tsx +20 -0
- package/templates/tanstack/src/features/landing/icons/tailwind.tsx +14 -0
- package/templates/tanstack/src/features/landing/icons/tanstack.tsx +321 -0
- package/templates/tanstack/src/features/landing/icons/typescript.tsx +16 -0
- package/templates/tanstack/src/features/landing/index.ts +1 -0
- package/templates/tanstack/src/features/landing/schemas/index.ts +1 -0
- package/templates/tanstack/src/features/landing/schemas/project.schema.ts +7 -0
- package/templates/tanstack/src/features/landing/stores/counter.store.ts +18 -0
- package/templates/tanstack/src/features/landing/stores/index.ts +1 -0
- package/templates/tanstack/src/features/landing/types/index.ts +1 -0
- package/templates/tanstack/src/features/landing/types/user.types.ts +9 -0
- package/templates/tanstack/src/helpers/format-date.ts +13 -0
- package/templates/tanstack/src/helpers/index.ts +1 -0
- package/templates/tanstack/src/hooks/index.ts +5 -0
- package/templates/tanstack/src/lib/api.ts +97 -0
- package/templates/tanstack/src/lib/query-client.ts +18 -0
- package/templates/tanstack/src/lib/utils.ts +13 -0
- package/templates/tanstack/src/providers/Providers.tsx +12 -0
- package/templates/tanstack/src/providers/ThemeProvider.tsx +98 -0
- package/templates/tanstack/src/providers/devtools.tsx +6 -0
- package/templates/tanstack/src/providers/index.ts +1 -0
- package/templates/tanstack/src/providers/root-provider.ts +9 -0
- package/templates/tanstack/src/routeTree.gen.ts +123 -0
- package/templates/tanstack/src/router.tsx +27 -0
- package/templates/tanstack/src/routes/__root.tsx +78 -0
- package/templates/tanstack/src/routes/index.tsx +13 -0
- package/templates/tanstack/src/routes/robots[.]txt.ts +21 -0
- package/templates/tanstack/src/routes/site[.]webmanifest.ts +32 -0
- package/templates/tanstack/src/routes/sitemap[.]xml.ts +27 -0
- package/templates/tanstack/src/schemas/index.ts +5 -0
- package/templates/tanstack/src/start.ts +20 -0
- package/templates/tanstack/src/stores/index.ts +5 -0
- package/templates/tanstack/src/styles/tailwind.css +123 -0
- package/templates/tanstack/src/types/site-config.types.ts +10 -0
- package/templates/tanstack/tsconfig.json +25 -0
- package/templates/tanstack/tsr.config.json +3 -0
- package/templates/tanstack/vite.config.ts +12 -0
- package/templates-i18n/nextjs/.changeset/README.md +8 -0
- package/templates-i18n/nextjs/.changeset/config.json +11 -0
- package/templates-i18n/nextjs/.env.example +6 -0
- package/templates-i18n/nextjs/.eslintcache +1 -0
- package/templates-i18n/nextjs/.github/workflows/ci.yml +41 -0
- package/templates-i18n/nextjs/.husky/commit-msg +1 -0
- package/templates-i18n/nextjs/.husky/pre-commit +1 -0
- package/templates-i18n/nextjs/.husky/pre-push +1 -0
- package/templates-i18n/nextjs/.prettierignore +6 -0
- package/templates-i18n/nextjs/.prettierrc +42 -0
- package/templates-i18n/nextjs/.vscode/extensions.json +7 -0
- package/templates-i18n/nextjs/.vscode/settings.json +20 -0
- package/templates-i18n/nextjs/LICENSE +21 -0
- package/templates-i18n/nextjs/README.md +202 -0
- package/templates-i18n/nextjs/_gitignore +45 -0
- package/templates-i18n/nextjs/commitlint.config.js +6 -0
- package/templates-i18n/nextjs/eslint.config.mjs +27 -0
- package/templates-i18n/nextjs/knip.config.js +29 -0
- package/templates-i18n/nextjs/next-env.d.ts +6 -0
- package/templates-i18n/nextjs/next.config.ts +42 -0
- package/templates-i18n/nextjs/package.json +117 -0
- package/templates-i18n/nextjs/pnpm-lock.yaml +6854 -0
- package/templates-i18n/nextjs/pnpm-workspace.yaml +3 -0
- package/templates-i18n/nextjs/postcss.config.mjs +7 -0
- package/templates-i18n/nextjs/public/favicon.ico +0 -0
- package/templates-i18n/nextjs/public/llms.txt +96 -0
- package/templates-i18n/nextjs/public/logo.png +0 -0
- package/templates-i18n/nextjs/public/logo.webp +0 -0
- package/templates-i18n/nextjs/public/og.png +0 -0
- package/templates-i18n/nextjs/src/app/[locale]/error.tsx +34 -0
- package/templates-i18n/nextjs/src/app/[locale]/layout.tsx +60 -0
- package/templates-i18n/nextjs/src/app/[locale]/loading.tsx +12 -0
- package/templates-i18n/nextjs/src/app/[locale]/not-found.tsx +18 -0
- package/templates-i18n/nextjs/src/app/[locale]/page.tsx +10 -0
- package/templates-i18n/nextjs/src/app/favicon.ico +0 -0
- package/templates-i18n/nextjs/src/app/global-error.tsx +32 -0
- package/templates-i18n/nextjs/src/app/manifest.ts +22 -0
- package/templates-i18n/nextjs/src/app/robots.ts +13 -0
- package/templates-i18n/nextjs/src/app/sitemap.ts +14 -0
- package/templates-i18n/nextjs/src/components/shared/LanguageSwitcher.tsx +48 -0
- package/templates-i18n/nextjs/src/components/shared/ThemeToggle.tsx +30 -0
- package/templates-i18n/nextjs/src/components/ui/avatar.tsx +54 -0
- package/templates-i18n/nextjs/src/components/ui/button.tsx +46 -0
- package/templates-i18n/nextjs/src/components/ui/dialog.tsx +107 -0
- package/templates-i18n/nextjs/src/components/ui/field.tsx +24 -0
- package/templates-i18n/nextjs/src/components/ui/index.ts +27 -0
- package/templates-i18n/nextjs/src/components/ui/input.tsx +23 -0
- package/templates-i18n/nextjs/src/components/ui/label.tsx +17 -0
- package/templates-i18n/nextjs/src/components/ui/skeleton.tsx +13 -0
- package/templates-i18n/nextjs/src/components/ui/table.tsx +94 -0
- package/templates-i18n/nextjs/src/components/ui/tabs.tsx +46 -0
- package/templates-i18n/nextjs/src/config/seo.config.ts +37 -0
- package/templates-i18n/nextjs/src/config/site.config.ts +15 -0
- package/templates-i18n/nextjs/src/constants/index.ts +5 -0
- package/templates-i18n/nextjs/src/env.ts +41 -0
- package/templates-i18n/nextjs/src/features/landing/api/get-users.api.ts +7 -0
- package/templates-i18n/nextjs/src/features/landing/api/index.ts +2 -0
- package/templates-i18n/nextjs/src/features/landing/api/query-keys.ts +7 -0
- package/templates-i18n/nextjs/src/features/landing/components/CartDemo.tsx +68 -0
- package/templates-i18n/nextjs/src/features/landing/components/Features.tsx +84 -0
- package/templates-i18n/nextjs/src/features/landing/components/Hero.tsx +76 -0
- package/templates-i18n/nextjs/src/features/landing/components/LandingPage.tsx +17 -0
- package/templates-i18n/nextjs/src/features/landing/components/ProjectFormDemo.tsx +64 -0
- package/templates-i18n/nextjs/src/features/landing/components/Reveal.tsx +83 -0
- package/templates-i18n/nextjs/src/features/landing/components/Showcase.tsx +83 -0
- package/templates-i18n/nextjs/src/features/landing/components/UsersDemo.tsx +191 -0
- package/templates-i18n/nextjs/src/features/landing/data/features.data.tsx +47 -0
- package/templates-i18n/nextjs/src/features/landing/data/index.ts +1 -0
- package/templates-i18n/nextjs/src/features/landing/helpers/get-initials.ts +15 -0
- package/templates-i18n/nextjs/src/features/landing/helpers/index.ts +7 -0
- package/templates-i18n/nextjs/src/features/landing/helpers/motion.ts +21 -0
- package/templates-i18n/nextjs/src/features/landing/hooks/index.ts +1 -0
- package/templates-i18n/nextjs/src/features/landing/hooks/use-users.ts +16 -0
- package/templates-i18n/nextjs/src/features/landing/icons/index.ts +6 -0
- package/templates-i18n/nextjs/src/features/landing/icons/nextjs.tsx +68 -0
- package/templates-i18n/nextjs/src/features/landing/icons/react-hook-form.tsx +18 -0
- package/templates-i18n/nextjs/src/features/landing/icons/react.tsx +20 -0
- package/templates-i18n/nextjs/src/features/landing/icons/tailwind.tsx +14 -0
- package/templates-i18n/nextjs/src/features/landing/icons/tanstack.tsx +321 -0
- package/templates-i18n/nextjs/src/features/landing/icons/typescript.tsx +16 -0
- package/templates-i18n/nextjs/src/features/landing/index.ts +1 -0
- package/templates-i18n/nextjs/src/features/landing/schemas/index.ts +1 -0
- package/templates-i18n/nextjs/src/features/landing/schemas/project.schema.ts +9 -0
- package/templates-i18n/nextjs/src/features/landing/stores/counter.store.ts +18 -0
- package/templates-i18n/nextjs/src/features/landing/stores/index.ts +1 -0
- package/templates-i18n/nextjs/src/features/landing/types/index.ts +1 -0
- package/templates-i18n/nextjs/src/features/landing/types/user.types.ts +9 -0
- package/templates-i18n/nextjs/src/helpers/format-date.ts +13 -0
- package/templates-i18n/nextjs/src/helpers/index.ts +1 -0
- package/templates-i18n/nextjs/src/hooks/index.ts +5 -0
- package/templates-i18n/nextjs/src/i18n/request.ts +16 -0
- package/templates-i18n/nextjs/src/i18n/routing.ts +11 -0
- package/templates-i18n/nextjs/src/lib/api.ts +97 -0
- package/templates-i18n/nextjs/src/lib/query-client.ts +18 -0
- package/templates-i18n/nextjs/src/lib/utils.ts +12 -0
- package/templates-i18n/nextjs/src/messages/en.json +55 -0
- package/templates-i18n/nextjs/src/messages/tr.json +55 -0
- package/templates-i18n/nextjs/src/providers/Providers.tsx +15 -0
- package/templates-i18n/nextjs/src/providers/QueryProvider.tsx +19 -0
- package/templates-i18n/nextjs/src/providers/ThemeProvider.tsx +9 -0
- package/templates-i18n/nextjs/src/providers/index.ts +1 -0
- package/templates-i18n/nextjs/src/proxy.ts +16 -0
- package/templates-i18n/nextjs/src/schemas/index.ts +5 -0
- package/templates-i18n/nextjs/src/stores/index.ts +5 -0
- package/templates-i18n/nextjs/src/styles/tailwind.css +122 -0
- package/templates-i18n/nextjs/src/types/site-config.types.ts +10 -0
- package/templates-i18n/nextjs/tsconfig.json +45 -0
- package/templates-i18n/nextjs/tsconfig.tsbuildinfo +1 -0
- package/templates-i18n/tanstack/.changeset/README.md +8 -0
- package/templates-i18n/tanstack/.changeset/config.json +11 -0
- package/templates-i18n/tanstack/.env.example +6 -0
- package/templates-i18n/tanstack/.eslintcache +1 -0
- package/templates-i18n/tanstack/.github/workflows/ci.yml +41 -0
- package/templates-i18n/tanstack/.husky/commit-msg +1 -0
- package/templates-i18n/tanstack/.husky/pre-commit +1 -0
- package/templates-i18n/tanstack/.husky/pre-push +1 -0
- package/templates-i18n/tanstack/.prettierignore +7 -0
- package/templates-i18n/tanstack/.prettierrc +41 -0
- package/templates-i18n/tanstack/.vscode/extensions.json +7 -0
- package/templates-i18n/tanstack/.vscode/settings.json +22 -0
- package/templates-i18n/tanstack/LICENSE +21 -0
- package/templates-i18n/tanstack/README.md +204 -0
- package/templates-i18n/tanstack/_gitignore +52 -0
- package/templates-i18n/tanstack/commitlint.config.js +6 -0
- package/templates-i18n/tanstack/eslint.config.js +29 -0
- package/templates-i18n/tanstack/knip.config.js +26 -0
- package/templates-i18n/tanstack/messages/en.json +65 -0
- package/templates-i18n/tanstack/messages/tr.json +65 -0
- package/templates-i18n/tanstack/package.json +132 -0
- package/templates-i18n/tanstack/pnpm-lock.yaml +5998 -0
- package/templates-i18n/tanstack/pnpm-workspace.yaml +3 -0
- package/templates-i18n/tanstack/project.inlang/README.md +157 -0
- package/templates-i18n/tanstack/project.inlang/settings.json +9 -0
- package/templates-i18n/tanstack/public/favicon.ico +0 -0
- package/templates-i18n/tanstack/public/llms.txt +86 -0
- package/templates-i18n/tanstack/public/logo.png +0 -0
- package/templates-i18n/tanstack/public/logo.webp +0 -0
- package/templates-i18n/tanstack/public/og.png +0 -0
- package/templates-i18n/tanstack/src/components/shared/DefaultCatchBoundary.tsx +36 -0
- package/templates-i18n/tanstack/src/components/shared/LanguageSwitcher.tsx +57 -0
- package/templates-i18n/tanstack/src/components/shared/NotFound.tsx +18 -0
- package/templates-i18n/tanstack/src/components/shared/Pending.tsx +13 -0
- package/templates-i18n/tanstack/src/components/shared/ThemeToggle.tsx +31 -0
- package/templates-i18n/tanstack/src/components/ui/avatar.tsx +52 -0
- package/templates-i18n/tanstack/src/components/ui/button.tsx +47 -0
- package/templates-i18n/tanstack/src/components/ui/dialog.tsx +107 -0
- package/templates-i18n/tanstack/src/components/ui/field.tsx +24 -0
- package/templates-i18n/tanstack/src/components/ui/index.ts +27 -0
- package/templates-i18n/tanstack/src/components/ui/input.tsx +23 -0
- package/templates-i18n/tanstack/src/components/ui/label.tsx +17 -0
- package/templates-i18n/tanstack/src/components/ui/skeleton.tsx +13 -0
- package/templates-i18n/tanstack/src/components/ui/table.tsx +94 -0
- package/templates-i18n/tanstack/src/components/ui/tabs.tsx +46 -0
- package/templates-i18n/tanstack/src/config/seo.config.ts +52 -0
- package/templates-i18n/tanstack/src/config/site.config.ts +15 -0
- package/templates-i18n/tanstack/src/constants/index.ts +5 -0
- package/templates-i18n/tanstack/src/env.ts +47 -0
- package/templates-i18n/tanstack/src/features/landing/api/get-users.api.ts +7 -0
- package/templates-i18n/tanstack/src/features/landing/api/index.ts +2 -0
- package/templates-i18n/tanstack/src/features/landing/api/query-keys.ts +7 -0
- package/templates-i18n/tanstack/src/features/landing/components/CartDemo.tsx +67 -0
- package/templates-i18n/tanstack/src/features/landing/components/Features.tsx +79 -0
- package/templates-i18n/tanstack/src/features/landing/components/Hero.tsx +68 -0
- package/templates-i18n/tanstack/src/features/landing/components/LandingPage.tsx +17 -0
- package/templates-i18n/tanstack/src/features/landing/components/ProjectFormDemo.tsx +64 -0
- package/templates-i18n/tanstack/src/features/landing/components/Reveal.tsx +83 -0
- package/templates-i18n/tanstack/src/features/landing/components/Showcase.tsx +81 -0
- package/templates-i18n/tanstack/src/features/landing/components/UsersDemo.tsx +191 -0
- package/templates-i18n/tanstack/src/features/landing/data/features.data.tsx +45 -0
- package/templates-i18n/tanstack/src/features/landing/data/index.ts +1 -0
- package/templates-i18n/tanstack/src/features/landing/helpers/get-initials.ts +15 -0
- package/templates-i18n/tanstack/src/features/landing/helpers/index.ts +7 -0
- package/templates-i18n/tanstack/src/features/landing/helpers/motion.ts +21 -0
- package/templates-i18n/tanstack/src/features/landing/hooks/index.ts +1 -0
- package/templates-i18n/tanstack/src/features/landing/hooks/use-users.ts +19 -0
- package/templates-i18n/tanstack/src/features/landing/icons/index.ts +5 -0
- package/templates-i18n/tanstack/src/features/landing/icons/react-hook-form.tsx +18 -0
- package/templates-i18n/tanstack/src/features/landing/icons/react.tsx +20 -0
- package/templates-i18n/tanstack/src/features/landing/icons/tailwind.tsx +14 -0
- package/templates-i18n/tanstack/src/features/landing/icons/tanstack.tsx +321 -0
- package/templates-i18n/tanstack/src/features/landing/icons/typescript.tsx +16 -0
- package/templates-i18n/tanstack/src/features/landing/index.ts +1 -0
- package/templates-i18n/tanstack/src/features/landing/schemas/index.ts +1 -0
- package/templates-i18n/tanstack/src/features/landing/schemas/project.schema.ts +10 -0
- package/templates-i18n/tanstack/src/features/landing/stores/counter.store.ts +18 -0
- package/templates-i18n/tanstack/src/features/landing/stores/index.ts +1 -0
- package/templates-i18n/tanstack/src/features/landing/types/index.ts +1 -0
- package/templates-i18n/tanstack/src/features/landing/types/user.types.ts +9 -0
- package/templates-i18n/tanstack/src/helpers/format-date.ts +13 -0
- package/templates-i18n/tanstack/src/helpers/index.ts +1 -0
- package/templates-i18n/tanstack/src/hooks/index.ts +5 -0
- package/templates-i18n/tanstack/src/lib/api.ts +97 -0
- package/templates-i18n/tanstack/src/lib/query-client.ts +18 -0
- package/templates-i18n/tanstack/src/lib/utils.ts +13 -0
- package/templates-i18n/tanstack/src/paraglide/README.md +162 -0
- package/templates-i18n/tanstack/src/providers/Providers.tsx +12 -0
- package/templates-i18n/tanstack/src/providers/ThemeProvider.tsx +98 -0
- package/templates-i18n/tanstack/src/providers/devtools.tsx +6 -0
- package/templates-i18n/tanstack/src/providers/index.ts +1 -0
- package/templates-i18n/tanstack/src/providers/root-provider.ts +9 -0
- package/templates-i18n/tanstack/src/routeTree.gen.ts +179 -0
- package/templates-i18n/tanstack/src/router.tsx +27 -0
- package/templates-i18n/tanstack/src/routes/$lang/index.tsx +13 -0
- package/templates-i18n/tanstack/src/routes/$lang.tsx +22 -0
- package/templates-i18n/tanstack/src/routes/__root.tsx +80 -0
- package/templates-i18n/tanstack/src/routes/index.tsx +13 -0
- package/templates-i18n/tanstack/src/routes/robots[.]txt.ts +21 -0
- package/templates-i18n/tanstack/src/routes/site[.]webmanifest.ts +32 -0
- package/templates-i18n/tanstack/src/routes/sitemap[.]xml.ts +27 -0
- package/templates-i18n/tanstack/src/schemas/index.ts +5 -0
- package/templates-i18n/tanstack/src/server.ts +10 -0
- package/templates-i18n/tanstack/src/start.ts +20 -0
- package/templates-i18n/tanstack/src/stores/index.ts +5 -0
- package/templates-i18n/tanstack/src/styles/tailwind.css +123 -0
- package/templates-i18n/tanstack/src/types/site-config.types.ts +10 -0
- package/templates-i18n/tanstack/tsconfig.json +26 -0
- package/templates-i18n/tanstack/tsr.config.json +3 -0
- package/templates-i18n/tanstack/vite.config.ts +31 -0
- package/index.js +0 -3
- package/public/start.jpg +0 -0
|
@@ -0,0 +1,162 @@
|
|
|
1
|
+
# Paraglide JS Compiled Output
|
|
2
|
+
|
|
3
|
+
> Auto-generated i18n message functions. Import `messages.js` to use translated strings.
|
|
4
|
+
|
|
5
|
+
Compiled from: `./project.inlang`
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
## What is this folder?
|
|
9
|
+
|
|
10
|
+
This folder contains compiled [Paraglide JS](https://github.com/opral/paraglide-js) output. Paraglide JS compiles your translation messages into tree-shakeable JavaScript functions.
|
|
11
|
+
|
|
12
|
+
## At a glance
|
|
13
|
+
|
|
14
|
+
Purpose:
|
|
15
|
+
- This folder stores compiled i18n message functions.
|
|
16
|
+
- Source translations live outside this folder in your inlang project.
|
|
17
|
+
|
|
18
|
+
Safe to import:
|
|
19
|
+
- `messages.js` — all message functions
|
|
20
|
+
- `runtime.js` — locale utilities
|
|
21
|
+
- `server.js` — server-side middleware
|
|
22
|
+
|
|
23
|
+
Do not edit:
|
|
24
|
+
- All files in this folder are auto-generated.
|
|
25
|
+
- Changes will be overwritten on next compilation.
|
|
26
|
+
|
|
27
|
+
```
|
|
28
|
+
paraglide/
|
|
29
|
+
├── messages.js # Message exports (import this)
|
|
30
|
+
├── messages/ # Individual message functions
|
|
31
|
+
├── runtime.js # Locale detection & configuration
|
|
32
|
+
├── registry.js # Formatting utilities (plural, number, datetime, relativetime)
|
|
33
|
+
├── server.js # Server-side middleware
|
|
34
|
+
└── .gitignore # Marks folder as generated
|
|
35
|
+
```
|
|
36
|
+
|
|
37
|
+
## Usage
|
|
38
|
+
|
|
39
|
+
```js
|
|
40
|
+
import * as m from "./paraglide/messages.js";
|
|
41
|
+
|
|
42
|
+
// Messages are functions that return localized strings
|
|
43
|
+
m.hello_world(); // "Hello, World!" (in current locale)
|
|
44
|
+
m.greeting({ name: "Sam" }); // "Hello, Sam!"
|
|
45
|
+
|
|
46
|
+
// Override locale per-call
|
|
47
|
+
m.hello_world({}, { locale: "de" }); // "Hallo, Welt!"
|
|
48
|
+
m.greeting({ name: "Sam" }, { locale: "de" }); // "Hallo, Sam!"
|
|
49
|
+
```
|
|
50
|
+
|
|
51
|
+
## Runtime API
|
|
52
|
+
|
|
53
|
+
```js
|
|
54
|
+
import { getLocale, getTextDirection, setLocale, locales, baseLocale } from "./paraglide/runtime.js";
|
|
55
|
+
|
|
56
|
+
getLocale(); // Current locale, e.g., "en"
|
|
57
|
+
getTextDirection(); // "ltr" | "rtl" for current locale
|
|
58
|
+
setLocale("de"); // Set locale
|
|
59
|
+
locales; // Available locales, e.g., ["en", "de", "fr"]
|
|
60
|
+
baseLocale; // Default locale, e.g., "en"
|
|
61
|
+
```
|
|
62
|
+
|
|
63
|
+
## Strategy
|
|
64
|
+
|
|
65
|
+
The strategy determines how the current locale is detected and persisted:
|
|
66
|
+
|
|
67
|
+
- **Cookie**: Stores locale preference in a cookie.
|
|
68
|
+
- **URL**: Derives locale from URL patterns (e.g., `/en/about`, `en.example.com`).
|
|
69
|
+
- **GlobalVariable**: Uses a global variable (client-side only).
|
|
70
|
+
- **BaseLocale**: Always returns the base locale.
|
|
71
|
+
|
|
72
|
+
Strategies can be combined. The order defines precedence:
|
|
73
|
+
|
|
74
|
+
```js
|
|
75
|
+
await compile({
|
|
76
|
+
project: "./project.inlang",
|
|
77
|
+
outdir: "./src/paraglide",
|
|
78
|
+
strategy: ["url", "cookie", "baseLocale"],
|
|
79
|
+
});
|
|
80
|
+
```
|
|
81
|
+
|
|
82
|
+
See the [strategy documentation](https://paraglidejs.com/strategy) for details.
|
|
83
|
+
|
|
84
|
+
## Markup (Rich Text)
|
|
85
|
+
|
|
86
|
+
Messages can contain markup tags for bold, links, and other inline elements. Translators control where tags appear; developers control how they render.
|
|
87
|
+
|
|
88
|
+
Important:
|
|
89
|
+
- Tag names are app-defined. There is no built-in list of HTML tags.
|
|
90
|
+
- `{#b}...{/b}` does not automatically render as `<b>...</b>`.
|
|
91
|
+
- Renderers/snippets are looked up by the same tag name used in the message.
|
|
92
|
+
|
|
93
|
+
### Message syntax
|
|
94
|
+
|
|
95
|
+
```json
|
|
96
|
+
{
|
|
97
|
+
"cta": "{#link to=|/docs| rel=$relationship @track}Read the docs{/link}",
|
|
98
|
+
"welcome": "{#b}Hi {name}{/b}{#icon/}"
|
|
99
|
+
}
|
|
100
|
+
```
|
|
101
|
+
|
|
102
|
+
- `{#tagName}` opens a tag, `{/tagName}` closes it.
|
|
103
|
+
- `{#tagName/}` creates a standalone tag.
|
|
104
|
+
- Options: `to=|/docs|` or `rel=$relationship` (accessed via `options.*`).
|
|
105
|
+
- Attributes: `@track` or `@variant=|hero|` (accessed via `attributes.*`).
|
|
106
|
+
|
|
107
|
+
This is the default inlang message syntax. Paraglide's message format is plugin-based — you can use [ICU MessageFormat 1](https://inlang.com/m/p7c8m1d2/plugin-inlang-icu-messageformat-1), [i18next](https://inlang.com/m/3i8bor92/plugin-inlang-i18next), or other [plugins](https://inlang.com/c/plugins) instead.
|
|
108
|
+
|
|
109
|
+
### Rendering markup
|
|
110
|
+
|
|
111
|
+
Calling the message function still returns **plain text** (markup stripped):
|
|
112
|
+
|
|
113
|
+
```js
|
|
114
|
+
m.cta({ relationship: "noopener" }); // "Read the docs"
|
|
115
|
+
```
|
|
116
|
+
|
|
117
|
+
To render markup, use the framework adapter or the low-level `parts()` API:
|
|
118
|
+
|
|
119
|
+
```js
|
|
120
|
+
const parts = m.cta.parts({ relationship: "noopener" });
|
|
121
|
+
// [
|
|
122
|
+
// { type: "markup-start", name: "link", options: { to: "/docs", rel: "noopener" }, attributes: { track: true } },
|
|
123
|
+
// { type: "text", value: "Read the docs" },
|
|
124
|
+
// { type: "markup-end", name: "link" }
|
|
125
|
+
// ]
|
|
126
|
+
```
|
|
127
|
+
|
|
128
|
+
Framework adapters provide a `<ParaglideMessage>` component that accepts markup renderers:
|
|
129
|
+
|
|
130
|
+
- `@inlang/paraglide-js-react`
|
|
131
|
+
- `@inlang/paraglide-js-vue`
|
|
132
|
+
- `@inlang/paraglide-js-svelte`
|
|
133
|
+
- `@inlang/paraglide-js-solid`
|
|
134
|
+
|
|
135
|
+
```jsx
|
|
136
|
+
import { ParaglideMessage } from "@inlang/paraglide-js-react"; // or -vue, -svelte, -solid
|
|
137
|
+
|
|
138
|
+
<ParaglideMessage
|
|
139
|
+
message={m.welcome}
|
|
140
|
+
inputs={{ name: "Ada" }}
|
|
141
|
+
markup={{
|
|
142
|
+
b: ({ children }) => <b>{children}</b>,
|
|
143
|
+
icon: () => <span aria-hidden="true" className="icon-wave" />,
|
|
144
|
+
}}
|
|
145
|
+
/>
|
|
146
|
+
```
|
|
147
|
+
|
|
148
|
+
The available renderer/snippet names come from the message itself. You can inspect them through `message.parts()`, and TypeScript uses the same names to type-check your markup renderers.
|
|
149
|
+
|
|
150
|
+
See the [markup documentation](https://paraglidejs.com/markup) for details.
|
|
151
|
+
|
|
152
|
+
## Key concepts
|
|
153
|
+
|
|
154
|
+
- **Tree-shakeable**: Each message is a function, enabling [up to 70% smaller i18n bundle sizes](https://paraglidejs.com/benchmark) than traditional i18n libraries.
|
|
155
|
+
- **Typesafe**: Full TypeScript/JSDoc support with autocomplete.
|
|
156
|
+
- **Variants**: Messages can have variants for pluralization, gender, etc.
|
|
157
|
+
- **Fallbacks**: Missing translations fall back to the base locale.
|
|
158
|
+
|
|
159
|
+
## Links
|
|
160
|
+
|
|
161
|
+
- [Paraglide JS Documentation](https://paraglidejs.com)
|
|
162
|
+
- [Source Repository](https://github.com/opral/paraglide-js)
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { Toaster } from "sonner";
|
|
2
|
+
|
|
3
|
+
import { ThemeProvider } from "@/providers/ThemeProvider";
|
|
4
|
+
|
|
5
|
+
export function Providers({ children }: { children: React.ReactNode }) {
|
|
6
|
+
return (
|
|
7
|
+
<ThemeProvider defaultTheme="system" storageKey="theme">
|
|
8
|
+
{children}
|
|
9
|
+
<Toaster richColors position="bottom-right" closeButton />
|
|
10
|
+
</ThemeProvider>
|
|
11
|
+
);
|
|
12
|
+
}
|
|
@@ -0,0 +1,98 @@
|
|
|
1
|
+
import { createContext, useContext, useEffect, useState } from "react";
|
|
2
|
+
import { ScriptOnce } from "@tanstack/react-router";
|
|
3
|
+
|
|
4
|
+
type Theme = "dark" | "light" | "system";
|
|
5
|
+
|
|
6
|
+
interface ThemeProviderProps {
|
|
7
|
+
children: React.ReactNode;
|
|
8
|
+
defaultTheme?: Theme;
|
|
9
|
+
storageKey?: string;
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
interface ThemeProviderState {
|
|
13
|
+
theme: Theme;
|
|
14
|
+
resolvedTheme: "dark" | "light";
|
|
15
|
+
setTheme: (theme: Theme) => void;
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
function getThemeScript(storageKey: string, defaultTheme: Theme) {
|
|
19
|
+
const key = JSON.stringify(storageKey);
|
|
20
|
+
const fallback = JSON.stringify(defaultTheme);
|
|
21
|
+
|
|
22
|
+
return `(function(){try{var t=localStorage.getItem(${key});if(t!=='light'&&t!=='dark'&&t!=='system'){t=${fallback}}var d=matchMedia('(prefers-color-scheme: dark)').matches;var r=t==='system'?(d?'dark':'light'):t;var e=document.documentElement;e.classList.add(r);e.style.colorScheme=r}catch(e){}})();`;
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
const ThemeProviderContext = createContext<ThemeProviderState | undefined>(undefined);
|
|
26
|
+
|
|
27
|
+
export function ThemeProvider({
|
|
28
|
+
children,
|
|
29
|
+
defaultTheme = "system",
|
|
30
|
+
storageKey = "theme",
|
|
31
|
+
}: ThemeProviderProps) {
|
|
32
|
+
const [theme, setThemeState] = useState<Theme>(defaultTheme);
|
|
33
|
+
const [resolvedTheme, setResolvedTheme] = useState<"dark" | "light">("light");
|
|
34
|
+
const [mounted, setMounted] = useState(false);
|
|
35
|
+
|
|
36
|
+
useEffect(() => {
|
|
37
|
+
const stored = localStorage.getItem(storageKey);
|
|
38
|
+
const initialTheme =
|
|
39
|
+
stored === "light" || stored === "dark" || stored === "system" ? stored : defaultTheme;
|
|
40
|
+
setThemeState(initialTheme);
|
|
41
|
+
|
|
42
|
+
if (initialTheme === "system") {
|
|
43
|
+
setResolvedTheme(
|
|
44
|
+
window.matchMedia("(prefers-color-scheme: dark)").matches ? "dark" : "light",
|
|
45
|
+
);
|
|
46
|
+
} else {
|
|
47
|
+
setResolvedTheme(initialTheme);
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
setMounted(true);
|
|
51
|
+
}, [defaultTheme, storageKey]);
|
|
52
|
+
|
|
53
|
+
useEffect(() => {
|
|
54
|
+
if (!mounted) return;
|
|
55
|
+
|
|
56
|
+
const root = document.documentElement;
|
|
57
|
+
root.classList.remove("light", "dark");
|
|
58
|
+
root.classList.add(resolvedTheme);
|
|
59
|
+
root.style.colorScheme = resolvedTheme;
|
|
60
|
+
}, [resolvedTheme, mounted]);
|
|
61
|
+
|
|
62
|
+
useEffect(() => {
|
|
63
|
+
if (!mounted) return;
|
|
64
|
+
|
|
65
|
+
if (theme !== "system") {
|
|
66
|
+
setResolvedTheme(theme);
|
|
67
|
+
return;
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
const media = window.matchMedia("(prefers-color-scheme: dark)");
|
|
71
|
+
const onChange = (e: MediaQueryListEvent) => {
|
|
72
|
+
setResolvedTheme(e.matches ? "dark" : "light");
|
|
73
|
+
};
|
|
74
|
+
|
|
75
|
+
setResolvedTheme(media.matches ? "dark" : "light");
|
|
76
|
+
media.addEventListener("change", onChange);
|
|
77
|
+
|
|
78
|
+
return () => media.removeEventListener("change", onChange);
|
|
79
|
+
}, [theme, mounted]);
|
|
80
|
+
|
|
81
|
+
const setTheme = (next: Theme) => {
|
|
82
|
+
localStorage.setItem(storageKey, next);
|
|
83
|
+
setThemeState(next);
|
|
84
|
+
};
|
|
85
|
+
|
|
86
|
+
return (
|
|
87
|
+
<ThemeProviderContext value={{ theme, resolvedTheme, setTheme }}>
|
|
88
|
+
<ScriptOnce>{getThemeScript(storageKey, defaultTheme)}</ScriptOnce>
|
|
89
|
+
{children}
|
|
90
|
+
</ThemeProviderContext>
|
|
91
|
+
);
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
export function useTheme() {
|
|
95
|
+
const context = useContext(ThemeProviderContext);
|
|
96
|
+
if (context === undefined) throw new Error("useTheme must be used within a ThemeProvider");
|
|
97
|
+
return context;
|
|
98
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { Providers } from "@/providers/Providers";
|
|
@@ -0,0 +1,179 @@
|
|
|
1
|
+
/* eslint-disable */
|
|
2
|
+
|
|
3
|
+
// @ts-nocheck
|
|
4
|
+
|
|
5
|
+
// noinspection JSUnusedGlobalSymbols
|
|
6
|
+
|
|
7
|
+
// This file was automatically generated by TanStack Router.
|
|
8
|
+
// You should NOT make any changes in this file as it will be overwritten.
|
|
9
|
+
// Additionally, you should also exclude this file from your linter and/or formatter to prevent it from being checked or modified.
|
|
10
|
+
|
|
11
|
+
import { Route as rootRouteImport } from './routes/__root'
|
|
12
|
+
import { Route as IndexRouteImport } from './routes/index'
|
|
13
|
+
import { Route as LangRouteImport } from './routes/$lang'
|
|
14
|
+
import { Route as RobotsDottxtRouteImport } from './routes/robots[.]txt'
|
|
15
|
+
import { Route as SiteDotwebmanifestRouteImport } from './routes/site[.]webmanifest'
|
|
16
|
+
import { Route as SitemapDotxmlRouteImport } from './routes/sitemap[.]xml'
|
|
17
|
+
import { Route as LangIndexRouteImport } from './routes/$lang/index'
|
|
18
|
+
|
|
19
|
+
const IndexRoute = IndexRouteImport.update({
|
|
20
|
+
id: '/',
|
|
21
|
+
path: '/',
|
|
22
|
+
getParentRoute: () => rootRouteImport,
|
|
23
|
+
} as any)
|
|
24
|
+
const LangRoute = LangRouteImport.update({
|
|
25
|
+
id: '/$lang',
|
|
26
|
+
path: '/$lang',
|
|
27
|
+
getParentRoute: () => rootRouteImport,
|
|
28
|
+
} as any)
|
|
29
|
+
const RobotsDottxtRoute = RobotsDottxtRouteImport.update({
|
|
30
|
+
id: '/robots.txt',
|
|
31
|
+
path: '/robots.txt',
|
|
32
|
+
getParentRoute: () => rootRouteImport,
|
|
33
|
+
} as any)
|
|
34
|
+
const SiteDotwebmanifestRoute = SiteDotwebmanifestRouteImport.update({
|
|
35
|
+
id: '/site.webmanifest',
|
|
36
|
+
path: '/site.webmanifest',
|
|
37
|
+
getParentRoute: () => rootRouteImport,
|
|
38
|
+
} as any)
|
|
39
|
+
const SitemapDotxmlRoute = SitemapDotxmlRouteImport.update({
|
|
40
|
+
id: '/sitemap.xml',
|
|
41
|
+
path: '/sitemap.xml',
|
|
42
|
+
getParentRoute: () => rootRouteImport,
|
|
43
|
+
} as any)
|
|
44
|
+
const LangIndexRoute = LangIndexRouteImport.update({
|
|
45
|
+
id: '/',
|
|
46
|
+
path: '/',
|
|
47
|
+
getParentRoute: () => LangRoute,
|
|
48
|
+
} as any)
|
|
49
|
+
|
|
50
|
+
export interface FileRoutesByFullPath {
|
|
51
|
+
'/': typeof IndexRoute
|
|
52
|
+
'/$lang': typeof LangRouteWithChildren
|
|
53
|
+
'/robots.txt': typeof RobotsDottxtRoute
|
|
54
|
+
'/site.webmanifest': typeof SiteDotwebmanifestRoute
|
|
55
|
+
'/sitemap.xml': typeof SitemapDotxmlRoute
|
|
56
|
+
'/$lang/': typeof LangIndexRoute
|
|
57
|
+
}
|
|
58
|
+
export interface FileRoutesByTo {
|
|
59
|
+
'/': typeof IndexRoute
|
|
60
|
+
'/robots.txt': typeof RobotsDottxtRoute
|
|
61
|
+
'/site.webmanifest': typeof SiteDotwebmanifestRoute
|
|
62
|
+
'/sitemap.xml': typeof SitemapDotxmlRoute
|
|
63
|
+
'/$lang': typeof LangIndexRoute
|
|
64
|
+
}
|
|
65
|
+
export interface FileRoutesById {
|
|
66
|
+
__root__: typeof rootRouteImport
|
|
67
|
+
'/': typeof IndexRoute
|
|
68
|
+
'/$lang': typeof LangRouteWithChildren
|
|
69
|
+
'/robots.txt': typeof RobotsDottxtRoute
|
|
70
|
+
'/site.webmanifest': typeof SiteDotwebmanifestRoute
|
|
71
|
+
'/sitemap.xml': typeof SitemapDotxmlRoute
|
|
72
|
+
'/$lang/': typeof LangIndexRoute
|
|
73
|
+
}
|
|
74
|
+
export interface FileRouteTypes {
|
|
75
|
+
fileRoutesByFullPath: FileRoutesByFullPath
|
|
76
|
+
fullPaths:
|
|
77
|
+
| '/'
|
|
78
|
+
| '/$lang'
|
|
79
|
+
| '/robots.txt'
|
|
80
|
+
| '/site.webmanifest'
|
|
81
|
+
| '/sitemap.xml'
|
|
82
|
+
| '/$lang/'
|
|
83
|
+
fileRoutesByTo: FileRoutesByTo
|
|
84
|
+
to: '/' | '/robots.txt' | '/site.webmanifest' | '/sitemap.xml' | '/$lang'
|
|
85
|
+
id:
|
|
86
|
+
| '__root__'
|
|
87
|
+
| '/'
|
|
88
|
+
| '/$lang'
|
|
89
|
+
| '/robots.txt'
|
|
90
|
+
| '/site.webmanifest'
|
|
91
|
+
| '/sitemap.xml'
|
|
92
|
+
| '/$lang/'
|
|
93
|
+
fileRoutesById: FileRoutesById
|
|
94
|
+
}
|
|
95
|
+
export interface RootRouteChildren {
|
|
96
|
+
IndexRoute: typeof IndexRoute
|
|
97
|
+
LangRoute: typeof LangRouteWithChildren
|
|
98
|
+
RobotsDottxtRoute: typeof RobotsDottxtRoute
|
|
99
|
+
SiteDotwebmanifestRoute: typeof SiteDotwebmanifestRoute
|
|
100
|
+
SitemapDotxmlRoute: typeof SitemapDotxmlRoute
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
declare module '@tanstack/react-router' {
|
|
104
|
+
interface FileRoutesByPath {
|
|
105
|
+
'/': {
|
|
106
|
+
id: '/'
|
|
107
|
+
path: '/'
|
|
108
|
+
fullPath: '/'
|
|
109
|
+
preLoaderRoute: typeof IndexRouteImport
|
|
110
|
+
parentRoute: typeof rootRouteImport
|
|
111
|
+
}
|
|
112
|
+
'/$lang': {
|
|
113
|
+
id: '/$lang'
|
|
114
|
+
path: '/$lang'
|
|
115
|
+
fullPath: '/$lang'
|
|
116
|
+
preLoaderRoute: typeof LangRouteImport
|
|
117
|
+
parentRoute: typeof rootRouteImport
|
|
118
|
+
}
|
|
119
|
+
'/robots.txt': {
|
|
120
|
+
id: '/robots.txt'
|
|
121
|
+
path: '/robots.txt'
|
|
122
|
+
fullPath: '/robots.txt'
|
|
123
|
+
preLoaderRoute: typeof RobotsDottxtRouteImport
|
|
124
|
+
parentRoute: typeof rootRouteImport
|
|
125
|
+
}
|
|
126
|
+
'/site.webmanifest': {
|
|
127
|
+
id: '/site.webmanifest'
|
|
128
|
+
path: '/site.webmanifest'
|
|
129
|
+
fullPath: '/site.webmanifest'
|
|
130
|
+
preLoaderRoute: typeof SiteDotwebmanifestRouteImport
|
|
131
|
+
parentRoute: typeof rootRouteImport
|
|
132
|
+
}
|
|
133
|
+
'/sitemap.xml': {
|
|
134
|
+
id: '/sitemap.xml'
|
|
135
|
+
path: '/sitemap.xml'
|
|
136
|
+
fullPath: '/sitemap.xml'
|
|
137
|
+
preLoaderRoute: typeof SitemapDotxmlRouteImport
|
|
138
|
+
parentRoute: typeof rootRouteImport
|
|
139
|
+
}
|
|
140
|
+
'/$lang/': {
|
|
141
|
+
id: '/$lang/'
|
|
142
|
+
path: '/'
|
|
143
|
+
fullPath: '/$lang/'
|
|
144
|
+
preLoaderRoute: typeof LangIndexRouteImport
|
|
145
|
+
parentRoute: typeof LangRoute
|
|
146
|
+
}
|
|
147
|
+
}
|
|
148
|
+
}
|
|
149
|
+
|
|
150
|
+
interface LangRouteChildren {
|
|
151
|
+
LangIndexRoute: typeof LangIndexRoute
|
|
152
|
+
}
|
|
153
|
+
|
|
154
|
+
const LangRouteChildren: LangRouteChildren = {
|
|
155
|
+
LangIndexRoute: LangIndexRoute,
|
|
156
|
+
}
|
|
157
|
+
|
|
158
|
+
const LangRouteWithChildren = LangRoute._addFileChildren(LangRouteChildren)
|
|
159
|
+
|
|
160
|
+
const rootRouteChildren: RootRouteChildren = {
|
|
161
|
+
IndexRoute: IndexRoute,
|
|
162
|
+
LangRoute: LangRouteWithChildren,
|
|
163
|
+
RobotsDottxtRoute: RobotsDottxtRoute,
|
|
164
|
+
SiteDotwebmanifestRoute: SiteDotwebmanifestRoute,
|
|
165
|
+
SitemapDotxmlRoute: SitemapDotxmlRoute,
|
|
166
|
+
}
|
|
167
|
+
export const routeTree = rootRouteImport
|
|
168
|
+
._addFileChildren(rootRouteChildren)
|
|
169
|
+
._addFileTypes<FileRouteTypes>()
|
|
170
|
+
|
|
171
|
+
import type { getRouter } from './router.tsx'
|
|
172
|
+
import type { startInstance } from './start.ts'
|
|
173
|
+
declare module '@tanstack/react-start' {
|
|
174
|
+
interface Register {
|
|
175
|
+
ssr: true
|
|
176
|
+
router: Awaited<ReturnType<typeof getRouter>>
|
|
177
|
+
config: Awaited<ReturnType<typeof startInstance.getOptions>>
|
|
178
|
+
}
|
|
179
|
+
}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { createRouter as createTanStackRouter } from "@tanstack/react-router";
|
|
2
|
+
import { setupRouterSsrQueryIntegration } from "@tanstack/react-router-ssr-query";
|
|
3
|
+
|
|
4
|
+
import { getContext } from "./providers/root-provider";
|
|
5
|
+
import { routeTree } from "./routeTree.gen";
|
|
6
|
+
|
|
7
|
+
export function getRouter() {
|
|
8
|
+
const context = getContext();
|
|
9
|
+
|
|
10
|
+
const router = createTanStackRouter({
|
|
11
|
+
routeTree,
|
|
12
|
+
context,
|
|
13
|
+
scrollRestoration: true,
|
|
14
|
+
defaultPreload: "intent",
|
|
15
|
+
defaultPreloadStaleTime: 0,
|
|
16
|
+
});
|
|
17
|
+
|
|
18
|
+
setupRouterSsrQueryIntegration({ router, queryClient: context.queryClient });
|
|
19
|
+
|
|
20
|
+
return router;
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
declare module "@tanstack/react-router" {
|
|
24
|
+
interface Register {
|
|
25
|
+
router: ReturnType<typeof getRouter>;
|
|
26
|
+
}
|
|
27
|
+
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { createFileRoute } from "@tanstack/react-router";
|
|
2
|
+
|
|
3
|
+
import { Pending } from "@/components/shared/Pending";
|
|
4
|
+
import { LandingPage } from "@/features/landing";
|
|
5
|
+
|
|
6
|
+
export const Route = createFileRoute("/$lang/")({
|
|
7
|
+
pendingComponent: Pending,
|
|
8
|
+
component: Home,
|
|
9
|
+
});
|
|
10
|
+
|
|
11
|
+
function Home() {
|
|
12
|
+
return <LandingPage />;
|
|
13
|
+
}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { createFileRoute, notFound, Outlet } from "@tanstack/react-router";
|
|
2
|
+
|
|
3
|
+
import { locales, setLocale } from "@/paraglide/runtime.js";
|
|
4
|
+
|
|
5
|
+
export const Route = createFileRoute("/$lang")({
|
|
6
|
+
beforeLoad: ({ params }) => {
|
|
7
|
+
const lang = params.lang;
|
|
8
|
+
|
|
9
|
+
// Geçici olarak as-needed kapatıldı. baseLocale için /'a yönlendirme iptal edildi.
|
|
10
|
+
if (!locales.includes(lang as (typeof locales)[number])) {
|
|
11
|
+
throw notFound();
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
setLocale(lang as (typeof locales)[number], { reload: false });
|
|
15
|
+
},
|
|
16
|
+
component: () => {
|
|
17
|
+
const { lang } = Route.useParams();
|
|
18
|
+
// key={lang} sayesinde dil değiştiğinde React tüm alt componentleri (sayfayı) yeniden render eder.
|
|
19
|
+
// Bu sayede çeviriler anında güncellenir.
|
|
20
|
+
return <Outlet key={lang} />;
|
|
21
|
+
},
|
|
22
|
+
});
|
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
import { TanStackDevtools } from "@tanstack/react-devtools";
|
|
2
|
+
import type { QueryClient } from "@tanstack/react-query";
|
|
3
|
+
import { createRootRouteWithContext, HeadContent, Outlet, Scripts } from "@tanstack/react-router";
|
|
4
|
+
import { TanStackRouterDevtoolsPanel } from "@tanstack/react-router-devtools";
|
|
5
|
+
|
|
6
|
+
import interCss from "@fontsource-variable/inter/index.css?url";
|
|
7
|
+
import { NuqsAdapter } from "nuqs/adapters/tanstack-router";
|
|
8
|
+
|
|
9
|
+
import { seoHeadMeta } from "@/config/seo.config";
|
|
10
|
+
|
|
11
|
+
import appCss from "@/styles/tailwind.css?url";
|
|
12
|
+
|
|
13
|
+
import { Providers } from "@/providers";
|
|
14
|
+
import TanStackQueryDevtools from "@/providers/devtools";
|
|
15
|
+
|
|
16
|
+
import { DefaultCatchBoundary } from "@/components/shared/DefaultCatchBoundary";
|
|
17
|
+
import { NotFound } from "@/components/shared/NotFound";
|
|
18
|
+
import { getLocale } from "@/paraglide/runtime.js";
|
|
19
|
+
|
|
20
|
+
interface RouterContext {
|
|
21
|
+
queryClient: QueryClient;
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
export const Route = createRootRouteWithContext<RouterContext>()({
|
|
25
|
+
head: () => ({
|
|
26
|
+
meta: [
|
|
27
|
+
{ charSet: "utf-8" },
|
|
28
|
+
{ name: "viewport", content: "width=device-width, initial-scale=1" },
|
|
29
|
+
...seoHeadMeta(),
|
|
30
|
+
],
|
|
31
|
+
links: [
|
|
32
|
+
{ rel: "stylesheet", href: appCss },
|
|
33
|
+
{ rel: "stylesheet", href: interCss },
|
|
34
|
+
{ rel: "icon", href: "/logo.webp" },
|
|
35
|
+
{ rel: "apple-touch-icon", href: "/logo.webp" },
|
|
36
|
+
{ rel: "manifest", href: "/site.webmanifest" },
|
|
37
|
+
],
|
|
38
|
+
}),
|
|
39
|
+
errorComponent: DefaultCatchBoundary,
|
|
40
|
+
notFoundComponent: () => <NotFound />,
|
|
41
|
+
shellComponent: RootDocument,
|
|
42
|
+
component: RootComponent,
|
|
43
|
+
});
|
|
44
|
+
|
|
45
|
+
function RootComponent() {
|
|
46
|
+
return (
|
|
47
|
+
<NuqsAdapter>
|
|
48
|
+
<Providers>
|
|
49
|
+
<Outlet />
|
|
50
|
+
</Providers>
|
|
51
|
+
</NuqsAdapter>
|
|
52
|
+
);
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
function RootDocument({ children }: { children: React.ReactNode }) {
|
|
56
|
+
const lang = getLocale();
|
|
57
|
+
return (
|
|
58
|
+
<html lang={lang} className="h-full" suppressHydrationWarning>
|
|
59
|
+
<head>
|
|
60
|
+
<HeadContent />
|
|
61
|
+
</head>
|
|
62
|
+
<body className="flex min-h-full flex-col font-sans antialiased" suppressHydrationWarning>
|
|
63
|
+
{children}
|
|
64
|
+
{import.meta.env.DEV ? (
|
|
65
|
+
<TanStackDevtools
|
|
66
|
+
config={{ position: "bottom-right" }}
|
|
67
|
+
plugins={[
|
|
68
|
+
{
|
|
69
|
+
name: "TanStack Router",
|
|
70
|
+
render: <TanStackRouterDevtoolsPanel />,
|
|
71
|
+
},
|
|
72
|
+
TanStackQueryDevtools,
|
|
73
|
+
]}
|
|
74
|
+
/>
|
|
75
|
+
) : null}
|
|
76
|
+
<Scripts />
|
|
77
|
+
</body>
|
|
78
|
+
</html>
|
|
79
|
+
);
|
|
80
|
+
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { createFileRoute, redirect } from "@tanstack/react-router";
|
|
2
|
+
|
|
3
|
+
import { baseLocale } from "@/paraglide/runtime.js";
|
|
4
|
+
|
|
5
|
+
export const Route = createFileRoute("/")({
|
|
6
|
+
beforeLoad: () => {
|
|
7
|
+
// Geçici olarak as-needed kapatıldı. Ana sayfa /en adresine yönlendiriliyor.
|
|
8
|
+
throw redirect({
|
|
9
|
+
to: "/$lang",
|
|
10
|
+
params: { lang: baseLocale },
|
|
11
|
+
});
|
|
12
|
+
},
|
|
13
|
+
});
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { createFileRoute } from "@tanstack/react-router";
|
|
2
|
+
|
|
3
|
+
import { siteConfig } from "@/config/site.config";
|
|
4
|
+
|
|
5
|
+
export const Route = createFileRoute("/robots.txt")({
|
|
6
|
+
server: {
|
|
7
|
+
handlers: {
|
|
8
|
+
GET: async () => {
|
|
9
|
+
const body = `User-agent: *
|
|
10
|
+
Allow: /
|
|
11
|
+
|
|
12
|
+
Sitemap: ${siteConfig.url}/sitemap.xml
|
|
13
|
+
`;
|
|
14
|
+
|
|
15
|
+
return new Response(body, {
|
|
16
|
+
headers: { "Content-Type": "text/plain; charset=utf-8" },
|
|
17
|
+
});
|
|
18
|
+
},
|
|
19
|
+
},
|
|
20
|
+
},
|
|
21
|
+
});
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { createFileRoute } from "@tanstack/react-router";
|
|
2
|
+
|
|
3
|
+
import { siteConfig } from "@/config/site.config";
|
|
4
|
+
|
|
5
|
+
export const Route = createFileRoute("/site.webmanifest")({
|
|
6
|
+
server: {
|
|
7
|
+
handlers: {
|
|
8
|
+
GET: async () => {
|
|
9
|
+
const manifest = {
|
|
10
|
+
name: siteConfig.name,
|
|
11
|
+
short_name: siteConfig.name,
|
|
12
|
+
description: siteConfig.description,
|
|
13
|
+
start_url: "/",
|
|
14
|
+
display: "standalone",
|
|
15
|
+
background_color: "#ffffff",
|
|
16
|
+
theme_color: "#ffffff",
|
|
17
|
+
icons: [
|
|
18
|
+
{
|
|
19
|
+
src: "/logo.webp",
|
|
20
|
+
sizes: "96x96",
|
|
21
|
+
type: "image/webp",
|
|
22
|
+
},
|
|
23
|
+
],
|
|
24
|
+
};
|
|
25
|
+
|
|
26
|
+
return Response.json(manifest, {
|
|
27
|
+
headers: { "Content-Type": "application/manifest+json; charset=utf-8" },
|
|
28
|
+
});
|
|
29
|
+
},
|
|
30
|
+
},
|
|
31
|
+
},
|
|
32
|
+
});
|