@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.
- package/README.md +109 -109
- package/dist/index.js +119 -30
- package/dist/types/generators/api.d.ts +2 -0
- package/dist/types/generators/index.d.ts +1 -0
- package/dist/types/generators/utils.d.ts +14 -1
- package/dist/types/types.d.ts +1 -1
- package/package.json +1 -1
- package/templates/api/README.md +207 -0
- package/templates/api/env.example +12 -0
- package/templates/api/package.json +49 -0
- package/templates/api/prisma/schema.prisma +21 -0
- package/templates/api/src/context.ts +23 -0
- package/templates/api/src/controllers/UserController.ts +102 -0
- package/templates/api/src/index.ts +50 -0
- package/templates/api/src/lib/controller.ts +90 -0
- package/templates/api/src/lib/middleware.ts +170 -0
- package/templates/api/src/middleware/auth.ts +75 -0
- package/templates/api/src/middleware/common.ts +103 -0
- package/templates/api/src/router/index.ts +130 -0
- package/templates/api/src/trpc.ts +28 -0
- package/templates/api/tsconfig.json +44 -0
- package/templates/native/.yarnrc.yml +18 -18
- package/templates/native/App.tsx +23 -23
- package/templates/native/README.md +85 -85
- package/templates/native/app.json +4 -4
- package/templates/native/babel.config.js +9 -9
- package/templates/native/index.js +5 -5
- package/templates/native/metro.config.js +27 -21
- package/templates/native/package.json +9 -9
- package/templates/native/tsconfig.json +29 -29
- package/templates/shared/README.md +108 -108
- package/templates/shared/package.json +39 -41
- package/templates/shared/src/index.ts +1 -11
- package/templates/shared/tsconfig.json +24 -24
- package/templates/web/README.md +89 -89
- package/templates/web/index.html +12 -12
- package/templates/web/package.json +51 -51
- package/templates/web/src/App.tsx +14 -14
- package/templates/web/src/main.tsx +24 -24
- package/templates/web/tsconfig.json +26 -26
- package/templates/web/vite.config.ts +68 -65
- package/templates/workspace/.yarnrc.yml +25 -25
- package/templates/workspace/README.md +79 -79
- package/templates/workspace/package.json +24 -24
- package/templates/shared/.yarnrc.yml +0 -19
- package/templates/shared/rollup.config.js +0 -27
- package/templates/shared/src/components/SharedComponent.tsx +0 -41
- package/templates/shared/src/components/index.ts +0 -3
- package/templates/shared/src/types/index.ts +0 -17
- package/templates/shared/src/utils/helpers.ts +0 -34
- package/templates/shared/src/utils/index.ts +0 -2
|
@@ -1,86 +1,86 @@
|
|
|
1
|
-
# {{projectName}}
|
|
2
|
-
|
|
3
|
-
{{description}}
|
|
4
|
-
|
|
5
|
-
## Getting Started
|
|
6
|
-
|
|
7
|
-
This is a React Native application built with the Idealyst Framework.
|
|
8
|
-
|
|
9
|
-
### Prerequisites
|
|
10
|
-
|
|
11
|
-
- Node.js 18+
|
|
12
|
-
- Yarn
|
|
13
|
-
- React Native development environment
|
|
14
|
-
- Android Studio (for Android development)
|
|
15
|
-
- Xcode (for iOS development)
|
|
16
|
-
|
|
17
|
-
### Installation
|
|
18
|
-
|
|
19
|
-
Install dependencies:
|
|
20
|
-
```bash
|
|
21
|
-
yarn install
|
|
22
|
-
```
|
|
23
|
-
|
|
24
|
-
### Running the App
|
|
25
|
-
|
|
26
|
-
Start the Metro bundler:
|
|
27
|
-
```bash
|
|
28
|
-
yarn start
|
|
29
|
-
```
|
|
30
|
-
|
|
31
|
-
Run on Android:
|
|
32
|
-
```bash
|
|
33
|
-
yarn android
|
|
34
|
-
```
|
|
35
|
-
|
|
36
|
-
Run on iOS:
|
|
37
|
-
```bash
|
|
38
|
-
yarn ios
|
|
39
|
-
```
|
|
40
|
-
|
|
41
|
-
### Project Structure
|
|
42
|
-
|
|
43
|
-
```
|
|
44
|
-
{{projectName}}/
|
|
45
|
-
├── src/
|
|
46
|
-
│ └── App.tsx # Main app component
|
|
47
|
-
├── android/ # Android-specific code
|
|
48
|
-
├── ios/ # iOS-specific code
|
|
49
|
-
├── babel.config.js # Babel configuration
|
|
50
|
-
├── metro.config.js # Metro configuration
|
|
51
|
-
└── tsconfig.json # TypeScript configuration
|
|
52
|
-
```
|
|
53
|
-
|
|
54
|
-
### Features
|
|
55
|
-
|
|
56
|
-
- **Idealyst Components**: Pre-built UI components
|
|
57
|
-
- **Idealyst Navigation**: Cross-platform navigation
|
|
58
|
-
- **Idealyst Theme**: Consistent theming system
|
|
59
|
-
- **TypeScript**: Full type safety
|
|
60
|
-
- **React Native 0.80.1**: Latest stable version
|
|
61
|
-
|
|
62
|
-
### Development
|
|
63
|
-
|
|
64
|
-
The app uses the Idealyst Framework for consistent UI and navigation across platforms.
|
|
65
|
-
|
|
66
|
-
Edit `src/App.tsx` to start building your application.
|
|
67
|
-
|
|
68
|
-
### Building for Production
|
|
69
|
-
|
|
70
|
-
Build Android APK:
|
|
71
|
-
```bash
|
|
72
|
-
yarn build:android
|
|
73
|
-
```
|
|
74
|
-
|
|
75
|
-
### Testing
|
|
76
|
-
|
|
77
|
-
Run tests:
|
|
78
|
-
```bash
|
|
79
|
-
yarn test
|
|
80
|
-
```
|
|
81
|
-
|
|
82
|
-
### Learn More
|
|
83
|
-
|
|
84
|
-
- [Idealyst Framework Documentation](https://github.com/your-username/idealyst-framework)
|
|
85
|
-
- [React Native Documentation](https://reactnative.dev/)
|
|
1
|
+
# {{projectName}}
|
|
2
|
+
|
|
3
|
+
{{description}}
|
|
4
|
+
|
|
5
|
+
## Getting Started
|
|
6
|
+
|
|
7
|
+
This is a React Native application built with the Idealyst Framework.
|
|
8
|
+
|
|
9
|
+
### Prerequisites
|
|
10
|
+
|
|
11
|
+
- Node.js 18+
|
|
12
|
+
- Yarn
|
|
13
|
+
- React Native development environment
|
|
14
|
+
- Android Studio (for Android development)
|
|
15
|
+
- Xcode (for iOS development)
|
|
16
|
+
|
|
17
|
+
### Installation
|
|
18
|
+
|
|
19
|
+
Install dependencies:
|
|
20
|
+
```bash
|
|
21
|
+
yarn install
|
|
22
|
+
```
|
|
23
|
+
|
|
24
|
+
### Running the App
|
|
25
|
+
|
|
26
|
+
Start the Metro bundler:
|
|
27
|
+
```bash
|
|
28
|
+
yarn start
|
|
29
|
+
```
|
|
30
|
+
|
|
31
|
+
Run on Android:
|
|
32
|
+
```bash
|
|
33
|
+
yarn android
|
|
34
|
+
```
|
|
35
|
+
|
|
36
|
+
Run on iOS:
|
|
37
|
+
```bash
|
|
38
|
+
yarn ios
|
|
39
|
+
```
|
|
40
|
+
|
|
41
|
+
### Project Structure
|
|
42
|
+
|
|
43
|
+
```
|
|
44
|
+
{{projectName}}/
|
|
45
|
+
├── src/
|
|
46
|
+
│ └── App.tsx # Main app component
|
|
47
|
+
├── android/ # Android-specific code
|
|
48
|
+
├── ios/ # iOS-specific code
|
|
49
|
+
├── babel.config.js # Babel configuration
|
|
50
|
+
├── metro.config.js # Metro configuration
|
|
51
|
+
└── tsconfig.json # TypeScript configuration
|
|
52
|
+
```
|
|
53
|
+
|
|
54
|
+
### Features
|
|
55
|
+
|
|
56
|
+
- **Idealyst Components**: Pre-built UI components
|
|
57
|
+
- **Idealyst Navigation**: Cross-platform navigation
|
|
58
|
+
- **Idealyst Theme**: Consistent theming system
|
|
59
|
+
- **TypeScript**: Full type safety
|
|
60
|
+
- **React Native 0.80.1**: Latest stable version
|
|
61
|
+
|
|
62
|
+
### Development
|
|
63
|
+
|
|
64
|
+
The app uses the Idealyst Framework for consistent UI and navigation across platforms.
|
|
65
|
+
|
|
66
|
+
Edit `src/App.tsx` to start building your application.
|
|
67
|
+
|
|
68
|
+
### Building for Production
|
|
69
|
+
|
|
70
|
+
Build Android APK:
|
|
71
|
+
```bash
|
|
72
|
+
yarn build:android
|
|
73
|
+
```
|
|
74
|
+
|
|
75
|
+
### Testing
|
|
76
|
+
|
|
77
|
+
Run tests:
|
|
78
|
+
```bash
|
|
79
|
+
yarn test
|
|
80
|
+
```
|
|
81
|
+
|
|
82
|
+
### Learn More
|
|
83
|
+
|
|
84
|
+
- [Idealyst Framework Documentation](https://github.com/your-username/idealyst-framework)
|
|
85
|
+
- [React Native Documentation](https://reactnative.dev/)
|
|
86
86
|
- [TypeScript Documentation](https://www.typescriptlang.org/)
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "{{
|
|
3
|
-
"displayName": "{{
|
|
4
|
-
"react-native-version": "0.80.1"
|
|
1
|
+
{
|
|
2
|
+
"name": "{{appName}}",
|
|
3
|
+
"displayName": "{{appName}}",
|
|
4
|
+
"react-native-version": "0.80.1"
|
|
5
5
|
}
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
module.exports = {
|
|
2
|
-
presets: ['module:@react-native/babel-preset'],
|
|
3
|
-
plugins: [
|
|
4
|
-
['react-native-unistyles/plugin', {
|
|
5
|
-
root: 'src',
|
|
6
|
-
autoProcessPaths: ['@idealyst/components', '@idealyst/navigation', '@idealyst/theme'],
|
|
7
|
-
}],
|
|
8
|
-
'react-native-reanimated/plugin',
|
|
9
|
-
],
|
|
1
|
+
module.exports = {
|
|
2
|
+
presets: ['module:@react-native/babel-preset'],
|
|
3
|
+
plugins: [
|
|
4
|
+
['react-native-unistyles/plugin', {
|
|
5
|
+
root: 'src',
|
|
6
|
+
autoProcessPaths: ['@idealyst/components', '@idealyst/navigation', '@idealyst/theme'],
|
|
7
|
+
}],
|
|
8
|
+
'react-native-reanimated/plugin',
|
|
9
|
+
],
|
|
10
10
|
};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import '@idealyst/theme/unistyles';
|
|
2
|
-
|
|
3
|
-
import { AppRegistry } from 'react-native';
|
|
4
|
-
import App from './App';
|
|
5
|
-
|
|
1
|
+
import '@idealyst/theme/unistyles';
|
|
2
|
+
|
|
3
|
+
import { AppRegistry } from 'react-native';
|
|
4
|
+
import App from './App';
|
|
5
|
+
|
|
6
6
|
AppRegistry.registerComponent('{{projectName}}', () => App);
|
|
@@ -1,21 +1,27 @@
|
|
|
1
|
-
const { getDefaultConfig, mergeConfig } = require('@react-native/metro-config');
|
|
2
|
-
const path = require('path');
|
|
3
|
-
|
|
4
|
-
const { wrapWithReanimatedMetroConfig } = require('react-native-reanimated/metro-config');
|
|
5
|
-
|
|
6
|
-
const config = {
|
|
7
|
-
projectRoot: __dirname,
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
1
|
+
const { getDefaultConfig, mergeConfig } = require('@react-native/metro-config');
|
|
2
|
+
const path = require('path');
|
|
3
|
+
|
|
4
|
+
const { wrapWithReanimatedMetroConfig } = require('react-native-reanimated/metro-config');
|
|
5
|
+
|
|
6
|
+
const config = {
|
|
7
|
+
projectRoot: __dirname,
|
|
8
|
+
watchFolders: [
|
|
9
|
+
// Add the workspace root to watch folders so Metro can watch workspace packages
|
|
10
|
+
path.resolve(__dirname, '..'),
|
|
11
|
+
],
|
|
12
|
+
resolver: {
|
|
13
|
+
nodeModulesPaths: [
|
|
14
|
+
path.resolve(__dirname, 'node_modules'),
|
|
15
|
+
// Add the workspace root node_modules
|
|
16
|
+
path.resolve(__dirname, '..', 'node_modules'),
|
|
17
|
+
],
|
|
18
|
+
// Important for Idealyst to use .native extensions for React Native (eg: @idealyst/components/src/Button/Button.native.tsx)
|
|
19
|
+
sourceExts: ['native.tsx', 'native.ts', 'tsx', 'ts', 'native.jsx', 'native.js', 'jsx', 'js', 'json'],
|
|
20
|
+
},
|
|
21
|
+
watcher: {
|
|
22
|
+
// When configuring custom components with .native extensions, make sure the watcher looks for them
|
|
23
|
+
additionalExts: ['native.tsx', 'native.ts', 'native.jsx', 'native.js'],
|
|
24
|
+
},
|
|
25
|
+
};
|
|
26
|
+
|
|
27
|
+
module.exports = wrapWithReanimatedMetroConfig(mergeConfig(getDefaultConfig(__dirname), config));
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "{{packageName}}",
|
|
3
|
-
"version": "{{version}}",
|
|
4
|
-
"description": "{{description}}",
|
|
5
|
-
"private": true,
|
|
6
|
-
"idealyst": {
|
|
7
|
-
"framework": "react-native",
|
|
8
|
-
"version": "1.0.3"
|
|
9
|
-
}
|
|
1
|
+
{
|
|
2
|
+
"name": "{{packageName}}",
|
|
3
|
+
"version": "{{version}}",
|
|
4
|
+
"description": "{{description}}",
|
|
5
|
+
"private": true,
|
|
6
|
+
"idealyst": {
|
|
7
|
+
"framework": "react-native",
|
|
8
|
+
"version": "1.0.3"
|
|
9
|
+
}
|
|
10
10
|
}
|
|
@@ -1,30 +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
|
-
]
|
|
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
30
|
}
|
|
@@ -1,109 +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/)
|
|
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
109
|
- [Rollup Documentation](https://rollupjs.org/)
|
|
@@ -1,42 +1,40 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "{{packageName}}",
|
|
3
|
-
"version": "{{version}}",
|
|
4
|
-
"description": "{{description}}",
|
|
5
|
-
"main": "
|
|
6
|
-
"module": "
|
|
7
|
-
"types": "
|
|
8
|
-
"
|
|
9
|
-
"
|
|
10
|
-
"
|
|
11
|
-
"
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
"react-native":
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
"@types/react": "^19.1.0",
|
|
25
|
-
"react": "^19.1.0",
|
|
26
|
-
"react-native": "^0.80.1",
|
|
27
|
-
"
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
"
|
|
37
|
-
"
|
|
38
|
-
"
|
|
39
|
-
|
|
40
|
-
"library"
|
|
41
|
-
]
|
|
1
|
+
{
|
|
2
|
+
"name": "{{packageName}}",
|
|
3
|
+
"version": "{{version}}",
|
|
4
|
+
"description": "{{description}}",
|
|
5
|
+
"main": "src/index.ts",
|
|
6
|
+
"module": "src/index.ts",
|
|
7
|
+
"types": "src/index.ts",
|
|
8
|
+
"peerDependencies": {
|
|
9
|
+
"@idealyst/components": "^1.0.21",
|
|
10
|
+
"@idealyst/navigation": "^1.0.21",
|
|
11
|
+
"@idealyst/theme": "^1.0.21",
|
|
12
|
+
"react": "^19.1.0",
|
|
13
|
+
"react-native": "^0.80.1"
|
|
14
|
+
},
|
|
15
|
+
"peerDependenciesMeta": {
|
|
16
|
+
"react-native": {
|
|
17
|
+
"optional": true
|
|
18
|
+
}
|
|
19
|
+
},
|
|
20
|
+
"devDependencies": {
|
|
21
|
+
"@idealyst/components": "^1.0.21",
|
|
22
|
+
"@idealyst/navigation": "^1.0.21",
|
|
23
|
+
"@idealyst/theme": "^1.0.21",
|
|
24
|
+
"@types/react": "^19.1.0",
|
|
25
|
+
"react": "^19.1.0",
|
|
26
|
+
"react-native": "^0.80.1",
|
|
27
|
+
"typescript": "^5.0.0"
|
|
28
|
+
},
|
|
29
|
+
"files": [
|
|
30
|
+
"dist",
|
|
31
|
+
"src"
|
|
32
|
+
],
|
|
33
|
+
"keywords": [
|
|
34
|
+
"react",
|
|
35
|
+
"react-native",
|
|
36
|
+
"cross-platform",
|
|
37
|
+
"shared",
|
|
38
|
+
"library"
|
|
39
|
+
]
|
|
42
40
|
}
|
|
@@ -1,11 +1 @@
|
|
|
1
|
-
|
|
2
|
-
export * from './components';
|
|
3
|
-
|
|
4
|
-
// Export all utilities
|
|
5
|
-
export * from './utils';
|
|
6
|
-
|
|
7
|
-
// Export all types
|
|
8
|
-
export * from './types';
|
|
9
|
-
|
|
10
|
-
// Re-export theme utilities
|
|
11
|
-
export { useTheme, createStyleSheet } from '@idealyst/theme';
|
|
1
|
+
export const add_stuff = "here";
|