Extension development in pure Typescript

Hi,

I think it would be nice to be able to develop extensions in pure typescript, with Panic providing scaffolding. Or at least have the option to do as I believe there are some developers who would still love to write in pure JS.

For example with VS Code we can develop in either TS or JS.

The benefits of course is better tooling and development experience (autocompletion etc). I understand Nova had limited support for TS prior to typescript extension by @apexskier but I think the extension and the app are mature enough to allow this to happen.

It is just easier to have these as a first party support than trying to hack like this Extension autocomplete support

Thanks!

1 Like

There are quite a few milestones that might be needed before we could approach this, unfortunately, but it’s something we’re working toward.

As you mention, TypeScript intelligence support in Nova is optional and reliant on third-party extensions for the time being. We are working toward changing this, as our plan is for Nova to eventually gain first-party support for a TypeScript language server, among other features. This would then lead to support for compiling TypeScript in extensions before they are submitted to the extension library, as well as autocomplete support for the extension API being built in.

There’s a lot predicated on all of this, as TypeScript support is not a small undertaking, but I’d like to make it known that we understand your wants and always have it in mind!

Logan

3 Likes

Any updates on this? BBEdit have built-in support LSP if they are present on the system. Neat. Not third-party plugins required.

One thing that would go a long way to easing the extension development experience – based on my efforts over the last few days to build a Nova extension using TypeScript – would be a Panic-authored type definition for the Nova extension environment.

Right now I am using @types/nova-editor-node type definitions, which are accurate… ish. They include definitions for some types that actually do not exist (like TransformStream) which has made it difficult to understand what I am actually allowed to do in my extension. It would make life a lot easier to have a set of definitions here that I can actually trust!

I think building on that with an example extension written in TypeScript would be really helpful too. For example, if you want to use npm dependencies, showing how to use esbuild to bundle everything into a single file would be really helpful for people that aren’t super well-versed in the vast world of JavaScript tools.

1 Like

@alexlafroscia There is a multi-part guide on how to use NPM dependencies and bundling with Rollup for Nova extension development.

If you notice a problem with the Typescript definitions you should fork the repo and make a pull request. I’ve fixed a few issues in it myself. It would benefit all of us.

There is at least a Panic-authored ESLint rules for Nova extension development here.