@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,135 +0,0 @@
|
|
|
1
|
-
# {{projectName}}
|
|
2
|
-
|
|
3
|
-
{{description}}
|
|
4
|
-
|
|
5
|
-
## Getting Started
|
|
6
|
-
|
|
7
|
-
This is a shared component library built with the Idealyst Framework that can be used across React Native and React web applications. It exports source TypeScript files directly for seamless integration in monorepo setups.
|
|
8
|
-
|
|
9
|
-
### Prerequisites
|
|
10
|
-
|
|
11
|
-
- Node.js 18+
|
|
12
|
-
- Yarn
|
|
13
|
-
|
|
14
|
-
### Installation
|
|
15
|
-
|
|
16
|
-
Install dependencies:
|
|
17
|
-
```bash
|
|
18
|
-
yarn install
|
|
19
|
-
```
|
|
20
|
-
|
|
21
|
-
### Development
|
|
22
|
-
|
|
23
|
-
Run tests:
|
|
24
|
-
```bash
|
|
25
|
-
yarn test
|
|
26
|
-
```
|
|
27
|
-
|
|
28
|
-
Type checking:
|
|
29
|
-
```bash
|
|
30
|
-
yarn type-check
|
|
31
|
-
```
|
|
32
|
-
|
|
33
|
-
## Usage
|
|
34
|
-
|
|
35
|
-
Import the HelloWorld component in your React or React Native app:
|
|
36
|
-
|
|
37
|
-
```typescript
|
|
38
|
-
import { HelloWorld } from '@{{workspaceName}}/shared';
|
|
39
|
-
|
|
40
|
-
function App() {
|
|
41
|
-
return <HelloWorld name="Developer" />;
|
|
42
|
-
}
|
|
43
|
-
```
|
|
44
|
-
|
|
45
|
-
## Component
|
|
46
|
-
|
|
47
|
-
### HelloWorld
|
|
48
|
-
|
|
49
|
-
A simple welcome component that works on both web and mobile platforms.
|
|
50
|
-
|
|
51
|
-
**Props:**
|
|
52
|
-
- `name?: string` - Name to display in the greeting (defaults to "World")
|
|
53
|
-
|
|
54
|
-
**Example:**
|
|
55
|
-
```typescript
|
|
56
|
-
<HelloWorld name="Alice" />
|
|
57
|
-
```
|
|
58
|
-
|
|
59
|
-
### Project Structure
|
|
60
|
-
|
|
61
|
-
```
|
|
62
|
-
{{projectName}}/
|
|
63
|
-
├── src/
|
|
64
|
-
│ ├── components/ # Shared components
|
|
65
|
-
│ ├── utils/ # Utility functions
|
|
66
|
-
│ ├── types/ # TypeScript types
|
|
67
|
-
│ └── index.ts # Main export file
|
|
68
|
-
├── dist/ # Built library (generated)
|
|
69
|
-
├── rollup.config.js # Build configuration
|
|
70
|
-
└── tsconfig.json # TypeScript configuration
|
|
71
|
-
```
|
|
72
|
-
|
|
73
|
-
### Features
|
|
74
|
-
|
|
75
|
-
- **Cross-platform**: Works on both React Native and React web
|
|
76
|
-
- **TypeScript**: Full type safety
|
|
77
|
-
- **Tree-shakeable**: Optimized for bundle size
|
|
78
|
-
- **Peer Dependencies**: Lightweight by design
|
|
79
|
-
- **Idealyst Theme Integration**: Compatible with the Idealyst theming system
|
|
80
|
-
|
|
81
|
-
### Usage
|
|
82
|
-
|
|
83
|
-
After building, you can import and use the library in your projects:
|
|
84
|
-
|
|
85
|
-
```tsx
|
|
86
|
-
import { SharedComponent, toTitleCase, ComponentProps } from '{{packageName}}';
|
|
87
|
-
|
|
88
|
-
// Use the shared component
|
|
89
|
-
<SharedComponent
|
|
90
|
-
title="Hello World"
|
|
91
|
-
description="This works on both web and mobile!"
|
|
92
|
-
/>
|
|
93
|
-
|
|
94
|
-
// Use utility functions
|
|
95
|
-
const formatted = toTitleCase('hello world'); // "Hello World"
|
|
96
|
-
```
|
|
97
|
-
|
|
98
|
-
### Building for Production
|
|
99
|
-
|
|
100
|
-
Build the library:
|
|
101
|
-
```bash
|
|
102
|
-
yarn build
|
|
103
|
-
```
|
|
104
|
-
|
|
105
|
-
This creates:
|
|
106
|
-
- `dist/index.js` - CommonJS build
|
|
107
|
-
- `dist/index.esm.js` - ES modules build
|
|
108
|
-
- `dist/index.d.ts` - TypeScript declarations
|
|
109
|
-
|
|
110
|
-
### Publishing
|
|
111
|
-
|
|
112
|
-
Before publishing, make sure to:
|
|
113
|
-
|
|
114
|
-
1. Update the version in `package.json`
|
|
115
|
-
2. Build the library: `yarn build`
|
|
116
|
-
3. Publish to npm: `npm publish`
|
|
117
|
-
|
|
118
|
-
### Development in Monorepo
|
|
119
|
-
|
|
120
|
-
If you're using this in a monorepo, you can reference it directly:
|
|
121
|
-
|
|
122
|
-
```json
|
|
123
|
-
{
|
|
124
|
-
"dependencies": {
|
|
125
|
-
"{{packageName}}": "workspace:*"
|
|
126
|
-
}
|
|
127
|
-
}
|
|
128
|
-
```
|
|
129
|
-
|
|
130
|
-
### Learn More
|
|
131
|
-
|
|
132
|
-
- [Idealyst Framework Documentation](https://github.com/your-username/idealyst-framework)
|
|
133
|
-
- [React Native Documentation](https://reactnative.dev/)
|
|
134
|
-
- [React Documentation](https://react.dev/)
|
|
135
|
-
- [Rollup Documentation](https://rollupjs.org/)
|
|
@@ -1,51 +0,0 @@
|
|
|
1
|
-
import { HelloWorld } from '../src/index';
|
|
2
|
-
|
|
3
|
-
describe('Shared Library', () => {
|
|
4
|
-
it('should export HelloWorld component', () => {
|
|
5
|
-
expect(HelloWorld).toBeDefined();
|
|
6
|
-
expect(typeof HelloWorld).toBe('function');
|
|
7
|
-
});
|
|
8
|
-
});
|
|
9
|
-
|
|
10
|
-
describe('HelloWorld Component', () => {
|
|
11
|
-
it('should be a React component', () => {
|
|
12
|
-
expect(HelloWorld).toBeDefined();
|
|
13
|
-
expect(typeof HelloWorld).toBe('function');
|
|
14
|
-
});
|
|
15
|
-
|
|
16
|
-
it('should accept props', () => {
|
|
17
|
-
// Test that the component function exists and can be called
|
|
18
|
-
// Note: Full component testing would require a React testing environment
|
|
19
|
-
expect(() => HelloWorld({ name: 'Test' })).not.toThrow();
|
|
20
|
-
});
|
|
21
|
-
});
|
|
22
|
-
|
|
23
|
-
describe('Sample Shared Tests', () => {
|
|
24
|
-
it('should pass a basic test', () => {
|
|
25
|
-
expect(1 + 1).toBe(2);
|
|
26
|
-
});
|
|
27
|
-
|
|
28
|
-
it('should handle string operations', () => {
|
|
29
|
-
const testString = 'Hello World';
|
|
30
|
-
expect(testString).toContain('World');
|
|
31
|
-
expect(testString.length).toBe(11);
|
|
32
|
-
});
|
|
33
|
-
|
|
34
|
-
it('should work with objects', () => {
|
|
35
|
-
const testObj = { name: 'test', value: 42 };
|
|
36
|
-
expect(testObj).toHaveProperty('name');
|
|
37
|
-
expect(testObj).toHaveProperty('value', 42);
|
|
38
|
-
});
|
|
39
|
-
|
|
40
|
-
it('should handle arrays', () => {
|
|
41
|
-
const testArray = [1, 2, 3, 4, 5];
|
|
42
|
-
expect(testArray).toHaveLength(5);
|
|
43
|
-
expect(testArray).toContain(3);
|
|
44
|
-
expect(testArray.filter(x => x > 3)).toEqual([4, 5]);
|
|
45
|
-
});
|
|
46
|
-
|
|
47
|
-
it('should work with async operations', async () => {
|
|
48
|
-
const result = await Promise.resolve('async test');
|
|
49
|
-
expect(result).toBe('async test');
|
|
50
|
-
});
|
|
51
|
-
});
|
|
@@ -1,35 +0,0 @@
|
|
|
1
|
-
# Dependencies
|
|
2
|
-
node_modules/
|
|
3
|
-
|
|
4
|
-
# Build outputs
|
|
5
|
-
dist/
|
|
6
|
-
build/
|
|
7
|
-
*.tsbuildinfo
|
|
8
|
-
|
|
9
|
-
# Environment variables
|
|
10
|
-
.env
|
|
11
|
-
.env.local
|
|
12
|
-
.env.development.local
|
|
13
|
-
.env.test.local
|
|
14
|
-
.env.production.local
|
|
15
|
-
|
|
16
|
-
# Logs
|
|
17
|
-
npm-debug.log*
|
|
18
|
-
yarn-debug.log*
|
|
19
|
-
yarn-error.log*
|
|
20
|
-
|
|
21
|
-
# Coverage
|
|
22
|
-
coverage/
|
|
23
|
-
*.lcov
|
|
24
|
-
.nyc_output
|
|
25
|
-
|
|
26
|
-
# IDE
|
|
27
|
-
.vscode/
|
|
28
|
-
.idea/
|
|
29
|
-
*.swp
|
|
30
|
-
*.swo
|
|
31
|
-
*~
|
|
32
|
-
|
|
33
|
-
# OS
|
|
34
|
-
.DS_Store
|
|
35
|
-
Thumbs.db
|
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
/** @type {import('jest').Config} */
|
|
2
|
-
module.exports = {
|
|
3
|
-
preset: 'ts-jest',
|
|
4
|
-
testEnvironment: 'node',
|
|
5
|
-
roots: ['<rootDir>/src', '<rootDir>/__tests__'],
|
|
6
|
-
testMatch: [
|
|
7
|
-
'**/__tests__/**/*.{ts,tsx,js}',
|
|
8
|
-
'**/*.{test,spec}.{ts,tsx,js}'
|
|
9
|
-
],
|
|
10
|
-
transform: {
|
|
11
|
-
'^.+\\.tsx?$': 'ts-jest',
|
|
12
|
-
},
|
|
13
|
-
collectCoverageFrom: [
|
|
14
|
-
'src/**/*.{ts,tsx}',
|
|
15
|
-
'!src/**/*.d.ts',
|
|
16
|
-
'!src/**/index.ts',
|
|
17
|
-
],
|
|
18
|
-
coverageDirectory: 'coverage',
|
|
19
|
-
coverageReporters: ['text', 'lcov'],
|
|
20
|
-
moduleFileExtensions: ['ts', 'tsx', 'js', 'jsx', 'json'],
|
|
21
|
-
testTimeout: 10000,
|
|
22
|
-
};
|
|
@@ -1,68 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "@{{workspaceScope}}/shared",
|
|
3
|
-
"version": "{{version}}",
|
|
4
|
-
"description": "{{description}}",
|
|
5
|
-
"main": "src/index.ts",
|
|
6
|
-
"module": "src/index.ts",
|
|
7
|
-
"types": "src/index.ts",
|
|
8
|
-
"exports": {
|
|
9
|
-
".": {
|
|
10
|
-
"import": "./src/index.ts",
|
|
11
|
-
"require": "./src/index.ts",
|
|
12
|
-
"types": "./src/index.ts"
|
|
13
|
-
}
|
|
14
|
-
},
|
|
15
|
-
"scripts": {
|
|
16
|
-
"test": "jest",
|
|
17
|
-
"test:watch": "jest --watch",
|
|
18
|
-
"test:coverage": "jest --coverage",
|
|
19
|
-
"type-check": "tsc --noEmit"
|
|
20
|
-
},
|
|
21
|
-
"peerDependencies": {
|
|
22
|
-
"@idealyst/components": "^{{idealystVersion}}",
|
|
23
|
-
"@idealyst/navigation": "^{{idealystVersion}}",
|
|
24
|
-
"@idealyst/theme": "^{{idealystVersion}}",
|
|
25
|
-
"@tanstack/react-query": "^5.83.0",
|
|
26
|
-
"@trpc/client": "^11.5.1",
|
|
27
|
-
"@trpc/react-query": "^11.5.1",
|
|
28
|
-
"@trpc/server": "^11.5.1",
|
|
29
|
-
"react": "^19.2.0",
|
|
30
|
-
"react-native": "^0.83.1",
|
|
31
|
-
"@{{workspaceScope}}/api": "*"
|
|
32
|
-
},
|
|
33
|
-
"peerDependenciesMeta": {
|
|
34
|
-
"react-native": {
|
|
35
|
-
"optional": true
|
|
36
|
-
}
|
|
37
|
-
},
|
|
38
|
-
"dependencies": {
|
|
39
|
-
"@mdi/js": "^7.4.47",
|
|
40
|
-
"@mdi/react": "^1.6.1",
|
|
41
|
-
"graphql": "^16.9.0",
|
|
42
|
-
"graphql-request": "^7.1.2"
|
|
43
|
-
},
|
|
44
|
-
"devDependencies": {
|
|
45
|
-
"@idealyst/components": "^{{idealystVersion}}",
|
|
46
|
-
"@idealyst/navigation": "^{{idealystVersion}}",
|
|
47
|
-
"@idealyst/theme": "^{{idealystVersion}}",
|
|
48
|
-
"@tanstack/react-query": "^5.83.0",
|
|
49
|
-
"@trpc/client": "^11.5.1",
|
|
50
|
-
"@trpc/react-query": "^11.5.1",
|
|
51
|
-
"@trpc/server": "^11.5.1",
|
|
52
|
-
"@types/jest": "^29.5.12",
|
|
53
|
-
"@types/react": "^19.2.0",
|
|
54
|
-
"jest": "^29.7.0",
|
|
55
|
-
"ts-jest": "^29.1.2",
|
|
56
|
-
"typescript": "^5.0.0"
|
|
57
|
-
},
|
|
58
|
-
"files": [
|
|
59
|
-
"src"
|
|
60
|
-
],
|
|
61
|
-
"keywords": [
|
|
62
|
-
"react",
|
|
63
|
-
"react-native",
|
|
64
|
-
"cross-platform",
|
|
65
|
-
"shared",
|
|
66
|
-
"library"
|
|
67
|
-
]
|
|
68
|
-
}
|
|
@@ -1,57 +0,0 @@
|
|
|
1
|
-
import { NavigatorProvider } from "@idealyst/navigation";
|
|
2
|
-
import { QueryClient, QueryClientProvider } from "@tanstack/react-query";
|
|
3
|
-
import React, { useEffect } from "react";
|
|
4
|
-
import { createGraphQLClient } from "../graphql/client";
|
|
5
|
-
import AppRouter from "../navigation/AppRouter";
|
|
6
|
-
import { createTRPCClient, trpc } from "../trpc/client";
|
|
7
|
-
|
|
8
|
-
interface AppProps {
|
|
9
|
-
apiUrl?: string;
|
|
10
|
-
graphqlUrl?: string;
|
|
11
|
-
queryClient?: QueryClient;
|
|
12
|
-
headers?: () => Record<string, string>;
|
|
13
|
-
}
|
|
14
|
-
|
|
15
|
-
// Default query client instance
|
|
16
|
-
const defaultQueryClient = new QueryClient({
|
|
17
|
-
defaultOptions: {
|
|
18
|
-
queries: {
|
|
19
|
-
staleTime: 1000 * 60 * 5, // 5 minutes
|
|
20
|
-
},
|
|
21
|
-
},
|
|
22
|
-
});
|
|
23
|
-
|
|
24
|
-
/**
|
|
25
|
-
* Unified App component that sets up tRPC, GraphQL, React Query providers, and Navigation
|
|
26
|
-
* This component can be used by both web and mobile platforms
|
|
27
|
-
*/
|
|
28
|
-
export const App: React.FC<AppProps> = ({
|
|
29
|
-
apiUrl = "http://localhost:3000/trpc",
|
|
30
|
-
graphqlUrl = "http://localhost:3000/graphql",
|
|
31
|
-
queryClient = defaultQueryClient,
|
|
32
|
-
headers,
|
|
33
|
-
}) => {
|
|
34
|
-
// Create tRPC client with the provided configuration
|
|
35
|
-
const trpcClient = createTRPCClient({
|
|
36
|
-
apiUrl,
|
|
37
|
-
headers,
|
|
38
|
-
});
|
|
39
|
-
|
|
40
|
-
// Initialize GraphQL client
|
|
41
|
-
useEffect(() => {
|
|
42
|
-
createGraphQLClient({
|
|
43
|
-
apiUrl: graphqlUrl,
|
|
44
|
-
headers,
|
|
45
|
-
});
|
|
46
|
-
}, [graphqlUrl, headers]);
|
|
47
|
-
|
|
48
|
-
return (
|
|
49
|
-
<trpc.Provider client={trpcClient} queryClient={queryClient}>
|
|
50
|
-
<QueryClientProvider client={queryClient}>
|
|
51
|
-
<NavigatorProvider route={AppRouter} />
|
|
52
|
-
</QueryClientProvider>
|
|
53
|
-
</trpc.Provider>
|
|
54
|
-
);
|
|
55
|
-
};
|
|
56
|
-
|
|
57
|
-
export default App;
|