Skip to content
This repository was archived by the owner on Nov 25, 2023. It is now read-only.

Commit d091163

Browse files
committed
deps bump
1 parent 28f22c1 commit d091163

21 files changed

+390
-290
lines changed

.gitignore

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
.idea
22
node_modules
33
build
4-
.DS_Store
4+
.DS_Store
5+
dist

commands/join.tsx

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ const Client = ({dir, isForceOverwrite, sessionId, verbose, tree}: IClientProps)
3333
loading: remoteLoading,
3434
remoteRegistry,
3535
registryRenderableArray,
36-
stats
36+
stats,
3737
} = useRemoteRegistry(dir, hyper.hyperObj?.eventLog, verbose, isPaused)
3838
useDriveDownload(dir, remoteRegistry, hyper.hyperObj?.drive)
3939

@@ -48,11 +48,11 @@ const Client = ({dir, isForceOverwrite, sessionId, verbose, tree}: IClientProps)
4848
items={[
4949
{
5050
label: 'Continue',
51-
value: true
51+
value: true,
5252
}, {
5353
label: 'Cancel',
54-
value: false
55-
}
54+
value: false,
55+
},
5656
]} onSelect={ack => {
5757
if (ack.value) {
5858
setIsPaused(false)
@@ -99,19 +99,19 @@ Client.propTypes = {
9999
verbose: PropTypes.bool,
100100

101101
/// Show full folder file tree
102-
tree: PropTypes.bool
102+
tree: PropTypes.bool,
103103
}
104104
Client.shortFlags = {
105105
dir: 'd',
106106
isForceOverwrite: 'f',
107107
verbose: 'v',
108-
tree: 't'
108+
tree: 't',
109109
}
110110
Client.defaultProps = {
111111
dir: '.',
112112
isForceOverwrite: false,
113113
verbose: false,
114-
tree: false
114+
tree: false,
115115
}
116116

117117
Client.positionalArgs = ['sessionId']

commands/new.tsx

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ const Host = ({dir, includeGitFiles, verbose, tree}: IHostProps) => {
2727
loading,
2828
localRegistry,
2929
registryRenderableArray,
30-
stats
30+
stats,
3131
} = useLocalRegistry(dir, hyper.hyperObj?.eventLog, !includeGitFiles, verbose)
3232
useDriveSync(dir, localRegistry, hyper.hyperObj?.drive)
3333

@@ -57,18 +57,18 @@ Host.propTypes = {
5757
verbose: PropTypes.bool,
5858

5959
/// Show full folder file tree
60-
tree: PropTypes.bool
60+
tree: PropTypes.bool,
6161
}
6262
Host.shortFlags = {
6363
dir: 'd',
6464
verbose: 'v',
65-
tree: 't'
65+
tree: 't',
6666
}
6767
Host.defaultProps = {
6868
dir: '.',
6969
includeGitFiles: false,
7070
verbose: false,
71-
tree: false
71+
tree: false,
7272
}
7373

7474
export default Host

components/DisplayComponent.tsx

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,8 @@ interface IDisplayComponentProps {
88
children: React.ReactNode;
99
}
1010

11-
const DisplayComponent = ({loading, loadingMessage, children}: IDisplayComponentProps) => {
12-
return loading ?
13-
<Loader status={loadingMessage}/> :
14-
<Box flexDirection="column">{children}</Box>
15-
}
11+
const DisplayComponent = ({loading, loadingMessage, children}: IDisplayComponentProps) => loading
12+
? <Loader status={loadingMessage}/>
13+
: <Box flexDirection="column">{children}</Box>
1614

1715
export default DisplayComponent

components/Errors.tsx

Lines changed: 17 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -6,15 +6,22 @@ interface IErrorsProps {
66
}
77

88
// Error display component. Does not render if no errors are logged
9-
const Errors = ({errors}: IErrorsProps) => errors.length > 0 ?
10-
<Box marginTop={2} flexDirection="column">
11-
<Text bold color="red">Errors:</Text>
12-
{errors.slice(0, 3).map((error, i) => (
13-
<Text key={i}>
14-
{error}
15-
</Text>
16-
))}
17-
{errors.length > 3 && <Text bold color="red">...and {errors.length - 3} more collapsed</Text>}
18-
</Box> : null
9+
const Errors = ({errors}: IErrorsProps) => {
10+
if (errors.length === 0) {
11+
return null
12+
}
13+
14+
return (
15+
<Box marginTop={2} flexDirection="column">
16+
<Text bold color="red">Errors:</Text>
17+
{errors.slice(0, 3).map((error, i) => (
18+
<Text key={i}>
19+
{error}
20+
</Text>
21+
))}
22+
{errors.length > 3 && <Text bold color="red">...and {errors.length - 3} more collapsed</Text>}
23+
</Box>
24+
)
25+
}
1926

2027
export default Errors

components/FileTree.tsx

Lines changed: 5 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -33,13 +33,9 @@ const Legend = () => (
3333
</Box>
3434
)
3535

36-
const isFileQueued = (file: ITreeRepresentation) => {
37-
return file.stats.numTransfers <= 1 && !file.stats.hasEnded
38-
}
36+
const isFileQueued = (file: ITreeRepresentation) => file.stats.numTransfers <= 1 && !file.stats.hasEnded
3937

40-
const fmtPercentage = (number: number) => {
41-
return `${(number * 100).toFixed(2)}%`
42-
}
38+
const fmtPercentage = (number: number) => `${(number * 100).toFixed(2)}%`
4339

4440
interface IFileTreeProps {
4541
registry: ITreeRepresentation[];
@@ -82,9 +78,9 @@ const TruncatedTreeFile = ({file}: {file: ITreeRepresentation}) => (
8278
// File tree display component
8379
const DISPLAY_NUM = 25
8480
const FileTree = ({registry, full}: IFileTreeProps) => {
85-
const emptyMessage = full ?
86-
<Text color="yellow">No files found</Text> :
87-
<Text bold color="green">All files synced</Text>
81+
const emptyMessage = full
82+
? <Text color="yellow">No files found</Text>
83+
: <Text bold color="green">All files synced</Text>
8884
const files = full ? registry : registry.filter(file => file.status !== STATUS.synced).sort((a, b) => b.size - a.size)
8985
return (
9086
<Box flexDirection="column" marginY={1}>

components/Hotkeys.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,9 @@ import Loader from './Loader'
88
const Hotkeys = () => {
99
useHotkey()
1010
const {closed} = useAppContext()
11-
return closed ?
12-
<Loader status="Cleaning up..." color="yellow"/> :
13-
<Text dimColor>[esc] or [q] to quit</Text>
11+
return closed
12+
? <Loader status="Cleaning up..." color="yellow"/>
13+
: <Text dimColor>[esc] or [q] to quit</Text>
1414
}
1515

1616
export default Hotkeys

contexts/App.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ interface IAppContextProps {
1414
const AppContext = createContext<IAppContextProps>({
1515
numConnected: 0,
1616
closed: false,
17-
setClosed: () => {}
17+
setClosed: () => {},
1818
})
1919

2020
export const useAppContext = () => useContext(AppContext)
@@ -31,7 +31,7 @@ export const AppContextProvider = ({children, hyper}: IAppContextProviderProps)
3131
closed,
3232
setClosed: () => {
3333
setClosed(true)
34-
}
34+
},
3535
}), [hyper])
3636

3737
if (hyper.loading) {

domain/registry.ts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ export class Registry {
5454
return total
5555
}, {
5656
totalBytes: 0,
57-
bytesPerSecond: 0
57+
bytesPerSecond: 0,
5858
})
5959
}
6060

@@ -121,7 +121,7 @@ export class Registry {
121121
isDir: node.isDir,
122122
status: node.status,
123123
size: node.sizeBytes,
124-
stats: node.stats
124+
stats: node.stats,
125125
})
126126
for (const child of node.getChildren()) {
127127
// Default to indent 2 spaces
@@ -239,8 +239,8 @@ export class Registry {
239239
onChangeCallback: data => {
240240
this._onChangeCallback(data)
241241
},
242-
onReadyCallback: onReady
243-
}
242+
onReadyCallback: onReady,
243+
},
244244
)
245245
return this
246246
}
@@ -270,7 +270,7 @@ export class Registry {
270270

271271
eventLog.createReadStream({
272272
tail: true,
273-
live: true
273+
live: true,
274274
}).on('data', (data: Buffer) => {
275275
process(data.toString())
276276
})

domain/trie.ts

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ export enum STATUS {
88
syncing,
99
waitingForRemote,
1010
error,
11-
synced
11+
synced,
1212
}
1313

1414
// Single trienode representing a file/folder
@@ -35,7 +35,7 @@ export class TrieNode {
3535
numTransfers: 0,
3636
bytesPerSecond: 0,
3737
totalTransferred: 0,
38-
hasEnded: false
38+
hasEnded: false,
3939
}
4040
}
4141

@@ -87,7 +87,7 @@ export class TrieNode {
8787
opName: string,
8888
op: (pathSegments: string[], ctx: Ctx) => Promise<T>,
8989
ctx: Ctx,
90-
folderPreRun?: (path: string[]) => void
90+
folderPreRun?: (path: string[]) => void,
9191
): Promise<STATUS> {
9292
const path = this.getPath()
9393

@@ -157,11 +157,11 @@ export class TrieNode {
157157
this.registry._debug(`[download] retry ${joinedPath} for the ${i} time: ${error.message}`)
158158
this.status = STATUS.waitingForRemote
159159
return true
160-
}
160+
},
161161
})
162162
},
163163
this.registry.stats,
164-
mkdir
164+
mkdir,
165165
)
166166
}
167167

@@ -182,7 +182,7 @@ export class TrieNode {
182182
this.status = STATUS.syncing
183183
return pump(readStream, writeStream, this.stats, this.registry.refreshStats)
184184
},
185-
this.registry.stats
185+
this.registry.stats,
186186
)
187187
}
188188
}

0 commit comments

Comments
 (0)