GOBL.js (WASM)
This folder contains the files necessary to execute the GOBL client library in your web browser. The core library is written in Go, and compiled to WebAssembly. The file gobl.js
provides a thin JavaScript wrapper around the compiled WebAssembly running in a web worker.
To execute a simple demo of the GOBL library in your browser, you will need to:
- Install Go (1.17 or newer)
- From this directory, execute the command
./build.sh
which will compile the WASM target and start a bare web server.
- In your browser, navigate to
http://localhost:9999/
- Open the JavaScript console in your browser to see the test output.
Running The GOBL.js Playground
Development
To start the local server via browser-sync, including hot reloading (no browser refresh required to see changes):
npm run dev
To start the interactive cyprus.io browser test runner. You must have a server running (npm run dev
or npm run start
for prod). This interactive UI runs tests against whichever server you have running. (Note: the Lighthouse performance tests will fail against the development server, because performance is much slower there.):
npm run test
To run the testing suite as it would run on a ci server, against the production build:
npm run ci
To run the code formatting checking tools eslint
(and prettier
):
npm run check-formatting
Production
For deployment, build the project and serve it on a simple http server.
npm start
Packages
Recommended Text Editor Extensions
Notes
- We're using tailwindcss via a CDN for now to try it out. If we decide to stick with it, we should add it in via a css build tool (like postcss) instead of using the CDN directly.
- For now everything (dev, prod, testing) uses port 8080. If/when that gets in the way of anything, we can set it up to use a different port for dev/testing vs prod.