https://github.com/gkzhb/typescript-nvim-template
neovim plugin template using typescript-to-lua
https://github.com/gkzhb/typescript-nvim-template
lua neovim neovim-plugin typescript typescript-to-lua
Last synced: 8 months ago
JSON representation
neovim plugin template using typescript-to-lua
- Host: GitHub
- URL: https://github.com/gkzhb/typescript-nvim-template
- Owner: gkzhb
- License: mit
- Created: 2022-06-18T05:48:05.000Z (almost 4 years ago)
- Default Branch: main
- Last Pushed: 2022-06-18T08:49:36.000Z (almost 4 years ago)
- Last Synced: 2025-02-26T16:47:54.334Z (about 1 year ago)
- Topics: lua, neovim, neovim-plugin, typescript, typescript-to-lua
- Language: TypeScript
- Homepage:
- Size: 8.79 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# TypeScriptToLua Neovim Plugin Template
This template project uses [TypeScriptToLua](https://typescripttolua.github.io/)
to create a neovim lua plugin.
## Notice for TypeScriptToLua
There are many differences between Typescript for JavaScript and TypeScriptToLua
for Lua:
1. Features from languages(JavaScript and Lua): [Caveats | TypeScriptToLua](https://typescripttolua.github.io/docs/caveats)
1. To support JavaScript's function behavior in Lua: [The Self Parameter | TypeScriptToLua](https://typescripttolua.github.io/docs/the-self-parameter)
1. Using other modules: you can use external Lua code but not TypeScript files
from npm packages. [External Lua Code | TypeScriptToLua](https://typescripttolua.github.io/docs/external-lua-code)
1. Publish TSToLua modules: with the previous item, the good news is you can use
TypeScriptToLua to publish this Lua module with **types** and can be used in
other TSToLua projects.
[Publishing Modules | TypeScriptToLua](https://typescripttolua.github.io/docs/publishing-modules)
1. Extend TypeScript to support features in Lua: [Language Extensions | TypeScriptToLua](https://typescripttolua.github.io/docs/advanced/language-extensions)
## How to use this template
First change the project name and related path.
1. In `package.json`:
* Update meta data `name`, `repository.url`, `author`, etc.
* Update project name path in `main`, `types`
1. In `tsconfig.json`:
* Update project name path in `compilerOptions.outDir`
This project favors `yarn` and use `yarn` to install dependencies, use
`yarn build` to generate lua code. The output files will be in `./lua//`.
Finally, use `yarn dev` to build in realtime
as source files change.
## TODO
* [ ] Examples to use GitHub CI to automatically build code on git push.
* [ ] Provide Neovim API type declarations (how to automatically generate them?)
as a npm package.