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 emoji=true
all=true all=true
include_warnings=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 suppress_type=$FlowFixMe

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@@ -18,7 +18,7 @@ import {
FlexRow, FlexRow,
styled, styled,
Searchable, Searchable,
} from 'sonar'; } from 'flipper';
const {spawn} = require('child_process'); 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;

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@@ -7,7 +7,7 @@
import {Provider} from 'react-redux'; import {Provider} from 'react-redux';
import ReactDOM from 'react-dom'; import ReactDOM from 'react-dom';
import {ContextMenuProvider} from 'sonar'; import {ContextMenuProvider} from 'flipper';
import {precachedIcons} from './utils/icons.js'; import {precachedIcons} from './utils/icons.js';
import GK from './fb-stubs/GK.js'; import GK from './fb-stubs/GK.js';
import Logger from './fb-stubs/Logger.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 React from 'react';
import BaseDevice from './devices/BaseDevice.js'; import BaseDevice from './devices/BaseDevice.js';
import {AndroidDevice, IOSDevice} from 'sonar'; import {AndroidDevice, IOSDevice} from 'flipper';
const invariant = require('invariant'); const invariant = require('invariant');

View File

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

View File

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

View File

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

View File

@@ -7,7 +7,7 @@
*/ */
import type {Leak} from './index.js'; 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 * Creates an Element (for ElementsInspector) representing a single Object in

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@@ -32,9 +32,9 @@ module.exports = ({types: t}) => ({
node.callee.name === 'require' && node.callee.name === 'require' &&
args.length === 1 && args.length === 1 &&
t.isStringLiteral(args[0]) && 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 ( } else if (
node.callee.name === 'require' && node.callee.name === 'require' &&
args.length > 0 && args.length > 0 &&

View File

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