Skip to content

JosepBergay/standard-version-updater-xml

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

21 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

standard-version-updater-xml

An XML updater for standard-version. All the parsing and writing is done by xmlbuilder2. Huge props to them 🎉, support these projects in any way you can!

Install

npm install --save-dev standard-version-updater-xml

Usage

You can use it as any other standard-version custom updater. In your config file:

JS Config

// .versionrc.js
const xmlUpdater = require('standard-version-updater-xml');

const xmlTracker = {
  filename: 'PATH_TO_MY_XML_FILE',
  updater: xmlUpdater,
};

// you can also pass write options to xmlUpdater
const prettyTracker = {
  filename: 'PATH_TO_MY_XML_FILE',
  updater: xmlUpdater({ prettyPrint: true, headless: true }),
};


module.exports = {
  packageFiles: [prettyTracker],
  bumpFiles: [prettyTracker],
};

JSON Config

{
  "packageFiles": [
    {
      "filename": "PATH_TO_MY_XML_FILE",
      "updater": "node_modules/standard-version-updater-xml/index.js"
    }
  ],
  "bumpFiles": [
    {
      "filename": "PATH_TO_MY_XML_FILE",
      "updater": "node_modules/standard-version-updater-xml/index.js"
    }
  ]
}

Then, use standard-version in your preferred flavour. Mine:

npx standard-version

Notes

  • You can use any file parseable by xmlbuilder2, even .csproj files!
  • Empty lines will be removed when writing version.
  • An xml declaration will be added on top the file if it's not already present. To avoid this, pass headless: true to xmlUpdater, see example above.

About

An XML updater for standard-version.

Resources

License

Stars

Watchers

Forks

Packages

No packages published