Nikky
06/05/2021, 5:55 PM^1.20
instead of 1.2.0
because without ^
it would pin it and transitive dependencies cannot raise it ?
is there any case where you would want to have a npm version without ^
prefixed ?
context: working on adding support for npm to #gradle-refresh-versionsBig Chungus
06/05/2021, 6:49 PMBig Chungus
06/05/2021, 6:50 PMNikky
06/05/2021, 6:59 PMNikky
06/05/2021, 7:00 PMversions.properties
?
such a thing would be a good thing to but in the readme or docsRobert Jaros
06/05/2021, 7:00 PM^
doesn't really "pin" the version of the library - it often puts two versions of the same library in the bundle fileRobert Jaros
06/05/2021, 7:01 PMbuild/js/yarn.lock
file with all info about resolved versionsNikky
06/05/2021, 7:02 PMRobert Jaros
06/05/2021, 7:02 PMRobert Jaros
06/05/2021, 7:03 PMNikky
06/05/2021, 7:05 PM^
when there is no other version range specified be sensible ?Robert Jaros
06/05/2021, 7:05 PMnode_modules
folders (local to some libraries - so we could have build/js/node_modules/somelib/node_modules/someconflictinglib
Robert Jaros
06/05/2021, 7:07 PM^
because from my experience there is less chance of a problem if some lib will be forced to use a higher version of other library, than if there are multiple versions in one bundle (it gives very hard to track errors)Nikky
06/05/2021, 7:09 PMloader-utils@^1.2.3, loader-utils@^1.4.0:
and
loader-utils@^2.0.0:
which have a different json5
dependencyRobert Jaros
06/05/2021, 7:09 PM^
will work only with the same major releases - you can still have two versions with different major number.Nikky
06/05/2021, 7:10 PMBig Chungus
06/05/2021, 7:10 PMNikky
06/05/2021, 7:11 PMBig Chungus
06/05/2021, 7:11 PMBig Chungus
06/05/2021, 7:12 PMNikky
06/05/2021, 7:14 PMnpm("...")
Nikky
06/05/2021, 7:14 PMRobert Jaros
06/05/2021, 7:14 PM^
Big Chungus
06/05/2021, 7:14 PMNikky
06/05/2021, 7:16 PMBig Chungus
06/05/2021, 7:16 PMBig Chungus
06/05/2021, 7:16 PMBig Chungus
06/05/2021, 7:17 PMBig Chungus
06/05/2021, 7:17 PMBig Chungus
06/05/2021, 7:18 PMNikky
06/05/2021, 7:18 PM^
prefixing itBig Chungus
06/05/2021, 7:19 PMBig Chungus
06/05/2021, 7:19 PMRobert Jaros
06/05/2021, 7:20 PM^
(where he has control) and any transitive dependency will also declare different fixed version (where he doesn't have control) - he will end up with two versions in the same bundle - and a great chance to have issues.Big Chungus
06/05/2021, 7:20 PMNikky
06/05/2021, 7:21 PMBig Chungus
06/05/2021, 7:21 PMBig Chungus
06/05/2021, 7:21 PMRobert Jaros
06/05/2021, 7:23 PMNikky
06/05/2021, 7:23 PM^
where they need itNikky
06/05/2021, 7:26 PMnpm(dependency: String)
with a extension function
even though its current implementation only throws a Exception
forcing the user to write npm("leaflet", "_")
if they just removed the function it would have crashed buildscripts the sameBig Chungus
06/05/2021, 7:29 PMNikky
06/05/2021, 7:34 PMans now delete all those version constants
Nikky
06/05/2021, 7:36 PMval version = if (FeatureFlag.NPM_IMPLICIT_RANGE.isEnabled){
when {
versionFromProperties.startsWith('^') -> versionFromProperties
versionFromProperties.startsWith('~') -> versionFromProperties
versionFromProperties.startsWith('*') -> versionFromProperties
else -> "^$versionFromProperties"
}
} else {
versionFromProperties
}
or is there other syntax for version ranges where i don;t need to add a ^
(or that would make it illegal) ?Robert Jaros
06/05/2021, 7:37 PMNikky
06/05/2021, 7:38 PMNikky
06/05/2021, 7:39 PM^~*><=
then it is a range ?Nikky
06/05/2021, 7:41 PM>=2.0.0 <3.1.4
will be a mess.. would i sort it as the lower bound ? then refreshVersion shows anything newer than that ?Nikky
06/05/2021, 7:41 PMRobert Jaros
06/05/2021, 7:44 PM2.0.0 - 3.1.4
this is also a range and adding ^
will be illegalNikky
06/05/2021, 7:46 PMNikky
06/05/2021, 7:47 PM=
operator will look terrible in a properties fileNikky
06/05/2021, 7:47 PMversion.npm.leaflet==1.7.1
Nikky
06/05/2021, 9:48 PMgenerateExternals
so that its easy to write a test for that ?