I recently improved on the prior tool to open the door for multiple kinds of parsing, as well as manual definitions in an XML file. When you are able to parse documents to generate the definitions automatically, you may still need to tweak or adjust the types by hand. BuildHX is designed to allow this workflow.
If you are able to automatically derive types using JInt, you could create a JIntParser for BuildHX, which could read a source directory and populate the types it finds there:
<source path="my/js/files" parser="jint" />
Similar to what I have done for Sencha Touch, you could fill in the blanks manually with the rest of the XML definition file for any given library.
BuildHX is not written in C#... it's in Haxe, of course, but that makes it easier for it to run on multiple platforms using Neko.
Since BuildHX is compiled for Neko, it can be distributed and used from haxelib. Ideally, I would like to continue this setup, so I don't think the tool should be compiled as C#.
However, we could create a standalone Jint-based executable and put it in the "/bin" directory along with jsduck and (probably) doxygen. It could accept a directory of JS files, and output
type information in JSON or XML files.
Hello Haxers,Im here to propose a solution to one of the biggest shortcommings of haxe on the javascript front
js_to_haxe.cmd <path_to_js_source_directory>
Hi Yaroslav,
I am currently working on documenting Haxe and Javascriptand Haxe and Node.js
I wanted to write a piece about automated conversion of externs.Your project looks like it could be helpful, but I don't get it to work.
Currently I think it's for windows and I work on mac
Is this true?
grtMatthijs
On Wednesday, September 9, 2015 at 12:04:43 PM UTC+2, Yaroslav Sivakov wrote:
Hello, Jimm! I port several libs from js to haxe and may recommend you pre-process js files with refactor (http://lib.haxe.org/p/refactor), then - manual editing. Just install refactor library and run from scripts folder:
js_to_haxe.cmd <path_to_js_source_directory>
--
To post to this group haxe...@googlegroups.com
http://groups.google.com/group/haxelang?hl=en
---
You received this message because you are subscribed to a topic in the Google Groups "Haxe" group.
For more options, visit https://groups.google.com/d/optout.
Hello, Jimm! I port several libs from js to haxe and may recommend you pre-process js files with refactor (http://lib.haxe.org/p/refactor), then - manual editing. Just install refactor library and run from scripts folder:
js_to_haxe.cmd <path_to_js_source_directory>
js_to_haxe.cmd e:\wyndorfcomponents\html5\audio\test\js\screenfull.js
js_to_haxe.cmd e:\wyndorfcomponents\html5\audio\test\js\screenfull.js e:\wyndorfcomponents\html5\audio\test\js\screenfull.hx
js_to_haxe.cmd e:\wyndorfcomponents\html5\audio\test\js e:\wyndorfcomponents\html5\audio\test\js
--
To post to this group haxe...@googlegroups.com
http://groups.google.com/group/haxelang?hl=en
---
You received this message because you are subscribed to a topic in the Google Groups "Haxe" group.
For more options, visit https://groups.google.com/d/optout.
Please, try:
js_to_haxe.cmd e:\wyndorfcomponents\html5\audio\test\js e:\wyndorfcomponents\html5\audio\test\js
haxelib run refactor
It uses a .ndll which I once compiled and submitted, perhaps it's out of date, but it seems it works for me. Could you post some error message?
js.
haxelib run refactor
…does not seem to work on Mac. :(
--
To post to this group haxe...@googlegroups.com
http://groups.google.com/group/haxelang?hl=en
---
You received this message because you are subscribed to the Google Groups "Haxe" group.
>haxelib run refactor js_to_haxe x3dom.js
ERROR: Unknow command 'js_to_haxe'.
>haxelib run refactor js_to_haxe.cmd x3dom.js
Called from ? line 1
Called from Main.hx line 69
Called from hant/Process.hx line 190
Called from hant/Process.hx line 95
Called from a C function
Called from hant/Process.hx line 169
Uncaught exception - Process creation failure : /usr/lib/haxe/lib/refactor/3,4,1/scripts/js_to_haxe.cmd
haxelib run refactor convertFile --exclude-string-literals --exclude-comments INPUT_FILE.js OUTPUT_FILE.hx js_to_haxe.rules
haxelib run refactor convert --exclude-string-literals --exclude-comments INPUT_DIR *.js OUTPUT_DIR /[.]js$/.hx/ js_to_haxe.rules