Переглянути джерело

Feature: example structure and system completed.

lfabl 1 тиждень тому
батько
коміт
9bf8f11aca

+ 1 - 1
example/mobile/index.js

@@ -1,4 +1,4 @@
-import App from "./index";
+import App from "./src/index";
 import {
     registerRootComponent
 } from "expo";

+ 28 - 6
example/mobile/metro.config.js

@@ -2,26 +2,48 @@
 /* eslint-disable */
 
 const {
-  getDefaultConfig
+    getDefaultConfig
 } = require("expo/metro-config");
 const path = require("path");
 
-const root = path.resolve(__dirname, "..");
+const root = path.resolve(__dirname, "../..");
 
-const nodeModulesPaths = [path.resolve(__dirname, "node_modules")];
+const nodeModulesPaths = [
+    path.resolve(__dirname, "node_modules")
+];
 
 const config = getDefaultConfig(__dirname);
 
 config.watchFolders = [root];
 
 config.resolver.extraNodeModules = {
-  "ncore-ui-kit-mobile": path.resolve(root, "src"),
-  "react": path.resolve(__dirname, "node_modules/react"),
-  "react-native": path.resolve(__dirname, "node_modules/react-native"),
+    "ncore-ui-kit-mobile": path.resolve(root, "src"),
+    "react": path.resolve(__dirname, "node_modules/react"),
+    "react-native": path.resolve(__dirname, "node_modules/react-native")
 };
 
 config.resolver.nodeModulesPaths = nodeModulesPaths;
 
 config.resolver.disableHierarchicalLookup = true;
 
+config.resolver.blockList = [
+    new RegExp(`${path.resolve(root, "example", "web", "node_modules").replace(/\\/g, "\\\\")}.*`),
+];
+
+config.resolver.resolveRequest = (context, moduleName, platform) => {
+    const forceLocal = ["react", "react-native"];
+    const match = forceLocal.find(
+        (pkg) => moduleName === pkg || moduleName.startsWith(`${pkg}/`)
+    );
+
+    if (match) {
+        const filePath = require.resolve(moduleName, {
+            paths: [__dirname],
+        });
+        return { filePath, type: "sourceFile" };
+    }
+
+    return context.resolveRequest(context, moduleName, platform);
+};
+
 module.exports = config;

+ 0 - 2
example/mobile/package.json

@@ -31,10 +31,8 @@
     },
     "private": true,
     "devDependencies": {
-        "@expo/webpack-config": "^19.0.1",
         "@react-native/metro-config": "0.84.1",
         "@types/react-native": "0.73.0",
-        "babel-preset-expo": "56.0.15",
         "react-native-builder-bob": "0.40.13",
         "react-native-monorepo-config": "0.3.3"
     }

+ 1 - 1
example/mobile/src/pages/home/index.tsx

@@ -27,11 +27,11 @@ import {
     StateCard,
     CheckBox,
     RowCard,
+    Sticker,
     Button,
     Dialog,
     Switch,
     Text,
-    Sticker,
     Chip
 } from "ncore-ui-kit-mobile";
 import {

+ 50 - 0
example/web/src/pages/home/index.tsx

@@ -23,12 +23,15 @@ import {
     BottomSheet,
     RadioButton,
     TextInput,
+    StateCard,
     SelectBox,
     CheckBox,
+    Sticker,
     RowCard,
     Button,
     Dialog,
     Switch,
+    Chip,
     Text
 } from "ncore-ui-kit-mobile";
 import {
@@ -366,6 +369,53 @@ const Home = () => {
             </Fragment>;
         }}
     >
+        <Chip
+            spreadBehaviour="free"
+            title="test"
+            isLoading={false}
+            isDisabled={false}
+            icon={({
+                customColor,
+                style,
+                color,
+                size
+            }) => <HomeIcon
+                color={customColor ? customColor : colors.content.icon[color]}
+                size={size}
+                style={style}
+            />}
+        />
+        <Sticker
+            spreadBehaviour="free"
+            title="test"
+            icon={({
+                style,
+                color,
+                size
+            }) => <HomeIcon
+                color={colors.content.icon[color]}
+                size={size}
+                style={style}
+            />}
+        />
+        <StateCard
+            title="Deneme"
+            subTitle="Bu bir alt metindir ve uzun olması gerekmektedir. Ne kadar uzun olursa o kadar iyidir."
+            icon={({
+                color,
+                size
+            }) => <HomeIcon
+                color={colors.content.icon[color]}
+                size={size}
+            />}
+            action={{
+                title: "Me Action",
+                size: "small",
+                onPress: () => {
+
+                }
+            }}
+        />
         <DateTimePicker
             minDate={moment().subtract(2, "months").toDate()}
             maxDate={moment().add(1, "months").toDate()}

+ 33 - 4
turbo.json

@@ -23,14 +23,14 @@
                 "example/mobile/android",
                 "!example/mobile/android/.gradle",
                 "!example/mobile/android/build",
-                "!example/mobile/android/app/build",
+                "!example/mobile/android/app/build"
+            ],
+            "outputs": [
                 "example/web/package.json",
                 "example/web/android",
                 "!example/web/android/.gradle",
                 "!example/web/android/build",
                 "!example/web/android/app/build"
-            ],
-            "outputs": [
             ]
         },
         "build:ios": {
@@ -49,13 +49,42 @@
                 "example/mobile/package.json",
                 "example/mobile/ios",
                 "!example/mobile/ios/build",
-                "!example/mobile/ios/Pods",
+                "!example/mobile/ios/Pods"
+            ],
+            "outputs": [
+                "example/web/package.json",
+                "example/web/ios",
+                "!example/web/ios/build",
+                "!example/web/ios/Pods"
+            ]
+        },
+        "build:web": {
+            "inputs": [
+                "package.json",
+                "android",
+                "!android/build",
+                "src/*.ts",
+                "src/*.tsx",
+                "example/web/package.json",
+                "example/web/android",
+                "!example/web/android/.gradle",
+                "!example/web/android/build",
+                "!example/web/android/app/build",
                 "example/web/package.json",
                 "example/web/ios",
                 "!example/web/ios/build",
                 "!example/web/ios/Pods"
             ],
             "outputs": [
+                "example/mobile/package.json",
+                "example/mobile/android",
+                "!example/mobile/android/.gradle",
+                "!example/mobile/android/build",
+                "!example/mobile/android/app/build",
+                "example/mobile/package.json",
+                "example/mobile/ios",
+                "!example/mobile/ios/build",
+                "!example/mobile/ios/Pods"
             ]
         }
     }

Різницю між файлами не показано, бо вона завелика
+ 87 - 553
yarn.lock


Деякі файли не було показано, через те що забагато файлів було змінено