Rename package to 'flipper'

Summary:
- rename package `'sonar'` > `'flipper'`
- rename package `'sonar-static'` > `'flipper-static'`
- rename package export from `window.Sonar` to `window.Flipper`

Reviewed By: passy

Differential Revision: D9851181

fbshipit-source-id: 34d4447c3b287496b3d20ddb54471ce777ec74e1
This commit is contained in:
Daniel Büchele
2018-09-18 06:38:14 -07:00
committed by Facebook Github Bot
parent 2e2924c979
commit 66e77075be
45 changed files with 61 additions and 61 deletions

View File

@@ -17,7 +17,7 @@ module.use_strict=true
emoji=true
all=true
include_warnings=true
module.name_mapper='sonar' -> '<PROJECT_ROOT>/src/index.js'
module.name_mapper='flipper' -> '<PROJECT_ROOT>/src/index.js'
suppress_type=$FlowFixMe

View File

@@ -1,5 +1,5 @@
{
"name": "sonar",
"name": "flipper",
"private": true,
"version": "0.7.2",
"versionDate": "2018-4-12",

View File

@@ -6,7 +6,7 @@
*/
import React from 'react';
import {FlexColumn, FlexRow} from 'sonar';
import {FlexColumn, FlexRow} from 'flipper';
import {connect} from 'react-redux';
import {toggleBugDialogVisible} from './reducers/application.js';
import WelcomeScreen from './chrome/WelcomeScreen.js';

View File

@@ -18,7 +18,7 @@ import {
FlexRow,
colors,
styled,
} from 'sonar';
} from 'flipper';
import React from 'react';
import {connect} from 'react-redux';
import {setPluginState} from './reducers/pluginStates.js';

View File

@@ -13,7 +13,7 @@ import {
Glyph,
Component,
styled,
} from 'sonar';
} from 'flipper';
import {remote} from 'electron';
import isProduction from '../utils/isProduction.js';
import config from '../fb-stubs/config.js';

View File

