@idealyst/cli 1.0.15 → 1.0.17

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 CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@idealyst/cli",
3
- "version": "1.0.15",
3
+ "version": "1.0.17",
4
4
  "description": "CLI tool for generating Idealyst Framework projects",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",
@@ -0,0 +1,16 @@
1
+ import './App.css';
2
+ import { BrowserRouter } from 'react-router-dom';
3
+ import { ExampleStackRouter, } from '@idealyst/navigation/examples';
4
+ import { NavigatorProvider } from '@idealyst/navigation';
5
+
6
+ function App() {
7
+ return (
8
+ <div className="App">
9
+ <BrowserRouter>
10
+ <NavigatorProvider route={ExampleStackRouter} />
11
+ </BrowserRouter>
12
+ </div>
13
+ );
14
+ }
15
+
16
+ export default App;
@@ -0,0 +1,23 @@
1
+ import React from 'react';
2
+ import {
3
+ SafeAreaView,
4
+ } from 'react-native';
5
+
6
+ import { ExampleStackRouter } from '@idealyst/navigation/examples';
7
+ import { NavigatorProvider } from '@idealyst/navigation';
8
+
9
+
10
+ function App() {
11
+
12
+ const backgroundStyle = {
13
+ flex: 1,
14
+ };
15
+
16
+ return (
17
+ <SafeAreaView style={backgroundStyle}>
18
+ <NavigatorProvider route={ExampleStackRouter} />
19
+ </SafeAreaView>
20
+ );
21
+ }
22
+
23
+ export default App;
@@ -1,6 +1,10 @@
1
1
  module.exports = {
2
- presets: ['@react-native/babel-preset'],
2
+ presets: ['module:@react-native/babel-preset'],
3
3
  plugins: [
4
+ ['react-native-unistyles/plugin', {
5
+ root: 'src',
6
+ autoProcessPaths: ['@idealyst/components', '@idealyst/navigation', '@idealyst/theme'],
7
+ }],
4
8
  'react-native-reanimated/plugin',
5
9
  ],
6
- };
10
+ };
@@ -1,3 +1,5 @@
1
+ import '@idealyst/theme/unistyles';
2
+
1
3
  import { AppRegistry } from 'react-native';
2
4
  import App from './src/App';
3
5
 
@@ -1,11 +1,26 @@
1
- const { getDefaultConfig } = require('@react-native/metro-config');
1
+ const { getDefaultConfig, mergeConfig } = require('@react-native/metro-config');
2
+ const path = require('path');
2
3
 
3
- /**
4
- * Metro configuration
5
- * https://reactnative.dev/docs/metro
6
- *
7
- * @type {import('metro-config').MetroConfig}
8
- */
9
- const config = getDefaultConfig(__dirname);
4
+ const { wrapWithReanimatedMetroConfig } = require('react-native-reanimated/metro-config');
10
5
 
11
- module.exports = config;
6
+ const config = {
7
+ projectRoot: __dirname,
8
+ resolver: {
9
+ nodeModulesPaths: [
10
+ path.resolve(__dirname, 'node_modules'),
11
+ ],
12
+ // Important for Idealyst to use .native extensions for React Native (eg: @idealyst/components/src/Button/Button.native.tsx)
13
+ sourceExts: ['native.tsx', 'native.ts', 'tsx', 'ts', 'native.jsx', 'native.js', 'jsx', 'js', 'json'],
14
+ },
15
+ watchFolders: [
16
+ path.resolve(__dirname, 'src'),
17
+ // To support live updates when developing components in other workspaces, add the folders here. Make sure
18
+ // path.resolve(__dirname, '../shared/'),
19
+ ],
20
+ watcher: {
21
+ // When configuring custom components with .native extensions, make sure the watcher looks for them
22
+ additionalExts: ['native.tsx', 'native.ts', 'native.jsx', 'native.js'],
23
+ },
24
+ };
25
+
26
+ module.exports = wrapWithReanimatedMetroConfig(mergeConfig(getDefaultConfig(__dirname), config));
@@ -1,30 +0,0 @@
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 = () => {
13
- return (
14
- <Screen>
15
- <View style={{ flex: 1, justifyContent: 'center', alignItems: 'center' }}>
16
- <Text variant="h1">Welcome to {{projectName}}</Text>
17
- <Text variant="body">
18
- This is a React Native app built with the Idealyst Framework.
19
- </Text>
20
- <Button
21
- title="Get Started"
22
- onPress={() => console.log('Button pressed!')}
23
- style={{ marginTop: 20 }}
24
- />
25
- </View>
26
- </Screen>
27
- );
28
- };
29
-
30
- export default App;