Zod- / jsVideoUrlParser

A javascript parser to extract informations like provider, channel, id, start time from YouTube, Vimeo, Dailymotion, Twitch,... urls
MIT License
235 stars 73 forks source link

Fix missing dist files for CDN usage #41

Closed oskarrough closed 6 years ago

oskarrough commented 6 years ago

Hi, thank you for this fine package.

It seems version 0.2.5 removed the dist folder from NPM. This means you can no longer use services such as https://unpkg.com with this package. For instance:

One way to fix this, is to add the dist folder to the files array in package.json to ensure it's included. There is a bit about "Workflow" at the bottom of this page https://unpkg.com/

Zod- commented 6 years ago

Could you also add the license to it?

MartinKolarik commented 6 years ago

Not 100% sure but I think setting "files": [ "dist" ], will remove everything other than dist from the package - what you should do is removing dist from .npmignore: https://github.com/Zod-/jsVideoUrlParser/blob/master/.npmignore#L6

Zod- commented 6 years ago

@lukescott could you take a look at this?

oskarrough commented 6 years ago

@Zod- the license is included regardless of the files option and ignore files, as far as I understand --> https://docs.npmjs.com/files/package.json#files.

But I think @MartinKolarik has the right approach here. If it's not ignored there's no need for the files option.

lukescott commented 6 years ago

Yep, just remove it from .npmignore. We should add dist back for this use-case considering a minor version bump. However, I would consider removing it from any major version releases in the future.

(Lodash - https://unpkg.com/lodash@4.17.4/ - which is on unpkg.com's home page, does not include a pre-built release. Which would lead me to assume there to be a client-side module loader of some sort.)

oskarrough commented 6 years ago

Cheers!

So… I believe modules/imports are coming to browsers https://developers.google.com/web/updates/2017/11/dynamic-import. Until it stabilizes I hope you'll consider keeping the pre-built release. Makes it really easy to use when you don't want a build system.

fwiw I noticed that React is publishing an UMD folder https://unpkg.com/react@16.2.0/umd/ as well.

Zod- commented 6 years ago

That's it then? I'll merge it later today and prepare a new release.

Zod- commented 6 years ago

https://unpkg.com/js-video-url-parser@0.2.7/dist/jsVideoUrlParser.min.js is up so it looks like it worked

oskarrough commented 6 years ago

Sweet! Thank you @Zod-