-
Notifications
You must be signed in to change notification settings - Fork 122
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Local build DX improvements #490
Conversation
I have to adapt Github CI workflow file prior for marking it as ready for review. |
I don't think that integrating Nx can bring any value to the project, it's just another layer on top NPM workspaces. It's bloated and adds another layer of abstraction (= more moving parts). NPM workspaces has everything a monorepo need. Moreover, I believe Lerna could also be ditched because it doesn't bring any value too. |
I could also make some adjustments in order to make it buildable under Windows. |
This is completely wrong. Nx isn't just a layer on top of NPM workspaces, in fact it has nothing to do with NPM workspaces. They're completely different tools. Nx brings a lot of value, especially to a mono repository of this size. Have you even used Nx before? |
You can literally only do two things with NPM workspaces
|
Also, this won't and can't solve the most annoying thing about the current setup which is package linking. |
Yes, when NPM workspaces haven't existed yet and Nx provided what they now call as integrated monorepos. It was useful back then. a) Providing advanced parallel task execution;
Their documentation says exactly what I mentioned: https://nx.dev/recipes/adopting-nx/adding-to-monorepo
Could you please be more specific?
Which are either: In addition to that, I personally don't consider this specific project as a big mono repository.
Could you please clarify what do you mean? Installation-time linking or publish-time linking? |
The main idea is
|
Package managers have been providing their own workspaces for years, it's just NPM that has been behind.
We're relying on dependencies of packages to be built and put into that package's
Yes, those are in my opinion especially important for developer experience.
If you have enabled incremental builds, but I don't see what that has got to do with the forementioned features, because incremental builds does none of that. |
Also, what you seem to have completely missed, which is one of the most important aspects of Nx, is that you have architecture and structure that you must abide by. |
In my opinion the most useless tooling that has been created. Turborepo wasn't that great back when I used it, but perhaps it has become better. |
Of course you're gonna be vendor locked in when you use a build system or a tool. What'd you expect? |
What exactly is being over engineered and reinvented? |
"composite": true, | ||
"types": [ | ||
"pg", | ||
"sqlstring" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why is it needed with this change to list all external types in this tsconfig:types section?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Packages' tsconfig.json files were updated to have compilerOptions.types correctly set, preventing redundant TS compilation from checking types of every node_modules/@types/* package (even not used in a particular monorepo package), which would occur every time a monorepo package is being built. This is because of having a single common node_modules shared across monorepo packages.
Thanks, merged with b3655bb |
Why
My main goal was to be able to install and build monorepo packages locally.
My environment is MacOS and Node v20.8.0 and I was following instructions from
DEVELOPMENT.md
.I haven't recorded all of dozens build errors I've encountered, but I was effectively unable to get packages built.
I want to contribute to this project and these problems were a great obstacle preventing me from doing that.
I hope that these changes will help other potential contributors avoid encountering same problems as I did.
Summary of changes
Local package linking
npm install
command now handles whatlerna bootstrap
andlerna link
handled previously.node_modules
directory, meaningpackages/*/node_modules
will only contain dependencies that are conflicting with other packages' dependencies. For, example,packages/foo/package.json
andpackages/bar/package.json
require[email protected]
andpackages/baz/package.json
requires[email protected]
–/node_modules
would contain[email protected]
andpackages/baz/node_modules
would contain[email protected]
.package-lock.json
file, the one from the project root is used.Other changes
npm install
now automatically installs compilers, allowing to avoid callingnpm run install-compiler
;lerna build
from building them. They seem to be non-buildable in their current state:tsconfig.json
files were updated to havecompilerOptions.types
correctly set, preventing redundant TS compilation from checking types of everynode_modules/@types/*
package (even not used in a particular monorepo package), which would occur every time a monorepo package is being built. This is because of having a single commonnode_modules
shared across monorepo packages.Relinquishment of Rights
Please mark following checkbox to confirm that you relinquish all rights of your changes: