Comments (12)
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.
@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.
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.
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.
'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.
Yep, seems better than my suggestion to mess with run.py
:-)
from gae-init.
Though the order specified is no longer guaranteed... does that matter for the JS?
from gae-init.
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.
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.py
and it still works ;-)
from gae-init.
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.
See pull #42 (the answer to everything...)
from gae-init.
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)
- Google login is not working (not GAE) HOT 1
- AttributeError: 'module' object has no attribute 'get_dbs'
- gulp-help is a blocker to upgrading to gulp4 HOT 2
- Yarn doesn't work with Node v12 HOT 3
- Use of memcache is a blocker to Python 3.7 migration HOT 5
- Trouble running gulp for local testing with grpcio in app.yaml HOT 4
- Can't import numpy HOT 7
- Error with virtualenv unrecognized argument during yarn install
- Requirement for email_validator on local test run not satisfied? HOT 4
- Race condition in deploy vs creation of lib.zip HOT 2
- Inconsistencies in gulpfile task descriptions HOT 3
- Add Twitch Login
- Upgrade to Font Awesome 5
- plan to update to python 3? HOT 1
- Moment.js is a legacy project HOT 1
- Dependabot couldn't authenticate with https://pypi.python.org/simple/
- Import error with latest changes HOT 1
- Travis not running
- Improve cleanup in development HOT 1
- gae-init.appspot.com is down
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from gae-init.