Plugin Marketplace: Download plugin updates in background

Summary: Download updated plugins in background. This is implemented by periodical polling of Marketplace GraphQL API (interval 5 min by default). The feature is under GK flipper_plugin_auto_update, so for now it is enabled only for me.

Reviewed By: mweststrate

Differential Revision: D21863057

fbshipit-source-id: 51d8223ad4b2a928f7571ea480c10ba2efd9935d
This commit is contained in:
Anton Nikolaev
2020-06-04 08:29:41 -07:00
committed by Facebook GitHub Bot
parent ab84bd563a
commit f981a772ec
8 changed files with 106 additions and 471 deletions

View File

@@ -0,0 +1,39 @@
/**
* Copyright (c) Facebook, Inc. and its affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*
* @format
*/
/*
* mock-fs library has issues with calls to console.log in jest tests which are not resolved yet,
* so this console log can be used as a workaround in jest tests with fs-mocks:
* const realConsole = global.console;
* global.console = consoleMock as any;
* afterAll(() => {
* global.console = realConsole;
* });
* See details: https://github.com/tschaub/mock-fs/issues/234
*/
function format(entry: any) {
if (typeof entry === 'object') {
try {
return JSON.stringify(entry);
} catch (e) {}
}
return entry;
}
function log(...msgs: any) {
process.stdout.write(msgs.map(format).join(' ') + '\n');
}
export default {
log,
warn: log,
error: log,
};