@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,49 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "@{{workspaceScope}}/database",
|
|
3
|
-
"version": "1.0.0",
|
|
4
|
-
"description": "Database layer with Prisma",
|
|
5
|
-
"main": "dist/index.js",
|
|
6
|
-
"types": "dist/index.d.ts",
|
|
7
|
-
"exports": {
|
|
8
|
-
".": {
|
|
9
|
-
"types": "./dist/index.d.ts",
|
|
10
|
-
"import": "./dist/index.js",
|
|
11
|
-
"require": "./dist/index.js"
|
|
12
|
-
},
|
|
13
|
-
"./client": {
|
|
14
|
-
"types": "./generated/client/index.d.ts",
|
|
15
|
-
"import": "./generated/client/index.js",
|
|
16
|
-
"require": "./generated/client/index.js"
|
|
17
|
-
},
|
|
18
|
-
"./schemas": {
|
|
19
|
-
"types": "./dist/validators.d.ts",
|
|
20
|
-
"import": "./dist/validators.js",
|
|
21
|
-
"require": "./dist/validators.js"
|
|
22
|
-
}
|
|
23
|
-
},
|
|
24
|
-
"scripts": {
|
|
25
|
-
"build": "tsc",
|
|
26
|
-
"dev": "tsc --watch",
|
|
27
|
-
"db:generate": "prisma generate",
|
|
28
|
-
"db:push": "prisma db push",
|
|
29
|
-
"db:migrate": "prisma migrate dev",
|
|
30
|
-
"db:studio": "prisma studio",
|
|
31
|
-
"db:seed": "tsx prisma/seed.ts",
|
|
32
|
-
"db:reset": "prisma migrate reset"
|
|
33
|
-
},
|
|
34
|
-
"dependencies": {
|
|
35
|
-
"@prisma/client": "^5.19.1",
|
|
36
|
-
"zod": "^3.22.4"
|
|
37
|
-
},
|
|
38
|
-
"devDependencies": {
|
|
39
|
-
"@types/node": "^20.10.0",
|
|
40
|
-
"prisma": "^5.19.1",
|
|
41
|
-
"tsx": "^4.7.0",
|
|
42
|
-
"typescript": "^5.3.3"
|
|
43
|
-
},
|
|
44
|
-
"files": [
|
|
45
|
-
"dist/**/*",
|
|
46
|
-
"prisma/**/*",
|
|
47
|
-
"generated/**/*"
|
|
48
|
-
]
|
|
49
|
-
}
|
|
@@ -1,64 +0,0 @@
|
|
|
1
|
-
import { PrismaClient } from '../generated/client';
|
|
2
|
-
|
|
3
|
-
const prisma = new PrismaClient();
|
|
4
|
-
|
|
5
|
-
async function main() {
|
|
6
|
-
// Add your seed data here
|
|
7
|
-
console.log('🌱 Seeding database...');
|
|
8
|
-
|
|
9
|
-
// Create some test data for the Test model
|
|
10
|
-
console.log('📝 Creating test entries...');
|
|
11
|
-
|
|
12
|
-
const testEntries = await Promise.all([
|
|
13
|
-
prisma.test.create({
|
|
14
|
-
data: {
|
|
15
|
-
name: 'API Connection Test',
|
|
16
|
-
message: 'This test verifies that the API can connect to the database successfully.',
|
|
17
|
-
status: 'active',
|
|
18
|
-
},
|
|
19
|
-
}),
|
|
20
|
-
prisma.test.create({
|
|
21
|
-
data: {
|
|
22
|
-
name: 'Data Validation Test',
|
|
23
|
-
message: 'This test ensures that data validation is working correctly across the stack.',
|
|
24
|
-
status: 'active',
|
|
25
|
-
},
|
|
26
|
-
}),
|
|
27
|
-
prisma.test.create({
|
|
28
|
-
data: {
|
|
29
|
-
name: 'tRPC Integration Test',
|
|
30
|
-
message: 'This test confirms that tRPC endpoints are properly configured and accessible.',
|
|
31
|
-
status: 'active',
|
|
32
|
-
},
|
|
33
|
-
}),
|
|
34
|
-
prisma.test.create({
|
|
35
|
-
data: {
|
|
36
|
-
name: 'Sample Inactive Test',
|
|
37
|
-
message: 'This is an example of an inactive test entry.',
|
|
38
|
-
status: 'inactive',
|
|
39
|
-
},
|
|
40
|
-
}),
|
|
41
|
-
]);
|
|
42
|
-
|
|
43
|
-
console.log(`✅ Created ${testEntries.length} test entries`);
|
|
44
|
-
|
|
45
|
-
// Example seed data for other models (uncommented for reference)
|
|
46
|
-
// const user = await prisma.user.create({
|
|
47
|
-
// data: {
|
|
48
|
-
// email: 'admin@example.com',
|
|
49
|
-
// name: 'Admin User',
|
|
50
|
-
// },
|
|
51
|
-
// });
|
|
52
|
-
|
|
53
|
-
console.log('✅ Seeding completed');
|
|
54
|
-
}
|
|
55
|
-
|
|
56
|
-
main()
|
|
57
|
-
.then(async () => {
|
|
58
|
-
await prisma.$disconnect();
|
|
59
|
-
})
|
|
60
|
-
.catch(async (e) => {
|
|
61
|
-
console.error(e);
|
|
62
|
-
await prisma.$disconnect();
|
|
63
|
-
process.exit(1);
|
|
64
|
-
});
|
|
@@ -1,107 +0,0 @@
|
|
|
1
|
-
// This is your Prisma schema file,
|
|
2
|
-
// learn more about it in the docs: https://pris.ly/d/prisma-schema
|
|
3
|
-
|
|
4
|
-
generator client {
|
|
5
|
-
provider = "prisma-client-js"
|
|
6
|
-
output = "./generated/client"
|
|
7
|
-
}
|
|
8
|
-
|
|
9
|
-
datasource db {
|
|
10
|
-
provider = "postgres"
|
|
11
|
-
url = env("DATABASE_URL")
|
|
12
|
-
}
|
|
13
|
-
|
|
14
|
-
// Simple Test model for quick API testing
|
|
15
|
-
model Test {
|
|
16
|
-
id String @id @default(cuid())
|
|
17
|
-
name String
|
|
18
|
-
message String
|
|
19
|
-
status String @default("active") // "active", "inactive"
|
|
20
|
-
createdAt DateTime @default(now())
|
|
21
|
-
updatedAt DateTime @updatedAt
|
|
22
|
-
}
|
|
23
|
-
|
|
24
|
-
// Demo User model with profile information
|
|
25
|
-
model User {
|
|
26
|
-
id String @id @default(cuid())
|
|
27
|
-
email String @unique
|
|
28
|
-
name String?
|
|
29
|
-
avatar String? // URL to profile image
|
|
30
|
-
bio String? // User biography
|
|
31
|
-
location String? // User location
|
|
32
|
-
website String? // Personal website
|
|
33
|
-
|
|
34
|
-
// Posts created by this user
|
|
35
|
-
posts Post[]
|
|
36
|
-
|
|
37
|
-
// Comments made by this user
|
|
38
|
-
comments Comment[]
|
|
39
|
-
|
|
40
|
-
// User preferences and settings
|
|
41
|
-
settings UserSettings?
|
|
42
|
-
|
|
43
|
-
createdAt DateTime @default(now())
|
|
44
|
-
updatedAt DateTime @updatedAt
|
|
45
|
-
}
|
|
46
|
-
|
|
47
|
-
// Demo Post model for a simple blog/social feed
|
|
48
|
-
model Post {
|
|
49
|
-
id String @id @default(cuid())
|
|
50
|
-
title String
|
|
51
|
-
content String
|
|
52
|
-
excerpt String? // Short description
|
|
53
|
-
published Boolean @default(false)
|
|
54
|
-
tags String? // Comma-separated tag strings
|
|
55
|
-
|
|
56
|
-
// Author relationship
|
|
57
|
-
author User @relation(fields: [authorId], references: [id], onDelete: Cascade)
|
|
58
|
-
authorId String
|
|
59
|
-
|
|
60
|
-
// Comments on this post
|
|
61
|
-
comments Comment[]
|
|
62
|
-
|
|
63
|
-
// Post metadata
|
|
64
|
-
views Int @default(0)
|
|
65
|
-
likes Int @default(0)
|
|
66
|
-
|
|
67
|
-
createdAt DateTime @default(now())
|
|
68
|
-
updatedAt DateTime @updatedAt
|
|
69
|
-
}
|
|
70
|
-
|
|
71
|
-
// Demo Comment model
|
|
72
|
-
model Comment {
|
|
73
|
-
id String @id @default(cuid())
|
|
74
|
-
content String
|
|
75
|
-
|
|
76
|
-
// Author relationship
|
|
77
|
-
author User @relation(fields: [authorId], references: [id], onDelete: Cascade)
|
|
78
|
-
authorId String
|
|
79
|
-
|
|
80
|
-
// Post relationship
|
|
81
|
-
post Post @relation(fields: [postId], references: [id], onDelete: Cascade)
|
|
82
|
-
postId String
|
|
83
|
-
|
|
84
|
-
// Parent comment for nested threading
|
|
85
|
-
parent Comment? @relation("CommentThread", fields: [parentId], references: [id])
|
|
86
|
-
parentId String?
|
|
87
|
-
children Comment[] @relation("CommentThread")
|
|
88
|
-
|
|
89
|
-
createdAt DateTime @default(now())
|
|
90
|
-
updatedAt DateTime @updatedAt
|
|
91
|
-
}
|
|
92
|
-
|
|
93
|
-
// User settings and preferences
|
|
94
|
-
model UserSettings {
|
|
95
|
-
id String @id @default(cuid())
|
|
96
|
-
theme String @default("auto") // "light", "dark", "auto"
|
|
97
|
-
notifications Boolean @default(true)
|
|
98
|
-
emailUpdates Boolean @default(false)
|
|
99
|
-
publicProfile Boolean @default(true)
|
|
100
|
-
|
|
101
|
-
// User relationship (one-to-one)
|
|
102
|
-
user User @relation(fields: [userId], references: [id], onDelete: Cascade)
|
|
103
|
-
userId String @unique
|
|
104
|
-
|
|
105
|
-
createdAt DateTime @default(now())
|
|
106
|
-
updatedAt DateTime @updatedAt
|
|
107
|
-
}
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
import { PrismaClient } from '../generated/client';
|
|
2
|
-
|
|
3
|
-
declare global {
|
|
4
|
-
var __prisma: PrismaClient | undefined;
|
|
5
|
-
}
|
|
6
|
-
|
|
7
|
-
export const prisma = globalThis.__prisma || new PrismaClient();
|
|
8
|
-
|
|
9
|
-
if (process.env.NODE_ENV !== 'production') {
|
|
10
|
-
globalThis.__prisma = prisma;
|
|
11
|
-
}
|
|
12
|
-
|
|
13
|
-
export * from './validators';
|
|
14
|
-
export * from '../generated/client';
|
|
15
|
-
export default prisma;
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
// Create model validators for each model defined in the Prisma schema using Zod
|
|
2
|
-
// E.g
|
|
3
|
-
import { z } from 'zod';
|
|
4
|
-
|
|
5
|
-
export const TestValidator = z.object({
|
|
6
|
-
id: z.string().uuid(),
|
|
7
|
-
email: z.string().email(),
|
|
8
|
-
name: z.string().min(2).max(100),
|
|
9
|
-
age: z.number().min(0).optional()
|
|
10
|
-
});
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"compilerOptions": {
|
|
3
|
-
"target": "ES2020",
|
|
4
|
-
"module": "commonjs",
|
|
5
|
-
"lib": ["ES2020"],
|
|
6
|
-
"outDir": "./dist",
|
|
7
|
-
"rootDir": "./src",
|
|
8
|
-
"strict": true,
|
|
9
|
-
"esModuleInterop": true,
|
|
10
|
-
"skipLibCheck": true,
|
|
11
|
-
"forceConsistentCasingInFileNames": true,
|
|
12
|
-
"declaration": true,
|
|
13
|
-
"declarationMap": true,
|
|
14
|
-
"sourceMap": true
|
|
15
|
-
},
|
|
16
|
-
"include": ["src/**/*"],
|
|
17
|
-
"exclude": ["node_modules", "dist"]
|
|
18
|
-
}
|
|
@@ -1,86 +0,0 @@
|
|
|
1
|
-
# {{projectName}}
|
|
2
|
-
|
|
3
|
-
{{description}}
|
|
4
|
-
|
|
5
|
-
## Getting Started
|
|
6
|
-
|
|
7
|
-
This is a React Native application built with the Idealyst Framework.
|
|
8
|
-
|
|
9
|
-
### Prerequisites
|
|
10
|
-
|
|
11
|
-
- Node.js 18+
|
|
12
|
-
- Yarn
|
|
13
|
-
- React Native development environment
|
|
14
|
-
- Android Studio (for Android development)
|
|
15
|
-
- Xcode (for iOS development)
|
|
16
|
-
|
|
17
|
-
### Installation
|
|
18
|
-
|
|
19
|
-
Install dependencies:
|
|
20
|
-
```bash
|
|
21
|
-
yarn install
|
|
22
|
-
```
|
|
23
|
-
|
|
24
|
-
### Running the App
|
|
25
|
-
|
|
26
|
-
Start the Metro bundler:
|
|
27
|
-
```bash
|
|
28
|
-
yarn start
|
|
29
|
-
```
|
|
30
|
-
|
|
31
|
-
Run on Android:
|
|
32
|
-
```bash
|
|
33
|
-
yarn android
|
|
34
|
-
```
|
|
35
|
-
|
|
36
|
-
Run on iOS:
|
|
37
|
-
```bash
|
|
38
|
-
yarn ios
|
|
39
|
-
```
|
|
40
|
-
|
|
41
|
-
### Project Structure
|
|
42
|
-
|
|
43
|
-
```
|
|
44
|
-
{{projectName}}/
|
|
45
|
-
├── src/
|
|
46
|
-
│ └── App.tsx # Main app component
|
|
47
|
-
├── android/ # Android-specific code
|
|
48
|
-
├── ios/ # iOS-specific code
|
|
49
|
-
├── babel.config.js # Babel configuration
|
|
50
|
-
├── metro.config.js # Metro configuration
|
|
51
|
-
└── tsconfig.json # TypeScript configuration
|
|
52
|
-
```
|
|
53
|
-
|
|
54
|
-
### Features
|
|
55
|
-
|
|
56
|
-
- **Idealyst Components**: Pre-built UI components
|
|
57
|
-
- **Idealyst Navigation**: Cross-platform navigation
|
|
58
|
-
- **Idealyst Theme**: Consistent theming system
|
|
59
|
-
- **TypeScript**: Full type safety
|
|
60
|
-
- **React Native 0.80.1**: Latest stable version
|
|
61
|
-
|
|
62
|
-
### Development
|
|
63
|
-
|
|
64
|
-
The app uses the Idealyst Framework for consistent UI and navigation across platforms.
|
|
65
|
-
|
|
66
|
-
Edit `src/App.tsx` to start building your application.
|
|
67
|
-
|
|
68
|
-
### Building for Production
|
|
69
|
-
|
|
70
|
-
Build Android APK:
|
|
71
|
-
```bash
|
|
72
|
-
yarn build:android
|
|
73
|
-
```
|
|
74
|
-
|
|
75
|
-
### Testing
|
|
76
|
-
|
|
77
|
-
Run tests:
|
|
78
|
-
```bash
|
|
79
|
-
yarn test
|
|
80
|
-
```
|
|
81
|
-
|
|
82
|
-
### Learn More
|
|
83
|
-
|
|
84
|
-
- [Idealyst Framework Documentation](https://github.com/your-username/idealyst-framework)
|
|
85
|
-
- [React Native Documentation](https://reactnative.dev/)
|
|
86
|
-
- [TypeScript Documentation](https://www.typescriptlang.org/)
|
|
@@ -1,156 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @format
|
|
3
|
-
*/
|
|
4
|
-
|
|
5
|
-
import React from 'react';
|
|
6
|
-
import ReactTestRenderer from 'react-test-renderer';
|
|
7
|
-
import App from '../App';
|
|
8
|
-
|
|
9
|
-
// Mock the NavigatorProvider to avoid complex navigation setup
|
|
10
|
-
jest.mock('@idealyst/navigation', () => ({
|
|
11
|
-
NavigatorProvider: ({ children }: { children?: React.ReactNode }) => (
|
|
12
|
-
React.createElement('View', { testID: 'navigator-provider' }, children || 'Navigator Content')
|
|
13
|
-
),
|
|
14
|
-
}));
|
|
15
|
-
|
|
16
|
-
jest.mock('@idealyst/navigation/examples', () => ({
|
|
17
|
-
ExampleStackRouter: {},
|
|
18
|
-
}));
|
|
19
|
-
|
|
20
|
-
describe('App Component', () => {
|
|
21
|
-
it('renders correctly', async () => {
|
|
22
|
-
let component: ReactTestRenderer.ReactTestRenderer;
|
|
23
|
-
|
|
24
|
-
await ReactTestRenderer.act(() => {
|
|
25
|
-
component = ReactTestRenderer.create(<App />);
|
|
26
|
-
});
|
|
27
|
-
|
|
28
|
-
expect(component!).toBeDefined();
|
|
29
|
-
expect(component!.toJSON()).toMatchSnapshot();
|
|
30
|
-
});
|
|
31
|
-
|
|
32
|
-
it('renders without crashing', () => {
|
|
33
|
-
const tree = ReactTestRenderer.create(<App />);
|
|
34
|
-
expect(tree).toBeDefined();
|
|
35
|
-
expect(tree.root).toBeDefined();
|
|
36
|
-
});
|
|
37
|
-
|
|
38
|
-
it('contains NavigatorProvider', () => {
|
|
39
|
-
const tree = ReactTestRenderer.create(<App />);
|
|
40
|
-
const navigatorProvider = tree.root.findByProps({ testID: 'navigator-provider' });
|
|
41
|
-
expect(navigatorProvider).toBeDefined();
|
|
42
|
-
});
|
|
43
|
-
|
|
44
|
-
it('has proper SafeAreaView structure', () => {
|
|
45
|
-
const tree = ReactTestRenderer.create(<App />);
|
|
46
|
-
const safeAreaView = tree.root.findByType('SafeAreaView');
|
|
47
|
-
expect(safeAreaView).toBeDefined();
|
|
48
|
-
expect(safeAreaView.props.style).toEqual({ flex: 1 });
|
|
49
|
-
});
|
|
50
|
-
});
|
|
51
|
-
|
|
52
|
-
describe('Sample Component Tests', () => {
|
|
53
|
-
// Example of testing a simple functional component
|
|
54
|
-
const SimpleButton = ({ title, onPress, disabled = false }: {
|
|
55
|
-
title: string;
|
|
56
|
-
onPress: () => void;
|
|
57
|
-
disabled?: boolean;
|
|
58
|
-
}) => {
|
|
59
|
-
return React.createElement(
|
|
60
|
-
'TouchableOpacity',
|
|
61
|
-
{
|
|
62
|
-
testID: 'simple-button',
|
|
63
|
-
onPress: disabled ? undefined : onPress,
|
|
64
|
-
style: { opacity: disabled ? 0.5 : 1 }
|
|
65
|
-
},
|
|
66
|
-
React.createElement('Text', null, title)
|
|
67
|
-
);
|
|
68
|
-
};
|
|
69
|
-
|
|
70
|
-
it('renders button with correct title', () => {
|
|
71
|
-
const mockPress = jest.fn();
|
|
72
|
-
const tree = ReactTestRenderer.create(
|
|
73
|
-
<SimpleButton title="Test Button" onPress={mockPress} />
|
|
74
|
-
);
|
|
75
|
-
|
|
76
|
-
const textElement = tree.root.findByType('Text');
|
|
77
|
-
expect(textElement.children).toEqual(['Test Button']);
|
|
78
|
-
});
|
|
79
|
-
|
|
80
|
-
it('handles press events', () => {
|
|
81
|
-
const mockPress = jest.fn();
|
|
82
|
-
const tree = ReactTestRenderer.create(
|
|
83
|
-
<SimpleButton title="Test Button" onPress={mockPress} />
|
|
84
|
-
);
|
|
85
|
-
|
|
86
|
-
const button = tree.root.findByProps({ testID: 'simple-button' });
|
|
87
|
-
ReactTestRenderer.act(() => {
|
|
88
|
-
button.props.onPress();
|
|
89
|
-
});
|
|
90
|
-
|
|
91
|
-
expect(mockPress).toHaveBeenCalledTimes(1);
|
|
92
|
-
});
|
|
93
|
-
|
|
94
|
-
it('disables button when disabled prop is true', () => {
|
|
95
|
-
const mockPress = jest.fn();
|
|
96
|
-
const tree = ReactTestRenderer.create(
|
|
97
|
-
<SimpleButton title="Disabled Button" onPress={mockPress} disabled={true} />
|
|
98
|
-
);
|
|
99
|
-
|
|
100
|
-
const button = tree.root.findByProps({ testID: 'simple-button' });
|
|
101
|
-
expect(button.props.onPress).toBeUndefined();
|
|
102
|
-
expect(button.props.style.opacity).toBe(0.5);
|
|
103
|
-
});
|
|
104
|
-
|
|
105
|
-
it('handles component state changes', () => {
|
|
106
|
-
const StatefulComponent = () => {
|
|
107
|
-
const [count, setCount] = React.useState(0);
|
|
108
|
-
|
|
109
|
-
return React.createElement(
|
|
110
|
-
'View',
|
|
111
|
-
{ testID: 'stateful-component' },
|
|
112
|
-
React.createElement('Text', { testID: 'count' }, count.toString()),
|
|
113
|
-
React.createElement(
|
|
114
|
-
'TouchableOpacity',
|
|
115
|
-
{
|
|
116
|
-
testID: 'increment-button',
|
|
117
|
-
onPress: () => setCount(c => c + 1)
|
|
118
|
-
},
|
|
119
|
-
React.createElement('Text', null, 'Increment')
|
|
120
|
-
)
|
|
121
|
-
);
|
|
122
|
-
};
|
|
123
|
-
|
|
124
|
-
const tree = ReactTestRenderer.create(<StatefulComponent />);
|
|
125
|
-
|
|
126
|
-
// Check initial state
|
|
127
|
-
const countText = tree.root.findByProps({ testID: 'count' });
|
|
128
|
-
expect(countText.children).toEqual(['0']);
|
|
129
|
-
|
|
130
|
-
// Simulate button press
|
|
131
|
-
const incrementButton = tree.root.findByProps({ testID: 'increment-button' });
|
|
132
|
-
ReactTestRenderer.act(() => {
|
|
133
|
-
incrementButton.props.onPress();
|
|
134
|
-
});
|
|
135
|
-
|
|
136
|
-
// Check updated state
|
|
137
|
-
expect(countText.children).toEqual(['1']);
|
|
138
|
-
});
|
|
139
|
-
});
|
|
140
|
-
|
|
141
|
-
describe('Sample Native Tests', () => {
|
|
142
|
-
it('should pass a basic test', () => {
|
|
143
|
-
expect(1 + 1).toBe(2);
|
|
144
|
-
});
|
|
145
|
-
|
|
146
|
-
it('should handle string operations', () => {
|
|
147
|
-
const greeting = 'Hello World';
|
|
148
|
-
expect(greeting).toContain('World');
|
|
149
|
-
});
|
|
150
|
-
|
|
151
|
-
it('should work with arrays', () => {
|
|
152
|
-
const items = [1, 2, 3];
|
|
153
|
-
expect(items).toHaveLength(3);
|
|
154
|
-
expect(items).toContain(2);
|
|
155
|
-
});
|
|
156
|
-
});
|