|
2 | 2 | "$schema": "http://json-schema.org/draft-07/schema#", |
3 | 3 | "type": "object", |
4 | 4 | "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.", |
6 | 6 | "properties": { |
7 | 7 | "$schema": { |
8 | 8 | "description": "A field for the [JSON schema](https://json-schema.org/) specification", |
|
24 | 24 | "https://staging-registry.com" |
25 | 25 | ] |
26 | 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" |
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.", |
35 | 29 | "type": "object", |
36 | 30 | "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 | + }, |
37 | 53 | "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.", |
39 | 55 | "type": "object", |
40 | 56 | "properties": { |
41 | 57 | "dynamic": { |
|
67 | 83 | } |
68 | 84 | }, |
69 | 85 | "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 |
70 | 128 | } |
71 | 129 | }, |
72 | 130 | "required": [ |
|
78 | 136 | "registries": [ |
79 | 137 | "https://my-registry.com" |
80 | 138 | ], |
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", |
82 | 160 | "mocks": { |
83 | 161 | "plugins": { |
84 | 162 | "static": { |
|
0 commit comments