eclipse-thingweb / td-tools

Utility libraries for W3C Thing Descriptions and Thing Models
https://thingweb.io
Other
4 stars 3 forks source link

add td utils #32

Closed hasanheroglu closed 4 months ago

hasanheroglu commented 4 months ago

Closes #18

codecov-commenter commented 4 months ago

Codecov Report

Attention: Patch coverage is 95.23810% with 2 lines in your changes missing coverage. Please review.

Project coverage is 95.23%. Comparing base (b53a2f1) to head (7c564d2). Report is 34 commits behind head on main.

Files Patch % Lines
node/td-utils/src/detectProtocolSchemes.ts 95.12% 2 Missing :warning:
Additional details and impacted files ```diff @@ Coverage Diff @@ ## main #32 +/- ## =========================================== + Coverage 74.94% 95.23% +20.28% =========================================== Files 7 2 -5 Lines 986 42 -944 Branches 361 9 -352 =========================================== - Hits 739 40 -699 + Misses 203 2 -201 + Partials 44 0 -44 ```

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.

danielpeintner commented 4 months ago

Question: Should we use JS or use TypeScript?

egekorkan commented 4 months ago

Question: Should we use JS or use TypeScript?

All should move to TS soon :) This is an adapted version of the logic in the depths of playground at https://github.com/eclipse-thingweb/playground/blob/master/packages/core/index.js#L1305

danielpeintner commented 4 months ago

Since the code in detectProtocolSchemes.js isn't really complex we could do it right away... Anyway it is fine by me.

hasanheroglu commented 4 months ago

I'm on it now

egekorkan commented 4 months ago

We had some discussion on this in the regular call:

  1. The test file should contain the expected output and not the TD
  2. The expected output should look like the following:
    "protocolSchemes": {
      "http":[{
        "uri":"http://mylamp.example.com:8080",
        "subprotocol":"longpoll"
      },
      {
        "uri":"http://mylamp.example.com:8081"
      }]