Skip to content

Commit 843f561

Browse files
committed
Add Flow libdef for fb-dotslash
1 parent 1c2fbb8 commit 843f561

3 files changed

Lines changed: 19 additions & 10 deletions

File tree

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
/**
2+
* Copyright (c) Meta Platforms, Inc. and affiliates.
3+
*
4+
* This source code is licensed under the MIT license found in the
5+
* LICENSE file in the root directory of this source tree.
6+
*
7+
* @flow strict-local
8+
* @format
9+
*/
10+
11+
declare module 'fb-dotslash' {
12+
declare module.exports: string;
13+
}

packages/debugger-shell/src/node/index.flow.js

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -152,11 +152,7 @@ function getShellBinaryAndArgs(
152152
): [string, Array<string>] {
153153
switch (flavor) {
154154
case 'prebuilt':
155-
return [
156-
// $FlowFixMe[cannot-resolve-module] fb-dotslash includes Flow types but Flow does not pick them up
157-
require('fb-dotslash'),
158-
[DEVTOOLS_BINARY_DOTSLASH_FILE],
159-
];
155+
return [require('fb-dotslash'), [DEVTOOLS_BINARY_DOTSLASH_FILE]];
160156
case 'dev':
161157
return [
162158
// NOTE: Internally at Meta, this is aliased to a workspace that is

packages/debugger-shell/src/node/private/LaunchUtils.js

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -44,11 +44,11 @@ async function spawnAndGetStderr(
4444
async function prepareDebuggerShellFromDotSlashFile(
4545
filePath: string,
4646
): Promise<DebuggerShellPreparationResult> {
47-
const {code, stderr} = await spawnAndGetStderr(
48-
// $FlowFixMe[cannot-resolve-module] fb-dotslash includes Flow types but Flow does not pick them up
49-
require('fb-dotslash'),
50-
['--', 'fetch', filePath],
51-
);
47+
const {code, stderr} = await spawnAndGetStderr(require('fb-dotslash'), [
48+
'--',
49+
'fetch',
50+
filePath,
51+
]);
5252
if (code === 0) {
5353
return {code: 'success'};
5454
}

0 commit comments

Comments
 (0)