Hella lines of code added, but like 90+% of them are tests for cjs and esm builds.
Summary
Add script from accio (with minor adjustments) to compile deno code down to cjs and esm (deno 2 node module didn't work and was too much for what we're doing anyways. we just need to strip out .ts extensions)
Add tsconfig files for both cjs and esm builds
Add unit tests for cjs
Add unit tests for esm using typescript
How to build and test
Run yarn install
Run yarn build
This will run console/build_esm_lib, which will create a temporary directory under tmp/conversion_workspace. It will use this workspace to make a copy of the source code, remove .ts extensions, and run the typescript compiler against the modified source code using either tsconfig.cjs.json or tsconfig.esm.json depending on what build is running.
Run yarn test
This will run jest against tests/cjs and tests/esm. All tests should pass. The tests are basically copies of the tests/deno tests, but modified to work with cjs and esm. The esm tests use typescript.
Closes #155
Hella lines of code added, but like 90+% of them are tests for cjs and esm builds.
Summary
How to build and test
Run
yarn install
Run
yarn build
This will runconsole/build_esm_lib
, which will create a temporary directory undertmp/conversion_workspace
. It will use this workspace to make a copy of the source code, remove.ts
extensions, and run the typescript compiler against the modified source code using eithertsconfig.cjs.json
ortsconfig.esm.json
depending on what build is running.Run
yarn test
This will run jest againsttests/cjs
andtests/esm
. All tests should pass. The tests are basically copies of thetests/deno
tests, but modified to work with cjs and esm. The esm tests use typescript.