generator-razor 14.0.26 → 14.0.28

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/app/index.js CHANGED
@@ -446,25 +446,31 @@ export default class extends Generator {
446
446
 
447
447
  await this.spawnCommand(
448
448
  typo3,
449
- ['razor-bootstrap:ter:update'],
449
+ ['razorbootstrap:ter:update'],
450
450
  {
451
451
  cwd: this.destinationRoot()
452
452
  }
453
453
  )
454
454
 
455
- this.log('→ Removing razor bootstrap...')
455
+ this.log('→ Installing razor...')
456
456
 
457
457
  await this.spawnCommand(
458
458
  typo3,
459
- ['extension:deactivate', 'razorbootstrap'],
459
+ ['razorbootstrap:extension:install', 'razor'],
460
460
  {
461
- cwd: this.destinationRoot()
461
+ cwd
462
462
  }
463
463
  )
464
464
 
465
- /*
466
- * Remove temporary bootstrap extension and cached DI container
467
- */
465
+ this.log('→ Deactivating Razor bootstrap...')
466
+
467
+ await this.spawnCommand(
468
+ typo3,
469
+ ['extension:deactivate', 'razorbootstrap'],
470
+ {
471
+ cwd
472
+ }
473
+ )
468
474
 
469
475
  await fs.remove(
470
476
  this.destinationPath('typo3conf/ext/razorbootstrap')
@@ -474,23 +480,13 @@ export default class extends Generator {
474
480
  this.destinationPath('typo3temp/var/cache')
475
481
  )
476
482
 
477
- this.log('→ Activating razor...')
478
-
479
- await this.spawnCommand(
480
- typo3,
481
- ['extension:activate', 'razor'],
482
- {
483
- cwd: this.destinationRoot()
484
- }
485
- )
486
-
487
483
  this.log('→ Flushing TYPO3 caches...')
488
484
 
489
485
  await this.spawnCommand(
490
486
  typo3,
491
487
  ['cache:flush'],
492
488
  {
493
- cwd: this.destinationRoot()
489
+ cwd
494
490
  }
495
491
  )
496
492
 
@@ -0,0 +1,87 @@
1
+ <?php
2
+
3
+ declare(strict_types=1);
4
+
5
+ namespace RZ\Razorbootstrap\Command;
6
+
7
+ use Symfony\Component\Console\Attribute\AsCommand;
8
+ use Symfony\Component\Console\Command\Command;
9
+ use Symfony\Component\Console\Input\InputArgument;
10
+ use Symfony\Component\Console\Input\InputInterface;
11
+ use Symfony\Component\Console\Output\OutputInterface;
12
+ use Symfony\Component\Console\Style\SymfonyStyle;
13
+ use TYPO3\CMS\Core\Attribute\AsNonSchedulableCommand;
14
+ use TYPO3\CMS\Core\Core\Bootstrap;
15
+ use TYPO3\CMS\Extensionmanager\Domain\Model\Extension;
16
+ use TYPO3\CMS\Extensionmanager\Service\ExtensionManagementService;
17
+ use TYPO3\CMS\Extensionmanager\Utility\InstallUtility;
18
+
19
+ #[AsCommand(
20
+ name: 'razorbootstrap:extension:install',
21
+ description: 'Installs a TYPO3 extension including its dependencies'
22
+ )]
23
+ #[AsNonSchedulableCommand]
24
+ final class InstallExtensionCommand extends Command
25
+ {
26
+ public function __construct(
27
+ private readonly InstallUtility $installUtility,
28
+ private readonly ExtensionManagementService $extensionManagementService
29
+ ) {
30
+ parent::__construct();
31
+ }
32
+
33
+ protected function configure(): void
34
+ {
35
+ $this->addArgument(
36
+ 'extensionKey',
37
+ InputArgument::REQUIRED,
38
+ 'Extension key to install'
39
+ );
40
+ }
41
+
42
+ protected function execute(
43
+ InputInterface $input,
44
+ OutputInterface $output
45
+ ): int {
46
+ $io = new SymfonyStyle($input, $output);
47
+ $extensionKey = (string)$input->getArgument('extensionKey');
48
+
49
+ Bootstrap::initializeBackendAuthentication();
50
+
51
+ $this->installUtility->reloadAvailableExtensions();
52
+
53
+ $extension = Extension::createFromExtensionArray(
54
+ $this->installUtility->enrichExtensionWithDetails(
55
+ $extensionKey,
56
+ false
57
+ )
58
+ );
59
+
60
+ $result = $this->extensionManagementService
61
+ ->installExtension($extension);
62
+
63
+ if ($result === false) {
64
+ $io->error(
65
+ 'Could not install extension "' . $extensionKey . '".'
66
+ );
67
+
68
+ foreach (
69
+ $this->extensionManagementService->getDependencyErrors() as $errors
70
+ ) {
71
+ foreach ($errors as $error) {
72
+ $io->writeln(
73
+ '<error>' . $error['message'] . '</error>'
74
+ );
75
+ }
76
+ }
77
+
78
+ return Command::FAILURE;
79
+ }
80
+
81
+ $io->success(
82
+ 'Extension "' . $extensionKey . '" successfully installed.'
83
+ );
84
+
85
+ return Command::SUCCESS;
86
+ }
87
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "generator-razor",
3
- "version": "14.0.26",
3
+ "version": "14.0.28",
4
4
  "description": "Yeoman generator for razor TYPO3 distribution",
5
5
  "license": "MIT",
6
6
  "main": "app/index.js",