@idealyst/cli 1.1.7 → 1.1.9
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/package.json +1 -1
- package/template/packages/mobile/babel.config.js +20 -4
- package/template/packages/mobile/index.js +4 -2
- package/template/packages/shared/src/index.ts +3 -0
- package/template/packages/shared/src/unistyles.ts +50 -0
- package/template/packages/web/src/main.tsx +3 -1
- package/template/packages/web/vite.config.ts +17 -1
package/package.json
CHANGED
|
@@ -1,10 +1,26 @@
|
|
|
1
1
|
module.exports = {
|
|
2
2
|
presets: ['module:@react-native/babel-preset'],
|
|
3
3
|
plugins: [
|
|
4
|
+
// Idealyst StyleBuilder plugin - expands $iterator patterns in defineStyle/extendStyle
|
|
5
|
+
// Must run BEFORE react-native-unistyles/plugin
|
|
6
|
+
['@idealyst/theme/plugin', {
|
|
7
|
+
autoProcessPaths: [
|
|
8
|
+
'@idealyst/components',
|
|
9
|
+
'@idealyst/navigation',
|
|
10
|
+
'@idealyst/theme',
|
|
11
|
+
],
|
|
12
|
+
// Path to your theme configuration file (relative to this babel.config.js)
|
|
13
|
+
themePath: '../shared/src/unistyles.ts',
|
|
14
|
+
}],
|
|
15
|
+
// Unistyles plugin - processes StyleSheet.create calls
|
|
4
16
|
['react-native-unistyles/plugin', {
|
|
5
|
-
|
|
6
|
-
|
|
17
|
+
autoProcessPaths: [
|
|
18
|
+
'@idealyst/components',
|
|
19
|
+
'@idealyst/navigation',
|
|
20
|
+
'@idealyst/theme',
|
|
21
|
+
],
|
|
7
22
|
}],
|
|
8
|
-
|
|
23
|
+
// Reanimated 4 uses the worklets plugin
|
|
24
|
+
'react-native-worklets/plugin',
|
|
9
25
|
],
|
|
10
|
-
};
|
|
26
|
+
};
|
|
@@ -1,6 +1,8 @@
|
|
|
1
|
-
|
|
1
|
+
// Import shared unistyles configuration FIRST
|
|
2
|
+
// This ensures the theme is registered before any component stylesheets
|
|
3
|
+
import '@{{projectName}}/shared';
|
|
2
4
|
|
|
3
5
|
import { AppRegistry } from 'react-native';
|
|
4
6
|
import App from './src/App';
|
|
5
7
|
|
|
6
|
-
AppRegistry.registerComponent('{{projectName}}', () => App);
|
|
8
|
+
AppRegistry.registerComponent('{{projectName}}', () => App);
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Theme configuration for Unistyles.
|
|
3
|
+
*
|
|
4
|
+
* This file must be imported BEFORE any @idealyst/components to ensure
|
|
5
|
+
* the theme is registered before stylesheets are created.
|
|
6
|
+
*
|
|
7
|
+
* Customize your themes here by extending the base Idealyst themes.
|
|
8
|
+
*/
|
|
9
|
+
import { StyleSheet } from 'react-native-unistyles';
|
|
10
|
+
import { fromTheme, lightTheme, darkTheme } from '@idealyst/theme';
|
|
11
|
+
|
|
12
|
+
// Create custom themes by extending the base themes
|
|
13
|
+
// You can use .addIntent(), .addRadius(), .addShadow(), .setSizes() to customize
|
|
14
|
+
const customLightTheme = fromTheme(lightTheme)
|
|
15
|
+
// Example: Add custom intents
|
|
16
|
+
// .addIntent('brand', {
|
|
17
|
+
// primary: '#6366f1',
|
|
18
|
+
// secondary: '#8b5cf6',
|
|
19
|
+
// contrast: '#ffffff',
|
|
20
|
+
// })
|
|
21
|
+
.build();
|
|
22
|
+
|
|
23
|
+
const customDarkTheme = fromTheme(darkTheme)
|
|
24
|
+
// Example: Add custom intents (should match light theme)
|
|
25
|
+
// .addIntent('brand', {
|
|
26
|
+
// primary: '#818cf8',
|
|
27
|
+
// secondary: '#a78bfa',
|
|
28
|
+
// contrast: '#000000',
|
|
29
|
+
// })
|
|
30
|
+
.build();
|
|
31
|
+
|
|
32
|
+
// Register custom theme type for TypeScript inference
|
|
33
|
+
declare module '@idealyst/theme' {
|
|
34
|
+
interface CustomThemeRegistry {
|
|
35
|
+
theme: typeof customLightTheme;
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
// Configure Unistyles with your themes
|
|
40
|
+
StyleSheet.configure({
|
|
41
|
+
settings: {
|
|
42
|
+
initialTheme: 'light',
|
|
43
|
+
// Enable adaptive themes to follow system preference
|
|
44
|
+
// adaptiveThemes: true,
|
|
45
|
+
},
|
|
46
|
+
themes: {
|
|
47
|
+
light: customLightTheme,
|
|
48
|
+
dark: customDarkTheme,
|
|
49
|
+
},
|
|
50
|
+
});
|
|
@@ -1,4 +1,6 @@
|
|
|
1
|
-
|
|
1
|
+
// Import shared unistyles configuration FIRST
|
|
2
|
+
// This ensures the theme is registered before any component stylesheets
|
|
3
|
+
import '@{{projectName}}/shared';
|
|
2
4
|
|
|
3
5
|
import * as React from 'react';
|
|
4
6
|
import ReactDOM from 'react-dom/client';
|
|
@@ -24,6 +24,21 @@ export default defineConfig({
|
|
|
24
24
|
],
|
|
25
25
|
],
|
|
26
26
|
plugins: [
|
|
27
|
+
// Idealyst StyleBuilder plugin - expands $iterator patterns
|
|
28
|
+
// Must run BEFORE react-native-unistyles/plugin
|
|
29
|
+
[
|
|
30
|
+
"@idealyst/theme/plugin",
|
|
31
|
+
{
|
|
32
|
+
autoProcessPaths: [
|
|
33
|
+
"@idealyst/components",
|
|
34
|
+
"@idealyst/navigation",
|
|
35
|
+
"@idealyst/theme",
|
|
36
|
+
],
|
|
37
|
+
// Path to your theme configuration file (relative to project root)
|
|
38
|
+
themePath: "../shared/src/unistyles.ts",
|
|
39
|
+
},
|
|
40
|
+
],
|
|
41
|
+
// Unistyles plugin - processes StyleSheet.create calls
|
|
27
42
|
[
|
|
28
43
|
"react-native-unistyles/plugin",
|
|
29
44
|
{
|
|
@@ -35,6 +50,7 @@ export default defineConfig({
|
|
|
35
50
|
],
|
|
36
51
|
},
|
|
37
52
|
],
|
|
53
|
+
// Web-specific component plugin
|
|
38
54
|
["@idealyst/components/plugin/web", { root: "src" }],
|
|
39
55
|
],
|
|
40
56
|
},
|
|
@@ -76,7 +92,7 @@ export default defineConfig({
|
|
|
76
92
|
"@idealyst/components",
|
|
77
93
|
"@idealyst/navigation",
|
|
78
94
|
"@idealyst/theme",
|
|
79
|
-
"@
|
|
95
|
+
"@{{projectName}}/shared",
|
|
80
96
|
],
|
|
81
97
|
esbuildOptions: {
|
|
82
98
|
loader: {
|