Project Setup
Setup your project to install blocks from a registry.
To install blocks from a registry you will need to create a jsrepo.json file.
This file tells jsrepo where to get the blocks as well as where and how to install them.
To setup the jsrepo.json file you can run the init command to take your through initial setup.
┌ jsrepo v1.35.1
│
◇ Where should we add the blocks?
│ ./src/blocks
│
◇ Add a repo?
│ Yes
│
◇ Where should we download the blocks from?
│ github/ieedan/std
│
◇ Add another repo?
│ No
│
◇ What formatter would you like to use?
│ Prettier
│
◇ Wrote config to `jsrepo.json`.
│
└ All done!
Once you have run through the prompts your jsrepo.json file should look something like this:
{
"$schema": "https://unpkg.com/jsrepo@1.35.1/schemas/project-config.json",
"repos": ["github/ieedan/std"],
"path": "src/blocks",
"includeTests": false,
"watermark": true,
"formatter": "prettier",
"paths": {
"*": "./src/blocks"
}
}
Now that you've created the jsrepo.json you can start adding blocks from registries.
To update blocks you can run update this will show a diff for each changed file and allow you to choose to accept or reject the changes.