@knapsack/app
Version:
Build Design Systems on top of knapsack, by Basalt
491 lines • 14.3 kB
JSON
{
"type": "object",
"properties": {
"primary": {
"type": "array",
"items": {
"type": "object",
"properties": {
"id": {
"type": "string"
},
"name": {
"type": "string"
},
"path": {
"type": "string"
},
"parentId": {
"description": "Use \"root\" if you want it at top level",
"type": "string"
}
},
"additionalProperties": false,
"required": [
"id",
"parentId"
]
}
},
"secondary": {
"type": "array",
"items": {
"type": "object",
"properties": {
"id": {
"type": "string"
},
"name": {
"type": "string"
},
"path": {
"type": "string"
},
"parentId": {
"description": "Use \"root\" if you want it at top level",
"type": "string"
}
},
"additionalProperties": false,
"required": [
"id",
"parentId"
]
}
}
},
"additionalProperties": false,
"required": [
"primary",
"secondary"
],
"definitions": {
"KnapsackAssetSetConfig": {
"type": "object",
"properties": {
"assets": {
"type": "array",
"items": {
"type": "object",
"properties": {
"src": {
"type": "string"
},
"tagLocation": {
"description": "Force this asset to load in either the head or foot of the HTML page.\nCSS defaults to head and JS default to foot",
"enum": [
"foot",
"head"
],
"type": "string"
}
},
"additionalProperties": false,
"required": [
"src"
]
}
},
"id": {
"type": "string"
},
"title": {
"type": "string"
},
"inlineCss": {
"type": "string"
},
"inlineJs": {
"type": "string"
},
"inlineHead": {
"type": "string"
},
"inlineFoot": {
"type": "string"
}
},
"additionalProperties": false,
"required": [
"assets",
"id",
"title"
]
},
"KnapsackPatternTemplate": {
"type": "object",
"properties": {
"id": {
"type": "string"
},
"title": {
"type": "string"
},
"path": {
"description": "Relative file path to the template from the config file it is declared in",
"type": "string"
},
"alias": {
"description": "Used by template renderers in addition to `path`\nTwig: `@components/button.twig`\nWeb Components: `my-button` => `<my-button>`\nReact: a named export of the file if not `default`",
"type": "string"
},
"templateLanguageId": {
"description": "Which template language?\ni.e. `twig`, `react`\nReplaces KnapsackTemplateRenderer.test which ran a test on the file path (similar to how WebPack loader `test` works)",
"type": "string"
},
"assetSetIds": {
"type": "array",
"items": {
"type": "string"
}
},
"statusId": {
"type": "string"
},
"spec": {
"description": "Supersedes `schema`",
"type": "object",
"properties": {
"isInferred": {
"description": "EXPERMIMENTAL\nAttempt to create the props & slots spec by reading the source file. Prevents ability to use spec editor.\nIf `true`, then uses the template `alias` & `path` to find the file.\nIf a string, then that file path is used in place of the source file. Scenario: the `path` is used to point to a compiled file w types stripped and this is used to point to either the source file w types or the compiled `.d.ts` file.\nCurrently only React is supported. The file extension determines if TypeScript (ts/tsx) or PropTypes (js/jsx) is used for inference.",
"type": [
"string",
"boolean"
]
},
"props": {
"description": "JSON Schema defining the serializable data passed in\nThe classic, formerly `schema`"
},
"slots": {
"description": "Child component slots",
"type": "object",
"additionalProperties": {
"type": "object",
"properties": {
"title": {
"type": "string"
},
"description": {
"type": "string"
},
"disallowText": {
"type": "boolean"
},
"isRequired": {
"type": "boolean"
},
"allowedPatternIds": {
"type": "array",
"items": {
"type": "string"
}
}
},
"additionalProperties": false,
"required": [
"title"
]
}
}
},
"additionalProperties": false
},
"demosById": {
"description": "Supercedes `demoData`, a `{}[]`\nSupercedes using `templates` for template files that were included with no data passed in and exist to demo how to include/import the source template and render it",
"type": "object",
"additionalProperties": {
"anyOf": [
{
"description": "Shows usage",
"type": "object",
"properties": {
"type": {
"type": "string",
"enum": [
"data"
]
},
"data": {
"type": "object",
"properties": {
"props": {
"type": "object",
"additionalProperties": {}
},
"slots": {
"type": "object",
"additionalProperties": {
"type": "array",
"items": {
"anyOf": [
{
"type": "object",
"properties": {
"patternId": {
"type": "string"
},
"templateId": {
"type": "string"
},
"demoId": {
"type": "string"
}
},
"additionalProperties": false,
"required": [
"demoId",
"patternId",
"templateId"
]
},
{
"type": "string"
}
]
}
}
}
},
"additionalProperties": false,
"required": [
"props"
]
},
"id": {
"type": "string"
},
"title": {
"type": "string"
},
"description": {
"type": "string"
},
"assetSetId": {
"description": "Would override what was on the template",
"type": "string"
}
},
"additionalProperties": false,
"required": [
"data",
"id",
"title",
"type"
]
},
{
"description": "Shows source code",
"type": "object",
"properties": {
"type": {
"type": "string",
"enum": [
"template"
]
},
"templateInfo": {
"type": "object",
"properties": {
"alias": {
"description": "Used by template renderers in addition to `path`\nTwig: `@components/button.twig`\nWeb Components: `my-button` => `<my-button>`\nReact: a named export of the file if not `default`",
"type": "string"
},
"path": {
"type": "string"
}
},
"additionalProperties": false
},
"id": {
"type": "string"
},
"title": {
"type": "string"
},
"description": {
"type": "string"
},
"assetSetId": {
"description": "Would override what was on the template",
"type": "string"
}
},
"additionalProperties": false,
"required": [
"id",
"templateInfo",
"title",
"type"
]
}
]
}
},
"demos": {
"type": "array",
"items": {
"type": "string"
}
}
},
"additionalProperties": false,
"required": [
"id",
"path",
"templateLanguageId"
]
},
"DataDemo": {
"description": "Shows usage",
"type": "object",
"properties": {
"type": {
"type": "string",
"enum": [
"data"
]
},
"data": {
"type": "object",
"properties": {
"props": {
"type": "object",
"additionalProperties": {}
},
"slots": {
"type": "object",
"additionalProperties": {
"type": "array",
"items": {
"anyOf": [
{
"type": "object",
"properties": {
"patternId": {
"type": "string"
},
"templateId": {
"type": "string"
},
"demoId": {
"type": "string"
}
},
"additionalProperties": false,
"required": [
"demoId",
"patternId",
"templateId"
]
},
{
"type": "string"
}
]
}
}
}
},
"additionalProperties": false,
"required": [
"props"
]
},
"id": {
"type": "string"
},
"title": {
"type": "string"
},
"description": {
"type": "string"
},
"assetSetId": {
"description": "Would override what was on the template",
"type": "string"
}
},
"additionalProperties": false,
"required": [
"data",
"id",
"title",
"type"
]
},
"TemplateDemo": {
"description": "Shows source code",
"type": "object",
"properties": {
"type": {
"type": "string",
"enum": [
"template"
]
},
"templateInfo": {
"type": "object",
"properties": {
"alias": {
"description": "Used by template renderers in addition to `path`\nTwig: `@components/button.twig`\nWeb Components: `my-button` => `<my-button>`\nReact: a named export of the file if not `default`",
"type": "string"
},
"path": {
"type": "string"
}
},
"additionalProperties": false
},
"id": {
"type": "string"
},
"title": {
"type": "string"
},
"description": {
"type": "string"
},
"assetSetId": {
"description": "Would override what was on the template",
"type": "string"
}
},
"additionalProperties": false,
"required": [
"id",
"templateInfo",
"title",
"type"
]
},
"DemoSize": {
"enum": [
"full",
"l",
"m",
"s"
],
"type": "string"
},
"KnapsackCustomPageSlice": {
"type": "object",
"properties": {
"id": {
"type": "string"
},
"blockId": {
"description": "Match this to a Slices `id` to use it",
"type": "string"
},
"data": {}
},
"additionalProperties": false,
"required": [
"blockId",
"data",
"id"
]
}
},
"$schema": "http://json-schema.org/draft-07/schema#"
}