Skip to content

API reference

settings.json and blueprintor.config.js share one format.

interface BlueprintorConfig {
blueprints: Blueprint[];
}
Config Where Marker in the list
Global blueprintor.defaultConfig in VS Code settings.json 🌐
Local blueprintor.config.js in the root of the workspace 📦

The local file is a CommonJS module, so it can contain code (helpers, loops, "x".repeat(3)). settings.json is plain JSON: the same fields, but no code.

A blueprint with one variable, one snippet and one file. Local form:

blueprintor.config.js
module.exports = {
blueprints: [
{
title: "React component",
variables: [{ key: "name", prompt: "Component name" }],
snippets: {
component: [
"export function {name.pascal}() {",
" return (",
" <div>",
" <div></div>",
" </div>",
" )",
"}",
],
},
structure: {
files: [{ name: "{name.pascal}.tsx", snippet: "component" }],
},
},
],
};

The same blueprint in settings.json:

{
// ...
"blueprintor.defaultConfig": {
"blueprints": [
{
"title": "React component",
"variables": [{ "key": "name", "prompt": "Component name" }],
"snippets": {
"component": [
"export function {name.pascal}() {",
" return (",
" <div>",
" <div></div>",
" </div>",
" )",
"}"
]
},
"structure": {
"files": [{ "name": "{name.pascal}.tsx", "snippet": "component" }]
}
}
]
}
}