This is an experiment/demonstration of implementing a library in Kotlin targeting JavaScript/TypeScript.
- IntelliJ IDEA Kotlin/JS Gradle project
- A* pathfinding algorithm implemented in Kotlin
- Gradle
browserProductionWebpacktarget producesastar-kotlin-js.jslibrary demoVue project usesastar-kotlin-js.jslibrary to visualize pathfinding
Note that the A* implementation is for demonstration purposes. I just wanted something a bit interesting to visualize. It's not optimized for production use, and might not even be correct.
- IntelliJ IDEA
- Kotlin/JS
- Gradle
- Kotlin
- Vue
- Vue-Cli
- Vuetify
- Vue Class Component
- Vue Property Decorator
- Vue Class Store
- TypeScript
- GitHub Pages
- Coffee
I learned many things along the way, which I should write down... more to follow...
Initial setup:
- In
build/js/packages/astar-kotlin-jsrunyarn link - In
demorunyarn link astar-kotlin-js
During development:
- In
demorunyarn servefor hot-reloading development server - Run
browserDevelopmentWebpackgradle task after making any kotlin code changes
Active yarn serve process will pick up any changes.
Prefer not to make code changes with the release commit, just update version and build docs. Always start (and develop) in develop branch. Never make changes directly to master. Merging to master defines a release, must be tagged, and will trigger CI/CD (just GitHub Pages hosting at this point).
git checkout develop- Update
build.gradlewith versionX.Y.Z - For GitHub Pages hosting:
- Run
browserProductionWebpackgradle task - In
demorunyarn build - Remove old
docs& movedemo/disttodocs - Remove
docs/js/*.mapsourcemaps (unneeded in repo) - In
docsrunhttp-serverto see if distribution works
- Run
git commit -am "vX.Y.Z"git checkout master && git merge develop && git tag X.Y.Z# novgit push --all && git push --tagsgit checkout develop# back to work
GitHub Pages is hosting
/docsoffmasterbranch.
TODO: These steps could be more automated (especially the
docsbuild).
MIT License © Nathaniel Baughman
Share and enjoy :)