erost / ng-videosharing-embed

embed youtube/vimeo/dailymotion videos using AngularJS directives
MIT License
97 stars 44 forks source link

Npm publish #49

Open alex88 opened 7 years ago

alex88 commented 7 years ago

Can you please publish this package on npm too?

igal1c0de4n commented 7 years ago

+1 thank you!

wilcraig commented 7 years ago

I went ahead and published this package to NPM. Have submitted pull request to update readme

npm install ng-videosharing-embed

igal1c0de4n commented 7 years ago

@wilcraig thank you!

FYI there's an addition you can make to align this module with common npm-publishing conventions (see packages such as ngSanitize, ngAnimate, and more):

At the module's root add a short index.js file which contains:

require('./src/angular-embedplayer');
module.exports = 'videosharing-embed';

Then add a main key to package.json which points to the released module file:

  "main": "index.js",

Doing so will allow ES6 imports of the form:

import ngVideoSharingEmbed from 'ng-videosharing-embed/src/angular-embedplayer';
...
angular.module('myMapp', [ngVideoSharingEmbed, ...

Which is convenient..

wilcraig commented 7 years ago

Ok great! I've added the index.js file and main key to package.json and pushed the changes as well as re-publishing to npm. Thanks @igalitarian

igal1c0de4n commented 7 years ago

@wilcraig Hey thanks for pushing the changes. Unfortunately version 0.3.5 doesn't play videos. It appears that the changes I provided were partial. That's because the src/angular-embedplayer.js file doesn't pull with it the directive & filter files.

After some tinkering I got it to work with the following index.js:

require('./src/angular-embedplayer');
require('./src/directives/embedvideo');
require('./src/filters/videosettings');
require('./src/filters/whitelist');
module.exports = 'videosharing-embed';
wilcraig commented 7 years ago

OK that makes sense. I was busy putting a lot of things into my build today so I didn't have a chance to test it together, but I'll update the index.js file again and push the changes. Thanks a ton!

igal1c0de4n commented 7 years ago

@wilcraig thanks, I confirm that v0.3.6 can be imported and works!

karensg commented 6 years ago

Could you also release the latest version on npm?