Skip to content

Commit e2728d2

Browse files
add client options and cos
1 parent e1a8f53 commit e2728d2

File tree

1 file changed

+53
-5
lines changed

1 file changed

+53
-5
lines changed

website/static/schema.json

Lines changed: 53 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
{
22
"$schema": "http://json-schema.org/draft-07/schema#",
33
"type": "object",
4+
"title": "OpenComponents CLI Configuration",
5+
"description": "Configuration file for the OpenComponents CLI tool. Used to configure registries and development mocks.",
46
"properties": {
57
"$schema": {
68
"description": "A field for the [JSON schema](https://json-schema.org/) specification",
@@ -10,27 +12,54 @@
1012
]
1113
},
1214
"registries": {
15+
"description": "List of registry URLs where components will be published. These are the target registries for component deployment.",
1316
"type": "array",
1417
"items": {
15-
"type": "string"
16-
}
18+
"type": "string",
19+
"description": "URL of an OpenComponents registry (e.g., 'https://my-registry.com')"
20+
},
21+
"minItems": 1,
22+
"example": [
23+
"https://my-registry.com",
24+
"https://staging-registry.com"
25+
]
26+
},
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"
1732
},
1833
"mocks": {
34+
"description": "Development configuration for mocking plugins that would normally be provided by production registries. Useful for local development and testing.",
1935
"type": "object",
2036
"properties": {
2137
"plugins": {
38+
"description": "Plugin mocking configuration. Plugins are shared functions that components can use, provided by registries in production.",
2239
"type": "object",
2340
"properties": {
2441
"dynamic": {
42+
"description": "Dynamic plugin mocks. Values are file paths to JavaScript modules that export 'register' and 'execute' functions. Use this when you need custom mock behavior.",
2543
"type": "object",
2644
"additionalProperties": {
27-
"type": "string"
45+
"type": "string",
46+
"description": "Path to a JavaScript file that exports register and execute functions"
47+
},
48+
"example": {
49+
"hash": "./mocks/hash-plugin.js",
50+
"auth": "./mocks/auth-plugin.js"
2851
}
2952
},
3053
"static": {
54+
"description": "Static plugin mocks. Values are static strings that will always be returned by the plugin. Use this for simple value mocking.",
3155
"type": "object",
3256
"additionalProperties": {
33-
"type": "string"
57+
"type": "string",
58+
"description": "Static value that the plugin should always return"
59+
},
60+
"example": {
61+
"hash": "mocked-hash-value",
62+
"apiKey": "test-api-key-123"
3463
}
3564
}
3665
},
@@ -43,5 +72,24 @@
4372
"required": [
4473
"registries"
4574
],
46-
"additionalProperties": false
75+
"additionalProperties": false,
76+
"examples": [
77+
{
78+
"registries": [
79+
"https://my-registry.com"
80+
],
81+
"client": "https://cdn.example.com/oc-client-browser.js",
82+
"mocks": {
83+
"plugins": {
84+
"static": {
85+
"hash": "test-hash-value",
86+
"apiKey": "dev-api-key"
87+
},
88+
"dynamic": {
89+
"auth": "./mocks/auth-plugin.js"
90+
}
91+
}
92+
}
93+
}
94+
]
4795
}

0 commit comments

Comments
 (0)