create-fate 1.3.3 → 1.5.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/bin/create-fate.mjs +41 -3
- package/package.json +1 -1
- package/templates/fate/_shared/vue-app/package.json +14 -16
- package/templates/fate/cloudflare/README.md +11 -0
- package/templates/fate/cloudflare/client/node_modules/.bin/browserslist +22 -0
- package/templates/fate/cloudflare/client/node_modules/.bin/cf-wrangler +22 -0
- package/templates/fate/cloudflare/client/node_modules/.bin/drizzle-kit +22 -0
- package/templates/fate/cloudflare/client/node_modules/.bin/esbuild +22 -0
- package/templates/fate/cloudflare/client/node_modules/.bin/fate +22 -0
- package/templates/fate/cloudflare/client/node_modules/.bin/fbtee +22 -0
- package/templates/fate/cloudflare/client/node_modules/.bin/intent +22 -0
- package/templates/fate/cloudflare/client/node_modules/.bin/jiti +22 -0
- package/templates/fate/cloudflare/client/node_modules/.bin/oxfmt +22 -0
- package/templates/fate/cloudflare/client/node_modules/.bin/oxlint +22 -0
- package/templates/fate/cloudflare/client/node_modules/.bin/rolldown +22 -0
- package/templates/fate/cloudflare/client/node_modules/.bin/tsc +22 -0
- package/templates/fate/cloudflare/client/node_modules/.bin/tsx +22 -0
- package/templates/fate/cloudflare/client/node_modules/.bin/vitest +22 -0
- package/templates/fate/cloudflare/client/node_modules/.bin/void +22 -0
- package/templates/fate/cloudflare/client/node_modules/.bin/vp +22 -0
- package/templates/fate/cloudflare/client/node_modules/.bin/vpr +22 -0
- package/templates/fate/cloudflare/client/node_modules/.bin/workerd +22 -0
- package/templates/fate/cloudflare/client/node_modules/.bin/wrangler +22 -0
- package/templates/fate/cloudflare/client/node_modules/.bin/wrangler2 +22 -0
- package/templates/fate/cloudflare/client/package.json +26 -21
- package/templates/fate/cloudflare/client/pages/layout.tsx +2 -16
- package/templates/fate/cloudflare/client/src/lib/AvailableLanguages.tsx +3 -3
- package/templates/fate/cloudflare/client/src/lib/LocaleContext.tsx +61 -0
- package/templates/fate/cloudflare/client/src/ui/LocaleSwitcher.tsx +26 -44
- package/templates/fate/cloudflare/client/start.mjs +11 -0
- package/templates/fate/cloudflare/client/translations/{de_DE.json → de-DE.json} +56 -113
- package/templates/fate/{graphql/client/translations/ja_JP.json → cloudflare/client/translations/ja-JP.json} +56 -113
- package/templates/fate/cloudflare/client/vite.config.ts +4 -8
- package/templates/fate/cloudflare/package.json +6 -10
- package/templates/fate/cloudflare/pnpm-workspace.yaml +4 -4
- package/templates/fate/cloudflare/server/db/migrations/20260508073357_initial_schema.sql +3 -2
- package/templates/fate/cloudflare/server/db/migrations/20260508120500_seed_cloudflare_demo.sql +10 -10
- package/templates/fate/cloudflare/server/db/migrations/meta/20260508073357_snapshot.json +10 -3
- package/templates/fate/cloudflare/server/db/schema.ts +2 -3
- package/templates/fate/cloudflare/server/node_modules/.bin/cf-wrangler +22 -0
- package/templates/fate/cloudflare/server/node_modules/.bin/drizzle-kit +22 -0
- package/templates/fate/cloudflare/server/node_modules/.bin/esbuild +22 -0
- package/templates/fate/cloudflare/server/node_modules/.bin/fate +22 -0
- package/templates/fate/cloudflare/server/node_modules/.bin/intent +22 -0
- package/templates/fate/cloudflare/server/node_modules/.bin/jiti +22 -0
- package/templates/fate/cloudflare/server/node_modules/.bin/oxfmt +22 -0
- package/templates/fate/cloudflare/server/node_modules/.bin/oxlint +22 -0
- package/templates/fate/cloudflare/server/node_modules/.bin/tsc +22 -0
- package/templates/fate/cloudflare/server/node_modules/.bin/tsx +22 -0
- package/templates/fate/cloudflare/server/node_modules/.bin/vitest +22 -0
- package/templates/fate/cloudflare/server/node_modules/.bin/vp +22 -0
- package/templates/fate/cloudflare/server/node_modules/.bin/vpr +22 -0
- package/templates/fate/cloudflare/server/node_modules/.bin/workerd +22 -0
- package/templates/fate/cloudflare/server/node_modules/.bin/wrangler +22 -0
- package/templates/fate/cloudflare/server/node_modules/.bin/wrangler2 +22 -0
- package/templates/fate/cloudflare/server/package.json +3 -3
- package/templates/fate/cloudflare/server/src/fate/server.ts +5 -2
- package/templates/fate/cloudflare/server/src/lib/auth.ts +0 -2
- package/templates/fate/cloudflare/server/tsconfig.json +1 -1
- package/templates/fate/cloudflare/tsconfig.json +2 -11
- package/templates/fate/cloudflare/vite.config.ts +3 -0
- package/templates/fate/drizzle/README.md +11 -0
- package/templates/fate/drizzle/client/node_modules/.bin/browserslist +22 -0
- package/templates/fate/drizzle/client/node_modules/.bin/cf-wrangler +22 -0
- package/templates/fate/drizzle/client/node_modules/.bin/drizzle-kit +22 -0
- package/templates/fate/drizzle/client/node_modules/.bin/esbuild +22 -0
- package/templates/fate/drizzle/client/node_modules/.bin/fate +22 -0
- package/templates/fate/drizzle/client/node_modules/.bin/fbtee +22 -0
- package/templates/fate/drizzle/client/node_modules/.bin/intent +22 -0
- package/templates/fate/drizzle/client/node_modules/.bin/jiti +22 -0
- package/templates/fate/drizzle/client/node_modules/.bin/oxfmt +22 -0
- package/templates/fate/drizzle/client/node_modules/.bin/oxlint +22 -0
- package/templates/fate/drizzle/client/node_modules/.bin/rolldown +22 -0
- package/templates/fate/drizzle/client/node_modules/.bin/tsc +22 -0
- package/templates/fate/drizzle/client/node_modules/.bin/tsx +22 -0
- package/templates/fate/drizzle/client/node_modules/.bin/vitest +22 -0
- package/templates/fate/drizzle/client/node_modules/.bin/void +22 -0
- package/templates/fate/drizzle/client/node_modules/.bin/vp +22 -0
- package/templates/fate/drizzle/client/node_modules/.bin/vpr +22 -0
- package/templates/fate/drizzle/client/node_modules/.bin/workerd +22 -0
- package/templates/fate/drizzle/client/node_modules/.bin/wrangler +22 -0
- package/templates/fate/drizzle/client/node_modules/.bin/wrangler2 +22 -0
- package/templates/fate/drizzle/client/package.json +28 -24
- package/templates/fate/drizzle/client/pages/layout.tsx +2 -16
- package/templates/fate/drizzle/client/src/lib/AvailableLanguages.tsx +3 -3
- package/templates/fate/drizzle/client/src/lib/LocaleContext.tsx +61 -0
- package/templates/fate/drizzle/client/src/ui/LocaleSwitcher.tsx +26 -44
- package/templates/fate/drizzle/client/start.mjs +11 -0
- package/templates/fate/{graphql/client/translations/de_DE.json → drizzle/client/translations/de-DE.json} +56 -113
- package/templates/fate/{cloudflare/client/translations/ja_JP.json → drizzle/client/translations/ja-JP.json} +56 -113
- package/templates/fate/drizzle/client/vite.config.ts +4 -8
- package/templates/fate/drizzle/package.json +6 -10
- package/templates/fate/drizzle/pnpm-workspace.yaml +4 -4
- package/templates/fate/drizzle/server/node_modules/.bin/drizzle-kit +22 -0
- package/templates/fate/drizzle/server/node_modules/.bin/esbuild +22 -0
- package/templates/fate/drizzle/server/node_modules/.bin/fate +22 -0
- package/templates/fate/drizzle/server/node_modules/.bin/intent +22 -0
- package/templates/fate/drizzle/server/node_modules/.bin/jiti +22 -0
- package/templates/fate/drizzle/server/node_modules/.bin/nodemon +22 -0
- package/templates/fate/drizzle/server/node_modules/.bin/oxfmt +22 -0
- package/templates/fate/drizzle/server/node_modules/.bin/oxlint +22 -0
- package/templates/fate/drizzle/server/node_modules/.bin/tsc +22 -0
- package/templates/fate/drizzle/server/node_modules/.bin/tsx +22 -0
- package/templates/fate/drizzle/server/node_modules/.bin/vitest +22 -0
- package/templates/fate/drizzle/server/node_modules/.bin/vp +22 -0
- package/templates/fate/drizzle/server/node_modules/.bin/vpr +22 -0
- package/templates/fate/drizzle/server/package.json +9 -9
- package/templates/fate/drizzle/server/src/app.tsx +1 -1
- package/templates/fate/drizzle/server/src/drizzle/schema.ts +2 -3
- package/templates/fate/drizzle/server/src/drizzle/seed.tsx +1 -1
- package/templates/fate/drizzle/tsconfig.json +1 -10
- package/templates/fate/graphql/README.md +11 -0
- package/templates/fate/graphql/client/node_modules/.bin/browserslist +22 -0
- package/templates/fate/graphql/client/node_modules/.bin/cf-wrangler +22 -0
- package/templates/fate/graphql/client/node_modules/.bin/drizzle-kit +22 -0
- package/templates/fate/graphql/client/node_modules/.bin/esbuild +22 -0
- package/templates/fate/graphql/client/node_modules/.bin/fate +22 -0
- package/templates/fate/graphql/client/node_modules/.bin/fbtee +22 -0
- package/templates/fate/graphql/client/node_modules/.bin/intent +22 -0
- package/templates/fate/graphql/client/node_modules/.bin/jiti +22 -0
- package/templates/fate/graphql/client/node_modules/.bin/oxfmt +22 -0
- package/templates/fate/graphql/client/node_modules/.bin/oxlint +22 -0
- package/templates/fate/graphql/client/node_modules/.bin/rolldown +22 -0
- package/templates/fate/graphql/client/node_modules/.bin/tsc +22 -0
- package/templates/fate/graphql/client/node_modules/.bin/tsx +22 -0
- package/templates/fate/graphql/client/node_modules/.bin/vitest +22 -0
- package/templates/fate/graphql/client/node_modules/.bin/void +22 -0
- package/templates/fate/graphql/client/node_modules/.bin/vp +22 -0
- package/templates/fate/graphql/client/node_modules/.bin/vpr +22 -0
- package/templates/fate/graphql/client/node_modules/.bin/workerd +22 -0
- package/templates/fate/graphql/client/node_modules/.bin/wrangler +22 -0
- package/templates/fate/graphql/client/node_modules/.bin/wrangler2 +22 -0
- package/templates/fate/graphql/client/node_modules/.bin/yaml +22 -0
- package/templates/fate/graphql/client/package.json +27 -23
- package/templates/fate/graphql/client/pages/layout.tsx +2 -16
- package/templates/fate/graphql/client/src/lib/AvailableLanguages.tsx +3 -3
- package/templates/fate/graphql/client/src/lib/LocaleContext.tsx +61 -0
- package/templates/fate/graphql/client/src/ui/LocaleSwitcher.tsx +26 -44
- package/templates/fate/graphql/client/src/ui/PostCard.tsx +1 -1
- package/templates/fate/graphql/client/start.mjs +11 -0
- package/templates/fate/{drizzle/client/translations/de_DE.json → graphql/client/translations/de-DE.json} +56 -113
- package/templates/fate/{http/client/translations/ja_JP.json → graphql/client/translations/ja-JP.json} +56 -113
- package/templates/fate/graphql/client/vite.config.ts +4 -8
- package/templates/fate/graphql/package.json +7 -11
- package/templates/fate/graphql/pnpm-workspace.yaml +4 -4
- package/templates/fate/graphql/server/package.json +25 -29
- package/templates/fate/graphql/server/prisma.config.ts +9 -1
- package/templates/fate/graphql/server/scripts/generate-graphql.tsx +1 -1
- package/templates/fate/graphql/server/src/index.tsx +1 -1
- package/templates/fate/graphql/server/src/prisma/schema.prisma +2 -1
- package/templates/fate/graphql/server/src/prisma/seed.tsx +1 -1
- package/templates/fate/graphql/server/tsconfig.json +1 -11
- package/templates/fate/graphql/tsconfig.json +1 -10
- package/templates/fate/graphql-client/README.md +9 -0
- package/templates/fate/graphql-client/_gitignore +3 -0
- package/templates/fate/graphql-client/package.json +27 -24
- package/templates/fate/graphql-client/pages/index.tsx +61 -27
- package/templates/fate/graphql-client/pages/layout.tsx +22 -15
- package/templates/fate/graphql-client/pnpm-workspace.yaml +6 -4
- package/templates/fate/graphql-client/src/lib/AvailableLanguages.tsx +5 -0
- package/templates/fate/graphql-client/src/lib/LocaleContext.tsx +61 -0
- package/templates/fate/graphql-client/src/ui/LocaleSwitcher.tsx +34 -0
- package/templates/fate/graphql-client/translations/de-DE.json +225 -0
- package/templates/fate/graphql-client/translations/ja-JP.json +225 -0
- package/templates/fate/graphql-client/vite.config.ts +9 -13
- package/templates/fate/http/README.md +11 -0
- package/templates/fate/http/client/node_modules/.bin/browserslist +22 -0
- package/templates/fate/http/client/node_modules/.bin/cf-wrangler +22 -0
- package/templates/fate/http/client/node_modules/.bin/drizzle-kit +22 -0
- package/templates/fate/http/client/node_modules/.bin/esbuild +22 -0
- package/templates/fate/http/client/node_modules/.bin/fate +22 -0
- package/templates/fate/http/client/node_modules/.bin/fbtee +22 -0
- package/templates/fate/http/client/node_modules/.bin/intent +22 -0
- package/templates/fate/http/client/node_modules/.bin/jiti +22 -0
- package/templates/fate/http/client/node_modules/.bin/oxfmt +22 -0
- package/templates/fate/http/client/node_modules/.bin/oxlint +22 -0
- package/templates/fate/http/client/node_modules/.bin/rolldown +22 -0
- package/templates/fate/http/client/node_modules/.bin/tsc +22 -0
- package/templates/fate/http/client/node_modules/.bin/tsx +22 -0
- package/templates/fate/http/client/node_modules/.bin/vitest +22 -0
- package/templates/fate/http/client/node_modules/.bin/void +22 -0
- package/templates/fate/http/client/node_modules/.bin/vp +22 -0
- package/templates/fate/http/client/node_modules/.bin/vpr +22 -0
- package/templates/fate/http/client/node_modules/.bin/workerd +22 -0
- package/templates/fate/http/client/node_modules/.bin/wrangler +22 -0
- package/templates/fate/http/client/node_modules/.bin/wrangler2 +22 -0
- package/templates/fate/http/client/package.json +26 -22
- package/templates/fate/http/client/pages/layout.tsx +2 -16
- package/templates/fate/http/client/src/lib/AvailableLanguages.tsx +3 -3
- package/templates/fate/http/client/src/lib/LocaleContext.tsx +61 -0
- package/templates/fate/http/client/src/ui/LocaleSwitcher.tsx +26 -44
- package/templates/fate/http/client/start.mjs +11 -0
- package/templates/fate/http/client/translations/{de_DE.json → de-DE.json} +56 -113
- package/templates/fate/{drizzle/client/translations/ja_JP.json → http/client/translations/ja-JP.json} +56 -113
- package/templates/fate/http/client/vite.config.ts +4 -8
- package/templates/fate/http/package.json +6 -10
- package/templates/fate/http/pnpm-workspace.yaml +4 -4
- package/templates/fate/http/server/node_modules/.bin/drizzle-kit +22 -0
- package/templates/fate/http/server/node_modules/.bin/esbuild +22 -0
- package/templates/fate/http/server/node_modules/.bin/fate +22 -0
- package/templates/fate/http/server/node_modules/.bin/intent +22 -0
- package/templates/fate/http/server/node_modules/.bin/jiti +22 -0
- package/templates/fate/http/server/node_modules/.bin/nodemon +22 -0
- package/templates/fate/http/server/node_modules/.bin/oxfmt +22 -0
- package/templates/fate/http/server/node_modules/.bin/oxlint +22 -0
- package/templates/fate/http/server/node_modules/.bin/tsc +22 -0
- package/templates/fate/http/server/node_modules/.bin/tsx +22 -0
- package/templates/fate/http/server/node_modules/.bin/vitest +22 -0
- package/templates/fate/http/server/node_modules/.bin/vp +22 -0
- package/templates/fate/http/server/node_modules/.bin/vpr +22 -0
- package/templates/fate/http/server/package.json +8 -8
- package/templates/fate/http/server/src/app.tsx +1 -1
- package/templates/fate/http/server/src/drizzle/schema.ts +2 -3
- package/templates/fate/http/server/src/drizzle/seed.tsx +1 -1
- package/templates/fate/http/tsconfig.json +1 -10
- package/templates/fate/prisma/README.md +11 -0
- package/templates/fate/prisma/client/node_modules/.bin/browserslist +22 -0
- package/templates/fate/prisma/client/node_modules/.bin/cf-wrangler +22 -0
- package/templates/fate/prisma/client/node_modules/.bin/drizzle-kit +22 -0
- package/templates/fate/prisma/client/node_modules/.bin/esbuild +22 -0
- package/templates/fate/prisma/client/node_modules/.bin/fate +22 -0
- package/templates/fate/prisma/client/node_modules/.bin/fbtee +22 -0
- package/templates/fate/prisma/client/node_modules/.bin/intent +22 -0
- package/templates/fate/prisma/client/node_modules/.bin/jiti +22 -0
- package/templates/fate/prisma/client/node_modules/.bin/oxfmt +22 -0
- package/templates/fate/prisma/client/node_modules/.bin/oxlint +22 -0
- package/templates/fate/prisma/client/node_modules/.bin/rolldown +22 -0
- package/templates/fate/prisma/client/node_modules/.bin/tsc +22 -0
- package/templates/fate/prisma/client/node_modules/.bin/tsx +22 -0
- package/templates/fate/prisma/client/node_modules/.bin/vitest +22 -0
- package/templates/fate/prisma/client/node_modules/.bin/void +22 -0
- package/templates/fate/prisma/client/node_modules/.bin/vp +22 -0
- package/templates/fate/prisma/client/node_modules/.bin/vpr +22 -0
- package/templates/fate/prisma/client/node_modules/.bin/workerd +22 -0
- package/templates/fate/prisma/client/node_modules/.bin/wrangler +22 -0
- package/templates/fate/prisma/client/node_modules/.bin/wrangler2 +22 -0
- package/templates/fate/prisma/client/node_modules/.bin/yaml +22 -0
- package/templates/fate/prisma/client/package.json +28 -24
- package/templates/fate/prisma/client/pages/layout.tsx +2 -16
- package/templates/fate/prisma/client/src/lib/AvailableLanguages.tsx +3 -3
- package/templates/fate/prisma/client/src/lib/LocaleContext.tsx +61 -0
- package/templates/fate/prisma/client/src/ui/LocaleSwitcher.tsx +26 -44
- package/templates/fate/prisma/client/start.mjs +11 -0
- package/templates/fate/prisma/client/translations/de-DE.json +632 -0
- package/templates/fate/prisma/client/translations/ja-JP.json +632 -0
- package/templates/fate/prisma/client/vite.config.ts +4 -8
- package/templates/fate/prisma/package.json +7 -11
- package/templates/fate/prisma/pnpm-workspace.yaml +4 -4
- package/templates/fate/prisma/server/node_modules/.bin/esbuild +22 -0
- package/templates/fate/prisma/server/node_modules/.bin/fate +22 -0
- package/templates/fate/prisma/server/node_modules/.bin/intent +22 -0
- package/templates/fate/prisma/server/node_modules/.bin/jiti +22 -0
- package/templates/fate/prisma/server/node_modules/.bin/nft +22 -0
- package/templates/fate/prisma/server/node_modules/.bin/nodemon +22 -0
- package/templates/fate/prisma/server/node_modules/.bin/oxfmt +22 -0
- package/templates/fate/prisma/server/node_modules/.bin/oxlint +22 -0
- package/templates/fate/prisma/server/node_modules/.bin/prisma +22 -0
- package/templates/fate/prisma/server/node_modules/.bin/tsc +22 -0
- package/templates/fate/prisma/server/node_modules/.bin/tsx +22 -0
- package/templates/fate/prisma/server/node_modules/.bin/vitest +22 -0
- package/templates/fate/prisma/server/node_modules/.bin/vp +22 -0
- package/templates/fate/prisma/server/node_modules/.bin/vpr +22 -0
- package/templates/fate/prisma/server/node_modules/.bin/yaml +22 -0
- package/templates/fate/prisma/server/package.json +9 -9
- package/templates/fate/prisma/server/prisma.config.ts +2 -1
- package/templates/fate/prisma/server/src/app.tsx +1 -1
- package/templates/fate/prisma/server/src/prisma/schema.prisma +2 -1
- package/templates/fate/prisma/server/src/prisma/seed.tsx +1 -1
- package/templates/fate/prisma/tsconfig.json +1 -10
- package/templates/fate/void/README.md +9 -0
- package/templates/fate/void/_gitignore +3 -0
- package/templates/fate/void/db/migrations/20260508073357_initial_schema.sql +3 -2
- package/templates/fate/void/db/migrations/20260508120500_seed_void_demo.sql +10 -10
- package/templates/fate/void/db/migrations/meta/20260508073357_snapshot.json +10 -3
- package/templates/fate/void/db/schema.ts +2 -3
- package/templates/fate/void/middleware/01.shared.ts +3 -0
- package/templates/fate/void/package.json +30 -25
- package/templates/fate/void/pages/index.tsx +23 -10
- package/templates/fate/void/pages/layout.tsx +22 -19
- package/templates/fate/void/pages/login.tsx +22 -18
- package/templates/fate/void/pages/search.tsx +18 -4
- package/templates/fate/void/pnpm-workspace.yaml +4 -4
- package/templates/fate/void/src/fate/server.ts +2 -1
- package/templates/fate/void/src/lib/AvailableLanguages.tsx +5 -0
- package/templates/fate/void/src/lib/LocaleContext.tsx +61 -0
- package/templates/fate/void/src/ui/CategoryCard.tsx +22 -4
- package/templates/fate/void/src/ui/CreatePost.tsx +12 -7
- package/templates/fate/void/src/ui/Error.tsx +4 -2
- package/templates/fate/void/src/ui/EventCard.tsx +18 -5
- package/templates/fate/void/src/ui/Header.tsx +10 -4
- package/templates/fate/void/src/ui/LocaleSwitcher.tsx +34 -0
- package/templates/fate/void/src/ui/PostCard.tsx +29 -14
- package/templates/fate/void/src/ui/UserCard.tsx +15 -8
- package/templates/fate/void/translations/de-DE.json +863 -0
- package/templates/fate/void/translations/ja-JP.json +863 -0
- package/templates/fate/void/vite.config.ts +6 -6
- package/templates/fate/prisma/client/translations/de_DE.json +0 -689
- package/templates/fate/prisma/client/translations/ja_JP.json +0 -689
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
#!/bin/sh
|
|
2
|
+
basedir=$(dirname "$(echo "$0" | sed -e 's,\\,/,g')")
|
|
3
|
+
|
|
4
|
+
case `uname` in
|
|
5
|
+
*CYGWIN*|*MINGW*|*MSYS*)
|
|
6
|
+
if command -v cygpath > /dev/null 2>&1; then
|
|
7
|
+
basedir=`cygpath -w "$basedir"`
|
|
8
|
+
fi
|
|
9
|
+
;;
|
|
10
|
+
esac
|
|
11
|
+
|
|
12
|
+
if [ -z "$NODE_PATH" ]; then
|
|
13
|
+
export NODE_PATH="/Users/cpojer/Projects/fate/packages/create-fate/templates/fate/cloudflare/node_modules/.pnpm/workerd@1.20260825.1/node_modules/workerd/node_modules:/Users/cpojer/Projects/fate/packages/create-fate/templates/fate/cloudflare/node_modules/.pnpm/workerd@1.20260825.1/node_modules:/Users/cpojer/Projects/fate/packages/create-fate/templates/fate/cloudflare/node_modules/.pnpm/node_modules"
|
|
14
|
+
else
|
|
15
|
+
export NODE_PATH="/Users/cpojer/Projects/fate/packages/create-fate/templates/fate/cloudflare/node_modules/.pnpm/workerd@1.20260825.1/node_modules/workerd/node_modules:/Users/cpojer/Projects/fate/packages/create-fate/templates/fate/cloudflare/node_modules/.pnpm/workerd@1.20260825.1/node_modules:/Users/cpojer/Projects/fate/packages/create-fate/templates/fate/cloudflare/node_modules/.pnpm/node_modules:$NODE_PATH"
|
|
16
|
+
fi
|
|
17
|
+
if [ -x "$basedir/node" ]; then
|
|
18
|
+
exec "$basedir/node" "$basedir/../../../node_modules/.pnpm/workerd@1.20260825.1/node_modules/workerd/bin/workerd" "$@"
|
|
19
|
+
else
|
|
20
|
+
exec node "$basedir/../../../node_modules/.pnpm/workerd@1.20260825.1/node_modules/workerd/bin/workerd" "$@"
|
|
21
|
+
fi
|
|
22
|
+
# cmd-shim-target=/Users/cpojer/Projects/fate/packages/create-fate/templates/fate/cloudflare/node_modules/.pnpm/workerd@1.20260825.1/node_modules/workerd/bin/workerd
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
#!/bin/sh
|
|
2
|
+
basedir=$(dirname "$(echo "$0" | sed -e 's,\\,/,g')")
|
|
3
|
+
|
|
4
|
+
case `uname` in
|
|
5
|
+
*CYGWIN*|*MINGW*|*MSYS*)
|
|
6
|
+
if command -v cygpath > /dev/null 2>&1; then
|
|
7
|
+
basedir=`cygpath -w "$basedir"`
|
|
8
|
+
fi
|
|
9
|
+
;;
|
|
10
|
+
esac
|
|
11
|
+
|
|
12
|
+
if [ -z "$NODE_PATH" ]; then
|
|
13
|
+
export NODE_PATH="/Users/cpojer/Projects/fate/packages/create-fate/templates/fate/cloudflare/node_modules/.pnpm/wrangler@4.126.0_@cloudflare+workers-types@4.20260702.1/node_modules/wrangler/node_modules:/Users/cpojer/Projects/fate/packages/create-fate/templates/fate/cloudflare/node_modules/.pnpm/wrangler@4.126.0_@cloudflare+workers-types@4.20260702.1/node_modules:/Users/cpojer/Projects/fate/packages/create-fate/templates/fate/cloudflare/node_modules/.pnpm/node_modules"
|
|
14
|
+
else
|
|
15
|
+
export NODE_PATH="/Users/cpojer/Projects/fate/packages/create-fate/templates/fate/cloudflare/node_modules/.pnpm/wrangler@4.126.0_@cloudflare+workers-types@4.20260702.1/node_modules/wrangler/node_modules:/Users/cpojer/Projects/fate/packages/create-fate/templates/fate/cloudflare/node_modules/.pnpm/wrangler@4.126.0_@cloudflare+workers-types@4.20260702.1/node_modules:/Users/cpojer/Projects/fate/packages/create-fate/templates/fate/cloudflare/node_modules/.pnpm/node_modules:$NODE_PATH"
|
|
16
|
+
fi
|
|
17
|
+
if [ -x "$basedir/node" ]; then
|
|
18
|
+
exec "$basedir/node" "$basedir/../../../node_modules/.pnpm/wrangler@4.126.0_@cloudflare+workers-types@4.20260702.1/node_modules/wrangler/bin/wrangler.js" "$@"
|
|
19
|
+
else
|
|
20
|
+
exec node "$basedir/../../../node_modules/.pnpm/wrangler@4.126.0_@cloudflare+workers-types@4.20260702.1/node_modules/wrangler/bin/wrangler.js" "$@"
|
|
21
|
+
fi
|
|
22
|
+
# cmd-shim-target=/Users/cpojer/Projects/fate/packages/create-fate/templates/fate/cloudflare/node_modules/.pnpm/wrangler@4.126.0_@cloudflare+workers-types@4.20260702.1/node_modules/wrangler/bin/wrangler.js
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
#!/bin/sh
|
|
2
|
+
basedir=$(dirname "$(echo "$0" | sed -e 's,\\,/,g')")
|
|
3
|
+
|
|
4
|
+
case `uname` in
|
|
5
|
+
*CYGWIN*|*MINGW*|*MSYS*)
|
|
6
|
+
if command -v cygpath > /dev/null 2>&1; then
|
|
7
|
+
basedir=`cygpath -w "$basedir"`
|
|
8
|
+
fi
|
|
9
|
+
;;
|
|
10
|
+
esac
|
|
11
|
+
|
|
12
|
+
if [ -z "$NODE_PATH" ]; then
|
|
13
|
+
export NODE_PATH="/Users/cpojer/Projects/fate/packages/create-fate/templates/fate/cloudflare/node_modules/.pnpm/wrangler@4.126.0_@cloudflare+workers-types@4.20260702.1/node_modules/wrangler/node_modules:/Users/cpojer/Projects/fate/packages/create-fate/templates/fate/cloudflare/node_modules/.pnpm/wrangler@4.126.0_@cloudflare+workers-types@4.20260702.1/node_modules:/Users/cpojer/Projects/fate/packages/create-fate/templates/fate/cloudflare/node_modules/.pnpm/node_modules"
|
|
14
|
+
else
|
|
15
|
+
export NODE_PATH="/Users/cpojer/Projects/fate/packages/create-fate/templates/fate/cloudflare/node_modules/.pnpm/wrangler@4.126.0_@cloudflare+workers-types@4.20260702.1/node_modules/wrangler/node_modules:/Users/cpojer/Projects/fate/packages/create-fate/templates/fate/cloudflare/node_modules/.pnpm/wrangler@4.126.0_@cloudflare+workers-types@4.20260702.1/node_modules:/Users/cpojer/Projects/fate/packages/create-fate/templates/fate/cloudflare/node_modules/.pnpm/node_modules:$NODE_PATH"
|
|
16
|
+
fi
|
|
17
|
+
if [ -x "$basedir/node" ]; then
|
|
18
|
+
exec "$basedir/node" "$basedir/../../../node_modules/.pnpm/wrangler@4.126.0_@cloudflare+workers-types@4.20260702.1/node_modules/wrangler/bin/wrangler.js" "$@"
|
|
19
|
+
else
|
|
20
|
+
exec node "$basedir/../../../node_modules/.pnpm/wrangler@4.126.0_@cloudflare+workers-types@4.20260702.1/node_modules/wrangler/bin/wrangler.js" "$@"
|
|
21
|
+
fi
|
|
22
|
+
# cmd-shim-target=/Users/cpojer/Projects/fate/packages/create-fate/templates/fate/cloudflare/node_modules/.pnpm/wrangler@4.126.0_@cloudflare+workers-types@4.20260702.1/node_modules/wrangler/bin/wrangler.js
|
|
@@ -9,42 +9,47 @@
|
|
|
9
9
|
},
|
|
10
10
|
"type": "module",
|
|
11
11
|
"scripts": {
|
|
12
|
-
"build": "vp build",
|
|
12
|
+
"build": "vp run fbtee:all && vp build",
|
|
13
13
|
"dev": "vp dev",
|
|
14
14
|
"dev:setup": "vp run fbtee:all",
|
|
15
15
|
"fate:generate": "vp exec fate generate",
|
|
16
|
-
"fbtee:all": "
|
|
16
|
+
"fbtee:all": "vp run fbtee:collect && vp run fbtee:translate",
|
|
17
|
+
"fbtee:collect": "vp exec fbtee collect",
|
|
18
|
+
"fbtee:prepare": "vp run fbtee:collect && vp exec fbtee prepare-translations --source-strings source_strings.json --output-dir translations --locales de-DE ja-JP",
|
|
19
|
+
"fbtee:translate": "vp exec fbtee translate --source-strings source_strings.json --output-dir src/translations --output-locale-style=bcp47",
|
|
20
|
+
"start": "node start.mjs"
|
|
17
21
|
},
|
|
18
22
|
"dependencies": {
|
|
19
23
|
"@app/server": "workspace:*",
|
|
24
|
+
"@hono/node-server": "^2.1.1",
|
|
20
25
|
"@nkzw/core": "^1.3.1",
|
|
21
26
|
"@nkzw/define-env": "^1.1.0",
|
|
22
27
|
"@nkzw/stack": "^2.3.2",
|
|
23
|
-
"@radix-ui/react-slot": "^1.
|
|
24
|
-
"@void/react": "^0.
|
|
25
|
-
"better-auth": "
|
|
28
|
+
"@radix-ui/react-slot": "^1.3.3",
|
|
29
|
+
"@void/react": "^0.10.12",
|
|
30
|
+
"better-auth": "1.7.2",
|
|
26
31
|
"cf-fate": "latest",
|
|
27
32
|
"class-variance-authority": "^0.7.1",
|
|
28
33
|
"clsx": "^2.1.1",
|
|
29
|
-
"fbtee": "^
|
|
30
|
-
"lucide-react": "^1.
|
|
31
|
-
"react": "^19.2.
|
|
32
|
-
"react-dom": "^19.2.
|
|
33
|
-
"react-error-boundary": "^6.1.
|
|
34
|
+
"fbtee": "^4.0.0",
|
|
35
|
+
"lucide-react": "^1.34.0",
|
|
36
|
+
"react": "^19.2.8",
|
|
37
|
+
"react-dom": "^19.2.8",
|
|
38
|
+
"react-error-boundary": "^6.1.3",
|
|
34
39
|
"react-fate": "latest",
|
|
35
|
-
"tailwind-merge": "^3.
|
|
36
|
-
"void": "^0.
|
|
40
|
+
"tailwind-merge": "^3.6.0",
|
|
41
|
+
"void": "^0.10.12"
|
|
37
42
|
},
|
|
38
43
|
"devDependencies": {
|
|
39
|
-
"@nkzw/
|
|
40
|
-
"@
|
|
41
|
-
"@tailwindcss/vite": "^4.
|
|
42
|
-
"@types/
|
|
43
|
-
"@types/
|
|
44
|
-
"@types/react": "^19.2.
|
|
45
|
-
"@
|
|
46
|
-
"
|
|
47
|
-
"tailwindcss": "^4.
|
|
44
|
+
"@nkzw/fbtee-cli": "^4.0.0",
|
|
45
|
+
"@nkzw/vite-plugin-fbtee": "^4.0.0",
|
|
46
|
+
"@tailwindcss/vite": "^4.3.3",
|
|
47
|
+
"@types/node": "^26.4.0",
|
|
48
|
+
"@types/react": "^19.2.18",
|
|
49
|
+
"@types/react-dom": "^19.2.5",
|
|
50
|
+
"@vitejs/plugin-react": "^6.1.0",
|
|
51
|
+
"oxc-transform-react": "^0.147.0",
|
|
52
|
+
"tailwindcss": "^4.3.3",
|
|
48
53
|
"vite": "catalog:",
|
|
49
54
|
"vite-plus": "catalog:"
|
|
50
55
|
},
|
|
@@ -1,14 +1,12 @@
|
|
|
1
|
+
import Stack from '@nkzw/stack';
|
|
1
2
|
/// <reference types="fbtee/ReactTypes.d.ts" />
|
|
2
|
-
|
|
3
3
|
import '../src/App.css';
|
|
4
|
-
import Stack from '@nkzw/stack';
|
|
5
|
-
import { createLocaleContext } from 'fbtee';
|
|
6
4
|
import { ReactNode, Suspense, useMemo } from 'react';
|
|
7
5
|
import { ErrorBoundary } from 'react-error-boundary';
|
|
8
6
|
import { FateClient } from 'react-fate';
|
|
9
7
|
import { createFateClient } from 'react-fate/client';
|
|
10
|
-
import AvailableLanguages from '../src/lib/AvailableLanguages.tsx';
|
|
11
8
|
import env from '../src/lib/env.tsx';
|
|
9
|
+
import LocaleContext from '../src/lib/LocaleContext.tsx';
|
|
12
10
|
import Card from '../src/ui/Card.tsx';
|
|
13
11
|
import Error from '../src/ui/Error.tsx';
|
|
14
12
|
import Header from '../src/ui/Header.tsx';
|
|
@@ -23,18 +21,6 @@ const Thinking = () => (
|
|
|
23
21
|
</Section>
|
|
24
22
|
);
|
|
25
23
|
|
|
26
|
-
const LocaleContext = createLocaleContext({
|
|
27
|
-
availableLanguages: AvailableLanguages,
|
|
28
|
-
clientLocales: [navigator.language, ...navigator.languages],
|
|
29
|
-
loadLocale: async (locale: string) => {
|
|
30
|
-
if (locale !== 'en_US' && AvailableLanguages.has(locale)) {
|
|
31
|
-
return (await import(`../src/translations/${locale}.json`)).default[locale];
|
|
32
|
-
}
|
|
33
|
-
|
|
34
|
-
return {};
|
|
35
|
-
},
|
|
36
|
-
});
|
|
37
|
-
|
|
38
24
|
export default function Layout({ children }: { children: ReactNode }) {
|
|
39
25
|
const { data: session } = AuthClient.useSession();
|
|
40
26
|
const userId = session?.user.id;
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
/// <reference types="fbtee/ReactTypes.d.ts" />
|
|
2
|
+
|
|
3
|
+
import { createLocaleContext, useLocaleContext } from 'fbtee';
|
|
4
|
+
import { ReactNode, startTransition, useEffect, useState } from 'react';
|
|
5
|
+
import AvailableLanguages from './AvailableLanguages.tsx';
|
|
6
|
+
|
|
7
|
+
const Context = createLocaleContext({
|
|
8
|
+
availableLanguages: AvailableLanguages,
|
|
9
|
+
// Keep the server and first client render identical; restore preferences after hydration.
|
|
10
|
+
clientLocales: ['en-US'],
|
|
11
|
+
fallbackLocale: 'en-US',
|
|
12
|
+
loadLocale: async (locale) => {
|
|
13
|
+
if (locale !== 'en-US' && AvailableLanguages.has(locale)) {
|
|
14
|
+
return (await import(`../translations/${locale}.json`)).default[locale];
|
|
15
|
+
}
|
|
16
|
+
return {};
|
|
17
|
+
},
|
|
18
|
+
});
|
|
19
|
+
|
|
20
|
+
function RestoreLocale({ restored, onRestore }: { restored: boolean; onRestore: () => void }) {
|
|
21
|
+
const { locale, setLocale } = useLocaleContext();
|
|
22
|
+
useEffect(() => {
|
|
23
|
+
if (restored) return;
|
|
24
|
+
onRestore();
|
|
25
|
+
let savedLocale: string | null = null;
|
|
26
|
+
try {
|
|
27
|
+
savedLocale = localStorage.getItem('fbtee:locale');
|
|
28
|
+
} catch {
|
|
29
|
+
// Browser storage can be unavailable.
|
|
30
|
+
}
|
|
31
|
+
const preferred = [savedLocale, ...navigator.languages, navigator.language]
|
|
32
|
+
.filter((value): value is string => !!value)
|
|
33
|
+
.map((value) => value.replaceAll('_', '-'));
|
|
34
|
+
const nextLocale = preferred
|
|
35
|
+
.map((value) =>
|
|
36
|
+
AvailableLanguages.has(value)
|
|
37
|
+
? value
|
|
38
|
+
: [...AvailableLanguages.keys()].find(
|
|
39
|
+
(available) => available.split('-')[0] === value.split('-')[0],
|
|
40
|
+
),
|
|
41
|
+
)
|
|
42
|
+
.find(Boolean);
|
|
43
|
+
if (nextLocale && nextLocale !== locale) {
|
|
44
|
+
startTransition(() => setLocale(nextLocale));
|
|
45
|
+
}
|
|
46
|
+
}, [locale, setLocale, restored, onRestore]);
|
|
47
|
+
useEffect(() => {
|
|
48
|
+
document.documentElement.lang = locale;
|
|
49
|
+
}, [locale]);
|
|
50
|
+
return null;
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
export default function LocaleContext({ children }: { children: ReactNode }) {
|
|
54
|
+
const [restored, setRestored] = useState(false);
|
|
55
|
+
return (
|
|
56
|
+
<Context>
|
|
57
|
+
<RestoreLocale restored={restored} onRestore={() => setRestored(true)} />
|
|
58
|
+
{children}
|
|
59
|
+
</Context>
|
|
60
|
+
);
|
|
61
|
+
}
|
|
@@ -1,52 +1,34 @@
|
|
|
1
|
-
import { VStack } from '@nkzw/stack';
|
|
2
|
-
import { cx } from 'class-variance-authority';
|
|
3
1
|
import { useLocaleContext } from 'fbtee';
|
|
4
|
-
import {
|
|
2
|
+
import { startTransition } from 'react';
|
|
5
3
|
import AvailableLanguages from '../lib/AvailableLanguages.tsx';
|
|
6
|
-
import { Button } from './Button.tsx';
|
|
7
|
-
import Card from './Card.tsx';
|
|
8
4
|
|
|
9
5
|
export default function LocaleSwitcher() {
|
|
10
|
-
const { locale
|
|
11
|
-
|
|
6
|
+
const { locale, localeChangeIsPending, setLocale } = useLocaleContext();
|
|
12
7
|
return (
|
|
13
|
-
|
|
14
|
-
<
|
|
15
|
-
<
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
8
|
+
<label className="inline-flex items-center gap-2 text-sm">
|
|
9
|
+
<span className="sr-only">
|
|
10
|
+
<fbt desc="Locale switcher button">Change Language</fbt>
|
|
11
|
+
</span>
|
|
12
|
+
<select
|
|
13
|
+
className="rounded-md border border-gray-300 bg-background px-2 py-1 text-foreground"
|
|
14
|
+
disabled={localeChangeIsPending}
|
|
15
|
+
onChange={(event) => {
|
|
16
|
+
const nextLocale = event.target.value;
|
|
17
|
+
try {
|
|
18
|
+
localStorage.setItem('fbtee:locale', nextLocale);
|
|
19
|
+
} catch {
|
|
20
|
+
// Changing the language still works without browser storage.
|
|
21
|
+
}
|
|
22
|
+
startTransition(() => setLocale(nextLocale));
|
|
23
|
+
}}
|
|
24
|
+
value={locale}
|
|
26
25
|
>
|
|
27
|
-
|
|
28
|
-
{
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
asChild
|
|
35
|
-
className={cx(
|
|
36
|
-
'transition-background border-slate-200 bg-transparent duration-150 hover:border-slate-300 hover:bg-slate-200 dark:hover:bg-slate-900 dark:text-white active:py-2',
|
|
37
|
-
{
|
|
38
|
-
'bg-slate-100 dark:bg-slate-900': currentLocale === locale,
|
|
39
|
-
},
|
|
40
|
-
)}
|
|
41
|
-
key={locale}
|
|
42
|
-
size="sm"
|
|
43
|
-
variant="outline"
|
|
44
|
-
>
|
|
45
|
-
<a className="w-full flex-1 cursor-pointer p-2">{name}</a>
|
|
46
|
-
</Button>
|
|
47
|
-
))}
|
|
48
|
-
</VStack>
|
|
49
|
-
</Card>
|
|
50
|
-
</>
|
|
26
|
+
{[...AvailableLanguages].map(([value, name]) => (
|
|
27
|
+
<option key={value} value={value}>
|
|
28
|
+
{name}
|
|
29
|
+
</option>
|
|
30
|
+
))}
|
|
31
|
+
</select>
|
|
32
|
+
</label>
|
|
51
33
|
);
|
|
52
34
|
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { readFileSync } from 'node:fs';
|
|
2
|
+
import process from 'node:process';
|
|
3
|
+
import { fileURLToPath, URL } from 'node:url';
|
|
4
|
+
|
|
5
|
+
const dist = new URL('./dist/', import.meta.url);
|
|
6
|
+
// Void's Node renderer reads this manifest to emit client scripts and styles.
|
|
7
|
+
globalThis.__VITE_MANIFEST__ = JSON.parse(
|
|
8
|
+
readFileSync(new URL('client/.vite/manifest.json', dist), 'utf8'),
|
|
9
|
+
);
|
|
10
|
+
process.chdir(fileURLToPath(dist));
|
|
11
|
+
await import(new URL('ssr/index.js', dist).href);
|