{"_id":"@bytelab.studio/tsb","_rev":"1-5c042bd17ebc1e283eb0ba8b7b247dda","name":"@bytelab.studio/tsb","dist-tags":{"latest":"3.1.0"},"versions":{"3.0.0":{"name":"@bytelab.studio/tsb","version":"3.0.0","keywords":["typescript","bundler","build","module","package","typescript-bundler","nodejs","multi-platform","tooling","npm"],"author":{"name":"Christoph Koschel"},"license":"MIT","_id":"@bytelab.studio/tsb@3.0.0","maintainers":[{"name":"koschel-christoph","email":"christoph.koschel86@gmail.com"}],"homepage":"https://github.com/bytelab-studio/tsb#readme","bugs":{"url":"https://github.com/bytelab-studio/tsb/issues"},"bin":{"tsb":"out/bin/tsb.js"},"dist":{"shasum":"1fdc41fe8eb0afd303c1de522a59140b4e5fbaf0","tarball":"https://registry.npmjs.org/@bytelab.studio/tsb/-/tsb-3.0.0.tgz","fileCount":51,"integrity":"sha512-loXdz0DbZvlUCygRcwbJZXG1KnTpCTZj187jk5cdV04oWWmcBHcT+M39QOFdyhb+XKhy6I4J/3R3DHxt4znp5w==","signatures":[{"sig":"MEYCIQCOSkeZEhoj8TZY82L+CQ66nudj0Z8xY23C3PI0oemhagIhAOY0Mq3OG0KUt5x7BcjvhntXE8Qj0KmYVRfzTOo6CxL0","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":134992},"main":"","gitHead":"fece6e1925b30edad37d0cbe47baf41ffce96048","scripts":{"test":"echo \"Error: no test specified\" && exit 0"},"_npmUser":{"name":"koschel-christoph","email":"christoph.koschel86@gmail.com"},"repository":{"url":"git+https://github.com/bytelab-studio/tsb.git","type":"git"},"_npmVersion":"8.19.4","description":"A simple, fast bundler system for TypeScript","directories":{},"_nodeVersion":"16.20.2","dependencies":{"fnv-plus":"^1.3.1","uglify-js":"^3.19.1","typescript":"^5.5.4","@koschel-christoph/node.options":"^1.0.2"},"_hasShrinkwrap":false,"devDependencies":{"@types/node":"^20.14.12","@types/fnv-plus":"^1.3.2","@types/uglify-js":"^3.17.5"},"_npmOperationalInternal":{"tmp":"tmp/tsb_3.0.0_1722692302340_0.3689250046723489","host":"s3://npm-registry-packages"}},"3.1.0":{"name":"@bytelab.studio/tsb","version":"3.1.0","description":"A simple, fast bundler system for TypeScript","repository":{"type":"git","url":"git+https://github.com/bytelab-studio/tsb.git"},"author":{"name":"Christoph Koschel"},"license":"MIT","main":"","scripts":{"test":"echo \"Error: no test specified\" && exit 0"},"bin":{"tsb":"out/bin/tsb.js"},"keywords":["typescript","bundler","build","module","package","typescript-bundler","nodejs","multi-platform","tooling","npm"],"dependencies":{"@koschel-christoph/node.options":"^1.0.2","fnv-plus":"^1.3.1","typescript":"^5.5.4","uglify-js":"^3.19.1"},"devDependencies":{"@types/fnv-plus":"^1.3.2","@types/uglify-js":"^3.17.5","@types/node":"^20.14.12"},"gitHead":"a8cc302e5d3e549544496e3d17822089568d88bf","bugs":{"url":"https://github.com/bytelab-studio/tsb/issues"},"homepage":"https://github.com/bytelab-studio/tsb#readme","_id":"@bytelab.studio/tsb@3.1.0","_nodeVersion":"16.20.2","_npmVersion":"8.19.4","dist":{"integrity":"sha512-YcF1RP3oVB59UAERrFRWV49acIXcZhr+Wuz7KbRQAyOvaTciOI2PI9P+FOE6g18bjTfl6xbIrjdJlj4HQ4bJZg==","shasum":"2373524c14df53700736fcb285bdc5bee5a6c29c","tarball":"https://registry.npmjs.org/@bytelab.studio/tsb/-/tsb-3.1.0.tgz","fileCount":59,"unpackedSize":181840,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQD9J0OKv8t5EnzQ+d8yHlN9/G1AfpO2v9DtpDuydXSLGgIgDN+prIN2wr5TChVetOFEE6VbVz3WIEwwutguagFZKto="}]},"_npmUser":{"name":"koschel-christoph","email":"christoph.koschel86@gmail.com"},"directories":{},"maintainers":[{"name":"koschel-christoph","email":"christoph.koschel86@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/tsb_3.1.0_1723897588347_0.10842198474871756"},"_hasShrinkwrap":false}},"time":{"created":"2024-08-03T13:38:22.215Z","modified":"2024-08-17T12:26:28.750Z","3.0.0":"2024-08-03T13:38:22.563Z","3.1.0":"2024-08-17T12:26:28.540Z"},"bugs":{"url":"https://github.com/bytelab-studio/tsb/issues"},"author":{"name":"Christoph Koschel"},"license":"MIT","homepage":"https://github.com/bytelab-studio/tsb#readme","keywords":["typescript","bundler","build","module","package","typescript-bundler","nodejs","multi-platform","tooling","npm"],"repository":{"type":"git","url":"git+https://github.com/bytelab-studio/tsb.git"},"description":"A simple, fast bundler system for TypeScript","maintainers":[{"name":"koschel-christoph","email":"christoph.koschel86@gmail.com"}],"readme":"# TSB\n\nA simple, fast bundler system for TypeScript\n\n## Installation\n\n```shell\nnpm install -g @bytelab.studio/tsb\n```\n\n## Using the tool\n\nTo use the `tsb` tool for your project, follow the steps below.\n\n### Step 1: Initialize a Project\n\nFirst, let `tsb` handle the setup\n\n```shell\ntsb init\n```\n\nAfter running the command, your file structure should look like this:\n\n```text\n.\n├── node_modules\n│       └── @bytelab.studio\n│               └── tsb-runtime\n├── out\n├── package-lock.json\n├── package.json\n├── src\n├── tsb.js\n└── tsconfig.json\n```\n\n### Step 2: Configure Your Project\n\nA `tsb.js` file is generated automatically and looks something like this:\n\n> `tsb.js` is loaded in a sandbox context, so most Node.js features are disabled, including\n> `require` modules, except for `tsb`.\n\n```javascript\nconst {builder} = require(\"tsb\");\n\nbuilder\n    .module(\"my-module\")\n    .addFolders(\"./src\")\n    .output(\"./out\")\n    .platform(\"nodejs\")\n```\n\n- The `module` function sets the name of your project, similar to the `name` property in `package.json`.\n- The `addFolders` function adds a folder recursively to the source files.\n- The `output` function sets the output directory for your bundled files.\n- The `platform` function sets the output platform of the project, e.g., `nodejs` or `browser`\n\nAll flags except `--script` and `-h | --help` can be set through the config file.\n\n```text\nUsage: tsb build <files> [options]\n  -m=name, --module=name        The module name\n  <>                            The files to be compiled\n  -p=platform, --platform=platform\n                             The target platform\n  -e=file, --entry=file         The entry file\n  -o=path, --output=path        The output path\n  --chunk-size=bytes            Sets the minimal chunk size in bytes\n  --script                      Use tsb.js definition in the CWD\n  -h, --help                    Prints this help string\n  --plugin-minify               Minifies the JavaScript output\n```\n\n| Flag           | Function                 |\n|----------------|--------------------------|\n| &lt;files>     | `addFiles`, `addFolders` |\n| -m, --module   | `module`                 |\n| -p, --platform | `platform`               |\n| -e, --entry    | `entry`                  |\n| --chunk-size   | `chunkSize`              |\n| --plugin-*     | `plugins`                |\n\n### Step 3: Write Program Content\n\nNow, write the actual program.\n\n```typescript\n// src/foo.ts\n\nexport function foo() {\n    console.log(\"Foo\");\n}\n```\n\n```typescript\n// src/entry.ts\n\nimport {foo} from \"./foo\"\n\nfoo();\n```\n\n### Step 4: Build the Project\n\nTo build the project, run the following command in your project directory:\n\n```shell\ntsb build --script\n```\n\nFiles are generated in the output folder:\n\n```text\nout\n ├── chunks\n │       └── <chunk>.js\n └── <module>.js\n```\n\n### Step 5: Run the Project\n\nTo run the project, use the following command:\n\n```shell\nnode ./out/<module>.js\n```\n\nNow your project is set up, configured, and ready to run using `tsb`.\n\n### NodeJS Modules\n\nCurrently, there is no way to include NodeJS modules directly in the bundled files. However, loading of NodeJS modules\nis supported on the NodeJS platform, and context switching with AppDomains across NodeJS modules is also supported.\n\n## Roadmap\n\nNothing in this roadmap is a promise. Everything in this roadmap is changeable.\n\n### Planned\n\n- [ ] Some sort of library system using NPM to install bundled libraries\n\n### v3.1.0\n\n- [x] Multi-platform support\n- [x] Macro-Plugin\n- [x] Enable loading chunks that are not directly integrated\n- [x] Enable loading files via resource path\n\n","readmeFilename":"README.md"}