{"id":19658542,"url":"https://github.com/cdaringe/deno-browser-libs","last_synced_at":"2026-06-05T20:31:57.740Z","repository":{"id":142017322,"uuid":"472111614","full_name":"cdaringe/deno-browser-libs","owner":"cdaringe","description":"Demonstrate compiling TypeScript into browser ready `ESM` modules/libraries using `deno`","archived":false,"fork":false,"pushed_at":"2023-12-15T02:27:28.000Z","size":5,"stargazers_count":1,"open_issues_count":1,"forks_count":0,"subscribers_count":3,"default_branch":"main","last_synced_at":"2025-02-18T06:08:46.506Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"TypeScript","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/cdaringe.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}},"created_at":"2022-03-20T21:52:27.000Z","updated_at":"2023-06-27T23:33:29.000Z","dependencies_parsed_at":null,"dependency_job_id":"f924314a-369a-471c-8f5b-bf6eeb85c777","html_url":"https://github.com/cdaringe/deno-browser-libs","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cdaringe%2Fdeno-browser-libs","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cdaringe%2Fdeno-browser-libs/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cdaringe%2Fdeno-browser-libs/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cdaringe%2Fdeno-browser-libs/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/cdaringe","download_url":"https://codeload.github.com/cdaringe/deno-browser-libs/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":240967620,"owners_count":19886258,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","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":"2024-11-11T15:38:03.106Z","updated_at":"2025-02-27T02:41:41.145Z","avatar_url":"https://github.com/cdaringe.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# deno browser libs (dbl) demo\n\nCompiling TypeScript -\u003e browser ready `ESM` modules/libraries using `deno`.\n\n`deno` is ESM oriented instrinsically, however, `deno` does **not offer a recipe for building/publishing of TS source for browser consumption**.\n\nThis project demonstrates [deb](https://github.com/cdaringe/rad/tree/main/src/build-buds/deb) to prepare deno browser libraries for publishing to HTTP servers.\n\n## Pre-requisite\n\n- Install [deno](https://deno.land/manual/getting_started/installation#download-and-install)\n- Install [rad](https://cdaringe.github.io/rad/):\n\n```sh\ndeno install --unstable -f -A -n rad https://raw.githubusercontent.com/cdaringe/rad/v6.9.1/src/bin.ts\n```\n\nIf you do not want to install rad into your global deno bins, see the rad website--you can use docker as well.\n\n## Demo\n\nThis project hosts **two** libaries, `foo` \u0026 `bar`. Observe them in `./foo` \u0026 `./bar` respectively.\n\nThese are basic TypeScript ESM libraries, which can be run and tested in deno.\n\nIn fact, run the tests to prove it:\n\n```sh\n$ rad -l info test\n```\n\nLet's build these modules for the browser. Run the build:\n\n```sh\n$ rad -l info build\n```\n\nWhat happened during the build, end-to-end?\n\n- Open `foo/mod.ts`\n  - Observe an import to `bar/mod.ts`\n    - This uses **`importMap.development.json`** to resolve the module locally\n- Run the build\n  - `bar/mod.ts` is now resolved to the URL requested in **`importMap.production.json`**\n  - This mapping is configured in `rad.ts`, in the `build` task.\n  - The build task does the following:\n    - compiles all modules from TS =\u003e ESM, and\n    - remaps `importMap.development.json` =\u003e `importMap.production.json`\n      - You may provide your own import remapping function instead of using `rewriteImportMapPath`, if desired\n\nFinally, upload your artifacts to the associated HTTP server. In my example, I sync the `./.build` directory to `https://static.cdaringe.com/esm/dbl/bar/`.\n\nThat's it! It's really not very much code. `deno` does the heavy lifting via `Deno.emit(...)`, but re-writing browser friendly imports via `importMap`s is missing link to bring the distribution of non-bundled libraries to life!\n\nDisclaimer, the `rad` build tool is **not required for use**. The `build` function is hosted in the `rad` repository. :)\n\n## Tasks\n\n- `rad -l info test` - run tests\n- `rad -l info build` - build browser ESM modules, ready to publish\n- `rad -l info publish` - rsync ESM modules to HTTP server\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcdaringe%2Fdeno-browser-libs","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcdaringe%2Fdeno-browser-libs","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcdaringe%2Fdeno-browser-libs/lists"}