458 lines
20 KiB
Markdown
458 lines
20 KiB
Markdown
# Upgrade project C:\repos\pnp\sp-dev-fx-webparts\samples\react-script-editor to v1.5.1
|
|
|
|
Date: 2018-8-9
|
|
|
|
## Findings
|
|
|
|
Following is the list of steps required to upgrade your project to SharePoint Framework version 1.5.1.
|
|
|
|
### FN001001 @microsoft/sp-core-library | Required
|
|
|
|
Upgrade SharePoint Framework dependency package @microsoft/sp-core-library
|
|
|
|
Execute the following command:
|
|
|
|
```sh
|
|
npm i @microsoft/sp-core-library@1.5.1 --save-exact
|
|
```
|
|
|
|
File: [./package.json](./package.json)
|
|
|
|
### FN001004 @microsoft/sp-webpart-base | Required
|
|
|
|
Upgrade SharePoint Framework dependency package @microsoft/sp-webpart-base
|
|
|
|
Execute the following command:
|
|
|
|
```sh
|
|
npm i @microsoft/sp-webpart-base@1.5.1 --save-exact
|
|
```
|
|
|
|
File: [./package.json](./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 @microsoft/sp-build-web@1.5.1 --save-exact -D
|
|
```
|
|
|
|
File: [./package.json](./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 @microsoft/sp-module-interfaces@1.5.1 --save-exact -D
|
|
```
|
|
|
|
File: [./package.json](./package.json)
|
|
|
|
### FN002003 @microsoft/sp-webpart-workbench | Required
|
|
|
|
Upgrade SharePoint Framework dev dependency package @microsoft/sp-webpart-workbench
|
|
|
|
Execute the following command:
|
|
|
|
```sh
|
|
npm i @microsoft/sp-webpart-workbench@1.5.1 --save-exact -D
|
|
```
|
|
|
|
File: [./package.json](./package.json)
|
|
|
|
### FN010001 .yo-rc.json version | Recommended
|
|
|
|
Update version in .yo-rc.json
|
|
|
|
In file [./.yo-rc.json](./.yo-rc.json) update the code as follows:
|
|
|
|
```json
|
|
{
|
|
"@microsoft/generator-sharepoint": {
|
|
"version": "1.5.1"
|
|
}
|
|
}
|
|
```
|
|
|
|
File: [./.yo-rc.json](./.yo-rc.json)
|
|
|
|
### FN001007 @types/webpack-env | Required
|
|
|
|
Upgrade SharePoint Framework dependency package @types/webpack-env
|
|
|
|
Execute the following command:
|
|
|
|
```sh
|
|
npm i @types/webpack-env@1.13.1 --save-exact
|
|
```
|
|
|
|
File: [./package.json](./package.json)
|
|
|
|
### FN001010 @types/es6-promise | Required
|
|
|
|
Install SharePoint Framework dependency package @types/es6-promise
|
|
|
|
Execute the following command:
|
|
|
|
```sh
|
|
npm i @types/es6-promise@0.0.33 --save-exact
|
|
```
|
|
|
|
File: [./package.json](./package.json)
|
|
|
|
### FN002005 @types/chai | Required
|
|
|
|
Upgrade SharePoint Framework dev dependency package @types/chai
|
|
|
|
Execute the following command:
|
|
|
|
```sh
|
|
npm i @types/chai@3.4.34 --save-exact -D
|
|
```
|
|
|
|
File: [./package.json](./package.json)
|
|
|
|
### FN002006 @types/mocha | Required
|
|
|
|
Upgrade SharePoint Framework dev dependency package @types/mocha
|
|
|
|
Execute the following command:
|
|
|
|
```sh
|
|
npm i @types/mocha@2.2.38 --save-exact -D
|
|
```
|
|
|
|
File: [./package.json](./package.json)
|
|
|
|
### FN003001 config.json schema | Required
|
|
|
|
Update config.json schema URL
|
|
|
|
In file [./config/config.json](./config/config.json) update the code as follows:
|
|
|
|
```json
|
|
{
|
|
"$schema": "https://developer.microsoft.com/json-schemas/spfx-build/config.2.0.schema.json"
|
|
}
|
|
```
|
|
|
|
File: [./config/config.json](./config/config.json)
|
|
|
|
### FN004001 copy-assets.json schema | Required
|
|
|
|
Update copy-assets.json schema URL
|
|
|
|
In file [./config/copy-assets.json](./config/copy-assets.json) update the code as follows:
|
|
|
|
```json
|
|
{
|
|
"$schema": "https://developer.microsoft.com/json-schemas/spfx-build/copy-assets.schema.json"
|
|
}
|
|
```
|
|
|
|
File: [./config/copy-assets.json](./config/copy-assets.json)
|
|
|
|
### FN005001 deploy-azure-storage.json schema | Required
|
|
|
|
Update deploy-azure-storage.json schema URL
|
|
|
|
In file [./config/deploy-azure-storage.json](./config/deploy-azure-storage.json) update the code as follows:
|
|
|
|
```json
|
|
{
|
|
"$schema": "https://developer.microsoft.com/json-schemas/spfx-build/deploy-azure-storage.schema.json"
|
|
}
|
|
```
|
|
|
|
File: [./config/deploy-azure-storage.json](./config/deploy-azure-storage.json)
|
|
|
|
### FN006001 package-solution.json schema | Required
|
|
|
|
Update package-solution.json schema URL
|
|
|
|
In file [./config/package-solution.json](./config/package-solution.json) update the code as follows:
|
|
|
|
```json
|
|
{
|
|
"$schema": "https://developer.microsoft.com/json-schemas/spfx-build/package-solution.schema.json"
|
|
}
|
|
```
|
|
|
|
File: [./config/package-solution.json](./config/package-solution.json)
|
|
|
|
### FN007001 serve.json schema | Required
|
|
|
|
Update serve.json schema URL
|
|
|
|
In file [./config/serve.json](./config/serve.json) update the code as follows:
|
|
|
|
```json
|
|
{
|
|
"$schema": "https://developer.microsoft.com/json-schemas/core-build/serve.schema.json"
|
|
}
|
|
```
|
|
|
|
File: [./config/serve.json](./config/serve.json)
|
|
|
|
### FN008001 tslint.json schema | Required
|
|
|
|
Update tslint.json schema URL
|
|
|
|
In file [./config/tslint.json](./config/tslint.json) update the code as follows:
|
|
|
|
```json
|
|
{
|
|
"$schema": "https://developer.microsoft.com/json-schemas/core-build/tslint.schema.json"
|
|
}
|
|
```
|
|
|
|
File: [./config/tslint.json](./config/tslint.json)
|
|
|
|
### FN009001 write-manifests.json schema | Required
|
|
|
|
Update write-manifests.json schema URL
|
|
|
|
In file [./config/write-manifests.json](./config/write-manifests.json) update the code as follows:
|
|
|
|
```json
|
|
{
|
|
"$schema": "https://developer.microsoft.com/json-schemas/spfx-build/write-manifests.schema.json"
|
|
}
|
|
```
|
|
|
|
File: [./config/write-manifests.json](./config/write-manifests.json)
|
|
|
|
### FN010002 .yo-rc.json isCreatingSolution | Recommended
|
|
|
|
Update isCreatingSolution in .yo-rc.json
|
|
|
|
In file [./.yo-rc.json](./.yo-rc.json) update the code as follows:
|
|
|
|
```json
|
|
{
|
|
"@microsoft/generator-sharepoint": {
|
|
"isCreatingSolution": true
|
|
}
|
|
}
|
|
```
|
|
|
|
File: [./.yo-rc.json](./.yo-rc.json)
|
|
|
|
### FN010003 .yo-rc.json packageManager | Recommended
|
|
|
|
Update packageManager in .yo-rc.json
|
|
|
|
In file [./.yo-rc.json](./.yo-rc.json) update the code as follows:
|
|
|
|
```json
|
|
{
|
|
"@microsoft/generator-sharepoint": {
|
|
"packageManager": "npm"
|
|
}
|
|
}
|
|
```
|
|
|
|
File: [./.yo-rc.json](./.yo-rc.json)
|
|
|
|
### FN010004 .yo-rc.json componentType | Recommended
|
|
|
|
Update componentType in .yo-rc.json
|
|
|
|
In file [./.yo-rc.json](./.yo-rc.json) update the code as follows:
|
|
|
|
```json
|
|
{
|
|
"@microsoft/generator-sharepoint": {
|
|
"componentType": "webpart"
|
|
}
|
|
}
|
|
```
|
|
|
|
File: [./.yo-rc.json](./.yo-rc.json)
|
|
|
|
### FN011001 Web part manifest schema | Required
|
|
|
|
Update schema in manifest src\webparts\scriptEditor\ScriptEditorWebPart.manifest.json
|
|
|
|
In file [src\webparts\scriptEditor\ScriptEditorWebPart.manifest.json](src\webparts\scriptEditor\ScriptEditorWebPart.manifest.json) update the code as follows:
|
|
|
|
```json
|
|
{
|
|
"$schema": "https://developer.microsoft.com/json-schemas/spfx/client-side-web-part-manifest.schema.json"
|
|
}
|
|
```
|
|
|
|
File: [src\webparts\scriptEditor\ScriptEditorWebPart.manifest.json](src\webparts\scriptEditor\ScriptEditorWebPart.manifest.json)
|
|
|
|
### FN012001 tsconfig.json module | Required
|
|
|
|
Update module type in tsconfig.json
|
|
|
|
In file [./tsconfig.json](./tsconfig.json) update the code as follows:
|
|
|
|
```json
|
|
{
|
|
"compilerOptions": {
|
|
"module": "esnext"
|
|
}
|
|
}
|
|
```
|
|
|
|
File: [./tsconfig.json](./tsconfig.json)
|
|
|
|
### FN012002 tsconfig.json moduleResolution | Required
|
|
|
|
Update moduleResolution in tsconfig.json
|
|
|
|
In file [./tsconfig.json](./tsconfig.json) update the code as follows:
|
|
|
|
```json
|
|
{
|
|
"compilerOptions": {
|
|
"moduleResolution": "node"
|
|
}
|
|
}
|
|
```
|
|
|
|
File: [./tsconfig.json](./tsconfig.json)
|
|
|
|
## Summary
|
|
|
|
### Execute script
|
|
|
|
```sh
|
|
npm i @microsoft/sp-core-library@1.5.1 --save-exact
|
|
npm i @microsoft/sp-webpart-base@1.5.1 --save-exact
|
|
npm i @microsoft/sp-build-web@1.5.1 --save-exact -D
|
|
npm i @microsoft/sp-module-interfaces@1.5.1 --save-exact -D
|
|
npm i @microsoft/sp-webpart-workbench@1.5.1 --save-exact -D
|
|
npm i @types/webpack-env@1.13.1 --save-exact
|
|
npm i @types/es6-promise@0.0.33 --save-exact
|
|
npm i @types/chai@3.4.34 --save-exact -D
|
|
npm i @types/mocha@2.2.38 --save-exact -D
|
|
```
|
|
|
|
### Modify files
|
|
|
|
#### [./.yo-rc.json](./.yo-rc.json)
|
|
|
|
```json
|
|
{
|
|
"@microsoft/generator-sharepoint": {
|
|
"version": "1.5.1"
|
|
}
|
|
}
|
|
```
|
|
|
|
```json
|
|
{
|
|
"@microsoft/generator-sharepoint": {
|
|
"isCreatingSolution": true
|
|
}
|
|
}
|
|
```
|
|
|
|
```json
|
|
{
|
|
"@microsoft/generator-sharepoint": {
|
|
"packageManager": "npm"
|
|
}
|
|
}
|
|
```
|
|
|
|
```json
|
|
{
|
|
"@microsoft/generator-sharepoint": {
|
|
"componentType": "webpart"
|
|
}
|
|
}
|
|
```
|
|
|
|
#### [./config/config.json](./config/config.json)
|
|
|
|
```json
|
|
{
|
|
"$schema": "https://developer.microsoft.com/json-schemas/spfx-build/config.2.0.schema.json"
|
|
}
|
|
```
|
|
|
|
#### [./config/copy-assets.json](./config/copy-assets.json)
|
|
|
|
```json
|
|
{
|
|
"$schema": "https://developer.microsoft.com/json-schemas/spfx-build/copy-assets.schema.json"
|
|
}
|
|
```
|
|
|
|
#### [./config/deploy-azure-storage.json](./config/deploy-azure-storage.json)
|
|
|
|
```json
|
|
{
|
|
"$schema": "https://developer.microsoft.com/json-schemas/spfx-build/deploy-azure-storage.schema.json"
|
|
}
|
|
```
|
|
|
|
#### [./config/package-solution.json](./config/package-solution.json)
|
|
|
|
```json
|
|
{
|
|
"$schema": "https://developer.microsoft.com/json-schemas/spfx-build/package-solution.schema.json"
|
|
}
|
|
```
|
|
|
|
#### [./config/serve.json](./config/serve.json)
|
|
|
|
```json
|
|
{
|
|
"$schema": "https://developer.microsoft.com/json-schemas/core-build/serve.schema.json"
|
|
}
|
|
```
|
|
|
|
#### [./config/tslint.json](./config/tslint.json)
|
|
|
|
```json
|
|
{
|
|
"$schema": "https://developer.microsoft.com/json-schemas/core-build/tslint.schema.json"
|
|
}
|
|
```
|
|
|
|
#### [./config/write-manifests.json](./config/write-manifests.json)
|
|
|
|
```json
|
|
{
|
|
"$schema": "https://developer.microsoft.com/json-schemas/spfx-build/write-manifests.schema.json"
|
|
}
|
|
```
|
|
|
|
#### [src\webparts\scriptEditor\ScriptEditorWebPart.manifest.json](src\webparts\scriptEditor\ScriptEditorWebPart.manifest.json)
|
|
|
|
```json
|
|
{
|
|
"$schema": "https://developer.microsoft.com/json-schemas/spfx/client-side-web-part-manifest.schema.json"
|
|
}
|
|
```
|
|
|
|
#### [./tsconfig.json](./tsconfig.json)
|
|
|
|
```json
|
|
{
|
|
"compilerOptions": {
|
|
"module": "esnext"
|
|
}
|
|
}
|
|
```
|
|
|
|
```json
|
|
{
|
|
"compilerOptions": {
|
|
"moduleResolution": "node"
|
|
}
|
|
}
|
|
```
|