Share uuid
Summary: Expose uuid from flipper-common as it is required in multiple packages Reviewed By: lblasa Differential Revision: D36441889 fbshipit-source-id: 1fa539cb437976dbefe7d5d9a52e5e098a6402a7
This commit is contained in:
committed by
Facebook GitHub Bot
parent
88bc3110a5
commit
0f038218f8
@@ -8,8 +8,12 @@
|
||||
"types": "lib/index.d.ts",
|
||||
"license": "MIT",
|
||||
"bugs": "https://github.com/facebook/flipper/issues",
|
||||
"dependencies": {},
|
||||
"devDependencies": {},
|
||||
"dependencies": {
|
||||
"uuid": "^8.3.2"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@types/uuid": "^8.3.4"
|
||||
},
|
||||
"peerDependencies": {},
|
||||
"scripts": {
|
||||
"reset": "rimraf lib *.tsbuildinfo",
|
||||
|
||||
@@ -52,6 +52,7 @@ export {
|
||||
} from './utils/errors';
|
||||
export {createControlledPromise} from './utils/controlledPromise';
|
||||
export * from './utils/typeUtils';
|
||||
export * from './utils/uuid';
|
||||
export * from './GK';
|
||||
export * from './clientUtils';
|
||||
export * from './settings';
|
||||
|
||||
@@ -7,5 +7,4 @@
|
||||
* @format
|
||||
*/
|
||||
|
||||
import {v4 as uuid} from 'uuid';
|
||||
export {uuid};
|
||||
export {v4 as uuid} from 'uuid';
|
||||
@@ -24,12 +24,10 @@
|
||||
"react-color": "^2.19.3",
|
||||
"react-element-to-jsx-string": "^14.3.4",
|
||||
"react-virtual": "^2.10.4",
|
||||
"string-natural-compare": "^3.0.0",
|
||||
"uuid": "^8.3.2"
|
||||
"string-natural-compare": "^3.0.0"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@types/string-natural-compare": "^3.0.2",
|
||||
"@types/uuid": "^8.3.4",
|
||||
"jest-mock-console": "^1.2.3"
|
||||
},
|
||||
"peerDependencies": {
|
||||
|
||||
@@ -137,7 +137,6 @@ export {createTablePlugin} from './utils/createTablePlugin';
|
||||
export {textContent} from './utils/textContent';
|
||||
import * as path from './utils/path';
|
||||
export {path};
|
||||
export * from './utils/uuid';
|
||||
export {safeStringify} from './utils/safeStringify';
|
||||
|
||||
// It's not ideal that this exists in flipper-plugin sources directly,
|
||||
@@ -150,6 +149,7 @@ export {
|
||||
sleep,
|
||||
timeout,
|
||||
createControlledPromise,
|
||||
uuid,
|
||||
DeviceOS,
|
||||
DeviceType,
|
||||
DeviceLogEntry,
|
||||
|
||||
@@ -11,13 +11,13 @@
|
||||
|
||||
import * as path from './utils/path';
|
||||
export {path};
|
||||
export * from './utils/uuid';
|
||||
export {safeStringify} from './utils/safeStringify';
|
||||
|
||||
export {
|
||||
sleep,
|
||||
timeout,
|
||||
createControlledPromise,
|
||||
uuid,
|
||||
ServerAddOn,
|
||||
ServerAddOnPluginConnection,
|
||||
FlipperServerForServerAddOn,
|
||||
|
||||
@@ -10,7 +10,7 @@
|
||||
import React, {useMemo} from 'react';
|
||||
import {Children, cloneElement, createContext, useContext} from 'react';
|
||||
import reactElementToJSXString from 'react-element-to-jsx-string';
|
||||
import {v4 as uuid} from 'uuid';
|
||||
import {uuid} from 'flipper-common';
|
||||
|
||||
export type InteractionReport = {
|
||||
// Duration of the event handler itself, not including any time the promise handler might have been pending
|
||||
|
||||
@@ -39,7 +39,6 @@
|
||||
"serialize-error": "^8.1.0",
|
||||
"split2": "^4.1.0",
|
||||
"tmp": "^0.2.1",
|
||||
"uuid": "^8.3.2",
|
||||
"which": "^2.0.2",
|
||||
"ws": "^8.5.0",
|
||||
"xdg-basedir": "^4.0.0"
|
||||
|
||||
@@ -7,11 +7,10 @@
|
||||
* @format
|
||||
*/
|
||||
|
||||
import {FlipperServerCommands, FlipperServerEvents} from 'flipper-common';
|
||||
import {FlipperServerCommands, FlipperServerEvents, uuid} from 'flipper-common';
|
||||
import {pathExists} from 'fs-extra';
|
||||
import {promises, createWriteStream, ReadStream} from 'fs';
|
||||
import axios from 'axios';
|
||||
import {v4 as uuid} from 'uuid';
|
||||
|
||||
const {unlink} = promises;
|
||||
|
||||
|
||||
@@ -10,9 +10,15 @@
|
||||
import axios from 'axios';
|
||||
import MemoryStream from 'memorystream';
|
||||
import {dirSync} from 'tmp';
|
||||
import * as uuid from 'uuid';
|
||||
import * as flipperCommon from 'flipper-common';
|
||||
import {commandDownloadFileStartFactory} from '../DownloadFile';
|
||||
|
||||
// https://stackoverflow.com/a/63374190
|
||||
jest.mock('flipper-common', () => ({
|
||||
__esModule: true,
|
||||
...jest.requireActual('flipper-common'),
|
||||
}));
|
||||
|
||||
describe('commands', () => {
|
||||
describe('DownloadFile', () => {
|
||||
let commandDownloadFileStart: ReturnType<
|
||||
@@ -60,7 +66,7 @@ describe('commands', () => {
|
||||
|
||||
const fakeDownloadURL = 'https://flipper.rocks';
|
||||
const fakeUuid = 'flipper42';
|
||||
jest.spyOn(uuid, 'v4').mockImplementation(() => fakeUuid);
|
||||
jest.spyOn(flipperCommon, 'uuid').mockImplementation(() => fakeUuid);
|
||||
|
||||
const downloadFileDescriptor = await commandDownloadFileStart(
|
||||
fakeDownloadURL,
|
||||
@@ -135,7 +141,7 @@ describe('commands', () => {
|
||||
|
||||
const fakeDownloadURL = 'https://flipper.rocks';
|
||||
const fakeUuid = 'flipper42';
|
||||
jest.spyOn(uuid, 'v4').mockImplementation(() => fakeUuid);
|
||||
jest.spyOn(flipperCommon, 'uuid').mockImplementation(() => fakeUuid);
|
||||
|
||||
await commandDownloadFileStart(fakeDownloadURL, dest);
|
||||
|
||||
@@ -177,7 +183,7 @@ describe('commands', () => {
|
||||
|
||||
const fakeDownloadURL = 'https://flipper.rocks';
|
||||
const fakeUuid = 'flipper42';
|
||||
jest.spyOn(uuid, 'v4').mockImplementation(() => fakeUuid);
|
||||
jest.spyOn(flipperCommon, 'uuid').mockImplementation(() => fakeUuid);
|
||||
|
||||
// We provide an invalid path to force write stream to fail
|
||||
await commandDownloadFileStart(fakeDownloadURL, '');
|
||||
|
||||
@@ -12,8 +12,7 @@ import iosUtil from './iOSContainerUtility';
|
||||
|
||||
import child_process from 'child_process';
|
||||
import type {IOSDeviceParams} from 'flipper-common';
|
||||
import {DeviceType} from 'flipper-common';
|
||||
import {v1 as uuid} from 'uuid';
|
||||
import {DeviceType, uuid} from 'flipper-common';
|
||||
import path from 'path';
|
||||
import {exec, execFile} from 'promisify-child-process';
|
||||
import {getFlipperServerConfig} from '../../FlipperServerConfig';
|
||||
|
||||
Reference in New Issue
Block a user