Skip to content

nebaughman/astar-kotlin-js

Repository files navigation

A* Pathfinding Demo with Kotlin/JS

Try it out ↣

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 browserProductionWebpack target produces astar-kotlin-js.js library
  • demo Vue project uses astar-kotlin-js.js library 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.

Ecosystem

Thoughts

I learned many things along the way, which I should write down... more to follow...

Development

Initial setup:

  • In build/js/packages/astar-kotlin-js run yarn link
  • In demo run yarn link astar-kotlin-js

During development:

  • In demo run yarn serve for hot-reloading development server
  • Run browserDevelopmentWebpack gradle task after making any kotlin code changes

Active yarn serve process will pick up any changes.

Release Process

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.gradle with version X.Y.Z
  • For GitHub Pages hosting:
    • Run browserProductionWebpack gradle task
    • In demo run yarn build
    • Remove old docs & move demo/dist to docs
    • Remove docs/js/*.map sourcemaps (unneeded in repo)
    • In docs run http-server to see if distribution works
  • git commit -am "vX.Y.Z"
  • git checkout master && git merge develop && git tag X.Y.Z # no v
  • git push --all && git push --tags
  • git checkout develop # back to work

GitHub Pages is hosting /docs off master branch.

TODO: These steps could be more automated (especially the docs build).

License

MIT License © Nathaniel Baughman

Share and enjoy :)

About

A* Pathfinding implemented in Kotlin targeting JavaScript/TypeScript

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages