Skip to content

Commit

Permalink
fix: Remove the unexpected double TS builds.
Browse files Browse the repository at this point in the history
  • Loading branch information
milesj committed Jan 14, 2021
1 parent 7941ece commit 2a33d38
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 10 deletions.
7 changes: 1 addition & 6 deletions src/Project.ts
Original file line number Diff line number Diff line change
Expand Up @@ -62,12 +62,7 @@ export default class Project extends BaseProject {
preferLocal: true,
});

const result = await this.buildPromise;

// Remove the promise so the build can be ran again
delete this.buildPromise;

return result;
return this.buildPromise;
}

@Memoize()
Expand Down
6 changes: 2 additions & 4 deletions src/components/ArtifactRow.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@ import React from 'react';
import { Box } from 'ink';
import Spinner from 'ink-spinner';
import { Style } from '@boost/cli';
import { formatMs } from '@boost/common';
import Artifact from '../Artifact';
import BundleArtifact from '../BundleArtifact';
import { STATE_LABELS } from '../constants';
import BundleTarget from './BundleTarget';
import Duration from './Duration';
import Target from './Target';

export interface ArtifactRowProps {
Expand Down Expand Up @@ -35,9 +35,7 @@ export default function ArtifactRow({ artifact }: ArtifactRowProps) {

<Box marginLeft={1}>
{artifact.isComplete() ? (
<Style type="default" bold>
{formatMs(artifact.buildResult.time)}
</Style>
<Duration time={artifact.buildResult.time} />
) : (
<Style type="muted">{STATE_LABELS[artifact.state]}</Style>
)}
Expand Down
17 changes: 17 additions & 0 deletions src/components/Duration.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
import React from 'react';
import { Style } from '@boost/cli';
import { formatMs } from '@boost/common';

export interface DurationProps {
time: number;
}

export default function Duration({ time }: DurationProps) {
const isFast = time <= 100;

return (
<Style type={isFast ? 'muted' : 'default'} bold>
{isFast ? '↝' : formatMs(time)}
</Style>
);
}

0 comments on commit 2a33d38

Please sign in to comment.