jvalue / jayvee

Jayvee is a domain-specific language and runtime for automated processing of data pipelines
https://jvalue.github.io/jayvee/
150 stars 15 forks source link

Add sourcemaps to development build #581

Closed joluj closed 5 months ago

joluj commented 5 months ago

Sourcemaps help debugging, especially when editing the interpreter. The sourcemaps are only emitted when building explicitly with the configuration development. This is enabled by default when running the examples.

Before (References compiled and bundled JS code):

file:///path/to/jayvee/dist/apps/interpreter/main.js:14606
throw new Error("TEST");
      ^

Error: TEST
    at file:///path/to/jayvee/dist/apps/interpreter/main.js:14606:7
    at ModuleJob.run (node:internal/modules/esm/module_job:218:25)
    at async ModuleLoader.import (node:internal/modules/esm/loader:329:24)
    at async loadESM (node:internal/process/esm_loader:34:7)
    at async handleMainPromise (node:internal/modules/run_main:113:12)

After (References TypeScript source):

/path/to/jayvee/libs/interpreter-lib/src/index.ts:10
throw new Error('TEST');
      ^

Error: TEST
    at <anonymous> (/path/to/jayvee/libs/interpreter-lib/src/index.ts:10:7)
    at ModuleJob.run (node:internal/modules/esm/module_job:218:25)
    at async ModuleLoader.import (node:internal/modules/esm/loader:329:24)
    at async loadESM (node:internal/process/esm_loader:34:7)
    at async handleMainPromise (node:internal/modules/run_main:113:12)
joluj commented 5 months ago

@TungstnBallon FYI, these sourcemaps would have helped you with the runtime error we've talked about on wednesday.