{"id":14155644,"url":"https://github.com/danielroe/siroc","last_synced_at":"2025-04-05T01:06:56.058Z","repository":{"id":39000572,"uuid":"270639947","full_name":"danielroe/siroc","owner":"danielroe","description":"Zero-config build tooling for Node","archived":false,"fork":false,"pushed_at":"2024-10-25T14:56:56.000Z","size":5142,"stargazers_count":152,"open_issues_count":23,"forks_count":4,"subscribers_count":4,"default_branch":"main","last_synced_at":"2024-10-30T05:58:10.212Z","etag":null,"topics":["bundle","node","package","rollup","typescript"],"latest_commit_sha":null,"homepage":"","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/danielroe.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":null,"code_of_conduct":"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},"funding":{"github":["danielroe"]}},"created_at":"2020-06-08T11:18:57.000Z","updated_at":"2024-10-12T22:23:30.000Z","dependencies_parsed_at":"2024-02-24T17:27:12.023Z","dependency_job_id":"4d41f20f-7217-43f1-8230-d21896b9a765","html_url":"https://github.com/danielroe/siroc","commit_stats":{"total_commits":325,"total_committers":9,"mean_commits":"36.111111111111114","dds":0.6338461538461538,"last_synced_commit":"333cca7e4c1b1a2f7673061c9288b38dcc6fc637"},"previous_names":["nuxt-contrib/siroc","unjs/siroc"],"tags_count":38,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/danielroe%2Fsiroc","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/danielroe%2Fsiroc/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/danielroe%2Fsiroc/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/danielroe%2Fsiroc/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/danielroe","download_url":"https://codeload.github.com/danielroe/siroc/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247271530,"owners_count":20911587,"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":["bundle","node","package","rollup","typescript"],"created_at":"2024-08-17T08:04:40.366Z","updated_at":"2025-04-05T01:06:56.037Z","avatar_url":"https://github.com/danielroe.png","language":"TypeScript","readme":"![siroc](https://user-images.githubusercontent.com/904724/101661809-0375af80-3a49-11eb-9c82-0b84306f9fc7.png)\n\n\n# 🌬️ siroc\n\n[![npm version][npm-version-src]][npm-version-href]\n[![Github Actions][github-actions-src]][github-actions-href]\n[![alerts][alerts-src]][alerts-href]\n[![grade][grade-src]][grade-href]\n\u003c!-- [![npm downloads][npm-downloads-src]][npm-downloads-href] --\u003e\n\n\u003e `siroc` is a zero-config but extensible framework for developing Node applications and libraries\n\n## Features\n\n- 💯 **Zero-config required**: Intelligent support for your package\n  - Supports running and compiling TypeScript and the latest JavaScript syntax\n- ⚒️ **Extensible**: Write your own commands and build hooks\n- 💪 **Typescript**: Fully typed and self-documenting\n\n**`siroc` is still a work in progress. Feedback is welcome, and changes will be frequent.**\n\n## Quick start\n\nJust install `siroc`.\n\n```bash\n# You can install siroc as a development dependency\npnpm i siroc --dev\n\n# ... or install globally\npnpm -g i siroc\n```\n\n## Configuration\n\nYou can configure `siroc` by creating a `siroc.config.ts`, `siroc.config.js` or `siroc.config.json` file at the same level as your `package.json`.\n\nIn a monorepo, any configuration options at the root level are inherited by your workspaces, though of course you can override them.\n\n```js\nimport { defineSirocConfig } from 'siroc'\n\nexport default defineSirocConfig({\n  // fully typed options\n})\n```\n\n## Commands\n\n### `siroc build`\n\n`siroc` knows what to build based on your `package.json`.\n\nBy default, `siroc` will build your `src/index.js` or `src/index.ts` file into whatever output file is specified in your package.json's `main` field.\n\nIf you have specified additional binaries, `siroc` will look for input files matching their names.\n\nUnder the hood, `siroc` uses `rollup` and `esbuild` to build and produce type definitions for your files.\n\n#### Monorepos\n\nIf you have enabled yarn workspaces, siroc will build each of your workspaces. You can choose to build only some of these by specifying what to build.\n\n```bash\nyarn siroc build @mypackage/cli\n```\n\n#### Watch mode\n\nYou can build in watch mode, which will rebuild as necessary when source files change:\n\n```\nyarn siroc build --watch\n```\n\n#### Configuration\n\nAt the most basic level, your entrypoints are configured in your `package.json`:\n\n- `bin` (see [npm docs](https://docs.npmjs.com/files/package.json#bin))\n- `main`, `module` and `browser` (see [npm docs](https://docs.npmjs.com/files/package.json#main))\n- `types` if you want a TS declaration file to be generated for your main/module/browser entrypoints\n- `exports` (see [npm docs](https://nodejs.org/api/packages.html#packages_conditional_exports))\n\nThere are some conventions in place of configuration that are worth noting:\n* the file type is inferred from the file name if possible (e.g. `babel.es.js` will be in 'es' format)\n* `main` defaults to CJS, `module` to ES, `browser` to UMD, and `bin` to CJS\n* if you have a folder mapped using [subpath patterns](https://nodejs.org/api/packages.html#packages_subpath_patterns) and it matches a folder within your `src` folder, the files within will be copied across and lightly transpiled using [mkdist](https://github.com/unjs/mkdist).\n\n##### Example\n```json5\n{\n  \"exports\": {\n    \".\": {\n      // This will be compiled in CJS and matched to src/index.ts\n      \"require\": \"./dist/index.js\",\n      // This will be compiled in ES and matched to src/index.ts\n      \"import\": \"./dist/index.es.js\"\n    },\n    // src/templates will be lightly transpiled with mkdist and copied to dist/templates\n    \"./templates/*\": \"./dist/templates/*\",\n    // siroc will not touch this\n    \"./package.json\": \"./package.json\"\n  },\n  // This will be compiled in CJS and matched to src/index.ts\n  \"main\": \"./dist/index.js\",\n  // This will be compiled in ES and matched to src/index.ts\n  \"module\": \"./dist/index.es.js\",\n  // Types will be generated for src/index.ts\n  \"types\": \"./dist/index.d.ts\",\n  \"bin\": {\n    // This will be compiled in CJS and matched to src/cli/index.ts\n    \"siroc\": \"bin/cli.js\",\n    // This will be compiled in CJS and matched to src/cli/runtime.ts\n    \"siroc-runner\": \"bin/runtime.js\"\n  }\n}\n```\n\n#### Build hooks\n\n`siroc` makes available three hooks for customising your build, if you need it.\n\n1. `build:extend`\n1. `build:extendRollup`\n1. `build:done`\n\n### `siroc dev`\n\nIf you're working in a monorepo, it can be helpful to have accurate and up-to-date intellisense when importing from other libraries in a monorepo, without having to rebuild every time you make changes.\n\nRunning `siroc dev` will replace your package entrypoints with stubs that point to your source files. Your binaries will run your source files directly using `jiti`.\n\n### `siroc run`\n\nYou can run arbitrary shell commands or node scripts using the power of [the `jiti` runtime](https://github.com/unjs/jiti).\n\nFor example:\n\n```bash\n# You can run a node script written in TypeScript\nyarn siroc run myfile.ts\n\n# You can run a command in all your workspaces\nyarn siroc run ls --workspaces\n```\n\n## Contributors\n\nContributions are very welcome.\n\n1. Clone this repo\n\n   ```bash\n   git clone https://github.com/unjs/siroc\n   ```\n\n2. Install dependencies and build project\n\n   ```bash\n   yarn\n\n   # Stub modules for rapid development\n   yarn siroc dev\n\n   # Test (on changes)\n   yarn siroc jest\n   ```\n\n**Tip:** You can also run `yarn link` within a package directory to test the module locally with another project.\n\n## License\n\n[MIT License](./LICENCE) - Made with 💖\n\n\n\u003c!-- Badges --\u003e\n[npm-version-src]: https://img.shields.io/npm/v/siroc?style=flat-square\n[npm-version-href]: https://npmjs.com/package/siroc\n\n[npm-downloads-src]: https://img.shields.io/npm/dm/siroc?style=flat-square\n[npm-downloads-href]: https://npm.chart.dev/siroc\n\n[github-actions-src]: https://img.shields.io/github/actions/workflow/status/unjs/siroc/ci.yml?branch=main\u0026style=flat-square\n[github-actions-href]: https://github.com/unjs/siroc/actions/workflows/ci.yml\n\n[alerts-src]: https://img.shields.io/lgtm/alerts/github/unjs/siroc?style=flat-square\n[alerts-href]: https://lgtm.com/projects/g/unjs/siroc\n\n[grade-src]: https://img.shields.io/lgtm/grade/javascript/github/unjs/siroc?style=flat-square\n[grade-href]: https://lgtm.com/projects/g/unjs/siroc\n","funding_links":["https://github.com/sponsors/danielroe"],"categories":["typescript"],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdanielroe%2Fsiroc","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdanielroe%2Fsiroc","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdanielroe%2Fsiroc/lists"}