Replies: 1 comment 1 reply
-
Nx or turbo are compatible with this approach. They don't replace the package manager (yarn, pnpm, npm) NX propose opt-in plugins/presets (storybook, jest, nextjs...) to ease starting with a project. I use Nx, but never used their presets/plugins... I guess with time I've got used to setup pretty all tools by myself and wanted to keep the freedom to use / experiment on the edge (ie: vitest, tsup...). For example with NX, I guess you could start quickly with yarn add -D @nrwl/nx-cloud @nrwl/workspace nx Then create a {
"extends": "nx/presets/npm.json",
"implicitDependencies": {
"package.json": {
"dependencies": "*",
"devDependencies": "*"
},
},
"tasksRunnerOptions": {
"default": {
"runner": "@nrwl/nx-cloud",
"options": {
"accessToken": "<PUT YOUR ACCESS TOKEN>",
"canTrackAnalytics": false,
"showUsageWarnings": true,
"cacheableOperations": [
"build",
"typecheck",
"test",
"test-unit",
"lint",
"lint-styles",
"build-storybook"
]
}
}
},
"targetDependencies": {
"build": [
{
"target": "build",
"projects": "dependencies"
}
]
},
"affected": {
"defaultBase": "main"
},
"pluginsConfig": {
"@nrwl/js": {
"analyzeSourceFiles": false
}
}
} Then run a build for example yarn nx run-many --target=build --all Run it twice to see the cache in effect 😄 (PS: Compare to When adding a solution like NX or Turbo, you'll directly benefit from some speedups. Some tips:
There's more to say, I'll see if I can clarify the readme. But thanks for the question |
Beta Was this translation helpful? Give feedback.
-
Hey, thanks for this repo it's awesome.
I'm wondering what your take is on
nx
as an alternative monorepo solution, and whether its approach is diametrically opposed to the direction taken with this monorepo example? Or can they/should they be used together?The extent of my research thus far is running the command
yarn add-nx-to-monorepo
and installing some code gen plugins for nx, which seems to work fine, but it appears that anything more in-depth than that could be impossible due to the different dependency graph created by nx.Anyway, interested in hearing thoughts on this monorepo vs. nx in general
Beta Was this translation helpful? Give feedback.
All reactions