chore: Set up development environment

Add the civet and typescript compilers, implement a build step,
  provide examples of using from es6, script, and command line.
  Of course, there is no actual behavior produced; convert always produces
  'foo' at the moment.
This commit is contained in:
Glen Whitney 2023-09-01 08:20:34 -07:00
parent 26f1be2d67
commit 67a07e2000
10 changed files with 468 additions and 1 deletions

2
src/example.civet Normal file
View file

@ -0,0 +1,2 @@
{convert} from ./index.js
console.log convert 'bar'

14
src/index.civet Normal file
View file

@ -0,0 +1,14 @@
type Tree = {[key:string]: string | Tree}
export function tree97(vrml1: string): Tree
{converted: 'foo'}
function render(t: string | Tree): string
if typeof t is 'string'
return t
if result := t.converted
render result
else '<Conversion failed>'
export function convert(vrml1: string): string
render tree97 vrml1