create-croissant 0.1.44 → 0.1.46
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 +8 -8
- package/dist/index.js +8 -8
- package/package.json +10 -10
- package/template/.env.example +2 -2
- package/template/.github/dependabot.yml +15 -0
- package/template/.github/workflows/ci.yml +143 -0
- package/template/.github/workflows/dependabot-automerge.yml +23 -0
- package/template/.husky/pre-push +0 -0
- package/template/README.md +23 -23
- package/template/apps/desktop/.eslintcache +1 -0
- package/template/apps/desktop/README.md +5 -5
- package/template/apps/desktop/package.json +5 -5
- package/template/apps/mobile/README.md +3 -3
- package/template/apps/mobile/app/(tabs)/_layout.tsx +21 -14
- package/template/apps/mobile/app/(tabs)/account.tsx +147 -0
- package/template/apps/mobile/app/(tabs)/explore.tsx +335 -104
- package/template/apps/mobile/app/(tabs)/index.tsx +94 -96
- package/template/apps/mobile/app/_layout.tsx +26 -7
- package/template/apps/mobile/app/index.tsx +129 -0
- package/template/apps/mobile/app/login.tsx +135 -0
- package/template/apps/mobile/app/signup.tsx +144 -0
- package/template/apps/mobile/app.json +9 -4
- package/template/apps/mobile/components/ui/button.tsx +86 -0
- package/template/apps/mobile/components/ui/input.tsx +56 -0
- package/template/apps/mobile/lib/auth-client.ts +1 -1
- package/template/apps/mobile/lib/orpc.ts +28 -0
- package/template/apps/mobile/package.json +14 -1
- package/template/apps/mobile/scripts/reset-project.js +0 -0
- package/template/apps/mobile/tsconfig.json +4 -1
- package/template/apps/platform/.env.example +1 -1
- package/template/apps/platform/package.json +10 -6
- package/template/apps/platform/portless.json +3 -0
- package/template/apps/platform/src/components/login-form.tsx +5 -4
- package/template/apps/platform/src/components/signup-form.tsx +12 -16
- package/template/apps/platform/src/router.tsx +0 -1
- package/template/apps/platform/src/routes/__root.tsx +6 -2
- package/template/apps/platform/src/routes/_auth/account.tsx +13 -17
- package/template/apps/platform/src/routes/_auth/examples/client-orpc-auth.tsx +2 -6
- package/template/apps/platform/src/routes/_public/examples/client-orpc.tsx +16 -29
- package/template/apps/platform/src/routes/_public/examples/ssr-orpc.tsx +10 -14
- package/template/apps/platform/src/routes/api/auth/$.ts +23 -2
- package/template/apps/platform/src/routes/api/rpc.$.ts +18 -0
- package/template/package.json +23 -18
- package/template/packages/auth/package.json +2 -2
- package/template/packages/db/package.json +1 -1
- package/template/packages/orpc/package.json +11 -4
- package/template/packages/orpc/src/lib/planets.ts +18 -18
- package/template/packages/orpc/src/lib/router.ts +3 -3
- package/template/packages/orpc/src/react/context.tsx +23 -0
- package/template/packages/orpc/src/react/general.ts +29 -0
- package/template/packages/orpc/src/react/index.ts +3 -0
- package/template/packages/orpc/src/react/planets.ts +90 -0
- package/template/packages/ui/package.json +3 -2
- package/template/pnpm-workspace.yaml +3 -0
- package/template/tsconfig.json +2 -1
- package/template/apps/mobile/app/modal.tsx +0 -29
- package/template/packages/orpc/node_modules/@types/node/LICENSE +0 -21
- package/template/packages/orpc/node_modules/@types/node/README.md +0 -15
- package/template/packages/orpc/node_modules/@types/node/assert/strict.d.ts +0 -111
- package/template/packages/orpc/node_modules/@types/node/assert.d.ts +0 -1078
- package/template/packages/orpc/node_modules/@types/node/async_hooks.d.ts +0 -603
- package/template/packages/orpc/node_modules/@types/node/buffer.buffer.d.ts +0 -472
- package/template/packages/orpc/node_modules/@types/node/buffer.d.ts +0 -1934
- package/template/packages/orpc/node_modules/@types/node/child_process.d.ts +0 -1476
- package/template/packages/orpc/node_modules/@types/node/cluster.d.ts +0 -578
- package/template/packages/orpc/node_modules/@types/node/compatibility/disposable.d.ts +0 -14
- package/template/packages/orpc/node_modules/@types/node/compatibility/index.d.ts +0 -9
- package/template/packages/orpc/node_modules/@types/node/compatibility/indexable.d.ts +0 -20
- package/template/packages/orpc/node_modules/@types/node/compatibility/iterators.d.ts +0 -20
- package/template/packages/orpc/node_modules/@types/node/console.d.ts +0 -452
- package/template/packages/orpc/node_modules/@types/node/constants.d.ts +0 -21
- package/template/packages/orpc/node_modules/@types/node/crypto.d.ts +0 -4545
- package/template/packages/orpc/node_modules/@types/node/dgram.d.ts +0 -600
- package/template/packages/orpc/node_modules/@types/node/diagnostics_channel.d.ts +0 -578
- package/template/packages/orpc/node_modules/@types/node/dns/promises.d.ts +0 -503
- package/template/packages/orpc/node_modules/@types/node/dns.d.ts +0 -923
- package/template/packages/orpc/node_modules/@types/node/domain.d.ts +0 -170
- package/template/packages/orpc/node_modules/@types/node/events.d.ts +0 -976
- package/template/packages/orpc/node_modules/@types/node/fs/promises.d.ts +0 -1295
- package/template/packages/orpc/node_modules/@types/node/fs.d.ts +0 -4461
- package/template/packages/orpc/node_modules/@types/node/globals.d.ts +0 -172
- package/template/packages/orpc/node_modules/@types/node/globals.typedarray.d.ts +0 -38
- package/template/packages/orpc/node_modules/@types/node/http.d.ts +0 -2089
- package/template/packages/orpc/node_modules/@types/node/http2.d.ts +0 -2644
- package/template/packages/orpc/node_modules/@types/node/https.d.ts +0 -579
- package/template/packages/orpc/node_modules/@types/node/index.d.ts +0 -97
- package/template/packages/orpc/node_modules/@types/node/inspector.d.ts +0 -253
- package/template/packages/orpc/node_modules/@types/node/inspector.generated.d.ts +0 -4052
- package/template/packages/orpc/node_modules/@types/node/module.d.ts +0 -891
- package/template/packages/orpc/node_modules/@types/node/net.d.ts +0 -1076
- package/template/packages/orpc/node_modules/@types/node/os.d.ts +0 -506
- package/template/packages/orpc/node_modules/@types/node/package.json +0 -145
- package/template/packages/orpc/node_modules/@types/node/path.d.ts +0 -200
- package/template/packages/orpc/node_modules/@types/node/perf_hooks.d.ts +0 -968
- package/template/packages/orpc/node_modules/@types/node/process.d.ts +0 -2084
- package/template/packages/orpc/node_modules/@types/node/punycode.d.ts +0 -117
- package/template/packages/orpc/node_modules/@types/node/querystring.d.ts +0 -152
- package/template/packages/orpc/node_modules/@types/node/readline/promises.d.ts +0 -161
- package/template/packages/orpc/node_modules/@types/node/readline.d.ts +0 -594
- package/template/packages/orpc/node_modules/@types/node/repl.d.ts +0 -428
- package/template/packages/orpc/node_modules/@types/node/sea.d.ts +0 -153
- package/template/packages/orpc/node_modules/@types/node/sqlite.d.ts +0 -721
- package/template/packages/orpc/node_modules/@types/node/stream/consumers.d.ts +0 -38
- package/template/packages/orpc/node_modules/@types/node/stream/promises.d.ts +0 -90
- package/template/packages/orpc/node_modules/@types/node/stream/web.d.ts +0 -622
- package/template/packages/orpc/node_modules/@types/node/stream.d.ts +0 -1687
- package/template/packages/orpc/node_modules/@types/node/string_decoder.d.ts +0 -67
- package/template/packages/orpc/node_modules/@types/node/test.d.ts +0 -2163
- package/template/packages/orpc/node_modules/@types/node/timers/promises.d.ts +0 -108
- package/template/packages/orpc/node_modules/@types/node/timers.d.ts +0 -287
- package/template/packages/orpc/node_modules/@types/node/tls.d.ts +0 -1319
- package/template/packages/orpc/node_modules/@types/node/trace_events.d.ts +0 -197
- package/template/packages/orpc/node_modules/@types/node/ts5.6/buffer.buffer.d.ts +0 -468
- package/template/packages/orpc/node_modules/@types/node/ts5.6/globals.typedarray.d.ts +0 -34
- package/template/packages/orpc/node_modules/@types/node/ts5.6/index.d.ts +0 -97
- package/template/packages/orpc/node_modules/@types/node/tty.d.ts +0 -208
- package/template/packages/orpc/node_modules/@types/node/url.d.ts +0 -984
- package/template/packages/orpc/node_modules/@types/node/util.d.ts +0 -2606
- package/template/packages/orpc/node_modules/@types/node/v8.d.ts +0 -920
- package/template/packages/orpc/node_modules/@types/node/vm.d.ts +0 -1000
- package/template/packages/orpc/node_modules/@types/node/wasi.d.ts +0 -181
- package/template/packages/orpc/node_modules/@types/node/web-globals/abortcontroller.d.ts +0 -34
- package/template/packages/orpc/node_modules/@types/node/web-globals/domexception.d.ts +0 -68
- package/template/packages/orpc/node_modules/@types/node/web-globals/events.d.ts +0 -97
- package/template/packages/orpc/node_modules/@types/node/web-globals/fetch.d.ts +0 -55
- package/template/packages/orpc/node_modules/@types/node/web-globals/navigator.d.ts +0 -22
- package/template/packages/orpc/node_modules/@types/node/web-globals/storage.d.ts +0 -24
- package/template/packages/orpc/node_modules/@types/node/worker_threads.d.ts +0 -784
- package/template/packages/orpc/node_modules/@types/node/zlib.d.ts +0 -747
- package/template/packages/orpc/node_modules/undici-types/LICENSE +0 -21
- package/template/packages/orpc/node_modules/undici-types/README.md +0 -6
- package/template/packages/orpc/node_modules/undici-types/agent.d.ts +0 -31
- package/template/packages/orpc/node_modules/undici-types/api.d.ts +0 -43
- package/template/packages/orpc/node_modules/undici-types/balanced-pool.d.ts +0 -29
- package/template/packages/orpc/node_modules/undici-types/cache.d.ts +0 -36
- package/template/packages/orpc/node_modules/undici-types/client.d.ts +0 -108
- package/template/packages/orpc/node_modules/undici-types/connector.d.ts +0 -34
- package/template/packages/orpc/node_modules/undici-types/content-type.d.ts +0 -21
- package/template/packages/orpc/node_modules/undici-types/cookies.d.ts +0 -28
- package/template/packages/orpc/node_modules/undici-types/diagnostics-channel.d.ts +0 -66
- package/template/packages/orpc/node_modules/undici-types/dispatcher.d.ts +0 -256
- package/template/packages/orpc/node_modules/undici-types/env-http-proxy-agent.d.ts +0 -21
- package/template/packages/orpc/node_modules/undici-types/errors.d.ts +0 -149
- package/template/packages/orpc/node_modules/undici-types/eventsource.d.ts +0 -61
- package/template/packages/orpc/node_modules/undici-types/fetch.d.ts +0 -209
- package/template/packages/orpc/node_modules/undici-types/file.d.ts +0 -39
- package/template/packages/orpc/node_modules/undici-types/filereader.d.ts +0 -54
- package/template/packages/orpc/node_modules/undici-types/formdata.d.ts +0 -108
- package/template/packages/orpc/node_modules/undici-types/global-dispatcher.d.ts +0 -9
- package/template/packages/orpc/node_modules/undici-types/global-origin.d.ts +0 -7
- package/template/packages/orpc/node_modules/undici-types/handlers.d.ts +0 -15
- package/template/packages/orpc/node_modules/undici-types/header.d.ts +0 -4
- package/template/packages/orpc/node_modules/undici-types/index.d.ts +0 -71
- package/template/packages/orpc/node_modules/undici-types/interceptors.d.ts +0 -17
- package/template/packages/orpc/node_modules/undici-types/mock-agent.d.ts +0 -50
- package/template/packages/orpc/node_modules/undici-types/mock-client.d.ts +0 -25
- package/template/packages/orpc/node_modules/undici-types/mock-errors.d.ts +0 -12
- package/template/packages/orpc/node_modules/undici-types/mock-interceptor.d.ts +0 -93
- package/template/packages/orpc/node_modules/undici-types/mock-pool.d.ts +0 -25
- package/template/packages/orpc/node_modules/undici-types/package.json +0 -55
- package/template/packages/orpc/node_modules/undici-types/patch.d.ts +0 -33
- package/template/packages/orpc/node_modules/undici-types/pool-stats.d.ts +0 -19
- package/template/packages/orpc/node_modules/undici-types/pool.d.ts +0 -39
- package/template/packages/orpc/node_modules/undici-types/proxy-agent.d.ts +0 -28
- package/template/packages/orpc/node_modules/undici-types/readable.d.ts +0 -65
- package/template/packages/orpc/node_modules/undici-types/retry-agent.d.ts +0 -8
- package/template/packages/orpc/node_modules/undici-types/retry-handler.d.ts +0 -116
- package/template/packages/orpc/node_modules/undici-types/util.d.ts +0 -18
- package/template/packages/orpc/node_modules/undici-types/webidl.d.ts +0 -228
- package/template/packages/orpc/node_modules/undici-types/websocket.d.ts +0 -150
package/template/package.json
CHANGED
|
@@ -2,13 +2,10 @@
|
|
|
2
2
|
"name": "croissant-stack",
|
|
3
3
|
"version": "0.0.1",
|
|
4
4
|
"private": true,
|
|
5
|
-
"workspaces": [
|
|
6
|
-
"apps/*",
|
|
7
|
-
"packages/*"
|
|
8
|
-
],
|
|
9
5
|
"scripts": {
|
|
10
6
|
"build": "turbo build",
|
|
11
|
-
"dev": "turbo dev",
|
|
7
|
+
"dev": "PORTLESS_LAN=1 turbo dev",
|
|
8
|
+
"proxy:lan": "portless proxy start --lan",
|
|
12
9
|
"lint": "oxlint --ignore-path .oxlintignore .",
|
|
13
10
|
"lint:fix": "oxlint --fix --ignore-path .oxlintignore .",
|
|
14
11
|
"format": "oxfmt --check --ignore-path .oxlintignore",
|
|
@@ -16,37 +13,45 @@
|
|
|
16
13
|
"quality": "turbo quality",
|
|
17
14
|
"quality:fix": "turbo quality:fix",
|
|
18
15
|
"typecheck": "turbo typecheck",
|
|
19
|
-
"
|
|
16
|
+
"dev:mobile": "turbo run dev --filter=mobile",
|
|
17
|
+
"dev:ios": "turbo run dev --filter=mobile -- --ios",
|
|
18
|
+
"dev:android": "turbo run dev --filter=mobile -- --android",
|
|
19
|
+
"ci": "pnpm run lint && pnpm run typecheck && pnpm run build",
|
|
20
20
|
"db:up": "docker compose up -d",
|
|
21
21
|
"db:down": "docker compose down",
|
|
22
22
|
"db:logs": "docker compose logs -f",
|
|
23
|
-
"update-deps": "
|
|
23
|
+
"update-deps": "pnpm dlx npm-check-updates -u -w --root && pnpm install",
|
|
24
24
|
"prepare": "husky"
|
|
25
25
|
},
|
|
26
26
|
"dependencies": {
|
|
27
27
|
"react": "19.2.5",
|
|
28
|
-
"react-dom": "19.2.5"
|
|
28
|
+
"react-dom": "19.2.5",
|
|
29
|
+
"react-native": "0.83.6"
|
|
29
30
|
},
|
|
30
31
|
"devDependencies": {
|
|
31
32
|
"@better-auth/core": "^1.6.9",
|
|
32
33
|
"@types/react": "^19.2.7",
|
|
33
34
|
"@types/react-dom": "^19.2.3",
|
|
34
|
-
"arktype": "^2.2.0",
|
|
35
35
|
"husky": "^9.1.7",
|
|
36
|
-
"oxfmt": "
|
|
37
|
-
"oxlint": "
|
|
36
|
+
"oxfmt": "latest",
|
|
37
|
+
"oxlint": "latest",
|
|
38
|
+
"portless": "^0.11.0",
|
|
38
39
|
"turbo": "^2.9.6",
|
|
39
40
|
"typescript": "6.0.3",
|
|
40
|
-
"vite": "^8.0.10"
|
|
41
|
+
"vite": "^8.0.10",
|
|
42
|
+
"zod": "4.3.6"
|
|
41
43
|
},
|
|
42
|
-
"
|
|
43
|
-
"
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
44
|
+
"pnpm": {
|
|
45
|
+
"overrides": {
|
|
46
|
+
"@noble/ciphers": "2.2.0",
|
|
47
|
+
"drizzle-orm": "^0.45.2",
|
|
48
|
+
"react": "19.2.5",
|
|
49
|
+
"react-dom": "19.2.5",
|
|
50
|
+
"react-native": "0.83.6"
|
|
51
|
+
}
|
|
47
52
|
},
|
|
48
53
|
"engines": {
|
|
49
54
|
"node": ">=20"
|
|
50
55
|
},
|
|
51
|
-
"packageManager": "
|
|
56
|
+
"packageManager": "pnpm@9.15.0"
|
|
52
57
|
}
|
|
@@ -12,12 +12,12 @@
|
|
|
12
12
|
"generate": "better-auth generate --output ../db/src/lib/auth-schema.ts"
|
|
13
13
|
},
|
|
14
14
|
"dependencies": {
|
|
15
|
-
"@workspace/db": "
|
|
15
|
+
"@workspace/db": "workspace:*",
|
|
16
16
|
"better-auth": "^1.6.9"
|
|
17
17
|
},
|
|
18
18
|
"devDependencies": {
|
|
19
19
|
"@better-auth/cli": "^1.4.22",
|
|
20
|
-
"@workspace/config-typescript": "
|
|
20
|
+
"@workspace/config-typescript": "workspace:*",
|
|
21
21
|
"drizzle-kit": "^0.31.10",
|
|
22
22
|
"tsx": "^4.21.0"
|
|
23
23
|
}
|
|
@@ -4,7 +4,8 @@
|
|
|
4
4
|
"private": true,
|
|
5
5
|
"type": "module",
|
|
6
6
|
"exports": {
|
|
7
|
-
"./router": "./src/lib/router.ts"
|
|
7
|
+
"./router": "./src/lib/router.ts",
|
|
8
|
+
"./react": "./src/react/index.ts"
|
|
8
9
|
},
|
|
9
10
|
"scripts": {
|
|
10
11
|
"typecheck": "tsc --noEmit"
|
|
@@ -12,11 +13,17 @@
|
|
|
12
13
|
"dependencies": {
|
|
13
14
|
"@orpc/client": "^1.14.0",
|
|
14
15
|
"@orpc/server": "^1.14.0",
|
|
15
|
-
"@
|
|
16
|
-
"@workspace/
|
|
16
|
+
"@orpc/tanstack-query": "^1.14.0",
|
|
17
|
+
"@workspace/auth": "workspace:*",
|
|
18
|
+
"@workspace/db": "workspace:*",
|
|
19
|
+
"drizzle-orm": "^0.45.2"
|
|
20
|
+
},
|
|
21
|
+
"peerDependencies": {
|
|
22
|
+
"@tanstack/react-query": "^5.100.5",
|
|
23
|
+
"react": ">=18"
|
|
17
24
|
},
|
|
18
25
|
"devDependencies": {
|
|
19
26
|
"@types/node": "^22.19.1",
|
|
20
|
-
"@workspace/config-typescript": "
|
|
27
|
+
"@workspace/config-typescript": "workspace:*"
|
|
21
28
|
}
|
|
22
29
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { ORPCError, os } from "@orpc/server";
|
|
2
2
|
import { db, schema } from "@workspace/db";
|
|
3
3
|
import { eq } from "drizzle-orm";
|
|
4
|
-
import {
|
|
4
|
+
import { z } from "zod";
|
|
5
5
|
import type { RPCContext } from "./router";
|
|
6
6
|
|
|
7
7
|
const { planets } = schema;
|
|
@@ -16,13 +16,13 @@ export const planetRouter = o.router({
|
|
|
16
16
|
|
|
17
17
|
createPlanet: o
|
|
18
18
|
.input(
|
|
19
|
-
|
|
20
|
-
name:
|
|
21
|
-
|
|
22
|
-
distanceFromSun:
|
|
23
|
-
diameter:
|
|
24
|
-
|
|
25
|
-
|
|
19
|
+
z.object({
|
|
20
|
+
name: z.string().min(1),
|
|
21
|
+
description: z.string().optional(),
|
|
22
|
+
distanceFromSun: z.number(),
|
|
23
|
+
diameter: z.number(),
|
|
24
|
+
hasRings: z.boolean().optional(),
|
|
25
|
+
atmosphere: z.string().optional(),
|
|
26
26
|
}),
|
|
27
27
|
)
|
|
28
28
|
.handler(async ({ input }) => {
|
|
@@ -32,14 +32,14 @@ export const planetRouter = o.router({
|
|
|
32
32
|
|
|
33
33
|
updatePlanet: o
|
|
34
34
|
.input(
|
|
35
|
-
|
|
36
|
-
id:
|
|
37
|
-
name:
|
|
38
|
-
|
|
39
|
-
distanceFromSun:
|
|
40
|
-
diameter:
|
|
41
|
-
hasRings:
|
|
42
|
-
|
|
35
|
+
z.object({
|
|
36
|
+
id: z.number(),
|
|
37
|
+
name: z.string().min(1),
|
|
38
|
+
description: z.string().optional(),
|
|
39
|
+
distanceFromSun: z.number(),
|
|
40
|
+
diameter: z.number(),
|
|
41
|
+
hasRings: z.boolean(),
|
|
42
|
+
atmosphere: z.string().optional(),
|
|
43
43
|
}),
|
|
44
44
|
)
|
|
45
45
|
.handler(async ({ input }) => {
|
|
@@ -59,8 +59,8 @@ export const planetRouter = o.router({
|
|
|
59
59
|
|
|
60
60
|
deletePlanet: o
|
|
61
61
|
.input(
|
|
62
|
-
|
|
63
|
-
id:
|
|
62
|
+
z.object({
|
|
63
|
+
id: z.number(),
|
|
64
64
|
}),
|
|
65
65
|
)
|
|
66
66
|
.handler(async ({ input }) => {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { ORPCError, os } from "@orpc/server";
|
|
2
|
-
import {
|
|
2
|
+
import { z } from "zod";
|
|
3
3
|
import { planetRouter } from "./planets";
|
|
4
4
|
import type { Session } from "@workspace/auth/lib/auth";
|
|
5
5
|
|
|
@@ -14,8 +14,8 @@ export const router = o.router({
|
|
|
14
14
|
|
|
15
15
|
hello: o
|
|
16
16
|
.input(
|
|
17
|
-
|
|
18
|
-
|
|
17
|
+
z.object({
|
|
18
|
+
name: z.string().optional(),
|
|
19
19
|
}),
|
|
20
20
|
)
|
|
21
21
|
.handler(({ input }) => {
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
import type { RouterClient } from "@orpc/server";
|
|
3
|
+
import type { AppRouter } from "../lib/router";
|
|
4
|
+
|
|
5
|
+
const ORPCContext = React.createContext<RouterClient<AppRouter> | null>(null);
|
|
6
|
+
|
|
7
|
+
export function ORPCProvider({
|
|
8
|
+
client,
|
|
9
|
+
children,
|
|
10
|
+
}: {
|
|
11
|
+
client: RouterClient<AppRouter>;
|
|
12
|
+
children: React.ReactNode;
|
|
13
|
+
}) {
|
|
14
|
+
return <ORPCContext.Provider value={client}>{children}</ORPCContext.Provider>;
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
export function useORPC() {
|
|
18
|
+
const context = React.useContext(ORPCContext);
|
|
19
|
+
if (!context) {
|
|
20
|
+
throw new Error("useORPC must be used within an ORPCProvider");
|
|
21
|
+
}
|
|
22
|
+
return context;
|
|
23
|
+
}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { useQuery, type UseQueryOptions } from "@tanstack/react-query";
|
|
2
|
+
import type { AppRouter } from "../lib/router";
|
|
3
|
+
import type { InferRouterOutputs } from "@orpc/server";
|
|
4
|
+
import { useORPC } from "./context";
|
|
5
|
+
|
|
6
|
+
type Outputs = InferRouterOutputs<AppRouter>;
|
|
7
|
+
|
|
8
|
+
export function useSecretData(
|
|
9
|
+
options?: Omit<UseQueryOptions<Outputs["getSecretData"]>, "queryKey" | "queryFn">,
|
|
10
|
+
) {
|
|
11
|
+
const orpc = useORPC();
|
|
12
|
+
return useQuery({
|
|
13
|
+
...options,
|
|
14
|
+
queryKey: ["secret-data"],
|
|
15
|
+
queryFn: () => orpc.getSecretData(),
|
|
16
|
+
});
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
export function useHello(
|
|
20
|
+
name?: string,
|
|
21
|
+
options?: Omit<UseQueryOptions<Outputs["hello"]>, "queryKey" | "queryFn">,
|
|
22
|
+
) {
|
|
23
|
+
const orpc = useORPC();
|
|
24
|
+
return useQuery({
|
|
25
|
+
...options,
|
|
26
|
+
queryKey: ["hello", name],
|
|
27
|
+
queryFn: () => orpc.hello({ name }),
|
|
28
|
+
});
|
|
29
|
+
}
|
|
@@ -0,0 +1,90 @@
|
|
|
1
|
+
import {
|
|
2
|
+
useMutation,
|
|
3
|
+
useQuery,
|
|
4
|
+
useQueryClient,
|
|
5
|
+
type UseMutationOptions,
|
|
6
|
+
type UseQueryOptions,
|
|
7
|
+
} from "@tanstack/react-query";
|
|
8
|
+
import type { AppRouter } from "../lib/router";
|
|
9
|
+
import type { InferRouterInputs, InferRouterOutputs } from "@orpc/server";
|
|
10
|
+
import { useORPC } from "./context";
|
|
11
|
+
|
|
12
|
+
type Inputs = InferRouterInputs<AppRouter>;
|
|
13
|
+
type Outputs = InferRouterOutputs<AppRouter>;
|
|
14
|
+
|
|
15
|
+
export function usePlanets(
|
|
16
|
+
options?: Omit<UseQueryOptions<Outputs["planets"]["getPlanets"]>, "queryKey" | "queryFn">,
|
|
17
|
+
) {
|
|
18
|
+
const orpc = useORPC();
|
|
19
|
+
return useQuery({
|
|
20
|
+
...options,
|
|
21
|
+
queryKey: ["planets"],
|
|
22
|
+
queryFn: () => orpc.planets.getPlanets(),
|
|
23
|
+
});
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
export function useCreatePlanet(
|
|
27
|
+
options?: Omit<
|
|
28
|
+
UseMutationOptions<
|
|
29
|
+
Outputs["planets"]["createPlanet"],
|
|
30
|
+
Error,
|
|
31
|
+
Inputs["planets"]["createPlanet"]
|
|
32
|
+
>,
|
|
33
|
+
"mutationFn"
|
|
34
|
+
>,
|
|
35
|
+
) {
|
|
36
|
+
const orpc = useORPC();
|
|
37
|
+
const queryClient = useQueryClient();
|
|
38
|
+
return useMutation({
|
|
39
|
+
...options,
|
|
40
|
+
mutationFn: (input: Inputs["planets"]["createPlanet"]) => orpc.planets.createPlanet(input),
|
|
41
|
+
onSuccess: (data, variables, context, extra) => {
|
|
42
|
+
queryClient.invalidateQueries({ queryKey: ["planets"] });
|
|
43
|
+
options?.onSuccess?.(data, variables, context, extra);
|
|
44
|
+
},
|
|
45
|
+
});
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
export function useUpdatePlanet(
|
|
49
|
+
options?: Omit<
|
|
50
|
+
UseMutationOptions<
|
|
51
|
+
Outputs["planets"]["updatePlanet"],
|
|
52
|
+
Error,
|
|
53
|
+
Inputs["planets"]["updatePlanet"]
|
|
54
|
+
>,
|
|
55
|
+
"mutationFn"
|
|
56
|
+
>,
|
|
57
|
+
) {
|
|
58
|
+
const orpc = useORPC();
|
|
59
|
+
const queryClient = useQueryClient();
|
|
60
|
+
return useMutation({
|
|
61
|
+
...options,
|
|
62
|
+
mutationFn: (input: Inputs["planets"]["updatePlanet"]) => orpc.planets.updatePlanet(input),
|
|
63
|
+
onSuccess: (data, variables, context, extra) => {
|
|
64
|
+
queryClient.invalidateQueries({ queryKey: ["planets"] });
|
|
65
|
+
options?.onSuccess?.(data, variables, context, extra);
|
|
66
|
+
},
|
|
67
|
+
});
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
export function useDeletePlanet(
|
|
71
|
+
options?: Omit<
|
|
72
|
+
UseMutationOptions<
|
|
73
|
+
Outputs["planets"]["deletePlanet"],
|
|
74
|
+
Error,
|
|
75
|
+
Inputs["planets"]["deletePlanet"]
|
|
76
|
+
>,
|
|
77
|
+
"mutationFn"
|
|
78
|
+
>,
|
|
79
|
+
) {
|
|
80
|
+
const orpc = useORPC();
|
|
81
|
+
const queryClient = useQueryClient();
|
|
82
|
+
return useMutation({
|
|
83
|
+
...options,
|
|
84
|
+
mutationFn: (input: Inputs["planets"]["deletePlanet"]) => orpc.planets.deletePlanet(input),
|
|
85
|
+
onSuccess: (data, variables, context, extra) => {
|
|
86
|
+
queryClient.invalidateQueries({ queryKey: ["planets"] });
|
|
87
|
+
options?.onSuccess?.(data, variables, context, extra);
|
|
88
|
+
},
|
|
89
|
+
});
|
|
90
|
+
}
|
|
@@ -32,7 +32,8 @@
|
|
|
32
32
|
"sonner": "^2.0.7",
|
|
33
33
|
"tailwind-merge": "^3.5.0",
|
|
34
34
|
"tw-animate-css": "^1.4.0",
|
|
35
|
-
"vaul": "^1.1.2"
|
|
35
|
+
"vaul": "^1.1.2",
|
|
36
|
+
"@tanstack/react-router": "^1.168.24"
|
|
36
37
|
},
|
|
37
38
|
"devDependencies": {
|
|
38
39
|
"@tailwindcss/vite": "^4.2.4",
|
|
@@ -40,7 +41,7 @@
|
|
|
40
41
|
"@types/node": "^25.6.0",
|
|
41
42
|
"@types/react": "^19.2.14",
|
|
42
43
|
"@types/react-dom": "^19.2.3",
|
|
43
|
-
"@workspace/config-typescript": "
|
|
44
|
+
"@workspace/config-typescript": "workspace:*",
|
|
44
45
|
"tailwindcss": "^4.2.4"
|
|
45
46
|
}
|
|
46
47
|
}
|
package/template/tsconfig.json
CHANGED
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
import { Link } from "expo-router";
|
|
2
|
-
import { StyleSheet } from "react-native";
|
|
3
|
-
|
|
4
|
-
import { ThemedText } from "@/components/themed-text";
|
|
5
|
-
import { ThemedView } from "@/components/themed-view";
|
|
6
|
-
|
|
7
|
-
export default function ModalScreen() {
|
|
8
|
-
return (
|
|
9
|
-
<ThemedView style={styles.container}>
|
|
10
|
-
<ThemedText type="title">This is a modal</ThemedText>
|
|
11
|
-
<Link href="/" dismissTo style={styles.link}>
|
|
12
|
-
<ThemedText type="link">Go to home screen</ThemedText>
|
|
13
|
-
</Link>
|
|
14
|
-
</ThemedView>
|
|
15
|
-
);
|
|
16
|
-
}
|
|
17
|
-
|
|
18
|
-
const styles = StyleSheet.create({
|
|
19
|
-
container: {
|
|
20
|
-
flex: 1,
|
|
21
|
-
alignItems: "center",
|
|
22
|
-
justifyContent: "center",
|
|
23
|
-
padding: 20,
|
|
24
|
-
},
|
|
25
|
-
link: {
|
|
26
|
-
marginTop: 15,
|
|
27
|
-
paddingVertical: 15,
|
|
28
|
-
},
|
|
29
|
-
});
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
MIT License
|
|
2
|
-
|
|
3
|
-
Copyright (c) Microsoft Corporation.
|
|
4
|
-
|
|
5
|
-
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
-
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
-
in the Software without restriction, including without limitation the rights
|
|
8
|
-
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
-
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
-
furnished to do so, subject to the following conditions:
|
|
11
|
-
|
|
12
|
-
The above copyright notice and this permission notice shall be included in all
|
|
13
|
-
copies or substantial portions of the Software.
|
|
14
|
-
|
|
15
|
-
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
-
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
-
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
-
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
-
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
-
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
-
SOFTWARE
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
# Installation
|
|
2
|
-
> `npm install --save @types/node`
|
|
3
|
-
|
|
4
|
-
# Summary
|
|
5
|
-
This package contains type definitions for node (https://nodejs.org/).
|
|
6
|
-
|
|
7
|
-
# Details
|
|
8
|
-
Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/node/v22.
|
|
9
|
-
|
|
10
|
-
### Additional Details
|
|
11
|
-
* Last updated: Fri, 03 Apr 2026 11:14:41 GMT
|
|
12
|
-
* Dependencies: [undici-types](https://npmjs.com/package/undici-types)
|
|
13
|
-
|
|
14
|
-
# Credits
|
|
15
|
-
These definitions were written by [Microsoft TypeScript](https://github.com/Microsoft), [Alberto Schiabel](https://github.com/jkomyno), [Andrew Makarov](https://github.com/r3nya), [Benjamin Toueg](https://github.com/btoueg), [David Junger](https://github.com/touffy), [Mohsen Azimi](https://github.com/mohsen1), [Nikita Galkin](https://github.com/galkin), [Sebastian Silbermann](https://github.com/eps1lon), [Wilco Bakker](https://github.com/WilcoBakker), [Marcin Kopacz](https://github.com/chyzwar), [Trivikram Kamat](https://github.com/trivikr), [Junxiao Shi](https://github.com/yoursunny), [Ilia Baryshnikov](https://github.com/qwelias), [ExE Boss](https://github.com/ExE-Boss), [Piotr Błażejewicz](https://github.com/peterblazejewicz), [Anna Henningsen](https://github.com/addaleax), [Victor Perin](https://github.com/victorperin), [NodeJS Contributors](https://github.com/NodeJS), [Linus Unnebäck](https://github.com/LinusU), [wafuwafu13](https://github.com/wafuwafu13), [Matteo Collina](https://github.com/mcollina), [Dmitry Semigradsky](https://github.com/Semigradsky), and [René](https://github.com/Renegade334).
|
|
@@ -1,111 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* In strict assertion mode, non-strict methods behave like their corresponding
|
|
3
|
-
* strict methods. For example, `assert.deepEqual()` will behave like
|
|
4
|
-
* `assert.deepStrictEqual()`.
|
|
5
|
-
*
|
|
6
|
-
* In strict assertion mode, error messages for objects display a diff. In legacy
|
|
7
|
-
* assertion mode, error messages for objects display the objects, often truncated.
|
|
8
|
-
*
|
|
9
|
-
* To use strict assertion mode:
|
|
10
|
-
*
|
|
11
|
-
* ```js
|
|
12
|
-
* import { strict as assert } from 'node:assert';
|
|
13
|
-
* ```
|
|
14
|
-
*
|
|
15
|
-
* ```js
|
|
16
|
-
* import assert from 'node:assert/strict';
|
|
17
|
-
* ```
|
|
18
|
-
*
|
|
19
|
-
* Example error diff:
|
|
20
|
-
*
|
|
21
|
-
* ```js
|
|
22
|
-
* import { strict as assert } from 'node:assert';
|
|
23
|
-
*
|
|
24
|
-
* assert.deepEqual([[[1, 2, 3]], 4, 5], [[[1, 2, '3']], 4, 5]);
|
|
25
|
-
* // AssertionError: Expected inputs to be strictly deep-equal:
|
|
26
|
-
* // + actual - expected ... Lines skipped
|
|
27
|
-
* //
|
|
28
|
-
* // [
|
|
29
|
-
* // [
|
|
30
|
-
* // ...
|
|
31
|
-
* // 2,
|
|
32
|
-
* // + 3
|
|
33
|
-
* // - '3'
|
|
34
|
-
* // ],
|
|
35
|
-
* // ...
|
|
36
|
-
* // 5
|
|
37
|
-
* // ]
|
|
38
|
-
* ```
|
|
39
|
-
*
|
|
40
|
-
* To deactivate the colors, use the `NO_COLOR` or `NODE_DISABLE_COLORS`
|
|
41
|
-
* environment variables. This will also deactivate the colors in the REPL. For
|
|
42
|
-
* more on color support in terminal environments, read the tty
|
|
43
|
-
* [`getColorDepth()`](https://nodejs.org/docs/latest-v22.x/api/tty.html#writestreamgetcolordepthenv) documentation.
|
|
44
|
-
* @since v15.0.0
|
|
45
|
-
* @see [source](https://github.com/nodejs/node/blob/v22.x/lib/assert/strict.js)
|
|
46
|
-
*/
|
|
47
|
-
declare module "assert/strict" {
|
|
48
|
-
import {
|
|
49
|
-
Assert,
|
|
50
|
-
AssertionError,
|
|
51
|
-
AssertionErrorOptions,
|
|
52
|
-
AssertOptions,
|
|
53
|
-
AssertPredicate,
|
|
54
|
-
AssertStrict,
|
|
55
|
-
CallTracker,
|
|
56
|
-
CallTrackerCall,
|
|
57
|
-
CallTrackerReportInformation,
|
|
58
|
-
deepStrictEqual,
|
|
59
|
-
doesNotMatch,
|
|
60
|
-
doesNotReject,
|
|
61
|
-
doesNotThrow,
|
|
62
|
-
fail,
|
|
63
|
-
ifError,
|
|
64
|
-
match,
|
|
65
|
-
notDeepStrictEqual,
|
|
66
|
-
notStrictEqual,
|
|
67
|
-
ok,
|
|
68
|
-
partialDeepStrictEqual,
|
|
69
|
-
rejects,
|
|
70
|
-
strictEqual,
|
|
71
|
-
throws,
|
|
72
|
-
} from "node:assert";
|
|
73
|
-
function strict(value: unknown, message?: string | Error): asserts value;
|
|
74
|
-
namespace strict {
|
|
75
|
-
export {
|
|
76
|
-
Assert,
|
|
77
|
-
AssertionError,
|
|
78
|
-
AssertionErrorOptions,
|
|
79
|
-
AssertOptions,
|
|
80
|
-
AssertPredicate,
|
|
81
|
-
AssertStrict,
|
|
82
|
-
CallTracker,
|
|
83
|
-
CallTrackerCall,
|
|
84
|
-
CallTrackerReportInformation,
|
|
85
|
-
deepStrictEqual,
|
|
86
|
-
deepStrictEqual as deepEqual,
|
|
87
|
-
doesNotMatch,
|
|
88
|
-
doesNotReject,
|
|
89
|
-
doesNotThrow,
|
|
90
|
-
fail,
|
|
91
|
-
ifError,
|
|
92
|
-
match,
|
|
93
|
-
notDeepStrictEqual,
|
|
94
|
-
notDeepStrictEqual as notDeepEqual,
|
|
95
|
-
notStrictEqual,
|
|
96
|
-
notStrictEqual as notEqual,
|
|
97
|
-
ok,
|
|
98
|
-
partialDeepStrictEqual,
|
|
99
|
-
rejects,
|
|
100
|
-
strict,
|
|
101
|
-
strictEqual,
|
|
102
|
-
strictEqual as equal,
|
|
103
|
-
throws,
|
|
104
|
-
};
|
|
105
|
-
}
|
|
106
|
-
export = strict;
|
|
107
|
-
}
|
|
108
|
-
declare module "node:assert/strict" {
|
|
109
|
-
import strict = require("assert/strict");
|
|
110
|
-
export = strict;
|
|
111
|
-
}
|