First off, you would want to confirm the following before you proceed further
- You forked the sistent repo
- You have cloned it
- You created a new local branch
- You have a basic understanding of what npm packages are and how they work
If you don’t understand any of the above steps or why they have to be done, feel free to ask.
If you are done with the above and are ready to work with sistent
1. Build and pack your local Sistent fork
Navigate to your local Sistent directory, build the project, and bundle it into a package archive:
Bash
cd <path-to-sistent-on-local-machine>
# Build the Sistent package
make build
# Create a tarball package
npm pack
This creates a file named similar to @sistent-sistent-X.Y.Z.tgz (or sistent-sistent-X.Y.Z.tgz) in your Sistent root directory.
2. Install the local tarball in your project
Navigate to your main project directory (e.g., Meshery UI) and install the newly generated .tgz file as a local dependency:
Bash
cd <path-to-your-project>
# Install the tarball directly
npm install <path-to-sistent-on-local-machine>/sistent-sistent-0.14.11.tgz
(Replace sistent-sistent-0.14.11.tgz with the actual name of the file generated in Step 1).
3. Build your project
Run the build command in the project where your local Sistent fork is installed to apply the changes:
Bash
# Example: Meshery UI
make ui-build
Now, your project will reflect the compiled changes from your local Sistent fork.
Verify local installation
To verify that your project is referencing the local tarball package rather than the registry version, inspect package.json or check npm ls:
Bash
npm ls @sistent/sistent
Expected output:
Plaintext
your-project-name@1.0.0 <path-to-your-project>
└── @sistent/sistent@0.14.11 -> file:../../<path-to-local-sistent-fork>/sistent-sistent-0.14.11.tgz
Revert back to the official package
To discard the local tarball build and revert to the official published package from the npm registry:
Bash
npm install @sistent/sistent@latest