{"action":"created","issue":{"url":"https://api.github.com/repos/angular-ui/bootstrap/issues/3999","labels_url":"https://api.github.com/repos/angular-ui/bootstrap/issues/3999/labels{/name}","comments_url":"https://api.github.com/repos/angular-ui/bootstrap/issues/3999/comments","events_url":"https://api.github.com/repos/angular-ui/bootstrap/issues/3999/events","html_url":"https://github.com/angular-ui/bootstrap/issues/3999","id":96648049,"number":3999,"title":"Update angular-ui NPM configuration to export a string","user":{"login":"jasonrose","id":466251,"avatar_url":"https://avatars.githubusercontent.com/u/466251?v=3","gravatar_id":"","url":"https://api.github.com/users/jasonrose","html_url":"https://github.com/jasonrose","followers_url":"https://api.github.com/users/jasonrose/followers","following_url":"https://api.github.com/users/jasonrose/following{/other_user}","gists_url":"https://api.github.com/users/jasonrose/gists{/gist_id}","starred_url":"https://api.github.com/users/jasonrose/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jasonrose/subscriptions","organizations_url":"https://api.github.com/users/jasonrose/orgs","repos_url":"https://api.github.com/users/jasonrose/repos","events_url":"https://api.github.com/users/jasonrose/events{/privacy}","received_events_url":"https://api.github.com/users/jasonrose/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":2,"created_at":"2015-07-22T19:40:54Z","updated_at":"2015-07-22T19:56:52Z","closed_at":null,"body":"Currently, `angular-bootstrap@0.12.2` and its previous versions exports `ui-bootstrap-tpls.min.js` as its main file.  The file defines the `ui.bootstrap` module in angular, which is all well and good.\r\n\r\nHowever, the convention seems to be for the entry point in angular npm modules to define the module in angular, then export the module name via `module.exports`.  I will include my current application's module definition here, to see how some third parties are packaging their libraries:\r\n\r\nTo support @kentcdodds, here is my module's definition in the application that I'm currently working on.  Pardon the coffee if you're not a fan:\r\n\r\n    module = angular.module 'mmb', [\r\n          require 'angular-route'\r\n          require 'angular-translate'\r\n          require 'angular-sanitize'\r\n          require 'angular-ui-bootstrap'\r\n          require './components/flux/Flux.coffee'\r\n          require './components/config/Config.coffee'\r\n          require './components/logging/Logging.coffee'\r\n          require './components/user/User.coffee'\r\n          require './components/upp/Upp.coffee'\r\n          require './components/header/Header.coffee'\r\n          require './components/wizard/Wizard.coffee'\r\n          'mmb-templates'\r\n        ]\r\n\r\n`angular-translate`, and the temporary `angular-ui-bootstrap` have a convention, as shown below in `index.js`:\r\n\r\n    require('./ui-bootstrap-tpls.js');\r\n    module.exports = 'ui.bootstrap';\r\n\r\nI think that this format is much cleaner, and at the very least removes one of the magic strings from the application.\r\n\r\n@kentcdobbs blogged about this same topic.  I will paste his comment here, which he originally brought up in https://github.com/angular-ui/bootstrap/issues/3992#issuecomment-123836419: https://medium.com/@kentcdodds/how-to-distribute-your-angularjs-module-e04d4dd58ddc"},"comment":{"url":"https://api.github.com/repos/angular-ui/bootstrap/issues/comments/123845332","html_url":"https://github.com/angular-ui/bootstrap/issues/3999#issuecomment-123845332","issue_url":"https://api.github.com/repos/angular-ui/bootstrap/issues/3999","id":123845332,"user":{"login":"jasonrose","id":466251,"avatar_url":"https://avatars.githubusercontent.com/u/466251?v=3","gravatar_id":"","url":"https://api.github.com/users/jasonrose","html_url":"https://github.com/jasonrose","followers_url":"https://api.github.com/users/jasonrose/followers","following_url":"https://api.github.com/users/jasonrose/following{/other_user}","gists_url":"https://api.github.com/users/jasonrose/gists{/gist_id}","starred_url":"https://api.github.com/users/jasonrose/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jasonrose/subscriptions","organizations_url":"https://api.github.com/users/jasonrose/orgs","repos_url":"https://api.github.com/users/jasonrose/repos","events_url":"https://api.github.com/users/jasonrose/events{/privacy}","received_events_url":"https://api.github.com/users/jasonrose/received_events","type":"User","site_admin":false},"created_at":"2015-07-22T19:56:52Z","updated_at":"2015-07-22T19:56:52Z","body":"`angular-bootstrap` works for me, as long as I do this:\r\n    require('angular-bootstrap');\r\n    angular.module('mmb', ['ui.bootstrap']);\r\nI don't think that this should change in the 0.12.x branch since that is what people expect.\r\n\r\n`angular-ui-bootstrap@0.13.0` works almost as-is, except for the restrictive `peerDependencies` which are not part of this issue.\r\n\r\nIf `angular-ui-bootstrap` is the way forward, then it behaves like `angular-translate` and other browserify-compatible npm packages, and does not require any modifications on that front.\r\n\r\nHowever, if `angular-ui-bootstrap` was a fluke, then I suggest that we adopt the convention I described above for `angular-bootstrap@0.13.0` or whatever the next version will be."}}