Skip to content
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

Blueprints: Allow optional metadata #1103

Merged
merged 1 commit into from
Mar 12, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
289 changes: 192 additions & 97 deletions packages/playground/blueprints/public/blueprint-schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,35 @@
},
"description": {
"type": "string",
"description": "Optional description. It doesn't do anything but is exposed as a courtesy to developers who may want to document which blueprint file does what."
"description": "Optional description. It doesn't do anything but is exposed as a courtesy to developers who may want to document which blueprint file does what.",
"deprecated": "Use meta.description instead."
},
"meta": {
"type": "object",
"properties": {
"title": {
"type": "string",
"description": "A clear and concise name for your Blueprint."
},
"description": {
"type": "string",
"description": "A brief explanation of what your Blueprint offers."
},
"author": {
"type": "string",
"description": "A GitHub username of the author of this Blueprint."
},
"categories": {
"type": "array",
"items": {
"type": "string"
},
"description": "Relevant categories to help users find your Blueprint in the future Blueprints section on WordPress.org."
}
},
"required": ["title", "author"],
"additionalProperties": false,
"description": "Optional metadata. Used by the Blueprints gallery at https://github.com/WordPress/blueprints"
},
"preferredVersions": {
"type": "object",
Expand Down Expand Up @@ -1171,46 +1199,125 @@
"$ref": "#/definitions/PHPRequestHeaders",
"description": "Request headers."
},
"files": {
"type": "object",
"additionalProperties": {
"type": "object",
"properties": {
"size": {
"type": "number"
},
"type": {
"type": "string"
"body": {
"anyOf": [
{
"type": "string"
},
{
"type": "object",
"properties": {
"BYTES_PER_ELEMENT": {
"type": "number"
},
"buffer": {
"type": "object",
"properties": {
"byteLength": {
"type": "number"
}
},
"required": ["byteLength"],
"additionalProperties": false
},
"byteLength": {
"type": "number"
},
"byteOffset": {
"type": "number"
},
"length": {
"type": "number"
}
},
"lastModified": {
"required": [
"BYTES_PER_ELEMENT",
"buffer",
"byteLength",
"byteOffset",
"length"
],
"additionalProperties": {
"type": "number"
},
"name": {
"type": "string"
},
"webkitRelativePath": {
"type": "string"
}
},
"required": [
"lastModified",
"name",
"size",
"type",
"webkitRelativePath"
],
"additionalProperties": false
},
"description": "Uploaded files"
},
"body": {
"type": "string",
"description": "Request body without the files."
},
"formData": {
"type": "object",
"additionalProperties": {},
"description": "Form data. If set, the request body will be ignored and the content-type header will be set to `application/x-www-form-urlencoded`."
{
"type": "object",
"additionalProperties": {
"anyOf": [
{
"type": "string"
},
{
"type": "object",
"properties": {
"BYTES_PER_ELEMENT": {
"type": "number"
},
"buffer": {
"type": "object",
"properties": {
"byteLength": {
"type": "number"
}
},
"required": ["byteLength"],
"additionalProperties": false
},
"byteLength": {
"type": "number"
},
"byteOffset": {
"type": "number"
},
"length": {
"type": "number"
}
},
"required": [
"BYTES_PER_ELEMENT",
"buffer",
"byteLength",
"byteOffset",
"length"
],
"additionalProperties": {
"type": "number"
}
},
{
"type": "object",
"properties": {
"size": {
"type": "number"
},
"type": {
"type": "string"
},
"lastModified": {
"type": "number"
},
"name": {
"type": "string"
},
"webkitRelativePath": {
"type": "string"
}
},
"required": [
"lastModified",
"name",
"size",
"type",
"webkitRelativePath"
],
"additionalProperties": false
}
]
}
}
],
"description": "Request body. If an object is given, the request will be encoded as multipart and sent with a `multipart/form-data` header."
}
},
"required": ["url"],
Expand Down Expand Up @@ -1250,78 +1357,66 @@
"description": "Request headers."
},
"body": {
"type": "string",
"description": "Request body without the files."
},
"fileInfos": {
"type": "array",
"items": {
"$ref": "#/definitions/FileInfo"
},
"description": "Uploaded files."
},
"code": {
"type": "string",
"description": "The code snippet to eval instead of a php file."
},
"throwOnError": {
"type": "boolean",
"description": "Whether to throw an error if the PHP process exits with a non-zero code or outputs to stderr."
}
},
"additionalProperties": false
},
"FileInfo": {
"type": "object",
"properties": {
"key": {
"type": "string"
},
"name": {
"type": "string"
},
"type": {
"type": "string"
},
"data": {
"type": "object",
"properties": {
"BYTES_PER_ELEMENT": {
"type": "number"
"anyOf": [
{
"type": "string"
},
"buffer": {
{
"type": "object",
"properties": {
"BYTES_PER_ELEMENT": {
"type": "number"
},
"buffer": {
"type": "object",
"properties": {
"byteLength": {
"type": "number"
}
},
"required": ["byteLength"],
"additionalProperties": false
},
"byteLength": {
"type": "number"
},
"byteOffset": {
"type": "number"
},
"length": {
"type": "number"
}
},
"required": ["byteLength"],
"additionalProperties": false
},
"byteLength": {
"type": "number"
},
"byteOffset": {
"type": "number"
},
"length": {
"type": "number"
"required": [
"BYTES_PER_ELEMENT",
"buffer",
"byteLength",
"byteOffset",
"length"
],
"additionalProperties": {
"type": "number"
}
}
},
"required": [
"BYTES_PER_ELEMENT",
"buffer",
"byteLength",
"byteOffset",
"length"
],
"description": "Request body."
},
"env": {
"type": "object",
"additionalProperties": {
"type": "number"
}
"type": "string"
},
"description": "Environment variables to set for this run."
},
"code": {
"type": "string",
"description": "The code snippet to eval instead of a php file."
},
"throwOnError": {
"type": "boolean",
"description": "Whether to throw an error if the PHP process exits with a non-zero code or outputs to stderr."
}
},
"required": ["key", "name", "type", "data"],
"additionalProperties": false
},
"WordPressInstallationOptions": {
Expand Down
23 changes: 23 additions & 0 deletions packages/playground/blueprints/src/lib/blueprint.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,31 @@ export interface Blueprint {
* Optional description. It doesn't do anything but is exposed as
* a courtesy to developers who may want to document which blueprint
* file does what.
*
* @deprecated Use meta.description instead.
*/
description?: string;
/**
* Optional metadata. Used by the Blueprints gallery at https://github.com/WordPress/blueprints
*/
meta?: {
/**
* A clear and concise name for your Blueprint.
*/
title: string;
/**
* A brief explanation of what your Blueprint offers.
*/
description?: string;
/**
* A GitHub username of the author of this Blueprint.
*/
author: string;
/**
* Relevant categories to help users find your Blueprint in the future Blueprints section on WordPress.org.
*/
categories?: string[];
};
/**
* The preferred PHP and WordPress versions to use.
*/
Expand Down
Loading