@idealyst/cli 1.0.23 → 1.0.25

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.
Files changed (51) hide show
  1. package/README.md +109 -109
  2. package/dist/index.js +119 -30
  3. package/dist/types/generators/api.d.ts +2 -0
  4. package/dist/types/generators/index.d.ts +1 -0
  5. package/dist/types/generators/utils.d.ts +14 -1
  6. package/dist/types/types.d.ts +1 -1
  7. package/package.json +1 -1
  8. package/templates/api/README.md +207 -0
  9. package/templates/api/env.example +12 -0
  10. package/templates/api/package.json +49 -0
  11. package/templates/api/prisma/schema.prisma +21 -0
  12. package/templates/api/src/context.ts +23 -0
  13. package/templates/api/src/controllers/UserController.ts +102 -0
  14. package/templates/api/src/index.ts +50 -0
  15. package/templates/api/src/lib/controller.ts +90 -0
  16. package/templates/api/src/lib/middleware.ts +170 -0
  17. package/templates/api/src/middleware/auth.ts +75 -0
  18. package/templates/api/src/middleware/common.ts +103 -0
  19. package/templates/api/src/router/index.ts +130 -0
  20. package/templates/api/src/trpc.ts +28 -0
  21. package/templates/api/tsconfig.json +44 -0
  22. package/templates/native/.yarnrc.yml +18 -18
  23. package/templates/native/App.tsx +23 -23
  24. package/templates/native/README.md +85 -85
  25. package/templates/native/app.json +4 -4
  26. package/templates/native/babel.config.js +9 -9
  27. package/templates/native/index.js +5 -5
  28. package/templates/native/metro.config.js +27 -21
  29. package/templates/native/package.json +9 -9
  30. package/templates/native/tsconfig.json +29 -29
  31. package/templates/shared/README.md +108 -108
  32. package/templates/shared/package.json +39 -41
  33. package/templates/shared/src/index.ts +1 -11
  34. package/templates/shared/tsconfig.json +24 -24
  35. package/templates/web/README.md +89 -89
  36. package/templates/web/index.html +12 -12
  37. package/templates/web/package.json +51 -51
  38. package/templates/web/src/App.tsx +14 -14
  39. package/templates/web/src/main.tsx +24 -24
  40. package/templates/web/tsconfig.json +26 -26
  41. package/templates/web/vite.config.ts +68 -65
  42. package/templates/workspace/.yarnrc.yml +25 -25
  43. package/templates/workspace/README.md +79 -79
  44. package/templates/workspace/package.json +24 -24
  45. package/templates/shared/.yarnrc.yml +0 -19
  46. package/templates/shared/rollup.config.js +0 -27
  47. package/templates/shared/src/components/SharedComponent.tsx +0 -41
  48. package/templates/shared/src/components/index.ts +0 -3
  49. package/templates/shared/src/types/index.ts +0 -17
  50. package/templates/shared/src/utils/helpers.ts +0 -34
  51. package/templates/shared/src/utils/index.ts +0 -2
@@ -1,26 +1,26 @@
1
- nodeLinker: "node-modules"
2
-
3
- # Enable transparent workspaces for better workspace dependency resolution
4
- enableTransparentWorkspaces: true
5
-
6
- # Enable network for package downloads
7
- enableNetwork: true
8
-
9
- # Timeout for HTTP requests (in milliseconds)
10
- httpTimeout: 60000
11
-
12
- # Number of retry attempts for HTTP requests
13
- httpRetry: 3
14
-
15
- # Registry configuration
16
- npmRegistryServer: "https://registry.yarnpkg.com"
17
-
18
- # Enable progress bars
19
- enableProgressBars: true
20
-
21
- # Enable colors in output
22
- enableColors: true
23
-
24
- # Prevent hoisting to avoid React Native issues
25
- # This ensures React Native dependencies stay in their local node_modules
1
+ nodeLinker: "node-modules"
2
+
3
+ # Enable transparent workspaces for better workspace dependency resolution
4
+ enableTransparentWorkspaces: true
5
+
6
+ # Enable network for package downloads
7
+ enableNetwork: true
8
+
9
+ # Timeout for HTTP requests (in milliseconds)
10
+ httpTimeout: 60000
11
+
12
+ # Number of retry attempts for HTTP requests
13
+ httpRetry: 3
14
+
15
+ # Registry configuration
16
+ npmRegistryServer: "https://registry.yarnpkg.com"
17
+
18
+ # Enable progress bars
19
+ enableProgressBars: true
20
+
21
+ # Enable colors in output
22
+ enableColors: true
23
+
24
+ # Prevent hoisting to avoid React Native issues
25
+ # This ensures React Native dependencies stay in their local node_modules
26
26
  nmHoistingLimits: workspaces
