Skip to content

Commit 37318db

Browse files
author
Jacky Liu
committed
<br>2020.2
<br>- add close tab button; <br>- fix RN 0.62 run issue; <br>- fix open new project in same window plugin not working issue;
1 parent abf60b2 commit 37318db

File tree

3 files changed

+18
-7
lines changed

3 files changed

+18
-7
lines changed

src/main/java/com/github/beansoft/reatnative/idea/utils/rn/RNVersionSwitcher.java

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88

99
public class RNVersionSwitcher {
1010
/**
11-
* If RN 0.60+, using yarn react-native.
11+
* If RN 0.60+, using npx react-native.
1212
* @param command
1313
* @param project
1414
* @return
@@ -17,7 +17,9 @@ public static final String rnVersionCommand(String command, Project project) {
1717
if(command != null && command.startsWith("react-native")) {
1818
String version = NPMParser.parseRNVersion(new File(RNPathUtil.getRNProjectPath(project), "package.json" ) );
1919
if(version != null && version.compareTo("0.60") >= 0) {
20-
command = command.replaceFirst("react-native", "yarn react-native");
20+
String preferredCommand = "npx";
21+
22+
command = command.replaceFirst("react-native", preferredCommand + " react-native");
2123
}
2224
}
2325

src/main/java/com/github/beansoft/reatnative/idea/views/ReactNativeConsole.java

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,12 @@ public class ReactNativeConsole implements FocusListener {
7878

7979
public static ReactNativeConsole getInstance(Project project) {
8080
// return project.getComponent(ReactNativeConsole.class);
81-
if(instance == null) {
81+
if (instance == null) {
82+
instance = new ReactNativeConsole(project);
83+
}
84+
85+
// Open another project in same window @since 2020.1.2
86+
if (instance.myProject != project) {
8287
instance = new ReactNativeConsole(project);
8388
}
8489
return instance;

src/main/resources/META-INF/plugin.xml

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
11
<idea-plugin>
22
<id>com.github.beansoft.reatnative.idea.free</id>
33
<name>React Native Console Free</name>
4-
<version>2020.1.0</version>
4+
<version>2020.2</version>
55
<vendor email="beansoft@126.com" url="https://github.com/beansoft/react-native-console">BeanSoft</vendor>
66

77
<description><![CDATA[
88
<h2>React Native Console Free</h2>
99
<p>a Free IDEA/WebStorm/Android Studio Plugin for run React Native commands</p>
10-
<p>This is the original FREE edition released at Apr 28, 2020, and will be maintained to run under latest IDEA/Android Studio.<br>
11-
FYI the <a href='https://plugins.jetbrains.com/plugin/9564-react-native-console'>Paid Version</a> which is under active development.<br>
10+
<p>This is the original FREE edition, and will be maintained to run under latest IDEA/Android Studio.<br>
11+
FYI the <a href='https://plugins.jetbrains.com/plugin/9564-react-native-console'>Paid Pro Version</a> which is under active development.<br>
1212
🆕FYI <b><a href="https://plugins.jetbrains.com/plugin/14718-flutter-storm/">FluterStorm</a></b> a
1313
WebStorm/PhpStorm/GoLand/PyCharm/CLion/RubyMine plugin for developing Flutter applications.<br>
1414
</p>
@@ -82,6 +82,10 @@ FYI the <a href='https://plugins.jetbrains.com/plugin/9564-react-native-console'
8282

8383
<change-notes><![CDATA[
8484
<br>
85+
<br>2020.2
86+
<br>- add close tab button;
87+
<br>- fix RN 0.62 run issue;
88+
<br>- fix open new project in same window plugin not working issue;
8589
<br>2020.1
8690
<br>- improve avd list command
8791
<br>2019.3.3
@@ -143,7 +147,7 @@ FYI the <a href='https://plugins.jetbrains.com/plugin/9564-react-native-console'
143147
<!-- 注意 id 中不能有空格! RNToolWindowFactory.java中的ID定义也一样!
144148
Warning: the tool window id should't cotains any space char, same ID value constraint in file RNToolWindowFactory.java
145149
-->
146-
<toolWindow id="RN Console Free" anchor="bottom" icon="/icons/ReactNative.png"
150+
<toolWindow id="RN Console Free" anchor="bottom" icon="/icons/ReactNative.png" canCloseContents="true"
147151
factoryClass="com.github.beansoft.reatnative.idea.views.RNToolWindowFactory" secondary="false"/>
148152

149153
<!-- ReactNative Run Configuration Type define TODO-->

0 commit comments

Comments
 (0)