Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Include source files in bower "main" #59

Merged
merged 2 commits into from
Jun 10, 2014

Conversation

anush
Copy link
Contributor

@anush anush commented Jun 9, 2014

Since iframeResizer.contentWindow.min.js is a distributable file, it should be part of the bower package.

@davidjbradshaw
Copy link
Owner

OK that's interesting as the documentation doesn't say what the main field does and examples never have it as an array. This what gets downloaded when you install via bower.

└── [dave             238]  iframe-resizer
    ├── [dave             136]  js
    │   ├── [dave            6513]  iframeResizer.contentWindow.min.js
    │   └── [dave            5432]  iframeResizer.min.js
    └── [dave             204]  src
        ├── [dave           14987]  iframeResizer.contentWindow.js
        ├── [dave            9657]  iframeResizer.contentWindow.map
        ├── [dave           11768]  iframeResizer.js
        └── [dave            7311]  iframeResizer.map

Can you explain what this change does as I have to admit to being a bit confused by what the main is for.

@davidjbradshaw
Copy link
Owner

Ah found the answer to my question.

https://github.com/bower/bower.json-spec#main

Which say arrays are ok, but this should link to the versions in src rather than js.

@anush
Copy link
Contributor Author

anush commented Jun 10, 2014

I've changed the bower "main" files to point to the source instead of the minified copy.

I've seen either used in other libraries, so though it was left up to the author's preference. Good to know there's a spec for it.

@anush anush changed the title Include iframeResizer.contentWindow.min.js in bower package Include source files in bower "main" Jun 10, 2014
@anush
Copy link
Contributor Author

anush commented Jun 10, 2014

I suppose it would be good to mention my primary reason for the pull request.

I use grunt-bower-task in my project so that I can manage my Bower dependencies via Grunt tasks. The grunt-bower-task uses what is defined in "main" to copy over the relevant files of the library.

Presently, in the case of iframe-resizer, only iframeResizer.min.js gets copied over. I needed the iframeResizer.contentWindow[.min].js file to also get recognized as a library file and get copied over. This PR solves this issue.

It makes perfect sense that the Bower spec indicates to include only the unprocessed copy (non-minified) as "main" files since the destination project may have it's own concatenation and minification process (as is true in my case).

@davidjbradshaw
Copy link
Owner

OK I will accept this. The one concern I had was that the two files where not designed to be included in the same built JS file. However, the bug I fixed last week for v2.5.1 should now prevent all the problems that might of caused.

davidjbradshaw added a commit that referenced this pull request Jun 10, 2014
Include source files in bower "main"
@davidjbradshaw davidjbradshaw merged commit 0deeeae into davidjbradshaw:master Jun 10, 2014
@davidjbradshaw
Copy link
Owner

And thank you for the contribution.

davidjbradshaw added a commit that referenced this pull request Jun 10, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants