invicticide / fractive

Fractive is a free, open-source, Markdown-based hypertext authoring tool for writing interactive fiction.
http://fractive.io
Other
37 stars 5 forks source link

Optional transpiler step #41

Open NQNStudios opened 6 years ago

NQNStudios commented 6 years ago

Since we're writing the engine in TypeScript it only makes sense that someone might want to write their story scripts in some other dialect of JavaScript. fractive.json should optionally specify the command for a transpiler, and Compiler.ts can run that command on every story script given in the glob expressions before bundling/copying them into the output folder.

NQNStudios commented 6 years ago

Spent some time trying to implement this by modifying Compiler.ts but I realized that it would involve invoking child_process to call transpilers from the command line, and it started to seem like a bit too much like a pain.

Here's as far as I got: https://github.com/NQNStudios/SpaceFractive/commit/b77ec784e9f4e0310436677f548229e147294b59

In the meantime, I'm going to sidestep this for Space Bard by just incorporating transcompilation into the game's build.sh bash script.