Nx monorepo
- Nx monorepo on https://cloud.nx.app/orgs (opens in a new tab)
Top level targets
Note: Having trouble with cache? Try nx reset
Note: Check for outdated dependencies with pnpm outdated -r, and update them with pnpm update -r
Each of lint,test, build have nx run-many --target=TARGET --all in package.json.
We also have pnpm affected:XXX
pnpm run dev:nx run site:devpnpm run lintpnpm run testpnpm run buildpnpm run affected:lintpnpm run affected:testpnpm run affected:build
Adding a Nextra project
I cloned: https://github.com/shuding/nextra-docs-template (opens in a new tab)
Another option would have been: https://github.com/jaredpalmer/nextra-blank-custom-theme (opens in a new tab), which has tailwind already setup
pnpm run devAdding a go project
This create an app with build serve test and lint commands.
nx run time-go:testnx run time-go:lintnx run time-go:servenx run time-go:build: this builds the binary intodist/apps/time-go
pnpm add -D @nx-go/nx-go
nx g @nx-go/nx-go:app time-go
cd apps/time-go
go mod init github.com/daneroo/phac-garden/apps/time-go
go mod tidySetup
This was only done once, to create the monorepo. It is not a step that needs to be repeated.
# Note I am using pnpm, not npm
pnpm dlx create-nx-workspace phac-garden --preset=empty --cli=nx --packageManager=pnpm --nx-cloud true
# instead of
npx create-nx-workspace@latest phac-garden --cli=nx --packageManager=pnpm --preset=empty
# Remote caching was enabled, and claimed see <https://cloud.nx.app/orgs>