@idealyst/cli 1.0.84 → 1.0.86

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.
@@ -426,7 +426,7 @@ async function mergePackageJsonDependencies(templatePath, projectPath, data) {
426
426
  '@trpc/server': '^11.5.1',
427
427
  'react-native-edge-to-edge': '^1.6.2',
428
428
  'react-native-gesture-handler': '^2.27.1',
429
- 'react-native-nitro-modules': '^0.26.3',
429
+ 'react-native-nitro-modules': '^0.30.0',
430
430
  'react-native-reanimated': '^3.18.0',
431
431
  'react-native-safe-area-context': '^5.5.1',
432
432
  'react-native-screens': '^4.11.1',
@@ -55,7 +55,7 @@ export const HelloWorld = ({
55
55
  <Screen style={{ flex: 1, padding: 20 }}>
56
56
  <View style={{ maxWidth: 600, alignSelf: "center" }}>
57
57
  <Text
58
- size="xlarge"
58
+ size="xl"
59
59
  weight="bold"
60
60
  style={{
61
61
  marginBottom: 16,
@@ -83,7 +83,7 @@ export const HelloWorld = ({
83
83
  <View style={{ alignItems: "center" }}>
84
84
  <Text style={{ fontSize: 32, marginBottom: 16 }}>🚀</Text>
85
85
  <Text
86
- size="xlarge"
86
+ size="xl"
87
87
  weight="bold"
88
88
  style={{ marginBottom: 8, textAlign: "center" }}
89
89
  >
@@ -6,7 +6,7 @@ import { HelloWorld } from '../components/HelloWorld';
6
6
  const HomeScreen = () => (
7
7
  <Screen>
8
8
  <View spacing="lg">
9
- <Text size="xlarge" weight="bold">Home</Text>
9
+ <Text size="xl" weight="bold">Home</Text>
10
10
  <Text size="md">Welcome to your {{projectName}} app!</Text>
11
11
  <View spacing="md" style={{ marginTop: 24 }}>
12
12
  <Text size="sm">
@@ -26,7 +26,7 @@ const HomeScreen = () => (
26
26
  const ProfileScreen = () => (
27
27
  <Screen>
28
28
  <View spacing="lg">
29
- <Text size="xlarge" weight="bold">Profile</Text>
29
+ <Text size="xl" weight="bold">Profile</Text>
30
30
  <Text size="md">User profile and account settings</Text>
31
31
  <View spacing="md" style={{ marginTop: 24 }}>
32
32
  <Text size="sm">
@@ -40,7 +40,7 @@ const ProfileScreen = () => (
40
40
  const SettingsScreen = () => (
41
41
  <Screen>
42
42
  <View spacing="lg">
43
- <Text size="xlarge" weight="bold">Settings</Text>
43
+ <Text size="xl" weight="bold">Settings</Text>
44
44
  <Text size="md">App configuration and preferences</Text>
45
45
  <View spacing="md" style={{ marginTop: 24 }}>
46
46
  <Text size="sm">
@@ -122,22 +122,6 @@ The app uses the Idealyst Framework for consistent UI and navigation that works
122
122
 
123
123
  Edit `src/App.tsx` to start building your application.
124
124
 
125
- ### Styling
126
-
127
- The app uses Unistyles for cross-platform styling. You can create styles that work on both web and mobile:
128
-
129
- ```tsx
130
- import { createStyleSheet } from 'react-native-unistyles';
131
-
132
- const styles = createStyleSheet({
133
- container: {
134
- flex: 1,
135
- justifyContent: 'center',
136
- alignItems: 'center'
137
- }
138
- });
139
- ```
140
-
141
125
  ### Learn More
142
126
 
143
127
  - [Idealyst Framework Documentation](https://github.com/your-username/idealyst-framework)
@@ -30,7 +30,7 @@
30
30
  "react-dom": "^19.1.0",
31
31
  "react-native": "^0.80.1",
32
32
  "react-native-edge-to-edge": "^1.6.2",
33
- "react-native-nitro-modules": "0.28.0",
33
+ "react-native-nitro-modules": "0.30.0",
34
34
  "react-native-unistyles": "^3.0.10",
35
35
  "react-native-web": "^0.20.0",
36
36
  "react-router": "^7.6.3",
@@ -1,28 +1,43 @@
1
- import { defineConfig } from 'vite'
2
- import react from '@vitejs/plugin-react'
3
- import babel from 'vite-plugin-babel'
4
- import path from 'path'
1
+ import react from "@vitejs/plugin-react";
2
+ import path from "path";
3
+ import { defineConfig } from "vite";
4
+ import babel from "vite-plugin-babel";
5
5
 
6
6
  // https://vitejs.dev/config/
7
7
  export default defineConfig({
8
8
  plugins: [
9
9
  babel({
10
- filter: (id) => id.includes("node_modules/@idealyst/") || id.includes("/packages/"),
10
+ filter: (id) =>
11
+ id.includes("node_modules/@idealyst/") ||
12
+ (id.includes("/packages/") &&
13
+ !id.includes("/packages/web/") &&
14
+ /\.(tsx?|jsx?)$/.test(id)),
11
15
  babelConfig: {
12
16
  presets: [
13
- ['@babel/preset-typescript', {
14
- isTSX: true,
15
- allExtensions: true,
16
- }]
17
+ ["@babel/preset-react", { runtime: "automatic" }],
18
+ [
19
+ "@babel/preset-typescript",
20
+ {
21
+ isTSX: true,
22
+ allExtensions: true,
23
+ },
24
+ ],
17
25
  ],
18
26
  plugins: [
19
- ['react-native-unistyles/plugin', {
20
- root: 'src',
21
- autoProcessPaths: ['@idealyst/components', '@idealyst/navigation', '@idealyst/theme'],
22
- }],
23
- ['@idealyst/components/plugin/web', { root: 'src' }]
24
- ]
25
- }
27
+ [
28
+ "react-native-unistyles/plugin",
29
+ {
30
+ root: "src",
31
+ autoProcessPaths: [
32
+ "@idealyst/components",
33
+ "@idealyst/navigation",
34
+ "@idealyst/theme",
35
+ ],
36
+ },
37
+ ],
38
+ ["@idealyst/components/plugin/web", { root: "src" }],
39
+ ],
40
+ },
26
41
  }),
27
42
  // Then process everything else with React plugin
28
43
  react(),
@@ -30,48 +45,54 @@ export default defineConfig({
30
45
  resolve: {
31
46
  alias: {
32
47
  // Use absolute path to resolve react-native-web properly
33
- 'react-native': path.resolve(__dirname, 'node_modules/react-native-web'),
34
- '@react-native/normalize-colors': path.resolve(__dirname, 'node_modules/@react-native/normalize-colors'),
48
+ "react-native": path.resolve(__dirname, "node_modules/react-native-web"),
49
+ "@react-native/normalize-colors": path.resolve(
50
+ __dirname,
51
+ "../../node_modules/@react-native/normalize-colors"
52
+ ),
35
53
  },
36
54
  // Platform-specific file resolution
37
- extensions: ['.web.tsx', '.web.ts', '.tsx', '.ts', '.js', '.jsx'],
55
+ extensions: [".web.tsx", ".web.ts", ".tsx", ".ts", ".js", ".jsx"],
38
56
  // Ensure proper resolution of package exports
39
- conditions: ['browser', 'import', 'module', 'default'],
57
+ conditions: ["browser", "import", "module", "default"],
40
58
  // Ensure workspace dependencies resolve properly
41
- preserveSymlinks: false
59
+ preserveSymlinks: false,
42
60
  },
43
61
  define: {
44
- global: 'globalThis',
62
+ global: "globalThis",
45
63
  __DEV__: JSON.stringify(true),
46
64
  },
47
65
  optimizeDeps: {
48
66
  include: [
49
- 'react-native-web',
50
- '@react-native/normalize-colors',
51
- 'react-native-unistyles',
52
- 'react-native-unistyles/web',
53
- '@mdi/react',
54
- '@mdi/js',
67
+ "react-native-web",
68
+ "react-native-unistyles",
69
+ "react-native-unistyles/web",
70
+ "@mdi/react",
71
+ "@mdi/js",
55
72
  ],
56
73
  exclude: [
57
- 'react-native-edge-to-edge',
58
- 'react-native-nitro-modules',
59
- '@idealyst/components',
60
- '@idealyst/navigation',
61
- '@idealyst/theme',
62
- '@{{workspaceScope}}/shared',
74
+ "react-native-edge-to-edge",
75
+ "react-native-nitro-modules",
76
+ "@idealyst/components",
77
+ "@idealyst/navigation",
78
+ "@idealyst/theme",
79
+ "@test/shared",
63
80
  ],
64
81
  esbuildOptions: {
65
82
  loader: {
66
- '.tsx': 'tsx',
67
- '.ts': 'ts',
68
- '.jsx': 'jsx',
69
- '.js': 'jsx' // Important: treat .js files as JSX for React Native compatibility
70
- }
71
- }
83
+ ".tsx": "tsx",
84
+ ".ts": "ts",
85
+ ".jsx": "jsx",
86
+ ".js": "jsx", // Important: treat .js files as JSX for React Native compatibility
87
+ },
88
+ alias: {
89
+ "react-native": path.resolve(__dirname, "node_modules/react-native-web"),
90
+ "@react-native/normalize-colors": path.resolve(__dirname, "../../node_modules/@react-native/normalize-colors"),
91
+ },
92
+ },
72
93
  },
73
94
  server: {
74
- host: '0.0.0.0',
95
+ host: "0.0.0.0",
75
96
  port: 5173,
76
97
  },
77
- })
98
+ });
@@ -1,6 +1,6 @@
1
1
  FROM node:20-bullseye
2
2
 
3
- # Install additional tools
3
+ # Install additional tools including gosu for proper user switching
4
4
  RUN apt-get update && apt-get install -y \
5
5
  git \
6
6
  postgresql-client \
@@ -18,6 +18,9 @@ RUN git config --global init.defaultBranch main
18
18
  # Create workspace directory
19
19
  RUN mkdir -p /workspace
20
20
  WORKDIR /workspace
21
+ RUN chown -R node:node /workspace
21
22
 
22
- # Keep container running
23
- CMD ["sleep", "infinity"]
23
+ # Note: We don't switch to node user here anymore - entrypoint.sh will do it
24
+ # This allows the entrypoint to fix permissions as root first
25
+
26
+ USER node
@@ -106,6 +106,7 @@
106
106
  }
107
107
  }
108
108
  },
109
+ "remoteUser": "node",
109
110
 
110
111
  // Post-create command to set up the development environment
111
112
  "postCreateCommand": "bash .devcontainer/setup.sh"
@@ -2,10 +2,6 @@
2
2
 
3
3
  echo "🚀 Setting up Idealyst development environment..."
4
4
 
5
- # Install dependencies
6
- echo "📦 Installing dependencies..."
7
- yarn install
8
-
9
5
  # Create environment file if it doesn't exist
10
6
  if [ ! -f ".env" ]; then
11
7
  echo "📝 Creating .env file..."
@@ -42,24 +38,6 @@ until pg_isready -h postgres -p 5432 -U postgres; do
42
38
  sleep 1
43
39
  done
44
40
 
45
- echo "✅ Database is ready!"
46
-
47
- # Run database migrations if they exist
48
- if [ -d "packages" ]; then
49
- echo "🗄️ Setting up database..."
50
-
51
- # Check if any package has prisma
52
- for package_dir in packages/*/; do
53
- if [ -f "${package_dir}prisma/schema.prisma" ]; then
54
- echo "Running Prisma setup for $(basename "$package_dir")..."
55
- cd "$package_dir"
56
- npx prisma generate
57
- npx prisma db push
58
- cd /workspace
59
- fi
60
- done
61
- fi
62
-
63
41
  echo "Add Figma MCP to Claude Code"
64
42
  claude mcp add -t sse figma-mcp http://figma-mcp:3333/sse
65
43
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@idealyst/cli",
3
- "version": "1.0.84",
3
+ "version": "1.0.86",
4
4
  "description": "CLI tool for generating Idealyst Framework projects",
5
5
  "readme": "README.md",
6
6
  "main": "dist/index.js",
@@ -1,7 +1,7 @@
1
- import { defineConfig } from 'vite'
2
- import react from '@vitejs/plugin-react'
3
- import babel from 'vite-plugin-babel'
4
- import path from 'path'
1
+ import react from "@vitejs/plugin-react";
2
+ import path from "path";
3
+ import { defineConfig } from "vite";
4
+ import babel from "vite-plugin-babel";
5
5
 
6
6
  // https://vitejs.dev/config/
7
7
  export default defineConfig({
@@ -9,21 +9,35 @@ export default defineConfig({
9
9
  babel({
10
10
  filter: (id) =>
11
11
  id.includes("node_modules/@idealyst/") ||
12
- (id.includes("/packages/") && /\.(tsx?|jsx?)$/.test(id)), babelConfig: {
12
+ (id.includes("/packages/") &&
13
+ !id.includes("/packages/web/") &&
14
+ /\.(tsx?|jsx?)$/.test(id)),
15
+ babelConfig: {
13
16
  presets: [
14
- ['@babel/preset-typescript', {
15
- isTSX: true,
16
- allExtensions: true,
17
- }]
17
+ ["@babel/preset-react", { runtime: "automatic" }],
18
+ [
19
+ "@babel/preset-typescript",
20
+ {
21
+ isTSX: true,
22
+ allExtensions: true,
23
+ },
24
+ ],
18
25
  ],
19
26
  plugins: [
20
- ['react-native-unistyles/plugin', {
21
- root: 'src',
22
- autoProcessPaths: ['@idealyst/components', '@idealyst/navigation', '@idealyst/theme'],
23
- }],
24
- ['@idealyst/components/plugin/web', { root: 'src' }]
25
- ]
26
- }
27
+ [
28
+ "react-native-unistyles/plugin",
29
+ {
30
+ root: "src",
31
+ autoProcessPaths: [
32
+ "@idealyst/components",
33
+ "@idealyst/navigation",
34
+ "@idealyst/theme",
35
+ ],
36
+ },
37
+ ],
38
+ ["@idealyst/components/plugin/web", { root: "src" }],
39
+ ],
40
+ },
27
41
  }),
28
42
  // Then process everything else with React plugin
29
43
  react(),
@@ -31,48 +45,54 @@ export default defineConfig({
31
45
  resolve: {
32
46
  alias: {
33
47
  // Use absolute path to resolve react-native-web properly
34
- 'react-native': path.resolve(__dirname, 'node_modules/react-native-web'),
35
- '@react-native/normalize-colors': path.resolve(__dirname, 'node_modules/@react-native/normalize-colors'),
48
+ "react-native": path.resolve(__dirname, "node_modules/react-native-web"),
49
+ "@react-native/normalize-colors": path.resolve(
50
+ __dirname,
51
+ "../../node_modules/@react-native/normalize-colors"
52
+ ),
36
53
  },
37
54
  // Platform-specific file resolution
38
- extensions: ['.web.tsx', '.web.ts', '.tsx', '.ts', '.js', '.jsx'],
55
+ extensions: [".web.tsx", ".web.ts", ".tsx", ".ts", ".js", ".jsx"],
39
56
  // Ensure proper resolution of package exports
40
- conditions: ['browser', 'import', 'module', 'default'],
57
+ conditions: ["browser", "import", "module", "default"],
41
58
  // Ensure workspace dependencies resolve properly
42
- preserveSymlinks: false
59
+ preserveSymlinks: false,
43
60
  },
44
61
  define: {
45
- global: 'globalThis',
62
+ global: "globalThis",
46
63
  __DEV__: JSON.stringify(true),
47
64
  },
48
65
  optimizeDeps: {
49
66
  include: [
50
- 'react-native-web',
51
- '@react-native/normalize-colors',
52
- 'react-native-unistyles',
53
- 'react-native-unistyles/web',
54
- '@mdi/react',
55
- '@mdi/js',
67
+ "react-native-web",
68
+ "react-native-unistyles",
69
+ "react-native-unistyles/web",
70
+ "@mdi/react",
71
+ "@mdi/js",
56
72
  ],
57
73
  exclude: [
58
- 'react-native-edge-to-edge',
59
- 'react-native-nitro-modules',
60
- '@idealyst/components',
61
- '@idealyst/navigation',
62
- '@idealyst/theme',
63
- '@{{workspaceScope}}/shared',
74
+ "react-native-edge-to-edge",
75
+ "react-native-nitro-modules",
76
+ "@idealyst/components",
77
+ "@idealyst/navigation",
78
+ "@idealyst/theme",
79
+ "@test/shared",
64
80
  ],
65
81
  esbuildOptions: {
66
82
  loader: {
67
- '.tsx': 'tsx',
68
- '.ts': 'ts',
69
- '.jsx': 'jsx',
70
- '.js': 'jsx' // Important: treat .js files as JSX for React Native compatibility
71
- }
72
- }
83
+ ".tsx": "tsx",
84
+ ".ts": "ts",
85
+ ".jsx": "jsx",
86
+ ".js": "jsx", // Important: treat .js files as JSX for React Native compatibility
87
+ },
88
+ alias: {
89
+ "react-native": path.resolve(__dirname, "node_modules/react-native-web"),
90
+ "@react-native/normalize-colors": path.resolve(__dirname, "../../node_modules/@react-native/normalize-colors"),
91
+ },
92
+ },
73
93
  },
74
94
  server: {
75
- host: '0.0.0.0',
95
+ host: "0.0.0.0",
76
96
  port: 5173,
77
97
  },
78
- })
98
+ });
@@ -1,6 +1,6 @@
1
1
  FROM node:20-bullseye
2
2
 
3
- # Install additional tools
3
+ # Install additional tools including gosu for proper user switching
4
4
  RUN apt-get update && apt-get install -y \
5
5
  git \
6
6
  postgresql-client \
@@ -18,6 +18,9 @@ RUN git config --global init.defaultBranch main
18
18
  # Create workspace directory
19
19
  RUN mkdir -p /workspace
20
20
  WORKDIR /workspace
21
+ RUN chown -R node:node /workspace
21
22
 
22
- # Keep container running
23
- CMD ["sleep", "infinity"]
23
+ # Note: We don't switch to node user here anymore - entrypoint.sh will do it
24
+ # This allows the entrypoint to fix permissions as root first
25
+
26
+ USER node
@@ -2,10 +2,6 @@
2
2
 
3
3
  echo "🚀 Setting up Idealyst development environment..."
4
4
 
5
- # Install dependencies
6
- echo "📦 Installing dependencies..."
7
- yarn install
8
-
9
5
  # Create environment file if it doesn't exist
10
6
  if [ ! -f ".env" ]; then
11
7
  echo "📝 Creating .env file..."
@@ -42,24 +38,6 @@ until pg_isready -h postgres -p 5432 -U postgres; do
42
38
  sleep 1
43
39
  done
44
40
 
45
- echo "✅ Database is ready!"
46
-
47
- # Run database migrations if they exist
48
- if [ -d "packages" ]; then
49
- echo "🗄️ Setting up database..."
50
-
51
- # Check if any package has prisma
52
- for package_dir in packages/*/; do
53
- if [ -f "${package_dir}prisma/schema.prisma" ]; then
54
- echo "Running Prisma setup for $(basename "$package_dir")..."
55
- cd "$package_dir"
56
- npx prisma generate
57
- npx prisma db push
58
- cd /workspace
59
- fi
60
- done
61
- fi
62
-
63
41
  echo "Add Figma MCP to Claude Code"
64
42
  claude mcp add -t sse figma-mcp http://figma-mcp:3333/sse
65
43
 
@@ -1,123 +0,0 @@
1
- # Idealyst Framework CLI - Quick LLM Command Reference
2
-
3
- ⚠️ **LLM CRITICAL**: Always provide ALL arguments to prevent interactive prompts that hang automation!
4
-
5
- ## 🚨 Commands That Will Hang LLMs
6
- ```bash
7
- # ❌ These will hang waiting for user input:
8
- idealyst init # Missing workspace name
9
- idealyst create my-app # Missing --type
10
- idealyst create my-app --type native # Missing --app-name
11
- idealyst create my-app --type web # Missing tRPC choice
12
- idealyst create my-app --type native --app-name "App" # Missing tRPC choice
13
- ```
14
-
15
- ## ✅ LLM-Safe Command Templates
16
- ```bash
17
- # Always use these exact patterns:
18
- idealyst init <workspace-name>
19
- idealyst create <name> --type database
20
- idealyst create <name> --type api
21
- idealyst create <name> --type shared
22
- idealyst create <name> --type native --app-name "Display Name" --with-trpc
23
- idealyst create <name> --type native --app-name "Display Name" --no-trpc
24
- idealyst create <name> --type web --with-trpc
25
- idealyst create <name> --type web --no-trpc
26
- ```
27
-
28
- ## Essential Commands
29
-
30
- ### Initialize Workspace (Required First)
31
- ```bash
32
- # ✅ Always provide workspace name
33
- idealyst init <workspace-name>
34
- cd <workspace-name>
35
-
36
- # ❌ Never run without name (will prompt)
37
- # idealyst init
38
- ```
39
-
40
- ### Create Projects (Run from workspace directory)
41
- ```bash
42
- # Database layer (Prisma + Zod) - No prompts
43
- idealyst create <name> --type database
44
-
45
- # API server (tRPC + Express) - No prompts
46
- idealyst create <name> --type api
47
-
48
- # React Native mobile app - REQUIRES app-name and trpc preference
49
- idealyst create <name> --type native --app-name "Display Name" --with-trpc
50
- idealyst create <name> --type native --app-name "Display Name" --no-trpc
51
-
52
- # React web app (Vite) - REQUIRES trpc preference
53
- idealyst create <name> --type web --with-trpc
54
- idealyst create <name> --type web --no-trpc
55
-
56
- # Shared TypeScript library - No prompts
57
- idealyst create <name> --type shared
58
- ```
59
-
60
- ## Project Types & Purposes
61
-
62
- | Type | Purpose | Key Technologies | Exports |
63
- |------|---------|------------------|---------|
64
- | `database` | Data layer | Prisma, Zod, TypeScript | `{ db, schemas, PrismaClient, types }` |
65
- | `api` | Backend server | tRPC, Express, Zod | tRPC router, middleware |
66
- | `native` | Mobile app | React Native, TypeScript | Mobile application |
67
- | `web` | Web app | React, Vite, TypeScript | Web application |
68
- | `shared` | Utilities | TypeScript, Rollup | Reusable functions/types |
69
-
70
- ## Architecture Patterns
71
-
72
- ### Full-Stack App (Recommended)
73
- ```bash
74
- # ✅ LLM-Safe: All arguments provided
75
- idealyst init my-app && cd my-app
76
- idealyst create database --type database
77
- idealyst create api --type api
78
- idealyst create mobile --type native --app-name "Mobile App" --with-trpc
79
- idealyst create web --type web --with-trpc
80
- ```
81
-
82
- ### Database Integration
83
- ```typescript
84
- // In API server
85
- import { db } from '@workspace/database';
86
- const users = await db.user.findMany();
87
-
88
- // In clients (with tRPC)
89
- const { data } = await api.users.getAll.useQuery();
90
- ```
91
-
92
- ## Key Rules for LLMs
93
- 1. **Always provide workspace name** - `idealyst init my-project` (never just `idealyst init`)
94
- 2. **Always provide project name AND --type** - `idealyst create api --type api`
95
- 3. **For native: Always provide --app-name AND tRPC choice** - `--app-name "App Name" --with-trpc`
96
- 4. **For web: Always provide tRPC choice** - `--with-trpc` or `--no-trpc`
97
- 5. **Use --skip-install** - For faster testing/iteration
98
- 6. **Use descriptive names** - `user-database`, `product-api`, not `db`, `api`
99
-
100
- ## Common Patterns
101
- ```bash
102
- # E-commerce (full arguments)
103
- idealyst init ecommerce-platform && cd ecommerce-platform
104
- idealyst create product-database --type database
105
- idealyst create api --type api
106
- idealyst create customer-mobile --type native --app-name "Customer App" --with-trpc
107
- idealyst create admin-web --type web --with-trpc
108
-
109
- # SaaS (full arguments)
110
- idealyst init saas-app && cd saas-app
111
- idealyst create user-database --type database
112
- idealyst create auth-api --type api
113
- idealyst create main-api --type api
114
- idealyst create dashboard --type web --with-trpc
115
- idealyst create mobile --type native --app-name "SaaS Mobile" --with-trpc
116
-
117
- # Content platform (full arguments)
118
- idealyst init content-platform && cd content-platform
119
- idealyst create content-database --type database
120
- idealyst create cms-api --type api
121
- idealyst create public-web --type web --no-trpc
122
- idealyst create admin-web --type web --with-trpc
123
- ```
@@ -1,514 +0,0 @@
1
- # Idealyst Framework CLI - LLM Reference Guide
2
-
3
- This is a comprehensive reference for LLMs to understand and use the Idealyst Framework CLI to create full-stack TypeScript projects.
4
-
5
- ## Overview
6
-
7
- The Idealyst Framework CLI is a powerful tool for generating TypeScript monorepo projects with React Native, React Web, API servers, database layers, and shared libraries. All projects are type-safe and follow modern development practices.
8
-
9
- ## CLI Installation & Usage
10
-
11
- ```bash
12
- # Install globally
13
- npm install -g @idealyst/cli
14
-
15
- # Or use via npx
16
- npx @idealyst/cli [command] [options]
17
- ```
18
-
19
- ⚠️ **IMPORTANT FOR LLMs**: Always provide ALL required arguments to avoid interactive prompts that can hang automated processes.
20
-
21
- ## 🚨 Critical LLM Requirements
22
-
23
- ### Commands That Will Hang LLMs
24
- ```bash
25
- # ❌ These commands will hang waiting for user input:
26
- idealyst init # Missing workspace name
27
- idealyst create my-app # Missing --type
28
- idealyst create my-app --type native # Missing --app-name
29
- idealyst create my-app --type web # Missing tRPC preference
30
- idealyst create my-app --type native --app-name "App" # Missing tRPC preference
31
- ```
32
-
33
- ### LLM-Safe Command Templates
34
- ```bash
35
- # ✅ Always use these exact patterns:
36
- idealyst init <workspace-name> # Always provide name
37
- idealyst create <name> --type database # Database: no extra args needed
38
- idealyst create <name> --type api # API: no extra args needed
39
- idealyst create <name> --type shared # Shared: no extra args needed
40
- idealyst create <name> --type native --app-name "Name" --with-trpc # Native: both required
41
- idealyst create <name> --type native --app-name "Name" --no-trpc # Native: both required
42
- idealyst create <name> --type web --with-trpc # Web: tRPC choice required
43
- idealyst create <name> --type web --no-trpc # Web: tRPC choice required
44
- ```
45
-
46
- ## Core Commands
47
-
48
- ### 1. Initialize Workspace
49
- **Purpose**: Create a new monorepo workspace that can contain multiple related projects.
50
-
51
- ```bash
52
- # Create a new workspace (ALWAYS provide project name)
53
- idealyst init <workspace-name> [options]
54
-
55
- # Options:
56
- # -d, --directory <dir> Output directory (default: .)
57
- # --skip-install Skip installing dependencies
58
-
59
- # ✅ LLM-Safe Examples:
60
- idealyst init my-workspace
61
- idealyst init ecommerce-platform --directory ./projects
62
- idealyst init my-app --skip-install
63
- ```
64
-
65
- **⚠️ LLM Warning**: Never run `idealyst init` without a project name - it will prompt interactively and hang.
66
-
67
- **What it creates:**
68
- - Yarn workspace configuration
69
- - TypeScript configuration
70
- - Build scripts and tooling
71
- - Package management setup
72
- - Version management scripts
73
- - Base Idealyst packages (theme, components, navigation)
74
-
75
- ### 2. Create Projects
76
- **Purpose**: Create individual projects within a workspace.
77
-
78
- ```bash
79
- # General syntax (ALWAYS provide project name AND type)
80
- idealyst create <project-name> --type <type> [options]
81
-
82
- # Options:
83
- # -t, --type <type> Project type: native, web, shared, api, or database
84
- # -d, --directory <dir> Output directory (default: .)
85
- # -a, --app-name <name> Display name for native apps (REQUIRED for native)
86
- # --with-trpc Include tRPC boilerplate (for web/native)
87
- # --no-trpc Explicitly disable tRPC (for web/native)
88
- # --skip-install Skip installing dependencies
89
-
90
- # ✅ LLM-Safe Examples:
91
- idealyst create my-api --type api
92
- idealyst create user-database --type database
93
- idealyst create mobile-app --type native --app-name "Mobile App"
94
- idealyst create web-app --type web --with-trpc
95
- idealyst create utils --type shared
96
- ```
97
-
98
- **⚠️ LLM Critical Rules**:
99
- 1. **Always provide `<project-name>`** - CLI will prompt if missing
100
- 2. **Always provide `--type <type>`** - CLI will prompt if missing
101
- 3. **For native projects**: Always provide `--app-name "Display Name"` - CLI will prompt if missing
102
- 4. **For web/native projects**: Always specify `--with-trpc` or `--no-trpc` - CLI will prompt if missing
103
-
104
- ## Project Types
105
-
106
- ### 1. Native (React Native)
107
- **Purpose**: Cross-platform mobile applications
108
-
109
- ```bash
110
- # ✅ LLM-Safe Command (always include --app-name)
111
- idealyst create my-mobile-app --type native --app-name "My Mobile App"
112
-
113
- # With tRPC integration
114
- idealyst create mobile-app --type native --app-name "Mobile App" --with-trpc
115
-
116
- # Without tRPC integration (explicit)
117
- idealyst create mobile-app --type native --app-name "Mobile App" --no-trpc
118
- ```
119
-
120
- **⚠️ LLM Required**: `--app-name` is REQUIRED for native projects to avoid interactive prompts.
121
-
122
- **Includes:**
123
- - React Native setup with TypeScript
124
- - Idealyst UI components
125
- - Navigation system
126
- - Platform-specific configurations (iOS/Android)
127
- - Jest testing setup
128
- - Optional tRPC integration
129
-
130
- **Key files:**
131
- - `src/App.tsx` - Main application component
132
- - `android/` - Android-specific code
133
- - `ios/` - iOS-specific code
134
- - `jest.config.js` - Testing configuration
135
-
136
- ### 2. Web (React Web)
137
- **Purpose**: Web applications using React
138
-
139
- ```bash
140
- # ✅ LLM-Safe Commands (always specify tRPC preference)
141
- idealyst create my-web-app --type web --with-trpc
142
- idealyst create my-web-app --type web --no-trpc
143
-
144
- # With additional options
145
- idealyst create web-dashboard --type web --with-trpc --skip-install
146
- ```
147
-
148
- **⚠️ LLM Required**: Always specify `--with-trpc` or `--no-trpc` to avoid interactive prompts.
149
-
150
- **Includes:**
151
- - React with TypeScript and Vite
152
- - Idealyst UI components (web-compatible)
153
- - Unistyles for styling
154
- - Jest testing setup
155
- - Optional tRPC integration
156
-
157
- **Key files:**
158
- - `src/App.tsx` - Main application component
159
- - `src/main.tsx` - Entry point
160
- - `vite.config.ts` - Vite configuration
161
- - `index.html` - HTML template
162
-
163
- ### 3. API Server
164
- **Purpose**: Backend API servers with tRPC
165
-
166
- ```bash
167
- # ✅ LLM-Safe Command
168
- idealyst create my-api --type api
169
-
170
- # With additional options
171
- idealyst create user-api --type api --skip-install
172
- ```
173
-
174
- **Includes:**
175
- - tRPC for type-safe APIs
176
- - Express.js server
177
- - Zod schema validation
178
- - TypeScript configuration
179
- - Middleware system (auth, CORS, etc.)
180
- - Controller pattern
181
- - Jest testing setup
182
-
183
- **Key files:**
184
- - `src/server.ts` - Express server setup
185
- - `src/index.ts` - Main exports
186
- - `src/context.ts` - tRPC context
187
- - `src/router/index.ts` - Route definitions
188
- - `src/controllers/` - API controllers
189
- - `src/middleware/` - Custom middleware
190
-
191
- **Note**: API projects no longer include database functionality (see Database type below).
192
-
193
- ### 4. Database
194
- **Purpose**: Shared database layer with Prisma
195
-
196
- ```bash
197
- # ✅ LLM-Safe Command
198
- idealyst create my-database --type database
199
-
200
- # With additional options
201
- idealyst create user-database --type database --skip-install
202
- ```
203
-
204
- **Includes:**
205
- - Prisma ORM setup
206
- - TypeScript configuration
207
- - Zod schemas for validation
208
- - Database client singleton
209
- - Migration scripts
210
- - Seed scripts
211
- - Jest testing setup
212
-
213
- **Key files:**
214
- - `src/index.ts` - Main exports (db, schemas, types)
215
- - `src/client.ts` - Prisma client singleton
216
- - `src/schemas.ts` - Zod validation schemas
217
- - `prisma/schema.prisma` - Database schema
218
- - `prisma/seed.ts` - Database seeding
219
-
220
- **Exports for consumption:**
221
- ```typescript
222
- // Import in other packages
223
- import { db, schemas, PrismaClient } from '@workspace/my-database';
224
- import type { User, Post } from '@workspace/my-database';
225
-
226
- // Use the database
227
- const users = await db.user.findMany();
228
- const validData = schemas.createUser.parse(input);
229
- ```
230
-
231
- ### 5. Shared Library
232
- **Purpose**: Reusable code shared across projects
233
-
234
- ```bash
235
- # ✅ LLM-Safe Command
236
- idealyst create my-shared-lib --type shared
237
-
238
- # With additional options
239
- idealyst create utils --type shared --skip-install
240
- ```
241
-
242
- **Includes:**
243
- - TypeScript library setup
244
- - Rollup build configuration
245
- - Jest testing setup
246
- - NPM package structure
247
-
248
- **Key files:**
249
- - `src/index.ts` - Main exports
250
- - `rollup.config.js` - Build configuration
251
-
252
- ## Project Architecture Patterns
253
-
254
- ### Monorepo Structure
255
- ```
256
- my-workspace/
257
- ├── package.json # Workspace root
258
- ├── packages/
259
- │ ├── mobile-app/ # React Native app
260
- │ ├── web-app/ # React web app
261
- │ ├── api-server/ # tRPC API server
262
- │ ├── user-database/ # Database layer
263
- │ └── shared-utils/ # Shared library
264
- └── node_modules/
265
- ```
266
-
267
- ### Database + API Pattern
268
- **Recommended approach for full-stack applications:**
269
-
270
- 1. **Create database package first:**
271
- ```bash
272
- idealyst create user-database --type database
273
- ```
274
-
275
- 2. **Create API server:**
276
- ```bash
277
- idealyst create api-server --type api
278
- ```
279
-
280
- 3. **Connect them in API:**
281
- ```typescript
282
- // In api-server/src/controllers/UserController.ts
283
- import { db } from '@workspace/user-database';
284
- import type { User } from '@workspace/user-database';
285
-
286
- export class UserController {
287
- async getUsers() {
288
- return await db.user.findMany();
289
- }
290
- }
291
- ```
292
-
293
- ### Client + API Pattern
294
- **For frontend applications with backend:**
295
-
296
- 1. **Create API first:**
297
- ```bash
298
- idealyst create api-server --type api
299
- idealyst create user-database --type database
300
- ```
301
-
302
- 2. **Create client apps:**
303
- ```bash
304
- idealyst create mobile-app --type native --with-trpc
305
- idealyst create web-app --type web --with-trpc
306
- ```
307
-
308
- 3. **Connect with tRPC:**
309
- ```typescript
310
- // In client app
311
- import { createTRPCProxyClient } from '@trpc/client';
312
- import type { AppRouter } from '@workspace/api-server';
313
-
314
- const api = createTRPCProxyClient<AppRouter>({
315
- links: [httpBatchLink({ url: 'http://localhost:3000/trpc' })]
316
- });
317
- ```
318
-
319
- ## Development Workflow
320
-
321
- ### 1. Initial Setup
322
- ```bash
323
- # Create workspace (provide name to avoid prompts)
324
- idealyst init my-project
325
-
326
- cd my-project
327
-
328
- # Create database layer (no additional args needed)
329
- idealyst create database --type database
330
-
331
- # Create API server (no additional args needed)
332
- idealyst create api --type api
333
-
334
- # Create client apps (specify tRPC and app-name to avoid prompts)
335
- idealyst create mobile --type native --app-name "Mobile App" --with-trpc
336
- idealyst create web --type web --with-trpc
337
- ```
338
-
339
- ### 2. Database Development
340
- ```bash
341
- cd packages/database
342
-
343
- # Edit prisma/schema.prisma
344
- # Add your models
345
-
346
- # Generate client
347
- yarn db:generate
348
-
349
- # Push to database
350
- yarn db:push
351
-
352
- # Build for consumption
353
- yarn build
354
- ```
355
-
356
- ### 3. API Development
357
- ```bash
358
- cd packages/api
359
-
360
- # Import database
361
- # Edit src/controllers/ files
362
- # Add your endpoints
363
-
364
- # Start development server
365
- yarn dev
366
- ```
367
-
368
- ### 4. Client Development
369
- ```bash
370
- # Mobile
371
- cd packages/mobile
372
- yarn android # or yarn ios
373
-
374
- # Web
375
- cd packages/web
376
- yarn dev
377
- ```
378
-
379
- ## Best Practices for LLMs
380
-
381
- ### 1. Always Start with Workspace
382
- Never create individual projects without a workspace:
383
- ```bash
384
- # ❌ Wrong - will fail
385
- idealyst create my-app --type native --app-name "My App"
386
-
387
- # ✅ Correct - always init workspace first
388
- idealyst init my-workspace
389
- cd my-workspace
390
- idealyst create my-app --type native --app-name "My App" --with-trpc
391
- ```
392
-
393
- ### 2. Always Provide ALL Required Arguments
394
- ```bash
395
- # ❌ Wrong - will hang on prompts
396
- idealyst init
397
- idealyst create --type native
398
- idealyst create mobile-app
399
-
400
- # ✅ Correct - full arguments prevent prompts
401
- idealyst init my-project
402
- idealyst create mobile-app --type native --app-name "Mobile App" --with-trpc
403
- idealyst create web-app --type web --no-trpc
404
- ```
405
-
406
- ### 3. Use --skip-install for Speed
407
- ```bash
408
- # ✅ For faster iteration/testing
409
- idealyst init my-project --skip-install
410
- idealyst create api --type api --skip-install
411
- ```
412
-
413
- ### 2. Database-First for Full-Stack
414
- For applications needing persistence:
415
- ```bash
416
- # 1. Create workspace (provide name)
417
- idealyst init e-commerce-app
418
-
419
- # 2. Create database first (no prompts)
420
- idealyst create database --type database
421
-
422
- # 3. Create API (no prompts)
423
- idealyst create api --type api
424
-
425
- # 4. Create clients (specify all args)
426
- idealyst create mobile --type native --app-name "E-Commerce Mobile" --with-trpc
427
- idealyst create admin --type web --with-trpc
428
- ```
429
-
430
- ### 3. Use Descriptive Names (No Prompts)
431
- ```bash
432
- # ✅ Good names with full arguments
433
- idealyst create user-database --type database
434
- idealyst create product-api --type api
435
- idealyst create customer-mobile --type native --app-name "Customer Mobile" --with-trpc
436
-
437
- # ❌ Avoid generic names and missing arguments
438
- idealyst create db --type database
439
- idealyst create api --type api
440
- idealyst create app # Missing --type, will prompt
441
- ```
442
-
443
- ### 4. Leverage Type Safety
444
- The framework provides end-to-end type safety:
445
- - Database types from Prisma
446
- - API types from tRPC
447
- - Component types from TypeScript React
448
-
449
- ### 5. Follow the Separation of Concerns
450
- - **Database packages**: Only data models and database access
451
- - **API packages**: Only business logic and endpoints
452
- - **Client packages**: Only UI and user interaction
453
- - **Shared packages**: Only reusable utilities
454
-
455
- ## Example Project Setups
456
-
457
- ### E-commerce Platform
458
- ```bash
459
- idealyst init ecommerce-platform
460
- cd ecommerce-platform
461
-
462
- # Core data layer
463
- idealyst create product-database --type database
464
-
465
- # Backend services
466
- idealyst create product-api --type api
467
- idealyst create payment-api --type api
468
-
469
- # Client applications
470
- idealyst create customer-mobile --type native --with-trpc
471
- idealyst create admin-web --type web --with-trpc
472
-
473
- # Shared utilities
474
- idealyst create shared-utils --type shared
475
- ```
476
-
477
- ### SaaS Application
478
- ```bash
479
- idealyst init saas-app
480
- cd saas-app
481
-
482
- # Data layer
483
- idealyst create user-database --type database
484
-
485
- # Backend
486
- idealyst create auth-api --type api
487
- idealyst create main-api --type api
488
-
489
- # Clients
490
- idealyst create mobile-app --type native --with-trpc
491
- idealyst create web-dashboard --type web --with-trpc
492
-
493
- # Shared
494
- idealyst create common-types --type shared
495
- ```
496
-
497
- ## Error Handling
498
-
499
- ### Common Issues:
500
- 1. **"Individual projects can only be created within a workspace"**
501
- - Solution: Run `idealyst init` first
502
-
503
- 2. **"Invalid project name"**
504
- - Solution: Use lowercase, no spaces, valid npm package names
505
-
506
- 3. **"Invalid project type"**
507
- - Solution: Use one of: native, web, shared, api, database
508
-
509
- ### Debugging:
510
- - Use `--skip-install` for faster iteration
511
- - Check generated package.json files
512
- - Verify workspace structure
513
-
514
- This reference should enable LLMs to effectively use the Idealyst Framework CLI to create comprehensive, type-safe, full-stack TypeScript applications.
File without changes
File without changes
File without changes