@cloudcannon/configuration-types 0.0.36 → 0.0.38

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (44) hide show
  1. package/dist/cloudcannon-config.latest.schema.json +9352 -10975
  2. package/dist/cloudcannon-config.legacy-eleventy.schema.json +9476 -11093
  3. package/dist/cloudcannon-config.legacy-hugo.schema.json +9424 -11046
  4. package/dist/cloudcannon-config.legacy-jekyll.schema.json +9476 -11093
  5. package/dist/cloudcannon-config.legacy-reader.schema.json +5882 -7507
  6. package/package.json +19 -21
  7. package/src/build-coupled.ts +295 -0
  8. package/src/cascade.ts +38 -0
  9. package/src/configuration.ts +421 -0
  10. package/src/documentation.ts +22 -0
  11. package/src/editables.ts +243 -0
  12. package/src/icon.ts +3597 -0
  13. package/src/image-options.ts +72 -0
  14. package/src/index.ts +40 -0
  15. package/src/inputs.ts +993 -0
  16. package/src/markdown.ts +97 -0
  17. package/src/mimetype.ts +445 -0
  18. package/src/paths.ts +43 -0
  19. package/src/preview.ts +125 -0
  20. package/src/select-values.ts +26 -0
  21. package/src/snippets.ts +113 -0
  22. package/src/source-editor.ts +68 -0
  23. package/src/structures.ts +120 -0
  24. package/src/syntax.ts +183 -0
  25. package/src/timezone.ts +607 -0
  26. package/src/build-coupled.d.ts +0 -315
  27. package/src/cascade.d.ts +0 -37
  28. package/src/cloudcannon-config.schema.json +0 -79
  29. package/src/configuration.d.ts +0 -750
  30. package/src/documentation.d.ts +0 -18
  31. package/src/editables.d.ts +0 -252
  32. package/src/icon.d.ts +0 -3585
  33. package/src/image-resizeable.d.ts +0 -65
  34. package/src/index.d.ts +0 -36
  35. package/src/inputs.d.ts +0 -1648
  36. package/src/javascript-api.d.ts +0 -204
  37. package/src/markdown.d.ts +0 -103
  38. package/src/paths.d.ts +0 -44
  39. package/src/preview.d.ts +0 -110
  40. package/src/select-values.d.ts +0 -6
  41. package/src/snippets.d.ts +0 -227
  42. package/src/source-editor.d.ts +0 -92
  43. package/src/structures.d.ts +0 -113
  44. package/src/timezone.d.ts +0 -596
