Merge pull request #2292 from pnp/template-structure
This commit is contained in:
commit
a3a18c591d
|
@ -34,7 +34,7 @@ jobs:
|
||||||
- name: Validate JSON
|
- name: Validate JSON
|
||||||
uses: docker://orrosenblatt/validate-json-action:latest
|
uses: docker://orrosenblatt/validate-json-action:latest
|
||||||
env:
|
env:
|
||||||
INPUT_SCHEMA: ./main/metadata-schema.json
|
INPUT_SCHEMA: ./main/templates/metadata-schema.json
|
||||||
INPUT_JSONS: ./Docs/docs/samples.json
|
INPUT_JSONS: ./Docs/docs/samples.json
|
||||||
- name: copy file to gh-pages
|
- name: copy file to gh-pages
|
||||||
uses: canastro/copy-file-action@master
|
uses: canastro/copy-file-action@master
|
||||||
|
|
|
@ -56,10 +56,10 @@ When you submit a new sample, please follow these guidelines:
|
||||||
|
|
||||||
### README.md
|
### README.md
|
||||||
|
|
||||||
* You will need to have a `README.md` file for your contribution, which is based on [the provided template](../main/samples/README-template.md) under the `samples` folder. Please copy this template to your project and update it accordingly. Your `README.md` must be named exactly `README.md` -- with capital letters -- as this is the information we use to make your sample public.
|
* You will need to have a `README.md` file for your contribution, which is based on [the provided template](../main/templates/README-template.md) under the `samples` folder. Please copy this template to your project and update it accordingly. Your `README.md` must be named exactly `README.md` -- with capital letters -- as this is the information we use to make your sample public.
|
||||||
* You will need to have a screenshot picture of your sample in action in the `README.md` file ("pics or it didn't happen"). The preview image must be located in the `assets` folder in the root of your sample folder.
|
* You will need to have a screenshot picture of your sample in action in the `README.md` file ("pics or it didn't happen"). The preview image must be located in the `assets` folder in the root of your sample folder.
|
||||||
* All screen shots must be located in the `assets` folder. Do not point to your own repository or any other external source
|
* All screen shots must be located in the `assets` folder. Do not point to your own repository or any other external source
|
||||||
* The README template contains a specific tracking image at the end of the file with an `img` element pointing to `https://pnptelemetry.azurewebsites.net/sp-dev-fx-webparts/samples/readme-template`. This is a transparent image which is used to track how many visits each sample receives in GitHub.
|
* The README template contains a specific tracking image at the end of the file with an `img` element pointing to `https://pnptelemetry.azurewebsites.net/sp-dev-fx-webparts/samples/YOUR-SOLUTION-NAME`. This is a transparent image which is used to track how many visits each sample receives in GitHub.
|
||||||
* Update the image `src` attribute according with the repository name and folder information. For example, if your sample is named `react-todo` in the `samples` folder, you should update the `src` attribute to `https://pnptelemetry.azurewebsites.net/sp-dev-fx-webparts/samples/react-todo`
|
* Update the image `src` attribute according with the repository name and folder information. For example, if your sample is named `react-todo` in the `samples` folder, you should update the `src` attribute to `https://pnptelemetry.azurewebsites.net/sp-dev-fx-webparts/samples/react-todo`
|
||||||
* Update the image `src` attribute according with the repository name and folder information.
|
* Update the image `src` attribute according with the repository name and folder information.
|
||||||
* If you find an existing sample which is similar to yours, please extend the existing one rather than submitting a new similar sample
|
* If you find an existing sample which is similar to yours, please extend the existing one rather than submitting a new similar sample
|
||||||
|
|
|
@ -1,8 +0,0 @@
|
||||||
{
|
|
||||||
"@microsoft/generator-sharepoint": {
|
|
||||||
"plusBeta": true,
|
|
||||||
"isCreatingSolution": true,
|
|
||||||
"environment": "spo",
|
|
||||||
"whichFolder": "subdir"
|
|
||||||
}
|
|
||||||
}
|
|
|
@ -24,7 +24,11 @@ If your web part uses a placeholder screen and requires the user to configure it
|
||||||
You can add as many screen shots as you'd like to help users understand your web part without having to download it and install it.
|
You can add as many screen shots as you'd like to help users understand your web part without having to download it and install it.
|
||||||
-->
|
-->
|
||||||
|
|
||||||
![picture of the web part in action](assets/preview.png)
|
![Example of a good preview](assets/goodpreview.png)
|
||||||
|
|
||||||
|
![Also a good preview](assets/alsogoodpreview.png)
|
||||||
|
|
||||||
|
![Not so good](assets/notsogood.gif)
|
||||||
|
|
||||||
## Compatibility
|
## Compatibility
|
||||||
|
|
Binary file not shown.
After Width: | Height: | Size: 77 KiB |
Binary file not shown.
After Width: | Height: | Size: 69 KiB |
Binary file not shown.
After Width: | Height: | Size: 1.4 MiB |
|
@ -0,0 +1,39 @@
|
||||||
|
// For more information on how to run this SPFx project in a VS Code Remote Container, please visit https://aka.ms/spfx-devcontainer
|
||||||
|
{
|
||||||
|
"name": "SPFx 1.13.1",
|
||||||
|
"image": "docker.io/m365pnp/spfx:1.13.1",
|
||||||
|
// Set *default* container specific settings.json values on container create.
|
||||||
|
"settings": {},
|
||||||
|
// Add the IDs of extensions you want installed when the container is created.
|
||||||
|
"extensions": [
|
||||||
|
"editorconfig.editorconfig",
|
||||||
|
"dbaeumer.vscode-eslint"
|
||||||
|
],
|
||||||
|
// Use 'forwardPorts' to make a list of ports inside the container available locally.
|
||||||
|
"forwardPorts": [
|
||||||
|
4321,
|
||||||
|
35729
|
||||||
|
],
|
||||||
|
"portsAttributes": {
|
||||||
|
"4321": {
|
||||||
|
"protocol": "https",
|
||||||
|
"label": "Manifest",
|
||||||
|
"onAutoForward": "silent",
|
||||||
|
"requireLocalPort": true
|
||||||
|
},
|
||||||
|
// Not needed for SPFx>= 1.12.1
|
||||||
|
// "5432": {
|
||||||
|
// "protocol": "https",
|
||||||
|
// "label": "Workbench",
|
||||||
|
// "onAutoForward": "silent"
|
||||||
|
// },
|
||||||
|
"35729": {
|
||||||
|
"protocol": "https",
|
||||||
|
"label": "LiveReload",
|
||||||
|
"onAutoForward": "silent",
|
||||||
|
"requireLocalPort": true
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"postCreateCommand": "bash .devcontainer/spfx-startup.sh",
|
||||||
|
"remoteUser": "node"
|
||||||
|
}
|
|
@ -0,0 +1,33 @@
|
||||||
|
echo
|
||||||
|
echo -e "\e[1;94mInstalling Node dependencies\e[0m"
|
||||||
|
npm install
|
||||||
|
|
||||||
|
## commands to create dev certificate and copy it to the root folder of the project
|
||||||
|
echo
|
||||||
|
echo -e "\e[1;94mGenerating dev certificate\e[0m"
|
||||||
|
gulp trust-dev-cert
|
||||||
|
|
||||||
|
# Convert the generated PEM certificate to a CER certificate
|
||||||
|
openssl x509 -inform PEM -in ~/.rushstack/rushstack-serve.pem -outform DER -out ./spfx-dev-cert.cer
|
||||||
|
|
||||||
|
# Copy the PEM ecrtificate for non-Windows hosts
|
||||||
|
cp ~/.rushstack/rushstack-serve.pem ./spfx-dev-cert.pem
|
||||||
|
|
||||||
|
## add *.cer to .gitignore to prevent certificates from being saved in repo
|
||||||
|
if ! grep -Fxq '*.cer' ./.gitignore
|
||||||
|
then
|
||||||
|
echo "# .CER Certificates" >> .gitignore
|
||||||
|
echo "*.cer" >> .gitignore
|
||||||
|
fi
|
||||||
|
|
||||||
|
## add *.pem to .gitignore to prevent certificates from being saved in repo
|
||||||
|
if ! grep -Fxq '*.pem' ./.gitignore
|
||||||
|
then
|
||||||
|
echo "# .PEM Certificates" >> .gitignore
|
||||||
|
echo "*.pem" >> .gitignore
|
||||||
|
fi
|
||||||
|
|
||||||
|
echo
|
||||||
|
echo -e "\e[1;92mReady!\e[0m"
|
||||||
|
|
||||||
|
echo -e "\n\e[1;94m**********\nOptional: if you plan on using gulp serve, don't forget to add the container certificate to your local machine. Please visit https://aka.ms/spfx-devcontainer for more information\n**********"
|
|
@ -0,0 +1,39 @@
|
||||||
|
// For more information on how to run this SPFx project in a VS Code Remote Container, please visit https://aka.ms/spfx-devcontainer
|
||||||
|
{
|
||||||
|
"name": "SPFx 1.11.0",
|
||||||
|
"image": "docker.io/m365pnp/spfx:1.11.0",
|
||||||
|
// Set *default* container specific settings.json values on container create.
|
||||||
|
"settings": {},
|
||||||
|
// Add the IDs of extensions you want installed when the container is created.
|
||||||
|
"extensions": [
|
||||||
|
"editorconfig.editorconfig",
|
||||||
|
"dbaeumer.vscode-eslint"
|
||||||
|
],
|
||||||
|
// Use 'forwardPorts' to make a list of ports inside the container available locally.
|
||||||
|
"forwardPorts": [
|
||||||
|
4321,
|
||||||
|
35729,
|
||||||
|
5432
|
||||||
|
],
|
||||||
|
"portsAttributes": {
|
||||||
|
"4321": {
|
||||||
|
"protocol": "https",
|
||||||
|
"label": "Manifest",
|
||||||
|
"onAutoForward": "silent",
|
||||||
|
"requireLocalPort": true
|
||||||
|
},
|
||||||
|
"5432": {
|
||||||
|
"protocol": "https",
|
||||||
|
"label": "Workbench",
|
||||||
|
"onAutoForward": "silent"
|
||||||
|
},
|
||||||
|
"35729": {
|
||||||
|
"protocol": "https",
|
||||||
|
"label": "LiveReload",
|
||||||
|
"onAutoForward": "silent",
|
||||||
|
"requireLocalPort": true
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"postCreateCommand": "bash .devcontainer/spfx-startup.sh",
|
||||||
|
"remoteUser": "node"
|
||||||
|
}
|
|
@ -0,0 +1,36 @@
|
||||||
|
## Optional switch to dev branch (if pushing to main/master is restricted)
|
||||||
|
# git checkout dev
|
||||||
|
|
||||||
|
## configure nvm, modejs, and fix project for spfx, if not handled by Dockerfile
|
||||||
|
#. ${NVM_DIR}/nvm.sh
|
||||||
|
#npm config delete prefix
|
||||||
|
#nvm install 10
|
||||||
|
#npm install -g gulp
|
||||||
|
|
||||||
|
npm install
|
||||||
|
|
||||||
|
## commands to create dev certificate and copy it to the root folder of the project
|
||||||
|
gulp trust-dev-cert
|
||||||
|
# Use following command for SPFx >= 1.12.1
|
||||||
|
cp ~/.rushstack/rushstack-serve.pem ./spfx-dev-cert.cer
|
||||||
|
# Use following command for SPFx < 1.12.1
|
||||||
|
# cp ~/.gcb-serve-data/gcb-serve.cer ./spfx-dev-cert.cer
|
||||||
|
|
||||||
|
## add *.cer to .gitignore to prevent certificates from being saved in repo
|
||||||
|
if ! grep -Fxq '*.cer' ./.gitignore
|
||||||
|
then
|
||||||
|
echo "# .CER Certificates" >> .gitignore
|
||||||
|
echo "*.cer" >> .gitignore
|
||||||
|
fi
|
||||||
|
|
||||||
|
## add *.pem to .gitignore to prevent certificates from being saved in repo
|
||||||
|
if ! grep -Fxq '*.pem' ./.gitignore
|
||||||
|
then
|
||||||
|
echo "# .PEM Certificates" >> .gitignore
|
||||||
|
echo "*.pem" >> .gitignore
|
||||||
|
fi
|
||||||
|
|
||||||
|
echo
|
||||||
|
echo -e "\e[1;92mReady!\e[0m"
|
||||||
|
|
||||||
|
echo -e "\n\e[1;94m**********\nOptional: if you plan on using gulp serve, don't forget to add the container certificate to your local machine. Please visit https://aka.ms/spfx-devcontainer for more information\n**********"
|
|
@ -1,210 +1,210 @@
|
||||||
{
|
{
|
||||||
"$id": "https://developer.microsoft.com/en-us/json-schemas/pnp/samples/v1.0/metadata-schema.json",
|
"$id": "https://developer.microsoft.com/en-us/json-schemas/pnp/samples/v1.0/metadata-schema.json",
|
||||||
"$schema": "http://json-schema.org/draft-07/schema#",
|
"$schema": "http://json-schema.org/draft-07/schema#",
|
||||||
"type": "array",
|
"type": "array",
|
||||||
"items": {
|
"items": {
|
||||||
"type": "object",
|
"type": "object",
|
||||||
"properties": {
|
"properties": {
|
||||||
"name": {
|
"name": {
|
||||||
"type": "string",
|
"type": "string",
|
||||||
"pattern": "pnp-sp-dev-spfx-web-parts-.*"
|
"pattern": "pnp-sp-dev-spfx-web-parts-.*"
|
||||||
},
|
},
|
||||||
"version": {
|
"version": {
|
||||||
"type": "string"
|
"type": "string"
|
||||||
},
|
},
|
||||||
"source": {
|
"source": {
|
||||||
"type": "string",
|
"type": "string",
|
||||||
"default": "pnp",
|
"default": "pnp",
|
||||||
"pattern": "pnp"
|
"pattern": "pnp"
|
||||||
},
|
},
|
||||||
"title": {
|
"title": {
|
||||||
"type": "string"
|
"type": "string"
|
||||||
},
|
},
|
||||||
"url": {
|
"url": {
|
||||||
"type": "string",
|
"type": "string",
|
||||||
"pattern": "https:\/\/github.com\/pnp\/sp-dev-fx-webparts\/tree\/main\/samples\/.*"
|
"pattern": "https:\/\/github.com\/pnp\/sp-dev-fx-webparts\/tree\/main\/samples\/.*"
|
||||||
},
|
},
|
||||||
"creationDateTime": {
|
"creationDateTime": {
|
||||||
"type": "string",
|
"type": "string",
|
||||||
"format": "date"
|
"format": "date"
|
||||||
},
|
},
|
||||||
"updateDateTime": {
|
"updateDateTime": {
|
||||||
"type": "string",
|
"type": "string",
|
||||||
"format": "date"
|
"format": "date"
|
||||||
},
|
},
|
||||||
"shortDescription": {
|
"shortDescription": {
|
||||||
"type": "string"
|
"type": "string"
|
||||||
},
|
},
|
||||||
"longDescription": {
|
"longDescription": {
|
||||||
"type": "array",
|
"type": "array",
|
||||||
"items": {
|
"items": {
|
||||||
"type": "string"
|
"type": "string"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"products": {
|
"products": {
|
||||||
"type": "array",
|
"type": "array",
|
||||||
"items": {
|
"items": {
|
||||||
"type": "string"
|
"type": "string"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"categories": {
|
"categories": {
|
||||||
"type": "array",
|
"type": "array",
|
||||||
"items": {
|
"items": {
|
||||||
"type": "string"
|
"type": "string"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"metadata": {
|
"metadata": {
|
||||||
"type": "array",
|
"type": "array",
|
||||||
"items": {
|
"items": {
|
||||||
"type": "object",
|
"type": "object",
|
||||||
"properties": {
|
"properties": {
|
||||||
"key": {
|
"key": {
|
||||||
"type": "string"
|
"type": "string"
|
||||||
},
|
},
|
||||||
"value": {
|
"value": {
|
||||||
"type": "string"
|
"type": "string"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"required": [
|
"required": [
|
||||||
"key",
|
"key",
|
||||||
"value"
|
"value"
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"thumbnails": {
|
"thumbnails": {
|
||||||
"type": "array",
|
"type": "array",
|
||||||
"items": [
|
"items": [
|
||||||
{
|
{
|
||||||
"type": "object",
|
"type": "object",
|
||||||
"properties": {
|
"properties": {
|
||||||
"type": {
|
"type": {
|
||||||
"type": "string",
|
"type": "string",
|
||||||
"enum": [
|
"enum": [
|
||||||
"image",
|
"image",
|
||||||
"video",
|
"video",
|
||||||
"slideshow"
|
"slideshow"
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
"order": {
|
"order": {
|
||||||
"type": "integer"
|
"type": "integer"
|
||||||
},
|
},
|
||||||
"alt": {
|
"alt": {
|
||||||
"type": "string"
|
"type": "string"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"if": {
|
"if": {
|
||||||
"properties": {
|
"properties": {
|
||||||
"type": {
|
"type": {
|
||||||
"const": "slideshow"
|
"const": "slideshow"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"then": {
|
"then": {
|
||||||
"properties": {
|
"properties": {
|
||||||
"slides": {
|
"slides": {
|
||||||
"type": "array",
|
"type": "array",
|
||||||
"items": {
|
"items": {
|
||||||
"type": "object",
|
"type": "object",
|
||||||
"properties": {
|
"properties": {
|
||||||
"url": {
|
"url": {
|
||||||
"type": "string"
|
"type": "string"
|
||||||
},
|
},
|
||||||
"order": {
|
"order": {
|
||||||
"type": "integer"
|
"type": "integer"
|
||||||
},
|
},
|
||||||
"alt": {
|
"alt": {
|
||||||
"type": "string"
|
"type": "string"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"required": [
|
"required": [
|
||||||
"url",
|
"url",
|
||||||
"order",
|
"order",
|
||||||
"alt"
|
"alt"
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"required": [
|
"required": [
|
||||||
"slides"
|
"slides"
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
"else": {
|
"else": {
|
||||||
"properties": {
|
"properties": {
|
||||||
"url": {
|
"url": {
|
||||||
"type": "string"
|
"type": "string"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"required": [
|
"required": [
|
||||||
"url"
|
"url"
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
"required": [
|
"required": [
|
||||||
"type",
|
"type",
|
||||||
"order",
|
"order",
|
||||||
"alt"
|
"alt"
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
"authors": {
|
"authors": {
|
||||||
"type": "array",
|
"type": "array",
|
||||||
"items": [
|
"items": [
|
||||||
{
|
{
|
||||||
"type": "object",
|
"type": "object",
|
||||||
"properties": {
|
"properties": {
|
||||||
"gitHubAccount": {
|
"gitHubAccount": {
|
||||||
"type": "string",
|
"type": "string",
|
||||||
"pattern": "^[a-zA-Z0-9]+(?:-[a-zA-Z0-9]+)*$"
|
"pattern": "^[a-zA-Z0-9]+(?:-[a-zA-Z0-9]+)*$"
|
||||||
},
|
},
|
||||||
"company": {
|
"company": {
|
||||||
"type": "string"
|
"type": "string"
|
||||||
},
|
},
|
||||||
"pictureUrl": {
|
"pictureUrl": {
|
||||||
"type": "string"
|
"type": "string"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"required": [
|
"required": [
|
||||||
"gitHubAccount"
|
"gitHubAccount"
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
"references": {
|
"references": {
|
||||||
"type": "array",
|
"type": "array",
|
||||||
"items": [
|
"items": [
|
||||||
{
|
{
|
||||||
"type": "object",
|
"type": "object",
|
||||||
"properties": {
|
"properties": {
|
||||||
"name": {
|
"name": {
|
||||||
"type": "string"
|
"type": "string"
|
||||||
},
|
},
|
||||||
"description": {
|
"description": {
|
||||||
"type": "string"
|
"type": "string"
|
||||||
},
|
},
|
||||||
"url": {
|
"url": {
|
||||||
"type": "string"
|
"type": "string"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"required": [
|
"required": [
|
||||||
"name",
|
"name",
|
||||||
"url"
|
"url"
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"required": [
|
"required": [
|
||||||
"name",
|
"name",
|
||||||
"source",
|
"source",
|
||||||
"title",
|
"title",
|
||||||
"url",
|
"url",
|
||||||
"shortDescription",
|
"shortDescription",
|
||||||
"products",
|
"products",
|
||||||
"metadata",
|
"metadata",
|
||||||
"thumbnails",
|
"thumbnails",
|
||||||
"authors",
|
"authors",
|
||||||
"creationDateTime",
|
"creationDateTime",
|
||||||
"updateDateTime"
|
"updateDateTime"
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
}
|
}
|
Loading…
Reference in New Issue