The registry config file for jsrepo.
jsrepo-build-config.json holds the configuration for your registry.
You can create a jsrepo-build-config.json by running the init command with the --registry flag:
jsrepo init --registry
$schema$schema is tracked with the cli so you can use a specific version using unpkg:
{
"$schema": "https://unpkg.com/jsrepo@1.47.0/schemas/registry-config.json"
}
allowSubdirectoriesallowSubdirectories allows subdirectories to be built.
{
"allowSubdirectories": false
}
configFilesconfigFiles allows you to specify files that the user may need in their project for the registry to function properly.
{
"configFiles": [
{
"name": "app.css",
"path": "./src/app.css",
"expectedPath": "./src/app.css",
"optional": false
}
]
}
expectedPathThe path where you expect users to have this file (used as a default in prompts).
nameThe name as it will be displayed in prompts to the user.
optionalWhen true users will be prompted to ask whether or not they want to add the config file.
pathThe path of the file in your registry.
dirsdirs is a list of the directories that contain your block categories.
{
"dirs": ["./src", "./blocks"]
}
doNotListBlocksdoNotListBlocks is a list of block names that shouldn't be listed when the user runs the add command.
{
"doNotListBlocks": ["utils"]
}
doNotListCategoriesdoNotListCategories is a list of category names that shouldn't be listed when the user runs the add command.
{
"doNotListCategories": ["utils"]
}
excludeBlocksexcludeBlocks allows you to prevent the specified blocks from being included in the manifest.
{
"excludeBlocks": ["domain"]
}
excludeCategoriesexcludeCategories allows you to prevent the specified categories from being included in the manifest.
{
"excludeCategories": ["INTERNAL"]
}
excludeDepsexcludeDeps allows you to prevent specified remote dependencies from being installed when the user adds/updates blocks. This is useful for framework specific API's like React or Svelte.
{
"excludeDeps": ["svelte", "react", "vue"]
}
includeBlocksincludeBlocks allows you to only include specified blocks in the final manifest file. Keep in mind that if these blocks are referenced by other blocks that are included then your build will break.
{
"includeBlocks": ["ui", "hooks"]
}
includeCategoriesincludeCategories allows you to only include specified categories in the final manifest file. Keep in mind that if these categories are referenced by other categories that are included then your build will break.
{
"includeCategories": ["components", "utils"]
}
includeFilesAdditional files to include in the manifest. This can be used to include arbitrary extra static files which don't have language support. This config option supports ignore style glob patterns.
{
"includeFiles": ["./src/blocks/header/hero.png", "./src/**/*.txt"]
}
listBlockslistBlocks is a list of block names that should be listed when the user runs the add command.
{
"listBlocks": ["utils"]
}
listCategorieslistCategories is a list of category names that should be listed when the user runs the add command.
{
"listCategories": ["utils"]
}
metameta allows you to provide optional information about the registry that can be displayed to users for better documentation.
{
"meta": {
"authors": ["Aidan Bleser"],
"bugs": "https://github.com/ieedan/std/issues",
"description": "Fully tested and documented TypeScript utilities brokered by jsrepo.",
"homepage": "https://ieedan.github.io/std/",
"repository": "https://github.com/ieedan/std",
"tags": ["typescript", "std"]
}
}
outputDiroutputDir is an optional key that allows you to copy the resulting jsrepo-manifest.json and any required files to a custom directory.
This is useful if you want to host the registry in a different location from where the code actually lives. (This should NOT be used when hosting your registry from a git repository)
{
"outputDir": "./static/new-york"
}
peerDependenciespeerDependencies allow you to warn users when they are missing dependencies that are required or are using dependency versions that are incompatible.
{
"peerDependencies": {
"svelte": {
"version": "5.x.x",
"message": "Svelte 5 is the only supported version for this registry see: https://github.com/ieedan/jsrepo"
},
"tailwindcss": "3.x.x"
}
}
messageA message displayed to users when installing with an incompatible peer dependency.
versionThe version or version range that is supported by your registry.
previewpreview displays a preview of the blocks list.
{
"preview": false
}
rulesrules allows you to configure the rules when checking the manifest file after build.
Below are the default settings for each rule.
{
"rules": {
"no-category-index-file-dependency": "warn",
"no-unpinned-dependency": "warn",
"require-local-dependency-exists": "error",
"max-local-dependencies": ["warn", 10],
"no-cir-dependency": "error",
"no-unused-block": "warn",
"no-framework-dependency": "warn"
}
}
no-category-index-file-dependencyDisallow depending on the index file of a category.
no-unpinned-dependencyRequire all dependencies to have a pinned version.
require-local-dependency-existsRequire all local dependencies to exist.
max-local-dependenciesEnforces a limit on the amount of local dependencies a block can have.
no-circular-dependencyDisallow circular dependencies.
no-unused-blockDisallow unused blocks. (Not listed and not a dependency of another block)
no-framework-dependencyDisallow frameworks (Svelte, Vue, React) as dependencies.