Skip to content

Commit 296af03

Browse files
author
Yarik Bratashchuk
committed
Node and yarn versions as constants, custom script to install yarn and node
1 parent 813e6c1 commit 296af03

File tree

3 files changed

+79
-2
lines changed

3 files changed

+79
-2
lines changed

.vitepress/constants/constants.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,9 @@
11
const constants = Object.freeze({
22
golangVersion: "1.22.2",
33

4+
nodeVersion: "21.7.2",
5+
yarnVersion: "1.22.19",
6+
47
rollkitLatestTag: "v0.13.3",
58
rollkitLatestSha: "45b1573",
69
rollkitCosmosSDKVersion: "v0.50.6-rollkit-v0.13.3-no-fraud-proofs",

public/install-yarn.sh

Lines changed: 68 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,68 @@
1+
#!/bin/sh
2+
3+
set -e
4+
5+
INSTALL_NODE_VER=21.7.2
6+
INSTALL_NVM_VER=0.39.7
7+
INSTALL_YARN_VER=1.22.19
8+
9+
# You can pass node and yarn versions as arguments to this script
10+
if [ "$1" != '' ]; then
11+
echo "==> Using specified node version - $1"
12+
INSTALL_NODE_VER=$1
13+
fi
14+
if [ "$2" != '' ]; then
15+
echo "==> Using specified yarn version - $2"
16+
INSTALL_YARN_VER=$2
17+
fi
18+
19+
20+
21+
echo "==> Ensuring .bashrc exists and is writable"
22+
touch ~/.bashrc
23+
24+
echo "==> Installing node version manager (NVM). Version $INSTALL_NVM_VER"
25+
# Removed if already installed
26+
rm -rf ~/.nvm
27+
# Unset exported variable
28+
export NVM_DIR=
29+
30+
# Install nvm
31+
curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v$INSTALL_NVM_VER/install.sh | bash
32+
# Make nvm command available to terminal
33+
source ~/.nvm/nvm.sh
34+
35+
echo "==> Installing node js version $INSTALL_NODE_VER"
36+
nvm install $INSTALL_NODE_VER
37+
38+
echo "==> Make this version system default"
39+
nvm alias default $INSTALL_NODE_VER
40+
nvm use default
41+
42+
echo "==> Installing Yarn package manager"
43+
rm -rf ~/.yarn
44+
curl -o- -L https://yarnpkg.com/install.sh | bash -s -- --version $INSTALL_YARN_VER
45+
46+
echo "==> Adding Yarn and Node to environment path"
47+
# Yarn configurations
48+
mv $HOME/.nvm/versions/node/v$INSTALL_NODE_VER/bin/node $HOME/.yarn/bin
49+
50+
export PATH="$HOME/.yarn/bin:$PATH"
51+
yarn config set prefix ~/.yarn -g
52+
53+
echo "==> Checking for versions"
54+
nvm --version
55+
node --version
56+
npm --version
57+
yarn --version
58+
59+
echo "==> Print binary paths"
60+
which npm
61+
which node
62+
which yarn
63+
64+
echo "==> List installed node versions"
65+
nvm ls
66+
67+
nvm cache clear
68+
echo "==> Now you're all setup and ready for development. If changes are yet totake effect, I suggest you restart your computer"

tutorials/gm-world-frontend.md

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,8 @@
1+
<!-- markdownlint-disable MD033 -->
2+
<script setup>
3+
import constants from '../.vitepress/constants/constants.js'
4+
</script>
5+
16
# GM World UI App
27

38
This tutorial aims to demonstrate the user interface (UI) application aspect of connecting a wallet to a rollup, showcasing that it's as straightforward as connecting to any other blockchain. It assumes you have the [Keplr](https://www.keplr.app/) wallet extension installed in your browser.
@@ -9,9 +14,10 @@ Before you start, ensure you have completed the [GM world](/tutorials/gm-world)
914
You will also need Yarn installed for web app development.
1015

1116
:::tip
12-
If you don't have yarn, run this command to install it using cURL on most Linux distros and macOS:
17+
If you don't have yarn or nodejs, run this command to install it using cURL on most Linux distros and macOS:
18+
1319
```bash
14-
curl -o- -L https://yarnpkg.com/install.sh | bash
20+
curl -sSL https://rollkit.dev/install-yarn.sh | sh -s {{constants.nodeVersion}} {{constants.yarnVersion}}
1521
```
1622
:::
1723

0 commit comments

Comments
 (0)