This PSInnersource accelerator allows a developer to quickly setup a Nextjs based module federated application setup, using turbo as monorepo workspace.
Make sure you use nodejs >= 18.17.0
- In a blank directory , run below command to start using it
npx @genesisx/nextjs-mfe
-
It will ask various inputs like workspace name, container application name, remote app(s) name
-
Once setup, go inside the workspace directory (cd workspace) and build the project
npm run build
- Serve the application as :
npm run dev
- You can access the application on : http://localhost:3000
Please refer the following repo
https://pscode.lioncloud.net/psinnersource/xt/micro-frontend/genesisx/nextjs-accelerator
Please reach out to Devesh Kaushal, Lalit Negi
Step 1 : Build the package npm run build Step 2 : Go to dist directory Step 3 : Run below command
npm publish --access public
NPM Repo : https://www.npmjs.com/package/@genesisx/nextjs-mfe
Node Version >= 18.17.0
- next | 14.1.0
- react | 18.2.0
- turbo | 2.1.1
- webpack | 5.80.0
- zustand | 4.4.3
- @module-federation/nextjs-mf | 8.1.10
- Added support for latest version og turborepo 2.1.1
- spec file addition for the unit testing of each component of the plopfile generator.
- Coverage reports are generated for every file covered each test run.
Run all spec files contained within the workspace:
npm run test
Run specific test files:
npm run test <fileName>.spec.js
Run all tests associated with a name or key word:
npm run <name>
- A major change through restructuring of the codebase to increase readibility.
- Components of the plopfile generator broken down into functions, actions and prompts.
- The plopfile has been reduced in length and all components are imported here for execution
- Added dynamic port mapping to keep track of all micro apps.
- Test cases for provided for templated apps allowing unit tests to be run and built upon out of the box.
- included feature that allows users to append additional micro applications to existing workspaces
- Added support to minify and uglify the published version of code to npm
- Added support for state sharing between multi micro-apps using zustand
- NextJs-MFE: module federation interapp proxy generator with turboRepo workspace support