Browse Source

Playground for windows (#5644)

Add script to start the packager on Windows
DamarXCV 4 years ago
parent
commit
764863f46b
3 changed files with 21 additions and 2 deletions
  1. 9
    2
      docs/docs/showcases.md
  2. 1
    0
      package.json
  3. 11
    0
      scripts/start-windows.js

+ 9
- 2
docs/docs/showcases.md View File

@@ -23,8 +23,15 @@ The playground example is a place where we showcase and test all features of rea
23 23
 git clone https://github.com/wix/react-native-navigation
24 24
 cd react-native-navigation
25 25
 npm install
26
+
27
+# for iOS:
26 28
 npm run xcode # Opens XCode
27
-npm start # Starts the packager
29
+npm start # Starts the packager on linux like systems
30
+
31
+# for Android:
32
+# 1. open Android Studio inside ".\playground"
33
+# 2. start a emulator
34
+npm run start-windows # Start the packager if you are on a windows system
28 35
 
29
-# Run the app in Simulator or on Device from within XCode
36
+# Run the app in Simulator or on Device from within XCode/Android Studio
30 37
 ```

+ 1
- 0
package.json View File

@@ -27,6 +27,7 @@
27 27
     "clean": "node ./scripts/clean",
28 28
     "prestart": "npm run build",
29 29
     "start": "node ./scripts/start",
30
+    "start-windows": "node ./scripts/start-windows",
30 31
     "pretest-js": "npm run build",
31 32
     "test-js": "node ./scripts/test-js",
32 33
     "test-unit-ios": "node ./scripts/test-unit --ios",

+ 11
- 0
scripts/start-windows.js View File

@@ -0,0 +1,11 @@
1
+const exec = require('shell-utils').exec;
2
+
3
+run();
4
+
5
+function run() {
6
+  // exec.killPort(8081);
7
+  // exec.execSync(`rd "./lib/dist" /Q/S`);
8
+  exec.execSync(`"./node_modules/.bin/tsc"`);
9
+  exec.execSync(`adb reverse tcp:8081 tcp:8081`);
10
+  exec.execSync(`node ./node_modules/react-native/local-cli/cli.js start`);
11
+}