Giter Site home page Giter Site logo

Comments (12)

bebraw avatar bebraw commented on June 4, 2024

Hi,

It's very unfortunate CDNs don't use the official naming. What if we implemented something to figure out the official name (ie. match libraries based on links) and then rename them all? Then you could use the same name to refer to them.

Also we could do something like a global search to make it easier to figure out where a particular library is available (ie. /v1/libraries?name=ember). I'm not exactly sure what that would return (array of objects with cdn -> library mapping?). This is a separate issue, though.

from api.

jimaek avatar jimaek commented on June 4, 2024

So something like this?

    {
        "name": "99lime",
        "normname": "99lime"
    },
    {
        "name": "accounting.js",
        "normname": "accounting"
    }

Basically create a parameter normname where we store the name but without js and dots. I just think we will run into lots of issue this way. Maybe regex would be a better solution?

from api.

tomByrer avatar tomByrer commented on June 4, 2024

"Official" naming can be tricky, since @jdalton named the repo https://github.com/lodash/lodash & homepage http://lodash.com/ but he will correct people to say "Lo-Dash". I'm the one who setup jsDeliv IIRC & picked the repo name, but not sure who set up CDNJS as lodash.js
So maybe an alias-array? How many lo-dash searches do you get at www.jsdelivr.com/?

I was going to compare the repositories field since (aside from moving the project) they should be the same, but you guys didn't grab that field from cdnjs :`(

Basically create a parameter normname where we store the name but without js and dots

That could work. You'll need to remove or transform+?wildcard all dashes & dots also, eg:
http://api.jsdelivr.com/v1/cdnjs/libraries?name=jquery-scrollTo
http://api.jsdelivr.com/v1/jsdelivr/libraries?name=jquery.scrollTo
If so, would the default for searches would have to be on normname, unless ?name= is used?

from api.

jimaek avatar jimaek commented on June 4, 2024

I think we can add the missing repository parameter to cdnjs. That would help a lot I think.

But I really dislike the idea of normalized names. For example jsDelivr can have a project named as jquery.pluginName but cdnjs just pluginName.

from api.

tomByrer avatar tomByrer commented on June 4, 2024

add the missing repository parameter to cdnjs

Thanks! BTW, what happens if the repo is not on github, since jsDelivr doesn't (seem to) encourage other repos? Not too many don't use github, 1-2% when I checked last summer, but may change in future. Eg CDNJS:

"repositories": [{
  "type": "svn",
  "url": "http://google-diff-match-patch.googlecode.com/svn/trunk/"
}],

I really dislike the idea of normalized names. For example jsDelivr can have a project named as jquery.pluginName but cdnjs just pluginName

Good point, may get worse as there are more plugins for Angular, React, etc

from api.

jimaek avatar jimaek commented on June 4, 2024

jsDelivr does not require for the project to be on Github. You can simply leave that parameter empty if the project is hosted elsewhere.

from api.

shahata avatar shahata commented on June 4, 2024

Maybe the bower component name can be used as the 'official name'.
It would be extremely helpful to me if I could query using the bower name.

from api.

bebraw avatar bebraw commented on June 4, 2024

@shahata That could be nice pick for number one name. If that's missing maybe go with NPM, then / (GitHub), then current name? Issue #13 discusses this approach.

from api.

GeorgeErickson avatar GeorgeErickson commented on June 4, 2024

A good search index implementation should handle this.

from api.

tomByrer avatar tomByrer commented on June 4, 2024

@GeorgeErickson yes @bebraw wrote one that weighs exact match well. Perhaps there should be some fuzzy searching, dropping any - | _ | . | .js | .css.

from api.

megawac avatar megawac commented on June 4, 2024

Related to #78 /cc @tomByrer

from api.

jimaek avatar jimaek commented on June 4, 2024

#78

from api.

Related Issues (20)

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.