gligoran / cordova-set-version Goto Github PK
View Code? Open in Web Editor NEWCLI and JavaScript API for setting the version in Apache Cordova config.xml
License: ISC License
CLI and JavaScript API for setting the version in Apache Cordova config.xml
License: ISC License
Using your example in the readme, I get TypeError: cordovaSetVersion is not a function.
This is because your module exposes its method using:
exports.default = cordovaSetVersion;
Whereas it should be:
module.exports = cordovaSetVersion;
cordovaSetVersion.default();
works fine.
Write a version string to config.xml.
I have installed it within my cordova/angular project but I'm getting
[ng] ERROR in ./node_modules/cordova-set-version/dist/index.js
[ng] Module not found: Error: Can't resolve 'fs' in 'C:\App\node_modules\cordova-set-version\dist'
when I add const cordovaSetVersion = require('cordova-set-version');
If callback is not given, return as a promise.
Hi, please can you update the docs to show an example of using the package.json version number?
hey @gligoran,
as far as I can tell, Cordova's CLI tools always resets the config.xml
file to use 4-space indentation, whereas your cordova-set-version
tool changes this to 2-space indentation.
would you be open to changing this project to cater for this? I have made this change in my fork and used it successfully with my own projects.
with that said, I would consider changing this hard-coded indentation size a pretty severe breaking change... so if you can think of a good reason to support both, I have no issue extending the cli.js
arguments to cater for this.
perhaps something along the lines of the following; where the default behaviour remains exactly as-is, but the user has the option of specifying the number of spaces to indent by.
Usage
$ cordova-set-version [-v|--version <version>] [-b|--build-number <build-number>] [-i|--indent-size <indent-size> [config.xml]
Options
-v, --version Version to set
-b, --build-number Build number to set
-i, --indent-size Number of spaces to indent by (default `2`)
Examples
$ cordova-set-version -v 2.4.9
$ cordova-set-version -b 86
$ cordova-set-version -v 2.4.9 -b 86
$ cordova-set-version -v 2.4.9 -i 4
fair warning: this could potentially open up a big can of indentation-worms, including the completely illogical desire to indent with tabs
instead.. also, with making it configurable, the tests would need to be changed in a different way to those seen in my fork.
anyways, what are your thoughts on all this?
master
branch failed. π¨I recommend you give this issue a high priority, so other packages depending on you could benefit from your bug fixes and new features.
You can find below the list of errors reported by semantic-release. Each one of them has to be resolved in order to automatically publish your package. Iβm sure you can resolve this πͺ.
Errors are usually caused by a misconfiguration or an authentication problem. With each error reported below you will find explanation and guidance to help you to resolve it.
Once all the errors are resolved, semantic-release will release your package the next time you push a commit to the master
branch. You can also manually restart the failed CI job that runs semantic-release.
If you are not sure how to resolve this, here is some links that can help you:
If those donβt help, or if this issue is reporting something you think isnβt right, you can always ask the humans behind semantic-release.
The npm token configured in the NPM_TOKEN
environment variable must be a valid token allowing to publish to the registry https://registry.npmjs.org/
.
If you are using Two-Factor Authentication, make configure the auth-only
level is supported. semantic-release cannot publish with the default auth-and-writes
level.
Please make sure to set the NPM_TOKEN
environment variable in your CI with the exact value of the npm token.
Good luck with your project β¨
Your semantic-release bot π¦π
13.1.0
to 13.2.0
.π¨ View failing branch.
This version is covered by your current version range and after updating it in your project the build failed.
nyc is a devDependency of this project. It might not break your production code or affect downstream projects, but probably breaks your build or test tools, which may prevent deploying or publishing.
The new version differs by 17 commits.
29e6f5e
chore(release): 13.2.0
e95856c
chore: Update dependencies. (#978)
921d386
fix: Create directory for merge destination. (#979)
df2730d
feat: Option Plugins (#948)
35cd49a
feat: document the fact that cacheDir is configurable (#968)
ff834aa
feat: avoid hardcoded HOME for spawn-wrap working dir (#957)
35710b1
build: move windows tests to travis (#961)
93cb5c1
tests: coverage for temp-dir changes (#964)
d566efe
test: stop using LAZY_LOAD_COUNT (#960)
f23d474
chore: update stale bot config with feedback (#958)
62d7fb8
chore: slight tweak to position of test
28b6d09
fix: missing command temp-directory (#928)
40afc5f
fix: nyc processing files not covered by include when all
is enabled. (#914)
ba22a26
docs(readme): Update to reflect .nycrc.json support (#934)
2dbb82d
chore: enable probot-stale
There are 17 commits in total.
See the full diff
There is a collection of frequently asked questions. If those donβt help, you can always ask the humans behind Greenkeeper.
Your Greenkeeper Bot π΄
The install fails with node v9.1.0 with npm ERR! Cannot read property '0' of undefined
This project will use TDD, so add the frameworks and do the setup for this to be easy to use.
1.3.0
to 1.3.1
.π¨ View failing branch.
This version is covered by your current version range and after updating it in your project the build failed.
husky is a devDependency of this project. It might not break your production code or affect downstream projects, but probably breaks your build or test tools, which may prevent deploying or publishing.
The new version differs by 6 commits.
566699c
1.3.1
45252e0
Update CHANGELOG.md
88bfce4
Update DOCS.md
942df81
Disable enable stdin if terminal
0f038a5
Update CHANGELOG.md
35b6b0d
Upgrade is-ci dependency (#427)
See the full diff
There is a collection of frequently asked questions. If those donβt help, you can always ask the humans behind Greenkeeper.
Your Greenkeeper Bot π΄
There is an error with this repository's Renovate configuration that needs to be fixed. As a precaution, Renovate will stop PRs until it is resolved.
Error type: undefined. Note: this is a nested preset so please contact the preset author if you are unable to fix it yourself.
From the CLI (I did not test other means), a build number with multiple decimal points will not update the config.xml.
Working Example:
cordova-set-version -v 1.0.2 -b 7.7
Results: ios-CFBundleVersion="7.7" version="1.0.2" android-versionCode="7.7" osx-CFBundleVersion="7.7"
Failing Example:
cordova-set-version -v 1.0.2 -b 7.7.7
Results: No update to the config.xml. No Error/Warning. No indication that something has gone wrong.
Expected: I'd like it to just update the build version # with my version, or at the very least the cli should provide an error.
Note: The ios app store will accept a 7.7.7 as a valid build #. I don't know if the android-versionCode with decimals is valid.
First of all, great package, thanks, very useful. I have this as dependency in all my Cordova projects.
Though I realised I needed to insert the version number in more places in config.xml
What do you think of an extra option of simply replacing the string {{cordova-set-version}}
by the version?
The script would read the config.xml in plain text and just replace.
Use http://shields.io/ and add:
master
branch failed. π¨I recommend you give this issue a high priority, so other packages depending on you could benefit from your bug fixes and new features.
You can find below the list of errors reported by semantic-release. Each one of them has to be resolved in order to automatically publish your package. Iβm sure you can resolve this πͺ.
Errors are usually caused by a misconfiguration or an authentication problem. With each error reported below you will find explanation and guidance to help you to resolve it.
Once all the errors are resolved, semantic-release will release your package the next time you push a commit the master
branch. You can also manually restart the failed CI job that runs semantic-release.
If you are not sure how to resolve this, here is some links that can help you:
If those donβt help, or if this issue is reporting something you think isnβt right, you can always ask the humans behind semantic-release.
semantic-release cannot push the version tag to the branch master
on remote Git repository.
Please refer to the authentication configuration documentation to configure the Git credentials on your CI environment.
Good luck with your project β¨
Your semantic-release bot π¦π
2.6.2
to 2.6.3
.π¨ View failing branch.
This version is covered by your current version range and after updating it in your project the build failed.
rimraf is a devDependency of this project. It might not break your production code or affect downstream projects, but probably breaks your build or test tools, which may prevent deploying or publishing.
The new version differs by 6 commits.
9442819
2.6.3
42fe369
autopublish scripts
21fd3df
bin test
8f1d3a1
update tap and glob for security stuff
f0bc3a1
update tap, add package-lock
692022b
travis node version updates
See the full diff
There is a collection of frequently asked questions. If those donβt help, you can always ask the humans behind Greenkeeper.
Your Greenkeeper Bot π΄
This issue lists Renovate updates and detected dependencies. Read the Dependency Dashboard docs to learn more.
These updates have all been created already. Click a checkbox below to force a retry/rebase of any.
.github/workflows/node.yml
actions/checkout v4
actions/setup-node v4
actions/cache v3
codecov/codecov-action v3
actions/checkout v4
actions/setup-node v4
actions/cache v3
package.json
meow ^12.0.0
read-pkg ^8.0.0
xml2js ^0.6.0
cz-conventional-changelog 3.3.0
fs-extra 11.2.0
husky 9.0.11
jest 29.7.0
jest-extended 4.0.2
npm-check 6.0.1
semantic-release 22.0.12
xo 0.56.0
node 20.13.1
npm 10.8.0
1.1.2
to 1.1.3
.π¨ View failing branch.
This version is covered by your current version range and after updating it in your project the build failed.
husky is a devDependency of this project. It might not break your production code or affect downstream projects, but probably breaks your build or test tools, which may prevent deploying or publishing.
The new version differs by 8 commits.
30619a3
1.1.3
96a73fc
Update dependencies
5c8d938
Don't fail if package.json doesn't exist
b94ac5c
Update README.md
f1a0457
Update README.md
4aa6487
Update README.md
6fd89e8
Update DOCS.md
4924a42
Update dependencies
See the full diff
There is a collection of frequently asked questions. If those donβt help, you can always ask the humans behind Greenkeeper.
Your Greenkeeper Bot π΄
7.0.0
to 7.0.1
.π¨ View failing branch.
This version is covered by your current version range and after updating it in your project the build failed.
fs-extra is a devDependency of this project. It might not break your production code or affect downstream projects, but probably breaks your build or test tools, which may prevent deploying or publishing.
The new version differs by 7 commits.
a32c852
7.0.1
6392917
Temporarily disable standard-markdown
ddc1a2f
Fix removeSync() to eliminate spurious ENOTEMPTY errors on Windows (#646)
ab254b1
Added docs/ and CHANGELOG.md to .npmignore (#642) (#643)
287f234
Fix typo in docs (#628)
402c1d0
Show support for mode (#587)
4da17fe
Chore: github issue template (#617)
See the full diff
There is a collection of frequently asked questions. If those donβt help, you can always ask the humans behind Greenkeeper.
Your Greenkeeper Bot π΄
Enable writing the version to config.xml via a CLI command.
3.0.4
to 3.0.5
.π¨ View failing branch.
This version is covered by your current version range and after updating it in your project the build failed.
commitizen is a devDependency of this project. It might not break your production code or affect downstream projects, but probably breaks your build or test tools, which may prevent deploying or publishing.
The new version differs by 1 commits.
0eded0a
fix(package): avoid depending on flatmap-stream (#591)
See the full diff
There is a collection of frequently asked questions. If those donβt help, you can always ask the humans behind Greenkeeper.
Your Greenkeeper Bot π΄
E.g.:
$ cordova create test
Creating a new cordova project.
$ cd test
$ sed -i 's|<content src="index.html" />|<content src="index.html" /> <!-- my very important comment -->|' config.xml
$ npx cordova-set-version -v 1.2.3 config.xml
$ cat config.xml | grep important
<no output>
Less bad, but still annoying, is that all whitespace (e.g. line breaks to group related sections in the file) is ignored, and the file is reformatted according to some beauty ideal.
I really like how npm version patch
/ yarn version --patch
works. It will auto-increment 1.1.18
to 1.1.19
for example
It follows semver and these are just some of the methods it supports:
--new-version [version] new version
--major auto-increment major version number
--minor auto-increment minor version number
--patch auto-increment patch version number
--premajor auto-increment premajor version number
--preminor auto-increment preminor version number
--prepatch auto-increment prepatch version number
--prerelease auto-increment prerelease version number
It would be lovely if this package could integrate this kind of functionality.
I am most interested in just being able to auto-increment the patch number
Many thanks
The library should use the version from package.json as the default value to be written to config.xml if no version is passed in.
Reference: https://cordova.apache.org/docs/en/latest/config_ref/#widget
Set these fields:
android-versionCode
: An integer used as an internal version number. This number is used only to determine whether one version is more recent than another, with higher numbers indicating more recent versions.ios-CFBundleVersion
/osx-CFBundleVersion
: CFBundleVersion
(String
- iOS, macOS) specifies the build version number of the bundle, which identifies an iteration (released or unreleased) of the bundle.15.13.1
to 15.13.2
.π¨ View failing branch.
This version is covered by your current version range and after updating it in your project the build failed.
semantic-release is a devDependency of this project. It might not break your production code or affect downstream projects, but probably breaks your build or test tools, which may prevent deploying or publishing.
The new version differs by 1 commits.
1aefd98
fix(package): update aggregate-error to version 2.0.0
See the full diff
There is a collection of frequently asked questions. If those donβt help, you can always ask the humans behind Greenkeeper.
Your Greenkeeper Bot π΄
Would be nice to have a flag or individual options to not add the build number for specific operating systems to config.xml. For example, I currently don't use the android-versionCode, or osx-CFBundleVersion, I only use the ios-CFBundleVersion. I want android to use the version to construct the versionCode, instead of specifying it myself.
When I run the CLI, the android and osx versions are added in, but I don't want them added.
My original widget line:
<widget id="myapp" ios-CFBundleVersion="100" version="1.0.0" xmlns="http://www.w3.org/ns/widgets" xmlns:cdv="http://cordova.apache.org/ns/1.0">
CLI call:
cordova-set-version -v 1.0.2 -b 102
Resulting widget line:
<widget id="myapp" ios-CFBundleVersion="102" version="1.0.2" xmlns="http://www.w3.org/ns/widgets" xmlns:cdv="http://cordova.apache.org/ns/1.0" android-versionCode="102" osx-CFBundleVersion="102">
A declarative, efficient, and flexible JavaScript library for building user interfaces.
π Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. πππ
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google β€οΈ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.