Skip to content

Commit a1a749a

Browse files
committedMar 20, 2025·
Updated readme, sample manifest, added dev container
1 parent 6314c12 commit a1a749a

File tree

4 files changed

+179
-12
lines changed

4 files changed

+179
-12
lines changed
 
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
{
2+
"name": "SPFx 1.20.0",
3+
"image": "docker.io/m365pnp/spfx:1.20.0",
4+
"customizations": {
5+
"vscode": {
6+
"extensions": [
7+
"editorconfig.editorconfig",
8+
"dbaeumer.vscode-eslint"
9+
]
10+
}
11+
},
12+
"forwardPorts": [
13+
4321,
14+
35729,
15+
5432
16+
],
17+
"portsAttributes": {
18+
"4321": {
19+
"protocol": "https",
20+
"label": "Manifest",
21+
"onAutoForward": "silent",
22+
"requireLocalPort": true
23+
},
24+
"5432": {
25+
"protocol": "https",
26+
"label": "Workbench",
27+
"onAutoForward": "silent"
28+
},
29+
"35729": {
30+
"protocol": "https",
31+
"label": "LiveReload",
32+
"onAutoForward": "silent",
33+
"requireLocalPort": true
34+
}
35+
},
36+
"postCreateCommand": "bash .devcontainer/spfx-startup.sh",
37+
"remoteUser": "node"
38+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
echo
2+
echo -e "\e[1;94mInstalling Node dependencies\e[0m"
3+
npm install
4+
5+
## commands to create dev certificate and copy it to the root folder of the project
6+
echo
7+
echo -e "\e[1;94mGenerating dev certificate\e[0m"
8+
gulp trust-dev-cert
9+
10+
# Convert the generated PEM certificate to a CER certificate
11+
openssl x509 -inform PEM -in ~/.rushstack/rushstack-serve.pem -outform DER -out ./spfx-dev-cert.cer
12+
13+
# Copy the PEM ecrtificate for non-Windows hosts
14+
cp ~/.rushstack/rushstack-serve.pem ./spfx-dev-cert.pem
15+
16+
## add *.cer to .gitignore to prevent certificates from being saved in repo
17+
if ! grep -Fxq '*.cer' ./.gitignore
18+
then
19+
echo "# .CER Certificates" >> .gitignore
20+
echo "*.cer" >> .gitignore
21+
fi
22+
23+
## add *.pem to .gitignore to prevent certificates from being saved in repo
24+
if ! grep -Fxq '*.pem' ./.gitignore
25+
then
26+
echo "# .PEM Certificates" >> .gitignore
27+
echo "*.pem" >> .gitignore
28+
fi
29+
30+
echo
31+
echo -e "\e[1;92mReady!\e[0m"
32+
33+
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**********"

‎samples/js-mermaid-diagram/README.md

+50-12
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,23 @@ Since the native **Markdown web part in SharePoint Online does not support Merma
88

99
![Mermaid](https://github.com/cfernandes-muhimbi/sp-dev-fx-webparts/blob/cfernandes-spfx-branch/samples/js-mermaid-diagram/assets/Mermaid.gif)
1010

11+
## Compatibility
1112

12-
## Used SharePoint Framework Version
13+
| :warning: Important |
14+
|:---------------------------|
15+
| Every SPFx version is optimally compatible with specific versions of Node.js. In order to be able to build this sample, you need to ensure that the version of Node on your workstation matches one of the versions listed in this section. This sample will not work on a different version of Node.|
16+
|Refer to <https://aka.ms/spfx-matrix> for more information on SPFx compatibility. |
1317

14-
![version](https://img.shields.io/badge/version-1.20.0-green.svg)
18+
This sample is optimally compatible with the following environment configuration:
19+
20+
![SPFx 1.20.2](https://img.shields.io/badge/SPFx-1.20.2-green.svg)
21+
![Node.js v18](https://img.shields.io/badge/Node.js-v18-green.svg)
22+
![Compatible with SharePoint Online](https://img.shields.io/badge/SharePoint%20Online-Compatible-green.svg)
23+
![Does not work with SharePoint 2019](https://img.shields.io/badge/SharePoint%20Server%202019-Incompatible-red.svg "SharePoint Server 2019 requires SPFx 1.4.1 or lower")
24+
![Does not work with SharePoint 2016 (Feature Pack 2)](https://img.shields.io/badge/SharePoint%20Server%202016%20(Feature%20Pack%202)-Incompatible-red.svg "SharePoint Server 2016 Feature Pack 2 requires SPFx 1.1")
25+
![Local Workbench Unsupported](https://img.shields.io/badge/Local%20Workbench-Unsupported-red.svg "Local workbench is no longer available as of SPFx 1.13 and above")
26+
![Hosted Workbench Compatible](https://img.shields.io/badge/Hosted%20Workbench-Compatible-green.svg)
27+
![Compatible with Remote Containers](https://img.shields.io/badge/Remote%20Containers-Compatible-green.svg)
1528

1629
## Applies to
1730

@@ -27,24 +40,26 @@ Since the native **Markdown web part in SharePoint Online does not support Merma
2740
| ------- | ---------------- | --------------- |
2841
| 1.0 | March 16, 2025 | Initial release |
2942

30-
## Disclaimer
3143

32-
**THIS CODE IS PROVIDED _AS IS_ WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.**
44+
## Contributors
3345

34-
---
35-
## Contributor
3646
- [Clavin Fernandes](https://github.com/cfernandes-muhimbi)
3747

3848

39-
## Minimal Path to Awesome
49+
## Minimal path to awesome
50+
51+
52+
- Clone this repository (or [download this solution as a .ZIP file](https://pnp.github.io/download-partial/?url=https://github.com/pnp/sp-dev-fx-webparts/tree/main/samples/js-mermaid-diagram) then unzip it)
53+
- From your command line, change your current directory to the directory containing this sample (`js-mermaid-diagram`, located under `samples`)
54+
- in the command line run:
55+
- `npm install`
56+
- `gulp serve`
57+
58+
> This sample can also be opened with [VS Code Remote Development](https://code.visualstudio.com/docs/remote/remote-overview). Visit <https://aka.ms/spfx-devcontainer> for further instructions.
4059
41-
- Clone this repository
42-
- Ensure that you are at the solution folder
43-
- in the command-line run:
44-
- **npm install**
45-
- **gulp serve**
4660

4761
## Features
62+
4863
- Render **Mermaid.js** diagrams in SharePoint Online
4964
- Supports flowcharts, sequence diagrams, Gantt charts, and more
5065
- Easy integration with existing SharePoint pagesShare your web part with others through Microsoft 365 Patterns and Practices program to get visibility and exposure. More details on the community, open-source projects and other activities from http://aka.ms/m365pnp.
@@ -58,3 +73,26 @@ Happy diagramming!
5873
- [Use Microsoft Graph in your solution](https://docs.microsoft.com/en-us/sharepoint/dev/spfx/web-parts/get-started/using-microsoft-graph-apis)
5974
- [Publish SharePoint Framework applications to the Marketplace](https://docs.microsoft.com/en-us/sharepoint/dev/spfx/publish-to-marketplace-overview)
6075
- [Microsoft 365 Patterns and Practices](https://aka.ms/m365pnp) - Guidance, tooling, samples and open-source controls for your Microsoft 365 development
76+
77+
## Help
78+
79+
We do not support samples, but this community is always willing to help, and we want to improve these samples. We use GitHub to track issues, which makes it easy for community members to volunteer their time and help resolve issues.
80+
81+
If you're having issues building the solution, please run [spfx doctor](https://pnp.github.io/cli-microsoft365/cmd/spfx/spfx-doctor/) from within the solution folder to diagnose incompatibility issues with your environment.
82+
83+
You can try looking at [issues related to this sample](https://github.com/pnp/sp-dev-fx-webparts/issues?q=label%3A%22sample%3A%20js-mermaid-diagram%22) to see if anybody else is having the same issues.
84+
85+
You can also try looking at [discussions related to this sample](https://github.com/pnp/sp-dev-fx-webparts/discussions?discussions_q=js-mermaid-diagram) and see what the community is saying.
86+
87+
If you encounter any issues using this sample, [create a new issue](https://github.com/pnp/sp-dev-fx-webparts/issues/new?assignees=&labels=Needs%3A+Triage+%3Amag%3A%2Ctype%3Abug-suspected%2Csample%3A%20js-mermaid-diagram&template=bug-report.yml&sample=js-mermaid-diagram&authors=@cfernandes-muhimbi&title=js-mermaid-diagram%20-%20).
88+
89+
For questions regarding this sample, [create a new question](https://github.com/pnp/sp-dev-fx-webparts/issues/new?assignees=&labels=Needs%3A+Triage+%3Amag%3A%2Ctype%3Aquestion%2Csample%3A%20js-mermaid-diagram&template=question.yml&sample=js-mermaid-diagram&authors=@cfernandes-muhimbi&title=js-mermaid-diagram%20-%20).
90+
91+
Finally, if you have an idea for improvement, [make a suggestion](https://github.com/pnp/sp-dev-fx-webparts/issues/new?assignees=&labels=Needs%3A+Triage+%3Amag%3A%2Ctype%3Aenhancement%2Csample%3A%20js-mermaid-diagram&template=suggestion.yml&sample=js-mermaid-diagram&authors=@cfernandes-muhimbi&title=js-mermaid-diagram%20-%20).
92+
93+
## Disclaimer
94+
95+
**THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.**
96+
97+
<img src="https://m365-visitor-stats.azurewebsites.net/sp-dev-fx-webparts/samples/js-mermaid-diagram" />
98+
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
1+
[
2+
{
3+
"name": "pnp-sp-dev-spfx-web-parts-js-mermaid-diagram",
4+
"source": "pnp",
5+
"title": "Mermaid Diagram Web Part for SharePoint Online",
6+
"shortDescription": "I created this web part to add Mermaid diagram support in SharePoint Online as part of my tutorial series. While working on it, I found this discussion thread: Displaying Mermaid Diagrams in SharePoint Online Markdown Web Parts, which highlights the need for a proper solution.",
7+
"url": "https://github.com/pnp/sp-dev-fx-webparts/tree/main/samples/js-mermaid-diagram",
8+
"downloadUrl": "https://pnp.github.io/download-partial/?url=https://github.com/pnp/sp-dev-fx-webparts/tree/main/samples/js-mermaid-diagram",
9+
"longDescription": [
10+
"I created this web part to add Mermaid diagram support in SharePoint Online as part of my tutorial series. While working on it, I found this discussion thread: Displaying Mermaid Diagrams in SharePoint Online Markdown Web Parts, which highlights the need for a proper solution."
11+
],
12+
"creationDateTime": "2025-03-16",
13+
"updateDateTime": "2025-03-16",
14+
"products": [
15+
"SharePoint"
16+
],
17+
"metadata": [
18+
{
19+
"key": "CLIENT-SIDE-DEV",
20+
"value": "React"
21+
},
22+
{
23+
"key": "SPFX-VERSION",
24+
"value": "1.20.0"
25+
}
26+
],
27+
"thumbnails": [
28+
{
29+
"name": "js-mermaid.png",
30+
"type": "image",
31+
"order": 100,
32+
"url": "https://github.com/pnp/sp-dev-fx-webparts/raw/main/samples/js-mermaid-diagram/assets/js-mermaid.png",
33+
"alt": "Web Part Preview"
34+
},
35+
{
36+
"name": "Mermaid.gif",
37+
"type": "image",
38+
"order": 101,
39+
"url": "https://github.com/pnp/sp-dev-fx-webparts/raw/main/samples/js-mermaid-diagram/assets/Mermaid.gif",
40+
"alt": "Web Part Preview"
41+
}
42+
],
43+
"authors": [
44+
{
45+
"gitHubAccount": "https://github.com/cfernandes-muhimbi",
46+
"pictureUrl": "https://github.com/cfernandes-muhimbi.png",
47+
"name": "Clavin Fernandes"
48+
}
49+
],
50+
"references": [
51+
{
52+
"name": "Build your first SharePoint client-side web part",
53+
"description": "Client-side web parts are client-side components that run in the context of a SharePoint page. Client-side web parts can be deployed to SharePoint environments that support the SharePoint Framework. You can also use modern JavaScript web frameworks, tools, and libraries to build them.",
54+
"url": "https://learn.microsoft.com/sharepoint/dev/spfx/web-parts/get-started/build-a-hello-world-web-part"
55+
}
56+
]
57+
}
58+
]

0 commit comments

Comments
 (0)
Please sign in to comment.