Skip to content

Commit

Permalink
feat: tanstack start try (#606)
Browse files Browse the repository at this point in the history
  • Loading branch information
gregkonush authored Dec 10, 2024
1 parent dd01146 commit 7713bfa
Show file tree
Hide file tree
Showing 17 changed files with 4,303 additions and 67 deletions.
10 changes: 6 additions & 4 deletions apps/temporal/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,11 @@ temporal:
ingress:
enabled: true
className: traefik
annotations:
traefik.frontend.rule.type: PathPrefix
kubernetes.io/ingress.class: traefik
ingress.kubernetes.io/ssl-redirect: "false"
hosts:
- "temporal.lan"
frontend:
ingress:
enabled: true
className: traefik
hosts:
- "frontend.temporal.lan"
3,878 changes: 3,815 additions & 63 deletions pnpm-lock.yaml

Large diffs are not rendered by default.

175 changes: 175 additions & 0 deletions services/avenir/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,175 @@
# Based on https://raw.githubusercontent.com/github/gitignore/main/Node.gitignore

# Logs

logs
_.log
npm-debug.log_
yarn-debug.log*
yarn-error.log*
lerna-debug.log*
.pnpm-debug.log*

# Caches

.cache

# Diagnostic reports (https://nodejs.org/api/report.html)

report.[0-9]_.[0-9]_.[0-9]_.[0-9]_.json

# Runtime data

pids
_.pid
_.seed
*.pid.lock

# Directory for instrumented libs generated by jscoverage/JSCover

lib-cov

# Coverage directory used by tools like istanbul

coverage
*.lcov

# nyc test coverage

.nyc_output

# Grunt intermediate storage (https://gruntjs.com/creating-plugins#storing-task-files)

.grunt

# Bower dependency directory (https://bower.io/)

bower_components

# node-waf configuration

.lock-wscript

# Compiled binary addons (https://nodejs.org/api/addons.html)

build/Release

# Dependency directories

node_modules/
jspm_packages/

# Snowpack dependency directory (https://snowpack.dev/)

web_modules/

# TypeScript cache

*.tsbuildinfo

# Optional npm cache directory

.npm

# Optional eslint cache

.eslintcache

# Optional stylelint cache

.stylelintcache

# Microbundle cache

.rpt2_cache/
.rts2_cache_cjs/
.rts2_cache_es/
.rts2_cache_umd/

# Optional REPL history

.node_repl_history

# Output of 'npm pack'

*.tgz

# Yarn Integrity file

.yarn-integrity

# dotenv environment variable files

.env
.env.development.local
.env.test.local
.env.production.local
.env.local

# parcel-bundler cache (https://parceljs.org/)

.parcel-cache

# Next.js build output

.next
out

# Nuxt.js build / generate output

.nuxt
dist

# Gatsby files

# Comment in the public line in if your project uses Gatsby and not Next.js

# https://nextjs.org/blog/next-9-1#public-directory-support

# public

# vuepress build output

.vuepress/dist

# vuepress v2.x temp and cache directory

.temp

# Docusaurus cache and generated files

.docusaurus

# Serverless directories

.serverless/

# FuseBox cache

.fusebox/

# DynamoDB Local files

.dynamodb/

# TernJS port file

.tern-port

# Stores VSCode versions used for testing VSCode extensions

.vscode-test

# yarn v2

.yarn/cache
.yarn/unplugged
.yarn/build-state.yml
.yarn/install-state.gz
.pnp.*

# IntelliJ based IDEs
.idea

# Finder (MacOS) folder config
.DS_Store
15 changes: 15 additions & 0 deletions services/avenir/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
# avenir

To install dependencies:

```bash
bun install
```

To run:

```bash
bun run index.ts
```

This project was created using `bun init` in bun v1.1.38. [Bun](https://bun.sh) is a fast all-in-one JavaScript runtime.
3 changes: 3 additions & 0 deletions services/avenir/app.config.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
import { defineConfig } from "@tanstack/start/config"

export default defineConfig({})
9 changes: 9 additions & 0 deletions services/avenir/app/client.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
// app/client.tsx
/// <reference types="vinxi/types/client" />
import { hydrateRoot } from "react-dom/client"
import { StartClient } from "@tanstack/start"
import { createRouter } from "./router"

const router = createRouter()

hydrateRoot(document, <StartClient router={router} />)
88 changes: 88 additions & 0 deletions services/avenir/app/routeTree.gen.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,88 @@
/* 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 { Route as rootRoute } from './routes/__root'
import { Route as IndexImport } from './routes/index'

// Create/Update Routes

const IndexRoute = IndexImport.update({
id: '/',
path: '/',
getParentRoute: () => rootRoute,
} as any)

// Populate the FileRoutesByPath interface

declare module '@tanstack/react-router' {
interface FileRoutesByPath {
'/': {
id: '/'
path: '/'
fullPath: '/'
preLoaderRoute: typeof IndexImport
parentRoute: typeof rootRoute
}
}
}

// Create and export the route tree

export interface FileRoutesByFullPath {
'/': typeof IndexRoute
}

export interface FileRoutesByTo {
'/': typeof IndexRoute
}

export interface FileRoutesById {
__root__: typeof rootRoute
'/': typeof IndexRoute
}

export interface FileRouteTypes {
fileRoutesByFullPath: FileRoutesByFullPath
fullPaths: '/'
fileRoutesByTo: FileRoutesByTo
to: '/'
id: '__root__' | '/'
fileRoutesById: FileRoutesById
}

export interface RootRouteChildren {
IndexRoute: typeof IndexRoute
}

const rootRouteChildren: RootRouteChildren = {
IndexRoute: IndexRoute,
}

export const routeTree = rootRoute
._addFileChildren(rootRouteChildren)
._addFileTypes<FileRouteTypes>()

/* ROUTE_MANIFEST_START
{
"routes": {
"__root__": {
"filePath": "__root.tsx",
"children": [
"/"
]
},
"/": {
"filePath": "index.tsx"
}
}
}
ROUTE_MANIFEST_END */
17 changes: 17 additions & 0 deletions services/avenir/app/router.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
// app/router.tsx
import { createRouter as createTanStackRouter } from "@tanstack/react-router"
import { routeTree } from "./routeTree.gen"

export function createRouter() {
const router = createTanStackRouter({
routeTree,
})

return router
}

declare module "@tanstack/react-router" {
interface Register {
router: ReturnType<typeof createRouter>
}
}
45 changes: 45 additions & 0 deletions services/avenir/app/routes/__root.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
// app/routes/__root.tsx
import { Outlet, ScrollRestoration, createRootRoute } from "@tanstack/react-router"
import { Meta, Scripts } from "@tanstack/start"
import type { ReactNode } from "react"

export const Route = createRootRoute({
head: () => ({
meta: [
{
charSet: "utf-8",
},
{
name: "viewport",
content: "width=device-width, initial-scale=1",
},
{
title: "TanStack Start Starter",
},
],
}),
component: RootComponent,
})

function RootComponent() {
return (
<RootDocument>
<Outlet />
</RootDocument>
)
}

function RootDocument({ children }: Readonly<{ children: ReactNode }>) {
return (
<html lang="en">
<head>
<Meta />
</head>
<body>
{children}
<ScrollRestoration />
<Scripts />
</body>
</html>
)
}
Loading

0 comments on commit 7713bfa

Please sign in to comment.