@idealyst/cli 1.0.16 → 1.0.18
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/templates/App.tsx +16 -0
- package/templates/native/App.tsx +23 -0
- package/templates/native/babel.config.js +0 -2
- package/templates/native/index.js +3 -1
- package/templates/native/metro.config.js +0 -7
- package/templates/web/src/App.tsx +3 -13
- package/templates/web/vite.config.ts +0 -1
- package/templates/native/src/App.tsx +0 -30
package/package.json
CHANGED
|
@@ -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,5 +1,3 @@
|
|
|
1
|
-
module.exports = wrapWithReanimatedMetroConfig(mergeConfig(getDefaultConfig(__dirname), config));
|
|
2
|
-
|
|
3
1
|
const { getDefaultConfig, mergeConfig } = require('@react-native/metro-config');
|
|
4
2
|
const path = require('path');
|
|
5
3
|
|
|
@@ -14,11 +12,6 @@ const config = {
|
|
|
14
12
|
// Important for Idealyst to use .native extensions for React Native (eg: @idealyst/components/src/Button/Button.native.tsx)
|
|
15
13
|
sourceExts: ['native.tsx', 'native.ts', 'tsx', 'ts', 'native.jsx', 'native.js', 'jsx', 'js', 'json'],
|
|
16
14
|
},
|
|
17
|
-
watchFolders: [
|
|
18
|
-
path.resolve(__dirname, 'src'),
|
|
19
|
-
// To support live updates when developing components in other workspaces, add the folders here. Make sure
|
|
20
|
-
// path.resolve(__dirname, '../shared/'),
|
|
21
|
-
],
|
|
22
15
|
watcher: {
|
|
23
16
|
// When configuring custom components with .native extensions, make sure the watcher looks for them
|
|
24
17
|
additionalExts: ['native.tsx', 'native.ts', 'native.jsx', 'native.js'],
|
|
@@ -1,19 +1,9 @@
|
|
|
1
|
-
import
|
|
2
|
-
import {
|
|
1
|
+
import { NavigatorProvider } from '@idealyst/navigation';
|
|
2
|
+
import { ExampleStackRouter } from '@idealyst/navigation/examples';
|
|
3
3
|
|
|
4
4
|
const App = () => {
|
|
5
5
|
return (
|
|
6
|
-
<
|
|
7
|
-
<Text variant="h1">Welcome to {{projectName}}</Text>
|
|
8
|
-
<Text variant="body" style={{ marginTop: 20, textAlign: 'center' }}>
|
|
9
|
-
This is a React web application built with the Idealyst Framework.
|
|
10
|
-
</Text>
|
|
11
|
-
<Button
|
|
12
|
-
title="Get Started"
|
|
13
|
-
onPress={() => console.log('Button pressed!')}
|
|
14
|
-
style={{ marginTop: 20 }}
|
|
15
|
-
/>
|
|
16
|
-
</View>
|
|
6
|
+
<NavigatorProvider route={ExampleStackRouter} />
|
|
17
7
|
);
|
|
18
8
|
};
|
|
19
9
|
|
|
@@ -20,7 +20,6 @@ export default defineConfig({
|
|
|
20
20
|
plugins: [
|
|
21
21
|
['react-native-unistyles/plugin', {
|
|
22
22
|
root: 'src',
|
|
23
|
-
debug: true,
|
|
24
23
|
autoProcessPaths: ['@idealyst/components', '@idealyst/navigation', '@idealyst/theme'],
|
|
25
24
|
}],
|
|
26
25
|
['@idealyst/components/plugin/web', { root: 'src' }]
|
|
@@ -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;
|