@thegetty/quire-cli 1.0.0-rc.45 → 1.0.0-rc.47
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/CHANGELOG.md +0 -36
- package/README.md +0 -9
- package/bin/cli.js +1 -46
- package/package.json +10 -27
- package/src/Command.js +6 -26
- package/src/commands/README.md +122 -213
- package/src/commands/build.js +37 -45
- package/src/commands/clean.js +19 -33
- package/src/commands/conf.js +43 -0
- package/src/commands/create.js +14 -42
- package/src/commands/epub.js +31 -67
- package/src/commands/index.js +2 -9
- package/src/commands/info.js +86 -88
- package/src/commands/pdf.js +82 -63
- package/src/commands/preview.js +31 -32
- package/src/commands/validate.js +20 -64
- package/src/commands/version.js +43 -0
- package/src/errors/validation/validation-error.js +11 -20
- package/src/helpers/clean.js +1 -1
- package/src/helpers/is-quire.js +31 -0
- package/src/helpers/test-cwd.js +6 -5
- package/src/helpers/which.js +4 -10
- package/src/lib/11ty/README.md +19 -135
- package/src/lib/11ty/api.js +93 -235
- package/src/lib/11ty/cli.js +37 -112
- package/src/lib/11ty/index.js +5 -64
- package/src/lib/11ty/paths.js +103 -0
- package/src/lib/README.md +0 -330
- package/src/lib/conf/README.md +69 -86
- package/src/lib/conf/config.js +3 -5
- package/src/lib/conf/defaults.js +0 -65
- package/src/lib/conf/schema.js +9 -103
- package/src/lib/epub/README.md +2 -133
- package/src/lib/epub/epub.js +11 -36
- package/src/lib/epub/index.js +21 -111
- package/src/lib/epub/pandoc.js +4 -33
- package/src/lib/git/README.md +2 -151
- package/src/lib/git/index.js +13 -217
- package/src/lib/i18n/README.md +3 -0
- package/src/lib/i18n/config.js +53 -0
- package/src/lib/i18n/index.js +43 -0
- package/src/lib/i18n/localeService.js +58 -0
- package/src/lib/pdf/README.md +0 -131
- package/src/lib/pdf/index.js +21 -124
- package/src/lib/pdf/paged.js +52 -100
- package/src/lib/pdf/prince.js +37 -115
- package/src/lib/pdf/split.js +33 -61
- package/src/lib/quire/README.md +19 -0
- package/src/lib/quire/index.js +353 -0
- package/src/lib/reporter/README.md +2 -211
- package/src/lib/reporter/index.js +0 -607
- package/src/main.js +48 -221
- package/src/packageConfig.js +0 -17
- package/src/validators/utils.js +1 -2
- package/man/quire.1 +0 -341
- package/man/quire.1.md +0 -232
- package/schemas/config.schema.json +0 -194
- package/schemas/figures.schema.json +0 -56
- package/schemas/layout.schema.json +0 -5
- package/schemas/objects.schema.json +0 -62
- package/schemas/publication.schema.json +0 -140
- package/schemas/references.schema.json +0 -29
- package/src/Command.spec.js +0 -99
- package/src/commands/build.spec.js +0 -113
- package/src/commands/build.test.js +0 -397
- package/src/commands/clean.spec.js +0 -118
- package/src/commands/clean.test.js +0 -382
- package/src/commands/config.js +0 -238
- package/src/commands/config.spec.js +0 -107
- package/src/commands/config.test.js +0 -845
- package/src/commands/create.spec.js +0 -112
- package/src/commands/create.test.js +0 -415
- package/src/commands/doctor.js +0 -251
- package/src/commands/doctor.spec.js +0 -115
- package/src/commands/doctor.test.js +0 -1409
- package/src/commands/epub.spec.js +0 -114
- package/src/commands/epub.test.js +0 -503
- package/src/commands/help.js +0 -60
- package/src/commands/help.test.js +0 -132
- package/src/commands/info.spec.js +0 -72
- package/src/commands/info.test.js +0 -512
- package/src/commands/pdf.spec.js +0 -114
- package/src/commands/pdf.test.js +0 -464
- package/src/commands/preview.spec.js +0 -97
- package/src/commands/preview.test.js +0 -250
- package/src/commands/use.js +0 -56
- package/src/commands/use.spec.js +0 -61
- package/src/commands/use.test.js +0 -280
- package/src/commands/validate.spec.js +0 -90
- package/src/commands/validate.test.js +0 -378
- package/src/commands/workflows.js +0 -70
- package/src/errors/build/build-failed-error.js +0 -19
- package/src/errors/build/config-field-missing-error.js +0 -20
- package/src/errors/build/config-file-not-found-error.js +0 -20
- package/src/errors/build/index.js +0 -11
- package/src/errors/help/help-topic-not-found-error.js +0 -30
- package/src/errors/help/index.js +0 -8
- package/src/errors/index.js +0 -58
- package/src/errors/input/index.js +0 -8
- package/src/errors/input/invalid-input-error.js +0 -21
- package/src/errors/install/dependency-install-error.js +0 -19
- package/src/errors/install/directory-not-empty-error.js +0 -25
- package/src/errors/install/index.js +0 -12
- package/src/errors/install/invalid-path-error.js +0 -31
- package/src/errors/install/invalid-starter-error.js +0 -27
- package/src/errors/install/version-not-found-error.js +0 -35
- package/src/errors/output/epub-generation-error.js +0 -19
- package/src/errors/output/index.js +0 -14
- package/src/errors/output/invalid-epub-library-error.js +0 -20
- package/src/errors/output/invalid-pdf-library-error.js +0 -20
- package/src/errors/output/missing-build-output-error.js +0 -21
- package/src/errors/output/pdf-generation-error.js +0 -24
- package/src/errors/output/tool-not-found-error.js +0 -37
- package/src/errors/project/index.js +0 -10
- package/src/errors/project/not-in-project-error.js +0 -20
- package/src/errors/project/project-create-error.js +0 -21
- package/src/errors/quire-error.js +0 -27
- package/src/errors/validation/index.js +0 -3
- package/src/errors/validation/unknown-config-key-error.js +0 -27
- package/src/errors/validation/unknown-config-operation-error.js +0 -24
- package/src/helpers/docs-url.js +0 -32
- package/src/helpers/pager.js +0 -59
- package/src/helpers/pager.test.js +0 -85
- package/src/helpers/suggest-similar.js +0 -124
- package/src/helpers/suggest-similar.test.js +0 -108
- package/src/helpers/test-cwd.test.js +0 -192
- package/src/lib/11ty/index.test.js +0 -655
- package/src/lib/commander/index.js +0 -103
- package/src/lib/commander/index.test.js +0 -86
- package/src/lib/commander/options.js +0 -237
- package/src/lib/commander/options.test.js +0 -205
- package/src/lib/conf/build-status.js +0 -103
- package/src/lib/conf/build-status.test.js +0 -247
- package/src/lib/conf/config.test.js +0 -281
- package/src/lib/conf/format.js +0 -60
- package/src/lib/conf/format.test.js +0 -106
- package/src/lib/conf/helpers.js +0 -91
- package/src/lib/conf/helpers.test.js +0 -136
- package/src/lib/conf/index.js +0 -22
- package/src/lib/constants.js +0 -28
- package/src/lib/doctor/README.md +0 -667
- package/src/lib/doctor/checks/environment/cli-version.js +0 -62
- package/src/lib/doctor/checks/environment/cli-version.test.js +0 -132
- package/src/lib/doctor/checks/environment/git-available.js +0 -77
- package/src/lib/doctor/checks/environment/git-available.test.js +0 -52
- package/src/lib/doctor/checks/environment/index.js +0 -13
- package/src/lib/doctor/checks/environment/node-version.js +0 -66
- package/src/lib/doctor/checks/environment/node-version.test.js +0 -17
- package/src/lib/doctor/checks/environment/npm-available.js +0 -66
- package/src/lib/doctor/checks/environment/npm-available.test.js +0 -52
- package/src/lib/doctor/checks/environment/os-info.js +0 -48
- package/src/lib/doctor/checks/environment/os-info.test.js +0 -81
- package/src/lib/doctor/checks/environment/runtime-info.js +0 -51
- package/src/lib/doctor/checks/environment/runtime-info.test.js +0 -132
- package/src/lib/doctor/checks/outputs/epub-output.js +0 -119
- package/src/lib/doctor/checks/outputs/epub-output.test.js +0 -277
- package/src/lib/doctor/checks/outputs/index.js +0 -10
- package/src/lib/doctor/checks/outputs/pdf-output.js +0 -144
- package/src/lib/doctor/checks/outputs/pdf-output.test.js +0 -377
- package/src/lib/doctor/checks/outputs/stale-build.js +0 -122
- package/src/lib/doctor/checks/outputs/stale-build.test.js +0 -282
- package/src/lib/doctor/checks/project/data-files.js +0 -56
- package/src/lib/doctor/checks/project/data-files.test.js +0 -125
- package/src/lib/doctor/checks/project/dependencies.js +0 -53
- package/src/lib/doctor/checks/project/dependencies.test.js +0 -71
- package/src/lib/doctor/checks/project/index.js +0 -11
- package/src/lib/doctor/checks/project/quire-11ty.js +0 -98
- package/src/lib/doctor/checks/project/quire-11ty.test.js +0 -170
- package/src/lib/doctor/checks/project/quire-project.js +0 -38
- package/src/lib/doctor/checks/project/quire-project.test.js +0 -47
- package/src/lib/doctor/checks/tools/index.js +0 -10
- package/src/lib/doctor/checks/tools/pandoc-available.js +0 -82
- package/src/lib/doctor/checks/tools/pandoc-available.test.js +0 -73
- package/src/lib/doctor/checks/tools/prince-available.js +0 -81
- package/src/lib/doctor/checks/tools/prince-available.test.js +0 -73
- package/src/lib/doctor/constants.js +0 -39
- package/src/lib/doctor/formatDuration.js +0 -108
- package/src/lib/doctor/formatDuration.test.js +0 -76
- package/src/lib/doctor/formatters/human.js +0 -257
- package/src/lib/doctor/formatters/human.test.js +0 -463
- package/src/lib/doctor/formatters/index.js +0 -8
- package/src/lib/doctor/formatters/json.js +0 -78
- package/src/lib/doctor/formatters/json.test.js +0 -174
- package/src/lib/doctor/formatters/shared.js +0 -129
- package/src/lib/doctor/formatters/shared.test.js +0 -194
- package/src/lib/doctor/index.js +0 -271
- package/src/lib/doctor/index.test.js +0 -797
- package/src/lib/epub/engines.js +0 -46
- package/src/lib/epub/index.test.js +0 -518
- package/src/lib/epub/pandoc.test.js +0 -122
- package/src/lib/epub/schema.js +0 -21
- package/src/lib/error/README.md +0 -170
- package/src/lib/error/handler.js +0 -107
- package/src/lib/git/index.spec.js +0 -80
- package/src/lib/git/index.test.js +0 -453
- package/src/lib/help/frontmatter.js +0 -77
- package/src/lib/help/frontmatter.test.js +0 -139
- package/src/lib/help/index.js +0 -146
- package/src/lib/help/index.test.js +0 -188
- package/src/lib/help/topics/configuration.md +0 -77
- package/src/lib/help/topics/debugging.md +0 -69
- package/src/lib/help/topics/epub.md +0 -74
- package/src/lib/help/topics/pdf.md +0 -74
- package/src/lib/help/topics/publishing.md +0 -80
- package/src/lib/help/topics/workflows.md +0 -50
- package/src/lib/installer/index.js +0 -309
- package/src/lib/installer/index.spec.js +0 -83
- package/src/lib/installer/index.test.js +0 -545
- package/src/lib/logger/README.md +0 -424
- package/src/lib/logger/debug.js +0 -132
- package/src/lib/logger/debug.spec.js +0 -130
- package/src/lib/logger/debug.test.js +0 -128
- package/src/lib/logger/index.js +0 -228
- package/src/lib/logger/index.spec.js +0 -131
- package/src/lib/logger/index.test.js +0 -578
- package/src/lib/npm/README.md +0 -127
- package/src/lib/npm/index.js +0 -198
- package/src/lib/npm/index.spec.js +0 -60
- package/src/lib/npm/index.test.js +0 -355
- package/src/lib/pdf/engines.js +0 -46
- package/src/lib/pdf/index.test.js +0 -708
- package/src/lib/pdf/paged.test.js +0 -366
- package/src/lib/pdf/prince.test.js +0 -202
- package/src/lib/pdf/schema.js +0 -21
- package/src/lib/pdf/split.test.js +0 -445
- package/src/lib/platform.js +0 -95
- package/src/lib/process/manager.js +0 -110
- package/src/lib/process/manager.test.js +0 -55
- package/src/lib/project/build.js +0 -162
- package/src/lib/project/build.test.js +0 -275
- package/src/lib/project/config.js +0 -48
- package/src/lib/project/config.test.js +0 -134
- package/src/lib/project/detect.js +0 -47
- package/src/lib/project/detect.test.js +0 -157
- package/src/lib/project/index.js +0 -56
- package/src/lib/project/output-paths.js +0 -87
- package/src/lib/project/output-paths.test.js +0 -66
- package/src/lib/project/paths.js +0 -272
- package/src/lib/project/version.js +0 -110
- package/src/lib/project/version.test.js +0 -350
- package/src/lib/reporter/index.test.js +0 -862
- package/src/main.spec.js +0 -61
- package/src/main.test.js +0 -347
- package/src/validators/validate-data-files.js +0 -154
- package/src/validators/validate-data-files.test.js +0 -217
|
@@ -1,194 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"$schema": "http://json-schema.org/draft-07/schema#",
|
|
3
|
-
"title": "Quire Config Schema",
|
|
4
|
-
"type": "object",
|
|
5
|
-
"properties": {
|
|
6
|
-
"accordion": {
|
|
7
|
-
"type": "object",
|
|
8
|
-
"properties": {
|
|
9
|
-
"controls": {
|
|
10
|
-
"type": "string",
|
|
11
|
-
"enum": ["arrow", "plus-minus"]
|
|
12
|
-
},
|
|
13
|
-
"copyButton": {
|
|
14
|
-
"type": "object",
|
|
15
|
-
"properties": {
|
|
16
|
-
"ariaLabel": { "type": "string" },
|
|
17
|
-
"successText": { "type": "string" },
|
|
18
|
-
"symbol": { "type": "string" }
|
|
19
|
-
},
|
|
20
|
-
"required": ["ariaLabel", "successText", "symbol"]
|
|
21
|
-
},
|
|
22
|
-
"globalControls": {
|
|
23
|
-
"type": "object",
|
|
24
|
-
"properties": {
|
|
25
|
-
"collapseText": { "type": "string" },
|
|
26
|
-
"expandText": { "type": "string" }
|
|
27
|
-
},
|
|
28
|
-
"required": ["collapseText", "expandText"]
|
|
29
|
-
}
|
|
30
|
-
},
|
|
31
|
-
"required": ["controls", "copyButton", "globalControls"]
|
|
32
|
-
},
|
|
33
|
-
"analytics": {
|
|
34
|
-
"type": "object",
|
|
35
|
-
"properties": {
|
|
36
|
-
"googleId": { "type": "string" }
|
|
37
|
-
},
|
|
38
|
-
"required": ["googleId"]
|
|
39
|
-
},
|
|
40
|
-
"bylineFormat": {
|
|
41
|
-
"oneOf": [
|
|
42
|
-
{ "type": "string", "enum": ["name", "name-title"] },
|
|
43
|
-
{ "type": "boolean", "enum": [false] }
|
|
44
|
-
]
|
|
45
|
-
},
|
|
46
|
-
"bibliography": {
|
|
47
|
-
"type": "object",
|
|
48
|
-
"properties": {
|
|
49
|
-
"displayOnPage": { "type": "boolean" },
|
|
50
|
-
"displayShort": { "type": "boolean" },
|
|
51
|
-
"heading": { "type": "string" }
|
|
52
|
-
},
|
|
53
|
-
"required": ["displayOnPage", "displayShort", "heading"]
|
|
54
|
-
},
|
|
55
|
-
"citations": {
|
|
56
|
-
"type": "object",
|
|
57
|
-
"properties": {
|
|
58
|
-
"divider": { "type": "string" },
|
|
59
|
-
"popupStyle": {
|
|
60
|
-
"type": "string",
|
|
61
|
-
"enum": ["text", "icon"]
|
|
62
|
-
}
|
|
63
|
-
},
|
|
64
|
-
"required": ["divider", "popupStyle"]
|
|
65
|
-
},
|
|
66
|
-
"entryPage": {
|
|
67
|
-
"type": "object",
|
|
68
|
-
"properties": {
|
|
69
|
-
"sideBySide": { "type": "boolean" },
|
|
70
|
-
"objectLinkText": { "type": "string" }
|
|
71
|
-
},
|
|
72
|
-
"required": ["sideBySide", "objectLinkText"]
|
|
73
|
-
},
|
|
74
|
-
"epub": {
|
|
75
|
-
"type": "object",
|
|
76
|
-
"properties": {
|
|
77
|
-
"defaultCoverImage": { "type": "string" },
|
|
78
|
-
"outputDir": { "type": "string" }
|
|
79
|
-
},
|
|
80
|
-
"required": ["defaultCoverImage", "outputDir"]
|
|
81
|
-
},
|
|
82
|
-
"footnotes": {
|
|
83
|
-
"type": "object",
|
|
84
|
-
"properties": {
|
|
85
|
-
"backlinkSymbol": { "type": "string" }
|
|
86
|
-
},
|
|
87
|
-
"required": ["backlinkSymbol"]
|
|
88
|
-
},
|
|
89
|
-
"figures": {
|
|
90
|
-
"type": "object",
|
|
91
|
-
"properties": {
|
|
92
|
-
"assetDir": { "type": "string" },
|
|
93
|
-
"enableModal": { "type": "boolean" },
|
|
94
|
-
"imageDir": { "type": "string" }
|
|
95
|
-
},
|
|
96
|
-
"required": ["assetDir", "enableModal", "imageDir"]
|
|
97
|
-
},
|
|
98
|
-
"licenseIcons": { "type": "boolean" },
|
|
99
|
-
"localization": {
|
|
100
|
-
"type": "object",
|
|
101
|
-
"properties": {
|
|
102
|
-
"defaultLocale": { "type": "string" }
|
|
103
|
-
},
|
|
104
|
-
"required": ["defaultLocale"]
|
|
105
|
-
},
|
|
106
|
-
"menuType": {
|
|
107
|
-
"type": "string",
|
|
108
|
-
"enum": ["full", "brief"]
|
|
109
|
-
},
|
|
110
|
-
"navigation": {
|
|
111
|
-
"type": "object",
|
|
112
|
-
"properties": {
|
|
113
|
-
"nextButtonText": { "type": "string" },
|
|
114
|
-
"prevButtonText": { "type": "string" }
|
|
115
|
-
},
|
|
116
|
-
"required": ["nextButtonText", "prevButtonText"]
|
|
117
|
-
},
|
|
118
|
-
"pageTitle": {
|
|
119
|
-
"type": "object",
|
|
120
|
-
"properties": {
|
|
121
|
-
"labelDivider": { "type": "string" }
|
|
122
|
-
},
|
|
123
|
-
"required": ["labelDivider"]
|
|
124
|
-
},
|
|
125
|
-
"pdf": {
|
|
126
|
-
"type": "object",
|
|
127
|
-
"properties": {
|
|
128
|
-
"filename": { "type": "string" },
|
|
129
|
-
"outputDir": { "type": "string" },
|
|
130
|
-
"pagePDF": {
|
|
131
|
-
"type": "object",
|
|
132
|
-
"properties": {
|
|
133
|
-
"accessLinks": {
|
|
134
|
-
"type": "array",
|
|
135
|
-
"items": {
|
|
136
|
-
"type": "object",
|
|
137
|
-
"properties": {
|
|
138
|
-
"header": { "type": "boolean" },
|
|
139
|
-
"footer": { "type": "boolean" },
|
|
140
|
-
"label": { "type": "string" }
|
|
141
|
-
}
|
|
142
|
-
}
|
|
143
|
-
},
|
|
144
|
-
"coverPage": { "type": "boolean" },
|
|
145
|
-
"output": { "type": "boolean" }
|
|
146
|
-
},
|
|
147
|
-
"required": ["accessLinks", "coverPage", "output"]
|
|
148
|
-
},
|
|
149
|
-
"publicationPDF": {
|
|
150
|
-
"type": "object",
|
|
151
|
-
"properties": {
|
|
152
|
-
"output": { "type": "boolean" }
|
|
153
|
-
},
|
|
154
|
-
"required": ["output"]
|
|
155
|
-
}
|
|
156
|
-
},
|
|
157
|
-
"required": ["filename", "outputDir", "pagePDF", "publicationPDF"]
|
|
158
|
-
},
|
|
159
|
-
"ref": {
|
|
160
|
-
"type": "object",
|
|
161
|
-
"properties": {
|
|
162
|
-
"sequenceTransition": { "type": "number" }
|
|
163
|
-
},
|
|
164
|
-
"required": ["sequenceTransition"]
|
|
165
|
-
},
|
|
166
|
-
"searchEnabled": { "type": "boolean" },
|
|
167
|
-
"tableOfContents": {
|
|
168
|
-
"type": "object",
|
|
169
|
-
"properties": {
|
|
170
|
-
"contributorDivider": { "type": "string" }
|
|
171
|
-
},
|
|
172
|
-
"required": ["contributorDivider"]
|
|
173
|
-
}
|
|
174
|
-
},
|
|
175
|
-
"required": [
|
|
176
|
-
"accordion",
|
|
177
|
-
"bylineFormat",
|
|
178
|
-
"bibliography",
|
|
179
|
-
"citations",
|
|
180
|
-
"entryPage",
|
|
181
|
-
"epub",
|
|
182
|
-
"footnotes",
|
|
183
|
-
"figures",
|
|
184
|
-
"licenseIcons",
|
|
185
|
-
"localization",
|
|
186
|
-
"menuType",
|
|
187
|
-
"navigation",
|
|
188
|
-
"pageTitle",
|
|
189
|
-
"pdf",
|
|
190
|
-
"ref",
|
|
191
|
-
"searchEnabled",
|
|
192
|
-
"tableOfContents"
|
|
193
|
-
]
|
|
194
|
-
}
|
|
@@ -1,56 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"$schema": "http://json-schema.org/draft-07/schema#",
|
|
3
|
-
"title": "Figures YAML Schema",
|
|
4
|
-
"type": "object",
|
|
5
|
-
"properties": {
|
|
6
|
-
"figure_list": {
|
|
7
|
-
"type": "array",
|
|
8
|
-
"items": {
|
|
9
|
-
"type": "object",
|
|
10
|
-
"required": ["id"],
|
|
11
|
-
"properties": {
|
|
12
|
-
"id": { "type": "string" },
|
|
13
|
-
"label": { "type": "string" },
|
|
14
|
-
"src": { "type": "string" },
|
|
15
|
-
"caption": { "type": "string" },
|
|
16
|
-
"credit": { "type": ["string", "null"] },
|
|
17
|
-
"alt": { "type": ["string", "null"] },
|
|
18
|
-
"poster": { "type": "string" },
|
|
19
|
-
"download": { "type": "boolean" },
|
|
20
|
-
"zoom": { "type": "boolean" },
|
|
21
|
-
"media_id": { "type": "string" },
|
|
22
|
-
"media_type": {
|
|
23
|
-
"type": "string",
|
|
24
|
-
"enum": ["youtube", "soundcloud", "table"]
|
|
25
|
-
},
|
|
26
|
-
"annotations": {
|
|
27
|
-
"type": "array",
|
|
28
|
-
"items": {
|
|
29
|
-
"type": "object",
|
|
30
|
-
"required": ["input", "items"],
|
|
31
|
-
"properties": {
|
|
32
|
-
"input": {
|
|
33
|
-
"type": "string",
|
|
34
|
-
"enum": ["radio", "checkbox"]
|
|
35
|
-
},
|
|
36
|
-
"items": {
|
|
37
|
-
"type": "array",
|
|
38
|
-
"items": {
|
|
39
|
-
"type": "object",
|
|
40
|
-
"properties": {
|
|
41
|
-
"src": { "type": "string" },
|
|
42
|
-
"label": { "type": "string" },
|
|
43
|
-
"selected": { "type": "boolean" }
|
|
44
|
-
},
|
|
45
|
-
"required": ["src"]
|
|
46
|
-
}
|
|
47
|
-
}
|
|
48
|
-
}
|
|
49
|
-
}
|
|
50
|
-
}
|
|
51
|
-
}
|
|
52
|
-
}
|
|
53
|
-
}
|
|
54
|
-
},
|
|
55
|
-
"required": ["figure_list"]
|
|
56
|
-
}
|
|
@@ -1,62 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"$schema": "http://json-schema.org/draft-07/schema#",
|
|
3
|
-
"title": "Objects Schema",
|
|
4
|
-
"type": "object",
|
|
5
|
-
"required": [
|
|
6
|
-
"object_card",
|
|
7
|
-
"object_display_order",
|
|
8
|
-
"object_filters",
|
|
9
|
-
"object_list"
|
|
10
|
-
],
|
|
11
|
-
"properties": {
|
|
12
|
-
"object_filters": {
|
|
13
|
-
"type": "array",
|
|
14
|
-
"items": { "type": "string" },
|
|
15
|
-
"minItems": 0
|
|
16
|
-
},
|
|
17
|
-
"object_card": {
|
|
18
|
-
"type": "array",
|
|
19
|
-
"items": { "type": "string" },
|
|
20
|
-
"minItems": 0
|
|
21
|
-
},
|
|
22
|
-
"object_display_order": {
|
|
23
|
-
"type": "array",
|
|
24
|
-
"items": { "type": "string" },
|
|
25
|
-
"minItems": 0
|
|
26
|
-
},
|
|
27
|
-
"object_list": {
|
|
28
|
-
"type": "array",
|
|
29
|
-
"items": {
|
|
30
|
-
"type": "object",
|
|
31
|
-
"properties": {
|
|
32
|
-
"id": { "type": "string" },
|
|
33
|
-
"title": { "type": "string" },
|
|
34
|
-
"artist": { "type": "string" },
|
|
35
|
-
"year": { "type": "string" },
|
|
36
|
-
"medium": { "type": "string" },
|
|
37
|
-
"dimensions": { "type": "string" },
|
|
38
|
-
"location": { "type": "string" },
|
|
39
|
-
"link": { "type": "string", "format": "uri" },
|
|
40
|
-
"figure": {
|
|
41
|
-
"type": "array",
|
|
42
|
-
"items": {
|
|
43
|
-
"type": "object",
|
|
44
|
-
"properties": {
|
|
45
|
-
"id": { "type": "string" }
|
|
46
|
-
},
|
|
47
|
-
"required": [
|
|
48
|
-
"id"
|
|
49
|
-
]
|
|
50
|
-
},
|
|
51
|
-
"minItems": 0
|
|
52
|
-
}
|
|
53
|
-
},
|
|
54
|
-
"required": [
|
|
55
|
-
"id",
|
|
56
|
-
"title"
|
|
57
|
-
]
|
|
58
|
-
},
|
|
59
|
-
"minItems": 0
|
|
60
|
-
}
|
|
61
|
-
}
|
|
62
|
-
}
|
|
@@ -1,140 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"$schema": "http://json-schema.org/draft-07/schema#",
|
|
3
|
-
"title": "Publication Schema",
|
|
4
|
-
"type": "object",
|
|
5
|
-
"required": [
|
|
6
|
-
"url",
|
|
7
|
-
"title",
|
|
8
|
-
"subtitle",
|
|
9
|
-
"description",
|
|
10
|
-
"pub_date",
|
|
11
|
-
"language",
|
|
12
|
-
"pub_type",
|
|
13
|
-
"identifier",
|
|
14
|
-
"publisher",
|
|
15
|
-
"contributor",
|
|
16
|
-
"copyright",
|
|
17
|
-
"license",
|
|
18
|
-
"resource_link",
|
|
19
|
-
"subject",
|
|
20
|
-
"revision_history",
|
|
21
|
-
"promo_image"
|
|
22
|
-
],
|
|
23
|
-
"properties": {
|
|
24
|
-
"url": { "type": "string" },
|
|
25
|
-
"title": { "type": "string" },
|
|
26
|
-
"subtitle": { "type": "string" },
|
|
27
|
-
"reading_line": { "type": ["string", "null"] },
|
|
28
|
-
"short_title": { "type": ["string", "null"] },
|
|
29
|
-
"description": {
|
|
30
|
-
"type": "object",
|
|
31
|
-
"required": ["full"],
|
|
32
|
-
"properties": {
|
|
33
|
-
"one_line": { "type": ["string", "null"] },
|
|
34
|
-
"full": { "type": "string" }
|
|
35
|
-
}
|
|
36
|
-
},
|
|
37
|
-
"pub_date": {
|
|
38
|
-
"oneOf": [
|
|
39
|
-
{ "type": "string" },
|
|
40
|
-
{ "type": "object" }
|
|
41
|
-
] },
|
|
42
|
-
"language": { "type": "string" },
|
|
43
|
-
"pub_type": { "type": "string" },
|
|
44
|
-
"identifier": {
|
|
45
|
-
"type": "object",
|
|
46
|
-
"properties": {
|
|
47
|
-
"isbn": { "type": ["string", "null"] }
|
|
48
|
-
}
|
|
49
|
-
},
|
|
50
|
-
"publisher": {
|
|
51
|
-
"type": "array",
|
|
52
|
-
"items": { "$ref": "#/definitions/publisher" }
|
|
53
|
-
},
|
|
54
|
-
"contributor_as_it_appears": { "type": ["string", "null"] },
|
|
55
|
-
"contributor": {
|
|
56
|
-
"type": "array",
|
|
57
|
-
"items": { "$ref": "#/definitions/contributor" }
|
|
58
|
-
},
|
|
59
|
-
"copyright": { "type": "string" },
|
|
60
|
-
"license": { "$ref": "#/definitions/license" },
|
|
61
|
-
"resource_link": {
|
|
62
|
-
"type": "array",
|
|
63
|
-
"items": { "$ref": "#/definitions/resourceLink" }
|
|
64
|
-
},
|
|
65
|
-
"subject": {
|
|
66
|
-
"type": "array",
|
|
67
|
-
"items": { "$ref": "#/definitions/subject" }
|
|
68
|
-
},
|
|
69
|
-
"revision_history": {
|
|
70
|
-
"type": "array",
|
|
71
|
-
"items": { "$ref": "#/definitions/revision" }
|
|
72
|
-
},
|
|
73
|
-
"repository_url": { "type": ["string", "null"] },
|
|
74
|
-
"promo_image": { "type": "string" }
|
|
75
|
-
},
|
|
76
|
-
"definitions": {
|
|
77
|
-
"publisher": {
|
|
78
|
-
"type": "object",
|
|
79
|
-
"required": ["name"],
|
|
80
|
-
"properties": {
|
|
81
|
-
"name": { "type": "string" },
|
|
82
|
-
"location": { "type": ["string", "null"] },
|
|
83
|
-
"url": { "type": ["string", "null"] },
|
|
84
|
-
"logo": { "type": ["string", "null"] }
|
|
85
|
-
}
|
|
86
|
-
},
|
|
87
|
-
"contributor": {
|
|
88
|
-
"type": "object",
|
|
89
|
-
"required": ["id", "type", "first_name", "last_name"],
|
|
90
|
-
"properties": {
|
|
91
|
-
"id": { "type": "string" },
|
|
92
|
-
"type": { "type": "string" },
|
|
93
|
-
"first_name": { "type": "string" },
|
|
94
|
-
"last_name": { "type": "string" },
|
|
95
|
-
"title": { "type": ["string", "null"] },
|
|
96
|
-
"affiliation": { "type": ["string", "null"] },
|
|
97
|
-
"bio": { "type": ["string", "null"] },
|
|
98
|
-
"url": { "type": ["string", "null"] },
|
|
99
|
-
"image": { "type": ["string", "null"] }
|
|
100
|
-
}
|
|
101
|
-
},
|
|
102
|
-
"license": {
|
|
103
|
-
"type": "object",
|
|
104
|
-
"required": ["name", "abbreviation", "url", "scope"],
|
|
105
|
-
"properties": {
|
|
106
|
-
"name": { "type": "string" },
|
|
107
|
-
"abbreviation": { "type": "string" },
|
|
108
|
-
"url": { "type": "string" },
|
|
109
|
-
"scope": { "type": "string" }
|
|
110
|
-
}
|
|
111
|
-
},
|
|
112
|
-
"resourceLink": {
|
|
113
|
-
"type": "object",
|
|
114
|
-
"required": ["type", "name", "link_relation"],
|
|
115
|
-
"properties": {
|
|
116
|
-
"type": { "type": "string" },
|
|
117
|
-
"name": { "type": "string" },
|
|
118
|
-
"media_type": { "type": ["string", "null"] },
|
|
119
|
-
"link_relation": { "type": "string" },
|
|
120
|
-
"url": { "type": ["string", "null"] }
|
|
121
|
-
}
|
|
122
|
-
},
|
|
123
|
-
"subject": {
|
|
124
|
-
"type": "object",
|
|
125
|
-
"required": ["type", "name"],
|
|
126
|
-
"properties": {
|
|
127
|
-
"type": { "type": "string" },
|
|
128
|
-
"name": { "type": "string" },
|
|
129
|
-
"identifier": { "type": ["string", "null"] }
|
|
130
|
-
}
|
|
131
|
-
},
|
|
132
|
-
"revision": {
|
|
133
|
-
"type": "object",
|
|
134
|
-
"properties": {
|
|
135
|
-
"date": { "type": ["string", "null"] },
|
|
136
|
-
"summary": { "type": ["string", "null"] }
|
|
137
|
-
}
|
|
138
|
-
}
|
|
139
|
-
}
|
|
140
|
-
}
|
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"$schema": "http://json-schema.org/draft-07/schema#",
|
|
3
|
-
"title": "References Schema",
|
|
4
|
-
"type": "object",
|
|
5
|
-
"required": [
|
|
6
|
-
"entries"
|
|
7
|
-
],
|
|
8
|
-
"properties": {
|
|
9
|
-
"entries": {
|
|
10
|
-
"type": "array",
|
|
11
|
-
"items": {
|
|
12
|
-
"type": "object",
|
|
13
|
-
"properties": {
|
|
14
|
-
"id": {
|
|
15
|
-
"type": "string"
|
|
16
|
-
},
|
|
17
|
-
"full": {
|
|
18
|
-
"type": "string"
|
|
19
|
-
}
|
|
20
|
-
},
|
|
21
|
-
"required": [
|
|
22
|
-
"full",
|
|
23
|
-
"id"
|
|
24
|
-
]
|
|
25
|
-
},
|
|
26
|
-
"minItems": 0
|
|
27
|
-
}
|
|
28
|
-
}
|
|
29
|
-
}
|
package/src/Command.spec.js
DELETED
|
@@ -1,99 +0,0 @@
|
|
|
1
|
-
import Command from './Command.js'
|
|
2
|
-
import test from 'ava'
|
|
3
|
-
|
|
4
|
-
/**
|
|
5
|
-
* Command Base Class Unit Tests
|
|
6
|
-
*
|
|
7
|
-
* Tests the abstract Command base class API contract.
|
|
8
|
-
* These tests verify the class cannot be instantiated directly
|
|
9
|
-
* and that the base methods behave correctly.
|
|
10
|
-
*/
|
|
11
|
-
|
|
12
|
-
test('Command cannot be instantiated directly', (t) => {
|
|
13
|
-
const error = t.throws(() => {
|
|
14
|
-
new Command({ name: 'test', description: 'test command' })
|
|
15
|
-
})
|
|
16
|
-
|
|
17
|
-
t.truthy(error)
|
|
18
|
-
t.regex(error.message, /abstract/i, 'error message should mention abstract')
|
|
19
|
-
})
|
|
20
|
-
|
|
21
|
-
test('Command.action() throws not-implemented error', (t) => {
|
|
22
|
-
// Create a minimal subclass that does not override action
|
|
23
|
-
class TestCommand extends Command {
|
|
24
|
-
constructor() {
|
|
25
|
-
super({ name: 'test', description: 'test command' })
|
|
26
|
-
}
|
|
27
|
-
}
|
|
28
|
-
|
|
29
|
-
const command = new TestCommand()
|
|
30
|
-
const error = t.throws(() => command.action())
|
|
31
|
-
|
|
32
|
-
t.truthy(error)
|
|
33
|
-
t.regex(error.message, /not been implemented/i, 'error message should indicate not implemented')
|
|
34
|
-
t.regex(error.message, /test/i, 'error message should include the command name')
|
|
35
|
-
})
|
|
36
|
-
|
|
37
|
-
test('subclass can override action without error', (t) => {
|
|
38
|
-
class TestCommand extends Command {
|
|
39
|
-
constructor() {
|
|
40
|
-
super({ name: 'test', description: 'test command' })
|
|
41
|
-
}
|
|
42
|
-
|
|
43
|
-
action() {
|
|
44
|
-
return 'action executed'
|
|
45
|
-
}
|
|
46
|
-
}
|
|
47
|
-
|
|
48
|
-
const command = new TestCommand()
|
|
49
|
-
const result = command.action()
|
|
50
|
-
|
|
51
|
-
t.is(result, 'action executed')
|
|
52
|
-
})
|
|
53
|
-
|
|
54
|
-
test('Command constructor sets properties from definition', (t) => {
|
|
55
|
-
const definition = {
|
|
56
|
-
name: 'test',
|
|
57
|
-
description: 'A test command',
|
|
58
|
-
summary: 'test summary',
|
|
59
|
-
aliases: ['t', 'tst'],
|
|
60
|
-
args: [['<input>', 'input file']],
|
|
61
|
-
options: [['--verbose', 'enable verbose output']],
|
|
62
|
-
version: '1.0.0',
|
|
63
|
-
hidden: true,
|
|
64
|
-
}
|
|
65
|
-
|
|
66
|
-
class TestCommand extends Command {
|
|
67
|
-
constructor() {
|
|
68
|
-
super(definition)
|
|
69
|
-
}
|
|
70
|
-
|
|
71
|
-
action() {}
|
|
72
|
-
}
|
|
73
|
-
|
|
74
|
-
const command = new TestCommand()
|
|
75
|
-
|
|
76
|
-
t.is(command.name, 'test')
|
|
77
|
-
t.is(command.description, 'A test command')
|
|
78
|
-
t.is(command.summary, 'test summary')
|
|
79
|
-
t.deepEqual(command.aliases, ['t', 'tst'])
|
|
80
|
-
t.deepEqual(command.args, [['<input>', 'input file']])
|
|
81
|
-
t.deepEqual(command.options, [['--verbose', 'enable verbose output']])
|
|
82
|
-
t.is(command.version, '1.0.0')
|
|
83
|
-
t.is(command.hidden, true)
|
|
84
|
-
})
|
|
85
|
-
|
|
86
|
-
test('Command constructor injects shared configuration', (t) => {
|
|
87
|
-
class TestCommand extends Command {
|
|
88
|
-
constructor() {
|
|
89
|
-
super({ name: 'test', description: 'test command' })
|
|
90
|
-
}
|
|
91
|
-
|
|
92
|
-
action() {}
|
|
93
|
-
}
|
|
94
|
-
|
|
95
|
-
const command = new TestCommand()
|
|
96
|
-
|
|
97
|
-
t.truthy(command.config, 'config should be injected')
|
|
98
|
-
t.is(typeof command.config.get, 'function', 'config should have get method')
|
|
99
|
-
})
|