Coder Social home page Coder Social logo

Comments (12)

mdxs avatar mdxs commented on July 25, 2024

I'm still learning about Grunt and the rest of the toolchain, so I lack a strong opinion on this topic. If I look at the run.py script, I would think it could also be solved adding a dict/set and using that to check against dupes... but that obviously isn't the Grunt magic you're looking for.

from gae-init.

lipis avatar lipis commented on July 25, 2024

@topless I also like Grunt and I think it's a pretty cool tool! For the gae-init though there are some requirements that I really don't want to drop just to use Grunt and if there is a nice and clean way to achieve these requirements I'm willing to simplify the run.py script.. Stuff like combining .coffee and .js files and you're not tied to use only CoffeeScript...

from gae-init.

lipis avatar lipis commented on July 25, 2024

But if there is a viable clean and nice solution when someone can change the file structure in one single file and everything will work smoothly locally and on production.. we could have a second look on that issue.. until then I don't have much time to spend on that one.. plus the run.py works like a glove...

from gae-init.

mdxs avatar mdxs commented on July 25, 2024

Quick look around shows that https://github.com/gruntjs/grunt-contrib-uglify might work with https://github.com/mishoo/UglifyJS2

Where UglifyJS2 seems to be a newer version than currently found in gae-init/node_modules/uglify-js (at least it seems from my limited observation)

from gae-init.

gmist avatar gmist commented on July 25, 2024
    'scripts': list({
        'src/script/common/util.coffee',
        'src/script/common/service.coffee',
        'src/script/common/upload.coffee',

        # Add this duplicate entry below
        'src/script/site/app.coffee',
        'src/script/site/app.coffee',
        ....
    })

:)

from gae-init.

mdxs avatar mdxs commented on July 25, 2024

Yep, seems better than my suggestion to mess with run.py :-)

from gae-init.

mdxs avatar mdxs commented on July 25, 2024

Though the order specified is no longer guaranteed... does that matter for the JS?

from gae-init.

lipis avatar lipis commented on July 25, 2024

I think the order on that stage doesn't really matter.. but maybe it is :) Either case having a duplicate entry is a developer's issue anyway.. I mean people should be a little bit more careful and especially with the copy/paste programming..! :P So for me that's not a real issue and I think @topless is just vouching for dumping the run.py script in favour of Grunt for compilation/minifications...

from gae-init.

mdxs avatar mdxs commented on July 25, 2024

Okay.

To preserve order, one could use:

def uniq(lst):
  dct = {}
  return [dct.setdefault(e, e) for e in lst if e not in dct]

after which:

    'scripts': uniq([
        'src/script/common/util.coffee',
        'src/script/common/service.coffee',
        'src/script/common/upload.coffee',

        # Add this duplicate entry below
        'src/script/site/app.coffee',
        'src/script/site/app.coffee',
        ....
    ])

Could do the trick.

Or to protect the innocent, the uniq() approach could be added to run.py to help the copy-and-paste wizards. So that they can continue to make a mess in main/config.pyand it still works ;-)

from gae-init.

lipis avatar lipis commented on July 25, 2024

I would prefer the http://stackoverflow.com/a/480227/8418 set solution rather than the .setdefault but still it's the same idea.. might add that in the run.py eventually..

from gae-init.

mdxs avatar mdxs commented on July 25, 2024

See pull #42 (the answer to everything...)

from gae-init.

lipis avatar lipis commented on July 25, 2024

I'm closing this one since the bug was solved. As for the suggestion I want to see it working first in a different project and we'll see how this is going to fly...

from gae-init.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.