rename ~/.sonar to ~/.flipper
Summary: renames config folder from sonar to flipper Reviewed By: jknoxville Differential Revision: D9541803 fbshipit-source-id: ef378c46fcbb14e76e99fb0743a99f24c536a434
This commit is contained in:
committed by
Facebook Github Bot
parent
2596e7d42a
commit
f7606c8d59
@@ -23,7 +23,7 @@ In order for the mobile app to know which certificates it can trust, it conducts
|
|||||||
This is achieved through the following steps:
|
This is achieved through the following steps:
|
||||||
* Desktop app starts an insecure server on port 8089.
|
* Desktop app starts an insecure server on port 8089.
|
||||||
* Mobile app connects to localhost:8089 and sends a Certificate Signing Request to the desktop app.
|
* Mobile app connects to localhost:8089 and sends a Certificate Signing Request to the desktop app.
|
||||||
* Desktop app uses it's private key (this is generated once and stored in ~/.sonar) to sign a client certificate for the mobile app.
|
* Desktop app uses it's private key (this is generated once and stored in ~/.flipper) to sign a client certificate for the mobile app.
|
||||||
* The desktop uses ADB (for android), or the mounted file system (for iOS simulators) to write the following files to the mobile app's private data partition
|
* The desktop uses ADB (for android), or the mounted file system (for iOS simulators) to write the following files to the mobile app's private data partition
|
||||||
* Server certificate that the mobile app can now trust.
|
* Server certificate that the mobile app can now trust.
|
||||||
* Client certificate for the mobile app to use going forward.
|
* Client certificate for the mobile app to use going forward.
|
||||||
|
|||||||
@@ -34,7 +34,7 @@ Learn more on how to use [Flipper's UI components](ui-components.md).
|
|||||||
|
|
||||||
### Dynamically loading plugins
|
### Dynamically loading plugins
|
||||||
|
|
||||||
Once a plugin is created, Flipper can load it from its folder. The path from where the plugins are loaded is specified in `~/.sonar/config.json`. Add the parent folder of your plugin to `pluginPaths` and start Flipper.
|
Once a plugin is created, Flipper can load it from its folder. The path from where the plugins are loaded is specified in `~/.flipper/config.json`. Add the parent folder of your plugin to `pluginPaths` and start Flipper.
|
||||||
|
|
||||||
### npm dependencies
|
### npm dependencies
|
||||||
|
|
||||||
|
|||||||
@@ -23,7 +23,7 @@ const {spawn} = require('child_process');
|
|||||||
const path = require('path');
|
const path = require('path');
|
||||||
const {app, shell} = require('electron').remote;
|
const {app, shell} = require('electron').remote;
|
||||||
|
|
||||||
const SONAR_PLUGIN_PATH = path.join(app.getPath('home'), '.sonar');
|
const SONAR_PLUGIN_PATH = path.join(app.getPath('home'), '.flipper');
|
||||||
const DYNAMIC_PLUGINS = JSON.parse(window.process.env.PLUGINS || '[]');
|
const DYNAMIC_PLUGINS = JSON.parse(window.process.env.PLUGINS || '[]');
|
||||||
|
|
||||||
type NPMModule = {
|
type NPMModule = {
|
||||||
|
|||||||
@@ -486,5 +486,5 @@ export default class CertificateProvider {
|
|||||||
}
|
}
|
||||||
|
|
||||||
function getFilePath(fileName: string): string {
|
function getFilePath(fileName: string): string {
|
||||||
return path.resolve(os.homedir(), '.sonar', 'certs', fileName);
|
return path.resolve(os.homedir(), '.flipper', 'certs', fileName);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -69,7 +69,7 @@ const createModuleIdFactory = () => filePath => {
|
|||||||
return id;
|
return id;
|
||||||
};
|
};
|
||||||
function pluginEntryPoints(additionalPaths = []) {
|
function pluginEntryPoints(additionalPaths = []) {
|
||||||
const defaultPluginPath = path.join(HOME_DIR, '.sonar', 'node_modules');
|
const defaultPluginPath = path.join(HOME_DIR, '.flipper', 'node_modules');
|
||||||
const entryPoints = entryPointForPluginFolder(defaultPluginPath);
|
const entryPoints = entryPointForPluginFolder(defaultPluginPath);
|
||||||
if (typeof additionalPaths === 'string') {
|
if (typeof additionalPaths === 'string') {
|
||||||
additionalPaths = [additionalPaths];
|
additionalPaths = [additionalPaths];
|
||||||
|
|||||||
@@ -38,13 +38,19 @@ if (process.platform === 'darwin') {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// ensure .sonar folder and config exist
|
// ensure .flipper folder and config exist
|
||||||
const sonarDir = path.join(os.homedir(), '.sonar');
|
const sonarDir = path.join(os.homedir(), '.sonar');
|
||||||
if (!fs.existsSync(sonarDir)) {
|
const flipperDir = path.join(os.homedir(), '.flipper');
|
||||||
|
if (fs.existsSync(flipperDir)) {
|
||||||
|
// nothing to do
|
||||||
|
} else if (fs.existsSync(sonarDir)) {
|
||||||
|
// move .sonar to .flipper
|
||||||
|
fs.renameSync(sonarDir, flipperDir);
|
||||||
|
} else {
|
||||||
fs.mkdirSync(sonarDir);
|
fs.mkdirSync(sonarDir);
|
||||||
}
|
}
|
||||||
|
|
||||||
const configPath = path.join(sonarDir, 'config.json');
|
const configPath = path.join(flipperDir, 'config.json');
|
||||||
let config = {pluginPaths: [], disabledPlugins: [], lastWindowPosition: {}};
|
let config = {pluginPaths: [], disabledPlugins: [], lastWindowPosition: {}};
|
||||||
|
|
||||||
try {
|
try {
|
||||||
@@ -88,7 +94,7 @@ compilePlugins(
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
pluginPaths,
|
pluginPaths,
|
||||||
path.join(require('os').homedir(), '.sonar', 'plugins'),
|
path.join(flipperDir, 'plugins'),
|
||||||
).then(dynamicPlugins => {
|
).then(dynamicPlugins => {
|
||||||
process.env.PLUGINS = JSON.stringify(dynamicPlugins);
|
process.env.PLUGINS = JSON.stringify(dynamicPlugins);
|
||||||
pluginsCompiled = true;
|
pluginsCompiled = true;
|
||||||
|
|||||||
Reference in New Issue
Block a user