olivernn / lunr.js

A bit like Solr, but much smaller and not as bright
http://lunrjs.com
MIT License
8.96k stars 548 forks source link

Bower install pulls in lot of unnecessary files #71

Closed kdabir closed 8 years ago

kdabir commented 10 years ago

If I install lunr.js using bower, I get too many files into my bower_components/lunr.js. Typically, an app using lunr.js won't need all these files. Why is this problem because bower recommends to check-in the bower_components into vcs, which essentially means I am checking in whole lunr.js repo into my project.

What I should ideally get from bower install is:

$ tree bower_components/lunr.js
bower_components/lunr.js
|-- CHANGELOG.mdown
|-- README.mdown
|-- VERSION
|-- bower.json
|-- component.json
|-- lunr.js
|-- lunr.min.js
`-- package.json

What I currently get is:

$ tree bower_components/lunr.js
bower_components/lunr.js
|-- CHANGELOG.mdown
|-- CNAME
|-- LICENSE
|-- Makefile
|-- README.mdown
|-- VERSION
|-- bower.json
|-- component.json
|-- example
|   |-- example_data.json
|   |-- example_index.json
|   |-- index.html
|   |-- index_builder.js
|   |-- jquery.js
|   `-- mustache.js
|-- index.html
|-- lib
|   |-- document_store.js
|   |-- event_emitter.js
|   |-- index.js
|   |-- lunr.js
|   |-- pipeline.js
|   |-- sorted_set.js
|   |-- stemmer.js
|   |-- stop_word_filter.js
|   |-- token_store.js
|   |-- tokenizer.js
|   |-- utils.js
|   `-- vector.js
|-- lunr.js
|-- lunr.min.js
|-- notes
|-- package.json
|-- server.js
|-- styles.css
`-- test
    |-- env
    |   |-- augment.min.js
    |   |-- jquery.js
    |   |-- qunit.css
    |   |-- qunit.js
    |   `-- runner.js
    |-- event_emitter_test.js
    |-- fixtures
    |   `-- stemming_vocab.json
    |-- index.html
    |-- index_test.js
    |-- lunr_test.js
    |-- pipeline_test.js
    |-- search_test.js
    |-- serialisation_test.js
    |-- sorted_set_test.js
    |-- stemmer_test.js
    |-- stop_word_filter_test.js
    |-- store_node_test.js
    |-- store_test.js
    |-- test_helper.js
    |-- token_store_test.js
    |-- tokenizer_test.js
    |-- utils_test.js
    `-- vector_test.js
kdabir commented 10 years ago

I have already fixed the bower.json's ignore of lunr.js and can send a pull request. Few things I need to confirm:

  1. Can component.json be removed as now bower recommends using bower.json or is it there for component.io (but I could not found lunr listed there)?
  2. Does this call for a version bump? otherwise we will not get the changes until the next release.
  3. If any more files can be removed or if you feel some files need to be kept.
kdabir commented 10 years ago

Found one interesting workaround. Using bower-installer, which only loads main file, one can solve problem for all bower components.

tomgruner commented 8 years ago

I personally like having bower install everything - that way I can add everything to source control locally. If the project gets deleted on github, I still have everything I need to continue with it. It's also the common behavior for bower so I would say this is a non issue. Cool to know about bower-installer!

kdabir commented 8 years ago

@tomgruner Well, ideally for that we should have internal mirrors/repos (nexus/artifactory types..), instead of bloating our repo.

But Anyways, I have moved on and use only npm for dependencies these days. So this is not an issue for me anymore. Closing this.