We are planning to use Mend (WhiteSource) to scan our code in a monorepo. The way Mend works by default is to scan all code in a monorepo after a push to master branch. Is it possible to configure Mend per app in the monorepo and not scan all apps in a monorepo for any change in any of the apps in the monorepo?
Related
I've been working on a project using monorepo and leveraging yarn workspaces.
It consists of several apps and common, e.g.
"server" (TS/Node app),
"web" (React app with Material UI),
"common" (Common JS code used in all apps) , etc.
I am having a hard time understanding what the build and run process should look like in this case.
What I do is:
Building "common"
Building each app individually ("server", "web", etc.)
Then in order to run it I need node_modules, so I copy that from the root of my monorepo into each of the app builds.
Then I deliver this built code + node_modules to remote servers (each app separately) where I start the app.
The problem here is that root node_modules contains dependencies of all the apps I have in my monorepo, e.g. MaterialUI that is not needed at all for "server" node app. As a result each ready-to-ship app weighs over 400MB which is too much.
What I've tried: My first though was that I could move each app out of the monorepo for build purposes and build it individually (expecting to get only what is specified in their own package.json) but they, as I quickly realized, have dependencies on commons from monorepo so the apps can't be built this way.
So it seems to me that I am missing something and not doing it the right way, would anyone please help me out?
Thanks!
I have two react application App1 and App2 and I want to merge them in a single project in way that -
They should use common package.json
They should use common node dependencies.
They should not affect each other configuration and code structure.
I am using default webpack configuration available in the create-react tool.
Thanks in advance.
I develop an application in Angular 2, mongoose, gulp and node.
What hosting service could you use?
What are the steps to mount an application of this type on a hosting server?
Thank you very much!
I recommend using Webpack for handling hosting.
With Webpack it is easy to setup different environments (dev, prod) with many configuration options. It provides a development server and many options to prepare your app for hosting. It supports tree-shaking (dramatically reduces the size of your application) and manages all the loading of your assets.
Hosting depends on your country. You can theoretically use any provider. Angular2 apps do not require any special configuration / plugins / services.
The steps are quite easy: Build your app, configure Webpack according to the guide found in the link above or here(Very nice description of how to build your application for production in an efficient way), and then start the production build via npm as described.
After that you could just drag your application to your ftp server and link the index.html. That's it!
I have a build process involving templating and file copying, which produces what I would like to deploy to Heroku.
But Heroku requires to push your source from a git repository.
What I currently see as my only option is to have a separate git repository, that only holds my build history.
My project is a NodeJS server application.
Is there a better approach?
Thanks.
I have create a grunt-init project template that simplifies the develop-build-deploy cycle of NodeJS server apps deployed on Heroku.
Here it is: https://github.com/nicroto/grunt-init-heroku
This will allow you to have a single repository for your server & client apps, AND do actual build work.
I am basically creating an ignored by git build dir, which I synch-up with your Heroku app. And of course scaffold the project with sample init, build and deploy scripts.
I hope this will be helpful to the community. :)
I have a Node.js Express app that I'm hosting on Nodejitsu. I'm already using env switches in Express for dev and prod, but obviously I'm going to need to push to different dev and prod servers.
For Nodejitsu, pushing to these servers requires a simple jitsu deploy, which looks to my package.json for app and domain/subdomain information.
I'm trying to think of the best way to handle the various pushes to dev and prod (and/r perhaps testing, staging, etc. in the future) given the package.json restriction. Clearly I would like to avoid maintaining several git repos, each with its own slightly different package.json.
What kind of workflow would be ideal for handling this?
We are't using Jitsu, but what we do is keep a couple of different version of the confs around in a confs folder. When we go to deploy our scripts copy the appropriate conf/package.json file in to the root dir.
You may be interested in this: https://github.com/nodejitsu/jitsu/issues/134
As MaĆecki points out in that issue, this can be done with npm scripts. You can have a few script setup in the package.json file(s) that do the appropriate pre-deploy work.