Skip to content

Commit

Permalink
chore: bump typings
Browse files Browse the repository at this point in the history
  • Loading branch information
stipsan committed Feb 26, 2024
1 parent 04f5f59 commit 1d88a74
Show file tree
Hide file tree
Showing 4 changed files with 29 additions and 30 deletions.
8 changes: 4 additions & 4 deletions dashboard/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion dashboard/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
"react-dom": "^18.2.0",
"styled-components": "^6.1.8",
"swr": "^2.1.0",
"type-fest": "^4.0.0",
"type-fest": "^4.10.3",
"use-immer": "^0.9.0",
"zod": "^3.21.4"
},
Expand Down
47 changes: 23 additions & 24 deletions dashboard/pages/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -114,8 +114,7 @@ function getStatus(output: Output | undefined): Status {
}
const columns: ColumnDef<CheckWithOutputs, any>[] = [
columnHelper.accessor(
// @ts-expect-error
(row: any) => {
(row) => {
const expectedStatus = row.outputs?.expected?.status
const actualStatus = row.outputs?.actual?.status

Expand Down Expand Up @@ -168,7 +167,7 @@ const columns: ColumnDef<CheckWithOutputs, any>[] = [
)
}
},
},
}
),
columnHelper.accessor('name', {
header: 'Name',
Expand Down Expand Up @@ -219,28 +218,28 @@ const Table = memo(function Table({ data }: { data: CheckWithOutputs[] }) {
scope="col"
colSpan={header.colSpan}
className={cx(
'sticky top-0 z-10 items-center border-b border-gray-300 bg-gray-50 bg-opacity-75 py-3.5 pl-4 pr-3 text-left text-sm font-semibold text-gray-900 backdrop-blur backdrop-filter sm:pl-6 lg:pl-8',
'sticky top-0 z-10 items-center border-b border-gray-300 bg-gray-50 bg-opacity-75 py-3.5 pl-4 pr-3 text-left text-sm font-semibold text-gray-900 backdrop-blur backdrop-filter sm:pl-6 lg:pl-8'
)}
>
{header.isPlaceholder ? null : (
<a
{...{
className: cx(
'group inline-flex sticky left-4 right-4',
header.column.getCanSort() && 'cursor-pointer',
header.column.getCanSort() && 'cursor-pointer'
),
onClick: header.column.getToggleSortingHandler(),
}}
>
{flexRender(
header.column.columnDef.header,
header.getContext(),
header.getContext()
)}
<span
className={cx(
header.column.getIsSorted()
? 'ml-2 flex-none rounded bg-gray-200 text-gray-900 group-hover:bg-gray-300'
: 'invisible ml-2 flex-none rounded text-gray-400 group-hover:visible group-focus:visible',
: 'invisible ml-2 flex-none rounded text-gray-400 group-hover:visible group-focus:visible'
)}
>
{{
Expand Down Expand Up @@ -349,25 +348,25 @@ function Dashboard({ initial }: { initial: InitialData }) {
status: expectedOutput?.error
? 'error'
: // @ts-expect-error
expectedOutput?.failure
? 'failure'
: // @ts-expect-error
expectedOutput?.result
? 'success'
: 'pending',
expectedOutput?.failure
? 'failure'
: // @ts-expect-error
expectedOutput?.result
? 'success'
: 'pending',
...expectedOutput,
},
actual: {
// @ts-expect-error
status: actualOutput?.error
? 'error'
: // @ts-expect-error
actualOutput?.failure
? 'failure'
: // @ts-expect-error
actualOutput?.result
? 'success'
: 'pending',
actualOutput?.failure
? 'failure'
: // @ts-expect-error
actualOutput?.result
? 'success'
: 'pending',
...actualOutput,
},
},
Expand Down Expand Up @@ -487,14 +486,14 @@ export const getStaticProps: GetStaticProps<Props> = async () => {
__dirname,
path.resolve(
__dirname,
'../../public/outputs/node-cjs-script-v16/actual.json',
),
'../../public/outputs/node-cjs-script-v16/actual.json'
)
)

for (const check of checksJson) {
if (check.type === 'artifact') {
const expectedText = await fs.readFile(
path.resolve(__dirname, `../../public${check.expected}`),
path.resolve(__dirname, `../../public${check.expected}`)
)
const expectedJson = JSON.parse(expectedText.toString())
try {
Expand All @@ -504,7 +503,7 @@ export const getStaticProps: GetStaticProps<Props> = async () => {
fallback[check.expected] = { error: err?.stack || err.toString() }
}
const actualText = await fs.readFile(
path.resolve(__dirname, `../../public${check.actual}`),
path.resolve(__dirname, `../../public${check.actual}`)
)
const actualJson = JSON.parse(actualText.toString())
try {
Expand All @@ -517,7 +516,7 @@ export const getStaticProps: GetStaticProps<Props> = async () => {
if (check.type === 'service') {
try {
const expectedJson = await fetch(check.expected).then((res) =>
res.json(),
res.json()
)
fallback[check.expected as any] = outputSchema.parse(expectedJson)
} catch (err: any) {
Expand Down
2 changes: 1 addition & 1 deletion runtimes/bun-script/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,6 @@
"dependencies": {
"@sanity/client": "6.14.3",
"@sanity/runtimes-test-client": "latest",
"bun-types": "^1.0.0"
"bun-types": "^1.0.29"
}
}

0 comments on commit 1d88a74

Please sign in to comment.