SharePoint Framework Generator Updated to v1.0.2

This page was originally published here ▶️ SharePoint Framework Generator Updated to v1.0.2 .

Did you know the SharePoint team at Microsoft updated the Yeoman generator, @microsoft/generator-sharepoint , twice in the last month? Yeah… I didn’t either until yesterday.

The final version was released on February 23, 2017, as version 1.0.0. They then slipped two more updates in early April in quick succession as versions 1.0.1 & 1.0.2. Unfortunately, Microsoft still hasn’t published the repo for the generator or made the homepage for it in the NPMJS registry of any use… just some boilerplate copy… so it’s not easy to figure out what’s changed.

I’ll first explain what changed in each version, then I’ll share how I figured it out so you can do the same in the future.

What Changed in version 1.0.1

Version 1.0.1, published on April 3, 2017, made one small change. It updated the devDependency in the generated package.json to include version 1.0.1 of the @microsoft/sp-build-web package.

What Changed in version 1.0.2

Version 1.0.2, published on April 5, 2017, applied an even smaller change than what we saw in version 1.0.1. It simply removed the TSLINT rule prefer-const from the generated tslint.json that requires variable definitions use the const keyword instead of let or var when possible. For instance, if you set a variable and never intend to change it, you should use const.

This is a good rule to have in your TSLINT settings, but someone convinced Microsoft to not only remove it but ship an update to the package to reflect it. Oh well…

How To Figure Out The Change History

When Microsoft isn’t sharing the repo or providing a useful homepage for the generator (and related packages for that matter), how are you supposed to figure out what changed in new versions?

First, you have to know there’s a new version!

Determine if there are Updated Packages

You first have to figure out if there is a new version available. Use npm’s outdated command to do this. Make sure you include the global flag since this is a global package:

npm outdated --global

If an installed package has a newer version listed, it will be listed. There are three columns listed:

  • Current: the version you currently have installed
  • Wanted: the max version of the package that satisfies the semver range specified
  • Latest: the version of the package tagged as latest in the npm registry

To update the package, simply reinstall it. So in the case of the SharePoint Framework generator:

npm i @microsoft/generator-sharepoint -g

What’s in the New Version?

Now, how do you see the changelog? You can first see a list of the published version history from npm. Do that using the npm info command:

npm info @microsoft/generator-sharepoint --json

That will output a JSON string… notice the time listing:

{ "name": "@microsoft/generator-sharepoint",
  "dist-tags": { "latest": "1.0.2" },
  "versions":
   [ "0.0.65",
     "0.1.0",
     "0.1.1",
     "0.1.2",
     "0.2.0",
     "0.2.1",
     "0.3.2",
     "0.4.1",
     "1.0.0",
     "1.0.1",
     "1.0.2" ],
  "maintainers": [ "microsoft <npmjs@microsoft.com>" ],
  "time":
   { "modified": "2017-04-20T21:07:18.275Z",
     "created": "2016-08-15T18:28:38.279Z",
     "0.0.0": "2016-08-15T18:28:38.279Z",
     "0.0.58": "2016-08-15T21:03:40.877Z",
     "0.0.59": "2016-08-16T05:24:54.365Z",
     "0.0.60": "2016-08-16T22:20:22.953Z",
     "0.0.61": "2016-08-17T02:52:19.173Z",
     "0.0.62": "2016-08-17T05:17:29.301Z",
     "0.0.63": "2016-08-17T09:05:37.143Z",
     "0.0.64": "2016-08-17T09:56:43.866Z",
     "0.0.65": "2016-08-17T18:39:19.263Z",
     "0.1.0": "2016-09-02T06:32:46.880Z",
     "0.1.1": "2016-09-14T06:40:20.692Z",
     "0.1.2": "2016-09-14T18:07:13.719Z",
     "0.2.0": "2016-09-21T02:12:33.958Z",
     "0.2.1": "2016-10-15T00:57:29.717Z",
     "0.3.0": "2016-11-21T21:45:16.659Z",
     "0.3.1": "2016-11-22T02:39:56.150Z",
     "0.3.2": "2016-11-22T03:28:50.511Z",
     "0.4.0": "2016-12-13T18:33:18.162Z",
     "0.4.1": "2017-01-09T19:21:33.906Z",
     "1.0.0": "2017-02-23T21:36:10.577Z",
     "1.0.1": "2017-04-03T22:52:50.962Z",
     "1.0.2": "2017-04-05T01:05:53.569Z" },
  "keywords": [ "yeoman-generator" ],
  "license": "SEE LICENSE IN EULA FOLDER",
  "readmeFilename": "README.md",
  "description": "Yeoman generator for the SharePoint Framework",
  "users": { "waldekm": true, "echfjosef": true, "artokai": true },
  "homepage": "http://aka.ms/spfx",
  "version": "1.0.2",
  "scripts":
   { "scenario-test": "mocha tests/scenario",
     "build": "gulp",
     "test": "gulp test",
     "clean": "gulp clean" },
  "dependencies":
   { "@microsoft/sp-core-library": "~1.0.0",
     "argparse": "~1.0.7",
     "chalk": "~1.1.1",
     "lodash": "~4.15.0",
     "tar-fs": "~1.2.0",
     "update-notifier": "~1.0.2",
     "yeoman-generator": "~1.0.1",
     "yosay": "~1.1.1" },
  "devDependencies":
   { "@types/chalk": "0.4.31",
     "@types/es6-promise": "0.0.32",
     "@types/lodash": "4.14.52",
     "@types/update-notifier": "1.0.0",
     "@types/yeoman-generator": "1.0.0",
     "@types/yosay": "0.0.28",
     "@microsoft/sp-build-node": "~1.0.0",
     "gulp": "~3.9.1",
     "mocha": "~2.5.3",
     "yeoman-assert": "~2.2.1",
     "yeoman-test": "~1.4.0" },
  "dist":
   { "shasum": "254191b36492b3a4f7b514251a0e097a67aa105e",
     "tarball": "https://registry.npmjs.org/@microsoft/generator-sharepoint/-/generator-sharepoint-1.0.2.tgz" },
  "directories": {} }

That is how I figured out the date of the versions.

But how do you figure out what’s in those new versions? That’s where I had to hope that the engineers at Microsoft were keeping a changelog, which they thankfully did. This is usually found in the root of the project.

First, you have to find the location of the installed global module. Find the location where all your global modules are installed. If you run npm with no arguments, the last night will tell you where it is.

Because I use NVM (I recently blogged about the merits of NVM if you want to learn more, my path on MacOS is: ~/.nvm/versions/node/v7.7.3/lib/node_modules. Within that folder, there’s a @microsoft subfolder, and within that, I find the generator, and within that folder, I’ll find the changelog.

Open the changelog, in this case CHANGELOG.md, and inspect the entries the team has added. In this case, they listed both versions with a mention of what each included:

  • 1.0.1: Updating the dependent version of sp-build-web to ensure office-ui-fabric-react can be bundled correctly.
  • 1.0.2: Disabled prefer-const rule
Andrew Connell
Developer & Chief Course Artisan, Voitanos LLC. | Microsoft MVP
Written by Andrew Connell

Andrew Connell is a web & cloud developer with a focus on Microsoft Azure & Microsoft 365. He’s received Microsoft’s MVP award every year since 2005 and has helped thousands of developers through the various courses he’s authored & taught. Andrew’s the founder of Voitanos and is dedicated to helping you be the best Microsoft 365 web & cloud developer. He lives with his wife & two kids in Florida.

Share & Comment