Skip to content

Commit

Permalink
vercelfix2 (#1326)
Browse files Browse the repository at this point in the history
- **fix some types**
- **format**

<!-- ELLIPSIS_HIDDEN -->

----

> [!IMPORTANT]
> Fix type annotations and update TypeScript version to 5.7.2 in the
project.
> 
>   - **Type Fixes**:
>     - Specify type `any` for `e` in `EventListener.tsx`.
> - Specify type `WasmError` for `d` in `prompt-preview-content.tsx`.
> - Import `WasmDiagnosticError` and `WasmError` in `atoms.ts` and
`prompt-preview-content.tsx`.
>   - **Version Update**:
> - Update TypeScript version from `5.2.2` to `5.7.2` in `package.json`.
>   - **Miscellaneous**:
>     - Remove unused `WasmDiagnosticError` declaration in `atoms.ts`.
> 
> <sup>This description was created by </sup>[<img alt="Ellipsis"
src="https://img.shields.io/badge/Ellipsis-blue?color=175173">](https://www.ellipsis.dev?ref=BoundaryML%2Fbaml&utm_source=github&utm_medium=referral)<sup>
for aa00a3d. It will automatically
update as commits are pushed.</sup>

<!-- ELLIPSIS_HIDDEN -->
  • Loading branch information
aaronvg authored Jan 14, 2025
1 parent 3b116fa commit 5720e9a
Show file tree
Hide file tree
Showing 5 changed files with 73 additions and 13 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ export const versionAtom = atom((get) => {
export const numErrorsAtom = atom((get) => {
const errors = get(diagnosticsAtom)

const warningCount = errors.filter((e) => e.type === 'warning').length
const warningCount = errors.filter((e: any) => e.type === 'warning').length

return { errors: errors.length - warningCount, warnings: warningCount }
})
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import { unwrap } from 'jotai/utils'
import { type ICodeBlock } from './types'
import { vscodeLocalStorageStore } from './Jotai'
import { orchIndexAtom } from './playground-panel/atoms-orch-graph'
import { WasmCallContext } from '@gloo-ai/baml-schema-wasm-web/baml_schema_build'
import { WasmCallContext, WasmDiagnosticError } from '@gloo-ai/baml-schema-wasm-web/baml_schema_build'
import { vscode } from './vscode'

const wasmAtomAsync = atom(async () => {
Expand Down Expand Up @@ -91,7 +91,6 @@ export const runtimeAtom = atom((get) => {
return { rt, diags }
} catch (e) {
console.log('Error occurred while getting runtime', e)
const WasmDiagnosticError = wasm.WasmDiagnosticError
if (e instanceof Error) {
console.error(e.message)
} else if (e instanceof WasmDiagnosticError) {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { useAtomValue } from 'jotai'
import { ctxAtom, diagnosticsAtom, runtimeAtom } from '../../atoms'
import { areTestsRunningAtom, functionTestSnippetAtom, selectionAtom } from '../atoms'
import type { WasmPrompt } from '@gloo-ai/baml-schema-wasm-web'
import type { WasmPrompt, WasmError } from '@gloo-ai/baml-schema-wasm-web'
import { Loader } from './components'
import { ErrorMessage } from './components'
import { findMediaFile } from './media-utils'
Expand Down Expand Up @@ -54,9 +54,9 @@ export const PromptPreviewContent = () => {
<div className='mb-2 text-sm font-medium text-red-500'>Syntax Error</div>
<pre className='px-2 py-1 font-mono text-sm text-red-500 whitespace-pre-wrap rounded-lg'>
<div className='space-y-2'>
<div>{diagnostics.filter((d) => d.type === 'error').length} error(s):</div>
<div>{diagnostics.filter((d: WasmError) => d.type === 'error').length} error(s):</div>
{diagnostics
.filter((d) => d.type === 'error')
.filter((d: WasmError) => d.type === 'error')
.map((d, i) => (
<div key={i}>- {d.message}</div>
))}
Expand Down
73 changes: 67 additions & 6 deletions typescript/pnpm-lock.yaml

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

2 changes: 1 addition & 1 deletion typescript/vscode-ext/packages/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -188,7 +188,7 @@
"esbuild": "^0.19.4",
"is-ci": "3.0.1",
"ovsx": "0.8.3",
"typescript": "5.2.2"
"typescript": "5.7.2"
},
"preview": false
}

0 comments on commit 5720e9a

Please sign in to comment.