Yes, that makes sense. What I meant was the opposite: When specifying a range, it should not be fulfilled with a suffixed version.

On 2018-09-13 16:20, Chris Brody wrote:
If I would try the following command in master branch of
cordova-common (just an experiment):

     npm install cordova-common@^3.0.0-nightly

I would see the following change in package.json:

    "dependencies": {
-    "cordova-common": "^2.2.0",
+    "cordova-common": "^3.0.0-nightly.2018.9.13.9c6cda3d",

Next experiment (again just an experiment): remove generated
node_modules and package-lock.json artifacts (package-lock.json is not
yet committed in cordova-common and update package.json as follows:

diff --git a/package.json b/package.json
index 9f3bdc23..e488c149 100644
--- a/package.json
+++ b/package.json
@@ -19,3 +19,3 @@
    "dependencies": {
-    "cordova-common": "^2.2.0",
+    "cordova-common": "^3.0.0-nightly",
      "cordova-create": "^1.1.0",

then after npm install I get the following result from grep version
node_modules/cordova-common/package.json:

   "version": "3.0.0-nightly.2018.9.13.9c6cda3d"

One more experiment: if I would try the following change to package.json:

diff --git a/package.json b/package.json
index 9f3bdc23..01c549dc 100644
--- a/package.json
+++ b/package.json
@@ -19,3 +19,3 @@
    "dependencies": {
-    "cordova-common": "^2.2.0",
+    "cordova-common": "^2.2.1-nightly",
      "cordova-create": "^1.1.0",

then do clean npm install (node_modules and package-lock.json
artifacts removed) I get the following result from grep version
node_modules/cordova-common/package.json:

   "version": "2.2.5"

These results indicate to me that depending on "-rc" version with
caret (^) should do what we want: use latest "-rc" version available
until we publish the major release, and then use the major release.

FYI this seems to be documented in
https://github.com/npm/node-semver#prerelease-tags which is linked by
https://semver.npmjs.com/.



---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscr...@cordova.apache.org
For additional commands, e-mail: dev-h...@cordova.apache.org

Reply via email to