What is the best way to import CRA project into existing Nx v15 monorepo? - frontend

Previously I asked about the migration of the Create-React-App project in the case of Nx v14.x.x. For that version of Nx, there was an algorithm for manual migration. Now there is only an automated migration in the documentation, but it is suitable for those who want to create a new Nx project from the existing CRA app. Automated migration isn't convenient if you want to import the CRA app into the existing Nx project.
Why the Nx developers removed manual migration from the docs? Is there a better way to import my CRA project into the existing Nx project?

Related

How to add extra library in ML FLOW which can not be added through conda.yaml

It would be great if you can shed some light.
I m building a data science project using MLFLOW. I can install most of library through conda.yaml. But there is one library which is in azure artifact. which can not be packaged directly. Is there any way we can mention extra libraries for MLFLOW when we run it on databricks/Locally. Which MLFLOW can use it while running

Does NX Cloud and Prisma work together in the CI/CD?

Does Prisma's way of saving the entity files inside the node_modules work within CI/CD if enabling the NX cloud distributed cache?

How to create module/controller of NestJs in a mono-repo with Nx?

I'm trying to use the Nx monorepo approach.
I've created a project with Angular & NestJs:
npx create-nx-workspace --preset=angular-nest
But now I'm trying to create modules.
On a standalone NestJs project, I would usually do something like:
nest g module auth
But if I do it in the root the file doesn't get created in the correct folder. What is the expected approach to develop in such multi-repo environment? should I open each app subfolder in a dedicated VS code? But then I guess I would loose the benefit of shared libraries?
I also think I could move my VS Code terminal in the correct folder, but then each time I open a new one I should go into the correct folder, pretty sure it will leads me to some errors.
THanks
If you're in an Nx workspace, you should be using the nx generator instead of the nest generator.
nx g #nrwl/nest:module auth
nx g #nrwl/nest:controller auth
I believe the generator will ask for which project as well. There's also the Nx Console Plugin for VSCode where you can see the changes before committing to any of them.

Do creating a React app enables ES Modules?

I am learning MERN and starting of the backend section I learned that we have to enable ESM in package.JSON to use import and export but in building frontend with react nothing has to be done
React itself doesn't care.
Whether you do or don't need to configure anything depends on the tools you use for your frontend development.
Eg. create-react-app and Vite configure the bundlers they use to work with ESM, but if you start from scratch, with e.g. your own Webpack configuration, you'll need to figure out the configuration yourself.

How to deploy React app to Prod and how to manage version control

Quick background: I'm a java web developer. I deploy my apps in EARs. I'm not familiar with how the build process works for the new JS frameworks like ReactJS. I have been using WebPack as a build tool but only in dev. I'm trying to keep up with the growing tech because my company is slowly adapting to it.
Question 1
How does the build process work when deploying a React app to a prod app server (or any server at that)?
I'm guessing Node will have to be installed on the app server with WebPack as a globally installed package so when the app is ready to be built, WebPack will kick off its build script in the package.json file that will create your bundle.
Question 2
If the above ^^ is somewhat correct, how do you kick off the WebPack build script?
My company uses IBM's Rational Team Concert as version control. RTC uses Ant scripts as their build so I'm guessing since we have a Spring Boot API that uses Gradle, we can tell the Ant script in RTC to run the Gradle script so the Spring API will build. Right before the Gradle build ends, Gradle can kick off the WebPack build script that will create the bundle.js. And from there you should have a full functioning frontend service just like you would when developing it.
This whole process has a been a headache to wrap my mind around and would like to get some clarification because there's only so much I can research without pulling all of my hair out. I hope I'm somewhat close to the correct way this process works.
In new version webpack (>=4) added new options mode for set environment. For get more information read this tutorial
webpack conf for production
and about deploy (ci,cd), webpack required before build, after build you don't need any js tools (SSR other case). Just create archive (project_${branch_name}.zip) and upload some store like gitlab, awsS3, etc and download when deploy.
I'm recommend don't mixing ui with backend if it possible split project other repository.
Note that RTC has multiple build definition templates. ANT is just one of them. You can also use the Maven build template, the Command Line as well if using the Jazz build engine. If its connected to Hudson/Jenkins for its build functions, you can use those as well.

Resources