MCPcopy Index your code
hub / github.com/erkobridee/nx-nextjs

github.com/erkobridee/nx-nextjs @main

Chat with this repo
repository ↗ · DeepWiki ↗ · + Follow
33 symbols 70 edges 61 files 0 documented · 0%
What it actually does AI analysis from the code graph — generated when you open this
loading…
README

NxNextjs

This project was generated using Nx (v14.5.10)

ℹ️  use the node.js v16 LTS

Goal

  • check how the Next.js works with Nx

  • define shared components and use on the applications

  • define shared assets (also webfonts) to use on the applications

  • load the webfont added to the nx workspace and define to use it on the root tailwind.config.js

Documentation

Project dependency graph

nx dep-graph

implicit - means some sort of manual configuration

Findings

  • it was possible to use the TailwindCSS with SASS inside of the nx workspace

  • Sass: LibSass is Deprecated - sass package | npm

  • the TailwindCSS support is handled through the Postcss supported by the nx workspace

  • it was possible to have Tailwind configuration per application extending the tailwind.config.js from the root

  • it was possible use the Next.js v10 though the Nx Next.js Plugin

  • the Next.js files when we run the development mode, they were place on the dists/apps/{app name}/

    • when we run the build it updates the same folder

    • when we run the export to get the static version, that's generates a inner folder /exported

CLI Commands

  • cleanup cache and dist: npm run clean

app - nx react plugin

  • development: nx serve app

  • build: nx build app

  • with the flag --prod that will do the optimizations for production

  • with the NODE_ENV=production that will trigger the Tailwind css purge

  • test builded: npx serve dist/apps/app

  • lint: nx lint app

  • jsUnit tests: nx test app

  • e2e tests: nx e2e app-e2e

nextjs - nx next.js plugin

  • development: nx serve nextjs

  • build: nx build nextjs

  • with the NODE_ENV=production that will trigger the Tailwind css purge

  • in case of deployment with the server side support from the Next.js, you need to the the current content from the folder dist/apps/nextjs

  • test builded: nx serve nextjs --prod

  • this will work only after run the build

  • export: nx export nextjs

  • with the NODE_ENV=production that will trigger the Tailwind css purge

  • NODE_ENV=production nx export nextjs --prod

  • test exported: npx serve dist/apps/nextjs/exported

  • lint: nx lint nextjs

  • jsUnit tests: nx test nextjs

  • e2e tests: nx e2e nextjs-e2e

shared-components - storybook - nx storybook plugin

  • storybook: nx storybook shared-components

  • build: nx build-storybook shared-components

  • with the NODE_ENV=production that will trigger the Tailwind css purge

  • test builded: npx serve dist/storybook/shared-components

  • lint: nx lint shared-components

  • jsUnit tests: nx test shared-components

Links

Development tip

  • to make my life easier I have the current node_modules from the project mapped to the PATH env variable, that enables me to run the command nx directly, if you don't have if you must use the short cut mapped on the package.json, using it like npm run nx ... or it's also possible to use like npx nx ... (the npx will look into the local installed packages ./node_modules/ and on the global installed packages)

  • ./node_modules/.bin

Known issues on MacOS

Extension points exported contracts — how you extend this code

Chainable (Interface)
(no doc)
apps/nextjs-e2e/src/support/commands.ts
Chainable (Interface)
(no doc)
apps/app-e2e/src/support/commands.ts
Chainable (Interface)
(no doc)
apps/shared-components-e2e/src/support/commands.ts
SharedComponentsProps (Interface)
(no doc)
libs/shared/components/src/lib/shared-components/index.tsx
TargetBlankLinkProps (Interface)
(no doc)
libs/shared/components/src/lib/target-blank-link/index.tsx

Core symbols most depended-on inside this repo

doCopy
called by 2
tools/config/nextjs/helpers/copy-shared-assets.js
login
called by 2
apps/shared-components-e2e/src/support/commands.ts
getGreeting
called by 1
apps/nextjs-e2e/src/support/app.po.ts
render
called by 1
apps/nextjs/src/pages/_document.tsx
getGreeting
called by 1
apps/app-e2e/src/support/app.po.ts
remove
called by 0
tools/scripts/libs/fs-toolkit.js
move
called by 0
tools/scripts/libs/fs-toolkit.js
copy
called by 0
tools/scripts/libs/fs-toolkit.js

Shape

Function 21
Interface 5
Method 5
Class 2

Languages

TypeScript100%

Modules by API surface

tools/scripts/libs/fs-toolkit.js5 symbols
tools/config/webpack/helpers/utils.js4 symbols
apps/nextjs/src/pages/_document.tsx4 symbols
tools/config/nextjs/helpers/copy-shared-assets.js2 symbols
libs/shared/components/src/lib/shared-components/index.tsx2 symbols
apps/shared-components-e2e/src/support/commands.ts2 symbols
apps/nextjs-e2e/src/support/commands.ts2 symbols
apps/app-e2e/src/support/commands.ts2 symbols
tools/config/nextjs/index.js1 symbols
libs/shared/components/src/lib/target-blank-link/index.tsx1 symbols
libs/shared/components/src/lib/target-blank-link/index.stories.tsx1 symbols
libs/shared/components/src/lib/shared-components/index.stories.tsx1 symbols

For agents

$ claude mcp add nx-nextjs \
  -- python -m otcore.mcp_server <graph>

⬇ download graph artifact