Skip to content

Commit cefdba7

Browse files
Add JSON schema for shard.yml (#623)
Co-authored-by: Sijawusz Pur Rahnama <[email protected]>
1 parent e20270d commit cefdba7

File tree

1 file changed

+262
-0
lines changed

1 file changed

+262
-0
lines changed

docs/shard.yml.schema.json

Lines changed: 262 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,262 @@
1+
{
2+
"$schema": "http://json-schema.org/draft-07/schema#",
3+
"title": "shard.yml",
4+
"description": "Metadata for projects managed by Shards",
5+
"type": "object",
6+
"properties": {
7+
"name": {
8+
"type": "string",
9+
"title": "project name",
10+
"description": "The name of the project",
11+
"maxLength": 50,
12+
"pattern": "^(?!.*__|.*--|.*crystal|[0-9_-])[a-z0-9_-]+(?<![_-])$"
13+
},
14+
"version": {
15+
"type": "string",
16+
"title": "project version",
17+
"description": "The version number of the project",
18+
"pattern": "^(?!.*\\.\\.|.*--)[0-9a-zA-Z.-]+$"
19+
},
20+
"authors": {
21+
"type": "array",
22+
"title": "authors",
23+
"description": "A list of authors, along with their contact email",
24+
"items": {
25+
"type": "string",
26+
"title": "author",
27+
"description": "An authors name and contact email"
28+
}
29+
},
30+
"crystal": {
31+
"type": "string",
32+
"title": "crystal version",
33+
"description": "A restriction to indicate what Crystal versions are supported"
34+
},
35+
"dependencies": {
36+
"type": "object",
37+
"title": "dependencies",
38+
"description": "A list of required dependencies\nhttps://github.com/crystal-lang/shards/blob/master/docs/shard.yml.adoc#dependency-attributes",
39+
"additionalProperties": {
40+
"type": "object",
41+
"title": "dependency name",
42+
"description": "The name of the dependency",
43+
"additionalProperties": false,
44+
"properties": {
45+
"github": {
46+
"type": "string",
47+
"title": "GitHub URL",
48+
"description": "GitHub repository URL as user/repo"
49+
},
50+
"gitlab": {
51+
"type": "string",
52+
"title": "GitLab URL",
53+
"description": "GitLab repository URL as user/repo"
54+
},
55+
"bitbucket": {
56+
"type": "string",
57+
"title": "Bitbucket URL",
58+
"description": "Bitbucket repository URL as user/repo"
59+
},
60+
"git": {
61+
"type": "string",
62+
"title": "git URL",
63+
"description": "A Git repository URL"
64+
},
65+
"hg": {
66+
"type": "string",
67+
"title": "Mercurial URL",
68+
"description": "A Mercurial repository URL"
69+
},
70+
"fossil": {
71+
"type": "string",
72+
"title": "Fossil URL",
73+
"description": "A Fossil repository URL"
74+
},
75+
"path": {
76+
"type": "string",
77+
"title": "local path",
78+
"description": "A local path to the dependency"
79+
},
80+
"version": {
81+
"type": "string",
82+
"title": "version requirement",
83+
"description": "A version requirement for the dependency"
84+
},
85+
"branch": {
86+
"type": "string",
87+
"title": "branch",
88+
"description": "Install the specified branch of a Git dependency"
89+
},
90+
"commit": {
91+
"type": "string",
92+
"title": "commit",
93+
"description": "Install the specified commit of a Git, Mercurial, or Fossil dependency"
94+
},
95+
"tag": {
96+
"type": "string",
97+
"title": "tag",
98+
"description": "Install the specified tag of a Git, Mercurial, or Fossil dependency"
99+
},
100+
"bookmark": {
101+
"type": "string",
102+
"title": "bookmark",
103+
"description": "Install the specified bookmark of a Mercurial dependency"
104+
}
105+
}
106+
}
107+
},
108+
"development_dependencies": {
109+
"type": "object",
110+
"title": "development dependencies",
111+
"description": "A list of dependencies required to work on the project, but not necessary to build and run the project\nhttps://github.com/crystal-lang/shards/blob/master/docs/shard.yml.adoc#dependency-attributes",
112+
"additionalProperties": {
113+
"type": "object",
114+
"title": "dependency name",
115+
"description": "The name of the dependency",
116+
"additionalProperties": false,
117+
"properties": {
118+
"github": {
119+
"type": "string",
120+
"title": "GitHub URL",
121+
"description": "GitHub repository URL as user/repo"
122+
},
123+
"gitlab": {
124+
"type": "string",
125+
"title": "GitLab URL",
126+
"description": "GitLab repository URL as user/repo"
127+
},
128+
"bitbucket": {
129+
"type": "string",
130+
"title": "Bitbucket URL",
131+
"description": "Bitbucket repository URL as user/repo"
132+
},
133+
"git": {
134+
"type": "string",
135+
"title": "git URL",
136+
"description": "A Git repository URL"
137+
},
138+
"hg": {
139+
"type": "string",
140+
"title": "Mercurial URL",
141+
"description": "A Mercurial repository URL"
142+
},
143+
"fossil": {
144+
"type": "string",
145+
"title": "Fossil URL",
146+
"description": "A Fossil repository URL"
147+
},
148+
"path": {
149+
"type": "string",
150+
"title": "local path",
151+
"description": "A local path to the dependency"
152+
},
153+
"version": {
154+
"type": "string",
155+
"title": "version requirement",
156+
"description": "A version requirement for the dependency"
157+
},
158+
"branch": {
159+
"type": "string",
160+
"title": "branch",
161+
"description": "Install the specified branch of a Git dependency"
162+
},
163+
"commit": {
164+
"type": "string",
165+
"title": "commit",
166+
"description": "Install the specified commit of a Git, Mercurial, or Fossil dependency"
167+
},
168+
"tag": {
169+
"type": "string",
170+
"title": "tag",
171+
"description": "Install the specified tag of a Git, Mercurial, or Fossil dependency"
172+
},
173+
"bookmark": {
174+
"type": "string",
175+
"title": "bookmark",
176+
"description": "Install the specified bookmark of a Mercurial dependency"
177+
}
178+
}
179+
}
180+
},
181+
"description": {
182+
"type": "string",
183+
"title": "project description",
184+
"description": "A single line description of the project"
185+
},
186+
"documentation": {
187+
"type": "string",
188+
"title": "documentation URL",
189+
"description": "The URL to a website providing the project's documentation for online browsing"
190+
},
191+
"executables": {
192+
"type": "array",
193+
"title": "executables",
194+
"description": "A list of executables to be installed",
195+
"items": {
196+
"type": "string"
197+
}
198+
},
199+
"homepage": {
200+
"type": "string",
201+
"title": "homepage URL",
202+
"description": "The URL of the project's homepage"
203+
},
204+
"libraries": {
205+
"type": "object",
206+
"title": "libraries",
207+
"description": "A list of shared libraries the shard tries to link to",
208+
"additionalProperties": {
209+
"type": "string"
210+
}
211+
},
212+
"license": {
213+
"type": "string",
214+
"title": "license",
215+
"description": "An OSI license name or an URL to a license file"
216+
},
217+
"repository": {
218+
"type": "string",
219+
"title": "repository URL",
220+
"description": "The URL of the project's canonical repository"
221+
},
222+
"scripts": {
223+
"type": "object",
224+
"title": "scripts",
225+
"description": "Script hooks to run",
226+
"properties": {
227+
"postinstall": {
228+
"type": "string",
229+
"title": "postinstall script",
230+
"description": "Will be run whenever the dependency is installed or upgraded in a project that requires it"
231+
}
232+
},
233+
"additionalProperties": false
234+
},
235+
"targets": {
236+
"type": "object",
237+
"title": "targets",
238+
"description": "A list of targets to build",
239+
"additionalProperties": {
240+
"type": "object",
241+
"title": "target name",
242+
"description": "The name of the target",
243+
"additionalProperties": false,
244+
"properties": {
245+
"main": {
246+
"type": "string",
247+
"title": "target main file",
248+
"description": "The main source file to compile for this target"
249+
}
250+
},
251+
"required": [
252+
"main"
253+
]
254+
}
255+
}
256+
},
257+
"required": [
258+
"name",
259+
"version"
260+
],
261+
"additionalProperties": false
262+
}

0 commit comments

Comments
 (0)