Code Monkey home page Code Monkey logo

npm-extraction-server's People

Contributors

joachimvh avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

npm-extraction-server's Issues

Add FOAF profile URL

Hi,

Is it possible to add the FOAF profile URL of the authors, contributors, and so on to the RDF?

KR
Pieter

Server uses wrong path logic when extracting from tarball

When the server receives a path such as http://localhost:3000/bundles/npm/@solid/community-server/3.0.0/components/context.jsonld, it has to download the tarball and look in there to find that exact resource. It does this by taking the tail, components/context.jsonld, and looking for that path. The problem is that this doesn't work if there is no direct mapping between the URL tail and the file path. The package above, for example, has the following in it's package.json:

  "lsd:importPaths": {
    "https://linkedsoftwaredependencies.org/bundles/npm/@solid/community-server/^3.0.0/components/": "dist/components/",
    "https://linkedsoftwaredependencies.org/bundles/npm/@solid/community-server/^3.0.0/config/": "config/",
    "https://linkedsoftwaredependencies.org/bundles/npm/@solid/community-server/^3.0.0/dist/": "dist/",
    "https://linkedsoftwaredependencies.org/bundles/npm/@solid/community-server/^3.0.0/templates/config/": "templates/config/"
  }

So it should actually find dist/components/context.jsonld. This requires checking if the incoming URL starts with one of the import paths, or is at least equal by using semver rules on the version number, notice the difference between 3.0.0 and ^3.0.0 above. It then has to check that the trailing part of the URL matches the trailing part of one of the importPath URLs. And then it has to replace the overlapping part with the value of the map. This makes the operation quite a bit more complicated but is feasible to do.

The issue that I have, and why I'm tagging @rubensworks, is because there are 2 other possible ways to configure the package.json and I'm not sure what is expected there.

First case is having "lsd:module": true in your config. How is the server supposed to know how to map the URL to a file path in the tarball? I had a look at the example in the documentation, but that caused more confusion since I have no idea how the equivalence there is achieved: https://componentsjs.readthedocs.io/en/latest/getting_started/basics/exposing_components/#packagejson-discovery

The other case is when there are only lsd:contexts entries. What should be done in that case? Or should only the exact URLs there be supported and mapped to their values, while other paths should be ignored?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.