flipper-server-companion
Advanced tools
Comparing version 0.187.1 to 0.188.0
@@ -0,1 +1,9 @@ | ||
/** | ||
* Copyright (c) Meta Platforms, Inc. and affiliates. | ||
* | ||
* This source code is licensed under the MIT license found in the | ||
* LICENSE file in the root directory of this source tree. | ||
* | ||
* @format | ||
*/ | ||
import { FlipperServer, Logger, FlipperCompanionCommands, FlipperCompanionEvents } from 'flipper-common'; | ||
@@ -9,2 +17,14 @@ import { BaseDevice } from 'flipper-frontend-core'; | ||
private readonly env; | ||
/** | ||
* A map of headless clients. Once a client is started, you can start plugins for the client. | ||
* Headless client manages a connection from desktop to Flipper server. Device client manages a connection from a device to Flipper server. | ||
* | ||
* --- YOUR DESKTOP --- --------- Node.js process ---------------------------------- --- Your iPhone ----- | ||
* | --------------- | | --- Flipper Server Companion --- ------------------ | | | | ||
* | | Flipper CLI | | <-- WebSocket conection --> | | ------------------- | | | | | ----------------- | | ||
* | --------------- | | | | Headless client | | <--> | Flipper Server | | <-- WebSocker conection --> | | Device client | | | ||
* -------------------- | | ------------------- | | | | | ----------------- | | ||
* | -------------------------------- ------------------ | | | | ||
* ------------------------------------------------------------ --------------------| | ||
*/ | ||
private readonly clients; | ||
@@ -11,0 +31,0 @@ private readonly devices; |
"use strict"; | ||
/** | ||
* Copyright (c) Meta Platforms, Inc. and affiliates. | ||
* | ||
* This source code is licensed under the MIT license found in the | ||
* LICENSE file in the root directory of this source tree. | ||
* | ||
* @format | ||
*/ | ||
var __importDefault = (this && this.__importDefault) || function (mod) { | ||
@@ -21,2 +29,14 @@ return (mod && mod.__esModule) ? mod : { "default": mod }; | ||
this.env = env; | ||
/** | ||
* A map of headless clients. Once a client is started, you can start plugins for the client. | ||
* Headless client manages a connection from desktop to Flipper server. Device client manages a connection from a device to Flipper server. | ||
* | ||
* --- YOUR DESKTOP --- --------- Node.js process ---------------------------------- --- Your iPhone ----- | ||
* | --------------- | | --- Flipper Server Companion --- ------------------ | | | | ||
* | | Flipper CLI | | <-- WebSocket conection --> | | ------------------- | | | | | ----------------- | | ||
* | --------------- | | | | Headless client | | <--> | Flipper Server | | <-- WebSocker conection --> | | Device client | | | ||
* -------------------- | | ------------------- | | | | | ----------------- | | ||
* | -------------------------------- ------------------ | | | | ||
* ------------------------------------------------------------ --------------------| | ||
*/ | ||
this.clients = new Map(); | ||
@@ -23,0 +43,0 @@ this.devices = new Map(); |
@@ -0,2 +1,10 @@ | ||
/** | ||
* Copyright (c) Meta Platforms, Inc. and affiliates. | ||
* | ||
* This source code is licensed under the MIT license found in the | ||
* LICENSE file in the root directory of this source tree. | ||
* | ||
* @format | ||
*/ | ||
export declare const css: () => () => {}; | ||
//# sourceMappingURL=fakeEmotionCss.d.ts.map |
"use strict"; | ||
/** | ||
* Copyright (c) Meta Platforms, Inc. and affiliates. | ||
* | ||
* This source code is licensed under the MIT license found in the | ||
* LICENSE file in the root directory of this source tree. | ||
* | ||
* @format | ||
*/ | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
@@ -3,0 +11,0 @@ exports.css = void 0; |
@@ -0,2 +1,10 @@ | ||
/** | ||
* Copyright (c) Meta Platforms, Inc. and affiliates. | ||
* | ||
* This source code is licensed under the MIT license found in the | ||
* LICENSE file in the root directory of this source tree. | ||
* | ||
* @format | ||
*/ | ||
export declare const styled: () => () => {}; | ||
//# sourceMappingURL=fakeEmotionStyled.d.ts.map |
"use strict"; | ||
/** | ||
* Copyright (c) Meta Platforms, Inc. and affiliates. | ||
* | ||
* This source code is licensed under the MIT license found in the | ||
* LICENSE file in the root directory of this source tree. | ||
* | ||
* @format | ||
*/ | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
@@ -3,0 +11,0 @@ exports.styled = void 0; |
@@ -0,3 +1,11 @@ | ||
/** | ||
* Copyright (c) Meta Platforms, Inc. and affiliates. | ||
* | ||
* This source code is licensed under the MIT license found in the | ||
* LICENSE file in the root directory of this source tree. | ||
* | ||
* @format | ||
*/ | ||
export * from './fakeEmotionStyled'; | ||
export declare const Layout: {}; | ||
//# sourceMappingURL=fakeLegacyExports.d.ts.map |
"use strict"; | ||
/** | ||
* Copyright (c) Meta Platforms, Inc. and affiliates. | ||
* | ||
* This source code is licensed under the MIT license found in the | ||
* LICENSE file in the root directory of this source tree. | ||
* | ||
* @format | ||
*/ | ||
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { | ||
@@ -3,0 +11,0 @@ if (k2 === undefined) k2 = k; |
@@ -0,1 +1,9 @@ | ||
/** | ||
* Copyright (c) Meta Platforms, Inc. and affiliates. | ||
* | ||
* This source code is licensed under the MIT license found in the | ||
* LICENSE file in the root directory of this source tree. | ||
* | ||
* @format | ||
*/ | ||
export declare class PureComponent { | ||
@@ -2,0 +10,0 @@ } |
"use strict"; | ||
/** | ||
* Copyright (c) Meta Platforms, Inc. and affiliates. | ||
* | ||
* This source code is licensed under the MIT license found in the | ||
* LICENSE file in the root directory of this source tree. | ||
* | ||
* @format | ||
*/ | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
@@ -3,0 +11,0 @@ exports.Component = exports.PureComponent = void 0; |
@@ -0,2 +1,10 @@ | ||
/** | ||
* Copyright (c) Meta Platforms, Inc. and affiliates. | ||
* | ||
* This source code is licensed under the MIT license found in the | ||
* LICENSE file in the root directory of this source tree. | ||
* | ||
* @format | ||
*/ | ||
export declare const unstable_batchedUpdates: (cb: () => void) => void; | ||
//# sourceMappingURL=fakeReactDOM.d.ts.map |
"use strict"; | ||
/** | ||
* Copyright (c) Meta Platforms, Inc. and affiliates. | ||
* | ||
* This source code is licensed under the MIT license found in the | ||
* LICENSE file in the root directory of this source tree. | ||
* | ||
* @format | ||
*/ | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
@@ -3,0 +11,0 @@ exports.unstable_batchedUpdates = void 0; |
@@ -0,1 +1,9 @@ | ||
/** | ||
* Copyright (c) Meta Platforms, Inc. and affiliates. | ||
* | ||
* This source code is licensed under the MIT license found in the | ||
* LICENSE file in the root directory of this source tree. | ||
* | ||
* @format | ||
*/ | ||
import { ClientQuery, FlipperServer, Logger } from 'flipper-common'; | ||
@@ -2,0 +10,0 @@ import { AbstractClient, ClientConnection, BaseDevice } from 'flipper-frontend-core'; |
"use strict"; | ||
/** | ||
* Copyright (c) Meta Platforms, Inc. and affiliates. | ||
* | ||
* This source code is licensed under the MIT license found in the | ||
* LICENSE file in the root directory of this source tree. | ||
* | ||
* @format | ||
*/ | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
@@ -11,4 +19,6 @@ exports.HeadlessClient = void 0; | ||
isBackgroundPlugin(_pluginId) { | ||
// In headless context we treat every plugin as a non-background one because we do not want to start anything automatically to preseve resources | ||
return false; | ||
} | ||
// Headless client never starts plugins automaticaly to preserve server resources | ||
shouldConnectAsBackgroundPlugin() { | ||
@@ -15,0 +25,0 @@ return false; |
@@ -0,1 +1,9 @@ | ||
/** | ||
* Copyright (c) Meta Platforms, Inc. and affiliates. | ||
* | ||
* This source code is licensed under the MIT license found in the | ||
* LICENSE file in the root directory of this source tree. | ||
* | ||
* @format | ||
*/ | ||
import { ActivatablePluginDetails, InstalledPluginDetails } from 'flipper-common'; | ||
@@ -2,0 +10,0 @@ import { AbstractPluginInitializer } from 'flipper-frontend-core'; |
"use strict"; | ||
/** | ||
* Copyright (c) Meta Platforms, Inc. and affiliates. | ||
* | ||
* This source code is licensed under the MIT license found in the | ||
* LICENSE file in the root directory of this source tree. | ||
* | ||
* @format | ||
*/ | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
@@ -3,0 +11,0 @@ exports.HeadlessPluginInitializer = void 0; |
@@ -0,3 +1,11 @@ | ||
/** | ||
* Copyright (c) Meta Platforms, Inc. and affiliates. | ||
* | ||
* This source code is licensed under the MIT license found in the | ||
* LICENSE file in the root directory of this source tree. | ||
* | ||
* @format | ||
*/ | ||
export { FlipperServerCompanion } from './companion'; | ||
export { initCompanionEnv, FlipperServerCompanionEnv } from './init'; | ||
//# sourceMappingURL=index.d.ts.map |
"use strict"; | ||
/** | ||
* Copyright (c) Meta Platforms, Inc. and affiliates. | ||
* | ||
* This source code is licensed under the MIT license found in the | ||
* LICENSE file in the root directory of this source tree. | ||
* | ||
* @format | ||
*/ | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
@@ -3,0 +11,0 @@ exports.initCompanionEnv = exports.FlipperServerCompanion = void 0; |
@@ -0,1 +1,9 @@ | ||
/** | ||
* Copyright (c) Meta Platforms, Inc. and affiliates. | ||
* | ||
* This source code is licensed under the MIT license found in the | ||
* LICENSE file in the root directory of this source tree. | ||
* | ||
* @format | ||
*/ | ||
import { FlipperServer } from 'flipper-common'; | ||
@@ -2,0 +10,0 @@ import { HeadlessPluginInitializer } from './HeadlessPluginInitializer'; |
"use strict"; | ||
/** | ||
* Copyright (c) Meta Platforms, Inc. and affiliates. | ||
* | ||
* This source code is licensed under the MIT license found in the | ||
* LICENSE file in the root directory of this source tree. | ||
* | ||
* @format | ||
*/ | ||
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { | ||
@@ -44,2 +52,3 @@ if (k2 === undefined) k2 = k; | ||
const initCompanionEnv = async (flipperServer) => { | ||
// Anything DOM-related (like React or ant) does not exist and should not be used in a headless context because there is no DOM to use | ||
(0, flipper_frontend_core_1.setGlobalObject)({ | ||
@@ -46,0 +55,0 @@ React: React, |
@@ -0,1 +1,9 @@ | ||
/** | ||
* Copyright (c) Meta Platforms, Inc. and affiliates. | ||
* | ||
* This source code is licensed under the MIT license found in the | ||
* LICENSE file in the root directory of this source tree. | ||
* | ||
* @format | ||
*/ | ||
import { Logger } from 'flipper-plugin-core'; | ||
@@ -2,0 +10,0 @@ import { RenderHost } from 'flipper-frontend-core'; |
"use strict"; | ||
/** | ||
* Copyright (c) Meta Platforms, Inc. and affiliates. | ||
* | ||
* This source code is licensed under the MIT license found in the | ||
* LICENSE file in the root directory of this source tree. | ||
* | ||
* @format | ||
*/ | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
@@ -11,2 +19,3 @@ exports.initializeFlipperLibImplementation = void 0; | ||
createPaste() { | ||
// TODO: Implement me | ||
throw new Error('Not implemented'); | ||
@@ -16,2 +25,3 @@ }, | ||
showNotification() { | ||
// TODO: Write to stdout/stderr? | ||
throw new Error('Not supported in headless context'); | ||
@@ -18,0 +28,0 @@ }, |
@@ -0,3 +1,11 @@ | ||
/** | ||
* Copyright (c) Meta Platforms, Inc. and affiliates. | ||
* | ||
* This source code is licensed under the MIT license found in the | ||
* LICENSE file in the root directory of this source tree. | ||
* | ||
* @format | ||
*/ | ||
import { FlipperServer, FlipperServerConfig } from 'flipper-common'; | ||
export declare function initializeRenderHost(flipperServer: FlipperServer, flipperServerConfig: FlipperServerConfig): void; | ||
//# sourceMappingURL=initializeRenderHost.d.ts.map |
"use strict"; | ||
/** | ||
* Copyright (c) Meta Platforms, Inc. and affiliates. | ||
* | ||
* This source code is licensed under the MIT license found in the | ||
* LICENSE file in the root directory of this source tree. | ||
* | ||
* @format | ||
*/ | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
@@ -8,5 +16,7 @@ exports.initializeRenderHost = void 0; | ||
readTextFromClipboard() { | ||
// TODO: | ||
return undefined; | ||
}, | ||
writeTextToClipboard(_text) { | ||
// TODO: | ||
}, | ||
@@ -29,4 +39,6 @@ async importFile() { | ||
onIpcEvent(_event) { | ||
// no-op | ||
}, | ||
sendIpcEvent(_event, ..._args) { | ||
// no-op | ||
}, | ||
@@ -37,2 +49,3 @@ shouldUseDarkColors() { | ||
restartFlipper() { | ||
// TODO: | ||
}, | ||
@@ -48,4 +61,11 @@ serverConfig: flipperServerConfig, | ||
let js = source.js; | ||
// append source url (to make sure a file entry shows up in the debugger) | ||
js += `\n//# sourceURL=file://${path}`; | ||
// and source map url (to get source code if available) | ||
js += `\n//# sourceMappingURL=file://${path.replace(/.js$/, '.map')}`; | ||
// Plugins are compiled as typical CJS modules, referring to the global | ||
// 'module', which we'll make available by loading the source into a closure that captures 'module'. | ||
// Note that we use 'eval', and not 'new Function', because the latter will cause the source maps | ||
// to be off by two lines (as the function declaration uses two lines in the generated source) | ||
// eslint-disable-next-line no-eval | ||
const cjsLoader = eval('(module) => {' + js + '\n}'); | ||
@@ -57,2 +77,3 @@ const theModule = { exports: {} }; | ||
getStaticResourceUrl(path) { | ||
// the 'static' folder is mounted as static middleware in Express at the root | ||
return '/' + path; | ||
@@ -59,0 +80,0 @@ }, |
{ | ||
"name": "flipper-server-companion", | ||
"version": "0.187.1", | ||
"version": "0.188.0", | ||
"description": "Runs Flipper plugins on Flipper Server", | ||
@@ -12,5 +12,5 @@ "repository": "facebook/flipper", | ||
"dependencies": { | ||
"flipper-common": "0.187.1", | ||
"flipper-frontend-core": "0.187.1", | ||
"flipper-plugin-core": "0.187.1", | ||
"flipper-common": "0.188.0", | ||
"flipper-frontend-core": "0.188.0", | ||
"flipper-plugin-core": "0.188.0", | ||
"immer": "^9.0.18" | ||
@@ -17,0 +17,0 @@ }, |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
69409
905
+ Addedflipper-common@0.188.0(transitive)
+ Addedflipper-frontend-core@0.188.0(transitive)
+ Addedflipper-plugin-core@0.188.0(transitive)
- Removedflipper-common@0.187.1(transitive)
- Removedflipper-frontend-core@0.187.1(transitive)
- Removedflipper-plugin-core@0.187.1(transitive)
Updatedflipper-common@0.188.0
Updatedflipper-plugin-core@0.188.0