@@ -1,315 +0,0 @@
1
- import type { CollectionConfig, Configuration, DataConfigEntry } from './configuration';
2
- import type { Paths } from './paths';
3
-
4
- export interface BuildCoupledPaths extends Paths {
5
- /**
6
- * Parent folder of all collections.
7
- */
8
- collections?: string;
9
- /**
10
- * Parent folder of all site data files.
11
- */
12
- data?: string;
13
- /**
14
- * Parent folder of all site layout files. _Only applies to Jekyll, Hugo, and Eleventy sites_.
15
- */
16
- layouts?: string;
17
- /**
18
- * Parent folder of all includes, partials, or shortcode files. _Only applies to Jekyll, Hugo, and
19
- * Eleventy sites_.
20
- */
21
- includes?: string;
22
- }
23
-
24
- export type FilterBase = 'none' | 'all' | 'strict';
25
-
26
- export interface Filter {
27
- /**
28
- * Defines the initial set of visible files in the collection file list. Defaults to "all", or
29
- * "strict" for the auto-discovered `pages` collection in Jekyll, Hugo, and Eleventy.
30
- */
31
- base?: FilterBase;
32
- /**
33
- * Add to the visible files set with `base`. Paths must be relative to the containing collection
34
- * `path`.
35
- */
36
- include?: string[];
37
- /**
38
- * Remove from the visible files set with `base`. Paths must be relative to the containing
39
- * collection `path`.
40
- */
41
- exclude?: string[];
42
- }
43
-
44
- interface Parseable {
45
- /**
46
- * Overrides the format files are read. Detected automatically from file extension if unset.
47
- */
48
- parser?: 'csv' | 'front-matter' | 'json' | 'properties' | 'toml' | 'yaml';
49
- }
50
-
51
- interface Filterable {
52
- /**
53
- * Controls which files are displayed in the collection list. Does not change which files are
54
- * assigned to this collection.
55
- */
56
- filter?: Filter | FilterBase;
57
- }
58
-
59
- interface WithCollectionsConfigOverride {
60
- /**
61
- * Prevents CloudCannon from automatically discovering collections for supported SSGs if true.
62
- * Defaults to false.
63
- */
64
- collections_config_override?: boolean;
65
- }
66
-
67
- /**
68
- * The `collections_config` entry format for build-coupled non-Jekyll/Hugo/Eleventy sites.
69
- */
70
- export interface ReaderCollectionConfig extends CollectionConfig, Parseable, Filterable {
71
- /**
72
- * Overrides the default singular input key of the collection. This is used for naming conventions
73
- * for select and multiselect inputs.
74
- */
75
- singular_key?: string;
76
- /**
77
- * Specifies whether this collection's source files build to output files. Defaults to false.
78
- */
79
- output?: boolean;
80
- }
81
-
82
- /**
83
- * The configuration format for build-coupled non-Jekyll/Hugo/Eleventy sites.
84
- */
85
- export interface ReaderConfiguration extends Omit<Configuration, 'version'> {
86
- /**
87
- * Controls which schema this file is validated against. Defaults to the latest schema.
88
- */
89
- version: 'legacy-reader';
90
- /**
91
- * Paths to where new asset files are uploaded to. They also set the default path when choosing
92
- * existing images, and linking to existing files. Each path is relative to global `source`.
93
- */
94
- paths?: BuildCoupledPaths;
95
- /**
96
- * Controls what data sets are available to populate select and multiselect inputs.
97
- *
98
- * https://cloudcannon.com/documentation/articles/configuration-file-reference/#data_config
99
- */
100
- data_config?: Record<string, DataConfigEntry & Parseable>;
101
- /**
102
- * Definitions for your collections, which are the sets of content files for your site grouped by
103
- * folder. Entries are keyed by a chosen collection key, and contain configuration specific to
104
- * that collection.
105
- *
106
- * https://cloudcannon.com/documentation/articles/configuration-file-reference/#collections_config
107
- */
108
- collections_config?: Record<string, ReaderCollectionConfig>;
109
- /**
110
- * Generates the integration file in another folder. Not applicable to Jekyll, Hugo, and Eleventy.
111
- * Defaults to the root folder.
112
- */
113
- output?: string;
114
- }
115
-
116
- export interface BuildCoupledCollectionConfig
117
- extends Omit<CollectionConfig, 'url' | 'path' | 'disable_url'>,
118
- Filterable {
119
- /**
120
- * Overrides the default singular input key of the collection. This is used for naming conventions
121
- * for select and multiselect inputs.
122
- */
123
- singular_key?: string;
124
- /**
125
- * The top-most folder where the files in this collection are stored. It is relative to `source`.
126
- */
127
- path?: string;
128
- /**
129
- * Specifies whether this collection's source files build to output files. Defaults to false.
130
- */
131
- output?: boolean;
132
- }
133
-
134
- interface BuildCoupledConfiguration
135
- extends Omit<Configuration, 'data_config' | 'collections_config' | 'version'>,
136
- WithCollectionsConfigOverride {
137
- /**
138
- * Paths to where new asset files are uploaded to. They also set the default path when choosing
139
- * existing images, and linking to existing files. Each path is relative to global `source`.
140
- */
141
- paths?: BuildCoupledPaths;
142
- /**
143
- * Definitions for your collections, which are the sets of content files for your site grouped by
144
- * folder. Entries are keyed by a chosen collection key, and contain configuration specific to
145
- * that collection.
146
- *
147
- * https://cloudcannon.com/documentation/articles/configuration-file-reference/#collections_config
148
- */
149
- collections_config?: BuildCoupledCollectionConfig;
150
- /**
151
- * Controls what data sets are available to populate select and multiselect inputs.
152
- *
153
- * https://cloudcannon.com/documentation/articles/configuration-file-reference/#data_config
154
- */
155
- data_config?: Record<string, boolean>;
156
- }
157
-
158
- /**
159
- * The `collections_config` entry format for build-coupled Hugo sites.
160
- */
161
- export interface HugoCollectionConfig extends BuildCoupledCollectionConfig {
162
- /**
163
- * Controls whether branch index files (e.g. `_index.md`) are assigned to this collection or not.
164
- * The "pages" collection defaults this to true, and false otherwise.
165
- */
166
- parse_branch_index?: boolean;
167
- }
168
-
169
- /**
170
- * The configuration format for build-coupled Hugo sites.
171
- */
172
- export interface HugoConfiguration extends BuildCoupledConfiguration {
173
- /**
174
- * Controls which schema this file is validated against. Defaults to the latest schema.
175
- */
176
- version: 'legacy-hugo';
177
- /**
178
- * Definitions for your collections, which are the sets of content files for your site grouped by
179
- * folder. Entries are keyed by a chosen collection key, and contain configuration specific to
180
- * that collection.
181
- *
182
- * https://cloudcannon.com/documentation/articles/configuration-file-reference/#collections_config
183
- */
184
- collections_config?: Record<string, HugoCollectionConfig>;
185
- }
186
-
187
- /**
188
- * The configuration format for build-coupled Jekyll sites.
189
- */
190
- export interface JekyllConfiguration extends BuildCoupledConfiguration {
191
- /**
192
- * Controls which schema this file is validated against. Defaults to the latest schema.
193
- */
194
- version: 'legacy-jekyll';
195
- /**
196
- * Definitions for your collections, which are the sets of content files for your site grouped by
197
- * folder. Entries are keyed by a chosen collection key, and contain configuration specific to
198
- * that collection.
199
- *
200
- * https://cloudcannon.com/documentation/articles/configuration-file-reference/#collections_config
201
- */
202
- collections_config?: Record<string, BuildCoupledCollectionConfig>;
203
- }
204
-
205
- /**
206
- * The configuration format for build-coupled Eleventy sites.
207
- */
208
- export interface EleventyConfiguration extends BuildCoupledConfiguration {
209
- /**
210
- * Controls which schema this file is validated against. Defaults to the latest schema.
211
- */
212
- version: 'legacy-eleventy';
213
- /**
214
- * Definitions for your collections, which are the sets of content files for your site grouped by
215
- * folder. Entries are keyed by a chosen collection key, and contain configuration specific to
216
- * that collection.
217
- *
218
- * https://cloudcannon.com/documentation/articles/configuration-file-reference/#collections_config
219
- */
220
- collections_config?: Record<string, BuildCoupledCollectionConfig>;
221
- }
222
-
223
- /**
224
- * @discriminator version
225
- */
226
- export type AnyLegacyConfiguration =
227
- | HugoConfiguration
228
- | JekyllConfiguration
229
- | EleventyConfiguration
230
- | ReaderConfiguration;
231
-
232
- export type AnyConfiguration = Configuration | AnyLegacyConfiguration;
233
-
234
- export type ParsedDataset =
235
- | string[]
236
- | Record<string, string>
237
- | Record<string, Record<string, unknown>>
238
- | Record<string, unknown>[];
239
-
240
- interface ParsedCollectionItem {
241
- [index: string]: unknown;
242
- /**
243
- * The path to the file this was parsed from.
244
- */
245
- path: string;
246
- /**
247
- * The collection key this is assigned to. Matches keys in `collections_config`.
248
- */
249
- collection?: string;
250
- /**
251
- * The URL this file is served at once built.
252
- */
253
- url?: string;
254
- }
255
-
256
- interface WithIntegrationOutput {
257
- /**
258
- * The error code encountered when attempting to create the integration output file.
259
- */
260
- error?: 'NO_CONTENT' | string;
261
- /**
262
- * The time this file was generated.
263
- */
264
- time?: string;
265
- /**
266
- * Details about the integration tool used to generate the integration output file.
267
- */
268
- cloudcannon?: {
269
- /**
270
- * Name of the integration tool used to generate the integration output file.
271
- */
272
- name: string;
273
- /**
274
- * Version of the integration tool used to generate the integration output file.
275
- */
276
- version: string;
277
- };
278
- /**
279
- * Map of data keys to parsed datasets. Keys match keys in `data_config`.
280
- */
281
- data?: Record<string, ParsedDataset>;
282
- /**
283
- * Map of collection keys to parsed collection files. Keys match keys in `collections_config`.
284
- */
285
- collections?: Record<string, ParsedCollectionItem[]>;
286
- /**
287
- * Map of build file paths to MD5s.
288
- */
289
- files?: Record<string, string>;
290
- }
291
-
292
- /**
293
- * The output from build-coupled non-Jekyll/Hugo/Eleventy sites.
294
- */
295
- export type IntegrationOutput = Configuration & WithIntegrationOutput;
296
-
297
- /**
298
- * The output from build-coupled Hugo sites.
299
- */
300
- export type HugoIntegrationOutput = HugoConfiguration & WithIntegrationOutput;
301
-
302
- /**
303
- * The output from build-coupled Jekyll sites.
304
- */
305
- export interface JekyllIntegrationOutput extends JekyllConfiguration, WithIntegrationOutput {
306
- /**
307
- * @deprecated Do not use.
308
- */
309
- defaults: unknown;
310
- }
311
-
312
- /**
313
- * The output from build-coupled Eleventy sites.
314
- */
315
- export type EleventyIntegrationOutput = EleventyConfiguration & WithIntegrationOutput;
package/src/cascade.d.ts DELETED
@@ -1,37 +0,0 @@
1
- import type { Editables } from './editables';
2
- import type { Input } from './inputs';
3
- import type { SelectValues } from './select-values';
4
- import type { Structure } from './structures';
5
-
6
- export type EditorKey = 'visual' | 'content' | 'data';
7
-
8
- export interface ReducedCascade {
9
- /**
10
- * Controls the behavior and appearance of your inputs in all data editing interfaces.
11
- */
12
- _inputs?: Record<string, Input>;
13
- /**
14
- * Fixed datasets that can be referenced by the _Values_ configuration for _Select_ and
15
- * _Multiselect_ inputs.
16
- */
17
- _select_data?: Record<string, SelectValues>;
18
- /**
19
- * Structured values for editors adding new items to arrays and objects. Entries here can be
20
- * referenced in the configuration for `array` or `object` inputs.
21
- */
22
- _structures?: Record<string, Structure>;
23
- }
24
-
25
- export interface Cascade extends ReducedCascade {
26
- /**
27
- * Set a preferred editor and/or disable the others. The first value sets which editor opens by
28
- * default, and the following values specify which editors are accessible.
29
- *
30
- * @uniqueItems
31
- */
32
- _enabled_editors?: EditorKey[];
33
- /**
34
- * Contains input options for Editable Regions and the Content Editor.
35
- */
36
- _editables?: Editables;
37
- }
@@ -1,79 +0,0 @@
1
- {
2
- "$id": "https://github.com/cloudcannon/configuration-types/releases/latest/download/cloudcannon-config.schema.json",
3
- "$schema": "http://json-schema.org/draft-07/schema#",
4
- "description": "Delegates to other schemas based on version.",
5
- "type": "object",
6
- "properties": {
7
- "version": {
8
- "enum": ["legacy-hugo", "legacy-jekyll", "legacy-eleventy", "legacy-reader", "latest"]
9
- }
10
- },
11
- "allOf": [
12
- {
13
- "if": {
14
- "properties": {
15
- "version": {
16
- "not": {
17
- "enum": ["legacy-hugo", "legacy-jekyll", "legacy-eleventy", "legacy-reader"]
18
- }
19
- }
20
- }
21
- },
22
- "then": {
23
- "$ref": "cloudcannon-config.latest.schema.json"
24
- }
25
- },
26
- {
27
- "if": {
28
- "properties": {
29
- "version": {
30
- "const": "legacy-hugo"
31
- }
32
- },
33
- "required": ["version"]
34
- },
35
- "then": {
36
- "$ref": "cloudcannon-config.legacy-hugo.schema.json"
37
- }
38
- },
39
- {
40
- "if": {
41
- "properties": {
42
- "version": {
43
- "const": "legacy-jekyll"
44
- }
45
- },
46
- "required": ["version"]
47
- },
48
- "then": {
49
- "$ref": "cloudcannon-config.legacy-jekyll.schema.json"
50
- }
51
- },
52
- {
53
- "if": {
54
- "properties": {
55
- "version": {
56
- "const": "legacy-eleventy"
57
- }
58
- },
59
- "required": ["version"]
60
- },
61
- "then": {
62
- "$ref": "cloudcannon-config.legacy-eleventy.schema.json"
63
- }
64
- },
65
- {
66
- "if": {
67
- "properties": {
68
- "version": {
69
- "const": "legacy-reader"
70
- }
71
- },
72
- "required": ["version"]
73
- },
74
- "then": {
75
- "$ref": "cloudcannon-config.legacy-reader.schema.json"
76
- }
77
- }
78
- ]
79
- }