Use `yarn` instead of `npm` for package management. Lock dependencies.
Signed-off-by: Igor Mandrigin <i@mandrigin.ru>
This commit is contained in:
parent
91e5ac3ccd
commit
37ef82b04d
6
Makefile
6
Makefile
|
@ -45,7 +45,7 @@ setup: ##@prepare Install all the requirements for status-react
|
||||||
|
|
||||||
prepare-desktop: ##@prepare Install desktop platform dependencies and prepare workspace
|
prepare-desktop: ##@prepare Install desktop platform dependencies and prepare workspace
|
||||||
scripts/prepare-for-platform.sh desktop
|
scripts/prepare-for-platform.sh desktop
|
||||||
npm install
|
yarn install --frozen-lockfile
|
||||||
|
|
||||||
$(STATUS_GO_IOS_ARCH):
|
$(STATUS_GO_IOS_ARCH):
|
||||||
curl --fail --silent --location \
|
curl --fail --silent --location \
|
||||||
|
@ -78,7 +78,7 @@ $(STATUS_GO_DRO_ARCH):
|
||||||
|
|
||||||
prepare-ios: $(STATUS_GO_IOS_ARCH) ##@prepare Install and prepare iOS-specific dependencies
|
prepare-ios: $(STATUS_GO_IOS_ARCH) ##@prepare Install and prepare iOS-specific dependencies
|
||||||
scripts/prepare-for-platform.sh ios
|
scripts/prepare-for-platform.sh ios
|
||||||
npm install
|
yarn install --frozen-lockfile
|
||||||
unzip -q -o "$(STATUS_GO_IOS_ARCH)" -d "$(RCTSTATUS_DIR)"
|
unzip -q -o "$(STATUS_GO_IOS_ARCH)" -d "$(RCTSTATUS_DIR)"
|
||||||
ifeq ($(OS),Darwin)
|
ifeq ($(OS),Darwin)
|
||||||
cd ios && pod install
|
cd ios && pod install
|
||||||
|
@ -86,7 +86,7 @@ endif
|
||||||
|
|
||||||
prepare-android: $(STATUS_GO_DRO_ARCH) ##@prepare Install and prepare Android-specific dependencies
|
prepare-android: $(STATUS_GO_DRO_ARCH) ##@prepare Install and prepare Android-specific dependencies
|
||||||
scripts/prepare-for-platform.sh android
|
scripts/prepare-for-platform.sh android
|
||||||
npm install
|
yarn install --frozen-lockfile
|
||||||
cd android && ./gradlew react-native-android:installArchives
|
cd android && ./gradlew react-native-android:installArchives
|
||||||
|
|
||||||
prepare-mobile: prepare-android prepare-ios ##@prepare Install and prepare mobile platform specific dependencies
|
prepare-mobile: prepare-android prepare-ios ##@prepare Install and prepare mobile platform specific dependencies
|
||||||
|
|
|
@ -17,7 +17,7 @@ pipeline {
|
||||||
options {
|
options {
|
||||||
timestamps()
|
timestamps()
|
||||||
/* Prevent Jenkins jobs from running forever */
|
/* Prevent Jenkins jobs from running forever */
|
||||||
timeout(time: 25, unit: 'MINUTES')
|
timeout(time: 35, unit: 'MINUTES')
|
||||||
/* Limit builds retained */
|
/* Limit builds retained */
|
||||||
buildDiscarder(logRotator(
|
buildDiscarder(logRotator(
|
||||||
numToKeepStr: '60',
|
numToKeepStr: '60',
|
||||||
|
|
|
@ -57,7 +57,7 @@ def installJSDeps(platform) {
|
||||||
sh "scripts/prepare-for-platform.sh ${platform}"
|
sh "scripts/prepare-for-platform.sh ${platform}"
|
||||||
while (!installed && attempt <= maxAttempts) {
|
while (!installed && attempt <= maxAttempts) {
|
||||||
println("#${attempt} attempt to install npm deps")
|
println("#${attempt} attempt to install npm deps")
|
||||||
sh 'npm install'
|
sh 'yarn install --frozen-lockfile'
|
||||||
installed = fileExists('node_modules/web3/index.js')
|
installed = fileExists('node_modules/web3/index.js')
|
||||||
attemp = attempt + 1
|
attemp = attempt + 1
|
||||||
}
|
}
|
||||||
|
|
|
@ -55,7 +55,7 @@ RUN apt-get update && apt-get -q -y --no-install-recommends install curl softwar
|
||||||
libx11-xcb1 libxss1 libasound2 libgl-dev libsm6 libxrandr2 python-dev \
|
libx11-xcb1 libxss1 libasound2 libgl-dev libsm6 libxrandr2 python-dev \
|
||||||
libjasper-dev libegl1-mesa libxcomposite-dev libxcursor-dev && \
|
libjasper-dev libegl1-mesa libxcomposite-dev libxcursor-dev && \
|
||||||
locale-gen en_US.UTF-8 && \
|
locale-gen en_US.UTF-8 && \
|
||||||
npm install -g npm@5.5.1 && \
|
npm install -g yarn@1.12.3 && \
|
||||||
apt-get clean && rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/* /usr/share/man
|
apt-get clean && rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/* /usr/share/man
|
||||||
|
|
||||||
RUN cd /tmp && wget -q https://cmake.org/files/v3.12/cmake-3.12.2-Linux-x86_64.tar.gz && \
|
RUN cd /tmp && wget -q https://cmake.org/files/v3.12/cmake-3.12.2-Linux-x86_64.tar.gz && \
|
||||||
|
|
|
@ -25,7 +25,7 @@ RUN apt-get update && apt-get -q -y --no-install-recommends install curl softwar
|
||||||
libx11-xcb1 libxss1 libasound2 libgl-dev libsm6 libxrandr2 python-dev \
|
libx11-xcb1 libxss1 libasound2 libgl-dev libsm6 libxrandr2 python-dev \
|
||||||
libjasper-dev libegl1-mesa libxcomposite-dev libxcursor-dev && \
|
libjasper-dev libegl1-mesa libxcomposite-dev libxcursor-dev && \
|
||||||
locale-gen en_US.UTF-8 && \
|
locale-gen en_US.UTF-8 && \
|
||||||
npm install -g npm@5.5.1 && \
|
npm install -g yarn@1.12.3 && \
|
||||||
apt-get clean && rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/* /usr/share/man && \
|
apt-get clean && rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/* /usr/share/man && \
|
||||||
python3 -m pip install --upgrade pip && \
|
python3 -m pip install --upgrade pip && \
|
||||||
pip3 install conan==1.9.0
|
pip3 install conan==1.9.0
|
||||||
|
|
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
|
@ -69,6 +69,8 @@ RUN mkdir -p $LEIN_INSTALL \
|
||||||
|
|
||||||
# Install React-Native
|
# Install React-Native
|
||||||
RUN npm install -g react-native-cli
|
RUN npm install -g react-native-cli
|
||||||
|
# Install Yarn
|
||||||
|
RUN npm install -g yarn@1.12.3
|
||||||
|
|
||||||
# Add files needed for installing dependencies
|
# Add files needed for installing dependencies
|
||||||
# Use directory /build for that purpose
|
# Use directory /build for that purpose
|
||||||
|
@ -80,7 +82,7 @@ ADD ./project.clj ./
|
||||||
|
|
||||||
ADD ./package.json package-lock.json ./
|
ADD ./package.json package-lock.json ./
|
||||||
|
|
||||||
RUN npm install
|
RUN yarn install --frozen-lockfile
|
||||||
|
|
||||||
ADD . ./
|
ADD . ./
|
||||||
|
|
||||||
|
|
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
|
@ -155,7 +155,7 @@ function buildClojureScript() {
|
||||||
|
|
||||||
# Add path to javascript bundle to package.json
|
# Add path to javascript bundle to package.json
|
||||||
jsBundleLine="\"desktopJSBundlePath\": \"$WORKFOLDER/Status.jsbundle\""
|
jsBundleLine="\"desktopJSBundlePath\": \"$WORKFOLDER/Status.jsbundle\""
|
||||||
jsPackagePath=$(joinExistingPath "$STATUSREACTPATH" 'desktop_files/package.json')
|
jsPackagePath=$(joinExistingPath "$STATUSREACTPATH" 'desktop_files/package.json.orig')
|
||||||
if grep -Fq "$jsBundleLine" "$jsPackagePath"; then
|
if grep -Fq "$jsBundleLine" "$jsPackagePath"; then
|
||||||
echo -e "${GREEN}Found line in package.json.${NC}"
|
echo -e "${GREEN}Found line in package.json.${NC}"
|
||||||
else
|
else
|
||||||
|
|
|
@ -210,20 +210,33 @@ function install_react_native_cli() {
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function install_yarn() {
|
||||||
|
if ! program_exists "node"; then
|
||||||
|
npm install -g yarn@1.12.3 # Install the latest yarn
|
||||||
|
else
|
||||||
|
cecho "+ yarn already installed... skipping."
|
||||||
|
fi
|
||||||
|
|
||||||
|
local yarn_version=$(yarn -v)
|
||||||
|
if [[ $yarn_version != "1.12.3" ]]; then
|
||||||
|
cecho "@b@red[[+ yarn version $yarn_version is installed. yarn version 1.12.3 is recommended.]]"
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
function install_node_via_nvm() {
|
function install_node_via_nvm() {
|
||||||
local nvmrc="$(repo_path)/.nvmrc"
|
local nvmrc="$(repo_path)/.nvmrc"
|
||||||
|
|
||||||
cd "$(repo_path)"
|
cd "$(repo_path)"
|
||||||
|
|
||||||
if [ ! -e "$nvmrc" ]; then
|
if [ ! -e "$nvmrc" ]; then
|
||||||
cecho "@b@blue[[+ Installing Node 8 (Node 10 is not supported by Realm and Node 9 doesn't support npm 5.5.1)]]"
|
cecho "@b@blue[[+ Installing Node 9 (Node 10 is not supported by Realm)]]"
|
||||||
|
|
||||||
nvm install 8.9.4
|
nvm install 9.3.0
|
||||||
nvm alias status-im 8.9.4
|
nvm alias status-im 9.3.0
|
||||||
echo status-im > "$nvmrc"
|
echo status-im > "$nvmrc"
|
||||||
|
|
||||||
nvm use status-im
|
nvm use status-im
|
||||||
npm install -g npm@5.5.1 # Explicitly downgrade to v5.5.1 of npm, since Status Desktop builds require it (npm install hangs with version higher than 5.5.1). We could maintain two versions of npm (5.5.1 for Desktop and a more recent on for mobile) but that can be confusing and lead to inconsistent environments
|
|
||||||
else
|
else
|
||||||
local version_alias=$(cat "$nvmrc")
|
local version_alias=$(cat "$nvmrc")
|
||||||
nvm use $version_alias
|
nvm use $version_alias
|
||||||
|
@ -232,10 +245,6 @@ function install_node_via_nvm() {
|
||||||
cecho "+ Node already installed ($version_alias $version via NVM)... skipping."
|
cecho "+ Node already installed ($version_alias $version via NVM)... skipping."
|
||||||
fi
|
fi
|
||||||
|
|
||||||
local npm_version=$(npm -v)
|
|
||||||
if [[ $npm_version != "5.5.1" ]]; then
|
|
||||||
cecho "@b@red[[+ npm version $npm_version is installed. npm version 5.5.1 is recommended.]]"
|
|
||||||
fi
|
|
||||||
}
|
}
|
||||||
|
|
||||||
function install_node_via_package_manager() {
|
function install_node_via_package_manager() {
|
||||||
|
|
|
@ -29,11 +29,11 @@ fi
|
||||||
|
|
||||||
scripts/run-pre-build-check.sh $1
|
scripts/run-pre-build-check.sh $1
|
||||||
|
|
||||||
echo "Creating link: package.json -> ${PLATFORM_FOLDER}/package.json "
|
echo "Creating link: package.json -> ${PLATFORM_FOLDER}/package.json.orig "
|
||||||
ln -sf ${PLATFORM_FOLDER}/package.json package.json
|
ln -sf ${PLATFORM_FOLDER}/package.json.orig package.json
|
||||||
|
|
||||||
echo "Creating link: package-lock.json -> ${PLATFORM_FOLDER}/package-lock.json"
|
echo "Creating link: yarn.lock -> ${PLATFORM_FOLDER}/yarn.lock"
|
||||||
ln -sf ${PLATFORM_FOLDER}/package-lock.json package-lock.json
|
ln -sf ${PLATFORM_FOLDER}/yarn.lock yarn.lock
|
||||||
|
|
||||||
echo "Creating link: VERSION -> ${PLATFORM_FOLDER}/VERSION"
|
echo "Creating link: VERSION -> ${PLATFORM_FOLDER}/VERSION"
|
||||||
ln -sf ${PLATFORM_FOLDER}/VERSION VERSION
|
ln -sf ${PLATFORM_FOLDER}/VERSION VERSION
|
||||||
|
|
|
@ -61,7 +61,7 @@ open -a /Applications/Genymotion.app/Contents/MacOS/player.app --args --vm-name
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Install deps
|
# Install deps
|
||||||
npm install
|
yarn install --frozen-lockfile
|
||||||
|
|
||||||
cd android && ./gradlew react-native-android:installArchives && cd ../
|
cd android && ./gradlew react-native-android:installArchives && cd ../
|
||||||
|
|
||||||
|
|
|
@ -6,6 +6,9 @@ YELLOW='\033[1;33m'
|
||||||
NC='\033[0m'
|
NC='\033[0m'
|
||||||
PLATFORM=""
|
PLATFORM=""
|
||||||
|
|
||||||
|
EXPECTED_NODE_VERSION="v9.3.0" # note the 'v' in front, that is how node does versioning
|
||||||
|
EXPECTED_YARN_VERSION="1.12.3" # note the lack of 'v' in front. inconsistent. :(
|
||||||
|
|
||||||
#if no arguments passed, inform user about possible ones
|
#if no arguments passed, inform user about possible ones
|
||||||
|
|
||||||
if [ $# -eq 0 ]; then
|
if [ $# -eq 0 ]; then
|
||||||
|
@ -15,9 +18,15 @@ else
|
||||||
PLATFORM=$1
|
PLATFORM=$1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
npm_version=$(npm -v)
|
node_version=$(node -v)
|
||||||
if [[ $npm_version != "5.5.1" ]]; then
|
|
||||||
echo -e "${YELLOW}+ npm version $npm_version is installed. npm version 5.5.1 is recommended.${NC}"
|
if [[ $node_version != $EXPECTED_NODE_VERSION ]]; then
|
||||||
|
echo -e "${YELLOW}+ node version $node_version is installed. node version $EXPECTED_NODE_VERSION is recommended.${NC}"
|
||||||
|
fi
|
||||||
|
|
||||||
|
yarn_version=$(yarn -v)
|
||||||
|
if [[ $yarn_version != $EXPECTED_YARN_VERSION ]]; then
|
||||||
|
echo -e "${YELLOW}+ yarn version $yarn_version is installed. yarn version $EXPECTED_YARN_VERSION is recommended.${NC}"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [[ $PLATFORM == 'android' ]]; then
|
if [[ $PLATFORM == 'android' ]]; then
|
||||||
|
|
|
@ -30,6 +30,7 @@ install_clojure_cli
|
||||||
install_leiningen
|
install_leiningen
|
||||||
install_nsis
|
install_nsis
|
||||||
install_node
|
install_node
|
||||||
|
install_yarn
|
||||||
install_watchman
|
install_watchman
|
||||||
install_react_native_cli
|
install_react_native_cli
|
||||||
install_android_sdk
|
install_android_sdk
|
||||||
|
|
Loading…
Reference in New Issue