This repo requires pnpm.
Initialize repo:
pnpm i
Start development version:
pnpm dev
To start local component development you need to follow this steps:
-
Run commands as mentioned in Setup & Development.
-
Navigate to near-discovery-components and follow Local development with BOS-Loader section.
-
(optional) Make a copy of
".env.example"
called".env.local"
.NEXT_PUBLIC_NETWORK_ID
allows you to choose working environment.
Note: The NEXT_PUBLIC_NETWORK_ID
value should be the same as chosen working environment in near-discovery-components
. More about environments.
If you need to make changes to the VM and test locally, you can link your local copy of the VM:
- Clone the VM repo as a sibling of
near-discovery
:
git clone git@github.com:NearSocial/VM.git
Folder Structure:
/near-discovery
/VM
- Make sure both directories are running the exact same version of Node. You can check by running
node --version
. - If you haven't already, run
pnpm i
insidenear-discovery
- Open
near-discovery/next.config.js
and modify by addingexperimental: { esmExternals: 'loose', },
to the root ofconst nextConfig = { ... }
- Inside
near-discovery
, runpnpm link ../VM
- Inside
VM
directory, runrm -rf node_modules pnpm-lock.yaml
, then runyarn
, then runyarn build
- Inside
near-discovery
, runpnpm dev
- Any time you make changes to the
VM
, runyarn build
inside theVM
project in order for the gateway project to pick up the changes
To revert out of local development mode for the VM:
- Inside
near-discovery
, runpnpm unlink ../VM
- Revert the changes to
near-discovery/next.config.js
- Restart
pnpm dev