Merge pull request #2270 from hugoabernier/main

Automated sample metadata verification
This commit is contained in:
Hugo Bernier 2022-02-12 22:25:27 -05:00 committed by GitHub
commit fa27af8098
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
9 changed files with 18460 additions and 7 deletions

42
.github/workflows/merge-sample-json.yml vendored Normal file
View File

@ -0,0 +1,42 @@
name: Merge Sample JSON
on:
push:
branches:
# When someone push to `main` branch
- main
paths:
- 'samples/**/assets/sample.json'
jobs:
build:
name: 'Merge all sample.json files to samples.json'
runs-on: ubuntu-latest
steps:
- name: Join samples
uses: actions/checkout@v2
with:
path: './'
- run: |
jq -s '[.[][]]' samples/**/assets/sample.json > samples.json
- name: Validate JSON
uses: docker://orrosenblatt/validate-json-action:latest
env:
INPUT_SCHEMA: /metadata-schema.json
INPUT_JSONS: /samples.json
- name: Commit updated file
uses: EndBug/add-and-commit@v6
with:
message: 'Updated samples.json'
add: 'samples.json --force'
cwd: './'
token: ${{ secrets.TOKEN }}
- uses: actions/checkout@v2
with:
fetch-depth: 0
- name: Copy to the pages
uses: planetoftheweb/copy-to-branches@v1
env:
key: main
branches: gh-pages
files: samples.json

210
metadata-schema.json Normal file
View File

@ -0,0 +1,210 @@
{
"$id": "https://developer.microsoft.com/en-us/json-schemas/pnp/samples/v1.0/metadata-schema.json",
"$schema": "http://json-schema.org/draft-07/schema#",
"type": "array",
"items": {
"type": "object",
"properties": {
"name": {
"type": "string",
"pattern": "pnp-sp-dev-spfx-web-parts-.*"
},
"version": {
"type": "string"
},
"source": {
"type": "string",
"default": "pnp",
"pattern": "pnp"
},
"title": {
"type": "string"
},
"url": {
"type": "string",
"pattern": "https:\/\/github.com\/pnp\/sp-dev-fx-webparts\/tree\/main\/samples\/.*"
},
"creationDateTime": {
"type": "string",
"format": "date"
},
"updateDateTime": {
"type": "string",
"format": "date"
},
"shortDescription": {
"type": "string"
},
"longDescription": {
"type": "array",
"items": {
"type": "string"
}
},
"products": {
"type": "array",
"items": {
"type": "string"
}
},
"categories": {
"type": "array",
"items": {
"type": "string"
}
},
"metadata": {
"type": "array",
"items": {
"type": "object",
"properties": {
"key": {
"type": "string"
},
"value": {
"type": "string"
}
},
"required": [
"key",
"value"
]
}
},
"thumbnails": {
"type": "array",
"items": [
{
"type": "object",
"properties": {
"type": {
"type": "string",
"enum": [
"image",
"video",
"slideshow"
]
},
"order": {
"type": "integer"
},
"alt": {
"type": "string"
}
},
"if": {
"properties": {
"type": {
"const": "slideshow"
}
}
},
"then": {
"properties": {
"slides": {
"type": "array",
"items": {
"type": "object",
"properties": {
"url": {
"type": "string"
},
"order": {
"type": "integer"
},
"alt": {
"type": "string"
}
},
"required": [
"url",
"order",
"alt"
]
}
}
},
"required": [
"slides"
]
},
"else": {
"properties": {
"url": {
"type": "string"
}
},
"required": [
"url"
]
},
"required": [
"type",
"order",
"alt"
]
}
]
},
"authors": {
"type": "array",
"items": [
{
"type": "object",
"properties": {
"gitHubAccount": {
"type": "string",
"pattern": "^[a-zA-Z0-9]+(?:-[a-zA-Z0-9]+)*$"
},
"company": {
"type": "string"
},
"pictureUrl": {
"type": "string"
}
},
"required": [
"gitHubAccount"
]
}
]
},
"references": {
"type": "array",
"items": [
{
"type": "object",
"properties": {
"name": {
"type": "string"
},
"description": {
"type": "string"
},
"url": {
"type": "string"
}
},
"required": [
"name",
"url"
]
}
]
}
},
"required": [
"name",
"source",
"title",
"url",
"shortDescription",
"products",
"metadata",
"thumbnails",
"authors",
"creationDateTime",
"updateDateTime"
]
}
}

