The process is really simple. You clone our repository of type definitions and follow a simple process, first you copy the pom.xml from the jquery project and replace all the mentions of jquery with the name of your library. For this demo I decided to use ace. That’s a code editor library, which might come handy for some future projects:
I first had a look into the “ace.d.ts” file. That’s the file which holds the actual type definitions. On the top it has a comment section with information about the library. I followed the project link, found a download link for ace.js and added it to the pom. So if you want to try it out, this is what the changed section of the pom should look like after your adjustments:
Now all you have to do is a maven install, and as a result you’ll get a wonderful new DukeScript library.
It’s best to write some tests, while the library is still warm from the compiler. Again the JQuery project can provide some clues. So copy the “src” folder from the jquery project, rename the package “jquery” to “ace”, and open class “JQueryTest.java” in the editor.