-
Notifications
You must be signed in to change notification settings - Fork 62
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Adds initial documentation for NPM package installation
- Loading branch information
Showing
1 changed file
with
59 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,61 @@ | ||
# Npm package | ||
|
||
soon | ||
## Installation via NPM Registry (recommended) | ||
|
||
The easiest way to install Garaga is via your prefered Node.js package manager, such as `npm` or `yarn`. | ||
|
||
1. Open your terminal or command prompt. | ||
2. Run the following command: | ||
|
||
```bash | ||
npm i -S garaga | ||
``` | ||
|
||
or | ||
|
||
```bash | ||
yarn add garaga | ||
``` | ||
|
||
{% hint style="info" %} | ||
{% endhint %} | ||
|
||
## Building the package from source code | ||
|
||
The package can be build directly from source code by cloning the garaga repository. Make sure you have both [Rust](https://www.rust-lang.org/tools/install) and [Node.js](https://nodejs.org/en/learn/getting-started/how-to-install-nodejs) installed in you machine. | ||
|
||
1. Open your terminal or command prompt. | ||
2. Install wasm-pack by running: | ||
```bash | ||
cargo install wasm-pack | ||
``` | ||
3. Run the following commands: | ||
|
||
```bash | ||
git clone https://github.com/keep-starknet-strange/garaga.git | ||
cd tools/npm/garaga_ts | ||
npm ci | ||
npm run build | ||
npm pack | ||
``` | ||
4. The .tgz file with the package contents will be available in the current folder. | ||
5. Install the .tgz file in your project | ||
```bash | ||
npm i -S <path-to-tgz-package-file> | ||
``` | ||
|
||
For reproducible builds, one can use instead docker compose. Make sure [docker](https://docs.docker.com/engine/install/) is installed in you machine. | ||
|
||
1. Open your terminal or command prompt. | ||
2. Run the following commands: | ||
|
||
```bash | ||
git clone https://github.com/keep-starknet-strange/garaga.git | ||
cd tools/npm/garaga_ts | ||
docker compose up --build | ||
``` | ||
3. The .tgz file with the package contents will be available in the current folder. | ||
4. Install the .tgz file in your project | ||
```bash | ||
npm i -S <path-to-tgz-package-file> | ||
``` |