upgrade to spfx 1.15
This commit is contained in:
parent
405f34dd89
commit
176c6a1753
|
@ -0,0 +1,5 @@
|
|||
require('@rushstack/eslint-config/patch/modern-module-resolution');
|
||||
module.exports = {
|
||||
extends: ['@microsoft/eslint-config-spfx/lib/profiles/react'],
|
||||
parserOptions: { tsconfigRootDir: __dirname }
|
||||
};
|
|
@ -35,3 +35,5 @@ obj
|
|||
*.cer
|
||||
# .PEM Certificates
|
||||
*.pem
|
||||
|
||||
.heft
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
"@microsoft/generator-sharepoint": {
|
||||
"isCreatingSolution": true,
|
||||
"environment": "spo",
|
||||
"version": "1.14.0",
|
||||
"version": "1.15.0",
|
||||
"libraryName": "react-graph-app-secret-expiration",
|
||||
"libraryId": "b25d85a4-7310-408a-a263-25959b0a5b1b",
|
||||
"packageManager": "npm",
|
||||
|
|
|
@ -17,12 +17,12 @@
|
|||
"title": "react-graph-app-secret-expiration Feature",
|
||||
"description": "The feature that activates elements of the react-graph-app-secret-expiration solution.",
|
||||
"id": "ca58f355-9872-4025-8ad5-763ad6076034",
|
||||
"version": "1.3.0.0"
|
||||
"version": "1.4.0.0"
|
||||
}
|
||||
],
|
||||
"name": "react-graph-app-secret-expiration-client-side-solution",
|
||||
"id": "b25d85a4-7310-408a-a263-25959b0a5b1b",
|
||||
"version": "1.3.0.0",
|
||||
"version": "1.4.0.0",
|
||||
"includeClientSideAssets": true,
|
||||
"isDomainIsolated": false,
|
||||
"skipFeatureDeployment": true,
|
||||
|
|
File diff suppressed because it is too large
Load Diff
|
@ -1,6 +1,6 @@
|
|||
{
|
||||
"name": "react-graph-app-secret-expiration",
|
||||
"version": "1.3.0",
|
||||
"version": "1.4.0",
|
||||
"private": true,
|
||||
"main": "lib/index.js",
|
||||
"scripts": {
|
||||
|
@ -11,28 +11,34 @@
|
|||
"dependencies": {
|
||||
"@fluentui/react": "^8.61.0",
|
||||
"@microsoft/rush-stack-compiler-3.8": "^0.4.47",
|
||||
"@microsoft/sp-core-library": "1.14.0",
|
||||
"@microsoft/sp-http": "^1.14.0",
|
||||
"@microsoft/sp-lodash-subset": "1.14.0",
|
||||
"@microsoft/sp-office-ui-fabric-core": "1.14.0",
|
||||
"@microsoft/sp-property-pane": "1.14.0",
|
||||
"@microsoft/sp-webpart-base": "1.14.0",
|
||||
"@microsoft/sp-core-library": "1.15.0",
|
||||
"@microsoft/sp-http": "1.15.0",
|
||||
"@microsoft/sp-lodash-subset": "1.15.0",
|
||||
"@microsoft/sp-office-ui-fabric-core": "1.15.0",
|
||||
"@microsoft/sp-property-pane": "1.15.0",
|
||||
"@microsoft/sp-webpart-base": "1.15.0",
|
||||
"@pnp/spfx-controls-react": "3.3.0",
|
||||
"moment": "^2.29.1",
|
||||
"office-ui-fabric-react": "7.174.1",
|
||||
"office-ui-fabric-react": "7.185.7",
|
||||
"react": "16.13.1",
|
||||
"react-dom": "16.13.1"
|
||||
"react-dom": "16.13.1",
|
||||
"tslib": "2.3.1"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@microsoft/eslint-config-spfx": "1.15.0",
|
||||
"@microsoft/eslint-plugin-spfx": "1.15.0",
|
||||
"@microsoft/rush-stack-compiler-3.7": "0.2.3",
|
||||
"@microsoft/rush-stack-compiler-3.9": "0.4.47",
|
||||
"@microsoft/sp-build-web": "1.14.0",
|
||||
"@microsoft/sp-module-interfaces": "1.14.0",
|
||||
"@microsoft/sp-tslint-rules": "1.14.0",
|
||||
"@microsoft/rush-stack-compiler-4.5": "0.2.2",
|
||||
"@microsoft/sp-build-web": "1.15.0",
|
||||
"@microsoft/sp-module-interfaces": "1.15.0",
|
||||
"@rushstack/eslint-config": "2.5.1",
|
||||
"@types/react": "16.9.51",
|
||||
"@types/react-dom": "16.9.8",
|
||||
"@types/webpack-env": "1.13.1",
|
||||
"ajv": "~5.2.2",
|
||||
"@types/webpack-env": "1.15.2",
|
||||
"ajv": "6.12.5",
|
||||
"eslint": "8.7.0",
|
||||
"eslint-plugin-react-hooks": "4.3.0",
|
||||
"gulp": "~4.0.2"
|
||||
}
|
||||
}
|
||||
|
|
|
@ -12,7 +12,7 @@ import { BaseClientSideWebPart } from '@microsoft/sp-webpart-base';
|
|||
import * as strings from 'GraphAppSecretExpirationWebPartStrings';
|
||||
import GraphAppSecretExpiration from './components/GraphAppSecretExpiration';
|
||||
import { IGraphAppSecretExpirationProps } from './components/IGraphAppSecretExpirationProps';
|
||||
import { MSGraphClient } from '@microsoft/sp-http';
|
||||
import { MSGraphClientV3 } from '@microsoft/sp-http';
|
||||
|
||||
export interface IGraphAppSecretExpirationWebPartProps {
|
||||
groupByColumn: string;
|
||||
|
@ -22,7 +22,7 @@ export interface IGraphAppSecretExpirationWebPartProps {
|
|||
}
|
||||
|
||||
export default class GraphAppSecretExpirationWebPart extends BaseClientSideWebPart<IGraphAppSecretExpirationWebPartProps> {
|
||||
private graphClient: MSGraphClient;
|
||||
private graphClient: MSGraphClientV3;
|
||||
private dropdownOptions: IPropertyPaneDropdownOption[] = [
|
||||
{ key: "none", text: "None" },
|
||||
{ key: "applicationId", text: "Application ID" },
|
||||
|
@ -31,8 +31,8 @@ export default class GraphAppSecretExpirationWebPart extends BaseClientSideWebPa
|
|||
public onInit(): Promise<void> {
|
||||
return new Promise<void>((resolve: () => void, reject: (error: any) => void): void => {
|
||||
this.context.msGraphClientFactory
|
||||
.getClient()
|
||||
.then((client: MSGraphClient): void => {
|
||||
.getClient("3")
|
||||
.then((client: MSGraphClientV3): void => {
|
||||
this.graphClient = client;
|
||||
resolve();
|
||||
}, err => reject(err));
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
import { MSGraphClient } from "@microsoft/sp-http";
|
||||
import { MSGraphClientV3 } from "@microsoft/sp-http";
|
||||
|
||||
export interface IGraphAppSecretExpirationProps {
|
||||
graphClient: MSGraphClient;
|
||||
graphClient: MSGraphClientV3;
|
||||
groupByColumn: string;
|
||||
expiringSoon: boolean;
|
||||
displaySampleData: boolean;
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
{
|
||||
"extends": "./node_modules/@microsoft/rush-stack-compiler-3.9/includes/tsconfig-web.json",
|
||||
"extends": "./node_modules/@microsoft/rush-stack-compiler-4.5/includes/tsconfig-web.json",
|
||||
"compilerOptions": {
|
||||
"target": "es5",
|
||||
"forceConsistentCasingInFileNames": true,
|
||||
|
|
|
@ -1,29 +0,0 @@
|
|||
{
|
||||
"extends": "./node_modules/@microsoft/sp-tslint-rules/base-tslint.json",
|
||||
"rules": {
|
||||
"class-name": false,
|
||||
"export-name": false,
|
||||
"forin": false,
|
||||
"label-position": false,
|
||||
"member-access": true,
|
||||
"no-arg": false,
|
||||
"no-console": false,
|
||||
"no-construct": false,
|
||||
"no-duplicate-variable": true,
|
||||
"no-eval": false,
|
||||
"no-function-expression": true,
|
||||
"no-internal-module": true,
|
||||
"no-shadowed-variable": true,
|
||||
"no-switch-case-fall-through": true,
|
||||
"no-unnecessary-semicolons": true,
|
||||
"no-unused-expression": true,
|
||||
"no-with-statement": true,
|
||||
"semicolon": true,
|
||||
"trailing-comma": false,
|
||||
"typedef": false,
|
||||
"typedef-whitespace": false,
|
||||
"use-named-parameter": true,
|
||||
"variable-name": false,
|
||||
"whitespace": false
|
||||
}
|
||||
}
|
|
@ -0,0 +1,361 @@
|
|||
# Upgrade project react-graph-app-secret-expiration to v1.15.0
|
||||
|
||||
Date: 07/07/2022
|
||||
|
||||
## Findings
|
||||
|
||||
Following is the list of steps required to upgrade your project to SharePoint Framework version 1.15.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.15.0
|
||||
```
|
||||
|
||||
File: [./package.json:14:5](./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.15.0
|
||||
```
|
||||
|
||||
File: [./package.json:16:5](./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.15.0
|
||||
```
|
||||
|
||||
File: [./package.json:17:5](./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.15.0
|
||||
```
|
||||
|
||||
File: [./package.json:19:5](./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.15.0
|
||||
```
|
||||
|
||||
File: [./package.json:18:5](./package.json)
|
||||
|
||||
### FN001022 office-ui-fabric-react | Required
|
||||
|
||||
Upgrade SharePoint Framework dependency package office-ui-fabric-react
|
||||
|
||||
Execute the following command:
|
||||
|
||||
```sh
|
||||
npm i -SE office-ui-fabric-react@7.185.7
|
||||
```
|
||||
|
||||
File: [./package.json:22:5](./package.json)
|
||||
|
||||
### FN001027 @microsoft/sp-http | Required
|
||||
|
||||
Upgrade SharePoint Framework dependency package @microsoft/sp-http
|
||||
|
||||
Execute the following command:
|
||||
|
||||
```sh
|
||||
npm i -SE @microsoft/sp-http@1.15.0
|
||||
```
|
||||
|
||||
File: [./package.json:15:5](./package.json)
|
||||
|
||||
### FN001033 tslib | Required
|
||||
|
||||
Install SharePoint Framework dependency package tslib
|
||||
|
||||
Execute the following command:
|
||||
|
||||
```sh
|
||||
npm i -SE tslib@2.3.1
|
||||
```
|
||||
|
||||
File: [./package.json:11:3](./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.15.0
|
||||
```
|
||||
|
||||
File: [./package.json:29:5](./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.15.0
|
||||
```
|
||||
|
||||
File: [./package.json:30:5](./package.json)
|
||||
|
||||
### FN002007 ajv | Required
|
||||
|
||||
Upgrade SharePoint Framework dev dependency package ajv
|
||||
|
||||
Execute the following command:
|
||||
|
||||
```sh
|
||||
npm i -DE ajv@6.12.5
|
||||
```
|
||||
|
||||
File: [./package.json:35:5](./package.json)
|
||||
|
||||
### FN002009 @microsoft/sp-tslint-rules | Required
|
||||
|
||||
Remove SharePoint Framework dev dependency package @microsoft/sp-tslint-rules
|
||||
|
||||
Execute the following command:
|
||||
|
||||
```sh
|
||||
npm un -D @microsoft/sp-tslint-rules
|
||||
```
|
||||
|
||||
File: [./package.json:31:5](./package.json)
|
||||
|
||||
### FN002013 @types/webpack-env | Required
|
||||
|
||||
Upgrade SharePoint Framework dev dependency package @types/webpack-env
|
||||
|
||||
Execute the following command:
|
||||
|
||||
```sh
|
||||
npm i -DE @types/webpack-env@1.15.2
|
||||
```
|
||||
|
||||
File: [./package.json:34:5](./package.json)
|
||||
|
||||
### FN002020 @microsoft/rush-stack-compiler-4.5 | Required
|
||||
|
||||
Install SharePoint Framework dev dependency package @microsoft/rush-stack-compiler-4.5
|
||||
|
||||
Execute the following command:
|
||||
|
||||
```sh
|
||||
npm i -DE @microsoft/rush-stack-compiler-4.5@0.2.2
|
||||
```
|
||||
|
||||
File: [./package.json:26:3](./package.json)
|
||||
|
||||
### FN002021 @rushstack/eslint-config | Required
|
||||
|
||||
Install SharePoint Framework dev dependency package @rushstack/eslint-config
|
||||
|
||||
Execute the following command:
|
||||
|
||||
```sh
|
||||
npm i -DE @rushstack/eslint-config@2.5.1
|
||||
```
|
||||
|
||||
File: [./package.json:26:3](./package.json)
|
||||
|
||||
### FN002022 @microsoft/eslint-plugin-spfx | Required
|
||||
|
||||
Install SharePoint Framework dev dependency package @microsoft/eslint-plugin-spfx
|
||||
|
||||
Execute the following command:
|
||||
|
||||
```sh
|
||||
npm i -DE @microsoft/eslint-plugin-spfx@1.15.0
|
||||
```
|
||||
|
||||
File: [./package.json:26:3](./package.json)
|
||||
|
||||
### FN002023 @microsoft/eslint-config-spfx | Required
|
||||
|
||||
Install SharePoint Framework dev dependency package @microsoft/eslint-config-spfx
|
||||
|
||||
Execute the following command:
|
||||
|
||||
```sh
|
||||
npm i -DE @microsoft/eslint-config-spfx@1.15.0
|
||||
```
|
||||
|
||||
File: [./package.json:26:3](./package.json)
|
||||
|
||||
### FN002024 eslint | Required
|
||||
|
||||
Install SharePoint Framework dev dependency package eslint
|
||||
|
||||
Execute the following command:
|
||||
|
||||
```sh
|
||||
npm i -DE eslint@8.7.0
|
||||
```
|
||||
|
||||
File: [./package.json:26:3](./package.json)
|
||||
|
||||
### FN002025 eslint-plugin-react-hooks | Required
|
||||
|
||||
Install SharePoint Framework dev dependency package eslint-plugin-react-hooks
|
||||
|
||||
Execute the following command:
|
||||
|
||||
```sh
|
||||
npm i -DE eslint-plugin-react-hooks@4.3.0
|
||||
```
|
||||
|
||||
File: [./package.json:26:3](./package.json)
|
||||
|
||||
### FN010001 .yo-rc.json version | Recommended
|
||||
|
||||
Update version in .yo-rc.json
|
||||
|
||||
```json
|
||||
{
|
||||
"@microsoft/generator-sharepoint": {
|
||||
"version": "1.15.0"
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
File: [./.yo-rc.json:5:5](./.yo-rc.json)
|
||||
|
||||
### FN012017 tsconfig.json extends property | Required
|
||||
|
||||
Update tsconfig.json extends property
|
||||
|
||||
```json
|
||||
{
|
||||
"extends": "./node_modules/@microsoft/rush-stack-compiler-4.5/includes/tsconfig-web.json"
|
||||
}
|
||||
```
|
||||
|
||||
File: [./tsconfig.json:2:3](./tsconfig.json)
|
||||
|
||||
### FN015003 tslint.json | Required
|
||||
|
||||
Remove file tslint.json
|
||||
|
||||
Execute the following command:
|
||||
|
||||
```sh
|
||||
rm "tslint.json"
|
||||
```
|
||||
|
||||
File: [tslint.json](tslint.json)
|
||||
|
||||
### FN015008 .eslintrc.js | Required
|
||||
|
||||
Add file .eslintrc.js
|
||||
|
||||
Execute the following command:
|
||||
|
||||
```sh
|
||||
cat > ".eslintrc.js" << EOF
|
||||
require('@rushstack/eslint-config/patch/modern-module-resolution');
|
||||
module.exports = {
|
||||
extends: ['@microsoft/eslint-config-spfx/lib/profiles/react'],
|
||||
parserOptions: { tsconfigRootDir: __dirname }
|
||||
};
|
||||
EOF
|
||||
```
|
||||
|
||||
File: [.eslintrc.js](.eslintrc.js)
|
||||
|
||||
### FN023002 .gitignore '.heft' folder | Required
|
||||
|
||||
To .gitignore add the '.heft' folder
|
||||
|
||||
|
||||
File: [./.gitignore](./.gitignore)
|
||||
|
||||
### 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 un -D @microsoft/sp-tslint-rules
|
||||
npm i -SE @microsoft/sp-core-library@1.15.0 @microsoft/sp-lodash-subset@1.15.0 @microsoft/sp-office-ui-fabric-core@1.15.0 @microsoft/sp-webpart-base@1.15.0 @microsoft/sp-property-pane@1.15.0 office-ui-fabric-react@7.185.7 @microsoft/sp-http@1.15.0 tslib@2.3.1
|
||||
npm i -DE @microsoft/sp-build-web@1.15.0 @microsoft/sp-module-interfaces@1.15.0 ajv@6.12.5 @types/webpack-env@1.15.2 @microsoft/rush-stack-compiler-4.5@0.2.2 @rushstack/eslint-config@2.5.1 @microsoft/eslint-plugin-spfx@1.15.0 @microsoft/eslint-config-spfx@1.15.0 eslint@8.7.0 eslint-plugin-react-hooks@4.3.0
|
||||
npm dedupe
|
||||
rm "tslint.json"
|
||||
cat > ".eslintrc.js" << EOF
|
||||
require('@rushstack/eslint-config/patch/modern-module-resolution');
|
||||
module.exports = {
|
||||
extends: ['@microsoft/eslint-config-spfx/lib/profiles/react'],
|
||||
parserOptions: { tsconfigRootDir: __dirname }
|
||||
};
|
||||
EOF
|
||||
```
|
||||
|
||||
### Modify files
|
||||
|
||||
#### [./.yo-rc.json](./.yo-rc.json)
|
||||
|
||||
Update version in .yo-rc.json:
|
||||
|
||||
```json
|
||||
{
|
||||
"@microsoft/generator-sharepoint": {
|
||||
"version": "1.15.0"
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
#### [./tsconfig.json](./tsconfig.json)
|
||||
|
||||
Update tsconfig.json extends property:
|
||||
|
||||
```json
|
||||
{
|
||||
"extends": "./node_modules/@microsoft/rush-stack-compiler-4.5/includes/tsconfig-web.json"
|
||||
}
|
||||
```
|
||||
|
||||
#### [./.gitignore](./.gitignore)
|
||||
|
||||
To .gitignore add the '.heft' folder:
|
||||
|
||||
```text
|
||||
.heft
|
||||
```
|
Loading…
Reference in New Issue