NextJS
This package allows creating GenesisX themed NextJS templates.
Usage
To create NextJS microApps, you can follow the steps outlined below:
Pre-requisites
- Make sure you are on correct version of Nodejs 18.x and Nx Version 16.6
node --version
nx --version
- To start with, create a new GenesisX workspace in an empty directory, run below command, of if you already have the workspace ready , please skip this step.
npx @genesisx/create-workspace
- Provide the requested parameters
- Provide name to your workspace like test-workspace
- Move to the created workspace -
cd test-workspace
- Install the packages
yarn install
- Install NextJS package
yarn add @genesisx/next
- Now follow either of the two modes(mentioned below) to use this generator - either the Nx Console or CLI
Via Nx Console
Goto Nx console and search for
nx generate @genesisx/next:templated
Enter the following
- appName: Genesis sample react name
- docs: Full https url to the docs can be entered (Optional)
This creates a new working directory
Via Command line
To integrate this package in your application, use below command:
nx generate @genesisx/next:templated <appName> <optional_doc_path> --no-interactive
Testing the app
You can test the newly created app using the nx serve command
nx serve <appName>
Running build and lints
To execute the lint checks on this package, run
nx lint next
To build this package, run
nx build next
To execute the unit tests via Jest, run
nx test next
More details & Troubleshooting
Visit the troubleshooting guide for common issues or refer to the readme.md file located within the package folder
<workspace-folder>/node_modules/@genesisx/next/README.md