From 68968da74162fdd7b41a78bc98829235dcd79744 Mon Sep 17 00:00:00 2001 From: Daniele Scasciafratte Date: Fri, 27 Jan 2023 18:40:59 +0100 Subject: [PATCH 01/11] node_modules folder inside host, not symlinked --- provision/vvv-init.sh | 2 ++ 1 file changed, 2 insertions(+) diff --git a/provision/vvv-init.sh b/provision/vvv-init.sh index 2be56ab..6bd16ad 100644 --- a/provision/vvv-init.sh +++ b/provision/vvv-init.sh @@ -121,6 +121,8 @@ function try_npm_install() { nvm use fi echo " * Running npm install after svn up/git pull" + mkdir -p ~/wp-develop-node_modules + mount --bind ~/wp-develop-node_modules ./node_modules # Grunt can crash because doesn't find a folder, the workaround is remove the node_modules folder and download all the dependencies again. npm_config_loglevel=error npm install --no-optional echo " * Checking npm install result" From 129848c8e7581f3e90d32713a774e73ef3c18ae7 Mon Sep 17 00:00:00 2001 From: Daniele Scasciafratte Date: Fri, 27 Jan 2023 18:46:27 +0100 Subject: [PATCH 02/11] create folder --- provision/vvv-init.sh | 1 + 1 file changed, 1 insertion(+) diff --git a/provision/vvv-init.sh b/provision/vvv-init.sh index 6bd16ad..2d3a5c5 100644 --- a/provision/vvv-init.sh +++ b/provision/vvv-init.sh @@ -122,6 +122,7 @@ function try_npm_install() { fi echo " * Running npm install after svn up/git pull" mkdir -p ~/wp-develop-node_modules + mkdir -p ./node_modules mount --bind ~/wp-develop-node_modules ./node_modules # Grunt can crash because doesn't find a folder, the workaround is remove the node_modules folder and download all the dependencies again. npm_config_loglevel=error npm install --no-optional From 6165c0bbcfca7c020baadeff03d7df2bae9394e8 Mon Sep 17 00:00:00 2001 From: Daniele Scasciafratte Date: Fri, 27 Jan 2023 18:57:21 +0100 Subject: [PATCH 03/11] Avoid puppeteer --- provision/vvv-init.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/provision/vvv-init.sh b/provision/vvv-init.sh index 2d3a5c5..8b0d29b 100644 --- a/provision/vvv-init.sh +++ b/provision/vvv-init.sh @@ -125,7 +125,7 @@ function try_npm_install() { mkdir -p ./node_modules mount --bind ~/wp-develop-node_modules ./node_modules # Grunt can crash because doesn't find a folder, the workaround is remove the node_modules folder and download all the dependencies again. - npm_config_loglevel=error npm install --no-optional + PUPPETEER_SKIP_DOWNLOAD='true' npm_config_loglevel=error npm install --no-optional echo " * Checking npm install result" if [ $? -eq 1 ]; then echo " ! Issues encounteed, here's the output:" @@ -134,7 +134,7 @@ function try_npm_install() { echo " * Clearing npm cache" npm_config_loglevel=error npm cache clean --force echo " * Running npm install again" - npm_config_loglevel=error noroot npm install --no-optional --force + PUPPETEER_SKIP_DOWNLOAD='true' npm_config_loglevel=error noroot npm install --no-optional --force echo " * Completed npm install command, check output for issues" fi echo " * Finished running npm install" From 987bb0835820989b9ad98b7c9397aca3da89ab0f Mon Sep 17 00:00:00 2001 From: Daniele Scasciafratte Date: Wed, 1 Feb 2023 19:14:08 +0100 Subject: [PATCH 04/11] feat(review): updated --- provision/vvv-init.sh | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/provision/vvv-init.sh b/provision/vvv-init.sh index 8b0d29b..e5aca2a 100644 --- a/provision/vvv-init.sh +++ b/provision/vvv-init.sh @@ -121,11 +121,11 @@ function try_npm_install() { nvm use fi echo " * Running npm install after svn up/git pull" - mkdir -p ~/wp-develop-node_modules - mkdir -p ./node_modules - mount --bind ~/wp-develop-node_modules ./node_modules + noroot mkdir -p ~/wp-develop-"${SITE_TITLE}"-node_modules + noroot mkdir -p ./node_modules + mount --bind ~/wp-develop-"${SITE_TITLE}"-node_modules ./node_modules # Grunt can crash because doesn't find a folder, the workaround is remove the node_modules folder and download all the dependencies again. - PUPPETEER_SKIP_DOWNLOAD='true' npm_config_loglevel=error npm install --no-optional + npm_config_loglevel=error npm install --no-optional echo " * Checking npm install result" if [ $? -eq 1 ]; then echo " ! Issues encounteed, here's the output:" @@ -134,7 +134,7 @@ function try_npm_install() { echo " * Clearing npm cache" npm_config_loglevel=error npm cache clean --force echo " * Running npm install again" - PUPPETEER_SKIP_DOWNLOAD='true' npm_config_loglevel=error noroot npm install --no-optional --force + npm_config_loglevel=error noroot npm install --no-optional --force echo " * Completed npm install command, check output for issues" fi echo " * Finished running npm install" From 1e040bfc1ad71dcffe41ec884ac16bd742b8c974 Mon Sep 17 00:00:00 2001 From: Daniele Scasciafratte Date: Thu, 2 Feb 2023 14:24:53 +0100 Subject: [PATCH 05/11] feat(review): changed path --- provision/vvv-init.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/provision/vvv-init.sh b/provision/vvv-init.sh index e5aca2a..d4a7cb8 100644 --- a/provision/vvv-init.sh +++ b/provision/vvv-init.sh @@ -121,9 +121,9 @@ function try_npm_install() { nvm use fi echo " * Running npm install after svn up/git pull" - noroot mkdir -p ~/wp-develop-"${SITE_TITLE}"-node_modules + noroot mkdir -p ~/.vvv/{SITE_TITLE}/wp_develop_node_modules noroot mkdir -p ./node_modules - mount --bind ~/wp-develop-"${SITE_TITLE}"-node_modules ./node_modules + mount --bind ~/.vvv/{SITE_TITLE}/wp_develop_node_modules ./node_modules # Grunt can crash because doesn't find a folder, the workaround is remove the node_modules folder and download all the dependencies again. npm_config_loglevel=error npm install --no-optional echo " * Checking npm install result" From 148802154100673a6da086348d44b457a47e3829 Mon Sep 17 00:00:00 2001 From: Daniele Scasciafratte Date: Thu, 23 Mar 2023 12:38:24 +0100 Subject: [PATCH 06/11] fix(bash): wrong variable --- provision/vvv-init.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/provision/vvv-init.sh b/provision/vvv-init.sh index d4a7cb8..e14cbb9 100644 --- a/provision/vvv-init.sh +++ b/provision/vvv-init.sh @@ -121,9 +121,9 @@ function try_npm_install() { nvm use fi echo " * Running npm install after svn up/git pull" - noroot mkdir -p ~/.vvv/{SITE_TITLE}/wp_develop_node_modules + noroot mkdir -p ~/.vvv/${SITE_TITLE}/wp_develop_node_modules noroot mkdir -p ./node_modules - mount --bind ~/.vvv/{SITE_TITLE}/wp_develop_node_modules ./node_modules + mount --bind ~/.vvv/${SITE_TITLE}/wp_develop_node_modules ./node_modules # Grunt can crash because doesn't find a folder, the workaround is remove the node_modules folder and download all the dependencies again. npm_config_loglevel=error npm install --no-optional echo " * Checking npm install result" From 206fd9d08cfa2d1de4287122b79dbf38eb04ddb3 Mon Sep 17 00:00:00 2001 From: Daniele Scasciafratte Date: Thu, 23 Mar 2023 13:05:11 +0100 Subject: [PATCH 07/11] wrap path --- provision/vvv-init.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/provision/vvv-init.sh b/provision/vvv-init.sh index e14cbb9..5d8bada 100644 --- a/provision/vvv-init.sh +++ b/provision/vvv-init.sh @@ -121,9 +121,9 @@ function try_npm_install() { nvm use fi echo " * Running npm install after svn up/git pull" - noroot mkdir -p ~/.vvv/${SITE_TITLE}/wp_develop_node_modules + noroot mkdir -p "~/.vvv/${SITE_TITLE}/wp_develop_node_modules" noroot mkdir -p ./node_modules - mount --bind ~/.vvv/${SITE_TITLE}/wp_develop_node_modules ./node_modules + mount --bind "~/.vvv/${SITE_TITLE}/wp_develop_node_modules" ./node_modules # Grunt can crash because doesn't find a folder, the workaround is remove the node_modules folder and download all the dependencies again. npm_config_loglevel=error npm install --no-optional echo " * Checking npm install result" From 204b1ea523e9b8e7b62656b71e7432c185aab92c Mon Sep 17 00:00:00 2001 From: Daniele Scasciafratte Date: Thu, 23 Mar 2023 14:40:44 +0100 Subject: [PATCH 08/11] removed try_grunt_build that was replace with try_npm_build --- provision/vvv-init.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/provision/vvv-init.sh b/provision/vvv-init.sh index 5d8bada..4ed1197 100644 --- a/provision/vvv-init.sh +++ b/provision/vvv-init.sh @@ -191,7 +191,7 @@ fi if [[ "${NPM}" == "true" ]]; then try_npm_install - try_grunt_build + try_npm_build else echo ' * NPM package installation ignored' fi @@ -208,7 +208,7 @@ if [[ "${NPM}" == "true" ]]; then if [[ ! -d "${VVV_PATH_TO_SITE}/public_html/build" ]]; then echo " * Initializing grunt... This may take a few moments." cd "${VVV_PATH_TO_SITE}/public_html/" - try_grunt_build + try_npm_build echo " * Grunt initialized." fi fi From 9af3c0e543fdb366bea80f5a8e9ebc3940f4a7f8 Mon Sep 17 00:00:00 2001 From: Daniele Scasciafratte Date: Thu, 23 Mar 2023 14:52:05 +0100 Subject: [PATCH 09/11] path fix --- provision/vvv-init.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/provision/vvv-init.sh b/provision/vvv-init.sh index 4ed1197..adfd5f1 100644 --- a/provision/vvv-init.sh +++ b/provision/vvv-init.sh @@ -121,9 +121,9 @@ function try_npm_install() { nvm use fi echo " * Running npm install after svn up/git pull" - noroot mkdir -p "~/.vvv/${SITE_TITLE}/wp_develop_node_modules" + noroot mkdir -p ~/.vvv/"${SITE_TITLE}"/wp_develop_node_modules noroot mkdir -p ./node_modules - mount --bind "~/.vvv/${SITE_TITLE}/wp_develop_node_modules" ./node_modules + mount --bind ~/.vvv/"${SITE_TITLE}"/wp_develop_node_modules ./node_modules # Grunt can crash because doesn't find a folder, the workaround is remove the node_modules folder and download all the dependencies again. npm_config_loglevel=error npm install --no-optional echo " * Checking npm install result" From 8a35b6ff5843734cbe7fa33c753d740e06e9748c Mon Sep 17 00:00:00 2001 From: Daniele Scasciafratte Date: Thu, 23 Mar 2023 14:56:50 +0100 Subject: [PATCH 10/11] use absolute path or it will use the root folder --- provision/vvv-init.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/provision/vvv-init.sh b/provision/vvv-init.sh index adfd5f1..fff8c0f 100644 --- a/provision/vvv-init.sh +++ b/provision/vvv-init.sh @@ -121,9 +121,9 @@ function try_npm_install() { nvm use fi echo " * Running npm install after svn up/git pull" - noroot mkdir -p ~/.vvv/"${SITE_TITLE}"/wp_develop_node_modules + noroot mkdir -p /home/vagrant/.vvv/"${SITE_TITLE}"/wp_develop_node_modules noroot mkdir -p ./node_modules - mount --bind ~/.vvv/"${SITE_TITLE}"/wp_develop_node_modules ./node_modules + mount --bind /home/vagrant/.vvv/"${SITE_TITLE}"/wp_develop_node_modules ./node_modules # Grunt can crash because doesn't find a folder, the workaround is remove the node_modules folder and download all the dependencies again. npm_config_loglevel=error npm install --no-optional echo " * Checking npm install result" From 181aec11dce85bf8fb3db217d7146e07c9a944ee Mon Sep 17 00:00:00 2001 From: Daniele Scasciafratte Date: Thu, 23 Mar 2023 16:16:07 +0100 Subject: [PATCH 11/11] npm just execute npm build once --- provision/vvv-init.sh | 1 - 1 file changed, 1 deletion(-) diff --git a/provision/vvv-init.sh b/provision/vvv-init.sh index fff8c0f..5a99e56 100644 --- a/provision/vvv-init.sh +++ b/provision/vvv-init.sh @@ -191,7 +191,6 @@ fi if [[ "${NPM}" == "true" ]]; then try_npm_install - try_npm_build else echo ' * NPM package installation ignored' fi