

Single File Monorepo Config, Custom Workspace Presets, Improved Tailwind Support...
source link: https://blog.nrwl.io/single-file-monorepo-config-custom-workspace-presets-improved-tailwind-support-and-more-in-nx-13-1bc88da334c9
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.

Single File Monorepo Config, Custom Workspace Presets, Improved Tailwind Support, and more in Nx 13.4!
Nx is a smart, extensible build framework to help you architect, test, and build at any scale — integrating seamlessly with modern technologies and libraries while providing a robust CLI, computation caching, dependency management, and more.
If you aren’t familiar with it, learn about Nx at nx.dev.
One Million Weekly Downloads 🎉
Nx reached a major milestone this week of one million weekly downloads. Nx has been working to push monorepos forward for a long time, and this milestone is a reflection of work between us and the Nx community to grow and expand in this space.
One million weekly downloadsSingle File Monorepo Configuration ☝️
When operating with a monorepo, some level of configuration is needed to provide context about the tools and structure for inferring information about projects. Nx has traditionally done this with 2 files, the nx.json that contains global configuration for the Nx CLI, and the workspace.json that contains references to projects within your workspace.
With the latest release of Nx and add-nx-to-monorepo 2.0, there is only the nx.json configuration file added to your existing monorepo, with the project information done through analyzing your workspace for existing projects. This allows you to incrementally adopt Nx into your monorepo to run tasks, cache computations, and more.
npx add-nx-to-monorepo
demoed the flexibility of Nx by migrating Meta’s (Facebook) React repository: video link
Learn more in our guide of adding Nx to an existing workspace and the config inside the nx.json.
Custom Workspace Presets 🎨
Nx provides many presets by default to support many different ecosystems. Nx for monorepos is like VSCode, where plugins allow you to extend the functionality of your monorepo to fit your ecosystem or platform of choice. To make it easier for scaffolding a pre-defined setup, we’ve introduced the ability to use custom presets when creating Nx workspaces with a provided npm package.
npx create-nx-workspace --preset=your-npm-package-namejust joined Nrwl and already implemented this new Nx feature! In the following video, Juri Strumpflohner walks you through the process of creating a new Nx Plugin with a custom preset.
This allows you to enhance the initial experience for new workspaces directly for your organization, and allows the Nx Plugin community to offer more tailored experiences. Please try out the new feature and let us know how we can improve it!
Dedicated TypeScript and JavaScript support with @nrwl/js
Nx has always shipped with great TypeScript support. In version 13.4 we improve it even further by releasing a brand new package: @nrwl/js
.
This is particularly useful if you have framework-agnostic TS/JS packages within an existing Nx workspace but also for those scenarios where you want to build and publish a TS/JS-based library to some package registry. The setup is very lightweight, but still provides all benefits you’d expect from an Nx-based setup such as Jest, ESLint, Prettier etc.
Read all the details on our new TypeScript guide or check out the video walkthrough below.
Improved Tailwind support for Angular 💅
Tailwind LogoTailwind is a utility-first CSS framework packed with classes that can be composed to build any design, directly in your markup. If you’ve used Tailwind with Angular applications previously, it's supported out of the box with Nx. We’re continually looking to improve the developer experience of using Tailwind in Angular applications and libraries. We already added support to the Angular plugin for Nx, and have added a new generator to configure Tailwind in existing apps and buildable/publishable libs, allowing you to set up and configure Tailwind without manual steps. The ability to configure new apps and libs is also supported, with support for Tailwind V2 and the latest V3 release.
nx g @nrwl/angular:app my-app --addTailwind
Read more about Angular and Tailwind in our docs.
Other Highlights 🗒
- Added SWC support for compiling JavaScript libraries and React apps/libs when building projects
- Added migration support Create React App version 5
- Updated the Angular framework to version 13.1
- Update support for Cypress to version 9
- Added additional SCAM generators for Angular for pipes and directives.
- Improved developer experience for using Module Federation with Angular v13
How to Update Nx
Updating Nx is done with the following command, and will update your Nx workspace dependencies and code to the latest version:
nx migrate latest
After updating your dependencies, run any necessary migrations.
nx migrate --run-migrations
Explore More
- Get our free basic Nx workspaces course on YouTube!
- Purchase our premium video course on advanced practices for Nx workspaces: here!
Be sure to click the 👏 so other people will see it. Follow us on Twitter, and subscribe to the YouTube Channel for more information on Angular, React, Nx, and more!
As always, if you are looking for enterprise consulting, training and support, you can find out more about how we work with our clients here.
Recommend
-
27
Lerna 已然成为搭建 monorepo 工程的首选,然而官方文档[1]并没有给出构建 monorepo 项目最后一公里的解决方案。而在这次在迁移搭建全民 K 歌基础库的实践中,在诸如 Orange CI 自动发布 npm 包等问题上就遇到了不少阻碍,我们把经验总结...
-
68
How to create a workspace coverage report in nrwl/nx monorepo?This is going to be a short one. I’m using nrwl/nx a LOT. I’m also testing a LOT. Lately I needed to add a coverage report to one of my nrwl/nx repositories. The coverag...
-
6
Generate a new library to host our page UI componentsWe want to have a library where to host our UI components s.t. they can be easily shared within our Nx workspace. Obviously, in our simple example of a blog platform, right now we...
-
9
From a Single Repo, to Multi-Repos, to Monorepo, to Multi-Monorepo Learn Development at Fr...
-
6
Laravel TALL Preset A front-end preset for Laravel to scaffold an application using the TALL stack, jumpstarting your application's development. If you're not familiar with the name, it's a...
-
16
What are we going to build?The final result of what we are going to be building can be found in this Github repository: https://github.com/leosvelperez/angular-tailwind-nx...
-
5
Early Access Program News CLion 2022.1 EAP6: CMake Presets, Improved CMake Scripts Formatting,...
-
5
前端多个包管理的的方式一般都是采用monorepo的方式去管理,之前都是使用的lerna的workspace去管理。这段时间包管理切换到了pnpm上,它也有worksapce,可以支持monorepo。 monorepo...
-
6
Git Monorepo Improved Performance Oct 20, 2022 • Ylan Segal •...
-
4
最近需要用到多包管理 monorepo 开发新项目,所以提前预研一下项目搭建。 monorepo(monolithic repository)是一种项目架构,就是用一个仓库管理多个项目(应用,库),react和babel的源码仓库都是用这种方式在管理。 优缺点略过,可以参考:
About Joyk
Aggregate valuable and interesting links.
Joyk means Joy of geeK