Development - Puzzlepart/prosjektportalen GitHub Wiki

Development

Build

This project is built using npm and gulp. Before you start make sure you have the latest version of npm. This project has been tested with npm 3.10.10 and newer. The quickest way to install or update npm is to install node.js

In order to build the project, you need to have gulp globally available.

You can install gulp globally with npm

npm install gulp -g

Once nodejs is installed, open a command prompt in the directory where you have cloned this project, e.g. c:\code\prosjektportalen and execute the following

npm install

Now you need to create your own @env.js in the folder .tasks. Use the @env.sample.js as a base. This file is used with the gulp watch task in conjuction with Live Reload. You can leave the values in this file blank.

Once this has completed, execute the following to build the project (using the default task)

npm run release 

The resulting build can be found under /dist, and a packaged zip under /release.

Watch

npm run watch will start listening to changes to .ts files.

Create a @watch.json in the tasks folder. The pageUrl specified here will be opened when running the watch script. See @watch.sample.json.

'use strict';
{
   "pageUrl": ""
}

Potential issues

If you haven´t upgraded the project portal installation for a while, you might have to update the Custom Actions.

Connect-PnPOnline {url}
Apply-PnPProvisioningTemplate ./templates/root/root.xml -Handlers CustomActions

Create a new release

NB: Make sure you're on the master branch and that dev has been merged through PR

  1. Update version

Update minor version (e.g. 1.x.0)

npm version minor

Update patch version (e.g. 1.0.x)

npm version patch

npm run release will be run automatically after a npm version update through the NPM script postversion.

  1. Run git push --tags to update the new tags/versions on the remote.
  2. Create a new release
  3. Pick the right tag version (the version you just published to remote)

Development-01.PNG

  1. In Release title write the same as the version/tag name without the v (see image above)
  2. Add a description of what's been changed in this release (see other releases for inspiration)
  3. Under releases in your Project Portal folder, find the .zip file for your version and drop it to the area under Describe this release
  4. Publish release!