anysphere / priompt

Prompt design using JSX.
MIT License
849 stars 51 forks source link

Remove @ts-ignores from tests #7

Closed unknown closed 5 months ago

unknown commented 5 months ago

This allows the JSX namespace to be resolved in the tests file, removing the need for ts-ignores.

unknown commented 5 months ago

As an aside, it looks like a few things have been added since the last time I played around with this repo and a few things on my end were broken on my end.

https://github.com/anysphere/priompt/blob/0ba66fb760462385c951c4e9e1312199a5c4764f/priompt-preview/src/openai.ts#L10 On my end, since ossEndpointsJson is "undefined", the preview app throws an error trying to parse "undefined" as a JSON. If needed, I can make a PR with my fix to get the app running.

arvid220u commented 5 months ago

This is great, thank you. Instead of making it global (which would potentially cause problems with mixing React/SolidJS and Priompt in the same project), I just made the tests import from ./index instead.

arvid220u commented 5 months ago

Also, thank you for pointing out the ossEndpointJson problem! It appears there are a few more problems with running Priompt (e.g. tiktoken-node) — I will fix them right now.

unknown commented 5 months ago

This is great, thank you. Instead of making it global (which would potentially cause problems with mixing React/SolidJS and Priompt in the same project), I just made the tests import from ./index instead.

I hadn't considered that conflict, your fix certainly makes more sense than what I did!