18184
samples.json Normal file

File diff suppressed because it is too large Load Diff

View File

@ -1,8 +1,8 @@
[
{
"name": "pnp-sp-dev-spfx-web-parts-aad-api-spo-cookie",
"source": "pnp",
"title": "Call custom APIs secured with Azure Active Directory without ADAL JS",
"source": "pnp",
"shortDescription": "Sample SharePoint Framework client-side web part showing how to access a custom API secured with Azure Active Directory (AAD) without using ADAL JS.",
"url": "https://github.com/pnp/sp-dev-fx-webparts/tree/main/samples/aad-api-spo-cookie",
"longDescription": [
@ -84,4 +84,4 @@
}
]
}
]
]

View File

@ -23,6 +23,14 @@
"value": "1.4.1"
}
],
"thumbnails": [
{
"type": "image",
"order": 100,
"url": "https://github.com/pnp/sp-dev-fx-webparts/raw/gh-pages/img/_nopreview.png",
"alt": "No preview available"
}
],
"authors": [
{
"gitHubAccount": "StfBauer",

View File

@ -23,6 +23,14 @@
"value": "1.4.1"
}
],
"thumbnails": [
{
"type": "image",
"order": 100,
"url": "https://github.com/pnp/sp-dev-fx-webparts/raw/gh-pages/img/_nopreview.png",
"alt": "No preview available"
}
],
"authors": [
{
"gitHubAccount": "StfBauer",

View File

@ -1,10 +1,10 @@
[
{
"name": "pnp-sp-dev-spfx-web-parts-react-enhanced-powerapps",
"source": "pnp",
"title": "Enhanced Power Apps",
"source": "pnp",
"shortDescription": "Adds dynamic resizing, theme awareness, and dynamic data to embedded Power Apps",
"url": "https://github.com/pnp/sp-dev-fx-webparts/tree/master/samples/react-enhanced-powerapps",
"url": "https://github.com/pnp/sp-dev-fx-webparts/tree/main/samples/react-enhanced-powerapps",
"longDescription": [
"Adds dynamic resizing, theme awareness, and dynamic data to embedded Power Apps"
],

View File

@ -38,7 +38,7 @@
],
"authors": [
{
"gitHubAccount": "a1mery ",
"gitHubAccount": "a1mery",
"pictureUrl": "https://github.com/a1mery.png",
"name": "Aimery Thomas",
"twitter": "aimery_thomas"

View File

@ -1,10 +1,11 @@
[
{
"name": "pnp-sp-dev-spfx-web-parts-react-list-form",
"version": null,
"source": "pnp",
"url": "https://github.com/pnp/sp-dev-fx-webparts/tree/master/samples/react-list-form",
"url": "https://github.com/pnp/sp-dev-fx-webparts/tree/main/samples/react-list-form",
"title": "List Form Web Part",
"creationDateTime": "2017-11-24",
"updateDateTime": "2021-02-19",
"shortDescription": "The React List Form web part is a web part for adding a list form to any page. It provides a working example of implementing generic SharePoint list forms using the SharePoint Framework (SPFx) and the React and Office UI Fabric libraries.",
"longDescription": [
"The React List Form web part is a web part for adding a list form to any page. It provides a working example of implementing generic SharePoint list forms using the SharePoint Framework (SPFx) and the React and Office UI Fabric libraries."