@cloudcannon/configuration-types 0.0.7 → 0.0.9
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.
- package/README.md +1 -1
- package/build/cloudcannon-config-eleventy.json +1122 -1425
- package/build/cloudcannon-config-hugo.json +720 -1029
- package/build/cloudcannon-config-jekyll.json +923 -1231
- package/build/{cloudcannon-config-default.json → cloudcannon-config-reader.json} +1180 -1509
- package/build/cloudcannon-config.json +939 -2630
- package/package.json +6 -6
- package/src/build-coupled.d.ts +181 -0
- package/src/configuration.d.ts +1594 -0
- package/src/index.d.ts +7 -1702
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@cloudcannon/configuration-types",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.9",
|
|
4
4
|
"description": "Contains TypeScript declarations and generates JSONSchema files for the CloudCannon configuration file.",
|
|
5
5
|
"author": "CloudCannon <support@cloudcannon.com>",
|
|
6
6
|
"license": "MIT",
|
|
@@ -18,11 +18,11 @@
|
|
|
18
18
|
"email": "support@cloudcannon.com"
|
|
19
19
|
},
|
|
20
20
|
"scripts": {
|
|
21
|
-
"build:
|
|
22
|
-
"build:
|
|
23
|
-
"build:eleventy": "ts-json-schema-generator --markdown-description --path src/
|
|
24
|
-
"build:jekyll": "ts-json-schema-generator --markdown-description --path src/
|
|
25
|
-
"build:hugo": "ts-json-schema-generator --markdown-description --path src/
|
|
21
|
+
"build:default": "ts-json-schema-generator --markdown-description --path src/index.d.ts --type Configuration --out build/cloudcannon-config.json",
|
|
22
|
+
"build:reader": "ts-json-schema-generator --markdown-description --path src/build-coupled.d.ts --type ReaderConfiguration --out build/cloudcannon-config-reader.json",
|
|
23
|
+
"build:eleventy": "ts-json-schema-generator --markdown-description --path src/build-coupled.d.ts --type EleventyConfiguration --out build/cloudcannon-config-eleventy.json",
|
|
24
|
+
"build:jekyll": "ts-json-schema-generator --markdown-description --path src/build-coupled.d.ts --type JekyllConfiguration --out build/cloudcannon-config-jekyll.json",
|
|
25
|
+
"build:hugo": "ts-json-schema-generator --markdown-description --path src/build-coupled.d.ts --type HugoConfiguration --out build/cloudcannon-config-hugo.json",
|
|
26
26
|
"build": "run-p build:*",
|
|
27
27
|
"prebuild": "mkdir -p build && rimraf --glob 'build/*.json'",
|
|
28
28
|
"test": "exit 0"
|
|
@@ -0,0 +1,181 @@
|
|
|
1
|
+
import { CollectionConfig, Configuration, Parseable } from './configuration';
|
|
2
|
+
|
|
3
|
+
export type FilterBase = 'none' | 'all' | 'strict';
|
|
4
|
+
|
|
5
|
+
export interface Filter {
|
|
6
|
+
/**
|
|
7
|
+
* Defines the initial set of visible files in the collection file list. Defaults to "all", or
|
|
8
|
+
* "strict" for the auto-discovered `pages` collection in Jekyll, Hugo, and Eleventy.
|
|
9
|
+
*/
|
|
10
|
+
base?: FilterBase;
|
|
11
|
+
/**
|
|
12
|
+
* Add to the visible files set with `base`. Paths must be relative to the containing collection
|
|
13
|
+
* `path`.
|
|
14
|
+
*/
|
|
15
|
+
include?: string[];
|
|
16
|
+
/**
|
|
17
|
+
* Remove from the visible files set with `base`. Paths must be relative to the containing
|
|
18
|
+
* collection `path`.
|
|
19
|
+
*/
|
|
20
|
+
exclude?: string[];
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
interface Filterable {
|
|
24
|
+
/**
|
|
25
|
+
* Controls which files are displayed in the collection list. Does not change which files are
|
|
26
|
+
* assigned to this collection.
|
|
27
|
+
*/
|
|
28
|
+
filter?: Filter | FilterBase;
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
interface WithCollectionsConfigOverride {
|
|
32
|
+
/**
|
|
33
|
+
* Prevents CloudCannon from automatically discovering collections for supported SSGs if true.
|
|
34
|
+
* Defaults to false.
|
|
35
|
+
*/
|
|
36
|
+
collections_config_override?: boolean;
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
/**
|
|
40
|
+
* The `collections_config` entry format for build-coupled non-Jekyll/Hugo/Eleventy sites.
|
|
41
|
+
*/
|
|
42
|
+
export interface ReaderCollectionConfig extends CollectionConfig, Parseable, Filterable {}
|
|
43
|
+
|
|
44
|
+
/**
|
|
45
|
+
* The configuration format for build-coupled non-Jekyll/Hugo/Eleventy sites.
|
|
46
|
+
*/
|
|
47
|
+
export interface ReaderConfiguration extends Configuration {
|
|
48
|
+
collections_config?: Record<string, ReaderCollectionConfig>;
|
|
49
|
+
/**
|
|
50
|
+
* Generates the integration file in another folder. Not applicable to Jekyll, Hugo, and Eleventy.
|
|
51
|
+
* Defaults to the root folder.
|
|
52
|
+
*/
|
|
53
|
+
output?: string;
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
export interface BuildCoupledCollectionConfig extends Omit<CollectionConfig, 'url'>, Filterable {}
|
|
57
|
+
|
|
58
|
+
interface BuildCoupledConfiguration
|
|
59
|
+
extends Omit<Configuration, 'data_config'>,
|
|
60
|
+
WithCollectionsConfigOverride {}
|
|
61
|
+
|
|
62
|
+
/**
|
|
63
|
+
* The `collections_config` entry format for build-coupled Hugo sites.
|
|
64
|
+
*/
|
|
65
|
+
export interface HugoCollectionConfig extends BuildCoupledCollectionConfig {
|
|
66
|
+
/**
|
|
67
|
+
* Controls whether branch index files (e.g. `_index.md`) are assigned to this collection or not.
|
|
68
|
+
* The "pages" collection defaults this to true, and false otherwise.
|
|
69
|
+
*/
|
|
70
|
+
parse_branch_index?: boolean;
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
/**
|
|
74
|
+
* The configuration format for build-coupled Hugo sites.
|
|
75
|
+
*/
|
|
76
|
+
export interface HugoConfiguration extends BuildCoupledConfiguration {
|
|
77
|
+
collections_config?: Record<string, HugoCollectionConfig>;
|
|
78
|
+
data_config?: Record<string, boolean>;
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
/**
|
|
82
|
+
* The configuration format for build-coupled Jekyll sites.
|
|
83
|
+
*/
|
|
84
|
+
export interface JekyllConfiguration extends BuildCoupledConfiguration {
|
|
85
|
+
collections_config?: Record<string, BuildCoupledCollectionConfig>;
|
|
86
|
+
data_config?: Record<string, boolean>;
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
/**
|
|
90
|
+
* The configuration format for build-coupled Eleventy sites.
|
|
91
|
+
*/
|
|
92
|
+
export type EleventyConfiguration = JekyllConfiguration;
|
|
93
|
+
|
|
94
|
+
export type ParsedDataset =
|
|
95
|
+
| string[]
|
|
96
|
+
| Record<string, string>
|
|
97
|
+
| Record<string, Record<string, any>>
|
|
98
|
+
| Record<string, any>[];
|
|
99
|
+
|
|
100
|
+
interface ParsedCollectionItem {
|
|
101
|
+
[index: string]: any;
|
|
102
|
+
/**
|
|
103
|
+
* The path to the file this was parsed from.
|
|
104
|
+
*/
|
|
105
|
+
path: 'string';
|
|
106
|
+
/**
|
|
107
|
+
* The collection key this is assigned to. Matches keys in `collections_config`.
|
|
108
|
+
*/
|
|
109
|
+
collection: 'string';
|
|
110
|
+
/**
|
|
111
|
+
* The URL this file is served at once built.
|
|
112
|
+
*/
|
|
113
|
+
url?: 'string';
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
interface WithIntegrationOutput {
|
|
117
|
+
/**
|
|
118
|
+
* The error code encountered when attempting to create the integration output file.
|
|
119
|
+
*/
|
|
120
|
+
error?: 'NO_CONTENT' | string;
|
|
121
|
+
/**
|
|
122
|
+
* The time this file was generated.
|
|
123
|
+
*/
|
|
124
|
+
time?: string;
|
|
125
|
+
/**
|
|
126
|
+
* The schema version of the integration output file.
|
|
127
|
+
*
|
|
128
|
+
* @deprecated No longer used.
|
|
129
|
+
*/
|
|
130
|
+
version?: string; // This refers to an old schema, replaced by the IntegrationOutput type.
|
|
131
|
+
/**
|
|
132
|
+
* Details about the integration tool used to generate the integration output file.
|
|
133
|
+
*/
|
|
134
|
+
cloudcannon?: {
|
|
135
|
+
/**
|
|
136
|
+
* Name of the integration tool used to generate the integration output file.
|
|
137
|
+
*/
|
|
138
|
+
name: string;
|
|
139
|
+
/**
|
|
140
|
+
* Version of the integration tool used to generate the integration output file.
|
|
141
|
+
*/
|
|
142
|
+
version: string;
|
|
143
|
+
};
|
|
144
|
+
/**
|
|
145
|
+
* Map of data keys to parsed datasets. Keys match keys in `data_config`.
|
|
146
|
+
*/
|
|
147
|
+
data?: Record<string, ParsedDataset>;
|
|
148
|
+
/**
|
|
149
|
+
* Map of collection keys to parsed collection files. Keys match keys in `collections_config`.
|
|
150
|
+
*/
|
|
151
|
+
collections?: Record<string, ParsedCollectionItem>;
|
|
152
|
+
/**
|
|
153
|
+
* Map of build file paths to MD5s.
|
|
154
|
+
*/
|
|
155
|
+
files?: Record<string, string>;
|
|
156
|
+
}
|
|
157
|
+
|
|
158
|
+
/**
|
|
159
|
+
* The output from build-coupled non-Jekyll/Hugo/Eleventy sites.
|
|
160
|
+
*/
|
|
161
|
+
export interface IntegrationOutput extends Configuration, WithIntegrationOutput {}
|
|
162
|
+
|
|
163
|
+
/**
|
|
164
|
+
* The output from build-coupled Hugo sites.
|
|
165
|
+
*/
|
|
166
|
+
export interface HugoIntegrationOutput extends HugoConfiguration, WithIntegrationOutput {}
|
|
167
|
+
|
|
168
|
+
/**
|
|
169
|
+
* The output from build-coupled Jekyll sites.
|
|
170
|
+
*/
|
|
171
|
+
export interface JekyllIntegrationOutput extends JekyllConfiguration, WithIntegrationOutput {
|
|
172
|
+
/**
|
|
173
|
+
* @deprecated Do not use.
|
|
174
|
+
*/
|
|
175
|
+
defaults: any;
|
|
176
|
+
}
|
|
177
|
+
|
|
178
|
+
/**
|
|
179
|
+
* The output from build-coupled Eleventy sites.
|
|
180
|
+
*/
|
|
181
|
+
export interface EleventyIntegrationOutput extends EleventyConfiguration, WithIntegrationOutput {}
|