{"id":50861285,"url":"https://github.com/mununki/rescript-sourcemap-test","last_synced_at":"2026-06-14T21:35:45.643Z","repository":{"id":355346479,"uuid":"1222275637","full_name":"mununki/rescript-sourcemap-test","owner":"mununki","description":null,"archived":false,"fork":false,"pushed_at":"2026-05-03T05:20:01.000Z","size":30,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2026-05-03T07:21:25.930Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"HTML","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/mununki.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2026-04-27T07:53:51.000Z","updated_at":"2026-05-03T05:20:05.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/mununki/rescript-sourcemap-test","commit_stats":null,"previous_names":["mununki/rescript-sourcemap-test"],"tags_count":null,"template":false,"template_full_name":null,"purl":"pkg:github/mununki/rescript-sourcemap-test","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mununki%2Frescript-sourcemap-test","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mununki%2Frescript-sourcemap-test/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mununki%2Frescript-sourcemap-test/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mununki%2Frescript-sourcemap-test/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/mununki","download_url":"https://codeload.github.com/mununki/rescript-sourcemap-test/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mununki%2Frescript-sourcemap-test/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":34339195,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-06-14T02:00:07.365Z","response_time":62,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2026-06-14T21:35:45.023Z","updated_at":"2026-06-14T21:35:45.638Z","avatar_url":"https://github.com/mununki.png","language":"HTML","funding_links":[],"categories":[],"sub_categories":[],"readme":"# ReScript Source Map Test\n\nVite + React app for checking `.res -\u003e .js.map` output from a local ReScript\ncompiler branch.\n\n## Setup\n\nCheck out and build the sourcemap branch in a local ReScript compiler clone. The\nexamples below assume the compiler repository is cloned as `rescript` next to\nthis test project:\n\n```sh\ncd /path/to/rescript\ngit fetch origin\ngit checkout sourcemap\nyarn install\nopam exec -- make\n```\n\nThe compiler repository uses Yarn, and `make` builds both the compiler and\nrewatch binaries used by the linked `rescript` package.\n\nThe app uses npm packages for `@rescript/react` and `@rescript/runtime`. The\nonly local package link is the `rescript` compiler package. By default,\n`package.json` points at `../rescript`. If your compiler checkout is not next to\nthis project, update that path before installing:\n\n```json\n{\n  \"devDependencies\": {\n    \"rescript\": \"link:/path/to/rescript\"\n  }\n}\n```\n\nThis app enables linked source maps in `rescript.json` with:\n\n```json\n{\n  \"sourceMap\": {\n    \"enabled\": \"always\",\n    \"mode\": \"linked\",\n    \"sourcesContent\": true\n  }\n}\n```\n\nThis test project uses `\"always\"` so the build-based browser and Node checks\nproduce source maps from `pnpm build` and `pnpm run test:node-sourcemap`.\nFor normal development projects, use `\"dev\"` if you only want source maps\nduring `rescript watch`.\n\n`@rescript/runtime` is pinned to the npm-published 13 alpha runtime because this\ntest app is meant to run against a 13 alpha compiler branch.\n\nInstall this test app's dependencies with pnpm after the `rescript` link points\nat your local checkout:\n\n```sh\ncd /path/to/rescript-sourcemap-test\npnpm install\n```\n\nBuild ReScript and the Vite production bundle:\n\n```sh\npnpm build\n```\n\nAfter changing compiler code, rerun `opam exec -- make` in the compiler checkout\nbefore rebuilding this test app.\n\n## Browser Test\n\nRun the Vite dev server:\n\n```sh\npnpm dev\n```\n\nReact app test:\n\n1. Open `http://127.0.0.1:5173/`.\n2. Open DevTools Sources and search for `SourceMapProbe.res`.\n3. Set a breakpoint on `throw(BrowserSourceMapError(message))`.\n4. Click `Throw ReScript exception`.\n5. The breakpoint should pause in `SourceMapProbe.res`.\n\nReact console-link test:\n\n1. Open `http://127.0.0.1:5173/`.\n2. Click `Throw JS Error`.\n3. The console stack should include `SourceMapProbe.res`.\n\nThe `Throw ReScript exception` button throws a ReScript exception object.\nReact reports errors thrown from synthetic event handlers through React's own\ndispatch path, so Chrome may show a top-level `react-dom_client.js` console\nlink even though the nested stack and breakpoints still map to `.res`.\n\nDirect generated-JS test:\n\n1. Open `http://127.0.0.1:5173/direct-browser.html`.\n2. Open DevTools Sources and search for `DirectBrowserProbe.res`.\n3. Set a breakpoint on `throw(DirectBrowserSourceMapError(message))`.\n4. Click `Throw from direct ReScript module`.\n5. The breakpoint should pause in `DirectBrowserProbe.res`.\n\nLine and column accuracy test:\n\n1. Open `http://127.0.0.1:5173/accuracy.html`.\n2. Open DevTools Sources and search for `AccuracyProbe.res`.\n3. Set breakpoints on these call sites:\n   - `JsError.throwWithMessage` inside `asciiBaseline`\n   - `JsError.throwWithMessage` inside `unicodeColumn`\n   - `JsError.throwWithMessage` inside `emojiColumn`\n   - `JsError.throwWithMessage` inside `multipleExpressions`\n4. Click the matching buttons. Each pause should land on the matching `.res`\n   line, and the highlighted expression should be near the `JsError` call.\n5. Search for `CrLfProbe.res`, set a breakpoint on its `JsError.throwWithMessage`\n   call, then click `CRLF source file`.\n\nFor the Unicode and emoji cases, the important check is the column location:\nthe `unicodeColumn` and `emojiColumn` functions put Korean text or an emoji\nbefore the throwing expression on the same source line. If UTF-8 byte offsets\nare accidentally used as source-map columns, these breakpoints tend to bind too\nfar to the right.\n\nPipe and pattern match test:\n\n1. Open `http://127.0.0.1:5173/pipe-match.html`.\n2. Open DevTools Sources and search for `PipeMatchProbe.res`.\n3. For pipe mapping, set breakpoints around the `runPipe` pipe expression,\n   especially the `\"pipe-input\"` line, then click `Throw from pipe chain`.\n4. When the exception pauses in `throwPipeMatchProbeErrorWithPrefix`, select\n   the `runPipe` frame in the call stack. It should point back to the pipe\n   expression in `PipeMatchProbe.res`.\n5. For pattern matching, set breakpoints on each branch body inside `describe`,\n   then click the matching `PipeOk`, `PipeMissing`, and `PipeFailed` buttons.\n6. Each breakpoint should bind in `PipeMatchProbe.res`, and the console stack\n   should include `.res` locations for the throwing branch.\n\nProduction build smoke test:\n\n```sh\npnpm build\n```\n\nFor browser behavior, prefer the manual DevTools checks above. The compiler PR\nhas its own repository test for `.js.map` file generation.\n\n## Node Test\n\nRun the automated Node stack trace check:\n\n```sh\npnpm run test:node-sourcemap\n```\n\nIt builds ReScript, runs `src/NodeProbe.js` with `node --enable-source-maps`,\nexpects the program to throw, and verifies that the stack trace mentions\n`NodeProbe.res`.\n\nFor manual inspection:\n\n```sh\npnpm run res:build\nnode --enable-source-maps src/NodeProbe.js\n```\n\nThat command is expected to exit with an error. With source maps enabled, the\nstack trace should point at `src/NodeProbe.res`. Without `--enable-source-maps`,\nNode should report `src/NodeProbe.js` instead.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmununki%2Frescript-sourcemap-test","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmununki%2Frescript-sourcemap-test","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmununki%2Frescript-sourcemap-test/lists"}