Skip to content

Commit 681eed6

Browse files
up schema
1 parent e2728d2 commit 681eed6

File tree

1 file changed

+89
-11
lines changed

1 file changed

+89
-11
lines changed

website/static/schema.json

Lines changed: 89 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
"$schema": "http://json-schema.org/draft-07/schema#",
33
"type": "object",
44
"title": "OpenComponents CLI Configuration",
5-
"description": "Configuration file for the OpenComponents CLI tool. Used to configure registries and development mocks.",
5+
"description": "Configuration file for the OpenComponents CLI tool. Used to configure registries and development settings.",
66
"properties": {
77
"$schema": {
88
"description": "A field for the [JSON schema](https://json-schema.org/) specification",
@@ -24,18 +24,34 @@
2424
"https://staging-registry.com"
2525
]
2626
},
27-
"client": {
28-
"description": "Custom URL for the oc-client-browser.js file to use during development. If specified, this URL will be used instead of the default bundled client library.",
29-
"type": "string",
30-
"format": "uri",
31-
"example": "https://myregistry.com/oc-client/client.dev.js"
32-
},
33-
"mocks": {
34-
"description": "Development configuration for mocking plugins that would normally be provided by production registries. Useful for local development and testing.",
27+
"development": {
28+
"description": "Development-specific configuration settings for local development and testing.",
3529
"type": "object",
3630
"properties": {
31+
"fallback": {
32+
"description": "Fallback configuration for when components cannot be found in the local registry. Allows specifying a fallback registry URL and optionally using its client library.",
33+
"type": "object",
34+
"properties": {
35+
"url": {
36+
"description": "URL of the fallback registry to use when components cannot be found locally.",
37+
"type": "string",
38+
"format": "uri",
39+
"example": "https://fallback-registry.com"
40+
},
41+
"client": {
42+
"description": "Whether to use the fallback registry's oc-client-browser.js for previewing components. Defaults to false.",
43+
"type": "boolean",
44+
"default": false,
45+
"example": true
46+
}
47+
},
48+
"required": [
49+
"url"
50+
],
51+
"additionalProperties": false
52+
},
3753
"plugins": {
38-
"description": "Plugin mocking configuration. Plugins are shared functions that components can use, provided by registries in production.",
54+
"description": "Plugin mocking configuration for development. Plugins are shared functions that components can use, provided by registries in production.",
3955
"type": "object",
4056
"properties": {
4157
"dynamic": {
@@ -67,6 +83,48 @@
6783
}
6884
},
6985
"additionalProperties": false
86+
},
87+
"mocks": {
88+
"description": "DEPRECATED: Use development.plugins instead. Development configuration for mocking plugins that would normally be provided by production registries.",
89+
"type": "object",
90+
"deprecated": true,
91+
"properties": {
92+
"plugins": {
93+
"description": "DEPRECATED: Use development.plugins instead. Plugin mocking configuration. Plugins are shared functions that components can use, provided by registries in production.",
94+
"type": "object",
95+
"deprecated": true,
96+
"properties": {
97+
"dynamic": {
98+
"description": "DEPRECATED: Use development.plugins.dynamic instead. Dynamic plugin mocks. Values are file paths to JavaScript modules that export 'register' and 'execute' functions.",
99+
"type": "object",
100+
"deprecated": true,
101+
"additionalProperties": {
102+
"type": "string",
103+
"description": "Path to a JavaScript file that exports register and execute functions"
104+
},
105+
"example": {
106+
"hash": "./mocks/hash-plugin.js",
107+
"auth": "./mocks/auth-plugin.js"
108+
}
109+
},
110+
"static": {
111+
"description": "DEPRECATED: Use development.plugins.static instead. Static plugin mocks. Values are static strings that will always be returned by the plugin.",
112+
"type": "object",
113+
"deprecated": true,
114+
"additionalProperties": {
115+
"type": "string",
116+
"description": "Static value that the plugin should always return"
117+
},
118+
"example": {
119+
"hash": "mocked-hash-value",
120+
"apiKey": "test-api-key-123"
121+
}
122+
}
123+
},
124+
"additionalProperties": false
125+
}
126+
},
127+
"additionalProperties": false
70128
}
71129
},
72130
"required": [
@@ -78,7 +136,27 @@
78136
"registries": [
79137
"https://my-registry.com"
80138
],
81-
"client": "https://cdn.example.com/oc-client-browser.js",
139+
"development": {
140+
"fallback": {
141+
"url": "https://fallback-registry.com",
142+
"client": true
143+
},
144+
"plugins": {
145+
"static": {
146+
"hash": "test-hash-value",
147+
"apiKey": "dev-api-key"
148+
},
149+
"dynamic": {
150+
"auth": "./mocks/auth-plugin.js"
151+
}
152+
}
153+
}
154+
},
155+
{
156+
"registries": [
157+
"https://my-registry.com"
158+
],
159+
"client": "https://myregistry.com/oc-client/client.dev.js",
82160
"mocks": {
83161
"plugins": {
84162
"static": {

0 commit comments

Comments
 (0)