From 7dde000334fe112ca2ba0ee367d0f67b0d98712c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Adam=20W=C3=B3jcik?= Date: Fri, 25 Oct 2024 01:13:12 +0200 Subject: [PATCH] fixup --- .../.devcontainer/devcontainer.json | 4 +- samples/react-pnp-js-sample/.yo-rc.json | 9 +- samples/react-pnp-js-sample/config/sass.json | 3 + samples/react-pnp-js-sample/config/serve.json | 2 +- samples/react-pnp-js-sample/package.json | 26 +- samples/react-pnp-js-sample/spfx.upgrade.md | 374 ++++++++++++++++++ samples/react-pnp-js-sample/spfx.validate.md | 40 ++ 7 files changed, 440 insertions(+), 18 deletions(-) create mode 100644 samples/react-pnp-js-sample/config/sass.json create mode 100644 samples/react-pnp-js-sample/spfx.upgrade.md create mode 100644 samples/react-pnp-js-sample/spfx.validate.md diff --git a/samples/react-pnp-js-sample/.devcontainer/devcontainer.json b/samples/react-pnp-js-sample/.devcontainer/devcontainer.json index 5c924ea0b6..5c898146d3 100644 --- a/samples/react-pnp-js-sample/.devcontainer/devcontainer.json +++ b/samples/react-pnp-js-sample/.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.15.2", - "image": "docker.io/m365pnp/spfx:1.15.2", + "name": "SPFx 1.20.0", + "image": "docker.io/m365pnp/spfx:1.20.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. diff --git a/samples/react-pnp-js-sample/.yo-rc.json b/samples/react-pnp-js-sample/.yo-rc.json index d66ce0fbf8..33afc58b8e 100644 --- a/samples/react-pnp-js-sample/.yo-rc.json +++ b/samples/react-pnp-js-sample/.yo-rc.json @@ -3,12 +3,17 @@ "plusBeta": true, "isCreatingSolution": true, "environment": "spo", - "version": "1.15.2", + "version": "1.20.0", + "nodeVersion": "18.20.3", "libraryName": "spfx-pnp-js-example", "libraryId": "d20ceaf6-094b-4086-b7a0-85761bc8be23", "packageManager": "npm", "solutionShortDescription": "spfx-pnp-js-example description", "isDomainIsolated": false, - "componentType": "webpart" + "componentType": "webpart", + "sdkVersions": { + "@microsoft/teams-js": "2.24.0", + "@microsoft/microsoft-graph-client": "3.0.2" + } } } \ No newline at end of file diff --git a/samples/react-pnp-js-sample/config/sass.json b/samples/react-pnp-js-sample/config/sass.json new file mode 100644 index 0000000000..cb41e61fb2 --- /dev/null +++ b/samples/react-pnp-js-sample/config/sass.json @@ -0,0 +1,3 @@ +{ + "$schema": "https://developer.microsoft.com/json-schemas/core-build/sass.schema.json" +} \ No newline at end of file diff --git a/samples/react-pnp-js-sample/config/serve.json b/samples/react-pnp-js-sample/config/serve.json index 5958674e1d..d5353a363a 100644 --- a/samples/react-pnp-js-sample/config/serve.json +++ b/samples/react-pnp-js-sample/config/serve.json @@ -2,5 +2,5 @@ "$schema": "https://developer.microsoft.com/json-schemas/core-build/serve.schema.json", "port": 4321, "https": true, - "initialPage": "https://enter-your-SharePoint-site/_layouts/workbench.aspx" + "initialPage": "https://{tenantDomain}/_layouts/workbench.aspx" } diff --git a/samples/react-pnp-js-sample/package.json b/samples/react-pnp-js-sample/package.json index cdb706f499..37f633d4af 100644 --- a/samples/react-pnp-js-sample/package.json +++ b/samples/react-pnp-js-sample/package.json @@ -14,12 +14,12 @@ "dependencies": { "@fluentui/react": "8.106.4", "@microsoft/generator-sharepoint": "1.20.0", - "@microsoft/sp-adaptive-card-extension-base": "^1.20.0", - "@microsoft/sp-core-library": "^1.20.0", - "@microsoft/sp-lodash-subset": "^1.20.0", - "@microsoft/sp-office-ui-fabric-core": "^1.20.0", - "@microsoft/sp-property-pane": "^1.20.0", - "@microsoft/sp-webpart-base": "^1.20.0", + "@microsoft/sp-adaptive-card-extension-base": "1.20.0", + "@microsoft/sp-core-library": "1.20.0", + "@microsoft/sp-lodash-subset": "1.20.0", + "@microsoft/sp-office-ui-fabric-core": "1.20.0", + "@microsoft/sp-property-pane": "1.20.0", + "@microsoft/sp-webpart-base": "1.20.0", "@pnp/graph": "^4.0.1", "@pnp/logging": "^4.0.1", "@pnp/sp": "^4.0.1", @@ -28,17 +28,17 @@ "tslib": "2.3.1" }, "devDependencies": { - "@microsoft/eslint-config-spfx": "1.20.1", - "@microsoft/eslint-plugin-spfx": "1.20.1", - "@microsoft/rush-stack-compiler-4.7": "^0.1.0", - "@microsoft/sp-build-web": "1.20.1", - "@microsoft/sp-module-interfaces": "1.20.1", - "@rushstack/eslint-config": "2.5.1", + "@microsoft/eslint-config-spfx": "1.20.2", + "@microsoft/eslint-plugin-spfx": "1.20.2", + "@microsoft/rush-stack-compiler-4.7": "0.1.0", + "@microsoft/sp-build-web": "1.20.2", + "@microsoft/sp-module-interfaces": "1.20.2", + "@rushstack/eslint-config": "4.0.1", "@types/react": "17.0.45", "@types/react-dom": "17.0.17", "@types/webpack-env": "1.18.2", "ajv": "6.12.5", - "eslint": "8.7.0", + "eslint": "8.57.0", "eslint-plugin-react-hooks": "4.3.0", "gulp": "~4.0.2", "typescript": "4.7.4" diff --git a/samples/react-pnp-js-sample/spfx.upgrade.md b/samples/react-pnp-js-sample/spfx.upgrade.md new file mode 100644 index 0000000000..c5677de313 --- /dev/null +++ b/samples/react-pnp-js-sample/spfx.upgrade.md @@ -0,0 +1,374 @@ +# Upgrade project spfx-pnp-js-example-client-side-solution to v1.20.0 + +Date: 10/25/2024 + +## Findings + +Following is the list of steps required to upgrade your project to SharePoint Framework version 1.20.0. [Summary](#Summary) of the modifications is included at the end of the report. + +### FN001001 @microsoft/sp-core-library | Required + +Upgrade SharePoint Framework dependency package @microsoft/sp-core-library + +Execute the following command: + +```sh +npm i -SE @microsoft/sp-core-library@1.20.0 +``` + +File: [./package.json:18:9](./package.json) + +### FN001002 @microsoft/sp-lodash-subset | Required + +Upgrade SharePoint Framework dependency package @microsoft/sp-lodash-subset + +Execute the following command: + +```sh +npm i -SE @microsoft/sp-lodash-subset@1.20.0 +``` + +File: [./package.json:19:9](./package.json) + +### FN001003 @microsoft/sp-office-ui-fabric-core | Required + +Upgrade SharePoint Framework dependency package @microsoft/sp-office-ui-fabric-core + +Execute the following command: + +```sh +npm i -SE @microsoft/sp-office-ui-fabric-core@1.20.0 +``` + +File: [./package.json:20:9](./package.json) + +### FN001004 @microsoft/sp-webpart-base | Required + +Upgrade SharePoint Framework dependency package @microsoft/sp-webpart-base + +Execute the following command: + +```sh +npm i -SE @microsoft/sp-webpart-base@1.20.0 +``` + +File: [./package.json:22:9](./package.json) + +### FN001021 @microsoft/sp-property-pane | Required + +Upgrade SharePoint Framework dependency package @microsoft/sp-property-pane + +Execute the following command: + +```sh +npm i -SE @microsoft/sp-property-pane@1.20.0 +``` + +File: [./package.json:21:9](./package.json) + +### FN001034 @microsoft/sp-adaptive-card-extension-base | Optional + +Upgrade SharePoint Framework dependency package @microsoft/sp-adaptive-card-extension-base + +Execute the following command: + +```sh +npm i -SE @microsoft/sp-adaptive-card-extension-base@1.20.0 +``` + +File: [./package.json:17:9](./package.json) + +### FN002001 @microsoft/sp-build-web | Required + +Upgrade SharePoint Framework dev dependency package @microsoft/sp-build-web + +Execute the following command: + +```sh +npm i -DE @microsoft/sp-build-web@1.20.2 +``` + +File: [./package.json:34:9](./package.json) + +### FN002002 @microsoft/sp-module-interfaces | Required + +Upgrade SharePoint Framework dev dependency package @microsoft/sp-module-interfaces + +Execute the following command: + +```sh +npm i -DE @microsoft/sp-module-interfaces@1.20.2 +``` + +File: [./package.json:35:9](./package.json) + +### FN002021 @rushstack/eslint-config | Required + +Upgrade SharePoint Framework dev dependency package @rushstack/eslint-config + +Execute the following command: + +```sh +npm i -DE @rushstack/eslint-config@4.0.1 +``` + +File: [./package.json:36:9](./package.json) + +### FN002024 eslint | Required + +Upgrade SharePoint Framework dev dependency package eslint + +Execute the following command: + +```sh +npm i -DE eslint@8.57.0 +``` + +File: [./package.json:41:9](./package.json) + +### FN002022 @microsoft/eslint-plugin-spfx | Required + +Upgrade SharePoint Framework dev dependency package @microsoft/eslint-plugin-spfx + +Execute the following command: + +```sh +npm i -DE @microsoft/eslint-plugin-spfx@1.20.2 +``` + +File: [./package.json:32:9](./package.json) + +### FN002023 @microsoft/eslint-config-spfx | Required + +Upgrade SharePoint Framework dev dependency package @microsoft/eslint-config-spfx + +Execute the following command: + +```sh +npm i -DE @microsoft/eslint-config-spfx@1.20.2 +``` + +File: [./package.json:31:9](./package.json) + +### FN010001 .yo-rc.json version | Recommended + +Update version in .yo-rc.json + +```json +{ + "@microsoft/generator-sharepoint": { + "version": "1.20.0" + } +} +``` + +File: [./.yo-rc.json:6:5](./.yo-rc.json) + +### FN010010 .yo-rc.json @microsoft/teams-js SDK version | Recommended + +Update @microsoft/teams-js SDK version in .yo-rc.json + +```json +{ + "@microsoft/generator-sharepoint": { + "sdkVersions": { + "@microsoft/teams-js": "2.24.0" + } + } +} +``` + +File: [./.yo-rc.json:2:3](./.yo-rc.json) + +### FN002028 @microsoft/rush-stack-compiler-4.7 | Required + +Upgrade SharePoint Framework dev dependency package @microsoft/rush-stack-compiler-4.7 + +Execute the following command: + +```sh +npm i -DE @microsoft/rush-stack-compiler-4.7@0.1.0 +``` + +File: [./package.json:30:24](./package.json) + +### FN007002 serve.json initialPage | Required + +Update serve.json initialPage URL + +```json +{ + "initialPage": "https://{tenantDomain}/_layouts/workbench.aspx" +} +``` + +File: [./config/serve.json:5:3](./config/serve.json) + +### FN015009 config\sass.json | Required + +Add file config\sass.json + +Execute the following command: + +```sh +cat > "config\sass.json" << EOF +{ + "$schema": "https://developer.microsoft.com/json-schemas/core-build/sass.schema.json" +} +EOF +``` + +File: [config\sass.json](config\sass.json) + +### FN001022 office-ui-fabric-react | Required + +Install SharePoint Framework dependency package office-ui-fabric-react + +Execute the following command: + +```sh +npm i -SE office-ui-fabric-react@7.199.1 +``` + +File: [./package.json:14:5](./package.json) + +### FN010008 .yo-rc.json nodeVersion | Recommended + +Update nodeVersion in .yo-rc.json + +```json +{ + "@microsoft/generator-sharepoint": { + "nodeVersion": "20.16.0" + } +} +``` + +File: [./.yo-rc.json:2:38](./.yo-rc.json) + +### FN010009 .yo-rc.json @microsoft/microsoft-graph-client SDK version | Recommended + +Update @microsoft/microsoft-graph-client SDK version in .yo-rc.json + +```json +{ + "@microsoft/generator-sharepoint": { + "sdkVersions": { + "@microsoft/microsoft-graph-client": "3.0.2" + } + } +} +``` + +File: [./.yo-rc.json:2:3](./.yo-rc.json) + +### FN021003 package.json engines.node | Required + +Update package.json engines.node property + +```json +{ + "engines": { + "node": ">=16.13.0 <17.0.0" + } +} +``` + +File: [./package.json:7:9](./package.json) + +### FN017001 Run npm dedupe | Optional + +If, after upgrading npm packages, when building the project you have errors similar to: "error TS2345: Argument of type 'SPHttpClientConfiguration' is not assignable to parameter of type 'SPHttpClientConfiguration'", try running 'npm dedupe' to cleanup npm packages. + +Execute the following command: + +```sh +npm dedupe +``` + +File: [./package.json](./package.json) + +## Summary + +### Execute script + +```sh +npm i -SE @microsoft/sp-core-library@1.20.0 @microsoft/sp-lodash-subset@1.20.0 @microsoft/sp-office-ui-fabric-core@1.20.0 @microsoft/sp-webpart-base@1.20.0 @microsoft/sp-property-pane@1.20.0 @microsoft/sp-adaptive-card-extension-base@1.20.0 office-ui-fabric-react@7.199.1 +npm i -DE @microsoft/sp-build-web@1.20.2 @microsoft/sp-module-interfaces@1.20.2 @rushstack/eslint-config@4.0.1 eslint@8.57.0 @microsoft/eslint-plugin-spfx@1.20.2 @microsoft/eslint-config-spfx@1.20.2 @microsoft/rush-stack-compiler-4.7@0.1.0 +npm dedupe +cat > "config\sass.json" << EOF +{ + "$schema": "https://developer.microsoft.com/json-schemas/core-build/sass.schema.json" +} +EOF +``` + +### Modify files + +#### [./.yo-rc.json](./.yo-rc.json) + +Update version in .yo-rc.json: + +```json +{ + "@microsoft/generator-sharepoint": { + "version": "1.20.0" + } +} +``` + +Update @microsoft/teams-js SDK version in .yo-rc.json: + +```json +{ + "@microsoft/generator-sharepoint": { + "sdkVersions": { + "@microsoft/teams-js": "2.24.0" + } + } +} +``` + +Update nodeVersion in .yo-rc.json: + +```json +{ + "@microsoft/generator-sharepoint": { + "nodeVersion": "20.16.0" + } +} +``` + +Update @microsoft/microsoft-graph-client SDK version in .yo-rc.json: + +```json +{ + "@microsoft/generator-sharepoint": { + "sdkVersions": { + "@microsoft/microsoft-graph-client": "3.0.2" + } + } +} +``` + +#### [./config/serve.json](./config/serve.json) + +Update serve.json initialPage URL: + +```json +{ + "initialPage": "https://{tenantDomain}/_layouts/workbench.aspx" +} +``` + +#### [./package.json](./package.json) + +Update package.json engines.node property: + +```json +{ + "engines": { + "node": ">=16.13.0 <17.0.0" + } +} +``` \ No newline at end of file diff --git a/samples/react-pnp-js-sample/spfx.validate.md b/samples/react-pnp-js-sample/spfx.validate.md new file mode 100644 index 0000000000..1b1101d3fe --- /dev/null +++ b/samples/react-pnp-js-sample/spfx.validate.md @@ -0,0 +1,40 @@ +# Validate project spfx-pnp-js-example-client-side-solution + +Date: 10/25/2024 + +## Findings + +Following is the list of issues found in your project. [Summary](#Summary) of the recommended fixes is included at the end of the report. + +### FN002013 @types/webpack-env | Required + +Install supported version of the @types/webpack-env package + +Execute the following command: + +```sh +npm i -DE @types/webpack-env@~1.15.2 +``` + +File: [./package.json:39:9](./package.json) + +### FN017001 Run npm dedupe | Optional + +If, after upgrading npm packages, when building the project you have errors similar to: "error TS2345: Argument of type 'SPHttpClientConfiguration' is not assignable to parameter of type 'SPHttpClientConfiguration'", try running 'npm dedupe' to cleanup npm packages. + +Execute the following command: + +```sh +npm dedupe +``` + +File: [./package.json](./package.json) + +## Summary + +### Execute script + +```sh +npm i -DE @types/webpack-env@~1.15.2 +npm dedupe +``` \ No newline at end of file