@@ -1,80 +1,80 @@
1
- # {{projectName}}
2
-
3
- {{description}}
4
-
5
- ## Getting Started
6
-
7
- This workspace contains your Idealyst Framework packages and applications.
8
-
9
- ### Structure
10
-
11
- ```
12
- {{projectName}}/
13
- ├── packages/ # Shared packages
14
- │ ├── theme/ # Theme configuration
15
- │ ├── components/ # UI components
16
- │ └── utils/ # Shared utilities
17
- ├── mobile-app/ # React Native app (generated)
18
- ├── web-app/ # React web app (generated)
19
- └── shared-lib/ # Shared library (generated)
20
- ```
21
-
22
- ### Development
23
-
24
- Install dependencies:
25
- ```bash
26
- yarn install
27
- ```
28
-
29
- Build all packages:
30
- ```bash
31
- yarn build:all
32
- ```
33
-
34
- Test all packages:
35
- ```bash
36
- yarn test:all
37
- ```
38
-
39
- ### Adding Applications
40
-
41
- Generate a new React Native app:
42
- ```bash
43
- idealyst create mobile-app --type native
44
- ```
45
-
46
- Generate a new React web app:
47
- ```bash
48
- idealyst create web-app --type web
49
- ```
50
-
51
- Generate a new shared library:
52
- ```bash
53
- idealyst create shared-lib --type shared
54
- ```
55
-
56
- **Note:** The CLI will automatically add new projects to the workspace configuration when run from the workspace root.
57
-
58
- ### Publishing
59
-
60
- Publish all packages:
61
- ```bash
62
- yarn publish:all
63
- ```
64
-
65
- ### Version Management
66
-
67
- Update patch version for all packages:
68
- ```bash
69
- yarn version:patch
70
- ```
71
-
72
- Update minor version for all packages:
73
- ```bash
74
- yarn version:minor
75
- ```
76
-
77
- Update major version for all packages:
78
- ```bash
79
- yarn version:major
1
+ # {{projectName}}
2
+
3
+ {{description}}
4
+
5
+ ## Getting Started
6
+
7
+ This workspace contains your Idealyst Framework packages and applications.
8
+
9
+ ### Structure
10
+
11
+ ```
12
+ {{projectName}}/
13
+ ├── packages/ # Shared packages
14
+ │ ├── theme/ # Theme configuration
15
+ │ ├── components/ # UI components
16
+ │ └── utils/ # Shared utilities
17
+ ├── mobile-app/ # React Native app (generated)
18
+ ├── web-app/ # React web app (generated)
19
+ └── shared-lib/ # Shared library (generated)
20
+ ```
21
+
22
+ ### Development
23
+
24
+ Install dependencies:
25
+ ```bash
26
+ yarn install
27
+ ```
28
+
29
+ Build all packages:
30
+ ```bash
31
+ yarn build:all
32
+ ```
33
+
34
+ Test all packages:
35
+ ```bash
36
+ yarn test:all
37
+ ```
38
+
39
+ ### Adding Applications
40
+
41
+ Generate a new React Native app:
42
+ ```bash
43
+ idealyst create mobile-app --type native
44
+ ```
45
+
46
+ Generate a new React web app:
47
+ ```bash
48
+ idealyst create web-app --type web
49
+ ```
50
+
51
+ Generate a new shared library:
52
+ ```bash
53
+ idealyst create shared-lib --type shared
54
+ ```
55
+
56
+ **Note:** The CLI will automatically add new projects to the workspace configuration when run from the workspace root.
57
+
58
+ ### Publishing
59
+
60
+ Publish all packages:
61
+ ```bash
62
+ yarn publish:all
63
+ ```
64
+
65
+ ### Version Management
66
+
67
+ Update patch version for all packages:
68
+ ```bash
69
+ yarn version:patch
70
+ ```
71
+
72
+ Update minor version for all packages:
73
+ ```bash
74
+ yarn version:minor
75
+ ```
76
+
77
+ Update major version for all packages:
78
+ ```bash
79
+ yarn version:major
80
80
  ```
@@ -1,25 +1,25 @@
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
- "publish:all": "yarn workspaces foreach --include '@/*' npm publish",
12
- "version:patch": "yarn workspaces foreach --include '@/*' version patch",
13
- "version:minor": "yarn workspaces foreach --include '@/*' version minor",
14
- "version:major": "yarn workspaces foreach --include '@/*' version major",
15
- "build:all": "yarn workspaces foreach --include '@/*' run build",
16
- "test:all": "yarn workspaces foreach --include '@/*' run test"
17
- },
18
- "devDependencies": {
19
- "@babel/core": "^7.28.0",
20
- "@babel/preset-env": "^7.28.0",
21
- "@babel/preset-react": "^7.27.1",
22
- "@babel/preset-typescript": "^7.27.1",
23
- "typescript": "^5.0.0"
24
- }
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
+ "publish:all": "yarn workspaces foreach --include '@/*' npm publish",
12
+ "version:patch": "yarn workspaces foreach --include '@/*' version patch",
13
+ "version:minor": "yarn workspaces foreach --include '@/*' version minor",
14
+ "version:major": "yarn workspaces foreach --include '@/*' version major",
15
+ "build:all": "yarn workspaces foreach --include '@/*' run build",
16
+ "test:all": "yarn workspaces foreach --include '@/*' run test"
17
+ },
18
+ "devDependencies": {
19
+ "@babel/core": "^7.28.0",
20
+ "@babel/preset-env": "^7.28.0",
21
+ "@babel/preset-react": "^7.27.1",
22
+ "@babel/preset-typescript": "^7.27.1",
23
+ "typescript": "^5.0.0"
24
+ }
25
25
  }
@@ -1,19 +0,0 @@
1
- nodeLinker: "node-modules"
2
-
3
- # Enable network for package downloads
4
- enableNetwork: true
5
-
6
- # Timeout for HTTP requests (in milliseconds)
7
- httpTimeout: 60000
8
-
9
- # Number of retry attempts for HTTP requests
10
- httpRetry: 3
11
-
12
- # Registry configuration
13
- npmRegistryServer: "https://registry.yarnpkg.com"
14
-
15
- # Enable progress bars
16
- enableProgressBars: true
17
-
18
- # Enable colors in output
19
- enableColors: true
@@ -1,27 +0,0 @@
1
- import typescript from 'rollup-plugin-typescript2';
2
-
3
- export default {
4
- input: 'src/index.ts',
5
- output: [
6
- {
7
- file: 'dist/index.js',
8
- format: 'cjs',
9
- exports: 'named'
10
- },
11
- {
12
- file: 'dist/index.esm.js',
13
- format: 'es'
14
- }
15
- ],
16
- external: [
17
- 'react',
18
- 'react-native',
19
- '@idealyst/theme'
20
- ],
21
- plugins: [
22
- typescript({
23
- tsconfig: './tsconfig.json',
24
- useTsconfigDeclarationDir: true
25
- })
26
- ]
27
- };
@@ -1,41 +0,0 @@
1
- import React from 'react';
2
- import { View, Text } from 'react-native';
3
- import { useTheme } from '@idealyst/theme';
4
-
5
- export interface SharedComponentProps {
6
- title: string;
7
- description?: string;
8
- }
9
-
10
- const SharedComponent: React.FC<SharedComponentProps> = ({ title, description }) => {
11
- const { theme } = useTheme();
12
-
13
- return (
14
- <View style={{
15
- padding: 16,
16
- backgroundColor: theme.colors.surface,
17
- borderRadius: 8,
18
- marginBottom: 16
19
- }}>
20
- <Text style={{
21
- fontSize: 18,
22
- fontWeight: 'bold',
23
- color: theme.colors.text,
24
- marginBottom: 8
25
- }}>
26
- {title}
27
- </Text>
28
- {description && (
29
- <Text style={{
30
- fontSize: 14,
31
- color: theme.colors.textSecondary,
32
- lineHeight: 20
33
- }}>
34
- {description}
35
- </Text>
36
- )}
37
- </View>
38
- );
39
- };
40
-
41
- export default SharedComponent;
@@ -1,3 +0,0 @@
1
- // Export all components
2
- export { default as SharedComponent } from './SharedComponent';
3
- export type { SharedComponentProps } from './SharedComponent';
@@ -1,17 +0,0 @@
1
- export interface ComponentProps {
2
- style?: any;
3
- children?: React.ReactNode;
4
- }
5
-
6
- export interface User {
7
- id: string;
8
- name: string;
9
- email: string;
10
- avatar?: string;
11
- }
12
-
13
- export interface ApiResponse<T> {
14
- data: T;
15
- message: string;
16
- success: boolean;
17
- }
@@ -1,34 +0,0 @@
1
- /**
2
- * Converts a string to title case
3
- * @param str The string to convert
4
- * @returns The string in title case
5
- */
6
- export const toTitleCase = (str: string): string => {
7
- return str.replace(/\w\S*/g, (txt) =>
8
- txt.charAt(0).toUpperCase() + txt.substr(1).toLowerCase()
9
- );
10
- };
11
-
12
- /**
13
- * Formats a number as currency
14
- * @param amount The amount to format
15
- * @param currency The currency code (default: 'USD')
16
- * @returns The formatted currency string
17
- */
18
- export const formatCurrency = (amount: number, currency = 'USD'): string => {
19
- return new Intl.NumberFormat('en-US', {
20
- style: 'currency',
21
- currency,
22
- }).format(amount);
23
- };
24
-
25
- /**
26
- * Truncates a string to a specified length
27
- * @param str The string to truncate
28
- * @param maxLength The maximum length
29
- * @returns The truncated string
30
- */
31
- export const truncateText = (str: string, maxLength: number): string => {
32
- if (str.length <= maxLength) return str;
33
- return str.substring(0, maxLength) + '...';
34
- };
@@ -1,2 +0,0 @@
1
- // Export all utilities
2
- export * from './helpers';