{"action":"created","issue":{"url":"https://api.github.com/repos/Dash-Industry-Forum/dash.js/issues/1173","repository_url":"https://api.github.com/repos/Dash-Industry-Forum/dash.js","labels_url":"https://api.github.com/repos/Dash-Industry-Forum/dash.js/issues/1173/labels{/name}","comments_url":"https://api.github.com/repos/Dash-Industry-Forum/dash.js/issues/1173/comments","events_url":"https://api.github.com/repos/Dash-Industry-Forum/dash.js/issues/1173/events","html_url":"https://github.com/Dash-Industry-Forum/dash.js/issues/1173","id":133924361,"number":1173,"title":"Consider changing main file / publishing to NPM","user":{"login":"nickygerritsen","id":550145,"avatar_url":"https://avatars.githubusercontent.com/u/550145?v=3","gravatar_id":"","url":"https://api.github.com/users/nickygerritsen","html_url":"https://github.com/nickygerritsen","followers_url":"https://api.github.com/users/nickygerritsen/followers","following_url":"https://api.github.com/users/nickygerritsen/following{/other_user}","gists_url":"https://api.github.com/users/nickygerritsen/gists{/gist_id}","starred_url":"https://api.github.com/users/nickygerritsen/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nickygerritsen/subscriptions","organizations_url":"https://api.github.com/users/nickygerritsen/orgs","repos_url":"https://api.github.com/users/nickygerritsen/repos","events_url":"https://api.github.com/users/nickygerritsen/events{/privacy}","received_events_url":"https://api.github.com/users/nickygerritsen/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":22,"created_at":"2016-02-16T09:11:12Z","updated_at":"2016-02-19T17:07:05Z","closed_at":"2016-02-18T18:49:19Z","body":"Hi!\r\n\r\nWe are using dash.js in another project which also uses ES6.\r\nThus we would like to include it as a dependency in our `package.json` and then use it.\r\n\r\nCurrently this is not possible, because of the following:\r\n* Using a tagged release (like `2.0.0`) will not work, as `dash.js` is not published to NPM\r\n* Using a git URL, like `https://[url].git#v2.0.0` will not work, because `package.json` specifies `index.js` as the main file and this is a ES6 file. Browserify will _never_ run on files in `node_modules` and thus will give an error\r\n* Using a release zip does the same\r\n\r\nFor the latter two cases, I could, instead of:\r\n\r\n```js\r\nimport 'dashjs';\r\n```\r\n\r\nwrite\r\n\r\n```js\r\nimport 'node_modules/dashjs/dist/dash.all.debug.js';\r\n```\r\n\r\nThis works for a direct dependency. However, when another package depends on a package that uses dash.js, this does not work because the directory changes. I.e. if I have package A which depends on B and package B depends on dash.js, this goes wrong.\r\n\r\nThis can all be easily fixed by changing the `main` file to `dist/dash.all.debug.js`, which is the browerified version of the file.\r\n\r\nFurthermore, it would be nice if dash.js could also be published to npm, so we can just add `^2.0.0` to our `package.json`. This could easily be done by just `npm publish`ing. However, I think some changes would then be nice:\r\n\r\n* Not add the `dist` files to the master branch. The `*.map` files are useless anyway (they contain local paths of @AkamaiDASH...). For the other files see below\r\n* Add a `files` section to `package.json` that specifies the files that appear in the NPM package\r\n* We then probably also need to upload a separate `.zip` file to the release, as it will not contain the `dist` files anymore in the tag. Another option is to have the tags themselves do contain the `dist` directory. This is what [video.js](https://github.com/videojs/video.js) is doing\r\n\r\nThere is already an old NPM package called `dashjs`, so we have two options if we want to add it to NPM I guess:\r\n\r\n* Contact the guy from the `dashjs` package whether it can be transferred to this repo\r\n* Create a different NPM package, for example `dash.js`. This requires renaming the `name` in `package.json` to `dash.js`*.\r\n\r\nI already create an NPM package called `dashjs-npm`, which is created using the following commit: https://github.com/StreamOneNL/dash.js/commit/f14709fea215f8747502896403fc8f7d25b533da.\r\nThis did not remove the `dist` files yet, but you get the idea.\r\n\r\n*: by \"accident\" I tried publishing `2.0.0` to the `dash.js` package already. I tried unpublishing it, but apparently you can never republish a version (or you need to contact NPM). However I guess publishing to NPM will only happen for `2.0.1` or `2.1.0` anyway, so I can grant access to you guys and then you can use it without problems."},"comment":{"url":"https://api.github.com/repos/Dash-Industry-Forum/dash.js/issues/comments/186307484","html_url":"https://github.com/Dash-Industry-Forum/dash.js/issues/1173#issuecomment-186307484","issue_url":"https://api.github.com/repos/Dash-Industry-Forum/dash.js/issues/1173","id":186307484,"user":{"login":"boushley","id":101239,"avatar_url":"https://avatars.githubusercontent.com/u/101239?v=3","gravatar_id":"","url":"https://api.github.com/users/boushley","html_url":"https://github.com/boushley","followers_url":"https://api.github.com/users/boushley/followers","following_url":"https://api.github.com/users/boushley/following{/other_user}","gists_url":"https://api.github.com/users/boushley/gists{/gist_id}","starred_url":"https://api.github.com/users/boushley/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/boushley/subscriptions","organizations_url":"https://api.github.com/users/boushley/orgs","repos_url":"https://api.github.com/users/boushley/repos","events_url":"https://api.github.com/users/boushley/events{/privacy}","received_events_url":"https://api.github.com/users/boushley/received_events","type":"User","site_admin":false},"created_at":"2016-02-19T17:07:05Z","updated_at":"2016-02-19T17:07:05Z","body":"Not a problem. I've been bitten by it before as well."}}