From 9cb79aa63d14e9ec6cc66c173dd3131d38f1f623 Mon Sep 17 00:00:00 2001 From: Louis Charette Date: Sun, 28 Jan 2024 21:40:03 -0800 Subject: [PATCH] Fix wrong lock file reference --- app/src/Bakery/AssetsInstallCommand.php | 7 +++---- app/src/Bakery/AssetsUpdateCommand.php | 2 +- app/tests/Unit/Bakery/AssetsInstallCommandTest.php | 2 +- 3 files changed, 5 insertions(+), 6 deletions(-) diff --git a/app/src/Bakery/AssetsInstallCommand.php b/app/src/Bakery/AssetsInstallCommand.php index 801e4183..dc474fdf 100644 --- a/app/src/Bakery/AssetsInstallCommand.php +++ b/app/src/Bakery/AssetsInstallCommand.php @@ -44,7 +44,7 @@ protected function configure(): void $help = [ 'This command will install npm dependencies defined in package.json.', 'It will automatically download and install the frontend dependencies in the node_modules directory.', - 'This command doesn\'t update any dependencies. It will install the version locked in the package.lock file.', + 'This command doesn\'t update any dependencies. It will install the version locked in the package-lock.json file.', 'Everything will be executed in the same dir the bakery command is executed.', 'For more info, see https://learn.userfrosting.com/asset-management', ]; @@ -86,14 +86,13 @@ protected function execute(InputInterface $input, OutputInterface $output) return self::SUCCESS; } - // Check if package.lock exists - $lockFile = $path . '/package.lock'; + // Check if package-lock.json exists + $lockFile = $path . '/package-lock.json'; if (!file_exists($lockFile)) { $this->io->note("Lock file `$lockFile` not found. Will install latest versions."); } // Execute command - $this->io->section('Installing npm Dependencies'); if ($this->executeCommand('npm install') !== 0) { $this->io->error('npm dependency installation has failed'); diff --git a/app/src/Bakery/AssetsUpdateCommand.php b/app/src/Bakery/AssetsUpdateCommand.php index 2367d10c..c2109fcc 100644 --- a/app/src/Bakery/AssetsUpdateCommand.php +++ b/app/src/Bakery/AssetsUpdateCommand.php @@ -44,7 +44,7 @@ protected function configure(): void $help = [ 'This command will update npm dependencies defined in package.json.', 'It will automatically download and install the latest version of frontend dependencies in the node_modules directory.', - 'It will install the latest possible version, ignoring package.lock file.', + 'It will install the latest possible version, ignoring package-lock.json file.', 'Everything will be executed in the same dir the bakery command is executed.', 'For more info, see https://learn.userfrosting.com/asset-management', ]; diff --git a/app/tests/Unit/Bakery/AssetsInstallCommandTest.php b/app/tests/Unit/Bakery/AssetsInstallCommandTest.php index 91e0af33..a45cf464 100644 --- a/app/tests/Unit/Bakery/AssetsInstallCommandTest.php +++ b/app/tests/Unit/Bakery/AssetsInstallCommandTest.php @@ -67,7 +67,7 @@ public function testCommand(): void // Assert some output $this->assertSame(0, $result->getStatusCode()); - $this->assertStringContainsString('Lock file `foo/package.lock` not found. Will install latest versions.', $result->getDisplay()); + $this->assertStringContainsString('Lock file `foo/package-lock.json` not found. Will install latest versions.', $result->getDisplay()); $this->assertStringContainsString('npm install', $result->getDisplay()); $this->assertStringContainsString('Dependencies Installed', $result->getDisplay()); }