White this Angular Utils you can:
To install this CLI run in a terminal:
(if you have a link to the Vipera NPM repository):
npm install -g angular-utils-cli
(directly from Github repository):
npm install -g git+https://git@github.com/github-vipera/angular-utils-cli.git
Assuming you are into the project root folder:
ngutils getVersion
Example:
mrbook:wa-motif-open-api-module developer$ ngutils getVersion
1.2.3
Simulating version increment with Semantic Versioning
ngutils getVersion --semver patch
Example:
mrbook:wa-motif-open-api-module developer$ ngutils getVersion --semver patch
1.2.4
To update your project version you can:
You can apply the new version only to the root (main) project or to all subprojects with the --all option.
ngutils updateVersion --v '1.0.1'
Update all projects including subprojects:
ngutils updateVersion --v '1.0.1' -a
ngutils updateVersion --semver patch -a
ngutils updateVersion --v 'my-very-custom-ver' --force -a
With the build command you can build the main project or all projects, alsi in '--prod' mode (Angular --prod switch).
ngutils build
or for a production build:
ngutils build --prod
or to build all projects and subprojects:
ngutils build -a
or for the production mode:
ngutils build --prod -a
White the semver option you can tell to auto-increment a version for the 'patch', 'minor' or 'major' part. For example, assuming you have the current version of the project set to '1.0.3', if you run the command getVersion you get:
mrbook:wa-motif-open-api-module developer$ ngutils getVersion
1.0.3
mrbook:wa-motif-open-api-module developer$
Then you can get the incremeneted version with the semver option:
mrbook:wa-motif-open-api-module developer$ ngutils getVersion --semver patch
1.0.4
mrbook:wa-motif-open-api-module developer$ ngutils getVersion --semver minor
1.1.0
mrbook:wa-motif-open-api-module developer$ ngutils getVersion --semver major
2.0.0
To automatically create module packages you can use the pack command.
ngutils pack -a
With this command creates a folder named package_dist with all packages.
You can also specify an alternative folder with the dist option:
ngutils pack -a --dist ./my_packages