-
Notifications
You must be signed in to change notification settings - Fork 257
[feat] Add JSONSchemas #134
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,157 @@ | ||
| { | ||
| "$schema": "https://json-schema.org/draft/2020-12/schema", | ||
| "$id": "https://example.com/schemas/compiled.schema.json", | ||
| "title": "Component Gallery compiled catalog (compiled/components.json)", | ||
| "type": "object", | ||
| "additionalProperties": false, | ||
| "required": ["generatedAt", "schemaVersion", "categories", "components"], | ||
| "properties": { | ||
| "generatedAt": { "type": "string", "format": "date-time" }, | ||
| "schemaVersion": { "type": "integer", "const": 1 }, | ||
| "categories": { | ||
| "type": "array", | ||
| "minItems": 1, | ||
| "uniqueItems": true, | ||
| "items": { "type": "string" } | ||
| }, | ||
| "components": { | ||
| "type": "array", | ||
| "items": { | ||
| "type": "object", | ||
| "additionalProperties": false, | ||
| "required": [ | ||
| "title", | ||
| "author", | ||
| "socialUrl", | ||
| "pipLink", | ||
| "categories", | ||
| "image", | ||
| "gitHubUrl", | ||
| "enabled", | ||
| "appUrl" | ||
| ], | ||
| "properties": { | ||
| "title": { "type": "string", "minLength": 1 }, | ||
| "author": { "type": "string", "minLength": 1 }, | ||
| "pipLink": { | ||
| "oneOf": [ | ||
| { "type": "string", "minLength": 1 }, | ||
| { "type": "null" } | ||
| ] | ||
| }, | ||
| "pypi": { | ||
| "oneOf": [ | ||
| { "type": "string", "minLength": 1 }, | ||
| { "type": "null" } | ||
| ] | ||
| }, | ||
| "categories": { | ||
| "type": "array", | ||
| "minItems": 1, | ||
| "uniqueItems": true, | ||
| "items": { "type": "string" } | ||
| }, | ||
| "image": { "type": ["string", "null"], "format": "uri" }, | ||
| "gitHubUrl": { "type": "string", "format": "uri" }, | ||
| "enabled": { "type": "boolean" }, | ||
| "appUrl": { "type": ["string", "null"], "format": "uri" }, | ||
| "socialUrl": { "type": ["string", "null"], "format": "uri" }, | ||
| "metrics": { | ||
| "type": ["object", "null"], | ||
| "additionalProperties": false, | ||
| "properties": { | ||
| "github": { | ||
| "type": ["object", "null"], | ||
| "additionalProperties": false, | ||
| "properties": { | ||
| "stars": { "type": ["integer", "null"], "minimum": 0 }, | ||
| "forks": { "type": ["integer", "null"], "minimum": 0 }, | ||
| "contributorsCount": { | ||
| "type": ["integer", "null"], | ||
| "minimum": 0 | ||
| }, | ||
| "openIssues": { "type": ["integer", "null"], "minimum": 0 }, | ||
| "lastPushAt": { | ||
| "type": ["string", "null"], | ||
| "format": "date-time" | ||
| }, | ||
| "fetchedAt": { | ||
| "type": ["string", "null"], | ||
| "format": "date-time" | ||
| }, | ||
| "isStale": { "type": ["boolean", "null"] } | ||
| } | ||
| }, | ||
| "pypi": { | ||
| "type": ["object", "null"], | ||
| "additionalProperties": false, | ||
| "properties": { | ||
| "latestVersion": { | ||
| "oneOf": [ | ||
| { "type": "string", "minLength": 1 }, | ||
| { "type": "null" } | ||
| ] | ||
| }, | ||
| "latestReleaseAt": { | ||
| "type": ["string", "null"], | ||
| "format": "date-time" | ||
| }, | ||
| "fetchedAt": { | ||
| "type": ["string", "null"], | ||
| "format": "date-time" | ||
| }, | ||
| "isStale": { "type": ["boolean", "null"] } | ||
| } | ||
| }, | ||
| "pypistats": { | ||
| "type": ["object", "null"], | ||
| "additionalProperties": false, | ||
| "properties": { | ||
| "lastDay": { "type": ["integer", "null"], "minimum": 0 }, | ||
| "lastWeek": { "type": ["integer", "null"], "minimum": 0 }, | ||
| "lastMonth": { "type": ["integer", "null"], "minimum": 0 }, | ||
| "fetchedAt": { | ||
| "type": ["string", "null"], | ||
| "format": "date-time" | ||
| }, | ||
| "isStale": { "type": ["boolean", "null"] } | ||
| } | ||
| } | ||
| } | ||
| }, | ||
| "ranking": { | ||
| "type": ["object", "null"], | ||
| "additionalProperties": false, | ||
| "required": ["score", "signals", "computedAt"], | ||
sfc-gh-bnisco marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| "properties": { | ||
| "score": { "type": "number" }, | ||
| "computedAt": { "type": "string", "format": "date-time" }, | ||
| "signals": { | ||
| "type": "object", | ||
| "additionalProperties": false, | ||
| "properties": { | ||
| "starsScore": { "type": ["number", "null"] }, | ||
| "recencyScore": { "type": ["number", "null"] }, | ||
| "daysSinceUpdate": { | ||
| "type": ["number", "null"], | ||
| "minimum": 0 | ||
| }, | ||
| "contributorsScore": { "type": ["number", "null"] }, | ||
| "daysSinceGithubPush": { | ||
sfc-gh-bnisco marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| "type": ["number", "null"], | ||
| "minimum": 0 | ||
| }, | ||
| "daysSincePypiRelease": { | ||
sfc-gh-bnisco marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| "type": ["number", "null"], | ||
| "minimum": 0 | ||
| }, | ||
| "downloadsScore": { "type": ["number", "null"] } | ||
| } | ||
| } | ||
| } | ||
| } | ||
| } | ||
| } | ||
| } | ||
| } | ||
| } | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,124 @@ | ||
| { | ||
| "$schema": "https://json-schema.org/draft/2020-12/schema", | ||
| "$id": "https://example.com/schemas/component.schema.json", | ||
| "title": "Component Gallery submission (source-of-truth)", | ||
| "type": "object", | ||
| "additionalProperties": false, | ||
| "required": ["schemaVersion", "title", "author", "links", "governance", "categories"], | ||
| "properties": { | ||
| "schemaVersion": { | ||
| "type": "integer", | ||
| "const": 1 | ||
| }, | ||
| "title": { | ||
| "type": "string", | ||
| "minLength": 1, | ||
| "maxLength": 80 | ||
| }, | ||
| "author": { | ||
| "type": "object", | ||
| "additionalProperties": false, | ||
| "required": ["github"], | ||
| "properties": { | ||
| "github": { | ||
| "type": "string", | ||
| "minLength": 1, | ||
| "maxLength": 39, | ||
| "pattern": "^[A-Za-z0-9_]+(?:-[A-Za-z0-9_]+)*$", | ||
| "description": "GitHub username (no @)." | ||
| }, | ||
| "displayName": { | ||
| "type": "string", | ||
| "minLength": 1, | ||
| "maxLength": 80 | ||
| } | ||
| } | ||
| }, | ||
| "links": { | ||
| "type": "object", | ||
| "additionalProperties": false, | ||
| "required": ["github"], | ||
| "properties": { | ||
| "github": { | ||
| "type": "string", | ||
| "format": "uri", | ||
| "pattern": "^https://github\\.com/[^/]+/[^/]+/?$" | ||
| }, | ||
| "pypi": { | ||
| "type": ["string", "null"], | ||
| "pattern": "^[A-Za-z0-9_.-]+$", | ||
sfc-gh-bnisco marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| "description": "PyPI project name (not a URL)." | ||
| }, | ||
| "demo": { | ||
| "type": ["string", "null"], | ||
| "format": "uri" | ||
| }, | ||
| "docs": { | ||
| "type": ["string", "null"], | ||
| "format": "uri" | ||
| } | ||
| } | ||
| }, | ||
| "media": { | ||
| "type": "object", | ||
| "additionalProperties": false, | ||
| "properties": { | ||
| "image": { | ||
| "type": ["string", "null"], | ||
| "format": "uri" | ||
| } | ||
| } | ||
| }, | ||
| "install": { | ||
| "type": "object", | ||
| "additionalProperties": false, | ||
| "properties": { | ||
| "pip": { | ||
| "type": ["string", "null"], | ||
| "minLength": 1, | ||
| "maxLength": 200 | ||
| } | ||
| } | ||
| }, | ||
| "governance": { | ||
| "type": "object", | ||
| "additionalProperties": false, | ||
| "required": ["enabled"], | ||
| "properties": { | ||
| "enabled": { | ||
| "type": "boolean" | ||
| }, | ||
| "notes": { | ||
| "type": ["string", "null"], | ||
| "maxLength": 500 | ||
| } | ||
| } | ||
| }, | ||
| "categories": { | ||
| "type": "array", | ||
| "minItems": 1, | ||
| "uniqueItems": true, | ||
| "items": { | ||
| "type": "string", | ||
| "enum": [ | ||
| "LLMs", | ||
| "Widgets", | ||
| "Charts", | ||
| "Authentication", | ||
| "Connections", | ||
| "Images & video", | ||
| "Audio", | ||
| "Text", | ||
| "Maps", | ||
| "Dataframes", | ||
| "Graphs", | ||
| "Molecules & genes", | ||
| "Code editors", | ||
| "Page navigation", | ||
| "Developer tools", | ||
| "Integrations" | ||
| ] | ||
|
Comment on lines
+103
to
+120
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. question: is it safe to assume this isn't difficult to adjust in the future and that this is based on the already existing categories?
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Correct, we can add or remove things as needed and are based on the existing categories right now. The full build pipeline validates all of the underlying json files against these enums, so if there any mismatches, the build will fail. |
||
| } | ||
| } | ||
| } | ||
| } | ||
Uh oh!
There was an error while loading. Please reload this page.