Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rename react native IDE to Radon IDE (the parts visible to the user) #550

Merged
merged 1 commit into from
Sep 18, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
45 changes: 23 additions & 22 deletions packages/vscode-extension/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "react-native-ide",
"displayName": "React Native IDE",
"displayName": "Radon IDE",
"description": "Extension turning VSCode into a full-featured IDE for React Native and Expo",
"publisher": "swmansion",
"categories": [
Expand Down Expand Up @@ -34,44 +34,44 @@
{
"command": "RNIDE.openDevMenu",
"title": "Open Dev Menu",
"category": "React Native IDE",
"category": "Radon IDE",
"enablement": "RNIDE.extensionIsActive"
},
{
"command": "RNIDE.closePanel",
"title": "Close IDE Panel",
"category": "React Native IDE",
"category": "Radon IDE",
"icon": "$(close)",
"enablement": "RNIDE.extensionIsActive"
},
{
"command": "RNIDE.openPanel",
"title": "Open IDE Panel",
"category": "React Native IDE",
"category": "Radon IDE",
"enablement": "RNIDE.extensionIsActive && !RNIDE.panelIsOpen"
},
{
"command": "RNIDE.showPanel",
"title": "Show IDE Panel",
"category": "React Native IDE",
"category": "Radon IDE",
"enablement": "RNIDE.extensionIsActive && RNIDE.panelIsOpen"
},
{
"command": "RNIDE.diagnose",
"title": "Diagnostics",
"category": "React Native IDE",
"category": "Radon IDE",
"enablement": "!RNIDE.extensionIsActive"
},
{
"command": "RNIDE.performBiometricAuthorization",
"title": "Perform Biometric Authorization ",
"category": "React Native IDE",
"category": "Radon IDE",
"enablement": "RNIDE.extensionIsActive"
},
{
"command": "RNIDE.performFailedBiometricAuthorization",
"title": "Perform Failed Biometric Authorization",
"category": "React Native IDE",
"category": "Radon IDE",
"enablement": "RNIDE.extensionIsActive"
}
],
Expand Down Expand Up @@ -99,9 +99,9 @@
}
],
"configuration": {
"title": "React Native IDE",
"title": "Radon IDE",
"properties": {
"ReactNativeIDE.panelLocation": {
"RadonIDE.panelLocation": {
"type": "string",
"scope": "window",
"default": "tab",
Expand All @@ -112,13 +112,13 @@
],
"description": "Controlls location of the IDE panel. Due to vscode API limitations, when secondary side panel is selected, you need to manually move the IDE panel to the secondary side panel. Changing this option closes and reopens the IDE."
},
"ReactNativeIDE.showDeviceFrame": {
"RadonIDE.showDeviceFrame": {
"type": "boolean",
"scope": "window",
"default": true,
"description": "Shows device frame in the IDE panel."
},
"ReactNativeIDE.inspectorExcludePattern": {
"RadonIDE.inspectorExcludePattern": {
"type": "string",
"scope": "window",
"default": null,
Expand All @@ -129,19 +129,19 @@
"viewsContainers": {
"activitybar": [
{
"id": "ReactNativeIDE",
"title": "React Native IDE",
"id": "RadonIDE",
"title": "Radon IDE",
"icon": "assets/logo.svg"
}
]
},
"views": {
"ReactNativeIDE": [
"RadonIDE": [
{
"type": "webview",
"id": "ReactNativeIDE.view",
"id": "RadonIDE.view",
"name": "",
"when": "config.ReactNativeIDE.panelLocation != 'tab' && !RNIDE.sidePanelIsClosed"
"when": "config.RadonIDE.panelLocation != 'tab' && !RNIDE.sidePanelIsClosed"
}
]
},
Expand All @@ -157,7 +157,7 @@
{
"command": "RNIDE.closePanel",
"group": "navigation",
"when": "RNIDE.extensionIsActive && RNIDE.panelIsOpen && view == ReactNativeIDE.view"
"when": "RNIDE.extensionIsActive && RNIDE.panelIsOpen && view == RadonIDE.view"
}
]
},
Expand Down Expand Up @@ -251,9 +251,9 @@
},
"initialConfigurations": [
{
"type": "react-native-ide",
"type": "radon-ide",
"request": "launch",
"name": "React Native IDE panel",
"name": "Radon IDE panel",
"ios": {
"configuration": "Debug"
},
Expand All @@ -265,7 +265,8 @@
},
{
"type": "react-native-ide",
"label": "React Native IDE",
"label": "Radon IDE",
"deprecated": "true",
"languages": [
"javascript",
"typescript",
Expand Down Expand Up @@ -337,7 +338,7 @@
{
"type": "react-native-ide",
"request": "launch",
"name": "React Native IDE panel",
"name": "Radon IDE panel",
"ios": {
"configuration": "Debug"
},
Expand Down
2 changes: 1 addition & 1 deletion packages/vscode-extension/src/Logger.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { window } from "vscode";

const outputChannel = window.createOutputChannel("React Native IDE", { log: true });
const outputChannel = window.createOutputChannel("Radon IDE", { log: true });

const logger = {
log(_message: string, ..._args: any[]) {},
Expand Down
4 changes: 2 additions & 2 deletions packages/vscode-extension/src/builders/BuildManager.ts
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ export class BuildManager {

let buildResult: BuildResult;
if (platform === DevicePlatform.Android) {
this.buildOutputChannel = window.createOutputChannel("React Native IDE (Android build)", {
this.buildOutputChannel = window.createOutputChannel("Radon IDE (Android build)", {
log: true,
});
buildResult = await buildAndroid(
Expand All @@ -68,7 +68,7 @@ export class BuildManager {
progressListener
);
} else {
this.buildOutputChannel = window.createOutputChannel("React Native IDE (iOS build)", {
this.buildOutputChannel = window.createOutputChannel("Radon IDE (iOS build)", {
log: true,
});
buildResult = await buildIos(
Expand Down
43 changes: 38 additions & 5 deletions packages/vscode-extension/src/extension.ts
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ export async function activate(context: ExtensionContext) {
handleUncaughtErrors();

if (Platform.OS !== "macos" && Platform.OS !== "windows") {
window.showErrorMessage("React Native IDE works only on macOS and Windows.", "Dismiss");
window.showErrorMessage("Radon IDE works only on macOS and Windows.", "Dismiss");
return;
}

Expand All @@ -74,6 +74,8 @@ export async function activate(context: ExtensionContext) {
enableDevModeLogging();
}

migrateOldConfiguration();

if (Platform.OS === "macos") {
try {
await fixMacosBinary(context);
Expand All @@ -88,7 +90,7 @@ export async function activate(context: ExtensionContext) {
await commands.executeCommand("setContext", "RNIDE.sidePanelIsClosed", false);

const panelLocation = workspace
.getConfiguration("ReactNativeIDE")
.getConfiguration("RadonIDE")
.get<PanelLocation>("panelLocation");

if (panelLocation !== "tab") {
Expand All @@ -100,7 +102,7 @@ export async function activate(context: ExtensionContext) {

async function closeIDEPanel(fileName?: string, lineNumber?: number) {
const panelLocation = workspace
.getConfiguration("ReactNativeIDE")
.getConfiguration("RadonIDE")
.get<PanelLocation>("panelLocation");

if (panelLocation !== "tab") {
Expand Down Expand Up @@ -230,7 +232,7 @@ export async function activate(context: ExtensionContext) {

context.subscriptions.push(
workspace.onDidChangeConfiguration((event: ConfigurationChangeEvent) => {
if (event.affectsConfiguration("ReactNativeIDE.panelLocation")) {
if (event.affectsConfiguration("RadonIDE.panelLocation")) {
showIDEPanel();
}
})
Expand Down Expand Up @@ -383,7 +385,7 @@ async function findAppRootFolder() {
window
.showErrorMessage(
`
React Native IDE couldn't find root application folder in this workspace.\n
Radon IDE couldn't find root application folder in this workspace.\n
Please make sure that the opened workspace contains a valid React Native or Expo project.\n
The way extension verifies the project is by looking for either: app.json, metro.config.js,
or node_modules/react-native folder. If your project structure is different, you can set the
Expand Down Expand Up @@ -430,6 +432,37 @@ async function diagnoseWorkspaceStructure() {
}
}

function migrateOldConfiguration() {
// At the moment of migration, all configuration settings are considered "global"
// in a sense that while they can potentially be set workspace-wide, they are not
// intended to, and hence we are only interested in migrating global settings.

// We ignore all potential errors that may occur in the process of migration.
// The current settings are not as critical to break user experience in case any
// of the method throws

try {
const oldConfiguration = workspace.getConfiguration("ReactNativeIDE");
const newConfigurations = workspace.getConfiguration("RadonIDE");
// iterate over all keys and set the in the new configuration
for (const key in oldConfiguration) {
try {
if (oldConfiguration.has(key)) {
const valueDetails = oldConfiguration.inspect(key);
if (valueDetails?.globalValue) {
newConfigurations.update(key, valueDetails.globalValue, true);
oldConfiguration.update(key, valueDetails.defaultValue, true);
}
}
} catch (e) {
Logger.error("Error when migrating parameter", key, e);
}
}
} catch (e) {
Logger.error("Error when migrating old configuration", e);
}
}

async function fixMacosBinary(context: ExtensionContext) {
// MacOS prevents binary files from being executed when downloaded from the internet.
// It requires notarization ticket to be available in the package where the binary was distributed
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ test("Shows error on Linux", async () => {

await getExtension().activate();

assert.ok(showErrorMessage.calledOnceWith("React Native IDE works only on macOS and Windows."));
assert.ok(showErrorMessage.calledOnceWith("Radon IDE works only on macOS and Windows."));
});

function stubLinuxPlatform() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -78,9 +78,9 @@ export class LaunchConfigController implements Disposable, LaunchConfig {

if (!RNIDEConfigurationExits) {
newConfigurations?.push({
type: "react-native-ide", // TODO: this should be renamed but will be visible to users
type: "radon-ide",
request: "launch",
name: "React Native IDE panel",
name: "Radon IDE panel",
...newLaunchConfig,
});
}
Expand Down
6 changes: 2 additions & 4 deletions packages/vscode-extension/src/panels/SidepanelViewProvider.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ import { WebviewController } from "./WebviewController";
import { Logger } from "../Logger";

export class SidePanelViewProvider implements WebviewViewProvider, Disposable {
public static readonly viewType = "ReactNativeIDE.view";
public static readonly viewType = "RadonIDE.view";
public static currentProvider: SidePanelViewProvider | undefined;
private _view: any = null;
public get view(): any {
Expand All @@ -40,9 +40,7 @@ export class SidePanelViewProvider implements WebviewViewProvider, Disposable {
public static showView(context: ExtensionContext, fileName?: string, lineNumber?: number) {
if (SidePanelViewProvider.currentProvider) {
commands.executeCommand(`${SidePanelViewProvider.viewType}.focus`);
if (
workspace.getConfiguration("ReactNativeIDE").get("panelLocation") === "secondary-side-panel"
) {
if (workspace.getConfiguration("RadonIDE").get("panelLocation") === "secondary-side-panel") {
commands.executeCommand("workbench.action.focusAuxiliaryBar");
}
} else {
Expand Down
6 changes: 3 additions & 3 deletions packages/vscode-extension/src/panels/Tabpanel.ts
Original file line number Diff line number Diff line change
Expand Up @@ -48,10 +48,10 @@ export class TabPanel implements Disposable {
this.webviewController = new WebviewController(this._panel.webview);

workspace.onDidChangeConfiguration((event: ConfigurationChangeEvent) => {
if (!event.affectsConfiguration("ReactNativeIDE")) {
if (!event.affectsConfiguration("RadonIDE")) {
return;
}
if (workspace.getConfiguration("ReactNativeIDE").get("panelLocation") !== "tab") {
if (workspace.getConfiguration("RadonIDE").get("panelLocation") !== "tab") {
this.dispose();
}
});
Expand All @@ -69,7 +69,7 @@ export class TabPanel implements Disposable {

const panel = window.createWebviewPanel(
"radon-ide-panel",
"React Native IDE",
"Radon IDE",
{ viewColumn: emptyGroup?.viewColumn || ViewColumn.Beside },
{
enableScripts: true,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,17 +14,17 @@ export class WorkspaceConfigController implements Disposable, WorkspaceConfig {
private configListener: Disposable | undefined;

constructor() {
const configuration = workspace.getConfiguration("ReactNativeIDE");
const configuration = workspace.getConfiguration("RadonIDE");
this.config = {
panelLocation: configuration.get<PanelLocation>("panelLocation")!,
showDeviceFrame: configuration.get<boolean>("showDeviceFrame")!,
};

this.configListener = workspace.onDidChangeConfiguration((event: ConfigurationChangeEvent) => {
if (!event.affectsConfiguration("ReactNativeIDE")) {
if (!event.affectsConfiguration("RadonIDE")) {
return;
}
const config = workspace.getConfiguration("ReactNativeIDE");
const config = workspace.getConfiguration("RadonIDE");
this.config = {
panelLocation: config.get<PanelLocation>("panelLocation")!,
showDeviceFrame: config.get<boolean>("showDeviceFrame")!,
Expand All @@ -38,7 +38,7 @@ export class WorkspaceConfigController implements Disposable, WorkspaceConfig {
}

async update<K extends keyof WorkspaceConfigProps>(key: K, value: WorkspaceConfigProps[K]) {
const configuration = workspace.getConfiguration("ReactNativeIDE");
const configuration = workspace.getConfiguration("RadonIDE");
if (configuration.inspect(key as string)?.workspaceValue) {
await configuration.update(key as string, value, false);
} else {
Expand Down
4 changes: 2 additions & 2 deletions packages/vscode-extension/src/project/project.ts
Original file line number Diff line number Diff line change
Expand Up @@ -356,7 +356,7 @@ export class Project
if (requestStack && inspectData?.stack) {
stack = inspectData.stack;
const inspectorExcludePattern = workspace
.getConfiguration("ReactNativeIDE")
.getConfiguration("RadonIDE")
.get("inspectorExcludePattern") as string | undefined;
const patterns = inspectorExcludePattern?.split(",").map((pattern) => pattern.trim());
function testInspectorExcludeGlobPattern(filename: string) {
Expand Down Expand Up @@ -478,7 +478,7 @@ export class Project
} catch (e) {
if (e instanceof DeviceAlreadyUsedError) {
window.showErrorMessage(
"This device is already used by other instance of React Native IDE.\nPlease select another device",
"This device is already used by other instance of Radon IDE.\nPlease select another device",
"Dismiss"
);
} else {
Expand Down
Loading