@idealyst/cli 1.2.0 → 1.2.3
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/commands/add.js +233 -0
- package/dist/commands/add.js.map +1 -0
- package/dist/commands/index.js +13 -0
- package/dist/commands/index.js.map +1 -0
- package/dist/commands/info.js +193 -0
- package/dist/commands/info.js.map +1 -0
- package/dist/commands/init.js +155 -0
- package/dist/commands/init.js.map +1 -0
- package/dist/constants.js +125 -0
- package/dist/constants.js.map +1 -0
- package/dist/generators/core/index.js +23 -0
- package/dist/generators/core/index.js.map +1 -0
- package/dist/generators/core/mobile.js +251 -0
- package/dist/generators/core/mobile.js.map +1 -0
- package/dist/generators/core/shared.js +474 -0
- package/dist/generators/core/shared.js.map +1 -0
- package/dist/generators/core/web.js +330 -0
- package/dist/generators/core/web.js.map +1 -0
- package/dist/generators/extensions/api.js +223 -0
- package/dist/generators/extensions/api.js.map +1 -0
- package/dist/generators/extensions/devcontainer.js +575 -0
- package/dist/generators/extensions/devcontainer.js.map +1 -0
- package/dist/generators/extensions/graphql.js +202 -0
- package/dist/generators/extensions/graphql.js.map +1 -0
- package/dist/generators/extensions/index.js +17 -0
- package/dist/generators/extensions/index.js.map +1 -0
- package/dist/generators/extensions/prisma.js +249 -0
- package/dist/generators/extensions/prisma.js.map +1 -0
- package/dist/generators/extensions/trpc.js +258 -0
- package/dist/generators/extensions/trpc.js.map +1 -0
- package/dist/generators/index.js +122 -4
- package/dist/generators/index.js.map +1 -1
- package/dist/generators/reactNative.js +253 -0
- package/dist/generators/reactNative.js.map +1 -0
- package/dist/generators/workspace.js +303 -0
- package/dist/generators/workspace.js.map +1 -0
- package/dist/identifiers/android.js +75 -0
- package/dist/identifiers/android.js.map +1 -0
- package/dist/identifiers/index.js +35 -0
- package/dist/identifiers/index.js.map +1 -0
- package/dist/identifiers/ios.js +65 -0
- package/dist/identifiers/ios.js.map +1 -0
- package/dist/index.js +41 -319
- package/dist/index.js.map +1 -1
- package/dist/templates/copier.js +135 -0
- package/dist/templates/copier.js.map +1 -0
- package/dist/templates/index.js +23 -0
- package/dist/templates/index.js.map +1 -0
- package/dist/templates/merger.js +113 -0
- package/dist/templates/merger.js.map +1 -0
- package/dist/templates/processor.js +142 -0
- package/dist/templates/processor.js.map +1 -0
- package/dist/types/commands/add.d.ts +14 -0
- package/dist/types/commands/index.d.ts +6 -0
- package/dist/types/commands/info.d.ts +10 -0
- package/dist/types/commands/init.d.ts +19 -0
- package/dist/types/constants.d.ts +82 -0
- package/dist/types/generators/core/index.d.ts +6 -0
- package/dist/types/generators/core/mobile.d.ts +14 -0
- package/dist/types/generators/core/shared.d.ts +8 -0
- package/dist/types/generators/core/web.d.ts +8 -0
- package/dist/types/generators/extensions/api.d.ts +8 -0
- package/dist/types/generators/extensions/devcontainer.d.ts +15 -0
- package/dist/types/generators/extensions/graphql.d.ts +8 -0
- package/dist/types/generators/extensions/index.d.ts +8 -0
- package/dist/types/generators/extensions/prisma.d.ts +8 -0
- package/dist/types/generators/extensions/trpc.d.ts +9 -0
- package/dist/types/generators/index.d.ts +11 -3
- package/dist/types/generators/reactNative.d.ts +19 -0
- package/dist/types/generators/workspace.d.ts +8 -0
- package/dist/types/identifiers/android.d.ts +26 -0
- package/dist/types/identifiers/index.d.ts +26 -0
- package/dist/types/identifiers/ios.d.ts +21 -0
- package/dist/types/index.d.ts +3 -0
- package/dist/types/templates/copier.d.ts +24 -0
- package/dist/types/templates/index.d.ts +6 -0
- package/dist/types/templates/merger.d.ts +43 -0
- package/dist/types/templates/processor.d.ts +39 -0
- package/dist/types/types.d.ts +184 -5
- package/dist/types/utils/filesystem.d.ts +56 -0
- package/dist/types/utils/index.d.ts +7 -0
- package/dist/types/utils/logger.d.ts +64 -0
- package/dist/types/utils/shell.d.ts +35 -0
- package/dist/types/utils/validation.d.ts +32 -0
- package/dist/types/wizard/index.d.ts +20 -0
- package/dist/types/wizard/steps/apiExtension.d.ts +5 -0
- package/dist/types/wizard/steps/appDisplayName.d.ts +5 -0
- package/dist/types/wizard/steps/devcontainerExtension.d.ts +5 -0
- package/dist/types/wizard/steps/graphqlExtension.d.ts +5 -0
- package/dist/types/wizard/steps/index.d.ts +12 -0
- package/dist/types/wizard/steps/orgDomain.d.ts +5 -0
- package/dist/types/wizard/steps/prismaExtension.d.ts +5 -0
- package/dist/types/wizard/steps/projectName.d.ts +5 -0
- package/dist/types/wizard/steps/summary.d.ts +5 -0
- package/dist/types/wizard/steps/trpcExtension.d.ts +5 -0
- package/dist/types/wizard/validators.d.ts +17 -0
- package/dist/types.js +74 -0
- package/dist/types.js.map +1 -1
- package/dist/utils/filesystem.js +173 -0
- package/dist/utils/filesystem.js.map +1 -0
- package/dist/utils/index.js +24 -0
- package/dist/utils/index.js.map +1 -0
- package/dist/utils/logger.js +106 -0
- package/dist/utils/logger.js.map +1 -0
- package/dist/utils/shell.js +113 -0
- package/dist/utils/shell.js.map +1 -0
- package/dist/utils/validation.js +196 -0
- package/dist/utils/validation.js.map +1 -0
- package/dist/wizard/index.js +177 -0
- package/dist/wizard/index.js.map +1 -0
- package/dist/wizard/steps/apiExtension.js +33 -0
- package/dist/wizard/steps/apiExtension.js.map +1 -0
- package/dist/wizard/steps/appDisplayName.js +53 -0
- package/dist/wizard/steps/appDisplayName.js.map +1 -0
- package/dist/wizard/steps/devcontainerExtension.js +131 -0
- package/dist/wizard/steps/devcontainerExtension.js.map +1 -0
- package/dist/wizard/steps/graphqlExtension.js +37 -0
- package/dist/wizard/steps/graphqlExtension.js.map +1 -0
- package/dist/wizard/steps/index.js +25 -0
- package/dist/wizard/steps/index.js.map +1 -0
- package/dist/wizard/steps/orgDomain.js +40 -0
- package/dist/wizard/steps/orgDomain.js.map +1 -0
- package/dist/wizard/steps/prismaExtension.js +33 -0
- package/dist/wizard/steps/prismaExtension.js.map +1 -0
- package/dist/wizard/steps/projectName.js +40 -0
- package/dist/wizard/steps/projectName.js.map +1 -0
- package/dist/wizard/steps/summary.js +119 -0
- package/dist/wizard/steps/summary.js.map +1 -0
- package/dist/wizard/steps/trpcExtension.js +37 -0
- package/dist/wizard/steps/trpcExtension.js.map +1 -0
- package/dist/wizard/validators.js +35 -0
- package/dist/wizard/validators.js.map +1 -0
- package/package.json +6 -19
- package/README.md +0 -110
- package/dist/generators/init.js +0 -268
- package/dist/generators/init.js.map +0 -1
- package/dist/generators/utils.js +0 -682
- package/dist/generators/utils.js.map +0 -1
- package/dist/scripts/configure-react-native-monorepo.js +0 -144
- package/dist/scripts/configure-react-native-monorepo.js.map +0 -1
- package/dist/template/.devcontainer/Dockerfile +0 -26
- package/dist/template/.devcontainer/devcontainer.json +0 -113
- package/dist/template/.devcontainer/docker-compose.yml +0 -59
- package/dist/template/.devcontainer/figma-mcp.sh +0 -32
- package/dist/template/.devcontainer/gitignore.template +0 -2
- package/dist/template/.devcontainer/setup.sh +0 -45
- package/dist/template/DOCKER.md +0 -0
- package/dist/template/Dockerfile +0 -111
- package/dist/template/README.md +0 -233
- package/dist/template/docker/nginx/prod.conf +0 -238
- package/dist/template/docker/nginx.conf +0 -131
- package/dist/template/docker/postgres/init.sql +0 -41
- package/dist/template/docker/prometheus/prometheus.yml +0 -52
- package/dist/template/docker-compose.prod.yml +0 -146
- package/dist/template/docker-compose.yml +0 -143
- package/dist/template/dockerignore.template +0 -151
- package/dist/template/env.example.template +0 -36
- package/dist/template/gitignore.template +0 -56
- package/dist/template/jest.config.js +0 -20
- package/dist/template/mcp.json.template +0 -8
- package/dist/template/package.json +0 -45
- package/dist/template/packages/api/README.md +0 -510
- package/dist/template/packages/api/__tests__/api.test.ts +0 -26
- package/dist/template/packages/api/env.example.template +0 -6
- package/dist/template/packages/api/gitignore.template +0 -35
- package/dist/template/packages/api/jest.config.js +0 -23
- package/dist/template/packages/api/jest.setup.js +0 -9
- package/dist/template/packages/api/package.json +0 -66
- package/dist/template/packages/api/src/context.ts +0 -52
- package/dist/template/packages/api/src/controllers/TestController.ts +0 -0
- package/dist/template/packages/api/src/graphql/builder.ts +0 -75
- package/dist/template/packages/api/src/graphql/generated.ts +0 -64
- package/dist/template/packages/api/src/graphql/index.ts +0 -75
- package/dist/template/packages/api/src/graphql/types/index.ts +0 -44
- package/dist/template/packages/api/src/graphql/types/test.ts +0 -245
- package/dist/template/packages/api/src/index.ts +0 -26
- package/dist/template/packages/api/src/lib/database.ts +0 -23
- package/dist/template/packages/api/src/router/index.ts +0 -163
- package/dist/template/packages/api/src/routers/test.ts +0 -161
- package/dist/template/packages/api/src/server.ts +0 -68
- package/dist/template/packages/api/src/trpc.ts +0 -28
- package/dist/template/packages/api/tsconfig.json +0 -44
- package/dist/template/packages/database/README.md +0 -162
- package/dist/template/packages/database/gitignore.template +0 -41
- package/dist/template/packages/database/package.json +0 -49
- package/dist/template/packages/database/prisma/seed.ts +0 -64
- package/dist/template/packages/database/schema.prisma +0 -107
- package/dist/template/packages/database/src/index.ts +0 -15
- package/dist/template/packages/database/src/validators.ts +0 -10
- package/dist/template/packages/database/tsconfig.json +0 -18
- package/dist/template/packages/mobile/README.md +0 -86
- package/dist/template/packages/mobile/__tests__/App.test.tsx +0 -156
- package/dist/template/packages/mobile/__tests__/components.test.tsx +0 -300
- package/dist/template/packages/mobile/app.json +0 -5
- package/dist/template/packages/mobile/babel.config.js +0 -10
- package/dist/template/packages/mobile/gitignore.template +0 -73
- package/dist/template/packages/mobile/index.js +0 -6
- package/dist/template/packages/mobile/jest.config.js +0 -21
- package/dist/template/packages/mobile/jest.setup.js +0 -12
- package/dist/template/packages/mobile/metro.config.js +0 -36
- package/dist/template/packages/mobile/package.json +0 -60
- package/dist/template/packages/mobile/src/App.tsx +0 -8
- package/dist/template/packages/mobile/src/utils/trpc.ts +0 -7
- package/dist/template/packages/mobile/tsconfig.json +0 -28
- package/dist/template/packages/shared/README.md +0 -135
- package/dist/template/packages/shared/__tests__/shared.test.ts +0 -51
- package/dist/template/packages/shared/gitignore.template +0 -35
- package/dist/template/packages/shared/jest.config.js +0 -22
- package/dist/template/packages/shared/package.json +0 -68
- package/dist/template/packages/shared/src/components/App.tsx +0 -57
- package/dist/template/packages/shared/src/components/HelloWorld.tsx +0 -531
- package/dist/template/packages/shared/src/components/index.ts +0 -1
- package/dist/template/packages/shared/src/graphql/client.ts +0 -34
- package/dist/template/packages/shared/src/index.ts +0 -22
- package/dist/template/packages/shared/src/navigation/AppRouter.tsx +0 -565
- package/dist/template/packages/shared/src/trpc/client.ts +0 -44
- package/dist/template/packages/shared/tsconfig.json +0 -22
- package/dist/template/packages/web/README.md +0 -131
- package/dist/template/packages/web/__tests__/App.test.tsx +0 -342
- package/dist/template/packages/web/__tests__/components.test.tsx +0 -564
- package/dist/template/packages/web/gitignore.template +0 -35
- package/dist/template/packages/web/index.html +0 -13
- package/dist/template/packages/web/jest.config.js +0 -27
- package/dist/template/packages/web/jest.setup.js +0 -24
- package/dist/template/packages/web/package.json +0 -69
- package/dist/template/packages/web/src/App.tsx +0 -14
- package/dist/template/packages/web/src/components/TestDemo.tsx +0 -164
- package/dist/template/packages/web/src/main.tsx +0 -25
- package/dist/template/packages/web/src/utils/trpc.ts +0 -7
- package/dist/template/packages/web/tsconfig.json +0 -26
- package/dist/template/packages/web/vite.config.ts +0 -98
- package/dist/template/setup.sh +0 -30
- package/dist/template/tsconfig.json +0 -22
- package/dist/template/yarnrc.yml.template +0 -4
- package/dist/types/generators/init.d.ts +0 -5
- package/dist/types/generators/utils.d.ts +0 -45
- package/dist/types/scripts/configure-react-native-monorepo.d.ts +0 -23
- package/template/.devcontainer/Dockerfile +0 -26
- package/template/.devcontainer/devcontainer.json +0 -113
- package/template/.devcontainer/docker-compose.yml +0 -59
- package/template/.devcontainer/figma-mcp.sh +0 -32
- package/template/.devcontainer/setup.sh +0 -45
- package/template/.dockerignore +0 -151
- package/template/.env.example +0 -36
- package/template/.env.production +0 -56
- package/template/DOCKER.md +0 -0
- package/template/Dockerfile +0 -111
- package/template/README.md +0 -233
- package/template/docker/nginx/prod.conf +0 -238
- package/template/docker/nginx.conf +0 -131
- package/template/docker/postgres/init.sql +0 -41
- package/template/docker/prometheus/prometheus.yml +0 -52
- package/template/docker-compose.prod.yml +0 -146
- package/template/docker-compose.yml +0 -143
- package/template/jest.config.js +0 -20
- package/template/package.json +0 -45
- package/template/packages/api/.env.example +0 -6
- package/template/packages/api/README.md +0 -510
- package/template/packages/api/__tests__/api.test.ts +0 -26
- package/template/packages/api/jest.config.js +0 -23
- package/template/packages/api/jest.setup.js +0 -9
- package/template/packages/api/package.json +0 -66
- package/template/packages/api/src/context.ts +0 -52
- package/template/packages/api/src/controllers/TestController.ts +0 -0
- package/template/packages/api/src/graphql/builder.ts +0 -75
- package/template/packages/api/src/graphql/generated.ts +0 -64
- package/template/packages/api/src/graphql/index.ts +0 -75
- package/template/packages/api/src/graphql/types/index.ts +0 -44
- package/template/packages/api/src/graphql/types/test.ts +0 -245
- package/template/packages/api/src/index.ts +0 -26
- package/template/packages/api/src/lib/database.ts +0 -23
- package/template/packages/api/src/router/index.ts +0 -163
- package/template/packages/api/src/routers/test.ts +0 -161
- package/template/packages/api/src/server.ts +0 -68
- package/template/packages/api/src/trpc.ts +0 -28
- package/template/packages/api/tsconfig.json +0 -44
- package/template/packages/database/README.md +0 -162
- package/template/packages/database/package.json +0 -49
- package/template/packages/database/prisma/seed.ts +0 -64
- package/template/packages/database/schema.prisma +0 -107
- package/template/packages/database/src/index.ts +0 -15
- package/template/packages/database/src/validators.ts +0 -10
- package/template/packages/database/tsconfig.json +0 -18
- package/template/packages/mobile/README.md +0 -86
- package/template/packages/mobile/__tests__/App.test.tsx +0 -156
- package/template/packages/mobile/__tests__/components.test.tsx +0 -300
- package/template/packages/mobile/app.json +0 -5
- package/template/packages/mobile/babel.config.js +0 -26
- package/template/packages/mobile/index.js +0 -8
- package/template/packages/mobile/jest.config.js +0 -21
- package/template/packages/mobile/jest.setup.js +0 -12
- package/template/packages/mobile/metro.config.js +0 -36
- package/template/packages/mobile/package.json +0 -60
- package/template/packages/mobile/src/App.tsx +0 -8
- package/template/packages/mobile/src/utils/trpc.ts +0 -7
- package/template/packages/mobile/tsconfig.json +0 -28
- package/template/packages/shared/README.md +0 -135
- package/template/packages/shared/__tests__/shared.test.ts +0 -51
- package/template/packages/shared/jest.config.js +0 -22
- package/template/packages/shared/package.json +0 -68
- package/template/packages/shared/src/components/App.tsx +0 -57
- package/template/packages/shared/src/components/HelloWorld.tsx +0 -531
- package/template/packages/shared/src/components/index.ts +0 -1
- package/template/packages/shared/src/graphql/client.ts +0 -34
- package/template/packages/shared/src/index.ts +0 -25
- package/template/packages/shared/src/navigation/AppRouter.tsx +0 -565
- package/template/packages/shared/src/trpc/client.ts +0 -44
- package/template/packages/shared/src/unistyles.ts +0 -50
- package/template/packages/shared/tsconfig.json +0 -22
- package/template/packages/web/README.md +0 -131
- package/template/packages/web/__tests__/App.test.tsx +0 -342
- package/template/packages/web/__tests__/components.test.tsx +0 -564
- package/template/packages/web/index.html +0 -13
- package/template/packages/web/jest.config.js +0 -27
- package/template/packages/web/jest.setup.js +0 -24
- package/template/packages/web/package.json +0 -69
- package/template/packages/web/src/App.tsx +0 -14
- package/template/packages/web/src/components/TestDemo.tsx +0 -164
- package/template/packages/web/src/main.tsx +0 -27
- package/template/packages/web/src/utils/trpc.ts +0 -7
- package/template/packages/web/tsconfig.json +0 -26
- package/template/packages/web/vite.config.ts +0 -114
- package/template/setup.sh +0 -30
- package/template/tsconfig.json +0 -22
|
@@ -1,531 +0,0 @@
|
|
|
1
|
-
import { Button, Card, Input, Screen, Text, View } from "@idealyst/components";
|
|
2
|
-
import { useQuery, useMutation, useQueryClient } from "@tanstack/react-query";
|
|
3
|
-
import { useState } from "react";
|
|
4
|
-
import { getGraphQLClient, gql } from "../graphql/client";
|
|
5
|
-
import { trpc } from "../trpc/client";
|
|
6
|
-
|
|
7
|
-
// GraphQL queries and mutations
|
|
8
|
-
const TESTS_QUERY = gql`
|
|
9
|
-
query GetTests($take: Int, $skip: Int) {
|
|
10
|
-
tests(take: $take, skip: $skip) {
|
|
11
|
-
id
|
|
12
|
-
name
|
|
13
|
-
message
|
|
14
|
-
status
|
|
15
|
-
createdAt
|
|
16
|
-
}
|
|
17
|
-
}
|
|
18
|
-
`;
|
|
19
|
-
|
|
20
|
-
const CREATE_TEST_MUTATION = gql`
|
|
21
|
-
mutation CreateTest($input: CreateTestInput!) {
|
|
22
|
-
createTest(input: $input) {
|
|
23
|
-
id
|
|
24
|
-
name
|
|
25
|
-
message
|
|
26
|
-
status
|
|
27
|
-
createdAt
|
|
28
|
-
}
|
|
29
|
-
}
|
|
30
|
-
`;
|
|
31
|
-
|
|
32
|
-
const DELETE_TEST_MUTATION = gql`
|
|
33
|
-
mutation DeleteTest($id: String!) {
|
|
34
|
-
deleteTest(id: $id) {
|
|
35
|
-
id
|
|
36
|
-
}
|
|
37
|
-
}
|
|
38
|
-
`;
|
|
39
|
-
|
|
40
|
-
interface HelloWorldProps {
|
|
41
|
-
name?: string;
|
|
42
|
-
platform?: "web" | "mobile";
|
|
43
|
-
projectName?: string;
|
|
44
|
-
}
|
|
45
|
-
|
|
46
|
-
// Type for test records
|
|
47
|
-
interface TestRecord {
|
|
48
|
-
id: string;
|
|
49
|
-
name: string;
|
|
50
|
-
message: string;
|
|
51
|
-
status: string;
|
|
52
|
-
createdAt: string;
|
|
53
|
-
}
|
|
54
|
-
|
|
55
|
-
export const HelloWorld = ({
|
|
56
|
-
name = "World",
|
|
57
|
-
platform = "web",
|
|
58
|
-
projectName = "Your Project",
|
|
59
|
-
}: HelloWorldProps) => {
|
|
60
|
-
const queryClient = useQueryClient();
|
|
61
|
-
const [activeTab, setActiveTab] = useState<"trpc" | "graphql">("trpc");
|
|
62
|
-
|
|
63
|
-
// tRPC state
|
|
64
|
-
const [trpcTestName, setTrpcTestName] = useState("");
|
|
65
|
-
const [trpcTestMessage, setTrpcTestMessage] = useState("");
|
|
66
|
-
|
|
67
|
-
// GraphQL state
|
|
68
|
-
const [gqlTestName, setGqlTestName] = useState("");
|
|
69
|
-
const [gqlTestMessage, setGqlTestMessage] = useState("");
|
|
70
|
-
|
|
71
|
-
// ========== tRPC Hooks ==========
|
|
72
|
-
const trpcTests = trpc.test.getAll.useQuery({});
|
|
73
|
-
const trpcCreateMutation = trpc.test.create.useMutation({
|
|
74
|
-
onSuccess: () => {
|
|
75
|
-
trpcTests.refetch();
|
|
76
|
-
setTrpcTestName("");
|
|
77
|
-
setTrpcTestMessage("");
|
|
78
|
-
},
|
|
79
|
-
});
|
|
80
|
-
const trpcDeleteMutation = trpc.test.delete.useMutation({
|
|
81
|
-
onSuccess: () => {
|
|
82
|
-
trpcTests.refetch();
|
|
83
|
-
},
|
|
84
|
-
});
|
|
85
|
-
|
|
86
|
-
// ========== GraphQL Hooks (with React Query) ==========
|
|
87
|
-
const gqlTests = useQuery<{ tests: TestRecord[] }>({
|
|
88
|
-
queryKey: ["graphql", "tests"],
|
|
89
|
-
queryFn: async () => {
|
|
90
|
-
const client = getGraphQLClient();
|
|
91
|
-
return client.request(TESTS_QUERY, { take: 10 });
|
|
92
|
-
},
|
|
93
|
-
});
|
|
94
|
-
|
|
95
|
-
const gqlCreateMutation = useMutation({
|
|
96
|
-
mutationFn: async (data: { name: string; message: string; status: string }) => {
|
|
97
|
-
const client = getGraphQLClient();
|
|
98
|
-
return client.request(CREATE_TEST_MUTATION, { input: data });
|
|
99
|
-
},
|
|
100
|
-
onSuccess: () => {
|
|
101
|
-
queryClient.invalidateQueries({ queryKey: ["graphql", "tests"] });
|
|
102
|
-
setGqlTestName("");
|
|
103
|
-
setGqlTestMessage("");
|
|
104
|
-
},
|
|
105
|
-
});
|
|
106
|
-
|
|
107
|
-
const gqlDeleteMutation = useMutation({
|
|
108
|
-
mutationFn: async (id: string) => {
|
|
109
|
-
const client = getGraphQLClient();
|
|
110
|
-
return client.request(DELETE_TEST_MUTATION, { id });
|
|
111
|
-
},
|
|
112
|
-
onSuccess: () => {
|
|
113
|
-
queryClient.invalidateQueries({ queryKey: ["graphql", "tests"] });
|
|
114
|
-
},
|
|
115
|
-
});
|
|
116
|
-
|
|
117
|
-
// ========== Handlers ==========
|
|
118
|
-
const handleTrpcCreate = async () => {
|
|
119
|
-
if (!trpcTestName || !trpcTestMessage) return;
|
|
120
|
-
await trpcCreateMutation.mutateAsync({
|
|
121
|
-
name: trpcTestName,
|
|
122
|
-
message: trpcTestMessage,
|
|
123
|
-
status: "active",
|
|
124
|
-
});
|
|
125
|
-
};
|
|
126
|
-
|
|
127
|
-
const handleTrpcDelete = async (id: string) => {
|
|
128
|
-
await trpcDeleteMutation.mutateAsync({ id });
|
|
129
|
-
};
|
|
130
|
-
|
|
131
|
-
const handleGqlCreate = async () => {
|
|
132
|
-
if (!gqlTestName || !gqlTestMessage) return;
|
|
133
|
-
await gqlCreateMutation.mutateAsync({
|
|
134
|
-
name: gqlTestName,
|
|
135
|
-
message: gqlTestMessage,
|
|
136
|
-
status: "active",
|
|
137
|
-
});
|
|
138
|
-
};
|
|
139
|
-
|
|
140
|
-
const handleGqlDelete = async (id: string) => {
|
|
141
|
-
await gqlDeleteMutation.mutateAsync(id);
|
|
142
|
-
};
|
|
143
|
-
|
|
144
|
-
const platformEmoji = platform === "mobile" ? "📱" : "🌐";
|
|
145
|
-
const platformText =
|
|
146
|
-
platform === "mobile"
|
|
147
|
-
? "Your mobile development environment is ready. This shared component works seamlessly across mobile and web platforms."
|
|
148
|
-
: "Your web development environment is ready. This shared component works seamlessly across web and mobile platforms.";
|
|
149
|
-
|
|
150
|
-
return (
|
|
151
|
-
<Screen style={{ flex: 1, padding: 20 }}>
|
|
152
|
-
<View style={{ maxWidth: 600, alignSelf: "center" }}>
|
|
153
|
-
<Text
|
|
154
|
-
size="xl"
|
|
155
|
-
weight="bold"
|
|
156
|
-
style={{
|
|
157
|
-
marginBottom: 16,
|
|
158
|
-
textAlign: "center",
|
|
159
|
-
color: "#1e293b",
|
|
160
|
-
}}
|
|
161
|
-
>
|
|
162
|
-
Welcome to {projectName}! {platformEmoji}
|
|
163
|
-
</Text>
|
|
164
|
-
|
|
165
|
-
<Text
|
|
166
|
-
size="lg"
|
|
167
|
-
style={{
|
|
168
|
-
marginBottom: 32,
|
|
169
|
-
textAlign: "center",
|
|
170
|
-
color: "#64748b",
|
|
171
|
-
lineHeight: 24,
|
|
172
|
-
paddingHorizontal: 16,
|
|
173
|
-
}}
|
|
174
|
-
>
|
|
175
|
-
{platformText}
|
|
176
|
-
</Text>
|
|
177
|
-
{/* Framework Branding Card */}
|
|
178
|
-
<Card type="elevated" padding="lg" intent="primary">
|
|
179
|
-
<View style={{ alignItems: "center" }}>
|
|
180
|
-
<Text style={{ fontSize: 32, marginBottom: 16 }}>🚀</Text>
|
|
181
|
-
<Text
|
|
182
|
-
size="xl"
|
|
183
|
-
weight="bold"
|
|
184
|
-
style={{ marginBottom: 8, textAlign: "center" }}
|
|
185
|
-
>
|
|
186
|
-
Idealyst Framework
|
|
187
|
-
</Text>
|
|
188
|
-
<Text size="md" style={{ marginBottom: 16, textAlign: "center" }}>
|
|
189
|
-
Hello, {name}! Welcome to your cross-platform workspace.
|
|
190
|
-
</Text>
|
|
191
|
-
|
|
192
|
-
{/* Technology Tags */}
|
|
193
|
-
<View
|
|
194
|
-
style={{
|
|
195
|
-
flexDirection: "row",
|
|
196
|
-
flexWrap: "wrap",
|
|
197
|
-
justifyContent: "center",
|
|
198
|
-
gap: 8,
|
|
199
|
-
}}
|
|
200
|
-
>
|
|
201
|
-
<Card
|
|
202
|
-
type="filled"
|
|
203
|
-
padding="sm"
|
|
204
|
-
style={{ backgroundColor: "rgba(255, 255, 255, 0.2)" }}
|
|
205
|
-
>
|
|
206
|
-
<Text size="sm" weight="semibold">
|
|
207
|
-
React
|
|
208
|
-
</Text>
|
|
209
|
-
</Card>
|
|
210
|
-
<Card
|
|
211
|
-
type="filled"
|
|
212
|
-
padding="sm"
|
|
213
|
-
style={{ backgroundColor: "rgba(255, 255, 255, 0.2)" }}
|
|
214
|
-
>
|
|
215
|
-
<Text size="sm" weight="semibold">
|
|
216
|
-
TypeScript
|
|
217
|
-
</Text>
|
|
218
|
-
</Card>
|
|
219
|
-
<Card
|
|
220
|
-
type="filled"
|
|
221
|
-
padding="sm"
|
|
222
|
-
style={{ backgroundColor: "rgba(255, 255, 255, 0.2)" }}
|
|
223
|
-
>
|
|
224
|
-
<Text size="sm" weight="semibold">
|
|
225
|
-
Cross-Platform
|
|
226
|
-
</Text>
|
|
227
|
-
</Card>
|
|
228
|
-
</View>
|
|
229
|
-
</View>
|
|
230
|
-
</Card>
|
|
231
|
-
|
|
232
|
-
{/* Quick Start Guide Card */}
|
|
233
|
-
<Card type="outlined" padding="lg" style={{ marginTop: 16 }}>
|
|
234
|
-
<Text size="lg" weight="bold" style={{ marginBottom: 16 }}>
|
|
235
|
-
🎯 Quick Start Guide
|
|
236
|
-
</Text>
|
|
237
|
-
|
|
238
|
-
<View style={{ marginBottom: 16 }}>
|
|
239
|
-
<Text size="md" weight="semibold" style={{ marginBottom: 8 }}>
|
|
240
|
-
Your Workspace Overview:
|
|
241
|
-
</Text>
|
|
242
|
-
<Text size="sm" style={{ marginBottom: 4 }}>
|
|
243
|
-
• <Text weight="semibold">packages/web/</Text> - React web
|
|
244
|
-
application
|
|
245
|
-
</Text>
|
|
246
|
-
<Text size="sm" style={{ marginBottom: 4 }}>
|
|
247
|
-
• <Text weight="semibold">packages/mobile/</Text> - React Native
|
|
248
|
-
mobile app
|
|
249
|
-
</Text>
|
|
250
|
-
<Text size="sm" style={{ marginBottom: 4 }}>
|
|
251
|
-
• <Text weight="semibold">packages/shared/</Text> - Cross-platform
|
|
252
|
-
components
|
|
253
|
-
</Text>
|
|
254
|
-
<Text size="sm" style={{ marginBottom: 4 }}>
|
|
255
|
-
• <Text weight="semibold">packages/api/</Text> - tRPC API server
|
|
256
|
-
</Text>
|
|
257
|
-
</View>
|
|
258
|
-
|
|
259
|
-
<View style={{ marginBottom: 16 }}>
|
|
260
|
-
<Text size="md" weight="semibold" style={{ marginBottom: 8 }}>
|
|
261
|
-
Try Editing:
|
|
262
|
-
</Text>
|
|
263
|
-
<Text size="sm" style={{ marginBottom: 4 }}>
|
|
264
|
-
1. Edit this component in{" "}
|
|
265
|
-
<Text weight="semibold">
|
|
266
|
-
packages/shared/src/components/HelloWorld.tsx
|
|
267
|
-
</Text>
|
|
268
|
-
</Text>
|
|
269
|
-
<Text size="sm" style={{ marginBottom: 4 }}>
|
|
270
|
-
2. Watch changes appear in both web and mobile apps instantly!
|
|
271
|
-
</Text>
|
|
272
|
-
<Text size="sm" style={{ marginBottom: 4 }}>
|
|
273
|
-
3. Run <Text weight="semibold">yarn dev</Text> to start all
|
|
274
|
-
development servers
|
|
275
|
-
</Text>
|
|
276
|
-
</View>
|
|
277
|
-
|
|
278
|
-
<Card type="filled" intent="success" padding="md">
|
|
279
|
-
<Text size="sm" weight="semibold" style={{ marginBottom: 4 }}>
|
|
280
|
-
✨ Framework Features:
|
|
281
|
-
</Text>
|
|
282
|
-
<Text size="sm">
|
|
283
|
-
Shared components • Type safety • Hot reload • Cross-platform
|
|
284
|
-
compatibility
|
|
285
|
-
</Text>
|
|
286
|
-
</Card>
|
|
287
|
-
</Card>
|
|
288
|
-
|
|
289
|
-
{/* API Testing Section */}
|
|
290
|
-
<Card type="outlined" padding="lg" style={{ marginTop: 16 }}>
|
|
291
|
-
<Text size="lg" weight="bold" style={{ marginBottom: 16 }}>
|
|
292
|
-
🚀 API Demo - Database Integration
|
|
293
|
-
</Text>
|
|
294
|
-
<Text size="md" style={{ marginBottom: 16, color: "#64748b" }}>
|
|
295
|
-
Test your full-stack integration! Toggle between tRPC and GraphQL to
|
|
296
|
-
see both APIs in action.
|
|
297
|
-
</Text>
|
|
298
|
-
|
|
299
|
-
{/* API Toggle */}
|
|
300
|
-
<View
|
|
301
|
-
style={{
|
|
302
|
-
flexDirection: "row",
|
|
303
|
-
gap: 8,
|
|
304
|
-
marginBottom: 16,
|
|
305
|
-
}}
|
|
306
|
-
>
|
|
307
|
-
<Button
|
|
308
|
-
type={activeTab === "trpc" ? "contained" : "outlined"}
|
|
309
|
-
intent={activeTab === "trpc" ? "primary" : "neutral"}
|
|
310
|
-
onPress={() => setActiveTab("trpc")}
|
|
311
|
-
size="sm"
|
|
312
|
-
>
|
|
313
|
-
tRPC
|
|
314
|
-
</Button>
|
|
315
|
-
<Button
|
|
316
|
-
type={activeTab === "graphql" ? "contained" : "outlined"}
|
|
317
|
-
intent={activeTab === "graphql" ? "primary" : "neutral"}
|
|
318
|
-
onPress={() => setActiveTab("graphql")}
|
|
319
|
-
size="sm"
|
|
320
|
-
>
|
|
321
|
-
GraphQL
|
|
322
|
-
</Button>
|
|
323
|
-
</View>
|
|
324
|
-
|
|
325
|
-
{/* tRPC Tab */}
|
|
326
|
-
{activeTab === "trpc" && (
|
|
327
|
-
<>
|
|
328
|
-
<Card
|
|
329
|
-
type="filled"
|
|
330
|
-
padding="md"
|
|
331
|
-
style={{ marginBottom: 16, backgroundColor: "#f0f9ff" }}
|
|
332
|
-
>
|
|
333
|
-
<Text size="md" weight="semibold" style={{ marginBottom: 12 }}>
|
|
334
|
-
Create via tRPC
|
|
335
|
-
</Text>
|
|
336
|
-
<View style={{ gap: 12 }}>
|
|
337
|
-
<Input
|
|
338
|
-
placeholder="Test name"
|
|
339
|
-
value={trpcTestName}
|
|
340
|
-
onChangeText={setTrpcTestName}
|
|
341
|
-
/>
|
|
342
|
-
<Input
|
|
343
|
-
placeholder="Test message"
|
|
344
|
-
value={trpcTestMessage}
|
|
345
|
-
onChangeText={setTrpcTestMessage}
|
|
346
|
-
/>
|
|
347
|
-
<Button
|
|
348
|
-
onPress={handleTrpcCreate}
|
|
349
|
-
disabled={
|
|
350
|
-
!trpcTestName ||
|
|
351
|
-
!trpcTestMessage ||
|
|
352
|
-
trpcCreateMutation.isPending
|
|
353
|
-
}
|
|
354
|
-
style={{ alignSelf: "flex-start" }}
|
|
355
|
-
>
|
|
356
|
-
{trpcCreateMutation.isPending ? "Creating..." : "Create (tRPC)"}
|
|
357
|
-
</Button>
|
|
358
|
-
</View>
|
|
359
|
-
</Card>
|
|
360
|
-
|
|
361
|
-
<View>
|
|
362
|
-
<Text size="md" weight="semibold" style={{ marginBottom: 12 }}>
|
|
363
|
-
Records via tRPC ({trpcTests.data?.length || 0})
|
|
364
|
-
</Text>
|
|
365
|
-
|
|
366
|
-
{trpcTests.isPending ? (
|
|
367
|
-
<Card type="outlined" padding="md">
|
|
368
|
-
<Text size="sm" style={{ color: "#64748b" }}>
|
|
369
|
-
Loading via tRPC...
|
|
370
|
-
</Text>
|
|
371
|
-
</Card>
|
|
372
|
-
) : trpcTests.data?.length === 0 ? (
|
|
373
|
-
<Card type="outlined" padding="md">
|
|
374
|
-
<Text size="sm" style={{ color: "#64748b" }}>
|
|
375
|
-
No tests found. Create one above!
|
|
376
|
-
</Text>
|
|
377
|
-
</Card>
|
|
378
|
-
) : (
|
|
379
|
-
<View style={{ gap: 8 }}>
|
|
380
|
-
{trpcTests.data?.map((test: TestRecord) => (
|
|
381
|
-
<Card key={test.id} type="outlined" padding="md">
|
|
382
|
-
<View
|
|
383
|
-
style={{
|
|
384
|
-
flexDirection: "row",
|
|
385
|
-
justifyContent: "space-between",
|
|
386
|
-
alignItems: "center",
|
|
387
|
-
}}
|
|
388
|
-
>
|
|
389
|
-
<View style={{ flex: 1 }}>
|
|
390
|
-
<Text
|
|
391
|
-
size="sm"
|
|
392
|
-
weight="semibold"
|
|
393
|
-
style={{ marginBottom: 4 }}
|
|
394
|
-
>
|
|
395
|
-
{test.name}
|
|
396
|
-
</Text>
|
|
397
|
-
<Text
|
|
398
|
-
size="sm"
|
|
399
|
-
style={{ color: "#64748b", marginBottom: 4 }}
|
|
400
|
-
>
|
|
401
|
-
{test.message}
|
|
402
|
-
</Text>
|
|
403
|
-
<Text size="sm" style={{ color: "#0ea5e9" }}>
|
|
404
|
-
tRPC • {test.status} •{" "}
|
|
405
|
-
{new Date(test.createdAt).toLocaleDateString()}
|
|
406
|
-
</Text>
|
|
407
|
-
</View>
|
|
408
|
-
<Button
|
|
409
|
-
intent="error"
|
|
410
|
-
size="sm"
|
|
411
|
-
onPress={() => handleTrpcDelete(test.id)}
|
|
412
|
-
disabled={trpcDeleteMutation.isPending}
|
|
413
|
-
>
|
|
414
|
-
Delete
|
|
415
|
-
</Button>
|
|
416
|
-
</View>
|
|
417
|
-
</Card>
|
|
418
|
-
))}
|
|
419
|
-
</View>
|
|
420
|
-
)}
|
|
421
|
-
</View>
|
|
422
|
-
</>
|
|
423
|
-
)}
|
|
424
|
-
|
|
425
|
-
{/* GraphQL Tab */}
|
|
426
|
-
{activeTab === "graphql" && (
|
|
427
|
-
<>
|
|
428
|
-
<Card
|
|
429
|
-
type="filled"
|
|
430
|
-
padding="md"
|
|
431
|
-
style={{ marginBottom: 16, backgroundColor: "#fdf4ff" }}
|
|
432
|
-
>
|
|
433
|
-
<Text size="md" weight="semibold" style={{ marginBottom: 12 }}>
|
|
434
|
-
Create via GraphQL
|
|
435
|
-
</Text>
|
|
436
|
-
<View style={{ gap: 12 }}>
|
|
437
|
-
<Input
|
|
438
|
-
placeholder="Test name"
|
|
439
|
-
value={gqlTestName}
|
|
440
|
-
onChangeText={setGqlTestName}
|
|
441
|
-
/>
|
|
442
|
-
<Input
|
|
443
|
-
placeholder="Test message"
|
|
444
|
-
value={gqlTestMessage}
|
|
445
|
-
onChangeText={setGqlTestMessage}
|
|
446
|
-
/>
|
|
447
|
-
<Button
|
|
448
|
-
intent="primary"
|
|
449
|
-
onPress={handleGqlCreate}
|
|
450
|
-
disabled={
|
|
451
|
-
!gqlTestName ||
|
|
452
|
-
!gqlTestMessage ||
|
|
453
|
-
gqlCreateMutation.isPending
|
|
454
|
-
}
|
|
455
|
-
style={{ alignSelf: "flex-start" }}
|
|
456
|
-
>
|
|
457
|
-
{gqlCreateMutation.isPending
|
|
458
|
-
? "Creating..."
|
|
459
|
-
: "Create (GraphQL)"}
|
|
460
|
-
</Button>
|
|
461
|
-
</View>
|
|
462
|
-
</Card>
|
|
463
|
-
|
|
464
|
-
<View>
|
|
465
|
-
<Text size="md" weight="semibold" style={{ marginBottom: 12 }}>
|
|
466
|
-
Records via GraphQL ({gqlTests.data?.tests?.length || 0})
|
|
467
|
-
</Text>
|
|
468
|
-
|
|
469
|
-
{gqlTests.isPending ? (
|
|
470
|
-
<Card type="outlined" padding="md">
|
|
471
|
-
<Text size="sm" style={{ color: "#64748b" }}>
|
|
472
|
-
Loading via GraphQL...
|
|
473
|
-
</Text>
|
|
474
|
-
</Card>
|
|
475
|
-
) : gqlTests.data?.tests?.length === 0 ? (
|
|
476
|
-
<Card type="outlined" padding="md">
|
|
477
|
-
<Text size="sm" style={{ color: "#64748b" }}>
|
|
478
|
-
No tests found. Create one above!
|
|
479
|
-
</Text>
|
|
480
|
-
</Card>
|
|
481
|
-
) : (
|
|
482
|
-
<View style={{ gap: 8 }}>
|
|
483
|
-
{gqlTests.data?.tests?.map((test: TestRecord) => (
|
|
484
|
-
<Card key={test.id} type="outlined" padding="md">
|
|
485
|
-
<View
|
|
486
|
-
style={{
|
|
487
|
-
flexDirection: "row",
|
|
488
|
-
justifyContent: "space-between",
|
|
489
|
-
alignItems: "center",
|
|
490
|
-
}}
|
|
491
|
-
>
|
|
492
|
-
<View style={{ flex: 1 }}>
|
|
493
|
-
<Text
|
|
494
|
-
size="sm"
|
|
495
|
-
weight="semibold"
|
|
496
|
-
style={{ marginBottom: 4 }}
|
|
497
|
-
>
|
|
498
|
-
{test.name}
|
|
499
|
-
</Text>
|
|
500
|
-
<Text
|
|
501
|
-
size="sm"
|
|
502
|
-
style={{ color: "#64748b", marginBottom: 4 }}
|
|
503
|
-
>
|
|
504
|
-
{test.message}
|
|
505
|
-
</Text>
|
|
506
|
-
<Text size="sm" style={{ color: "#d946ef" }}>
|
|
507
|
-
GraphQL • {test.status} •{" "}
|
|
508
|
-
{new Date(test.createdAt).toLocaleDateString()}
|
|
509
|
-
</Text>
|
|
510
|
-
</View>
|
|
511
|
-
<Button
|
|
512
|
-
intent="error"
|
|
513
|
-
size="sm"
|
|
514
|
-
onPress={() => handleGqlDelete(test.id)}
|
|
515
|
-
disabled={gqlDeleteMutation.isPending}
|
|
516
|
-
>
|
|
517
|
-
Delete
|
|
518
|
-
</Button>
|
|
519
|
-
</View>
|
|
520
|
-
</Card>
|
|
521
|
-
))}
|
|
522
|
-
</View>
|
|
523
|
-
)}
|
|
524
|
-
</View>
|
|
525
|
-
</>
|
|
526
|
-
)}
|
|
527
|
-
</Card>
|
|
528
|
-
</View>
|
|
529
|
-
</Screen>
|
|
530
|
-
);
|
|
531
|
-
};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export { App } from './App';
|
|
@@ -1,34 +0,0 @@
|
|
|
1
|
-
import { GraphQLClient } from "graphql-request";
|
|
2
|
-
|
|
3
|
-
// Configuration for GraphQL client
|
|
4
|
-
export interface GraphQLClientConfig {
|
|
5
|
-
apiUrl: string;
|
|
6
|
-
headers?: () => Record<string, string>;
|
|
7
|
-
}
|
|
8
|
-
|
|
9
|
-
// Singleton instance for the GraphQL client
|
|
10
|
-
let graphqlClient: GraphQLClient | null = null;
|
|
11
|
-
|
|
12
|
-
// Create GraphQL client factory
|
|
13
|
-
export function createGraphQLClient(config: GraphQLClientConfig): GraphQLClient {
|
|
14
|
-
graphqlClient = new GraphQLClient(config.apiUrl, {
|
|
15
|
-
headers: config.headers?.() ?? {},
|
|
16
|
-
});
|
|
17
|
-
return graphqlClient;
|
|
18
|
-
}
|
|
19
|
-
|
|
20
|
-
// Get the current GraphQL client instance
|
|
21
|
-
export function getGraphQLClient(): GraphQLClient {
|
|
22
|
-
if (!graphqlClient) {
|
|
23
|
-
throw new Error(
|
|
24
|
-
"GraphQL client not initialized. Call createGraphQLClient first."
|
|
25
|
-
);
|
|
26
|
-
}
|
|
27
|
-
return graphqlClient;
|
|
28
|
-
}
|
|
29
|
-
|
|
30
|
-
// Re-export gql for convenience
|
|
31
|
-
export { gql } from "graphql-request";
|
|
32
|
-
|
|
33
|
-
// Re-export GraphQLClient type
|
|
34
|
-
export type { GraphQLClient };
|
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
// Configure Unistyles theme BEFORE any component imports
|
|
2
|
-
import './unistyles';
|
|
3
|
-
|
|
4
|
-
// Export the unified App component
|
|
5
|
-
export { App } from './components';
|
|
6
|
-
|
|
7
|
-
// Export navigation router
|
|
8
|
-
export { default as AppRouter } from './navigation/AppRouter';
|
|
9
|
-
|
|
10
|
-
// Export tRPC client utilities
|
|
11
|
-
export { trpc, createTRPCClient, createVanillaTRPCClient } from './trpc/client';
|
|
12
|
-
export type { TRPCClientConfig, AppRouter } from './trpc/client';
|
|
13
|
-
|
|
14
|
-
// Export GraphQL client utilities
|
|
15
|
-
export {
|
|
16
|
-
createGraphQLClient,
|
|
17
|
-
getGraphQLClient,
|
|
18
|
-
gql,
|
|
19
|
-
} from './graphql/client';
|
|
20
|
-
export type { GraphQLClientConfig, GraphQLClient } from './graphql/client';
|
|
21
|
-
|
|
22
|
-
// Simple type for the HelloWorld component props
|
|
23
|
-
export interface HelloWorldProps {
|
|
24
|
-
name?: string;
|
|
25
|
-
}
|