From f7fc2be92b904394d9576b0e8a8d0beee255bc9a Mon Sep 17 00:00:00 2001 From: Bilal Qamar <59555732+BilalQamar95@users.noreply.github.com> Date: Tue, 20 Aug 2024 18:59:37 +0500 Subject: [PATCH 1/4] chore: pin npm@10 --- tubular/scripts/frontend_utils.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/tubular/scripts/frontend_utils.py b/tubular/scripts/frontend_utils.py index bfa8d7a8..bb17a01f 100755 --- a/tubular/scripts/frontend_utils.py +++ b/tubular/scripts/frontend_utils.py @@ -106,11 +106,11 @@ def install_requirements_npm_aliases(self): """ Install NPM alias requirements for app to build """ npm_aliases = self.get_npm_aliases_config() if npm_aliases: - # Install and pin NPM to latest npm@8 version - proc = subprocess.Popen(['npm install npm@8'], cwd=self.app_name, shell=True) + # Install and pin NPM to latest npm@10 version + proc = subprocess.Popen(['npm install npm@10'], cwd=self.app_name, shell=True) return_code = proc.wait() if return_code != 0: - self.FAIL(1, 'Could not run `npm install npm@8` for app {}.'.format(self.app_name)) + self.FAIL(1, 'Could not run `npm install npm@10` for app {}.'.format(self.app_name)) aliased_installs = ' '.join(['{}@{}'.format(k, v) for k, v in npm_aliases.items()]) # Use the locally installed npm at ./node_modules/.bin/npm From 1a893448dbaa1b29f5659609378e947dd04dfff1 Mon Sep 17 00:00:00 2001 From: Bilal Qamar <59555732+BilalQamar95@users.noreply.github.com> Date: Wed, 28 Aug 2024 17:08:47 +0500 Subject: [PATCH 2/4] chore: removed redundant npm install in install_requirements_npm_aliases --- tubular/scripts/frontend_utils.py | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/tubular/scripts/frontend_utils.py b/tubular/scripts/frontend_utils.py index bb17a01f..2b0ee4d3 100755 --- a/tubular/scripts/frontend_utils.py +++ b/tubular/scripts/frontend_utils.py @@ -106,14 +106,8 @@ def install_requirements_npm_aliases(self): """ Install NPM alias requirements for app to build """ npm_aliases = self.get_npm_aliases_config() if npm_aliases: - # Install and pin NPM to latest npm@10 version - proc = subprocess.Popen(['npm install npm@10'], cwd=self.app_name, shell=True) - return_code = proc.wait() - if return_code != 0: - self.FAIL(1, 'Could not run `npm install npm@10` for app {}.'.format(self.app_name)) - aliased_installs = ' '.join(['{}@{}'.format(k, v) for k, v in npm_aliases.items()]) - # Use the locally installed npm at ./node_modules/.bin/npm + # Use the locally installed npm at ./node_modules/.bin/npm to install aliases install_aliases_proc = subprocess.Popen( ['./node_modules/.bin/npm install {}'.format(aliased_installs)], cwd=self.app_name, From 0b4923c780e9734a808ca881ed964d9a05009f40 Mon Sep 17 00:00:00 2001 From: Bilal Qamar <59555732+BilalQamar95@users.noreply.github.com> Date: Wed, 28 Aug 2024 19:09:20 +0500 Subject: [PATCH 3/4] chore: Use global npm for alias installation in install_requirements_npm_aliases --- tubular/scripts/frontend_utils.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tubular/scripts/frontend_utils.py b/tubular/scripts/frontend_utils.py index 2b0ee4d3..868e1905 100755 --- a/tubular/scripts/frontend_utils.py +++ b/tubular/scripts/frontend_utils.py @@ -109,7 +109,7 @@ def install_requirements_npm_aliases(self): aliased_installs = ' '.join(['{}@{}'.format(k, v) for k, v in npm_aliases.items()]) # Use the locally installed npm at ./node_modules/.bin/npm to install aliases install_aliases_proc = subprocess.Popen( - ['./node_modules/.bin/npm install {}'.format(aliased_installs)], + ['npm install {}'.format(aliased_installs)], cwd=self.app_name, shell=True ) From c123cee0381f92e4aad66865951a2f09081ea5ca Mon Sep 17 00:00:00 2001 From: Bilal Qamar <59555732+BilalQamar95@users.noreply.github.com> Date: Wed, 28 Aug 2024 19:19:21 +0500 Subject: [PATCH 4/4] chore: removed unnecessary comment --- tubular/scripts/frontend_utils.py | 1 - 1 file changed, 1 deletion(-) diff --git a/tubular/scripts/frontend_utils.py b/tubular/scripts/frontend_utils.py index 868e1905..3f14f6ad 100755 --- a/tubular/scripts/frontend_utils.py +++ b/tubular/scripts/frontend_utils.py @@ -107,7 +107,6 @@ def install_requirements_npm_aliases(self): npm_aliases = self.get_npm_aliases_config() if npm_aliases: aliased_installs = ' '.join(['{}@{}'.format(k, v) for k, v in npm_aliases.items()]) - # Use the locally installed npm at ./node_modules/.bin/npm to install aliases install_aliases_proc = subprocess.Popen( ['npm install {}'.format(aliased_installs)], cwd=self.app_name,