{"id":17452361,"url":"https://github.com/omar-azmi/build_tools_ts","last_synced_at":"2025-08-03T23:32:12.504Z","repository":{"id":248157022,"uuid":"778667478","full_name":"omar-azmi/build_tools_ts","owner":"omar-azmi","description":"general deno build tool scripts which I practically use in all of my typescript repos","archived":false,"fork":false,"pushed_at":"2024-10-25T22:21:43.000Z","size":6283,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2024-11-25T23:41:55.503Z","etag":null,"topics":["build-tools","bundler","converter","deno","dnt","docs-generator","esbuild","npm","typedoc","typescript"],"latest_commit_sha":null,"homepage":"https://omar-azmi.github.io/build_tools_ts/","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/omar-azmi.png","metadata":{"files":{"readme":"readme.md","changelog":null,"contributing":null,"funding":null,"license":"license.md","code_of_conduct":".github/code_of_conduct.md","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":"2024-03-28T06:51:25.000Z","updated_at":"2024-10-25T22:20:07.000Z","dependencies_parsed_at":"2024-07-12T19:31:33.332Z","dependency_job_id":"2608258b-423c-4e41-9bfb-d50ea565f262","html_url":"https://github.com/omar-azmi/build_tools_ts","commit_stats":null,"previous_names":["omar-azmi/build_tools_ts"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/omar-azmi%2Fbuild_tools_ts","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/omar-azmi%2Fbuild_tools_ts/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/omar-azmi%2Fbuild_tools_ts/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/omar-azmi%2Fbuild_tools_ts/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/omar-azmi","download_url":"https://codeload.github.com/omar-azmi/build_tools_ts/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":228571844,"owners_count":17938772,"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":["build-tools","bundler","converter","deno","dnt","docs-generator","esbuild","npm","typedoc","typescript"],"created_at":"2024-10-17T23:06:08.066Z","updated_at":"2025-08-03T23:32:12.478Z","avatar_url":"https://github.com/omar-azmi.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# @oazmi/build-tools\n\nThis package contains various convenience tools for codebase transformation, documentation generation, and code bundling.\n\nUnder the hood, it relies on:\n\n- [`esbuild`](https://www.npmjs.com/package/esbuild) + [`esbuild-deno-loader`](https://jsr.io/@luca/esbuild-deno-loader) for bundling ({@link dist!}).\n- [`dnt`](https://jsr.io/@deno/dnt) for deno to node project transformation ({@link docs!}).\n- [`typedoc`](https://www.npmjs.com/package/typedoc) for documentation generation ({@link npm!}).\n\n## Building Typescript Documentation\n\n### Through the CLI\n\nTo generate documentation for your typescript project through the shell, simply run:\n\n```shell\ndeno run -A \"jsr:@oazmi/build-tools/cli/docs\"\n```\n\nYou may also provide a json file containing a documentation-generation configuration, by passing its location using the cli `--config=\"./path/to/config.json\"`, and then using the schema in {@link cli/docs!CliConfigJson | `CliConfigJson`} to configure the json bundling options. \u003cbr\u003e\nSee the {@link cli/docs!} module's documentation for further reading.\n\n### Through Scripting\n\nTo generate documentation through scripting, use the {@link docs!buildDocs | `buildDocs`} function. \u003cbr\u003e\nRead the {@link docs!} module's documentation for advanced usage.\n\nAn example to get a taste of the configurable options:\n\n```ts\nimport { buildDocs, type BuildDocsConfig, defaultBuildDocsConfig } from \"jsr:@oazmi/build-tools/docs\"\n\nconst my_config: BuildDocsConfig = {\n\t...defaultBuildDocsConfig,\n\tdir: \"./mydocs/\",\n\tsite: \"./mydocs/\",\n\tpreserveTemporary: false,\n\ttypedoc: {\n\t\t// place optional typedoc configurations here\n\t\tgithubPages: true,\n\t},\n\ttext: [\"./helloworld.txt\", \"Konichiwa Meena-San!\\nShine' Kuda Sai Meena-San!\\nSosshtte Arigato yo Meena-San Desu Desu!\"],\n}\nconst docs_artifacts = await buildDocs(my_config)\nalert(\"press any button to delete the generated docs in:\", my_config.dir)\n// cleanup the generated documentation html site under \"./mydocs/\"\ndocs_artifacts.cleanup()\n```\n\n## Transforming Deno project to Node project\n\n### Through the CLI\n\nTo transform your deno project to a node-based project through the shell, simply run:\n\n```shell\ndeno run -A \"jsr:@oazmi/build-tools/cli/npm\" --install\n```\n\nYou may also provide a json file containing a node-project-generation configuration, by passing its location using the cli `--config=\"./path/to/config.json\"`, and then using the schema in {@link cli/npm!CliConfigJson | `CliConfigJson`} to configure the json bundling options. \u003cbr\u003e\nSee the {@link cli/npm!} module's documentation for further reading.\n\n### Through Scripting\n\nTo transform to a node-based project through scripting, use the {@link npm!buildNpm | `buildNpm`} function. \u003cbr\u003e\nRead the {@link npm!} module's documentation for advanced usage.\n\nAn example to catch a whiff of stinky node's configurable options:\n\n```ts\nimport { buildNpm, type BuildNpmConfig, defaultBuildNpmConfig } from \"jsr:@oazmi/build-tools/npm\"\n\nconst my_config: BuildNpmConfig = {\n\t...defaultBuildNpmConfig,\n\tdir: \"./npm-release/\",\n\tdnt: {\n\t\t// place optional dnt configurations here\n\t\ttypeCheck: true,\n\t\tdeclaration: \"inline\",\n\t\ttest: true,\n\t\tskipNpmInstall: false,\n\t},\n\ttext: [\"./helloworld.txt\", \"Konichiwa Meena-San!\\nShine' Kuda Sai Meena-San!\\nSosshtte Arigato yo Meena-San Desu Desu!\"],\n}\nconst npm_artifacts = await buildNpm(my_config)\nalert(\"press any button to delete the generated npm-build in:\", my_config.dir)\n// cleanup the generated npm-build under \"./npm-release/\"\nnpm_artifacts.cleanup()\n```\n\n## Bundle Source Code to Javascript\n\n### Through the CLI\n\nTo create a bundled and minified distribution of your deno project's exports through the shell, simply run:\n\n```shell\ndeno run -A \"jsr:@oazmi/build-tools/cli/dist\"\n```\n\nCheck out the {@link cli/dist!CliArgs | `CliArgs`} interface for a list of configurable options via command line switches (i.e. `--command-name=\"command_value\"`)\n\nYou may also provide a json file containing a bundling configuration, by passing its location using the cli `--config=\"./path/to/config.json\"`, and then using the schema in {@link cli/dist!CliConfigJson | `CliConfigJson`} to configure the json bundling options. \u003cbr\u003e\nSee the {@link cli/dist!} module's documentation for further reading.\n\n### Through Scripting\n\nTo bundle your source code to javascript through scripting, use the {@link dist!buildDist | `buildDist`} function for single-pass builds, and for double-pass builds use: {@link dist!bundle | `bundle`} + {@link dist!transform | `transform`} + {@link funcdefs!createFiles | `createFiles`} sequentially. \u003cbr\u003e\nRead the {@link dist!} module's documentation for advanced usage.\n\nAn example to get a flavor of the configurable options:\n\n```ts\nimport { buildDist, type BuildDistConfig, defaultBuildDistConfig, esStop } from \"jsr:@oazmi/build-tools/dist\"\n\nconst my_config: BuildDistConfig = {\n\t...defaultBuildDistConfig,\n\t// when no input files are provided, the function reads your \"deno.json\" file to use its \"exports\" field as the input.\n\tinput: {\n\t\t\"my-lib.js\": \"./src/mod.ts\",\n\t\t\"plugins/hello.js\": \"./src/plugins/hello.ts\",\n\t\t\"plugins/world.js\": \"./src/plugins/world.ts\",\n\t},\n\tdeno: \"./deno.json\",\n\tdir: \"./dist/\",\n\tlog: \"verbose\",\n\t// enabling `splitting` makes the `input` entrypoints use the same source for shared code.\n\tesbuild: { splitting: true },\n}\nawait buildDist(my_config)\n// your output files are now saved to: \"./dist/my-lib.js\", \"./dist/plugins/hello.js\", and \"./dist/plugins/world.js\"\n\n// it is important that you stop esbuild manually, otherwise the deno process will not quit automatically.\nawait esStop()\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fomar-azmi%2Fbuild_tools_ts","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fomar-azmi%2Fbuild_tools_ts","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fomar-azmi%2Fbuild_tools_ts/lists"}