@@ -18,7 +18,7 @@ import {
Text,
FlexCenter,
styled,
} from 'sonar';
} from 'flipper';
const Container = styled(FlexColumn)({
padding: 10,

View File

@@ -5,7 +5,7 @@
* @format
*/
import {Component, Button} from 'sonar';
import {Component, Button} from 'flipper';
import {connect} from 'react-redux';
import {spawn} from 'child_process';
import {selectDevice, preferDevice} from '../reducers/connections.js';

View File

@@ -14,7 +14,7 @@ import {
Popover,
styled,
colors,
} from 'sonar';
} from 'flipper';
const Heading = styled(Text)({
display: 'block',

View File

@@ -5,7 +5,7 @@
* @format
*/
import {styled, colors} from 'sonar';
import {styled, colors} from 'flipper';
const ErrorBarContainer = styled('div')({
backgroundColor: colors.cherry,

View File

@@ -22,7 +22,7 @@ import {
Text,
Glyph,
styled,
} from 'sonar';
} from 'flipper';
import React from 'react';
import {devicePlugins} from '../device-plugins/index.js';
import plugins from '../plugins/index.js';

View File

@@ -18,7 +18,7 @@ import {
FlexRow,
styled,
Searchable,
} from 'sonar';
} from 'flipper';
const {spawn} = require('child_process');
const path = require('path');
const {app, shell} = require('electron').remote;

View File

@@ -14,7 +14,7 @@ import {
Button,
styled,
colors,
} from 'sonar';
} from 'flipper';
const Anchor = styled('img')({
zIndex: 6,

View File

@@ -5,7 +5,7 @@
* @format
*/
import {Button, ButtonGroup, Component} from 'sonar';
import {Button, ButtonGroup, Component} from 'flipper';
import {connect} from 'react-redux';
import AndroidDevice from '../devices/AndroidDevice';
import IOSDevice from '../devices/IOSDevice';

View File

@@ -7,7 +7,7 @@
import React from 'react';
import ReactDOM from 'react-dom';
import {Sidebar} from 'sonar';
import {Sidebar} from 'flipper';
import {connect} from 'react-redux';
import {toggleRightSidebarAvailable} from '../reducers/application.js';

View File

@@ -14,7 +14,7 @@ import {
Spacer,
GK,
styled,
} from 'sonar';
} from 'flipper';
import {connect} from 'react-redux';
import {
toggleBugDialogVisible,

View File

@@ -14,7 +14,7 @@ import {
Glyph,
colors,
brandColors,
} from 'sonar';
} from 'flipper';
import isProduction from '../utils/isProduction.js';
import {shell, remote} from 'electron';

View File

@@ -10,11 +10,11 @@ import type {
TableRows,
TableColumnSizes,
TableColumns,
} from 'sonar';
import {FlexColumn, Button, SonarSidebar} from 'sonar';
} from 'flipper';
import {FlexColumn, Button, SonarSidebar} from 'flipper';
import textContent from './utils/textContent.js';
import createPaste from './utils/createPaste.js';
import {FlipperPlugin, SearchableTable} from 'sonar';
import {FlipperPlugin, SearchableTable} from 'flipper';
type ID = string;

View File

@@ -5,7 +5,7 @@
* @format
*/
import {FlipperDevicePlugin} from 'sonar';
import {FlipperDevicePlugin} from 'flipper';
var adb = require('adbkit-fb');
import {
@@ -16,7 +16,7 @@ import {
Text,
ManagedTable,
colors,
} from 'sonar';
} from 'flipper';
type ADBClient = any;
type AndroidDevice = {

View File

@@ -7,7 +7,7 @@
import type {FlipperDevicePlugin} from '../plugin.js';
import {GK} from 'sonar';
import {GK} from 'flipper';
import logs from './logs/index.js';
import cpu from './cpu/index.js';

View File

@@ -16,7 +16,7 @@ import {
Button,
colors,
styled,
} from 'sonar';
} from 'flipper';
export type Counter = {
expression: RegExp,

View File

@@ -10,7 +10,7 @@ import type {
TableColumnOrder,
TableColumnSizes,
TableColumns,
} from 'sonar';
} from 'flipper';
import type {Counter} from './LogWatcher.js';
import type {DeviceLogEntry} from '../../devices/BaseDevice.js';
import type {Props as PluginProps} from '../../plugin';
@@ -28,7 +28,7 @@ import {
FlipperDevicePlugin,
SearchableTable,
styled,
} from 'sonar';
} from 'flipper';
import textContent from '../../utils/textContent.js';
import createPaste from '../../utils/createPaste.js';
import LogWatcher from './LogWatcher';

View File

@@ -6,7 +6,7 @@
*/
import type stream from 'stream';
import {FlipperDevicePlugin} from 'sonar';
import {FlipperDevicePlugin} from 'flipper';
export type LogLevel =
| 'unknown'

View File

@@ -7,7 +7,7 @@
import {Provider} from 'react-redux';
import ReactDOM from 'react-dom';
import {ContextMenuProvider} from 'sonar';
import {ContextMenuProvider} from 'flipper';
import {precachedIcons} from './utils/icons.js';
import GK from './fb-stubs/GK.js';
import Logger from './fb-stubs/Logger.js';

View File

@@ -12,7 +12,7 @@ import type Client from './Client.js';
import React from 'react';
import BaseDevice from './devices/BaseDevice.js';
import {AndroidDevice, IOSDevice} from 'sonar';
import {AndroidDevice, IOSDevice} from 'flipper';
const invariant = require('invariant');

View File

@@ -5,10 +5,10 @@
* @format
*/
import {GK} from 'sonar';
import {GK} from 'flipper';
import React from 'react';
import ReactDOM from 'react-dom';
import * as Sonar from 'sonar';
import * as Flipper from 'flipper';
import {FlipperPlugin, FlipperBasePlugin} from '../plugin.js';
import {remote} from 'electron';
@@ -19,7 +19,7 @@ const remoteEnv = remote.process.env;
// expose Sonar and exact globally for dynamically loaded plugins
window.React = React;
window.ReactDOM = ReactDOM;
window.Sonar = Sonar;
window.Flipper = Flipper;
const addIfNotAdded = plugin => {
if (!plugins.has(plugin.name)) {

View File

@@ -5,7 +5,7 @@
* @format
*/
import type {ElementID, Element, ElementSearchResultSet} from 'sonar';
import type {ElementID, Element, ElementSearchResultSet} from 'flipper';
import {
colors,
Glyph,
@@ -25,7 +25,7 @@ import {
VerticalRule,
Popover,
ToggleButton,
} from 'sonar';
} from 'flipper';
import type {TrackType} from '../../fb-stubs/Logger.js';
import SidebarExtensions from '../../fb-stubs/LayoutInspectorSidebarExtensions.js';

View File

@@ -17,8 +17,8 @@ import {
FlipperPlugin,
Button,
styled,
} from 'sonar';
import type {ElementID, Element} from 'sonar';
} from 'flipper';
import type {ElementID, Element} from 'flipper';
import {processLeaks} from './processLeakString';
type State = {

View File

@@ -7,7 +7,7 @@
*/
import type {Leak} from './index.js';
import type {Element} from 'sonar';
import type {Element} from 'flipper';
/**
* Creates an Element (for ElementsInspector) representing a single Object in

View File

@@ -18,7 +18,7 @@ import {
Panel,
styled,
colors,
} from 'sonar';
} from 'flipper';
import {getHeaderValue} from './index.js';
import querystring from 'querystring';

View File

@@ -5,7 +5,7 @@
* @format
*/
import type {TableHighlightedRows, TableRows, TableBodyRow} from 'sonar';
import type {TableHighlightedRows, TableRows, TableBodyRow} from 'flipper';
import {
ContextMenu,
@@ -17,8 +17,8 @@ import {
PureComponent,
SonarSidebar,
styled,
} from 'sonar';
import {FlipperPlugin, SearchableTable} from 'sonar';
} from 'flipper';
import {FlipperPlugin, SearchableTable} from 'flipper';
import RequestDetails from './RequestDetails.js';
import {URL} from 'url';

View File

@@ -5,9 +5,9 @@
* @format
*/
import {FlipperPlugin} from 'sonar';
import {FlexColumn} from 'sonar';
import {ButtonGroup, Button, styled, colors} from 'sonar';
import {FlipperPlugin} from 'flipper';
import {FlexColumn} from 'flipper';
import {ButtonGroup, Button, styled, colors} from 'flipper';
export type Sandbox = {
name: string,

View File

@@ -14,8 +14,8 @@ import {
FlexRow,
DataInspector,
styled,
} from 'sonar';
import {FlipperPlugin} from 'sonar';
} from 'flipper';
import {FlipperPlugin} from 'flipper';
const {clone} = require('lodash');

View File

@@ -215,7 +215,7 @@ type State = {
* **Usage**
*
* ```jsx
* import {Button} from 'sonar';
* import {Button} from 'flipper';
* <Button onClick={handler}>Click me</Button>
* ```
*

View File

@@ -13,7 +13,7 @@ import {
maybeSnapTop,
SNAP_SIZE,
} from '../../utils/snap.js';
import {styled} from 'sonar';
import {styled} from 'flipper';
const invariant = require('invariant');
const React = require('react');

View File

@@ -48,7 +48,7 @@ type Props = {
* **Usage**
*
* ```jsx
* import {ToggleButton} from 'sonar';
* import {ToggleButton} from 'flipper';
* <ToggleButton onClick={handler} toggled={boolean}/>
* ```
*/

View File

@@ -16,7 +16,7 @@ import {
View,
} from '../index';
import styled from '../styled/index';
import type {TableBodyRow, TableRows} from 'sonar';
import type {TableBodyRow, TableRows} from 'flipper';
import type {PluginClient} from '../../plugin';
type ValueWithType = {|

View File

@@ -8,7 +8,7 @@
import {Component} from 'react';
import FlexRow from '../FlexRow.js';
import {Elements} from './elements.js';
import type {ContextMenuExtension} from 'sonar';
import type {ContextMenuExtension} from 'flipper';
export type ElementID = string;

View File

@@ -12,7 +12,7 @@ import Panel from '../Panel.js';
import ManagedDataInspector from '../data-inspector/ManagedDataInspector.js';
import {Component} from 'react';
import {Console} from '../console';
import {GK} from 'sonar';
import {GK} from 'flipper';
const deepEqual = require('deep-equal');

View File

@@ -16,7 +16,7 @@ import {
colors,
brandColors,
PureComponent,
} from 'sonar';
} from 'flipper';
const Containter = styled(FlexColumn)({
fontSize: 17,

View File

@@ -5,7 +5,7 @@
* @format
*/
import type {Filter} from 'sonar';
import type {Filter} from 'flipper';
import {PureComponent} from 'react';
import Text from '../Text.js';
import styled from '../../styled/index.js';

View File

@@ -5,7 +5,7 @@
* @format
*/
import type {Filter} from 'sonar';
import type {Filter} from 'flipper';
import {PureComponent} from 'react';
import Toolbar from '../Toolbar.js';
import FlexRow from '../FlexRow.js';

View File

@@ -5,7 +5,7 @@
* @format
*/
import type {ManagedTableProps, TableBodyRow, Filter} from 'sonar';
import type {ManagedTableProps, TableBodyRow, Filter} from 'flipper';
import type {SearchableProps} from './Searchable.js';
import {PureComponent} from 'react';
import ManagedTable from '../table/ManagedTable.js';

View File

@@ -1,5 +1,5 @@
{
"name": "sonar-static",
"name": "flipper-static",
"version": "1.0.0",
"main": "index.js",
"license": "MIT",

View File

@@ -32,9 +32,9 @@ module.exports = ({types: t}) => ({
node.callee.name === 'require' &&
args.length === 1 &&
t.isStringLiteral(args[0]) &&
args[0].value === 'sonar'
args[0].value === 'flipper'
) {
path.replaceWith(t.identifier('window.Sonar'));
path.replaceWith(t.identifier('window.Flipper'));
} else if (
node.callee.name === 'require' &&
args.length > 0 &&

View File

@@ -12,7 +12,7 @@ const metro = require('metro');
exports.transform = function({filename, options, src}) {
const presets = [require('../node_modules/babel-preset-react')];
const isSonarPlugin = !__dirname.startsWith(options.projectRoot);
const isPlugin = !__dirname.startsWith(options.projectRoot);
let ast = babylon.parse(src, {
filename,
@@ -29,8 +29,8 @@ exports.transform = function({filename, options, src}) {
require('./fb-stubs.js'),
require('./dynamic-requires.js'),
];
if (isSonarPlugin) {
plugins.push(require('./sonar-requires.js'));
if (isPlugin) {
plugins.push(require('./flipper-requires.js'));
} else {
plugins.push(require('./import-react.js'));
}