{"_id":"@andyjessop/bakery","_rev":"1-c47590e05f436ed6ed6492316e7040ef","name":"@andyjessop/bakery","dist-tags":{"latest":"0.0.2"},"versions":{"0.0.1":{"name":"@andyjessop/bakery","version":"0.0.1","author":{"name":"Andy Jessop"},"license":"CC BY-NC 4.0","type":"module","bin":{"bakery":"bin/bakery"},"scripts":{"build":"bun build ./scripts/command/command.ts --compile --outfile bin/bakery","serve":"bun run --cwd ./apps/server serve","command":"bun run ./scripts/command/command.ts"},"devDependencies":{"@biomejs/biome":"1.6.2","@types/bun":"^1.0.10","nx":"18.1.3"},"workspaces":["apps/*","packages/*"],"dependencies":{"@types/minimist":"^1.2.5","minimist":"^1.2.8","react":"^18.2.0"},"_id":"@andyjessop/bakery@0.0.1","gitHead":"9f9882fada7199cc0f2450c6f3f38a557aa9b105","description":"<p align=\"center\">   <img src=\"./assets/bakery.png\" width=400/> </p>","_nodeVersion":"20.11.0","_npmVersion":"10.5.0","dist":{"integrity":"sha512-rpzO7hFlQHN84FiFKt5UWbUrh4t9WRuULpD24dKPX9WWWxAHcFYBd9R7UCw0Jn1NXjcTdmGoR6Mre6DyhkYIgw==","shasum":"9723cbbfa1cbae5be028d317739f9a4081710416","tarball":"https://registry.npmjs.org/@andyjessop/bakery/-/bakery-0.0.1.tgz","fileCount":4,"unpackedSize":52801789,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIGOk7dd+UXCbuog25IN7e3qvUM8M8o14MJ5SalsmLxEhAiEArjCIqdIUJLWLcUSCJ73R+EphK3cEPdNS9G4X+AA0iUg="}]},"_npmUser":{"name":"andrewdjessop","email":"andrewdjessop@gmail.com"},"directories":{},"maintainers":[{"name":"andrewdjessop","email":"andrewdjessop@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/bakery_0.0.1_1711631166615_0.4814080421522131"},"_hasShrinkwrap":false},"0.0.2":{"name":"@andyjessop/bakery","version":"0.0.2","author":{"name":"Andy Jessop"},"license":"CC BY-NC 4.0","type":"module","bin":{"bakery":".bin/bakery"},"scripts":{"build":"bun build ./lib/command/command.ts --compile --outfile .bin/bakery","publish":"npm publish --access=public","serve":"bun run --cwd ./apps/server serve","test":"bun test","command":"bun run ./lib/command/command.ts"},"devDependencies":{"@biomejs/biome":"1.6.2","@types/bun":"^1.0.10"},"workspaces":["apps/*","packages/*"],"dependencies":{"@types/minimist":"^1.2.5","minimist":"^1.2.8","react":"^18.2.0"},"_id":"@andyjessop/bakery@0.0.2","gitHead":"3f2098e1a543fbf1d72bf09fb28c805b207465d2","description":"<p align=\"center\">   <img src=\"./assets/bakery.png\" width=400/> </p>","_nodeVersion":"20.11.0","_npmVersion":"10.5.0","dist":{"integrity":"sha512-6vCSAnyUkKHdE8kk4H31THFBB/xV4mWElT8QUJ+jRRB0ei5YVliSkOmE2WU86kyb6SCWEH27fEw5J8aSgXK6aQ==","shasum":"afce5080031cc5ace00275f0960776d0d884b2ef","tarball":"https://registry.npmjs.org/@andyjessop/bakery/-/bakery-0.0.2.tgz","fileCount":4,"unpackedSize":52684026,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCkHf2IHijYWxa4R8A1KDXqVJAgOAgsVHdWR0eyiJqUeQIgEMrRob3E60J2e1AQXBzEFcEu4KzKU4yUmHCiG9aytGg="}]},"_npmUser":{"name":"andrewdjessop","email":"andrewdjessop@gmail.com"},"directories":{},"maintainers":[{"name":"andrewdjessop","email":"andrewdjessop@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/bakery_0.0.2_1712259779434_0.734671909007726"},"_hasShrinkwrap":false}},"time":{"created":"2024-03-28T13:06:06.510Z","0.0.1":"2024-03-28T13:06:06.990Z","modified":"2024-04-04T19:42:59.984Z","0.0.2":"2024-04-04T19:42:59.820Z"},"maintainers":[{"name":"andrewdjessop","email":"andrewdjessop@gmail.com"}],"description":"<p align=\"center\">   <img src=\"./assets/bakery.png\" width=400/> </p>","author":{"name":"Andy Jessop"},"license":"CC BY-NC 4.0","readme":"<p align=\"center\">\n  <img src=\"./assets/bakery.png\" width=400/>\n</p>\n\n# Bakery\n\nBakery is a monorepo task runner that allows you to efficiently run scripts across multiple packages in your repository. It provides commands to run tasks on all packages or only on affected packages based on changes since a specified commit.\n\n## Roadmap\n\n- [x] Run tasks\n- [ ] Run tasks on affected packages\n- [ ] Cache task output\n- [ ] Remote task cache\n\n## Installation\n\n```bash\nbun install @andyjessop/bakery --save-dev\n```\n\nAlternateively, clone this repo as a starter template: https://github.com/andyjessop/bakery-template\n\nAnd then run `bun install` in the root directory.\n\n### Task Dependencies\n\nIn a monorepo, tasks usually depend on other tasks. In order to ensure that they run in the right order, create a `bakery.json` like this:\n\n```json\n{\n\t\"tasks\": {\n\t\t\"build\": {\n\t\t\t\"dependsOn\": [\"build\", \"lint\", \"test\"]\n\t\t},\n\t\t\"lint\": {\n\t\t\t\"dependsOn\": []\n\t\t},\n\t\t\"test\": {\n\t\t\t\"dependsOn\": []\n\t\t}\n\t}\n}\n```\n\nHere we have the `build` task depending on `lint`, `test`, and the `build` tasks of all its dependencies (recursively). This means that when you run `bunx bakery run --script=build`, Bakery will run `lint` and `test` first, and then `build`.\n\n### Project structure\n\nReference the Bun docs to learn how to set up a monorepo with Bun: [Workspace setup](https://bun.sh/docs/install/workspaces).\n\n## Usage\n\nTo use Bakery, navigate to your monorepo's root directory and run the following commands:\n\n### Running a script on all packages\n\nTo run a script on all packages in the monorepo, use the run command followed by the --script flag:\n\n```bash\nbunx bakery run --script=<script-name>\n```\n\nReplace <script-name> with the name of the script you want to run, such as test or build. For example:\n\n```bash\nbunx bakery run --script=test\nbunx bakery run --script=build\n```\n\n### Running a script on affected packages\n\nTo run a script only on packages affected by changes since a specific commit, use the affected command followed by the --script flag:\n\n```bash\nbunx bakery affected --script=<script-name>\n```\n\nReplace <script-name> with the name of the script you want to run. Bakery will automatically determine which packages have been affected by changes and run the specified script only on those packages. For example:\n\n```bash\nbunx bakery affected --script=test\n```\n\n### Running a script on specific packages\n\nTo run a script on specific packages, use the run command with the --script flag and the packages flag followed by a comma-separated list of package names:\n\n```bash\nbunx bakery run --script=<script-name> packages=<package1>,<package2>,...\n```\n\nReplace <script-name> with the name of the script you want to run, and <package1>,<package2>,... with the names of the packages you want to include. For example:\n\n```bash\nbunx bakery run --script=test packages=pkg-a,pkg-b\n```\n\n## Configuration\n\nBakery looks for a bakery.json file in the root directory of your monorepo to configure task dependencies. The bakery.json file should have the following structure:\n\n```json\n{\n  \"tasks\": {\n    \"<script-name>\": {\n      \"dependsOn\": [\"<dependency1>\", \"<dependency2>\", ...]\n    }\n  }\n}\n```\n\nReplace <script-name> with the name of the script, and <dependency1>, <dependency2>, etc., with the names of the packages that the script depends on.\n\n## How it works\n\nBakery uses a graph-based approach to determine the affected packages and the order in which tasks should be executed. It analyzes the dependencies between packages and builds a task pipeline based on the specified script and the affected packages.\n\nThe task runner then executes the tasks in the pipeline, ensuring that dependencies are respected and that tasks are run in parallel when possible.\n\n## Requirements\n\nBun runtime environment.\n","readmeFilename":"README.md"}