@idealyst/cli 1.0.89 → 1.0.91
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/generators/index.js +3 -40
- package/dist/generators/index.js.map +1 -1
- package/dist/generators/init.js +273 -0
- package/dist/generators/init.js.map +1 -0
- package/dist/generators/utils.js +5 -0
- package/dist/generators/utils.js.map +1 -1
- package/dist/index.js +20 -202
- package/dist/index.js.map +1 -1
- package/dist/scripts/configure-react-native-monorepo.js +144 -0
- package/dist/scripts/configure-react-native-monorepo.js.map +1 -0
- package/dist/{templates/workspace → template}/README.md +66 -12
- package/dist/template/package.json +45 -0
- package/{templates → dist/template/packages}/api/package.json +3 -1
- package/{templates → dist/template/packages}/database/package.json +1 -1
- package/dist/{templates/native → template/packages/mobile}/babel.config.js +1 -0
- package/{templates/native → dist/template/packages/mobile}/metro.config.js +4 -4
- package/{templates/native → dist/template/packages/mobile}/package.json +5 -2
- package/{templates → dist/template/packages}/shared/package.json +2 -2
- package/{templates → dist/template/packages}/web/package.json +4 -1
- package/dist/types/generators/index.d.ts +1 -7
- package/dist/types/generators/init.d.ts +5 -0
- package/dist/types/scripts/configure-react-native-monorepo.d.ts +23 -0
- package/dist/types/types.d.ts +0 -4
- package/package.json +2 -2
- package/{templates/workspace → template}/README.md +66 -12
- package/template/package.json +45 -0
- package/{dist/templates → template/packages}/api/package.json +3 -1
- package/{dist/templates → template/packages}/database/package.json +1 -1
- package/{templates/native → template/packages/mobile}/babel.config.js +1 -0
- package/{dist/templates/native → template/packages/mobile}/metro.config.js +4 -4
- package/{dist/templates/native → template/packages/mobile}/package.json +5 -2
- package/{templates/native/src/App.tsx → template/packages/mobile/src/App-with-trpc-and-shared.tsx} +1 -1
- package/{dist/templates/native → template/packages/mobile}/src/App.tsx +1 -1
- package/{dist/templates → template/packages}/shared/package.json +2 -2
- package/{dist/templates → template/packages}/shared/src/components/App.tsx +8 -9
- package/{dist/templates → template/packages}/shared/src/components/HelloWorld.tsx +17 -20
- package/template/packages/shared/src/navigation/AppRouter.tsx +565 -0
- package/{dist/templates → template/packages}/web/package.json +4 -1
- package/{dist/templates/web/src/App.tsx → template/packages/web/src/App-with-trpc-and-shared.tsx} +1 -1
- package/{templates → template/packages}/web/src/App.tsx +1 -1
- package/dist/generators/api.js +0 -31
- package/dist/generators/api.js.map +0 -1
- package/dist/generators/database.js +0 -31
- package/dist/generators/database.js.map +0 -1
- package/dist/generators/fullstack.js +0 -418
- package/dist/generators/fullstack.js.map +0 -1
- package/dist/generators/native.js +0 -112
- package/dist/generators/native.js.map +0 -1
- package/dist/generators/shared.js +0 -29
- package/dist/generators/shared.js.map +0 -1
- package/dist/generators/web.js +0 -45
- package/dist/generators/web.js.map +0 -1
- package/dist/generators/workspace.js +0 -83
- package/dist/generators/workspace.js.map +0 -1
- package/dist/templates/shared/src/navigation/AppRouter.tsx +0 -98
- package/dist/templates/workspace/package.json +0 -35
- package/dist/types/generators/api.d.ts +0 -2
- package/dist/types/generators/database.d.ts +0 -2
- package/dist/types/generators/fullstack.d.ts +0 -2
- package/dist/types/generators/native.d.ts +0 -2
- package/dist/types/generators/shared.d.ts +0 -2
- package/dist/types/generators/web.d.ts +0 -2
- package/dist/types/generators/workspace.d.ts +0 -2
- package/templates/workspace/package.json +0 -38
- /package/dist/{templates/workspace → template}/.devcontainer/Dockerfile +0 -0
- /package/dist/{templates/workspace → template}/.devcontainer/devcontainer.json +0 -0
- /package/dist/{templates/workspace → template}/.devcontainer/docker-compose.yml +0 -0
- /package/dist/{templates/workspace → template}/.devcontainer/figma-mcp.sh +0 -0
- /package/dist/{templates/workspace → template}/.devcontainer/setup.sh +0 -0
- /package/dist/{templates/workspace → template}/.dockerignore +0 -0
- /package/dist/{templates/workspace → template}/.env.example +0 -0
- /package/dist/{templates/workspace → template}/DOCKER.md +0 -0
- /package/dist/{templates/workspace → template}/Dockerfile +0 -0
- /package/dist/{templates/workspace → template}/docker/nginx/prod.conf +0 -0
- /package/dist/{templates/workspace → template}/docker/nginx.conf +0 -0
- /package/dist/{templates/workspace → template}/docker/postgres/init.sql +0 -0
- /package/dist/{templates/workspace → template}/docker/prometheus/prometheus.yml +0 -0
- /package/dist/{templates/workspace → template}/docker-compose.prod.yml +0 -0
- /package/dist/{templates/workspace → template}/docker-compose.yml +0 -0
- /package/dist/{templates/workspace → template}/jest.config.js +0 -0
- /package/dist/{templates → template/packages}/api/.env.example +0 -0
- /package/dist/{templates → template/packages}/api/README.md +0 -0
- /package/dist/{templates → template/packages}/api/__tests__/api.test.ts +0 -0
- /package/dist/{templates → template/packages}/api/jest.config.js +0 -0
- /package/dist/{templates → template/packages}/api/jest.setup.js +0 -0
- /package/dist/{templates → template/packages}/api/src/context.ts +0 -0
- /package/dist/{templates → template/packages}/api/src/controllers/TestController.ts +0 -0
- /package/dist/{templates → template/packages}/api/src/index.ts +0 -0
- /package/dist/{templates → template/packages}/api/src/lib/crud.ts +0 -0
- /package/dist/{templates → template/packages}/api/src/lib/database.ts +0 -0
- /package/dist/{templates → template/packages}/api/src/router/index.ts +0 -0
- /package/dist/{templates → template/packages}/api/src/routers/test.ts +0 -0
- /package/dist/{templates → template/packages}/api/src/routers/user.example.ts +0 -0
- /package/dist/{templates → template/packages}/api/src/server.ts +0 -0
- /package/dist/{templates → template/packages}/api/src/trpc.ts +0 -0
- /package/dist/{templates → template/packages}/api/tsconfig.json +0 -0
- /package/dist/{templates → template/packages}/database/README.md +0 -0
- /package/dist/{templates → template/packages}/database/prisma/seed.ts +0 -0
- /package/dist/{templates → template/packages}/database/schema.prisma +0 -0
- /package/dist/{templates → template/packages}/database/src/index.ts +0 -0
- /package/dist/{templates → template/packages}/database/src/validators.ts +0 -0
- /package/dist/{templates → template/packages}/database/tsconfig.json +0 -0
- /package/dist/{templates/native → template/packages/mobile}/README.md +0 -0
- /package/dist/{templates/native → template/packages/mobile}/__tests__/App.test.tsx +0 -0
- /package/dist/{templates/native → template/packages/mobile}/__tests__/components.test.tsx +0 -0
- /package/dist/{templates/native → template/packages/mobile}/app.json +0 -0
- /package/dist/{templates/native → template/packages/mobile}/index.js +0 -0
- /package/dist/{templates/native → template/packages/mobile}/jest.config.js +0 -0
- /package/dist/{templates/native → template/packages/mobile}/jest.setup.js +0 -0
- /package/dist/{templates/native → template/packages/mobile}/src/App-with-trpc-and-shared.tsx +0 -0
- /package/dist/{templates/native → template/packages/mobile}/src/App-with-trpc.tsx +0 -0
- /package/{templates/native/src/App-with-trpc-and-shared.tsx → dist/template/packages/mobile/src/App.tsx} +0 -0
- /package/dist/{templates/native → template/packages/mobile}/src/utils/trpc.ts +0 -0
- /package/dist/{templates/native → template/packages/mobile}/tsconfig.json +0 -0
- /package/dist/{templates → template/packages}/shared/README.md +0 -0
- /package/dist/{templates → template/packages}/shared/__tests__/shared.test.ts +0 -0
- /package/dist/{templates → template/packages}/shared/jest.config.js +0 -0
- /package/{templates → dist/template/packages}/shared/src/components/App.tsx +0 -0
- /package/{templates → dist/template/packages}/shared/src/components/HelloWorld.tsx +0 -0
- /package/dist/{templates → template/packages}/shared/src/components/index.ts +0 -0
- /package/dist/{templates → template/packages}/shared/src/index.ts +0 -0
- /package/{templates → dist/template/packages}/shared/src/navigation/AppRouter.tsx +0 -0
- /package/dist/{templates → template/packages}/shared/src/trpc/client.ts +0 -0
- /package/dist/{templates → template/packages}/shared/tsconfig.json +0 -0
- /package/dist/{templates → template/packages}/web/README.md +0 -0
- /package/dist/{templates → template/packages}/web/__tests__/App.test.tsx +0 -0
- /package/dist/{templates → template/packages}/web/__tests__/components.test.tsx +0 -0
- /package/dist/{templates → template/packages}/web/index.html +0 -0
- /package/dist/{templates → template/packages}/web/jest.config.js +0 -0
- /package/dist/{templates → template/packages}/web/jest.setup.js +0 -0
- /package/dist/{templates → template/packages}/web/src/App-with-trpc-and-shared.tsx +0 -0
- /package/dist/{templates → template/packages}/web/src/App-with-trpc.tsx +0 -0
- /package/{templates/web/src/App-with-trpc-and-shared.tsx → dist/template/packages/web/src/App.tsx} +0 -0
- /package/dist/{templates → template/packages}/web/src/components/TestDemo.tsx +0 -0
- /package/dist/{templates → template/packages}/web/src/main.tsx +0 -0
- /package/dist/{templates → template/packages}/web/src/utils/trpc.ts +0 -0
- /package/dist/{templates → template/packages}/web/tsconfig.json +0 -0
- /package/dist/{templates → template/packages}/web/vite.config.ts +0 -0
- /package/dist/{templates/workspace → template}/setup.sh +0 -0
- /package/dist/{templates/workspace → template}/tsconfig.json +0 -0
- /package/{templates/workspace → template}/.devcontainer/Dockerfile +0 -0
- /package/{templates/workspace → template}/.devcontainer/devcontainer.json +0 -0
- /package/{templates/workspace → template}/.devcontainer/docker-compose.yml +0 -0
- /package/{templates/workspace → template}/.devcontainer/figma-mcp.sh +0 -0
- /package/{templates/workspace → template}/.devcontainer/setup.sh +0 -0
- /package/{templates/workspace → template}/.dockerignore +0 -0
- /package/{templates/workspace → template}/.env.example +0 -0
- /package/{templates/workspace → template}/.env.production +0 -0
- /package/{templates/workspace → template}/DOCKER.md +0 -0
- /package/{templates/workspace → template}/Dockerfile +0 -0
- /package/{templates/workspace → template}/docker/nginx/prod.conf +0 -0
- /package/{templates/workspace → template}/docker/nginx.conf +0 -0
- /package/{templates/workspace → template}/docker/postgres/init.sql +0 -0
- /package/{templates/workspace → template}/docker/prometheus/prometheus.yml +0 -0
- /package/{templates/workspace → template}/docker-compose.prod.yml +0 -0
- /package/{templates/workspace → template}/docker-compose.yml +0 -0
- /package/{templates/workspace → template}/jest.config.js +0 -0
- /package/{templates → template/packages}/api/.env.example +0 -0
- /package/{templates → template/packages}/api/README.md +0 -0
- /package/{templates → template/packages}/api/__tests__/api.test.ts +0 -0
- /package/{templates → template/packages}/api/jest.config.js +0 -0
- /package/{templates → template/packages}/api/jest.setup.js +0 -0
- /package/{templates → template/packages}/api/src/context.ts +0 -0
- /package/{templates → template/packages}/api/src/controllers/TestController.ts +0 -0
- /package/{templates → template/packages}/api/src/index.ts +0 -0
- /package/{templates → template/packages}/api/src/lib/crud.ts +0 -0
- /package/{templates → template/packages}/api/src/lib/database.ts +0 -0
- /package/{templates → template/packages}/api/src/router/index.ts +0 -0
- /package/{templates → template/packages}/api/src/routers/test.ts +0 -0
- /package/{templates → template/packages}/api/src/routers/user.example.ts +0 -0
- /package/{templates → template/packages}/api/src/server.ts +0 -0
- /package/{templates → template/packages}/api/src/trpc.ts +0 -0
- /package/{templates → template/packages}/api/tsconfig.json +0 -0
- /package/{templates → template/packages}/database/README.md +0 -0
- /package/{templates → template/packages}/database/prisma/seed.ts +0 -0
- /package/{templates → template/packages}/database/schema.prisma +0 -0
- /package/{templates → template/packages}/database/src/index.ts +0 -0
- /package/{templates → template/packages}/database/src/validators.ts +0 -0
- /package/{templates → template/packages}/database/tsconfig.json +0 -0
- /package/{templates/native → template/packages/mobile}/README.md +0 -0
- /package/{templates/native → template/packages/mobile}/__tests__/App.test.tsx +0 -0
- /package/{templates/native → template/packages/mobile}/__tests__/components.test.tsx +0 -0
- /package/{templates/native → template/packages/mobile}/app.json +0 -0
- /package/{templates/native → template/packages/mobile}/index.js +0 -0
- /package/{templates/native → template/packages/mobile}/jest.config.js +0 -0
- /package/{templates/native → template/packages/mobile}/jest.setup.js +0 -0
- /package/{templates/native → template/packages/mobile}/src/App-with-trpc.tsx +0 -0
- /package/{templates/native → template/packages/mobile}/src/utils/trpc.ts +0 -0
- /package/{templates/native → template/packages/mobile}/tsconfig.json +0 -0
- /package/{templates → template/packages}/shared/README.md +0 -0
- /package/{templates → template/packages}/shared/__tests__/shared.test.ts +0 -0
- /package/{templates → template/packages}/shared/jest.config.js +0 -0
- /package/{templates → template/packages}/shared/src/components/index.ts +0 -0
- /package/{templates → template/packages}/shared/src/index.ts +0 -0
- /package/{templates → template/packages}/shared/src/trpc/client.ts +0 -0
- /package/{templates → template/packages}/shared/tsconfig.json +0 -0
- /package/{templates → template/packages}/web/README.md +0 -0
- /package/{templates → template/packages}/web/__tests__/App.test.tsx +0 -0
- /package/{templates → template/packages}/web/__tests__/components.test.tsx +0 -0
- /package/{templates → template/packages}/web/index.html +0 -0
- /package/{templates → template/packages}/web/jest.config.js +0 -0
- /package/{templates → template/packages}/web/jest.setup.js +0 -0
- /package/{templates → template/packages}/web/src/App-with-trpc.tsx +0 -0
- /package/{templates → template/packages}/web/src/components/TestDemo.tsx +0 -0
- /package/{templates → template/packages}/web/src/main.tsx +0 -0
- /package/{templates → template/packages}/web/src/utils/trpc.ts +0 -0
- /package/{templates → template/packages}/web/tsconfig.json +0 -0
- /package/{templates → template/packages}/web/vite.config.ts +0 -0
- /package/{templates/workspace → template}/setup.sh +0 -0
- /package/{templates/workspace → template}/tsconfig.json +0 -0
|
@@ -6,14 +6,14 @@ const { wrapWithReanimatedMetroConfig } = require('react-native-reanimated/metro
|
|
|
6
6
|
const config = {
|
|
7
7
|
projectRoot: __dirname,
|
|
8
8
|
watchFolders: [
|
|
9
|
-
// Add the workspace root to watch folders so Metro can
|
|
10
|
-
path.resolve(__dirname, '
|
|
9
|
+
// Add the workspace root to watch folders so Metro can find hoisted node_modules
|
|
10
|
+
path.resolve(__dirname, '../..'),
|
|
11
11
|
],
|
|
12
12
|
resolver: {
|
|
13
13
|
nodeModulesPaths: [
|
|
14
14
|
path.resolve(__dirname, 'node_modules'),
|
|
15
|
-
// Add the workspace root node_modules
|
|
16
|
-
path.resolve(__dirname, '
|
|
15
|
+
// Add the workspace root node_modules for hoisted packages
|
|
16
|
+
path.resolve(__dirname, '../..', 'node_modules'),
|
|
17
17
|
],
|
|
18
18
|
// Important for Idealyst to use .native extensions for React Native (eg: @idealyst/components/src/Button/Button.native.tsx)
|
|
19
19
|
sourceExts: ['native.tsx', 'native.ts', 'tsx', 'ts', 'native.jsx', 'native.js', 'jsx', 'js', 'json', 'cjs'],
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
{
|
|
2
|
-
"name": "{{
|
|
2
|
+
"name": "@{{workspaceScope}}/mobile",
|
|
3
3
|
"version": "{{version}}",
|
|
4
4
|
"description": "{{description}}",
|
|
5
5
|
"private": true,
|
|
@@ -16,13 +16,16 @@
|
|
|
16
16
|
"@idealyst/components": "^{{idealystVersion}}",
|
|
17
17
|
"@idealyst/navigation": "^{{idealystVersion}}",
|
|
18
18
|
"@idealyst/theme": "^{{idealystVersion}}",
|
|
19
|
+
"@{{workspaceScope}}/shared": "workspace:*",
|
|
20
|
+
"@{{workspaceScope}}/database": "workspace:*",
|
|
19
21
|
"@tanstack/react-query": "^5.83.0",
|
|
20
22
|
"@trpc/client": "^11.5.1",
|
|
21
23
|
"@trpc/react-query": "^11.5.1",
|
|
22
24
|
"@trpc/server": "^11.5.1",
|
|
23
25
|
"react": "^18.2.0",
|
|
24
26
|
"react-native": "^0.73.0",
|
|
25
|
-
"react-native-svg": "^15.8.0"
|
|
27
|
+
"react-native-svg": "^15.8.0",
|
|
28
|
+
"react-native-worklets": "^0.6.1"
|
|
26
29
|
},
|
|
27
30
|
"devDependencies": {
|
|
28
31
|
"@babel/core": "^7.20.0",
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
{
|
|
2
|
-
"name": "{{
|
|
2
|
+
"name": "@{{workspaceScope}}/shared",
|
|
3
3
|
"version": "{{version}}",
|
|
4
4
|
"description": "{{description}}",
|
|
5
5
|
"main": "src/index.ts",
|
|
@@ -28,7 +28,7 @@
|
|
|
28
28
|
"@trpc/server": "^11.5.1",
|
|
29
29
|
"react": "^19.1.0",
|
|
30
30
|
"react-native": "^0.80.1",
|
|
31
|
-
"{{workspaceScope}}/api": "*"
|
|
31
|
+
"@{{workspaceScope}}/api": "*"
|
|
32
32
|
},
|
|
33
33
|
"peerDependenciesMeta": {
|
|
34
34
|
"react-native": {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
{
|
|
2
|
-
"name": "{{
|
|
2
|
+
"name": "@{{workspaceScope}}/web",
|
|
3
3
|
"version": "{{version}}",
|
|
4
4
|
"description": "{{description}}",
|
|
5
5
|
"private": true,
|
|
@@ -16,6 +16,9 @@
|
|
|
16
16
|
"@idealyst/components": "^{{idealystVersion}}",
|
|
17
17
|
"@idealyst/navigation": "^{{idealystVersion}}",
|
|
18
18
|
"@idealyst/theme": "^{{idealystVersion}}",
|
|
19
|
+
"@{{workspaceScope}}/shared": "workspace:*",
|
|
20
|
+
"@{{workspaceScope}}/database": "workspace:*",
|
|
21
|
+
"@{{workspaceScope}}/api": "workspace:*",
|
|
19
22
|
"@mdi/js": "^7.4.47",
|
|
20
23
|
"@mdi/react": "^1.6.1",
|
|
21
24
|
"@react-native/normalize-colors": "^0.80.1",
|
|
@@ -1,9 +1,3 @@
|
|
|
1
1
|
import { GenerateProjectOptions } from '../types';
|
|
2
2
|
export declare function generateProject(options: GenerateProjectOptions): Promise<void>;
|
|
3
|
-
export * from './
|
|
4
|
-
export * from './web';
|
|
5
|
-
export * from './shared';
|
|
6
|
-
export * from './workspace';
|
|
7
|
-
export * from './api';
|
|
8
|
-
export * from './database';
|
|
9
|
-
export * from './fullstack';
|
|
3
|
+
export * from './init';
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Configures React Native Android and iOS to work in a Yarn workspace monorepo
|
|
3
|
+
* with hoisted node_modules at the workspace root.
|
|
4
|
+
*
|
|
5
|
+
* Based on: https://www.callstack.com/blog/setting-up-react-native-monorepo-with-yarn-workspaces
|
|
6
|
+
*/
|
|
7
|
+
interface ConfigureOptions {
|
|
8
|
+
mobilePackagePath: string;
|
|
9
|
+
workspaceRoot: string;
|
|
10
|
+
}
|
|
11
|
+
/**
|
|
12
|
+
* Updates Android gradle files to use workspace root node_modules
|
|
13
|
+
*/
|
|
14
|
+
export declare function configureAndroid(options: ConfigureOptions): Promise<void>;
|
|
15
|
+
/**
|
|
16
|
+
* Updates iOS Podfile to use workspace root node_modules
|
|
17
|
+
*/
|
|
18
|
+
export declare function configureIOS(options: ConfigureOptions): Promise<void>;
|
|
19
|
+
/**
|
|
20
|
+
* Main function to configure both Android and iOS
|
|
21
|
+
*/
|
|
22
|
+
export declare function configureReactNativeMonorepo(mobilePackagePath: string, workspaceRoot: string): Promise<void>;
|
|
23
|
+
export {};
|
package/dist/types/types.d.ts
CHANGED
|
@@ -1,11 +1,7 @@
|
|
|
1
|
-
export type ProjectType = 'native' | 'web' | 'shared' | 'workspace' | 'api' | 'database' | 'fullstack';
|
|
2
1
|
export interface GenerateProjectOptions {
|
|
3
2
|
name: string;
|
|
4
|
-
type: ProjectType;
|
|
5
3
|
directory: string;
|
|
6
4
|
skipInstall: boolean;
|
|
7
|
-
appName?: string;
|
|
8
|
-
withTrpc?: boolean;
|
|
9
5
|
figmaToken?: string;
|
|
10
6
|
}
|
|
11
7
|
export interface TemplateData {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@idealyst/cli",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.91",
|
|
4
4
|
"description": "CLI tool for generating Idealyst Framework projects",
|
|
5
5
|
"readme": "README.md",
|
|
6
6
|
"main": "dist/index.js",
|
|
@@ -56,7 +56,7 @@
|
|
|
56
56
|
},
|
|
57
57
|
"files": [
|
|
58
58
|
"dist",
|
|
59
|
-
"
|
|
59
|
+
"template",
|
|
60
60
|
"docs"
|
|
61
61
|
],
|
|
62
62
|
"keywords": [
|
|
@@ -1,22 +1,76 @@
|
|
|
1
1
|
# {{projectName}}
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
A full-stack application built with the Idealyst Framework.
|
|
4
4
|
|
|
5
|
-
##
|
|
5
|
+
## 🏗️ Architecture
|
|
6
6
|
|
|
7
|
-
This workspace contains
|
|
7
|
+
This workspace contains a complete full-stack application with:
|
|
8
8
|
|
|
9
|
-
|
|
9
|
+
- **📱 Mobile App** (`packages/mobile`) - React Native app with Idealyst components
|
|
10
|
+
- **🌐 Web App** (`packages/web`) - React web app with Idealyst components
|
|
11
|
+
- **🚀 API Server** (`packages/api`) - tRPC API server with Express
|
|
12
|
+
- **🗄️ Database** (`packages/database`) - Prisma database layer with PostgreSQL
|
|
13
|
+
- **📦 Shared** (`packages/shared`) - Cross-platform shared components and utilities
|
|
10
14
|
|
|
15
|
+
All packages are pre-integrated and work together seamlessly.
|
|
16
|
+
|
|
17
|
+
## 🚀 Quick Start
|
|
18
|
+
|
|
19
|
+
### Prerequisites
|
|
20
|
+
- Node.js 18+
|
|
21
|
+
- Yarn 3+
|
|
22
|
+
- PostgreSQL (or use Docker)
|
|
23
|
+
|
|
24
|
+
### Setup
|
|
25
|
+
```bash
|
|
26
|
+
# Install dependencies
|
|
27
|
+
yarn install
|
|
28
|
+
|
|
29
|
+
# Set up environment variables
|
|
30
|
+
cp packages/api/.env.example packages/api/.env
|
|
31
|
+
cp packages/database/.env.example packages/database/.env
|
|
32
|
+
# Edit .env files with your database URL
|
|
33
|
+
|
|
34
|
+
# Generate database client
|
|
35
|
+
yarn db:generate
|
|
36
|
+
|
|
37
|
+
# Push database schema
|
|
38
|
+
yarn db:push
|
|
39
|
+
|
|
40
|
+
# Start all development servers
|
|
41
|
+
yarn dev
|
|
11
42
|
```
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
43
|
+
|
|
44
|
+
This will start:
|
|
45
|
+
- 🌐 Web app at http://localhost:5173
|
|
46
|
+
- 🚀 API server at http://localhost:3000
|
|
47
|
+
- 📱 Mobile app (Metro bundler)
|
|
48
|
+
|
|
49
|
+
### Individual Commands
|
|
50
|
+
|
|
51
|
+
```bash
|
|
52
|
+
# Web development
|
|
53
|
+
yarn web:dev # Start web app
|
|
54
|
+
yarn web:build # Build web app
|
|
55
|
+
|
|
56
|
+
# Mobile development
|
|
57
|
+
yarn mobile:start # Start Metro bundler
|
|
58
|
+
yarn mobile:android # Run on Android
|
|
59
|
+
yarn mobile:ios # Run on iOS
|
|
60
|
+
|
|
61
|
+
# API development
|
|
62
|
+
yarn api:dev # Start API server
|
|
63
|
+
yarn api:build # Build API server
|
|
64
|
+
|
|
65
|
+
# Database management
|
|
66
|
+
yarn db:generate # Generate Prisma client
|
|
67
|
+
yarn db:push # Push schema to database
|
|
68
|
+
yarn db:migrate # Create migrations
|
|
69
|
+
yarn db:studio # Open Prisma Studio
|
|
70
|
+
|
|
71
|
+
# Build all packages
|
|
72
|
+
yarn build # Build everything
|
|
73
|
+
yarn build:packages # Build shared packages only
|
|
20
74
|
```
|
|
21
75
|
|
|
22
76
|
## Testing
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "{{packageName}}",
|
|
3
|
+
"version": "{{version}}",
|
|
4
|
+
"description": "{{description}}",
|
|
5
|
+
"private": true,
|
|
6
|
+
"workspaces": [
|
|
7
|
+
"packages/*"
|
|
8
|
+
],
|
|
9
|
+
"packageManager": "yarn@4.1.0",
|
|
10
|
+
"scripts": {
|
|
11
|
+
"dev": "concurrently \"yarn api:dev\" \"yarn web:dev\" \"yarn mobile:start\"",
|
|
12
|
+
"build": "yarn build:packages && yarn api:build && yarn web:build",
|
|
13
|
+
"build:packages": "yarn workspace @{{workspaceScope}}/database build && yarn workspace @{{workspaceScope}}/shared build",
|
|
14
|
+
"api:dev": "yarn workspace @{{workspaceScope}}/api dev",
|
|
15
|
+
"api:build": "yarn workspace @{{workspaceScope}}/api build",
|
|
16
|
+
"web:dev": "yarn workspace @{{workspaceScope}}/web dev",
|
|
17
|
+
"web:build": "yarn workspace @{{workspaceScope}}/web build",
|
|
18
|
+
"mobile:start": "yarn workspace @{{workspaceScope}}/mobile start",
|
|
19
|
+
"mobile:android": "yarn workspace @{{workspaceScope}}/mobile android",
|
|
20
|
+
"mobile:ios": "yarn workspace @{{workspaceScope}}/mobile ios",
|
|
21
|
+
"db:generate": "yarn workspace @{{workspaceScope}}/database db:generate",
|
|
22
|
+
"db:push": "yarn workspace @{{workspaceScope}}/database db:push",
|
|
23
|
+
"db:migrate": "yarn workspace @{{workspaceScope}}/database db:migrate",
|
|
24
|
+
"db:studio": "yarn workspace @{{workspaceScope}}/database db:studio",
|
|
25
|
+
"test": "yarn workspaces foreach --include '@/*' run test",
|
|
26
|
+
"test:watch": "yarn workspaces foreach --include '@/*' run test:watch",
|
|
27
|
+
"test:coverage": "yarn workspaces foreach --include '@/*' run test:coverage",
|
|
28
|
+
"test:ci": "yarn workspaces foreach --include '@/*' --parallel run test --passWithNoTests",
|
|
29
|
+
"type-check": "yarn workspaces run type-check"
|
|
30
|
+
},
|
|
31
|
+
"devDependencies": {
|
|
32
|
+
"@babel/core": "^7.28.0",
|
|
33
|
+
"@babel/preset-env": "^7.28.0",
|
|
34
|
+
"@babel/preset-react": "^7.27.1",
|
|
35
|
+
"@babel/preset-typescript": "^7.27.1",
|
|
36
|
+
"@idealyst/mcp-server": "^{{idealystVersion}}",
|
|
37
|
+
"@mobilenext/mobile-mcp": "^0.0.34",
|
|
38
|
+
"@playwright/mcp": "^0.0.45",
|
|
39
|
+
"@types/jest": "^29.5.12",
|
|
40
|
+
"concurrently": "^8.2.2",
|
|
41
|
+
"jest": "^29.7.0",
|
|
42
|
+
"ts-jest": "^29.1.2",
|
|
43
|
+
"typescript": "^5.0.0"
|
|
44
|
+
}
|
|
45
|
+
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
{
|
|
2
|
-
"name": "{{
|
|
2
|
+
"name": "@{{workspaceScope}}/api",
|
|
3
3
|
"version": "{{version}}",
|
|
4
4
|
"description": "{{description}}",
|
|
5
5
|
"type": "module",
|
|
@@ -23,6 +23,8 @@
|
|
|
23
23
|
"type-check": "tsc --noEmit"
|
|
24
24
|
},
|
|
25
25
|
"dependencies": {
|
|
26
|
+
"@{{workspaceScope}}/database": "workspace:*",
|
|
27
|
+
"@{{workspaceScope}}/shared": "workspace:*",
|
|
26
28
|
"@trpc/server": "^11.5.1",
|
|
27
29
|
"cors": "^2.8.5",
|
|
28
30
|
"dotenv": "^16.3.1",
|
|
@@ -6,14 +6,14 @@ const { wrapWithReanimatedMetroConfig } = require('react-native-reanimated/metro
|
|
|
6
6
|
const config = {
|
|
7
7
|
projectRoot: __dirname,
|
|
8
8
|
watchFolders: [
|
|
9
|
-
// Add the workspace root to watch folders so Metro can
|
|
10
|
-
path.resolve(__dirname, '
|
|
9
|
+
// Add the workspace root to watch folders so Metro can find hoisted node_modules
|
|
10
|
+
path.resolve(__dirname, '../..'),
|
|
11
11
|
],
|
|
12
12
|
resolver: {
|
|
13
13
|
nodeModulesPaths: [
|
|
14
14
|
path.resolve(__dirname, 'node_modules'),
|
|
15
|
-
// Add the workspace root node_modules
|
|
16
|
-
path.resolve(__dirname, '
|
|
15
|
+
// Add the workspace root node_modules for hoisted packages
|
|
16
|
+
path.resolve(__dirname, '../..', 'node_modules'),
|
|
17
17
|
],
|
|
18
18
|
// Important for Idealyst to use .native extensions for React Native (eg: @idealyst/components/src/Button/Button.native.tsx)
|
|
19
19
|
sourceExts: ['native.tsx', 'native.ts', 'tsx', 'ts', 'native.jsx', 'native.js', 'jsx', 'js', 'json', 'cjs'],
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
{
|
|
2
|
-
"name": "{{
|
|
2
|
+
"name": "@{{workspaceScope}}/mobile",
|
|
3
3
|
"version": "{{version}}",
|
|
4
4
|
"description": "{{description}}",
|
|
5
5
|
"private": true,
|
|
@@ -16,13 +16,16 @@
|
|
|
16
16
|
"@idealyst/components": "^{{idealystVersion}}",
|
|
17
17
|
"@idealyst/navigation": "^{{idealystVersion}}",
|
|
18
18
|
"@idealyst/theme": "^{{idealystVersion}}",
|
|
19
|
+
"@{{workspaceScope}}/shared": "workspace:*",
|
|
20
|
+
"@{{workspaceScope}}/database": "workspace:*",
|
|
19
21
|
"@tanstack/react-query": "^5.83.0",
|
|
20
22
|
"@trpc/client": "^11.5.1",
|
|
21
23
|
"@trpc/react-query": "^11.5.1",
|
|
22
24
|
"@trpc/server": "^11.5.1",
|
|
23
25
|
"react": "^18.2.0",
|
|
24
26
|
"react-native": "^0.73.0",
|
|
25
|
-
"react-native-svg": "^15.8.0"
|
|
27
|
+
"react-native-svg": "^15.8.0",
|
|
28
|
+
"react-native-worklets": "^0.6.1"
|
|
26
29
|
},
|
|
27
30
|
"devDependencies": {
|
|
28
31
|
"@babel/core": "^7.20.0",
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
{
|
|
2
|
-
"name": "{{
|
|
2
|
+
"name": "@{{workspaceScope}}/shared",
|
|
3
3
|
"version": "{{version}}",
|
|
4
4
|
"description": "{{description}}",
|
|
5
5
|
"main": "src/index.ts",
|
|
@@ -28,7 +28,7 @@
|
|
|
28
28
|
"@trpc/server": "^11.5.1",
|
|
29
29
|
"react": "^19.1.0",
|
|
30
30
|
"react-native": "^0.80.1",
|
|
31
|
-
"{{workspaceScope}}/api": "*"
|
|
31
|
+
"@{{workspaceScope}}/api": "*"
|
|
32
32
|
},
|
|
33
33
|
"peerDependenciesMeta": {
|
|
34
34
|
"react-native": {
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import
|
|
2
|
-
import { QueryClient, QueryClientProvider } from
|
|
3
|
-
import
|
|
4
|
-
import
|
|
5
|
-
import
|
|
1
|
+
import { NavigatorProvider } from "@idealyst/navigation";
|
|
2
|
+
import { QueryClient, QueryClientProvider } from "@tanstack/react-query";
|
|
3
|
+
import React from "react";
|
|
4
|
+
import AppRouter from "../navigation/AppRouter";
|
|
5
|
+
import { createTRPCClient, trpc } from "../trpc/client";
|
|
6
6
|
|
|
7
7
|
interface AppProps {
|
|
8
8
|
apiUrl?: string;
|
|
@@ -15,7 +15,6 @@ const defaultQueryClient = new QueryClient({
|
|
|
15
15
|
defaultOptions: {
|
|
16
16
|
queries: {
|
|
17
17
|
staleTime: 1000 * 60 * 5, // 5 minutes
|
|
18
|
-
cacheTime: 1000 * 60 * 10, // 10 minutes
|
|
19
18
|
},
|
|
20
19
|
},
|
|
21
20
|
});
|
|
@@ -24,10 +23,10 @@ const defaultQueryClient = new QueryClient({
|
|
|
24
23
|
* Unified App component that sets up tRPC, React Query providers, and Navigation
|
|
25
24
|
* This component can be used by both web and mobile platforms
|
|
26
25
|
*/
|
|
27
|
-
export const App: React.FC<AppProps> = ({
|
|
28
|
-
apiUrl =
|
|
26
|
+
export const App: React.FC<AppProps> = ({
|
|
27
|
+
apiUrl = "http://localhost:3000/trpc",
|
|
29
28
|
queryClient = defaultQueryClient,
|
|
30
|
-
headers
|
|
29
|
+
headers,
|
|
31
30
|
}) => {
|
|
32
31
|
// Create tRPC client with the provided configuration
|
|
33
32
|
const trpcClient = createTRPCClient({
|
|
@@ -79,7 +79,7 @@ export const HelloWorld = ({
|
|
|
79
79
|
{platformText}
|
|
80
80
|
</Text>
|
|
81
81
|
{/* Framework Branding Card */}
|
|
82
|
-
<Card
|
|
82
|
+
<Card type="elevated" padding="lg" intent="primary">
|
|
83
83
|
<View style={{ alignItems: "center" }}>
|
|
84
84
|
<Text style={{ fontSize: 32, marginBottom: 16 }}>🚀</Text>
|
|
85
85
|
<Text
|
|
@@ -89,10 +89,7 @@ export const HelloWorld = ({
|
|
|
89
89
|
>
|
|
90
90
|
Idealyst Framework
|
|
91
91
|
</Text>
|
|
92
|
-
<Text
|
|
93
|
-
size="md"
|
|
94
|
-
style={{ marginBottom: 16, textAlign: "center" }}
|
|
95
|
-
>
|
|
92
|
+
<Text size="md" style={{ marginBottom: 16, textAlign: "center" }}>
|
|
96
93
|
Hello, {name}! Welcome to your cross-platform workspace.
|
|
97
94
|
</Text>
|
|
98
95
|
|
|
@@ -106,7 +103,7 @@ export const HelloWorld = ({
|
|
|
106
103
|
}}
|
|
107
104
|
>
|
|
108
105
|
<Card
|
|
109
|
-
|
|
106
|
+
type="filled"
|
|
110
107
|
padding="sm"
|
|
111
108
|
style={{ backgroundColor: "rgba(255, 255, 255, 0.2)" }}
|
|
112
109
|
>
|
|
@@ -115,7 +112,7 @@ export const HelloWorld = ({
|
|
|
115
112
|
</Text>
|
|
116
113
|
</Card>
|
|
117
114
|
<Card
|
|
118
|
-
|
|
115
|
+
type="filled"
|
|
119
116
|
padding="sm"
|
|
120
117
|
style={{ backgroundColor: "rgba(255, 255, 255, 0.2)" }}
|
|
121
118
|
>
|
|
@@ -124,7 +121,7 @@ export const HelloWorld = ({
|
|
|
124
121
|
</Text>
|
|
125
122
|
</Card>
|
|
126
123
|
<Card
|
|
127
|
-
|
|
124
|
+
type="filled"
|
|
128
125
|
padding="sm"
|
|
129
126
|
style={{ backgroundColor: "rgba(255, 255, 255, 0.2)" }}
|
|
130
127
|
>
|
|
@@ -137,7 +134,7 @@ export const HelloWorld = ({
|
|
|
137
134
|
</Card>
|
|
138
135
|
|
|
139
136
|
{/* Quick Start Guide Card */}
|
|
140
|
-
<Card
|
|
137
|
+
<Card type="outlined" padding="lg" style={{ marginTop: 16 }}>
|
|
141
138
|
<Text size="lg" weight="bold" style={{ marginBottom: 16 }}>
|
|
142
139
|
🎯 Quick Start Guide
|
|
143
140
|
</Text>
|
|
@@ -182,7 +179,7 @@ export const HelloWorld = ({
|
|
|
182
179
|
</Text>
|
|
183
180
|
</View>
|
|
184
181
|
|
|
185
|
-
<Card
|
|
182
|
+
<Card type="filled" intent="success" padding="md">
|
|
186
183
|
<Text size="sm" weight="semibold" style={{ marginBottom: 4 }}>
|
|
187
184
|
✨ Framework Features:
|
|
188
185
|
</Text>
|
|
@@ -194,7 +191,7 @@ export const HelloWorld = ({
|
|
|
194
191
|
</Card>
|
|
195
192
|
|
|
196
193
|
{/* API Testing Section */}
|
|
197
|
-
<Card
|
|
194
|
+
<Card type="outlined" padding="lg" style={{ marginTop: 16 }}>
|
|
198
195
|
<Text size="lg" weight="bold" style={{ marginBottom: 16 }}>
|
|
199
196
|
🚀 API Demo - Database Integration
|
|
200
197
|
</Text>
|
|
@@ -205,7 +202,7 @@ export const HelloWorld = ({
|
|
|
205
202
|
|
|
206
203
|
{/* Create New Test Form */}
|
|
207
204
|
<Card
|
|
208
|
-
|
|
205
|
+
type="filled"
|
|
209
206
|
padding="md"
|
|
210
207
|
style={{ marginBottom: 16, backgroundColor: "#f8fafc" }}
|
|
211
208
|
>
|
|
@@ -229,11 +226,11 @@ export const HelloWorld = ({
|
|
|
229
226
|
disabled={
|
|
230
227
|
!newTestName ||
|
|
231
228
|
!newTestMessage ||
|
|
232
|
-
createTestMutation.
|
|
229
|
+
createTestMutation.isPending
|
|
233
230
|
}
|
|
234
231
|
style={{ alignSelf: "flex-start" }}
|
|
235
232
|
>
|
|
236
|
-
{createTestMutation.
|
|
233
|
+
{createTestMutation.isPending ? "Creating..." : "Create Test"}
|
|
237
234
|
</Button>
|
|
238
235
|
</View>
|
|
239
236
|
</Card>
|
|
@@ -244,14 +241,14 @@ export const HelloWorld = ({
|
|
|
244
241
|
Database Records ({tests.data?.length || 0})
|
|
245
242
|
</Text>
|
|
246
243
|
|
|
247
|
-
{tests.
|
|
248
|
-
<Card
|
|
244
|
+
{tests.isPending ? (
|
|
245
|
+
<Card type="outlined" padding="md">
|
|
249
246
|
<Text size="sm" style={{ color: "#64748b" }}>
|
|
250
247
|
Loading tests...
|
|
251
248
|
</Text>
|
|
252
249
|
</Card>
|
|
253
250
|
) : tests.data?.length === 0 ? (
|
|
254
|
-
<Card
|
|
251
|
+
<Card type="outlined" padding="md">
|
|
255
252
|
<Text size="sm" style={{ color: "#64748b" }}>
|
|
256
253
|
No tests found. Create one above!
|
|
257
254
|
</Text>
|
|
@@ -259,7 +256,7 @@ export const HelloWorld = ({
|
|
|
259
256
|
) : (
|
|
260
257
|
<View style={{ gap: 8 }}>
|
|
261
258
|
{tests.data?.map((test: any) => (
|
|
262
|
-
<Card key={test.id}
|
|
259
|
+
<Card key={test.id} type="outlined" padding="md">
|
|
263
260
|
<View
|
|
264
261
|
style={{
|
|
265
262
|
flexDirection: "row",
|
|
@@ -287,10 +284,10 @@ export const HelloWorld = ({
|
|
|
287
284
|
</Text>
|
|
288
285
|
</View>
|
|
289
286
|
<Button
|
|
290
|
-
|
|
287
|
+
intent="error"
|
|
291
288
|
size="sm"
|
|
292
289
|
onPress={() => handleDeleteTest(test.id)}
|
|
293
|
-
disabled={deleteTestMutation.
|
|
290
|
+
disabled={deleteTestMutation.isPending}
|
|
294
291
|
>
|
|
295
292
|
Delete
|
|
296
293
|
</Button>
|