create-croissant 0.1.55 → 0.1.57
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/dist/add.js +5 -5
- package/dist/index.js +1 -1
- package/package.json +1 -1
- package/template/README.md +10 -3
- package/template/apps/desktop/.vscode/extensions.json +1 -1
- package/template/apps/desktop/README.md +3 -30
- package/template/apps/desktop/index.html +14 -0
- package/template/apps/desktop/package.json +21 -32
- package/template/apps/desktop/public/tauri.svg +6 -0
- package/template/apps/desktop/public/vite.svg +1 -0
- package/template/apps/desktop/src/App.css +116 -0
- package/template/apps/desktop/src/App.tsx +51 -0
- package/template/apps/desktop/src/assets/react.svg +1 -0
- package/template/apps/desktop/src/{renderer/src/components → components}/app-sidebar.tsx +7 -3
- package/template/apps/desktop/src/components/login-form.tsx +160 -0
- package/template/apps/desktop/src/components/search-form.tsx +19 -0
- package/template/apps/desktop/src/components/signup-form.tsx +206 -0
- package/template/apps/desktop/src/components/version-switcher.tsx +54 -0
- package/template/apps/desktop/src/env.d.ts +1 -0
- package/template/apps/desktop/src/lib/auth-client.ts +5 -0
- package/template/apps/desktop/src/lib/orpc.ts +10 -0
- package/template/apps/desktop/src/main.tsx +12 -0
- package/template/apps/desktop/src/{renderer/src/routeTree.gen.ts → routeTree.gen.ts} +21 -0
- package/template/apps/desktop/src/router.tsx +19 -0
- package/template/apps/desktop/src/{renderer/src/routes → routes}/__root.tsx +9 -5
- package/template/apps/desktop/src/{renderer/src/routes → routes}/_auth/account.tsx +18 -10
- package/template/apps/desktop/src/routes/_auth/dashboard.tsx +58 -0
- package/template/apps/desktop/src/{renderer/src/routes → routes}/_auth/examples/client-orpc-auth.tsx +17 -6
- package/template/apps/desktop/src/{renderer/src/routes → routes}/_auth.tsx +2 -14
- package/template/apps/desktop/src/{renderer/src/routes → routes}/_public/examples/client-orpc.tsx +25 -5
- package/template/apps/desktop/src/{renderer/src/routes → routes}/_public/index.tsx +21 -9
- package/template/apps/desktop/src/routes/_public/login.tsx +34 -0
- package/template/apps/desktop/src/routes/_public/signup.tsx +31 -0
- package/template/apps/desktop/src/{renderer/src/routes → routes}/_public.tsx +1 -1
- package/template/apps/desktop/src/vite-env.d.ts +1 -0
- package/template/apps/desktop/src-tauri/Cargo.toml +25 -0
- package/template/apps/desktop/src-tauri/build.rs +3 -0
- package/template/apps/desktop/src-tauri/capabilities/default.json +7 -0
- package/template/apps/desktop/src-tauri/icons/128x128.png +0 -0
- package/template/apps/desktop/src-tauri/icons/128x128@2x.png +0 -0
- package/template/apps/desktop/src-tauri/icons/32x32.png +0 -0
- package/template/apps/desktop/src-tauri/icons/Square107x107Logo.png +0 -0
- package/template/apps/desktop/src-tauri/icons/Square142x142Logo.png +0 -0
- package/template/apps/desktop/src-tauri/icons/Square150x150Logo.png +0 -0
- package/template/apps/desktop/src-tauri/icons/Square284x284Logo.png +0 -0
- package/template/apps/desktop/src-tauri/icons/Square30x30Logo.png +0 -0
- package/template/apps/desktop/src-tauri/icons/Square310x310Logo.png +0 -0
- package/template/apps/desktop/src-tauri/icons/Square44x44Logo.png +0 -0
- package/template/apps/desktop/src-tauri/icons/Square71x71Logo.png +0 -0
- package/template/apps/desktop/src-tauri/icons/Square89x89Logo.png +0 -0
- package/template/apps/desktop/src-tauri/icons/StoreLogo.png +0 -0
- package/template/apps/desktop/src-tauri/icons/icon.icns +0 -0
- package/template/apps/desktop/src-tauri/icons/icon.ico +0 -0
- package/template/apps/desktop/src-tauri/icons/icon.png +0 -0
- package/template/apps/desktop/src-tauri/src/lib.rs +14 -0
- package/template/apps/desktop/src-tauri/src/main.rs +6 -0
- package/template/apps/desktop/src-tauri/tauri.conf.json +35 -0
- package/template/apps/desktop/tsconfig.json +15 -4
- package/template/apps/desktop/tsconfig.node.json +5 -3
- package/template/apps/desktop/vite.config.ts +40 -0
- package/template/apps/mobile/app/(tabs)/_layout.tsx +11 -10
- package/template/apps/mobile/app/(tabs)/explore.tsx +29 -27
- package/template/apps/mobile/app/(tabs)/index.tsx +25 -24
- package/template/apps/mobile/app/_layout.tsx +8 -8
- package/template/apps/mobile/app/modal.tsx +6 -6
- package/template/apps/mobile/components/external-link.tsx +5 -5
- package/template/apps/mobile/components/haptic-tab.tsx +4 -4
- package/template/apps/mobile/components/hello-wave.tsx +5 -4
- package/template/apps/mobile/components/parallax-scroll-view.tsx +15 -13
- package/template/apps/mobile/components/themed-text.tsx +14 -14
- package/template/apps/mobile/components/themed-view.tsx +3 -3
- package/template/apps/mobile/components/ui/collapsible.tsx +14 -13
- package/template/apps/mobile/components/ui/icon-symbol.ios.tsx +4 -4
- package/template/apps/mobile/components/ui/icon-symbol.tsx +9 -9
- package/template/apps/mobile/constants/theme.ts +19 -19
- package/template/apps/mobile/hooks/use-color-scheme.ts +1 -1
- package/template/apps/mobile/hooks/use-color-scheme.web.ts +3 -3
- package/template/apps/mobile/hooks/use-theme-color.ts +4 -4
- package/template/apps/mobile/package.json +7 -7
- package/template/apps/mobile/scripts/reset-project.js +2 -2
- package/template/apps/mobile/tsconfig.json +3 -13
- package/template/apps/platform/package.json +0 -1
- package/template/apps/platform/src/components/login-form.tsx +4 -1
- package/template/apps/platform/src/components/signup-form.tsx +15 -12
- package/template/apps/platform/src/routes/__root.tsx +7 -1
- package/template/apps/platform/src/routes/_public/examples/client-orpc.tsx +12 -3
- package/template/apps/platform/src/routes/_public/examples/ssr-orpc.tsx +2 -1
- package/template/package.json +7 -7
- package/template/packages/orpc/package.json +4 -4
- package/template/pnpm-workspace.yaml +5 -5
- package/template/apps/desktop/.editorconfig +0 -9
- package/template/apps/desktop/.eslintcache +0 -1
- package/template/apps/desktop/.vscode/launch.json +0 -39
- package/template/apps/desktop/.vscode/settings.json +0 -11
- package/template/apps/desktop/build/entitlements.mac.plist +0 -12
- package/template/apps/desktop/build/icon.icns +0 -0
- package/template/apps/desktop/build/icon.ico +0 -0
- package/template/apps/desktop/build/icon.png +0 -0
- package/template/apps/desktop/dev-app-update.yml +0 -3
- package/template/apps/desktop/electron-builder.yml +0 -45
- package/template/apps/desktop/electron.vite.config.ts +0 -26
- package/template/apps/desktop/resources/icon.png +0 -0
- package/template/apps/desktop/src/main/index.ts +0 -88
- package/template/apps/desktop/src/preload/index.d.ts +0 -11
- package/template/apps/desktop/src/preload/index.ts +0 -29
- package/template/apps/desktop/src/renderer/index.html +0 -17
- package/template/apps/desktop/src/renderer/src/assets/base.css +0 -67
- package/template/apps/desktop/src/renderer/src/assets/electron.svg +0 -10
- package/template/apps/desktop/src/renderer/src/assets/main.css +0 -171
- package/template/apps/desktop/src/renderer/src/assets/wavy-lines.svg +0 -25
- package/template/apps/desktop/src/renderer/src/components/Versions.tsx +0 -15
- package/template/apps/desktop/src/renderer/src/components/login-form.tsx +0 -57
- package/template/apps/desktop/src/renderer/src/env.d.ts +0 -6
- package/template/apps/desktop/src/renderer/src/lib/auth-client.ts +0 -5
- package/template/apps/desktop/src/renderer/src/lib/orpc.ts +0 -12
- package/template/apps/desktop/src/renderer/src/main.tsx +0 -22
- package/template/apps/desktop/src/renderer/src/routes/_auth/dashboard.tsx +0 -46
- package/template/apps/desktop/src/renderer/src/routes/_public/login.tsx +0 -16
- package/template/apps/desktop/tsconfig.web.json +0 -19
- package/template/apps/platform/src/lib/auth-client-electron.ts +0 -13
package/template/apps/desktop/src/{renderer/src/routes → routes}/_public/examples/client-orpc.tsx
RENAMED
|
@@ -11,7 +11,12 @@ import { Field, FieldError, FieldLabel } from "@workspace/ui/components/field";
|
|
|
11
11
|
|
|
12
12
|
import type { router } from "@workspace/orpc/router";
|
|
13
13
|
import type { InferRouterOutputs } from "@orpc/server";
|
|
14
|
-
import {
|
|
14
|
+
import {
|
|
15
|
+
usePlanets,
|
|
16
|
+
useCreatePlanet,
|
|
17
|
+
useUpdatePlanet,
|
|
18
|
+
useDeletePlanet,
|
|
19
|
+
} from "@workspace/orpc/react";
|
|
15
20
|
|
|
16
21
|
type Outputs = InferRouterOutputs<typeof router>;
|
|
17
22
|
type Planet = Outputs["planets"]["getPlanets"][number];
|
|
@@ -28,6 +33,17 @@ const planetSchema = z.object({
|
|
|
28
33
|
});
|
|
29
34
|
|
|
30
35
|
export const Route = createFileRoute("/_public/examples/client-orpc")({
|
|
36
|
+
head: () => ({
|
|
37
|
+
meta: [
|
|
38
|
+
{
|
|
39
|
+
title: "Client + oRPC Example | Croissant Stack",
|
|
40
|
+
},
|
|
41
|
+
{
|
|
42
|
+
name: "description",
|
|
43
|
+
content: "Explore client-side data fetching and mutations with oRPC in Croissant Stack.",
|
|
44
|
+
},
|
|
45
|
+
],
|
|
46
|
+
}),
|
|
31
47
|
component: ClientORPC,
|
|
32
48
|
});
|
|
33
49
|
|
|
@@ -124,7 +140,7 @@ function ClientORPC() {
|
|
|
124
140
|
</p>
|
|
125
141
|
</div>
|
|
126
142
|
|
|
127
|
-
<div className="rounded-lg border p-6 bg-muted/30
|
|
143
|
+
<div className="rounded-lg border p-6 bg-muted/30">
|
|
128
144
|
<h2 className="font-semibold mb-4 flex items-center gap-2">
|
|
129
145
|
{editingId ? <Pencil className="h-4 w-4" /> : <Plus className="h-4 w-4" />}
|
|
130
146
|
{editingId ? "Edit Planet" : "Add New Planet"}
|
|
@@ -228,10 +244,14 @@ function ClientORPC() {
|
|
|
228
244
|
<Button
|
|
229
245
|
type="submit"
|
|
230
246
|
className="flex items-center gap-2"
|
|
231
|
-
disabled={
|
|
247
|
+
disabled={
|
|
248
|
+
!state.canSubmit || state.isSubmitting || updateMutation.isPending
|
|
249
|
+
}
|
|
232
250
|
>
|
|
233
251
|
<Check className="h-4 w-4" />{" "}
|
|
234
|
-
{state.isSubmitting || updateMutation.isPending
|
|
252
|
+
{state.isSubmitting || updateMutation.isPending
|
|
253
|
+
? "Saving..."
|
|
254
|
+
: "Save Changes"}
|
|
235
255
|
</Button>
|
|
236
256
|
<Button
|
|
237
257
|
variant="outline"
|
|
@@ -270,7 +290,7 @@ function ClientORPC() {
|
|
|
270
290
|
{planets.map((planet) => (
|
|
271
291
|
<div
|
|
272
292
|
key={planet.id}
|
|
273
|
-
className="flex items-center justify-between rounded-lg border p-4 bg-background shadow-sm hover:shadow-md transition-shadow
|
|
293
|
+
className="flex items-center justify-between rounded-lg border p-4 bg-background shadow-sm hover:shadow-md transition-shadow"
|
|
274
294
|
>
|
|
275
295
|
<div className="flex-1">
|
|
276
296
|
<div className="flex items-center gap-2">
|
|
@@ -1,14 +1,28 @@
|
|
|
1
1
|
import { Link, createFileRoute } from "@tanstack/react-router";
|
|
2
2
|
import { Button } from "@workspace/ui/components/button";
|
|
3
|
-
import {
|
|
3
|
+
import type { AppRouter } from "@workspace/orpc/router";
|
|
4
|
+
import type { InferRouterOutputs } from "@orpc/server";
|
|
5
|
+
import { orpc } from "@/lib/orpc";
|
|
6
|
+
|
|
7
|
+
type Outputs = InferRouterOutputs<AppRouter>;
|
|
8
|
+
type Planet = Outputs["planets"]["getPlanets"][number];
|
|
4
9
|
|
|
5
10
|
export const Route = createFileRoute("/_public/")({
|
|
11
|
+
loader: async () => {
|
|
12
|
+
const [helloRes, planets] = await Promise.all([
|
|
13
|
+
orpc.hello({ name: "Croissant Stack Desktop" }),
|
|
14
|
+
orpc.planets.getPlanets(),
|
|
15
|
+
]);
|
|
16
|
+
return {
|
|
17
|
+
message: helloRes.message,
|
|
18
|
+
planets,
|
|
19
|
+
};
|
|
20
|
+
},
|
|
6
21
|
component: App,
|
|
7
22
|
});
|
|
8
23
|
|
|
9
24
|
function App() {
|
|
10
|
-
const {
|
|
11
|
-
const { data: planets, isLoading: planetsLoading } = usePlanets();
|
|
25
|
+
const { message, planets } = Route.useLoaderData();
|
|
12
26
|
|
|
13
27
|
return (
|
|
14
28
|
<div className="flex min-h-svh p-6">
|
|
@@ -16,20 +30,18 @@ function App() {
|
|
|
16
30
|
<div>
|
|
17
31
|
<h1 className="font-medium text-2xl mb-4">Desktop Project ready!</h1>
|
|
18
32
|
<p>
|
|
19
|
-
oRPC integration: <span className="font-bold">{
|
|
33
|
+
oRPC integration: <span className="font-bold">{message}</span>
|
|
20
34
|
</p>
|
|
21
35
|
|
|
22
36
|
<div className="mt-8">
|
|
23
37
|
<h2 className="text-xl font-semibold mb-2">Planets from Database:</h2>
|
|
24
|
-
{
|
|
25
|
-
<p className="text-gray-500 italic">Loading planets...</p>
|
|
26
|
-
) : !planets || planets.length === 0 ? (
|
|
38
|
+
{planets.length === 0 ? (
|
|
27
39
|
<p className="text-gray-500 italic">
|
|
28
|
-
No planets found in the database.
|
|
40
|
+
No planets found in the database. Run `db:push` and seed data if needed.
|
|
29
41
|
</p>
|
|
30
42
|
) : (
|
|
31
43
|
<ul className="grid grid-cols-1 gap-2">
|
|
32
|
-
{planets.map((planet) => (
|
|
44
|
+
{planets.map((planet: Planet) => (
|
|
33
45
|
<li key={planet.id} className="rounded-md border p-3 shadow-sm">
|
|
34
46
|
<span className="font-bold">{planet.name}</span> - {planet.description}
|
|
35
47
|
</li>
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import { createFileRoute } from "@tanstack/react-router";
|
|
2
|
+
import { LoginForm } from "@/components/login-form";
|
|
3
|
+
|
|
4
|
+
export const Route = createFileRoute("/_public/login")({
|
|
5
|
+
head: () => ({
|
|
6
|
+
meta: [
|
|
7
|
+
{
|
|
8
|
+
title: "Sign In | Croissant Stack",
|
|
9
|
+
},
|
|
10
|
+
{
|
|
11
|
+
name: "description",
|
|
12
|
+
content: "Sign in to your Croissant Stack account.",
|
|
13
|
+
},
|
|
14
|
+
{
|
|
15
|
+
name: "robots",
|
|
16
|
+
content: "noindex, follow",
|
|
17
|
+
},
|
|
18
|
+
],
|
|
19
|
+
}),
|
|
20
|
+
headers: () => ({
|
|
21
|
+
"Cache-Control": "public, max-age=3600, s-maxage=3600, stale-while-revalidate=86400",
|
|
22
|
+
}),
|
|
23
|
+
component: Login,
|
|
24
|
+
});
|
|
25
|
+
|
|
26
|
+
function Login() {
|
|
27
|
+
return (
|
|
28
|
+
<div className="flex min-h-svh items-center justify-center p-6">
|
|
29
|
+
<div className="w-full max-w-sm">
|
|
30
|
+
<LoginForm />
|
|
31
|
+
</div>
|
|
32
|
+
</div>
|
|
33
|
+
);
|
|
34
|
+
}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { createFileRoute } from "@tanstack/react-router";
|
|
2
|
+
import { SignupForm } from "@/components/signup-form";
|
|
3
|
+
|
|
4
|
+
export const Route = createFileRoute("/_public/signup")({
|
|
5
|
+
head: () => ({
|
|
6
|
+
meta: [
|
|
7
|
+
{
|
|
8
|
+
title: "Create an Account | Croissant Stack",
|
|
9
|
+
},
|
|
10
|
+
{
|
|
11
|
+
name: "description",
|
|
12
|
+
content:
|
|
13
|
+
"Join Croissant Stack today. Create an account to start building with the best stack.",
|
|
14
|
+
},
|
|
15
|
+
],
|
|
16
|
+
}),
|
|
17
|
+
headers: () => ({
|
|
18
|
+
"Cache-Control": "public, max-age=3600, s-maxage=3600, stale-while-revalidate=86400",
|
|
19
|
+
}),
|
|
20
|
+
component: Signup,
|
|
21
|
+
});
|
|
22
|
+
|
|
23
|
+
function Signup() {
|
|
24
|
+
return (
|
|
25
|
+
<div className="flex min-h-svh items-center justify-center p-6">
|
|
26
|
+
<div className="w-full max-w-sm">
|
|
27
|
+
<SignupForm />
|
|
28
|
+
</div>
|
|
29
|
+
</div>
|
|
30
|
+
);
|
|
31
|
+
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { Outlet, createFileRoute } from "@tanstack/react-router";
|
|
2
2
|
import { SidebarProvider, SidebarTrigger } from "@workspace/ui/components/sidebar";
|
|
3
|
-
import { PublicSidebar } from "
|
|
3
|
+
import { PublicSidebar } from "@/components/app-sidebar";
|
|
4
4
|
|
|
5
5
|
export const Route = createFileRoute("/_public")({
|
|
6
6
|
component: PublicLayout,
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
/// <reference types="vite/client" />
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
[package]
|
|
2
|
+
name = "desktop"
|
|
3
|
+
version = "0.1.0"
|
|
4
|
+
description = "A Tauri App"
|
|
5
|
+
authors = ["you"]
|
|
6
|
+
edition = "2021"
|
|
7
|
+
|
|
8
|
+
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
|
|
9
|
+
|
|
10
|
+
[lib]
|
|
11
|
+
# The `_lib` suffix may seem redundant but it is necessary
|
|
12
|
+
# to make the lib name unique and wouldn't conflict with the bin name.
|
|
13
|
+
# This seems to be only an issue on Windows, see https://github.com/rust-lang/cargo/issues/8519
|
|
14
|
+
name = "desktop_lib"
|
|
15
|
+
crate-type = ["staticlib", "cdylib", "rlib"]
|
|
16
|
+
|
|
17
|
+
[build-dependencies]
|
|
18
|
+
tauri-build = { version = "2", features = [] }
|
|
19
|
+
|
|
20
|
+
[dependencies]
|
|
21
|
+
tauri = { version = "2", features = [] }
|
|
22
|
+
tauri-plugin-opener = "2"
|
|
23
|
+
serde = { version = "1", features = ["derive"] }
|
|
24
|
+
serde_json = "1"
|
|
25
|
+
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
// Learn more about Tauri commands at https://tauri.app/develop/calling-rust/
|
|
2
|
+
#[tauri::command]
|
|
3
|
+
fn greet(name: &str) -> String {
|
|
4
|
+
format!("Hello, {}! You've been greeted from Rust!", name)
|
|
5
|
+
}
|
|
6
|
+
|
|
7
|
+
#[cfg_attr(mobile, tauri::mobile_entry_point)]
|
|
8
|
+
pub fn run() {
|
|
9
|
+
tauri::Builder::default()
|
|
10
|
+
.plugin(tauri_plugin_opener::init())
|
|
11
|
+
.invoke_handler(tauri::generate_handler![greet])
|
|
12
|
+
.run(tauri::generate_context!())
|
|
13
|
+
.expect("error while running tauri application");
|
|
14
|
+
}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "https://schema.tauri.app/config/2",
|
|
3
|
+
"productName": "desktop",
|
|
4
|
+
"version": "0.1.0",
|
|
5
|
+
"identifier": "com.croissantlabs.desktop",
|
|
6
|
+
"build": {
|
|
7
|
+
"beforeDevCommand": "pnpm dev",
|
|
8
|
+
"devUrl": "http://localhost:1420",
|
|
9
|
+
"beforeBuildCommand": "pnpm build",
|
|
10
|
+
"frontendDist": "../dist"
|
|
11
|
+
},
|
|
12
|
+
"app": {
|
|
13
|
+
"windows": [
|
|
14
|
+
{
|
|
15
|
+
"title": "desktop",
|
|
16
|
+
"width": 800,
|
|
17
|
+
"height": 600
|
|
18
|
+
}
|
|
19
|
+
],
|
|
20
|
+
"security": {
|
|
21
|
+
"csp": null
|
|
22
|
+
}
|
|
23
|
+
},
|
|
24
|
+
"bundle": {
|
|
25
|
+
"active": true,
|
|
26
|
+
"targets": "all",
|
|
27
|
+
"icon": [
|
|
28
|
+
"icons/32x32.png",
|
|
29
|
+
"icons/128x128.png",
|
|
30
|
+
"icons/128x128@2x.png",
|
|
31
|
+
"icons/icon.icns",
|
|
32
|
+
"icons/icon.ico"
|
|
33
|
+
]
|
|
34
|
+
}
|
|
35
|
+
}
|
|
@@ -1,6 +1,17 @@
|
|
|
1
1
|
{
|
|
2
|
-
"
|
|
3
|
-
"
|
|
4
|
-
"
|
|
5
|
-
|
|
2
|
+
"extends": "@workspace/config-typescript/react.json",
|
|
3
|
+
"include": ["**/*.ts", "**/*.tsx", "vite.config.ts"],
|
|
4
|
+
"compilerOptions": {
|
|
5
|
+
"target": "ES2022",
|
|
6
|
+
"lib": ["ES2022", "DOM", "DOM.Iterable"],
|
|
7
|
+
"module": "ESNext",
|
|
8
|
+
"moduleResolution": "bundler",
|
|
9
|
+
"allowImportingTsExtensions": true,
|
|
10
|
+
"verbatimModuleSyntax": true,
|
|
11
|
+
"jsx": "react-jsx",
|
|
12
|
+
"paths": {
|
|
13
|
+
"@/*": ["./src/*"],
|
|
14
|
+
"@workspace/ui/*": ["../../packages/ui/src/*"]
|
|
15
|
+
}
|
|
16
|
+
}
|
|
6
17
|
}
|
|
@@ -1,8 +1,10 @@
|
|
|
1
1
|
{
|
|
2
|
-
"extends": "@workspace/config-typescript/base.json",
|
|
3
2
|
"compilerOptions": {
|
|
4
3
|
"composite": true,
|
|
5
|
-
"
|
|
4
|
+
"skipLibCheck": true,
|
|
5
|
+
"module": "ESNext",
|
|
6
|
+
"moduleResolution": "bundler",
|
|
7
|
+
"allowSyntheticDefaultImports": true
|
|
6
8
|
},
|
|
7
|
-
"include": ["
|
|
9
|
+
"include": ["vite.config.ts"]
|
|
8
10
|
}
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import { defineConfig } from "vite";
|
|
2
|
+
import react from "@vitejs/plugin-react";
|
|
3
|
+
import { TanStackRouterVite } from "@tanstack/router-plugin/vite";
|
|
4
|
+
import tailwindcss from "@tailwindcss/vite";
|
|
5
|
+
import tsconfigPaths from "vite-tsconfig-paths";
|
|
6
|
+
|
|
7
|
+
// https://vite.dev/config/
|
|
8
|
+
export default defineConfig(async () => ({
|
|
9
|
+
plugins: [
|
|
10
|
+
tsconfigPaths(),
|
|
11
|
+
TanStackRouterVite({
|
|
12
|
+
routesDirectory: "./src/routes",
|
|
13
|
+
generatedRouteTree: "./src/routeTree.gen.ts",
|
|
14
|
+
}),
|
|
15
|
+
react(),
|
|
16
|
+
tailwindcss(),
|
|
17
|
+
],
|
|
18
|
+
|
|
19
|
+
// Vite options tailored for Tauri development and only applied in `tauri dev` or `tauri build`
|
|
20
|
+
//
|
|
21
|
+
// 1. prevent Vite from obscuring rust errors
|
|
22
|
+
clearScreen: false,
|
|
23
|
+
// 2. tauri expects a fixed port, fail if that port is not available
|
|
24
|
+
server: {
|
|
25
|
+
port: 1420,
|
|
26
|
+
strictPort: true,
|
|
27
|
+
host: process.env.TAURI_DEV_HOST || false,
|
|
28
|
+
hmr: process.env.TAURI_DEV_HOST
|
|
29
|
+
? {
|
|
30
|
+
protocol: "ws",
|
|
31
|
+
host: process.env.TAURI_DEV_HOST,
|
|
32
|
+
port: 1421,
|
|
33
|
+
}
|
|
34
|
+
: undefined,
|
|
35
|
+
watch: {
|
|
36
|
+
// 3. tell Vite to ignore watching `src-tauri`
|
|
37
|
+
ignored: ["**/src-tauri/**"],
|
|
38
|
+
},
|
|
39
|
+
},
|
|
40
|
+
}));
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import { Tabs } from
|
|
2
|
-
import React from
|
|
1
|
+
import { Tabs } from "expo-router";
|
|
2
|
+
import React from "react";
|
|
3
3
|
|
|
4
|
-
import { HapticTab } from
|
|
5
|
-
import { IconSymbol } from
|
|
6
|
-
import { Colors } from
|
|
7
|
-
import { useColorScheme } from
|
|
4
|
+
import { HapticTab } from "@/components/haptic-tab";
|
|
5
|
+
import { IconSymbol } from "@/components/ui/icon-symbol";
|
|
6
|
+
import { Colors } from "@/constants/theme";
|
|
7
|
+
import { useColorScheme } from "@/hooks/use-color-scheme";
|
|
8
8
|
|
|
9
9
|
export default function TabLayout() {
|
|
10
10
|
const colorScheme = useColorScheme();
|
|
@@ -12,21 +12,22 @@ export default function TabLayout() {
|
|
|
12
12
|
return (
|
|
13
13
|
<Tabs
|
|
14
14
|
screenOptions={{
|
|
15
|
-
tabBarActiveTintColor: Colors[colorScheme ??
|
|
15
|
+
tabBarActiveTintColor: Colors[colorScheme ?? "light"].tint,
|
|
16
16
|
headerShown: false,
|
|
17
17
|
tabBarButton: HapticTab,
|
|
18
|
-
}}
|
|
18
|
+
}}
|
|
19
|
+
>
|
|
19
20
|
<Tabs.Screen
|
|
20
21
|
name="index"
|
|
21
22
|
options={{
|
|
22
|
-
title:
|
|
23
|
+
title: "Home",
|
|
23
24
|
tabBarIcon: ({ color }) => <IconSymbol size={28} name="house.fill" color={color} />,
|
|
24
25
|
}}
|
|
25
26
|
/>
|
|
26
27
|
<Tabs.Screen
|
|
27
28
|
name="explore"
|
|
28
29
|
options={{
|
|
29
|
-
title:
|
|
30
|
+
title: "Explore",
|
|
30
31
|
tabBarIcon: ({ color }) => <IconSymbol size={28} name="paperplane.fill" color={color} />,
|
|
31
32
|
}}
|
|
32
33
|
/>
|
|
@@ -1,18 +1,18 @@
|
|
|
1
|
-
import { Image } from
|
|
2
|
-
import { Platform, StyleSheet } from
|
|
1
|
+
import { Image } from "expo-image";
|
|
2
|
+
import { Platform, StyleSheet } from "react-native";
|
|
3
3
|
|
|
4
|
-
import { Collapsible } from
|
|
5
|
-
import { ExternalLink } from
|
|
6
|
-
import ParallaxScrollView from
|
|
7
|
-
import { ThemedText } from
|
|
8
|
-
import { ThemedView } from
|
|
9
|
-
import { IconSymbol } from
|
|
10
|
-
import { Fonts } from
|
|
4
|
+
import { Collapsible } from "@/components/ui/collapsible";
|
|
5
|
+
import { ExternalLink } from "@/components/external-link";
|
|
6
|
+
import ParallaxScrollView from "@/components/parallax-scroll-view";
|
|
7
|
+
import { ThemedText } from "@/components/themed-text";
|
|
8
|
+
import { ThemedView } from "@/components/themed-view";
|
|
9
|
+
import { IconSymbol } from "@/components/ui/icon-symbol";
|
|
10
|
+
import { Fonts } from "@/constants/theme";
|
|
11
11
|
|
|
12
12
|
export default function TabTwoScreen() {
|
|
13
13
|
return (
|
|
14
14
|
<ParallaxScrollView
|
|
15
|
-
headerBackgroundColor={{ light:
|
|
15
|
+
headerBackgroundColor={{ light: "#D0D0D0", dark: "#353636" }}
|
|
16
16
|
headerImage={
|
|
17
17
|
<IconSymbol
|
|
18
18
|
size={310}
|
|
@@ -20,25 +20,27 @@ export default function TabTwoScreen() {
|
|
|
20
20
|
name="chevron.left.forwardslash.chevron.right"
|
|
21
21
|
style={styles.headerImage}
|
|
22
22
|
/>
|
|
23
|
-
}
|
|
23
|
+
}
|
|
24
|
+
>
|
|
24
25
|
<ThemedView style={styles.titleContainer}>
|
|
25
26
|
<ThemedText
|
|
26
27
|
type="title"
|
|
27
28
|
style={{
|
|
28
29
|
fontFamily: Fonts.rounded,
|
|
29
|
-
}}
|
|
30
|
+
}}
|
|
31
|
+
>
|
|
30
32
|
Explore
|
|
31
33
|
</ThemedText>
|
|
32
34
|
</ThemedView>
|
|
33
35
|
<ThemedText>This app includes example code to help you get started.</ThemedText>
|
|
34
36
|
<Collapsible title="File-based routing">
|
|
35
37
|
<ThemedText>
|
|
36
|
-
This app has two screens:{
|
|
37
|
-
<ThemedText type="defaultSemiBold">app/(tabs)/index.tsx</ThemedText> and{
|
|
38
|
+
This app has two screens:{" "}
|
|
39
|
+
<ThemedText type="defaultSemiBold">app/(tabs)/index.tsx</ThemedText> and{" "}
|
|
38
40
|
<ThemedText type="defaultSemiBold">app/(tabs)/explore.tsx</ThemedText>
|
|
39
41
|
</ThemedText>
|
|
40
42
|
<ThemedText>
|
|
41
|
-
The layout file in <ThemedText type="defaultSemiBold">app/(tabs)/_layout.tsx</ThemedText>{
|
|
43
|
+
The layout file in <ThemedText type="defaultSemiBold">app/(tabs)/_layout.tsx</ThemedText>{" "}
|
|
42
44
|
sets up the tab navigator.
|
|
43
45
|
</ThemedText>
|
|
44
46
|
<ExternalLink href="https://docs.expo.dev/router/introduction">
|
|
@@ -47,19 +49,19 @@ export default function TabTwoScreen() {
|
|
|
47
49
|
</Collapsible>
|
|
48
50
|
<Collapsible title="Android, iOS, and web support">
|
|
49
51
|
<ThemedText>
|
|
50
|
-
You can open this project on Android, iOS, and the web. To open the web version, press{
|
|
52
|
+
You can open this project on Android, iOS, and the web. To open the web version, press{" "}
|
|
51
53
|
<ThemedText type="defaultSemiBold">w</ThemedText> in the terminal running this project.
|
|
52
54
|
</ThemedText>
|
|
53
55
|
</Collapsible>
|
|
54
56
|
<Collapsible title="Images">
|
|
55
57
|
<ThemedText>
|
|
56
|
-
For static images, you can use the <ThemedText type="defaultSemiBold">@2x</ThemedText> and{
|
|
58
|
+
For static images, you can use the <ThemedText type="defaultSemiBold">@2x</ThemedText> and{" "}
|
|
57
59
|
<ThemedText type="defaultSemiBold">@3x</ThemedText> suffixes to provide files for
|
|
58
60
|
different screen densities
|
|
59
61
|
</ThemedText>
|
|
60
62
|
<Image
|
|
61
|
-
source={require(
|
|
62
|
-
style={{ width: 100, height: 100, alignSelf:
|
|
63
|
+
source={require("@/assets/images/react-logo.png")}
|
|
64
|
+
style={{ width: 100, height: 100, alignSelf: "center" }}
|
|
63
65
|
/>
|
|
64
66
|
<ExternalLink href="https://reactnative.dev/docs/images">
|
|
65
67
|
<ThemedText type="link">Learn more</ThemedText>
|
|
@@ -67,7 +69,7 @@ export default function TabTwoScreen() {
|
|
|
67
69
|
</Collapsible>
|
|
68
70
|
<Collapsible title="Light and dark mode components">
|
|
69
71
|
<ThemedText>
|
|
70
|
-
This template has light and dark mode support. The{
|
|
72
|
+
This template has light and dark mode support. The{" "}
|
|
71
73
|
<ThemedText type="defaultSemiBold">useColorScheme()</ThemedText> hook lets you inspect
|
|
72
74
|
what the user's current color scheme is, and so you can adjust UI colors accordingly.
|
|
73
75
|
</ThemedText>
|
|
@@ -77,18 +79,18 @@ export default function TabTwoScreen() {
|
|
|
77
79
|
</Collapsible>
|
|
78
80
|
<Collapsible title="Animations">
|
|
79
81
|
<ThemedText>
|
|
80
|
-
This template includes an example of an animated component. The{
|
|
82
|
+
This template includes an example of an animated component. The{" "}
|
|
81
83
|
<ThemedText type="defaultSemiBold">components/HelloWave.tsx</ThemedText> component uses
|
|
82
|
-
the powerful{
|
|
84
|
+
the powerful{" "}
|
|
83
85
|
<ThemedText type="defaultSemiBold" style={{ fontFamily: Fonts.mono }}>
|
|
84
86
|
react-native-reanimated
|
|
85
|
-
</ThemedText>{
|
|
87
|
+
</ThemedText>{" "}
|
|
86
88
|
library to create a waving hand animation.
|
|
87
89
|
</ThemedText>
|
|
88
90
|
{Platform.select({
|
|
89
91
|
ios: (
|
|
90
92
|
<ThemedText>
|
|
91
|
-
The <ThemedText type="defaultSemiBold">components/ParallaxScrollView.tsx</ThemedText>{
|
|
93
|
+
The <ThemedText type="defaultSemiBold">components/ParallaxScrollView.tsx</ThemedText>{" "}
|
|
92
94
|
component provides a parallax effect for the header image.
|
|
93
95
|
</ThemedText>
|
|
94
96
|
),
|
|
@@ -100,13 +102,13 @@ export default function TabTwoScreen() {
|
|
|
100
102
|
|
|
101
103
|
const styles = StyleSheet.create({
|
|
102
104
|
headerImage: {
|
|
103
|
-
color:
|
|
105
|
+
color: "#808080",
|
|
104
106
|
bottom: -90,
|
|
105
107
|
left: -35,
|
|
106
|
-
position:
|
|
108
|
+
position: "absolute",
|
|
107
109
|
},
|
|
108
110
|
titleContainer: {
|
|
109
|
-
flexDirection:
|
|
111
|
+
flexDirection: "row",
|
|
110
112
|
gap: 8,
|
|
111
113
|
},
|
|
112
114
|
});
|