@idealyst/cli 1.0.2
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/README.md +110 -0
- package/dist/index.js +287 -0
- package/dist/types/generators/index.d.ts +6 -0
- package/dist/types/generators/native.d.ts +2 -0
- package/dist/types/generators/shared.d.ts +2 -0
- package/dist/types/generators/utils.d.ts +11 -0
- package/dist/types/generators/web.d.ts +2 -0
- package/dist/types/generators/workspace.d.ts +2 -0
- package/dist/types/index.d.ts +2 -0
- package/dist/types/types.d.ts +13 -0
- package/package.json +59 -0
- package/templates/native/README.md +86 -0
- package/templates/native/app.json +5 -0
- package/templates/native/babel.config.js +14 -0
- package/templates/native/index.js +9 -0
- package/templates/native/metro.config.js +11 -0
- package/templates/native/package.json +70 -0
- package/templates/native/src/App.tsx +35 -0
- package/templates/native/tsconfig.json +30 -0
- package/templates/shared/README.md +109 -0
- package/templates/shared/package.json +42 -0
- package/templates/shared/rollup.config.js +27 -0
- package/templates/shared/src/components/SharedComponent.tsx +25 -0
- package/templates/shared/src/components/index.ts +1 -0
- package/templates/shared/src/index.ts +7 -0
- package/templates/shared/src/types/index.ts +7 -0
- package/templates/shared/src/utils/helpers.ts +32 -0
- package/templates/shared/src/utils/index.ts +1 -0
- package/templates/shared/tsconfig.json +25 -0
- package/templates/web/README.md +91 -0
- package/templates/web/index.html +13 -0
- package/templates/web/package.json +51 -0
- package/templates/web/src/App.tsx +39 -0
- package/templates/web/src/main.tsx +11 -0
- package/templates/web/tsconfig.json +27 -0
- package/templates/web/vite.config.ts +23 -0
- package/templates/workspace/README.md +78 -0
- package/templates/workspace/package.json +25 -0
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "{{packageName}}",
|
|
3
|
+
"version": "{{version}}",
|
|
4
|
+
"description": "{{description}}",
|
|
5
|
+
"private": true,
|
|
6
|
+
"scripts": {
|
|
7
|
+
"android": "react-native run-android",
|
|
8
|
+
"ios": "react-native run-ios",
|
|
9
|
+
"lint": "eslint .",
|
|
10
|
+
"start": "react-native start",
|
|
11
|
+
"test": "jest",
|
|
12
|
+
"build:android": "react-native bundle --platform android --dev false --entry-file index.js --bundle-output android/app/src/main/assets/index.android.bundle --assets-dest android/app/src/main/res"
|
|
13
|
+
},
|
|
14
|
+
"dependencies": {
|
|
15
|
+
"@idealyst/components": "^1.0.1",
|
|
16
|
+
"@idealyst/navigation": "^1.0.1",
|
|
17
|
+
"@idealyst/theme": "^1.0.1",
|
|
18
|
+
"@react-native-vector-icons/common": "^12.0.1",
|
|
19
|
+
"@react-native-vector-icons/material-design-icons": "^12.0.1",
|
|
20
|
+
"@react-native/new-app-screen": "0.80.1",
|
|
21
|
+
"@react-native/normalize-colors": "^0.80.1",
|
|
22
|
+
"@react-navigation/bottom-tabs": "^7.4.2",
|
|
23
|
+
"@react-navigation/drawer": "^7.5.3",
|
|
24
|
+
"@react-navigation/native": "^7.1.14",
|
|
25
|
+
"@react-navigation/native-stack": "^7.3.21",
|
|
26
|
+
"react": "19.1.0",
|
|
27
|
+
"react-native": "0.80.1",
|
|
28
|
+
"react-native-edge-to-edge": "^1.6.2",
|
|
29
|
+
"react-native-gesture-handler": "^2.27.1",
|
|
30
|
+
"react-native-nitro-modules": "^0.26.3",
|
|
31
|
+
"react-native-reanimated": "^3.18.0",
|
|
32
|
+
"react-native-safe-area-context": "^5.5.1",
|
|
33
|
+
"react-native-screens": "^4.11.1",
|
|
34
|
+
"react-native-unistyles": "^3.0.4",
|
|
35
|
+
"react-native-vector-icons": "^10.2.0"
|
|
36
|
+
},
|
|
37
|
+
"devDependencies": {
|
|
38
|
+
"@babel/core": "^7.25.2",
|
|
39
|
+
"@babel/preset-env": "^7.25.3",
|
|
40
|
+
"@babel/runtime": "^7.27.6",
|
|
41
|
+
"@react-native-community/cli": "19.0.0",
|
|
42
|
+
"@react-native-community/cli-platform-android": "19.0.0",
|
|
43
|
+
"@react-native-community/cli-platform-ios": "19.0.0",
|
|
44
|
+
"@react-native/babel-preset": "0.80.1",
|
|
45
|
+
"@react-native/eslint-config": "0.80.1",
|
|
46
|
+
"@react-native/metro-config": "0.80.1",
|
|
47
|
+
"@react-native/typescript-config": "0.80.1",
|
|
48
|
+
"@types/jest": "^29.5.13",
|
|
49
|
+
"@types/react": "^19.1.0",
|
|
50
|
+
"@types/react-test-renderer": "^19.1.0",
|
|
51
|
+
"babel-plugin-module-resolver": "^5.0.2",
|
|
52
|
+
"eslint": "^8.19.0",
|
|
53
|
+
"jest": "^29.7.0",
|
|
54
|
+
"metro-react-native-babel-preset": "^0.80.1",
|
|
55
|
+
"prettier": "^2.8.8",
|
|
56
|
+
"react-test-renderer": "19.1.0",
|
|
57
|
+
"typescript": "^5.0.4"
|
|
58
|
+
},
|
|
59
|
+
"jest": {
|
|
60
|
+
"preset": "react-native",
|
|
61
|
+
"moduleFileExtensions": [
|
|
62
|
+
"ts",
|
|
63
|
+
"tsx",
|
|
64
|
+
"js",
|
|
65
|
+
"jsx",
|
|
66
|
+
"json",
|
|
67
|
+
"node"
|
|
68
|
+
]
|
|
69
|
+
}
|
|
70
|
+
}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { Screen, View, Text, Button } from '@idealyst/components';
|
|
3
|
+
import { UnistylesRegistry } from 'react-native-unistyles';
|
|
4
|
+
import { lightTheme, darkTheme } from '@idealyst/theme';
|
|
5
|
+
|
|
6
|
+
// Register themes
|
|
7
|
+
UnistylesRegistry.addThemes({
|
|
8
|
+
light: lightTheme,
|
|
9
|
+
dark: darkTheme,
|
|
10
|
+
});
|
|
11
|
+
|
|
12
|
+
const App: React.FC = () => {
|
|
13
|
+
return (
|
|
14
|
+
<Screen>
|
|
15
|
+
<View style={{ flex: 1, justifyContent: 'center', alignItems: 'center', padding: 20 }}>
|
|
16
|
+
<Text variant="h1" style={{ marginBottom: 20, textAlign: 'center' }}>
|
|
17
|
+
Welcome to {{projectName}}
|
|
18
|
+
</Text>
|
|
19
|
+
<Text variant="body1" style={{ marginBottom: 30, textAlign: 'center' }}>
|
|
20
|
+
Built with Idealyst Framework
|
|
21
|
+
</Text>
|
|
22
|
+
<Button
|
|
23
|
+
title="Get Started"
|
|
24
|
+
onPress={() => console.log('Button pressed!')}
|
|
25
|
+
style={{ marginBottom: 20 }}
|
|
26
|
+
/>
|
|
27
|
+
<Text variant="caption" style={{ textAlign: 'center', opacity: 0.7 }}>
|
|
28
|
+
Edit src/App.tsx to start building your app
|
|
29
|
+
</Text>
|
|
30
|
+
</View>
|
|
31
|
+
</Screen>
|
|
32
|
+
);
|
|
33
|
+
};
|
|
34
|
+
|
|
35
|
+
export default App;
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
{
|
|
2
|
+
"extends": "@react-native/typescript-config/tsconfig.json",
|
|
3
|
+
"compilerOptions": {
|
|
4
|
+
"allowJs": true,
|
|
5
|
+
"allowSyntheticDefaultImports": true,
|
|
6
|
+
"esModuleInterop": true,
|
|
7
|
+
"isolatedModules": true,
|
|
8
|
+
"jsx": "react-native",
|
|
9
|
+
"lib": ["es2017"],
|
|
10
|
+
"moduleResolution": "node",
|
|
11
|
+
"noEmit": true,
|
|
12
|
+
"strict": true,
|
|
13
|
+
"target": "esnext",
|
|
14
|
+
"skipLibCheck": true,
|
|
15
|
+
"resolveJsonModule": true,
|
|
16
|
+
"baseUrl": "./",
|
|
17
|
+
"paths": {
|
|
18
|
+
"@/*": ["./src/*"]
|
|
19
|
+
}
|
|
20
|
+
},
|
|
21
|
+
"include": [
|
|
22
|
+
"src/**/*",
|
|
23
|
+
"index.js"
|
|
24
|
+
],
|
|
25
|
+
"exclude": [
|
|
26
|
+
"node_modules",
|
|
27
|
+
"android",
|
|
28
|
+
"ios"
|
|
29
|
+
]
|
|
30
|
+
}
|
|
@@ -0,0 +1,109 @@
|
|
|
1
|
+
# {{projectName}}
|
|
2
|
+
|
|
3
|
+
{{description}}
|
|
4
|
+
|
|
5
|
+
## Getting Started
|
|
6
|
+
|
|
7
|
+
This is a shared library built with the Idealyst Framework that can be used across React Native and React web applications.
|
|
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
|
+
Build the library:
|
|
24
|
+
```bash
|
|
25
|
+
yarn build
|
|
26
|
+
```
|
|
27
|
+
|
|
28
|
+
Watch for changes during development:
|
|
29
|
+
```bash
|
|
30
|
+
yarn dev
|
|
31
|
+
```
|
|
32
|
+
|
|
33
|
+
### Project Structure
|
|
34
|
+
|
|
35
|
+
```
|
|
36
|
+
{{projectName}}/
|
|
37
|
+
├── src/
|
|
38
|
+
│ ├── components/ # Shared components
|
|
39
|
+
│ ├── utils/ # Utility functions
|
|
40
|
+
│ ├── types/ # TypeScript types
|
|
41
|
+
│ └── index.ts # Main export file
|
|
42
|
+
├── dist/ # Built library (generated)
|
|
43
|
+
├── rollup.config.js # Build configuration
|
|
44
|
+
└── tsconfig.json # TypeScript configuration
|
|
45
|
+
```
|
|
46
|
+
|
|
47
|
+
### Features
|
|
48
|
+
|
|
49
|
+
- **Cross-platform**: Works on both React Native and React web
|
|
50
|
+
- **TypeScript**: Full type safety
|
|
51
|
+
- **Tree-shakeable**: Optimized for bundle size
|
|
52
|
+
- **Peer Dependencies**: Lightweight by design
|
|
53
|
+
- **Idealyst Theme Integration**: Compatible with the Idealyst theming system
|
|
54
|
+
|
|
55
|
+
### Usage
|
|
56
|
+
|
|
57
|
+
After building, you can import and use the library in your projects:
|
|
58
|
+
|
|
59
|
+
```tsx
|
|
60
|
+
import { SharedComponent, toTitleCase, ComponentProps } from '{{packageName}}';
|
|
61
|
+
|
|
62
|
+
// Use the shared component
|
|
63
|
+
<SharedComponent
|
|
64
|
+
title="Hello World"
|
|
65
|
+
description="This works on both web and mobile!"
|
|
66
|
+
/>
|
|
67
|
+
|
|
68
|
+
// Use utility functions
|
|
69
|
+
const formatted = toTitleCase('hello world'); // "Hello World"
|
|
70
|
+
```
|
|
71
|
+
|
|
72
|
+
### Building for Production
|
|
73
|
+
|
|
74
|
+
Build the library:
|
|
75
|
+
```bash
|
|
76
|
+
yarn build
|
|
77
|
+
```
|
|
78
|
+
|
|
79
|
+
This creates:
|
|
80
|
+
- `dist/index.js` - CommonJS build
|
|
81
|
+
- `dist/index.esm.js` - ES modules build
|
|
82
|
+
- `dist/index.d.ts` - TypeScript declarations
|
|
83
|
+
|
|
84
|
+
### Publishing
|
|
85
|
+
|
|
86
|
+
Before publishing, make sure to:
|
|
87
|
+
|
|
88
|
+
1. Update the version in `package.json`
|
|
89
|
+
2. Build the library: `yarn build`
|
|
90
|
+
3. Publish to npm: `npm publish`
|
|
91
|
+
|
|
92
|
+
### Development in Monorepo
|
|
93
|
+
|
|
94
|
+
If you're using this in a monorepo, you can reference it directly:
|
|
95
|
+
|
|
96
|
+
```json
|
|
97
|
+
{
|
|
98
|
+
"dependencies": {
|
|
99
|
+
"{{packageName}}": "workspace:*"
|
|
100
|
+
}
|
|
101
|
+
}
|
|
102
|
+
```
|
|
103
|
+
|
|
104
|
+
### Learn More
|
|
105
|
+
|
|
106
|
+
- [Idealyst Framework Documentation](https://github.com/your-username/idealyst-framework)
|
|
107
|
+
- [React Native Documentation](https://reactnative.dev/)
|
|
108
|
+
- [React Documentation](https://react.dev/)
|
|
109
|
+
- [Rollup Documentation](https://rollupjs.org/)
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "{{packageName}}",
|
|
3
|
+
"version": "{{version}}",
|
|
4
|
+
"description": "{{description}}",
|
|
5
|
+
"main": "dist/index.js",
|
|
6
|
+
"module": "dist/index.esm.js",
|
|
7
|
+
"types": "dist/index.d.ts",
|
|
8
|
+
"scripts": {
|
|
9
|
+
"build": "rollup -c",
|
|
10
|
+
"dev": "rollup -c -w",
|
|
11
|
+
"prepublishOnly": "yarn build"
|
|
12
|
+
},
|
|
13
|
+
"peerDependencies": {
|
|
14
|
+
"@idealyst/theme": "^1.0.1",
|
|
15
|
+
"react": "^19.1.0",
|
|
16
|
+
"react-native": "^0.80.1"
|
|
17
|
+
},
|
|
18
|
+
"peerDependenciesMeta": {
|
|
19
|
+
"react-native": {
|
|
20
|
+
"optional": true
|
|
21
|
+
}
|
|
22
|
+
},
|
|
23
|
+
"devDependencies": {
|
|
24
|
+
"@types/react": "^19.1.0",
|
|
25
|
+
"react": "^19.1.0",
|
|
26
|
+
"react-native": "^0.80.1",
|
|
27
|
+
"rollup": "^3.20.0",
|
|
28
|
+
"rollup-plugin-typescript2": "^0.34.0",
|
|
29
|
+
"typescript": "^5.0.0"
|
|
30
|
+
},
|
|
31
|
+
"files": [
|
|
32
|
+
"dist",
|
|
33
|
+
"src"
|
|
34
|
+
],
|
|
35
|
+
"keywords": [
|
|
36
|
+
"react",
|
|
37
|
+
"react-native",
|
|
38
|
+
"cross-platform",
|
|
39
|
+
"shared",
|
|
40
|
+
"library"
|
|
41
|
+
]
|
|
42
|
+
}
|
|
@@ -0,0 +1,27 @@
|
|
|
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
|
+
};
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { View, Text } from 'react-native';
|
|
3
|
+
|
|
4
|
+
interface SharedComponentProps {
|
|
5
|
+
title: string;
|
|
6
|
+
description?: string;
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
export const SharedComponent: React.FC<SharedComponentProps> = ({
|
|
10
|
+
title,
|
|
11
|
+
description
|
|
12
|
+
}) => {
|
|
13
|
+
return (
|
|
14
|
+
<View style={{ padding: 16, alignItems: 'center' }}>
|
|
15
|
+
<Text style={{ fontSize: 18, fontWeight: 'bold', marginBottom: 8 }}>
|
|
16
|
+
{title}
|
|
17
|
+
</Text>
|
|
18
|
+
{description && (
|
|
19
|
+
<Text style={{ fontSize: 14, color: '#666', textAlign: 'center' }}>
|
|
20
|
+
{description}
|
|
21
|
+
</Text>
|
|
22
|
+
)}
|
|
23
|
+
</View>
|
|
24
|
+
);
|
|
25
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './SharedComponent';
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Format a string to title case
|
|
3
|
+
*/
|
|
4
|
+
export const toTitleCase = (str: string): string => {
|
|
5
|
+
return str.replace(/\w\S*/g, (txt) =>
|
|
6
|
+
txt.charAt(0).toUpperCase() + txt.substr(1).toLowerCase()
|
|
7
|
+
);
|
|
8
|
+
};
|
|
9
|
+
|
|
10
|
+
/**
|
|
11
|
+
* Check if a value is empty (null, undefined, empty string, empty array)
|
|
12
|
+
*/
|
|
13
|
+
export const isEmpty = (value: any): boolean => {
|
|
14
|
+
if (value === null || value === undefined) return true;
|
|
15
|
+
if (typeof value === 'string' && value.trim() === '') return true;
|
|
16
|
+
if (Array.isArray(value) && value.length === 0) return true;
|
|
17
|
+
return false;
|
|
18
|
+
};
|
|
19
|
+
|
|
20
|
+
/**
|
|
21
|
+
* Debounce function calls
|
|
22
|
+
*/
|
|
23
|
+
export const debounce = <T extends (...args: any[]) => any>(
|
|
24
|
+
func: T,
|
|
25
|
+
delay: number
|
|
26
|
+
): ((...args: Parameters<T>) => void) => {
|
|
27
|
+
let timeoutId: NodeJS.Timeout;
|
|
28
|
+
return (...args: Parameters<T>) => {
|
|
29
|
+
clearTimeout(timeoutId);
|
|
30
|
+
timeoutId = setTimeout(() => func(...args), delay);
|
|
31
|
+
};
|
|
32
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './helpers';
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
{
|
|
2
|
+
"compilerOptions": {
|
|
3
|
+
"target": "ES2020",
|
|
4
|
+
"module": "ESNext",
|
|
5
|
+
"lib": ["ES2020"],
|
|
6
|
+
"moduleResolution": "node",
|
|
7
|
+
"esModuleInterop": true,
|
|
8
|
+
"allowSyntheticDefaultImports": true,
|
|
9
|
+
"strict": true,
|
|
10
|
+
"skipLibCheck": true,
|
|
11
|
+
"forceConsistentCasingInFileNames": true,
|
|
12
|
+
"declaration": true,
|
|
13
|
+
"declarationDir": "./dist",
|
|
14
|
+
"outDir": "./dist",
|
|
15
|
+
"rootDir": "./src",
|
|
16
|
+
"jsx": "react-jsx"
|
|
17
|
+
},
|
|
18
|
+
"include": [
|
|
19
|
+
"src/**/*"
|
|
20
|
+
],
|
|
21
|
+
"exclude": [
|
|
22
|
+
"node_modules",
|
|
23
|
+
"dist"
|
|
24
|
+
]
|
|
25
|
+
}
|
|
@@ -0,0 +1,91 @@
|
|
|
1
|
+
# {{projectName}}
|
|
2
|
+
|
|
3
|
+
{{description}}
|
|
4
|
+
|
|
5
|
+
## Getting Started
|
|
6
|
+
|
|
7
|
+
This is a React web application built with the Idealyst Framework and Vite.
|
|
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
|
+
Start the development server:
|
|
24
|
+
```bash
|
|
25
|
+
yarn dev
|
|
26
|
+
```
|
|
27
|
+
|
|
28
|
+
The app will be available at `http://localhost:3000`
|
|
29
|
+
|
|
30
|
+
### Building for Production
|
|
31
|
+
|
|
32
|
+
Build the app:
|
|
33
|
+
```bash
|
|
34
|
+
yarn build
|
|
35
|
+
```
|
|
36
|
+
|
|
37
|
+
Preview the production build:
|
|
38
|
+
```bash
|
|
39
|
+
yarn preview
|
|
40
|
+
```
|
|
41
|
+
|
|
42
|
+
### Project Structure
|
|
43
|
+
|
|
44
|
+
```
|
|
45
|
+
{{projectName}}/
|
|
46
|
+
├── src/
|
|
47
|
+
│ ├── App.tsx # Main app component
|
|
48
|
+
│ └── main.tsx # App entry point
|
|
49
|
+
├── index.html # HTML template
|
|
50
|
+
├── vite.config.ts # Vite configuration
|
|
51
|
+
└── tsconfig.json # TypeScript configuration
|
|
52
|
+
```
|
|
53
|
+
|
|
54
|
+
### Features
|
|
55
|
+
|
|
56
|
+
- **Idealyst Components**: Cross-platform UI components
|
|
57
|
+
- **Idealyst Navigation**: Consistent navigation system
|
|
58
|
+
- **Idealyst Theme**: Unified theming across platforms
|
|
59
|
+
- **React 19.1**: Latest React version
|
|
60
|
+
- **Vite**: Fast build tool and dev server
|
|
61
|
+
- **TypeScript**: Full type safety
|
|
62
|
+
- **React Native Web**: Use React Native components on the web
|
|
63
|
+
|
|
64
|
+
### Development
|
|
65
|
+
|
|
66
|
+
The app uses the Idealyst Framework for consistent UI and navigation that works across web and mobile platforms.
|
|
67
|
+
|
|
68
|
+
Edit `src/App.tsx` to start building your application.
|
|
69
|
+
|
|
70
|
+
### Styling
|
|
71
|
+
|
|
72
|
+
The app uses Unistyles for cross-platform styling. You can create styles that work on both web and mobile:
|
|
73
|
+
|
|
74
|
+
```tsx
|
|
75
|
+
import { createStyleSheet } from 'react-native-unistyles';
|
|
76
|
+
|
|
77
|
+
const styles = createStyleSheet({
|
|
78
|
+
container: {
|
|
79
|
+
flex: 1,
|
|
80
|
+
justifyContent: 'center',
|
|
81
|
+
alignItems: 'center'
|
|
82
|
+
}
|
|
83
|
+
});
|
|
84
|
+
```
|
|
85
|
+
|
|
86
|
+
### Learn More
|
|
87
|
+
|
|
88
|
+
- [Idealyst Framework Documentation](https://github.com/your-username/idealyst-framework)
|
|
89
|
+
- [React Documentation](https://react.dev/)
|
|
90
|
+
- [Vite Documentation](https://vitejs.dev/)
|
|
91
|
+
- [React Native Web Documentation](https://necolas.github.io/react-native-web/)
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
<!doctype html>
|
|
2
|
+
<html lang="en">
|
|
3
|
+
<head>
|
|
4
|
+
<meta charset="UTF-8" />
|
|
5
|
+
<link rel="icon" type="image/svg+xml" href="/vite.svg" />
|
|
6
|
+
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
|
7
|
+
<title>{{projectName}}</title>
|
|
8
|
+
</head>
|
|
9
|
+
<body>
|
|
10
|
+
<div id="root"></div>
|
|
11
|
+
<script type="module" src="/src/main.tsx"></script>
|
|
12
|
+
</body>
|
|
13
|
+
</html>
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "{{packageName}}",
|
|
3
|
+
"version": "{{version}}",
|
|
4
|
+
"description": "{{description}}",
|
|
5
|
+
"private": true,
|
|
6
|
+
"type": "module",
|
|
7
|
+
"scripts": {
|
|
8
|
+
"dev": "vite",
|
|
9
|
+
"build": "tsc && vite build",
|
|
10
|
+
"preview": "vite preview"
|
|
11
|
+
},
|
|
12
|
+
"dependencies": {
|
|
13
|
+
"@idealyst/components": "^1.0.1",
|
|
14
|
+
"@idealyst/navigation": "^1.0.1",
|
|
15
|
+
"@idealyst/theme": "^1.0.1",
|
|
16
|
+
"@mdi/js": "^7.4.47",
|
|
17
|
+
"@mdi/react": "^1.6.1",
|
|
18
|
+
"@react-native/normalize-colors": "^0.80.1",
|
|
19
|
+
"@types/react-router-dom": "^5.3.3",
|
|
20
|
+
"compression": "^1.7.4",
|
|
21
|
+
"express": "^4.18.2",
|
|
22
|
+
"react": "^19.1.0",
|
|
23
|
+
"react-dom": "^19.1.0",
|
|
24
|
+
"react-native": "^0.80.1",
|
|
25
|
+
"react-native-edge-to-edge": "^1.6.2",
|
|
26
|
+
"react-native-nitro-modules": "0.26.3",
|
|
27
|
+
"react-native-unistyles": "^3.0.4",
|
|
28
|
+
"react-native-web": "^0.20.0",
|
|
29
|
+
"react-router": "^7.6.3",
|
|
30
|
+
"react-router-dom": "^7.6.3",
|
|
31
|
+
"sirv": "^2.0.4"
|
|
32
|
+
},
|
|
33
|
+
"devDependencies": {
|
|
34
|
+
"@babel/core": "^7.28.0",
|
|
35
|
+
"@babel/preset-env": "^7.28.0",
|
|
36
|
+
"@babel/preset-react": "^7.27.1",
|
|
37
|
+
"@babel/preset-typescript": "^7.27.1",
|
|
38
|
+
"@types/compression": "^1.7.5",
|
|
39
|
+
"@types/express": "^4.17.21",
|
|
40
|
+
"@types/react": "^19.1.0",
|
|
41
|
+
"@types/react-dom": "^19.1.0",
|
|
42
|
+
"@typescript-eslint/eslint-plugin": "^7.2.0",
|
|
43
|
+
"@typescript-eslint/parser": "^7.2.0",
|
|
44
|
+
"@vitejs/plugin-react": "^4.6.0",
|
|
45
|
+
"eslint": "^8.57.0",
|
|
46
|
+
"eslint-plugin-react-hooks": "^4.6.0",
|
|
47
|
+
"eslint-plugin-react-refresh": "^0.4.6",
|
|
48
|
+
"typescript": "^5.2.2",
|
|
49
|
+
"vite": "^5.2.0"
|
|
50
|
+
}
|
|
51
|
+
}
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { View, Text, Button } from '@idealyst/components';
|
|
3
|
+
import { UnistylesRegistry } from 'react-native-unistyles';
|
|
4
|
+
import { lightTheme, darkTheme } from '@idealyst/theme';
|
|
5
|
+
|
|
6
|
+
// Register themes
|
|
7
|
+
UnistylesRegistry.addThemes({
|
|
8
|
+
light: lightTheme,
|
|
9
|
+
dark: darkTheme,
|
|
10
|
+
});
|
|
11
|
+
|
|
12
|
+
const App: React.FC = () => {
|
|
13
|
+
return (
|
|
14
|
+
<View style={{
|
|
15
|
+
flex: 1,
|
|
16
|
+
justifyContent: 'center',
|
|
17
|
+
alignItems: 'center',
|
|
18
|
+
padding: 20,
|
|
19
|
+
minHeight: '100vh'
|
|
20
|
+
}}>
|
|
21
|
+
<Text variant="h1" style={{ marginBottom: 20, textAlign: 'center' }}>
|
|
22
|
+
Welcome to {{projectName}}
|
|
23
|
+
</Text>
|
|
24
|
+
<Text variant="body1" style={{ marginBottom: 30, textAlign: 'center' }}>
|
|
25
|
+
Built with Idealyst Framework
|
|
26
|
+
</Text>
|
|
27
|
+
<Button
|
|
28
|
+
title="Get Started"
|
|
29
|
+
onPress={() => console.log('Button pressed!')}
|
|
30
|
+
style={{ marginBottom: 20 }}
|
|
31
|
+
/>
|
|
32
|
+
<Text variant="caption" style={{ textAlign: 'center', opacity: 0.7 }}>
|
|
33
|
+
Edit src/App.tsx to start building your app
|
|
34
|
+
</Text>
|
|
35
|
+
</View>
|
|
36
|
+
);
|
|
37
|
+
};
|
|
38
|
+
|
|
39
|
+
export default App;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { createRoot } from 'react-dom/client';
|
|
3
|
+
import App from './App';
|
|
4
|
+
|
|
5
|
+
const container = document.getElementById('root');
|
|
6
|
+
if (!container) {
|
|
7
|
+
throw new Error('Root element not found');
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
const root = createRoot(container);
|
|
11
|
+
root.render(<App />);
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
{
|
|
2
|
+
"compilerOptions": {
|
|
3
|
+
"target": "ES2020",
|
|
4
|
+
"lib": ["ES2020", "DOM", "DOM.Iterable"],
|
|
5
|
+
"module": "ESNext",
|
|
6
|
+
"skipLibCheck": true,
|
|
7
|
+
"moduleResolution": "node",
|
|
8
|
+
"allowImportingTsExtensions": true,
|
|
9
|
+
"isolatedModules": true,
|
|
10
|
+
"moduleDetection": "force",
|
|
11
|
+
"noEmit": true,
|
|
12
|
+
"jsx": "react-jsx",
|
|
13
|
+
"strict": true,
|
|
14
|
+
"noUnusedLocals": true,
|
|
15
|
+
"noUnusedParameters": true,
|
|
16
|
+
"noFallthroughCasesInSwitch": true,
|
|
17
|
+
"noUncheckedIndexedAccess": true,
|
|
18
|
+
"baseUrl": ".",
|
|
19
|
+
"paths": {
|
|
20
|
+
"@/*": ["./src/*"],
|
|
21
|
+
"react-native": ["node_modules/react-native-web"]
|
|
22
|
+
},
|
|
23
|
+
"types": ["vite/client"]
|
|
24
|
+
},
|
|
25
|
+
"include": ["src/**/*"],
|
|
26
|
+
"exclude": ["node_modules", "dist"]
|
|
27
|
+
}
|