Skip to content

Commit 84790e8

Browse files
committed
improvement(workflow-code): simplify the source check type check
One unavailable path builds W_TYPES_UNCHECKED, reportCheck merges the type check's findings, files are read once and concurrently, and npm and tsc run without the Sim API key.
1 parent 93161b6 commit 84790e8

5 files changed

Lines changed: 191 additions & 132 deletions

File tree

‎packages/sim-cli/src/commands/protocol/source-check.ts‎

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,7 @@ import {
4848
type LocalDeclarations,
4949
refreshTsconfigs,
5050
} from './source-tree'
51+
import type { TypeCheck } from './source-types'
5152
import { type Diagnostic, findingsOutput } from './source-ui'
5253
import { blockDigest, readStoredBlockDigests, readStoredEdges } from './stored-edges'
5354
import { lockRecoveryHint, readSourceFiles } from './workflow-dir'
@@ -780,18 +781,19 @@ export function reportCheck(
780781
unlisted?: UnlistedCounts
781782
/** The source directory, which GitHub Actions annotations resolve finding files under. */
782783
dir?: string
783-
/** Whether the type check ran after the compile (`source-types.ts`). */
784-
typesChecked?: boolean
784+
/** The type check that ran after the compile, whose findings join the compile's. */
785+
types?: TypeCheck
785786
} = {}
786787
): void {
788+
findings = [...findings, ...(options.types?.findings ?? [])]
787789
const shown = findingsOutput(output, options.verbose, options.dir)
788790
const listed = boundAnswerFindings(findings, options.bound)
789791
shown.print(listed)
790792
const unlisted = options.unlisted ?? { errors: 0, warnings: 0 }
791793
const errors = findings.filter((finding) => finding.severity === 'error').length + unlisted.errors
792794
if (errors > 0) setSoftExitCode(1)
793795
printProtocolResult(output, {
794-
checked: options.typesChecked ? ['compile', 'types'] : ['compile'],
796+
checked: options.types?.checked ? ['compile', 'types'] : ['compile'],
795797
errors,
796798
warnings:
797799
findings.filter((finding) => finding.severity === 'warning').length + unlisted.warnings,

0 commit comments

Comments
 (0)