Skip to content

Commit b833653

Browse files
authored
docs(examples): add Tanstack Start example (#2209)
1 parent 643a604 commit b833653

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

54 files changed

+9771
-0
lines changed

examples/tanstack-start/.gitignore

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
node_modules
2+
.yarn
3+
4+
.DS_Store
5+
.cache
6+
.env
7+
.vercel
8+
.output
9+
.vinxi
10+
11+
/build/
12+
/api/
13+
/server/build
14+
/public/build
15+
.vinxi
16+
# Sentry Config File
17+
.env.sentry-build-plugin
18+
/test-results/
19+
/playwright-report/
20+
/blob-report/
21+
/playwright/.cache/
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
**/build
2+
**/public
3+
pnpm-lock.yaml
4+
routeTree.gen.ts

examples/tanstack-start/README.md

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
# Example project using Tanstack Start + Vite + Babel with LinguiJS Plugin
2+
3+
This is a [Tanstack Start](https://tanstack.com/start/latest) project that demonstrates i18n support with Lingui.
4+
5+
## Development
6+
7+
From your terminal:
8+
9+
```sh
10+
yarn install
11+
yarn dev
12+
```
13+
14+
This starts your app in development mode, rebuilding assets on file changes.
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
import { lingui } from "@lingui/vite-plugin"
2+
import { defineConfig } from "@tanstack/react-start/config"
3+
import tsConfigPaths from "vite-tsconfig-paths"
4+
5+
export default defineConfig({
6+
tsr: {
7+
appDirectory: "src",
8+
},
9+
react: {
10+
babel: {
11+
plugins: ["@lingui/babel-plugin-lingui-macro"],
12+
},
13+
},
14+
vite: {
15+
plugins: [
16+
lingui(),
17+
tsConfigPaths({
18+
projects: ["./tsconfig.json"],
19+
}),
20+
],
21+
},
22+
})
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
import { defineConfig } from "@lingui/cli"
2+
3+
export default defineConfig({
4+
catalogs: [
5+
{
6+
include: ["src"],
7+
path: "<rootDir>/src/locales/{locale}/messages",
8+
},
9+
],
10+
locales: ["fr", "en"],
11+
sourceLocale: "en",
12+
})
Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
{
2+
"name": "tanstack-start",
3+
"private": true,
4+
"sideEffects": false,
5+
"type": "module",
6+
"scripts": {
7+
"dev": "vinxi dev",
8+
"build": "vinxi build",
9+
"lingui:extract": "lingui extract --clean",
10+
"start": "vinxi start"
11+
},
12+
"dependencies": {
13+
"@lingui/core": "^5.3.0",
14+
"@lingui/react": "^5.3.0",
15+
"@tanstack/react-router": "^1.114.27",
16+
"@tanstack/react-router-devtools": "^1.114.27",
17+
"@tanstack/react-start": "^1.114.28",
18+
"cookie-es": "^2.0.0",
19+
"react": "^19.0.0",
20+
"react-dom": "^19.0.0",
21+
"redaxios": "^0.5.1",
22+
"tailwind-merge": "^2.6.0",
23+
"vinxi": "0.5.3"
24+
},
25+
"devDependencies": {
26+
"@lingui/babel-plugin-lingui-macro": "^5.3.0",
27+
"@lingui/cli": "^5.3.0",
28+
"@lingui/vite-plugin": "^5.3.0",
29+
"@types/node": "^22.5.4",
30+
"@types/react": "^19.0.8",
31+
"@types/react-dom": "^19.0.3",
32+
"autoprefixer": "^10.4.20",
33+
"postcss": "^8.5.1",
34+
"tailwindcss": "^3.4.17",
35+
"typescript": "^5.7.2",
36+
"vite-tsconfig-paths": "^5.1.4"
37+
}
38+
}
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
export default {
2+
plugins: {
3+
tailwindcss: {},
4+
autoprefixer: {},
5+
},
6+
}
29.3 KB
Loading
107 KB
Loading
26.6 KB
Loading

0 commit comments

Comments
 (0)