Skip to content

A plop helper that provides a setup for Azure NPM NPMRC files

Notifications You must be signed in to change notification settings

crutchcorn/plop-pack-azure-npm

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Plop Pack Azure NPM

npm

Useful to have action for PlopJS. This action helps users setup their Azure DevOps NPMRC file

Installation

npm i plop-pack-azure-npm

Config

{
    projectName: 'PROJ_NAME',
    registryUrl: 'pkgs.dev.azure.com/PROJ_NAME/project-uuid-999-999/_packaging/package-name/npm'
}

Your registryUrl must not contain a tailing / nor the registry/ postfix or https:// prefix

There's also an optional property you can pass to config: progressSpinner. It's required to use this property when using plop instead of node-plop, as otherwise the spinner will cause problems with the input.

const {progressSpinner} = require('plop');

const azureConfig = {
    projectName: '',
    registryUrl: '',
    progressSpinner
}

Example

module.exports = function(plop) {
  // Loads the npmInstall action type
  plop.load('plop-pack-azure-npm');

  plop.setGenerator('generate', {
    prompts: [
        // ...
    ],
    actions: function(data) {
      const actions = [];

      actions.push({
        type: 'npmInstall',
        path: `${process.cwd()}/project-name/`,
        // By default is false, but if "true" will log the output of commands
        verbose: true
      })
    }
  })
}

About

A plop helper that provides a setup for Azure NPM NPMRC files

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published