BLOG > ARTICLE

Running SPCAF analysis of SharePoint Framework projects with Gulp

4 min read

SharePointFramework

Recently Microsoft announced a new development model for SharePoint customizations. Here is how our latest investments in SPCAF will help you ensure that your SharePoint Framework projects have the high quality your organization aims for.

Modern solutions for modern SharePoint Framework

Over the last few years technology has changed significantly. Client-side solutions became more powerful and web development on the web stack gained popularity. Still SharePoint has been using the same proprietary development model. Using SharePoint Add-ins we could offload our customizations from SharePoint servers increasing platform hygiene and improving its scalability but building SharePoint solutions still required a lot of specialistic knowledge.

Recently Microsoft also announced a new modern user experience for SharePoint. One that makes SharePoint not only look great but also work great: in browser and mobile devices.

Modern SharePoint team site

The new SharePoint UX is accompanied by the SharePoint Framework – development model built from scratch based on the assumption that building SharePoint solutions should be possible for every developer and shouldn’t be any different than building web applications. For the first time ever, SharePoint developers aren’t limited to using Visual Studio on Windows. Using tools familiar to any web developer, on any stack, they can build rich solutions that seamlessly integrate with the new SharePoint user experience.

More capabilities but not at the price of compliancy

SharePoint is a powerful platform widely adopted for its customization capabilities, sometimes even beyond what’s reasonable and supported. As many organizations struggled with successfully using SharePoint and benefitting of its flexibility, we built SPCAF – quality assessment solution for verifying that SharePoint customizations adhere to organizational quality standards. Using our extensive experience of the SharePoint platform we defined a set of rules that organizations can extend if necessary to define a complete set of policies that express their SharePoint quality bar. As SPCAF integrates with the complete lifecycle of SharePoint customizations: from a single developer workstation to centralized build and release systems, adhering to these rules is no afterthought and doesn’t come at the price of developer productivity.

Organizational rules for modern customizations

The SharePoint Framework announced by Microsoft allows developers to use modern web development tools. One of them is Gulp – a Node.js-based task runner. Gulp can be in a way compared to MSBuild and is often used for implementing build automation. SharePoint Framework projects use Gulp tasks to build and package solutions for release.

We extended SPCAF so that you can integrate it with Gulp. Here is how you can use SPCAF with Gulp:

We start SPCAF analysis by executing the Gulp SPCAF task in the command line:

While the analysis is running any issues discovered in the project are reported directly to the command line.

Issues in a SharePoint Framework project discovered using SPCAF analysis in Gulp

Using the information reported for the particular issue, you can navigate to the specific location causing the issue.

Fixing the error reported by SPCAF in the source code

By rerunning the SPCAF analysis we can confirm that all issues have been fixed and that the SharePoint Framework solution is ready to be released.

SPCAF analysis in Gulp confirming that there are no issues in the SharePoint Framework project

Using our native Gulp task you can easily analyze your SharePoint Framework projects. The same task could be chained with the standard SharePoint Framework build tasks so that you can automatically have your projects analyzed during the build process. This allows you to automate the SPCAF analysis both on developer workstations and build servers.

Optionally, SPCAF analysis can generate for you a quality report. That report can be then used as a proof of the quality of the SharePoint Framework project and can be handed over to your customer or the business owner in your organization. Many quality managers and security officers appreciate find SPCAF reports an invaluable insight while approving the release of the particular customization.

Although SharePoint developers can use the SharePoint Framework on any platform, currently SPCAF is available only on Windows. We are however investigating opportunities of supporting SPCAF on other platforms and if you are interested in that we would appreciate your feedback.

Stay tuned as we announce more of our investments that will help your organization benefit of the modern SharePoint user experience and its customization capabilities. You can expect these SPCAF features to be available when Microsoft releases the SharePoint Framework.

Merken

Waldek Mastykarz

Waldek is a Microsoft Office Development MVP and Head of Product at Rencore. He reinforces our product development adding loads of business experience from working as a SharePoint consultant for more than 10 years. Waldek is passionate about what he does and shares his enthusiasm through his blog and as a regular speaker at conferences and community events all over Europe. Recently, Waldek joined the SharePoint Patterns and Practices (PnP) Core Team to help developers make better use of the SharePoint and Office 365 platforms.