Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
  • Feb 02 08:44
    benarmstead closed #356
  • Jan 31 19:44
    marishuman edited #358
  • Jan 31 05:21
    marishuman edited #358
  • Jan 31 05:16
    marishuman edited #358
  • Jan 31 05:14
    marishuman opened #358
  • Jan 29 14:16
    ali-mozaffari edited #357
  • Jan 29 14:14
    ali-mozaffari opened #357
  • Jan 12 09:17
    srThibaultP closed #338
  • Jan 12 09:17
    srThibaultP commented #338
  • Dec 29 2022 10:07
    benarmstead opened #356
  • Dec 16 2022 08:05
    Cheppar commented #229
  • Nov 17 2022 01:40
    yurloc opened #355
  • Oct 28 2022 12:08
    Khodor1997 opened #354
  • Oct 27 2022 13:36
    proyer-maxar commented #167
  • Oct 13 2022 09:21
    dolorain closed #308
  • Oct 12 2022 19:07
    DPatel13 reopened #353
  • Oct 12 2022 19:07
    DPatel13 closed #353
  • Oct 12 2022 19:07
    DPatel13 opened #353
  • Oct 12 2022 18:59
    DPatel13 opened #352
  • Oct 12 2022 14:17
    sgibbes commented #338
Daniel Smullen
@drspangle
sorry let me do that again
module.exports = {
  client: {
    lib: {
      css: [
        'public/lib/font-awesome/css/font-awesome.min.css',
        'public/lib/bootstrap/dist/css/bootstrap.css',
        'public/lib/animate-css/animate.css',    
        'public/lib/material-design-lite/material.min.css',
            'public/lib/leaflet/dist/leaflet.css',
        'public/lib/angular-material/angular-material.min.css',
        '//fonts.googleapis.com/icon?family=Material+Icons',
        'public/lib/bootstrap-material-design/dist/css/bootstrap-material-design.css',
        'public/lib/md-range-slider/dist/style.min.css',
        'public/css/irr.css'
      ],
      js: [

        'public/lib/material-design-lite/material.min.js',
        'public/lib/angular/angular.js',
        'public/lib/angular-aria/angular-aria.js',
        'public/lib/angular-material/angular-material.js',
        'public/lib/angular-resource/angular-resource.js',
        'public/lib/angular-animate/angular-animate.js',
        'public/lib/angular-messages/angular-messages.js',
        'public/lib/angular-ui-router/release/angular-ui-router.js',
        'public/lib/angular-ui-utils/ui-utils.js',
        'public/lib/angular-bootstrap/ui-bootstrap-tpls.js',
        'public/lib/angular-file-upload/angular-file-upload.js',
        'public/lib/moment/min/moment.min.js',
        'public/lib/jquery/dist/jquery.js',
        'node-modules/leaflet-geosearch/lib/index.js',
            'public/lib/leaflet/dist/leaflet.js'

      ],
      tests: ['public/lib/angular-mocks/angular-mocks.js']
    },
    css: [
      'modules/*/client/css/*.css'
<snip>
the serverside section is below...
<snip>

  server: {
    gruntConfig: 'gruntfile.js',
    gulpConfig: 'gulpfile.js',
    allJS: ['server.js', 'config/**/*.js', 'modules/*/server/**/*.js'],
    models: 'modules/*/server/models/**/*.js',
    routes: ['modules/!(core)/server/routes/**/*.js', 'modules/core/server/routes/**/*.js'],
    sockets: 'modules/*/server/sockets/**/*.js',
    config: 'modules/*/server/config/*.js',
    policies: 'modules/*/server/policies/*.js',
    views: 'modules/*/server/views/*.html'
  }
so the public/lib/ folder is where i store clientside modules that i get through bower
the modules/ folder is where i put my own defined modules, as in page contents, etc.
and then the node-modules/ folder is where my other modules, got through npm, go
so the gruntfile is designed to pull from that module.exports object, get all the javascript files, concatenate and minify them
and as a result i can use the objects exported by them
Stephan Meijer
@smeijer
okay, I understand.
a quick fix, would be to handle leaflet-geosearch the same as you handle jquery.
node-modules/leaflet-geosearch/dist/bundle.js
Than there must be a global GeoSearch, the OSM provider should be under GeoSearch.OpenStreetMapProvider
Daniel Smullen
@drspangle
i attempted that, let me see if i needed to qualify it with GeoSearch.*
one moment
Stephan Meijer
@smeijer
A map would than be loaded with:
var searchControl = new GeoSearch.GeoSearchControl({
  provider: new GeoSearch.OpenStreetMapProvider(),
});

var map = new L.Map('map');
map.addControl(searchControl);
Daniel Smullen
@drspangle
let's see if this works...
nope, GeoSearch is undefined
so it seems i am not able to get the top level object from your library, at all
Stephan Meijer
@smeijer
Is it possible that that because it's not in your public dir?
Daniel Smullen
@drspangle
that is a possibility, which i will look into, but i'm not totally sure how to determine that
the reason why it is in the npm managed node-modules folder is because i could not get the dist/ folder when using bower to install
of course i can copy it manually, but in order to maintain the installation process for the app in general, i must find some way to get the dist/ folder contents through bower, since that would be the idea behind providing a module through bower
in fact the idea behind distributing the module that way, i believe, would be to decouple the module from the build process' itself's dependencies
Stephan Meijer
@smeijer
yes, I understand of course. Just curious if that can be the reason.
Is it possible to refer external (cdn hosted for example), libraries?
Daniel Smullen
@drspangle
it is a very reasonable suggestion
to answer the cdn question, i am not sure, but maybe it is possible since i think i've done that in the line where i get material icons
but i am not sure how desirable this is
this means that my configuration file must have a static binding to that URL, so if it changes i have to update everything, whereas using bower's manifest i can automatically insert these dependencies since their path is predictable based on my bower config file
the leaflet bower package, for example, already has a dist/ folder
Stephan Meijer
@smeijer
Sorry, I have a phone call. Be right back.
Daniel Smullen
@drspangle
sure
Daniel Smullen
@drspangle

i believe your bower.json might be fixed by replacing the line

"main": "src/js/l.control.geosearch.js",

with

"main": "dist/bundle.js",

and then committing the dist/ folder inside the git repository

then $ bower install leaflet-geosearch will work out of the box
also, to answer the CDN question, it is not possible - the purpose of bower is to also manage your module's dependencies as well, so that it can be linked to them after downloading them once, rather than managing a separate version for each module
for example, if you depend on angularJS, bower will ensure that it is downloaded once, and then all other bower-installed modules which depend on it will link to it, rather than managing it's own copy
you must define these dependencies in the bower.json file
and you can control what version you depend on as well
Stephan Meijer
@smeijer
Okay; makes sense. Although I do not understand why that fixes your problem. Why can you than refer to the globals, and not when you point directly to the bundle.js. It's strange for me.
Daniel Smullen
@drspangle
it's strange for me as well, i don't have a good explanation for why i can't use bundle.js as it is
Stephan Meijer
@smeijer
I must think about this. I'm not really in favor of committing build files to a git repo. Especially since bower is already advising to start using yarn in favor of bower.
Daniel Smullen
@drspangle
indeed
it is an important decision, the issue revolves around supporting bower, which is still supported
webpack and yarn and the like are suggested for new projects
Stephan Meijer
@smeijer
true
Daniel Smullen
@drspangle
but unfortunately my project still depends on bower for building
Stephan Meijer
@smeijer
and when installing trough bower, you can specify a git branch or something?
Daniel Smullen
@drspangle
i'm not sure about that, i think you must specify a git endpoint, and you use tags to specify the version/branch
so you could use the tags to specify a particular version, but you could also use it to specify a particular branch for releases that support bower