These are chat archives for webjars/webjars

1st
Aug 2017
Karl Bennett
@karlbennett
Aug 01 2017 01:11
Hi all, I'm trying to find out how the bower webjars are generated. Because the polymer webjar has had broken dependencies since version 2.0.0.
Wondering if I can help with a pull request or something.
James Ward
@jamesward
Aug 01 2017 01:12
What is the broken dep?
Karl Bennett
@karlbennett
Aug 01 2017 01:13
<dependencies>

        <dependency>
            <groupId>org.webjars.bower</groupId>
            <artifactId>github-com-webcomponents-shadycss</artifactId>
            <version>^v1.0.0</version>
        </dependency>

        <dependency>
            <groupId>org.webjars.bower</groupId>
            <artifactId>webcomponentsjs</artifactId>
            <version>^v1.0.0</version>
        </dependency>


    </dependencies>
James Ward
@jamesward
Aug 01 2017 01:13
Both missing?
Karl Bennett
@karlbennett
Aug 01 2017 01:13
those are npm version ranges
James Ward
@jamesward
Aug 01 2017 01:13
oh!
so the version converter failed
Karl Bennett
@karlbennett
Aug 01 2017 01:13
also version ranges aren't recommended in maven ;)
James Ward
@jamesward
Aug 01 2017 01:14
unfortunately we have to do as NPM does
Karl Bennett
@karlbennett
Aug 01 2017 01:14
looks like it's a bit broke yes :)
James Ward
@jamesward
Aug 01 2017 01:14
Karl Bennett
@karlbennett
Aug 01 2017 01:14
ah I see, ranges for all, oh wells
sure can
Karl Bennett
@karlbennett
Aug 01 2017 01:17
will see if I'm up to the task :)
Issues raised: webjars/webjars#1636
Haha, good grief, I do wonder sometimes about Scala being a Write Only Language :D
Karl Bennett
@karlbennett
Aug 01 2017 01:24
Well at least I can see where it's falling down. It's the 'v' in the version numbers.
James Ward
@jamesward
Aug 01 2017 01:58
yeah. I don't think that is normal with NPM deps.
Karl Bennett
@karlbennett
Aug 01 2017 02:00
I don't think there is a "normal" for NPM ;)
James Ward
@jamesward
Aug 01 2017 02:01
true :) But also not something we've encountered yet
Karl Bennett
@karlbennett
Aug 01 2017 02:01
well, I'll at least get the test written
James Ward
@jamesward
Aug 01 2017 02:01
yeah, i'm not so great at writing parsers. so the scala is terrible
Karl Bennett
@karlbennett
Aug 01 2017 02:01
I think I can handle that
James Ward
@jamesward
Aug 01 2017 02:02
yeah, a test is the right place to start
Karl Bennett
@karlbennett
Aug 01 2017 02:02
I find all Scala to be a bit of a challenge :D Just so much syntax to deal with.
James Ward
@jamesward
Aug 01 2017 02:03
yeah, way to many ways to do things
Karl Bennett
@karlbennett
Aug 01 2017 02:04
I'm certainly a bit of a curmudgeon when it comes to programming languages. Keep falling back to Java and worrying if I'm just being too close minded :/
James Ward
@jamesward
Aug 01 2017 02:05
it was a long hard road for me to learn scala. now that i kinda know it I can't go back to java. but i also can't recommend scala.
quite the conundrum
Karl Bennett
@karlbennett
Aug 01 2017 02:06
I'm liking the look of Rust. But the examples for it do seem to use quite a few output arguments...
So, um... in that bower.json, this is a version number: "webcomponents/shadycss#^v1.0.0"
James Ward
@jamesward
Aug 01 2017 02:08
yeah, that means use the github repo webcomponents/shadycss and semver ^v1.0.0
Karl Bennett
@karlbennett
Aug 01 2017 02:08
looks like that got parsed partially
James Ward
@jamesward
Aug 01 2017 02:08
yeah. i think it got the github part right
but not the semver part
Karl Bennett
@karlbennett
Aug 01 2017 02:09
yeah
still waiting for Intellij to start. It's downloading SBT.
James Ward
@jamesward
Aug 01 2017 02:09
i think the easy fix is to drop the v out
James Ward
@jamesward
Aug 01 2017 02:10
hmm.. might need to fix that too
Karl Bennett
@karlbennett
Aug 01 2017 02:11
you mean remove alpha version prefixes across the board?
James Ward
@jamesward
Aug 01 2017 02:12
well, maybe not
i think we preserve the version specified in the bower.json
so it'd probably be wrong to change that
but we should verify what the bower.json for that webcomponents package specifies
No version specified. so I guess we just directly use the tag
but does that mean the maven version range should be like [v1.0.0, 2) ?
Would that even work? I'm not sure.
Karl Bennett
@karlbennett
Aug 01 2017 02:23
yeah I was wondering the same thing
Karl Bennett
@karlbennett
Aug 01 2017 03:37
oh dear, I can't get the project to build with ./sbt test
oh, ok, maybe all those error logs are expected
James Ward
@jamesward
Aug 01 2017 03:41
might need to start a memcache server?
or set some env vars
env vars & memcache shouldn't be necessary to just run the semver tests though
Karl Bennett
@karlbennett
Aug 01 2017 03:43
the tests are passing :)
just getting lots of error log output
Well:
Error: Total 156, Failed 0, Errors 6, Passed 149, Skipped 1
Can run the tests in Intellij now though, so that's good
Karl Bennett
@karlbennett
Aug 01 2017 04:03
sweet tests failing:
"work with alpha prefix" in {
      SemVer.convertSemVerToMaven("a1.2.3")            must be equalTo Some("a1.2.3")
      SemVer.convertSemVerToMaven(">bc1")              must be equalTo Some("(bc1,)")
      SemVer.convertSemVerToMaven("<def1")             must be equalTo Some("(,def1)")
      SemVer.convertSemVerToMaven(">=g1")              must be equalTo Some("[g1,)")
      SemVer.convertSemVerToMaven("<=h1")              must be equalTo Some("(,h1]")
      SemVer.convertSemVerToMaven(">=i1.0.0 <i1.4.0")  must be equalTo Some("[i1.0.0,i1.4.0)")
      SemVer.convertSemVerToMaven("j1 - j2")           must be equalTo Some("[j1,j3)")
      SemVer.convertSemVerToMaven("k1.2 - k2")         must be equalTo Some("[k1.2,k3)")
      SemVer.convertSemVerToMaven("l1.2.3 - l2")       must be equalTo Some("[l1.2.3,l3)")
      SemVer.convertSemVerToMaven("m1.2.3-alpha - m2") must be equalTo Some("[m1.2.3-alpha,m3)")
      SemVer.convertSemVerToMaven("n1.2")               must be equalTo Some("[n1.2,n1.3)")
      SemVer.convertSemVerToMaven("~o1")                must be equalTo Some("[o1,o2)")
      SemVer.convertSemVerToMaven("^p1.2.3")            must be equalTo Some("[p1.2.3,p2)")
      SemVer.convertSemVerToMaven("^q0.2.3")            must be equalTo Some("[q0.2.3,q0.3)")
      SemVer.convertSemVerToMaven("^r1.2.x")            must be equalTo Some("[r1.2.0,r2)")
      SemVer.convertSemVerToMaven("^s1.x")              must be equalTo Some("[s1.0.0,s2)")
      SemVer.convertSemVerToMaven("^t1.3.0 || >t1.4.0-beta.0")  must be equalTo Some("[t1.3.0,t2),(t1.4.0-beta.0,)")
    }
Karl Bennett
@karlbennett
Aug 01 2017 04:15
right so... major needs to be a string now...
joy
that broke a BUNCH of stuff :D
Karl Bennett
@karlbennett
Aug 01 2017 06:20
ok, I've made the fix... it's not pretty though...
James Ward
@jamesward
Aug 01 2017 14:08
cool! thank you!