From 54b06c9b872e41f43388a9eaabd7234ea49c5c4b Mon Sep 17 00:00:00 2001 From: Hugo Bernier Date: Sun, 12 Mar 2023 14:44:48 -0400 Subject: [PATCH] Updated sample.json, readme, and container --- .../.devcontainer/devcontainer.json | 18 ++++++------- .../.devcontainer/spfx-startup.sh | 6 +++-- samples/react-script-editor/README.md | 27 ++++++------------- .../react-script-editor/assets/sample.json | 4 +-- 4 files changed, 23 insertions(+), 32 deletions(-) diff --git a/samples/react-script-editor/.devcontainer/devcontainer.json b/samples/react-script-editor/.devcontainer/devcontainer.json index edbc0aded..d0df53099 100644 --- a/samples/react-script-editor/.devcontainer/devcontainer.json +++ b/samples/react-script-editor/.devcontainer/devcontainer.json @@ -1,7 +1,7 @@ // 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.10.0", - "image": "docker.io/m365pnp/spfx:1.10.0", + "name": "SPFx 1.16.1", + "image": "docker.io/m365pnp/spfx:1.16.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. @@ -12,8 +12,7 @@ // Use 'forwardPorts' to make a list of ports inside the container available locally. "forwardPorts": [ 4321, - 35729, - 5432 + 35729 ], "portsAttributes": { "4321": { @@ -22,11 +21,12 @@ "onAutoForward": "silent", "requireLocalPort": true }, - "5432": { - "protocol": "https", - "label": "Workbench", - "onAutoForward": "silent" - }, + // Not needed for SPFx>= 1.12.1 + // "5432": { + // "protocol": "https", + // "label": "Workbench", + // "onAutoForward": "silent" + // }, "35729": { "protocol": "https", "label": "LiveReload", diff --git a/samples/react-script-editor/.devcontainer/spfx-startup.sh b/samples/react-script-editor/.devcontainer/spfx-startup.sh index ca531bdf2..456d6aea8 100644 --- a/samples/react-script-editor/.devcontainer/spfx-startup.sh +++ b/samples/react-script-editor/.devcontainer/spfx-startup.sh @@ -7,9 +7,11 @@ 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 -cp ~/.gcb-serve-data/gcb-serve.cer ./spfx-dev-cert.cer -cp ~/.gcb-serve-data/gcb-serve.cer ./spfx-dev-cert.pem +# 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 diff --git a/samples/react-script-editor/README.md b/samples/react-script-editor/README.md index b0540c07e..77c32b329 100644 --- a/samples/react-script-editor/README.md +++ b/samples/react-script-editor/README.md @@ -1,18 +1,4 @@ ---- -page_type: sample -products: -- office-sp -languages: -- javascript -- typescript -extensions: - contentType: samples - technologies: - - SharePoint Framework - platforms: - - react - createdDate: 3/1/2017 12:00:00 AM ---- + # Script editor web part for modern pages built in React This version works only for SharePoint Online. If you want a version for Sharepoint on-premises go to [react-script-editor-onprem](../react-script-editor-onprem). @@ -162,11 +148,13 @@ In order to make it available to absolutely all sites you need apply the *Deploy | :warning: Important | |:---------------------------| -| Every SPFx version is only compatible with specific version(s) of Node.js. In order to be able to build this sample, please 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.| +| 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.| |Refer to for more information on SPFx compatibility. | -![SPFx 1.13.1](https://img.shields.io/badge/SPFx-1.13.1-green.svg) -![Node.js v14 | v12](https://img.shields.io/badge/Node.js-v14%20%7C%20v12-green.svg) +This sample is optimally compatible with the following environment configuration: + +![SPFx 1.16.1](https://img.shields.io/badge/SPFx-1.16.1-green.svg) +![Node.js v16 | v14 | v12](https://img.shields.io/badge/Node.js-v16%20%7C%20v14%20%7C%20v12-green.svg) ![Compatible with SharePoint Online](https://img.shields.io/badge/SharePoint%20Online-Compatible-green.svg) ![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") ![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") @@ -184,7 +172,6 @@ In order to make it available to absolutely all sites you need apply the *Deploy * [Mikael Svenson](https://github.com/wobba) ([@mikaelsvenson](http://www.twitter.com/mikaelsvenson), [techmikael.com](techmikael.com)) * [Felix Bohnacker](https://github.com/felixbohnackerfelixbohnacker) - ## Version history Version|Date|Comments @@ -210,6 +197,8 @@ Version|Date|Comments 1.0.18.0|June 14, 2022|Upgrade to SPFx v1.13.1 1.0.19.0|August 31, 2022|Added support for section background color 1.0.20.0|October 10, 2022|Added sample html/script with self-executing function +1.0.21.0|March 11, 2023|Bump dependencies to allow react-script-editor to build under SPFx 1.16.1 + ## Minimal Path to Awesome diff --git a/samples/react-script-editor/assets/sample.json b/samples/react-script-editor/assets/sample.json index 7e4810b17..3f0ff81ce 100644 --- a/samples/react-script-editor/assets/sample.json +++ b/samples/react-script-editor/assets/sample.json @@ -9,7 +9,7 @@ "Coming from old classic SharePoint pages you might have existing script solutions you want to re-use on a modern page without having to repackage it as a new SharePoint Framework web part." ], "creationDateTime": "2019-10-13", - "updateDateTime": "2022-08-31", + "updateDateTime": "2023-03-11", "products": [ "SharePoint" ], @@ -20,7 +20,7 @@ }, { "key": "SPFX-VERSION", - "value": "1.13.1" + "value": "1.16.1" }, { "key": "SPFX-FULLPAGEAPP",