{"id":13394297,"url":"https://github.com/boltpkg/bolt","last_synced_at":"2025-05-14T01:11:43.457Z","repository":{"id":46830881,"uuid":"98847801","full_name":"boltpkg/bolt","owner":"boltpkg","description":"⚡️ Super-powered JavaScript project management","archived":false,"fork":false,"pushed_at":"2024-06-01T08:17:55.000Z","size":1460,"stargazers_count":2376,"open_issues_count":76,"forks_count":84,"subscribers_count":23,"default_branch":"master","last_synced_at":"2025-05-11T16:01:50.409Z","etag":null,"topics":["javascript","npm","package-manager","project-management","workspaces","yarn"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","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/boltpkg.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","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}},"created_at":"2017-07-31T04:22:56.000Z","updated_at":"2025-05-04T08:45:34.000Z","dependencies_parsed_at":"2024-06-18T12:29:00.978Z","dependency_job_id":"2bbfd685-c943-4cc2-927f-c3119d136b81","html_url":"https://github.com/boltpkg/bolt","commit_stats":{"total_commits":362,"total_committers":31,"mean_commits":11.67741935483871,"dds":0.660220994475138,"last_synced_commit":"f26c036e69e82253056534e159e0fd0dceb9c21b"},"previous_names":["pyarn/pyarn"],"tags_count":83,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/boltpkg%2Fbolt","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/boltpkg%2Fbolt/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/boltpkg%2Fbolt/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/boltpkg%2Fbolt/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/boltpkg","download_url":"https://codeload.github.com/boltpkg/bolt/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":254049482,"owners_count":22006072,"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":["javascript","npm","package-manager","project-management","workspaces","yarn"],"created_at":"2024-07-30T17:01:15.266Z","updated_at":"2025-05-14T01:11:38.448Z","avatar_url":"https://github.com/boltpkg.png","language":"JavaScript","readme":"# Bolt\n\n\u003e Super-powered JavaScript project management\n\n[![Build Status](https://travis-ci.org/boltpkg/bolt.svg?branch=master)](https://travis-ci.org/boltpkg/bolt)\n\n### Introduction\n\nAre you sharing components, libraries or services between different projects and\nfind it difficult to manage? Juggling lots of Node packages in lots of different\nrepositories? What if there was a better way?\n\n![Diagram: One package per project](https://raw.githubusercontent.com/boltpkg/assets/master/diagram-multirepo.png)\n\nMost JavaScript projects have 1 package per project (repo). So when you have\nlots of packages, you have to do a lot of work to manage them all:\n\n- You need to install every single package one by one.\n- If you make changes to one package and want to test them in another, you need\n  to manually link them together and run tests separately.\n- Managing dependencies and keeping everything up to date can be overwhelming,\n  and you can easily fall really far behind.\n\nInstead of all that, what if you put all of your packages together?\n\n![Diagram: Project with many packages](https://raw.githubusercontent.com/boltpkg/assets/master/diagram-monorepo.png)\n\nThis is the idea behind \"workspaces\".\n\n#### What are workspaces?\n\nA _workspace_ is like any other node package: It's just a directory with its\nown `package.json`.\n\nWorkspaces are grouped into a single \"project\". A _project_ is also just a\nnode package at the root of your repository. This is sometimes referred to\nas a \"monorepo\", but we prefer the term \"multi-package repo\".\n\n```\nproject\n├── package.json\n├── workspace-one\n│   ├── package.json\n│   └── index.js\n└── workspace-two\n    ├── package.json\n    └── index.js\n```\n\nPut another way, workspaces are just like any other package, except they are\nnested within a larger project/repo. Each workspace can have its own dependencies\nwith its own code and scripts. Workspaces can also be grouped into\nsub-directories for further organization.\n\nUsing Bolt, you can install the dependencies for all of these packages at once\n(and you can do it really really fast).\n\nBut here's where it gets really cool: When you specify a dependency from one\nworkspace to another. It will get linked to the actual source. This way, when\nyou go to test your code. All your changes get tested together.\n\n\u003e **Note:** This idea is not new, other tools like [Lerna](https://lernajs.io)\n\u003e have existed for awhile and are used by many projects. Bolt is a fresh take\n\u003e on the idea.\n\n#### What is Bolt?\n\nBolt implements the idea of workspaces on top of [Yarn](https://yarnpkg.com/).\nIn fact, the Bolt CLI is largely a drop-in replacement of the Yarn CLI. You can\nuse it on any project already using Yarn.\n\nBut Bolt (will soon) do lots of other stuff. Instead of wasting tons of time\nsetting up a whole bunch of build tools for running your tests, or compiling\nyour code, what if your package manager just did all that for you? Then when\nyou want to do something differently, all you need to do is override a script.\n\nWell that's what Bolt will do for you (once we get around to implementing it).\n\nLong term, many of the features in Bolt will hopefully prove to be useful and\nother package managers like [Yarn](https://yarnpkg.com/) and\n[npm](https://www.npmjs.com/) will adopt them.\n\n## Installation\n\nFirst be sure that you have [Node/npm](https://nodejs.org/) and\n[Yarn](https://yarnpkg.com/docs/install/) installed. Then run the following\ncommand:\n\n```sh\nyarn global add bolt\n```\n\n\u003e Thanks to Cam Pedersen ([@ecto](https://github.com/ecto)) for the \"bolt\"\n\u003e package name on npm\n\n## Commands\n\n\u003e **Note:** Bolt is under active development and some of these commands have\n\u003e not yet been implemented.\n\n| Command                                 | Description                                                               | Status |\n| --------------------------------------- | ------------------------------------------------------------------------- |--------|\n| `bolt`                                  | (Defaults to `bolt install`)                                              |✅|\n| `bolt [unknown command]`                | (Defaults to `bolt run [unknown command]`)                                |✅|\n| `bolt help`                             | View Bolt's help content                                                  |❌|\n| `bolt help [command]`                   | View Bolt's help content for a single command                             |❌|\n| `bolt init`                             | Create a new Bolt package in the current directory                        |✅|\n| └ `bolt init --yes`                     | Skip the prompts and use defaults                                         |✅|\n| `bolt install`                          | Install all the dependencies for a project                                |✅|\n| `bolt add [dependency]`                 | Add a dependency                                                          |✅|\n| `bolt upgrade [dependency]`             | Upgrade a dependency                                                      |✅|\n| `bolt remove [dependency]`              | remove a dependency                                                       |✅|\n| `bolt version`                          | Updates the version of your package(s)                                    |❌|\n| `bolt publish`                          | Publish new version(s) of your package(s) to npm                          |✅|\n| └ `bolt publish-lock`                   | Lock your package(s) on the npm registry                                  |✅|\n| └ `bolt publish-unlock`                 | Unlock your package(s) on the npm registry                                |✅|\n| `bolt run [script]`                     | Run a script in a package                                                 |✅|\n| `bolt build`                            | Build your package(s) (Default: Babel)                                    |🖌|\n| `bolt test`                             | Test your package(s) (Default: Jest)                                      |🖌|\n| `bolt format/fmt`                       | Format the files in your package(s) (Default: Prettier)                   |🖌|\n| `bolt lint`                             | Lint your package(s) (Default: ESLint)                                    |🖌|\n| `bolt doc`                              | Generate docs (Default: Documentation.js)                                 |🖌|\n| `bolt check`                            | Type check your package(s) (Default: Flow)                                |🖌|\n| `bolt bin`                              | Print the folder where executable files for the package will be installed |✅|\n| `bolt workspaces/ws`                    | **Run the following commands across all workspaces:**                     ||\n| └ `bolt ws run [script]`                | Run a script in every package                                             |✅|\n| └ `bolt ws exec -- [cmd]`               | Run a shell cmd in every package                                          |✅|\n| └ `bolt ws upgrade [dependency]`        | Upgrade a dependency from every package that depends on it                |✅|\n| └ `bolt ws remove [dependency]`         | Remove a dependency from every package that depends on it                 |✅|\n| └ `bolt ws ... --only [name glob]`      | Filter workspaces by name                                                 |✅|\n| └ `bolt ws ... --ignore [name glob]`    | Filter out workspaces by name                                             |✅|\n| └ `bolt ws ... --only-fs [file glob]`   | Filter workspaces by file path                                            |✅|\n| └ `bolt ws ... --ignore-fs [file glob]` | Filter out workspaces by file path                                        |✅|\n| `bolt workspace/w [name]`               | **Run the following commands on a single workspace:**                     ||\n| └ `bolt w [name] run [script]`          | Run a script in a single workspace                                        |✅|\n| └ `bolt w [name] add [dependency]`      | Add a dependency to a single workspace                                    |✅|\n| └ `bolt w [name] upgrade [dependency]`  | Upgrade a dependency in a single workspace                                |✅|\n| `bolt project/p`                        | **Run the following commands on your project package:**                   ||\n| └ `bolt p run [script]`                 | Run a script on the project package                                       |✅|\n| └ `bolt p add [dependency]`             | Add a dependency to the project package                                   |✅|\n| └ `bolt p remove [dependency]`          | Remove a dependency from the project package                              |✅|\n| └ `bolt p upgrade [dependency]`         | Upgrade a dependency on the project package                               |✅|\n| `bolt generate/g [generator]`           | **Create files in your package using a generator:**                       ||\n| └ `bolt g license [license]`            | Create a LICENSE file in your package (Default: MIT)                      |❌|\n\n## Configuration\n\nBolt config is in the root `package.json`.\n\nFor examples, for declaring workspaces in sub-directories:\n\n```json\n{\n  \"name\": \"my-project\",\n  \"bolt\": {\n    \"workspaces\": [\n      \"utils/*\",\n      \"apps/*\"\n    ]\n  }\n}\n```\n\n## Passing flags to run commands\n\nDepending on your needs you might run a script in one of many ways.\n\n```\nbolt script\nbolt run script\nbolt p run script\nbolt w package run script\nbolt ws --only=\"my-package\" run script\nbolt ws exec --only=\"my-package\" -- yarn script\n```\n\nSimilar to later versions of yarn, you can also call a script with extra flags:\n\n```\nbolt script --flag1 --flag2\nbolt run script --flag1 --flag2\nbolt p run script --flag1 --flag2\nbolt w my-package run script --flag1 --flag2\nbolt ws --only=\"my-package\" run script -- --flag1 --flag2\nbolt ws exec --only=\"my-package\" -- yarn script  --flag1 --flag2\n```\n\nThe only slightly surprising one might be the `ws run` command where you'll notice you need to add in the extra `--` flag to pass in flags. This is to avoid ambiguity in which flags are meant for bolt and which are meant for your script.\n\n\n\u003e Please note that this project is released with a [Contributor Code of Conduct](code-of-conduct.md). By participating in this project you agree to its terms.\n","funding_links":[],"categories":["JavaScript","构建系统和依赖性管理工具","project-management"],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fboltpkg%2Fbolt","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fboltpkg%2Fbolt","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fboltpkg%2Fbolt/lists"}