npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

cordova-version-control

v1.2.4

Published

Control the versions in your config.xml of your cordova projects

Downloads

229

Readme

NPM

This will write the version and build number to your Cordova projects config.xml file Version numbers will follow the Semantic Versioning system (https://semver.org/) which would already be used in the project.json file The build number will use the semver system as a 6 digit version such as 42069 to designate the major.minor.patch version 4.20.69 you can set your own version and build numbers using the -v for version and -b for build

Features

  • Writes version and buildNumber to Cordova config.xml
  • Can read version from local package.json
  • Only update android or ios build number if you wish (from an app review rejection)
  • Can work on Cordova Plugin projects
  • Replaces {{cdvverctrl}} with version in config.xml when the -e option is enabled. See Extra option below.
  • Use a template to ready from and save in the base of the project directory to make the use of the -e option more automated.
  • Has CLI

Install

$ npm install cordova-version-control

Usage

const cdvVerCrtl = require('cordova-version-control');

cdvVerCrtl(); // reads version from package.json
cdvVerCrtl('4.20.69');
cdvVerCrtl('./plugin.xml', '4.20.69');
cdvVerCrtl('./path/to/plugin.alt.xml', 69);
cdvVerCrtl('./path/to/config.alt.xml', '4.20.69', 69)
    .catch(error => { ... });

API

cdvVerCrtl([configPath], [version], [buildNumber], [android], [ios], [extra], [template], [plugin]): Promise

  • configPath (string) - path to your config.xml or plugin.xml
  • version (string) - version to be written
  • buildNumber (number) - build number to be written
  • android (bool) - sets if you only want to write android build number, ignored for plugins
  • ios (bool) - sets if you only want to write android build number, ignored for plugins
  • extra (bool) - enables the extra version locations in config.xml
  • template (string) - path to a template config.xml file or plugin.xml file.
  • plugin (bool) - designate that this is a cordova plugin project and saves to a plugin.xml file

Important notes: You can not have android and ios both as true. Only use one at a time or set both to false to write both android and ios build numbers.

CLI

cdvversioncrtl [-v|--version <version>] [-b|--build-number <build-number>] [-a|--android-only] [-i|--ios-only] [-e|--extra] [-t|--template] [-p|--plugin] [config.xml]

Options:

  • -v/--version - version to set
  • -b/--build-number - build number to set
  • -a/--androidOnly - only set android build number, ignored for plugins
  • -i/--iosOnly - only set ios build number, ignored for plugins
  • -e/--extra - enables the extra version locations in config.xml
  • -t/--template - path to the template config.xml file
  • -p/--plugin - designate that this is a cordova plugin project and saves to a plugin.xml file
  • --help - display help

Important notes: You can not use -a and -i options at the same time. Only use one at a time or don't include them to write both android and ios build numbers.

Extra option

To use the extra you will need to add {{cdvverctrl}} where you want to add the verion to in the config.xml. For example, if you have a version of 4.20.69.

<description>
    Some meme cordova app {{cdvverctrl}}!!
</description>

will become

<description>
    Some meme cordova app 4.20.69!!
</description>

Use with Standard Version

if you want this to use the version when you run standard-version. You can have this run during the life cycle after the version bump. To do you you will need to add the following to your package.json. you can edit it as you see fit but you will need to commit the new changes to the config.xml file.

"scripts": {
    "release": "standard-version"
  },
"standard-version": {
    "scripts": {
      "postbump": "verctrl -e && git add -A && git commit -a -m \"chore(cordova-version): bumped config.xml versions\""
    }
  }

Running npm run release will use standard-version to bump the version in the package.json file. It then calls verctrl to have it take that version and add it to the config.xml file. Which will then add the changes and then commit the changes.

Examples

$ cdvversioncrtl -v 2.4.9 -p plugin.xml
$ cdvversioncrtl -b 86
$ cdvverctrl -v 2.4.9 -b 86
$ cdvverctrl (gets version from project package.json)
$ verctrl -t config.xml.src -e