Grunt and Bower config issue - angularjs

I am fighting a weird problem that has caused me to pull my hair out multiple times. For a project we are working on we are using bower and grunt to deal with dependencies etc... everything seems to be fine except our angular app is looking for all the stuff to be put in the bower_dep folder. It does this on every one elses machine ... on my machine however when bower goes out and gets dependencies it puts them in app/bower_dep and my app doesnt find them ... on top of that of course if i forget to manually copy the stuff over the app winds up breaking in spectacular fashion.
The question here becomes why would grunt/bower be putting my dependencies in app/bower_dep rather than /bower_dep like it does on everyone elses machine?

Related

Remove error logging in production using webpack

I have a React/Next.js website which I created using create-next-app so it handles all of the webpack stuff for me. I know very little about webpack or how to configure it so my question might seem incredibly simple to some.
I have my own logging service which I call using log.info() instead of console.log().
I'd like to remove every line which contains "log.info(" and anything after it (and whitespace before it). It should do this only when doing a next build (for production), not when you do npm run dev.
I'm hoping I can achieve this with some kind of webpack plugin or script and I'm hoping I can run it before Next/Webpack does it's thing and minifies everything onto one line.
I'd appreciate any shove int he right direction as googling has drawn a blank.

Is it right to think that all dependencies in a React-webpack web app package.json are dev dependencies?

I have a React-webpack web app (client side only - no API server) and was tidying up the package.json file and it occurred to me that all of the dependencies are dev dependencies as you do not run the React web app in production - you build it and distribute the built files.
Is this right?
React and possibly ReactDOM would be dependencies. Any additional libraries you're using that appear on the page would also be dependencies (example: react-autosuggest). Everything else would generally be a devDependency.
There's no great consensus on this yet (see this webpack issue, for instance). Some folks want to do everything as a dependency, others as a devDependency, I'm sure you could make a case for bundled dependencies, etc. The solution I outlined above is a best practice that seems to work well. For example, if you're using a version range on a package, you likely wouldn't care about minor/patch version change to webpack, eslint, karma, mocha, etc. You'd most certainly care about even a patch level change to something like react, so it gets separated out into a much shorter dependency list. (Looking at one project, there seems to be a 4-5x difference between dependency and devDependency. It's much easier to spot the meaningful changes if you corral them into the dependency tree.)
Related: yarn takes the approach I outlined above.

Gradle for AngularJS Application

I´m pretty new to gradle and currently there is question that bugs me. The situation appears as follows: Based on a bower technology stack I implemented an Angular App. The app as it is doesn't change nor has it to be built in any way since there are just static javascript and HTML pages. In my opinion the used versions of angular, bootstrap and other libraries should also stay the same due to compatibility of the single libraries so these files also shouldn't change. Is this a correct behavior or should I get at least the latest build of the used libraries version as I deploy the application?
Also less is used in the application. Is there a way to compile the CSS every time I run the gradle build file or should I deliver just the compiled and finished CSS file?
As a result I´m also not quite sure if it's recommended at all using gradle to deploy an "static" angular application.
I hope someone out there can help me to answer the questions above. As you can guess, I´m not very experienced at deploying of such angular applications since this is my first project with this kind of problem.
This goes for all package managers, not just gradle but npm, gem, nuget, maven, whatever.
Use static dependancy version numbers. Otherwise you will end up finding breaking dependencies in QA or Prod rather than production.
This means you need to be aware of security fixes in your dependencies.
When you need a feature or fix in a new version of your dependencies, unlock the versions, rebuild and test in dev. Re-lock the dependencies and send to QA for verification.

Should Bower be Updating a Package Every Time Repeatedly?

Not much to the question really - I have an error when trying to build with gulp (first highlight). I noticed when I run "bower update bootswatch," it downloads something every time. I have very little experience with package management, so I was wondering if this is a problem, and if it is, what I can do about it.
Edit: An important note is that it doesn't reinstall/re-download any of the other tens of packages.
Edit 2: On the end of the big rectangle there is a covered-up part: "invalid-meta bootswatch is missing "main" entry in bower.json" - is this important?
Just based on the history of bower questions on here, I am guessing no one has any clue as to what's going on, understandably - neither do I. With that said, I am posting a lazy "solution": After verifying versions and such are exactly the same with a co-worker, but the file content is different, my coworker sent me his bootswatch folder and I copied it into bower components. That fixed it.

angular deployd grunt workflow

I am having a hard time integrating deployd into an already existing angular grunt workflow.
Did somebody ever accomplish to do this easily.
Steps taken so far:
added deployd and grunt-deployd to the proji
adjusted the gruntfile in x many ways
project has a public folder where the angularjs resides.
and the rest is the usual dpd create stuff
now dpd -d gets me to the dashboard but it collides with the grunt modules of the existing project mainly grunt-concurrent and instantly crashes dpd
if I run the proji with grunt server it does load the dashboard on port 7777 but its blank so one can not do anything the dashboard usually offers.
It further does not proxy the api endpoints properly to port 9000 it fails with cannot get.
I have seen projects on git trying to do the same but almost all of them are broken.
https://github.com/taras/grunt-deployd/issues/1
Like this guy that switched away from deployd.
I think its a pity as deployd is such a great thing. My friend said as well if the integration would be easier in situations where you do not want to do stuff with dpd-client and the dashboard white instead of black much more people would love to use it!
I would like to post my gruntfile but wanted to see first if thats useful at all.
Update:
Deployd has been updated to be able to integrate Grunt, Gulp or other dev tools with Deployd.
The documentation page for this feature is available here:
http://docs.deployd.com/docs/server/use-grunt-or-gulp.html
tldr: you just need to add a package.json with deployd in the dependencies and gulp/grunt in your devDependencies.
Old answer: Running deployd with Grunt, Gulp or any other Nodejs module is a known issue.
I proposed a pull request that fixes the problem, but more tests are needed to be accepted.
Temporarily, I use the fork of the pull request and add this repo in my package.json (here's a working example):
"dependencies": {
"deployd": "nicolasritouet/deployd"
}

Resources