This guide presents a reliable alternative to npm link for testing local @sistent/sistent changes in Meshery. Since npm link caused issues, this workflow uses a build-and-copy approach to test local changes more reliably.
Step 1: Make Your Changes
Navigate to your local Sistent repository using cd /path/to/localSistent and make the desired changes.
Step 2: Build @sistent/sistent
After making your changes inside this localSistent repository, build the package using make build to generate the latest compiled files. This creates an updated dist/ directory containing your latest changes.
Step 3: Copying the dist files
From your Meshery repository, run these 2 commands:
i. cp -r /path/to/localSistent/dist/* ui/node_modules/@sistent/sistent/dist/
ii. cp -r /path/to/localSistent/dist/* provider-ui/node_modules/@sistent/sistent/dist/
Step 4: Start Meshery in Development Mode
i. Navigate to your local Meshery repository and run make server in one terminal. If you haven’t already, choose a provider and complete the sign-in process.
ii. In another terminal run make ui
Important thing:
While testing your local @sistent/sistent changes, make sure you do not run these commands inside the Meshery repository:
make ui-setup
make ui-build
Both of these commands invoke npm install (npm i) under the hood.
When npm install runs, npm verifies the installed dependencies and replaces the locally copied @sistent/sistent/dist files with the published version from the npm registry. As a result, your local changes are overwritten, and they will no longer appear in Meshery.
If you make additional changes to Sistent, simply
i. Rebuild the package using make build
ii. Copy the updated dist/ files into Meshery’s node_modules as mentioned above
iii. Refresh your browser or restart the UI development server if needed.