Date: 1/17/2024
Following is the list of steps required to upgrade your project to SharePoint Framework version 1.17.4. Summary of the modifications is included at the end of the report.
Upgrade SharePoint Framework dependency package @microsoft/sp-core-library
Execute the following command:
npm i -SE @microsoft/sp-core-library@1.17.4
File: ./package.json:17:5
Upgrade SharePoint Framework dependency package @microsoft/sp-dialog
Execute the following command:
npm i -SE @microsoft/sp-dialog@1.17.4
File: ./package.json:18:5
Upgrade SharePoint Framework dependency package @microsoft/sp-application-base
Execute the following command:
npm i -SE @microsoft/sp-application-base@1.17.4
File: ./package.json:16:5
Upgrade SharePoint Framework dependency package @microsoft/decorators
Execute the following command:
npm i -SE @microsoft/decorators@1.17.4
File: ./package.json:15:5
Install SharePoint Framework dependency package @microsoft/sp-adaptive-card-extension-base
Execute the following command:
npm i -SE @microsoft/sp-adaptive-card-extension-base@1.17.4
File: ./package.json:14:3
Install SharePoint Framework dev dependency package @microsoft/eslint-plugin-spfx
Execute the following command:
npm i -DE @microsoft/eslint-plugin-spfx@1.17.4
File: ./package.json:24:3
Install SharePoint Framework dev dependency package @microsoft/eslint-config-spfx
Execute the following command:
npm i -DE @microsoft/eslint-config-spfx@1.17.4
File: ./package.json:24:3
Upgrade SharePoint Framework dev dependency package @microsoft/sp-build-web
Execute the following command:
npm i -DE @microsoft/sp-build-web@1.17.4
File: ./package.json:25:5
Upgrade SharePoint Framework dev dependency package @microsoft/sp-module-interfaces
Execute the following command:
npm i -DE @microsoft/sp-module-interfaces@1.17.4
File: ./package.json:27:5
Update version in .yo-rc.json
{
"@microsoft/generator-sharepoint": {
"version": "1.17.4"
}
}
File: ./.yo-rc.json:5:5
Install SharePoint Framework dev dependency package @microsoft/rush-stack-compiler-4.5
Execute the following command:
npm i -DE @microsoft/rush-stack-compiler-4.5@0.5.0
File: ./package.json:24:3
In the .vscode/launch.json file, update the type property for the hosted workbench launch configuration
{
"configurations": [
{
"type": "msedge"
}
]
}
File: .vscode\launch.json:28:7
Install SharePoint Framework dev dependency package eslint
Execute the following command:
npm i -DE eslint@8.7.0
File: ./package.json:24:3
Update serve.json initialPage URL
{
"initialPage": "https://{tenantDomain}/_layouts/workbench.aspx"
}
File: ./config/serve.json:1:1
Update @microsoft/teams-js SDK version in .yo-rc.json
{
"@microsoft/generator-sharepoint": {
"sdkVersions": {
"@microsoft/teams-js": "2.9.1"
}
}
}
File: ./.yo-rc.json:2:3
In the .vscode/launch.json file, update the url property for the hosted workbench launch configuration
{
"configurations": [
{
"url": "https://{tenantDomain}/_layouts/workbench.aspx"
}
]
}
File: .vscode\launch.json:28:7
Add file config\sass.json
Execute the following command:
cat > "config\sass.json" << EOF
{
"$schema": "https://developer.microsoft.com/json-schemas/core-build/sass.schema.json"
}
EOF
File: config\sass.json
Update nodeVersion in .yo-rc.json
{
"@microsoft/generator-sharepoint": {
"nodeVersion": "16.15.1"
}
}
File: ./.yo-rc.json:2:38
Update @microsoft/microsoft-graph-client SDK version in .yo-rc.json
{
"@microsoft/generator-sharepoint": {
"sdkVersions": {
"@microsoft/microsoft-graph-client": "3.0.2"
}
}
}
File: ./.yo-rc.json:2:3
Update package.json engines.node property
{
"engines": {
"node": ">=16.13.0 <17.0.0"
}
}
File: ./package.json:7:5
Install SharePoint Framework dev dependency package typescript
Execute the following command:
npm i -DE typescript@4.5.5
File: ./package.json:24:3
Add noImplicitAny in tsconfig.json
{
"compilerOptions": {
"noImplicitAny": true
}
}
File: ./tsconfig.json:3:22
Update serve.json schema URL
{
"$schema": "https://developer.microsoft.com/json-schemas/spfx-build/spfx-serve.schema.json"
}
File: ./config/serve.json:2:3
Install SharePoint Framework dependency package tslib
Execute the following command:
npm i -SE tslib@2.3.1
File: ./package.json:14:3
Upgrade SharePoint Framework dev dependency package ajv
Execute the following command:
npm i -DE ajv@6.12.5
File: ./package.json:33:5
Remove SharePoint Framework dev dependency package @microsoft/sp-tslint-rules
Execute the following command:
npm un -D @microsoft/sp-tslint-rules
File: ./package.json:26:5
Upgrade SharePoint Framework dev dependency package @types/webpack-env
Execute the following command:
npm i -DE @types/webpack-env@1.15.2
File: ./package.json:34:5
Install SharePoint Framework dev dependency package @rushstack/eslint-config
Execute the following command:
npm i -DE @rushstack/eslint-config@2.5.1
File: ./package.json:24:3
Update tsconfig.json extends property
{
"extends": "./node_modules/@microsoft/rush-stack-compiler-4.5/includes/tsconfig-web.json"
}
File: ./tsconfig.json:2:3
Remove file tslint.json
Execute the following command:
rm "tslint.json"
File: tslint.json
Add file .eslintrc.js
Execute the following command:
cat > ".eslintrc.js" << EOF
require('@rushstack/eslint-config/patch/modern-module-resolution');
export default {
extends: ['@microsoft/eslint-config-spfx/lib/profiles/default'],
parserOptions: { tsconfigRootDir: __dirname }
};
EOF
File: .eslintrc.js
To .gitignore add the '.heft' folder
File: ./.gitignore
In package-solution.json add metadata section
{
"solution": {
"metadata": {
"shortDescription": {
"default": "spfx-walls description"
},
"longDescription": {
"default": "spfx-walls description"
},
"screenshotPaths": [],
"videoUrl": "",
"categories": []
}
}
}
File: ./config/package-solution.json:3:3
Remove SharePoint Framework dev dependency package @microsoft/sp-webpart-workbench
Execute the following command:
npm un -D @microsoft/sp-webpart-workbench
File: ./package.json:28:5
In the .vscode/launch.json file, remove the local workbench launch configuration
File: .vscode\launch.json:11:7
Remove file config\copy-assets.json
Execute the following command:
rm "config\copy-assets.json"
File: config\copy-assets.json
Create the .npmignore file
File: ./.npmignore
Update deploy-azure-storage.json workingDir
{
"workingDir": "./release/assets/"
}
File: ./config/deploy-azure-storage.json:3:3
To .gitignore add the 'release' folder
File: ./.gitignore
Upgrade SharePoint Framework dev dependency package gulp
Execute the following command:
npm i -DE gulp@4.0.2
File: ./package.json:30:5
Remove SharePoint Framework dev dependency package @types/chai
Execute the following command:
npm un -D @types/chai
File: ./package.json:31:5
Remove SharePoint Framework dev dependency package @types/mocha
Execute the following command:
npm un -D @types/mocha
File: ./package.json:32:5
Remove SharePoint Framework dev dependency package @types/es6-promise
Execute the following command:
npm un -D @types/es6-promise
File: ./package.json:35:5
Remove tsconfig.json exclude property
{
"exclude": []
}
File: ./tsconfig.json:35:3
Add es2015.promise lib in tsconfig.json
{
"compilerOptions": {
"lib": [
"es2015.promise"
]
}
}
File: ./tsconfig.json:25:5
Remove es6-promise type in tsconfig.json
{
"compilerOptions": {
"types": [
"es6-promise"
]
}
}
File: ./tsconfig.json:22:7
Before 'build.initialize(require('gulp'));' add the serve task
var getTasks = build.rig.getTasks;
build.rig.getTasks = function () {
var result = getTasks.call(build.rig);
result.set('serve', result.get('serve-deprecated'));
return result;
};
File: ./gulpfile.js
Update tslint.json extends property
{
"extends": "./node_modules/@microsoft/sp-tslint-rules/base-tslint.json"
}
File: ./tslint.json:2:3
Remove package.json property
{
"engines": "undefined"
}
File: ./package.json:6:3
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:
npm dedupe
File: ./package.json
npm un -D @microsoft/sp-tslint-rules @microsoft/sp-webpart-workbench @types/chai @types/mocha @types/es6-promise
npm i -SE @microsoft/sp-core-library@1.17.4 @microsoft/sp-dialog@1.17.4 @microsoft/sp-application-base@1.17.4 @microsoft/decorators@1.17.4 @microsoft/sp-adaptive-card-extension-base@1.17.4 tslib@2.3.1
npm i -DE @microsoft/eslint-plugin-spfx@1.17.4 @microsoft/eslint-config-spfx@1.17.4 @microsoft/sp-build-web@1.17.4 @microsoft/sp-module-interfaces@1.17.4 @microsoft/rush-stack-compiler-4.5@0.5.0 eslint@8.7.0 typescript@4.5.5 ajv@6.12.5 @types/webpack-env@1.15.2 @rushstack/eslint-config@2.5.1 gulp@4.0.2
npm dedupe
cat > "config\sass.json" << EOF
{
"$schema": "https://developer.microsoft.com/json-schemas/core-build/sass.schema.json"
}
EOF
rm "tslint.json"
cat > ".eslintrc.js" << EOF
require('@rushstack/eslint-config/patch/modern-module-resolution');
export default {
extends: ['@microsoft/eslint-config-spfx/lib/profiles/default'],
parserOptions: { tsconfigRootDir: __dirname }
};
EOF
rm "config\copy-assets.json"
Update version in .yo-rc.json:
{
"@microsoft/generator-sharepoint": {
"version": "1.17.4"
}
}
Update @microsoft/teams-js SDK version in .yo-rc.json:
{
"@microsoft/generator-sharepoint": {
"sdkVersions": {
"@microsoft/teams-js": "2.9.1"
}
}
}
Update nodeVersion in .yo-rc.json:
{
"@microsoft/generator-sharepoint": {
"nodeVersion": "16.15.1"
}
}
Update @microsoft/microsoft-graph-client SDK version in .yo-rc.json:
{
"@microsoft/generator-sharepoint": {
"sdkVersions": {
"@microsoft/microsoft-graph-client": "3.0.2"
}
}
}
In the .vscode/launch.json file, update the type property for the hosted workbench launch configuration:
{
"configurations": [
{
"type": "msedge"
}
]
}
In the .vscode/launch.json file, update the url property for the hosted workbench launch configuration:
{
"configurations": [
{
"url": "https://{tenantDomain}/_layouts/workbench.aspx"
}
]
}
In the .vscode/launch.json file, remove the local workbench launch configuration:
Update serve.json initialPage URL:
{
"initialPage": "https://{tenantDomain}/_layouts/workbench.aspx"
}
Update serve.json schema URL:
{
"$schema": "https://developer.microsoft.com/json-schemas/spfx-build/spfx-serve.schema.json"
}
Update package.json engines.node property:
{
"engines": {
"node": ">=16.13.0 <17.0.0"
}
}
Remove package.json property:
{
"engines": "undefined"
}
Add noImplicitAny in tsconfig.json:
{
"compilerOptions": {
"noImplicitAny": true
}
}
Update tsconfig.json extends property:
{
"extends": "./node_modules/@microsoft/rush-stack-compiler-4.5/includes/tsconfig-web.json"
}
Remove tsconfig.json exclude property:
{
"exclude": []
}
Add es2015.promise lib in tsconfig.json:
{
"compilerOptions": {
"lib": [
"es2015.promise"
]
}
}
Remove es6-promise type in tsconfig.json:
{
"compilerOptions": {
"types": [
"es6-promise"
]
}
}
To .gitignore add the '.heft' folder:
.heft
To .gitignore add the 'release' folder:
release
In package-solution.json add metadata section:
{
"solution": {
"metadata": {
"shortDescription": {
"default": "spfx-walls description"
},
"longDescription": {
"default": "spfx-walls description"
},
"screenshotPaths": [],
"videoUrl": "",
"categories": []
}
}
}
Create the .npmignore file:
!dist
config
gulpfile.js
release
src
temp
tsconfig.json
tslint.json
*.log
.yo-rc.json
.vscode
Update deploy-azure-storage.json workingDir:
{
"workingDir": "./release/assets/"
}
Before 'build.initialize(require('gulp'));' add the serve task:
var getTasks = build.rig.getTasks;
build.rig.getTasks = function () {
var result = getTasks.call(build.rig);
result.set('serve', result.get('serve-deprecated'));
return result;
};
Update tslint.json extends property:
{
"extends": "./node_modules/@microsoft/sp-tslint-rules/base-tslint.json"
}