-
-
Notifications
You must be signed in to change notification settings - Fork 379
Expand file tree
/
Copy pathconfig.schema.json
More file actions
255 lines (255 loc) · 9.29 KB
/
Copy pathconfig.schema.json
File metadata and controls
255 lines (255 loc) · 9.29 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
{
"$schema": "http://json-schema.org/draft-04/schema#",
"additionalProperties": false,
"properties": {
"$schema": {
"type": "string"
},
"rootDir": {
"description": "The root directory that all others paths in this config are relative to. Usually the root of your repo. If omitted, rootDir is equal to the directory containing your Cosmos config. When you don't use a Cosmos config, rootDir defaults to the current working directory.",
"type": "string",
"minLength": 1
},
"exportPath": {
"description": "Output directory for static exports. [default: \"cosmos-export\"]",
"type": "string",
"minLength": 1
},
"detectLocalPlugins": {
"description": "Automatically detect and load local plugins. [default: true]",
"type": "boolean"
},
"disablePlugins": {
"description": "Disable plugins. [default: false]",
"type": "boolean"
},
"staticPath": {
"description": "Dir path to serve static assets from.",
"type": "string",
"minLength": 1
},
"plugins": {
"description": "Module IDs of Cosmos plugins (eg. \"react-cosmos-plugin-open-fixture\" or \"../path/to/my-plugin\").",
"type": "array",
"items": { "type": "string", "minLength": 1 },
"uniqueItems": true
},
"publicUrl": {
"description": "Base URL for static assets. [default: \"\"]",
"type": "string"
},
"fixturesDir": {
"description": "Name for directories that contain fixture files (eg. __fixtures__/example.jsx). [default: \"__fixtures__\"]",
"type": "string",
"minLength": 1
},
"fixtureFileSuffix": {
"description": "Suffix for fixture files (eg. example.fixture.jsx). [default: \"fixture\"]",
"type": "string",
"minLength": 1
},
"ignore": {
"description": "Patterns for ignoring fixture and decorator files (eg. [\"**/dist/**\"]).",
"type": "array",
"items": { "type": "string", "minLength": 1 },
"uniqueItems": true
},
"watchDirs": {
"description": "Directories where the Cosmos server watches for fixture files changes while running. [default: [\".\"]]",
"type": "array",
"items": {
"type": "string",
"minLength": 1
},
"uniqueItems": true
},
"lazy": {
"description": "Dynamically import fixture and decorator modules as they are loaded. When false all fixture and decorator modules are imported statically and bundled together. [default: false]",
"type": "boolean"
},
"exposeImports": {
"description": "Expose user imports and config required for the Cosmos renderer. Used with React Native and in custom integrations. When a path is specified it requires a file extension (eg. \"src/cosmos.imports.ts\"). [default: false]",
"anyOf": [{ "type": "string", "minLength": 1 }, { "type": "boolean" }]
},
"host": {
"description": "Dev server host. Set to null to accept connections from any address that reaches the server. [default: null]",
"anyOf": [{ "type": "string", "minLength": 1 }, { "type": "null" }]
},
"port": {
"description": "Dev server port. [default: 5000]",
"type": "number"
},
"portRetries": {
"description": "Max number of port retries. [default: 10]",
"type": "number"
},
"https": {
"description": "Server will be served over HTTPS.",
"type": "boolean"
},
"httpsOptions": {
"description": "Additional options for HTTPS server.",
"type": "object",
"additionalProperties": false,
"properties": {
"certPath": {
"description": "Path of a certificate file.",
"type": "string"
},
"keyPath": {
"description": "Path of a certificate's key file.",
"type": "string"
}
}
},
"httpProxy": {
"description": "Proxy some URLs to a different HTTP server (eg. an API backend dev server).",
"type": "object",
"additionalProperties": true,
"patternProperties": {
".*": {
"anyOf": [
{ "type": "string" },
{
"type": "object",
"description": "Advanced HTTP proxy config.",
"additionalProperties": true,
"required": ["target"],
"properties": {
"target": { "type": "string" },
"secure": { "type": "boolean" },
"pathRewrite": {
"type": "object",
"patternProperties": { ".*": { "type": "string" } }
},
"logLevel": {
"type": "string",
"enum": ["error", "debug", "info", "warn", "silent"]
}
}
}
]
}
}
},
"globalImports": {
"description": "Modules to be imported before loading components. Stuff like reset.css, polyfills, etc.",
"type": "array",
"items": { "type": "string", "minLength": 1 },
"uniqueItems": true
},
"rendererUrl": {
"description": "Required when renderer doesn't run on the same port (or host) as the Playground. Useful for integrations with build tools. [default: null]",
"anyOf": [
{ "type": "string", "minLength": 1 },
{
"type": "object",
"additionalProperties": false,
"required": ["dev", "export"],
"properties": {
"dev": { "type": "string", "minLength": 1 },
"export": { "type": "string", "minLength": 1 }
}
},
{ "type": "null" }
]
},
"dom": {
"description": "DOM-related options",
"type": "object",
"properties": {
"containerQuerySelector": {
"description": "Document selector for existing element to use as component parent (eg. #root). A blank container element is created from scratch if no selector is provided. [default: null]",
"type": ["string", "null"],
"minLength": 1
}
}
},
"vite": {
"description": "Vite-related options",
"type": "object",
"additionalProperties": false,
"properties": {
"configPath": {
"description": "Path to Vite config. Set to false to disable reading it from the default path. [default: \"vite.config.js\" or \"vite.config.ts\"]",
"anyOf": [{ "type": "string", "minLength": 1 }, { "enum": [false] }]
},
"mainScriptUrl": {
"description": "URL to custom main script (eg. \"/src/my-main.tsx\"). [default: detect main script URL]",
"anyOf": [{ "type": "string", "minLength": 1 }, { "type": "null" }]
},
"port": {
"description": "Vite renderer port. [default: 5050]",
"type": "number"
}
}
},
"webpack": {
"description": "Webpack-related options",
"type": "object",
"additionalProperties": false,
"properties": {
"configPath": {
"description": "Path to an existing webpack config, which Cosmos will reuse to build your code. Set to null to disable this behavior. [default: \"webpack.config.js\"]",
"anyOf": [{ "type": "string", "minLength": 1 }, { "type": "null" }]
},
"overridePath": {
"description": "Path to a user module that customizes the webpack config used by Cosmos. Set to null to disable this behavior. [default: \"webpack.override.js\"]",
"anyOf": [{ "type": "string", "minLength": 1 }, { "type": "null" }]
},
"includeHashInOutputFilename": {
"description": "Changes output filename from \"[name].js\" to \"[name].[contenthash].js\". [default: false]",
"type": "boolean"
},
"hotReload": {
"description": "Enable webpack's Hot Module Replacement. [default: true]",
"type": "boolean"
},
"reloadOnFail": {
"description": "When using webpack's Hot Module Replacement, enable automatic location reload after webpack fails to update modules. [default: false]",
"type": "boolean"
}
}
},
"ui": {
"description": "UI plugin options",
"type": "object",
"additionalProperties": true,
"properties": {
"rendererPreview": {
"description": "Options for the renderer preview UI plugin.",
"type": "object",
"additionalProperties": false,
"properties": {
"backgroundColor": {
"description": "Background color of the iframe preview. [default: \"#fff\"]",
"type": "string"
}
}
},
"responsivePreview": {
"type": "object",
"additionalProperties": false,
"properties": {
"devices": {
"description": "List of device viewports.",
"type": "array",
"items": {
"type": "object",
"additionalProperties": false,
"required": ["label", "width", "height"],
"properties": {
"label": { "type": "string", "minLength": 1 },
"width": { "type": "number", "minimum": 1 },
"height": { "type": "number", "minimum": 1 }
}
}
}
}
}
}
}
},
"title": "JSON schema for React Cosmos configs",
"type": "object"
}