Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/haikyuu/ts2imba
A typescript to Imba converter
https://github.com/haikyuu/ts2imba
imba jsx tailwindcss typescript
Last synced: 8 days ago
JSON representation
A typescript to Imba converter
- Host: GitHub
- URL: https://github.com/haikyuu/ts2imba
- Owner: haikyuu
- License: mit
- Created: 2022-06-29T23:07:37.000Z (over 2 years ago)
- Default Branch: main
- Last Pushed: 2024-01-11T20:45:59.000Z (10 months ago)
- Last Synced: 2024-10-14T16:36:51.707Z (22 days ago)
- Topics: imba, jsx, tailwindcss, typescript
- Language: Imba
- Homepage: https://ts2imba.com
- Size: 427 KB
- Stars: 8
- Watchers: 2
- Forks: 0
- Open Issues: 13
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
[![Ceasefire Now](https://badge.techforpalestine.org/default)](https://techforpalestine.org/learn-more)
## TS 2 Imba
alpha software that works well enough- Doesn't support template literals atm. (and probably many other things) 😄
It also converts react function components to imba tags and tailwind classes into imba inline styles
# Current limitations
- Should work in the browser ... but it doesn't for some reason (didn't spend much time trying to fix it since I was the only user)
- Template literals have a weird AST representation. I'd rather just do some regex magic to remove unescaped $ and use "" or """ instead. For now, I change ` to " manually in the js code ^^
- The majority of js2coffee tests aren't ported yet.# Contribute
Contributions are very welcome, the easiest way to contribute is to
1. add a failing test case in an issue
2. If you face `"ASTType" is not supported`, create a `def ASTType(node, ctx) do debugger` in `builder.imba` and see if you can make it work. Start with returning an array with a random string, then create a failing test case, focus on it with `test.only` and run vitest on the file `npx vitest my_file.test.imba`. You can find a simple test [here](https://github.com/haikyuu/ts2imba/blob/main/src/tests/advanced/exportNamed.test.imba)
# Credits
- This wouldn't have been possible without the amazing work of https://github.com/rstacruz on https://github.com/js2coffee/js2coffee
- Thanks to @roman01la for https://github.com/roman01la/html-to-react-components