bitbucket
Download and add registry items from a Bitbucket repository.
Usage
To start adding registry items from a Bitbucket repository you can run the following command:
jsrepo add https://bitbucket.org/<owner>/<repo>/<item-name>The Bitbucket provider can parse Bitbucket URLs so that you can just copy and paste a link to a Bitbucket repository and it will just work:
jsrepo add https://bitbucket.org/<owner>/<repo>/<item-name>
jsrepo add https://bitbucket.org/<owner>/<repo>/src/<ref>The bitbucket/ shorthand
You can also just use the bitbucket/ shorthand in place of https://bitbucket.org/.
jsrepo add bitbucket/<owner>/<repo>/<item-name>
jsrepo add bitbucket/<owner>/<repo>/src/<ref>If you configured a custom baseUrl in your jsrepo.config file then using the bitbucket/ shorthand will use your
custom base url instead of https://bitbucket.org/.
Custom base urls
By default the Bitbucket provider will use https://bitbucket.org as the base url for the bitbucket/ shorthand. You can configure this behavior by configuring bitbucket in your jsrepo.config file:
import { defineConfig } from "jsrepo";
import { bitbucket } from "jsrepo/providers";
export default defineConfig({
providers: [bitbucket()],
});Alternatively you can use the bitbucket:https://<url> shorthand to use a custom base url without having to touch your config file:
jsrepo add bitbucket:https://bitbucket.org/<owner>/<repo>/src/<ref>This syntax tells the Bitbucket provider that it can resolve this URL as a Bitbucket repository.
Deploying your registry to Bitbucket
When deploying your registry to Bitbucket you will want to use the repository output type:
import { defineConfig } from "jsrepo";
import { repository } from "jsrepo/outputs";
export default defineConfig({
registry: {
// ...
outputs: [repository()],
},
});This will create a registry.json file that will contain everything users need to use your registry.
The registry.json file must be at the root of your repository otherwise users won't be able to use your registry.
Authentication
To authenticate with Bitbucket you can run the following command:
jsrepo auth bitbucketYou can logout of your account by running:
jsrepo auth bitbucket --logoutEnvironment Variable
If you prefer to use an environment variable or are in an environment where you can't use the jsrepo auth command you can provide the token via the BITBUCKET_TOKEN environment variable.
BITBUCKET_TOKEN=... jsrepo add Options
Prop
Type