generator-razor 14.0.25 → 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
@@ -428,6 +428,86 @@ export default class extends Generator {
428
428
  await this._fixProjectGroup()
429
429
  await this._fixWritableDirectoryPermissions()
430
430
 
431
+ const typo3 = this.destinationPath(
432
+ 'typo3/sysext/core/bin/typo3'
433
+ )
434
+
435
+ this.log('→ Activating razor bootstrap...')
436
+
437
+ await this.spawnCommand(
438
+ typo3,
439
+ ['extension:activate', 'razorbootstrap'],
440
+ {
441
+ cwd: this.destinationRoot()
442
+ }
443
+ )
444
+
445
+ this.log('→ Updating TER extension list...')
446
+
447
+ await this.spawnCommand(
448
+ typo3,
449
+ ['razorbootstrap:ter:update'],
450
+ {
451
+ cwd: this.destinationRoot()
452
+ }
453
+ )
454
+
455
+ this.log('→ Installing razor...')
456
+
457
+ await this.spawnCommand(
458
+ typo3,
459
+ ['razorbootstrap:extension:install', 'razor'],
460
+ {
461
+ cwd
462
+ }
463
+ )
464
+
465
+ this.log('→ Deactivating Razor bootstrap...')
466
+
467
+ await this.spawnCommand(
468
+ typo3,
469
+ ['extension:deactivate', 'razorbootstrap'],
470
+ {
471
+ cwd
472
+ }
473
+ )
474
+
475
+ await fs.remove(
476
+ this.destinationPath('typo3conf/ext/razorbootstrap')
477
+ )
478
+
479
+ await fs.remove(
480
+ this.destinationPath('typo3temp/var/cache')
481
+ )
482
+
483
+ this.log('→ Flushing TYPO3 caches...')
484
+
485
+ await this.spawnCommand(
486
+ typo3,
487
+ ['cache:flush'],
488
+ {
489
+ cwd
490
+ }
491
+ )
492
+
493
+ const razorScript = this.destinationPath('razor.sh')
494
+
495
+ if (!await fs.pathExists(razorScript)) {
496
+ throw new Error(
497
+ 'razor.sh was not created during razor installation.'
498
+ )
499
+ }
500
+
501
+ this.log('→ Starting razor installer...')
502
+
503
+ await this.spawnCommand(
504
+ 'bash',
505
+ ['./razor.sh'],
506
+ {
507
+ cwd: this.destinationRoot()
508
+ }
509
+ )
510
+
431
511
  const orange = chalk.ansi256(208)
432
512
  const petrol = chalk.ansi256(24)
433
513
 
@@ -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
+ }
@@ -0,0 +1,51 @@
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\InputInterface;
10
+ use Symfony\Component\Console\Output\OutputInterface;
11
+ use Symfony\Component\Console\Style\SymfonyStyle;
12
+ use TYPO3\CMS\Core\Attribute\AsNonSchedulableCommand;
13
+ use TYPO3\CMS\Extensionmanager\Exception\ExtensionManagerException;
14
+ use TYPO3\CMS\Extensionmanager\Remote\RemoteRegistry;
15
+
16
+ #[AsCommand(
17
+ name: 'razorbootstrap:ter:update',
18
+ description: 'Updates the TYPO3 Extension Repository extension list'
19
+ )]
20
+ #[AsNonSchedulableCommand]
21
+ final class UpdateTerCommand extends Command
22
+ {
23
+ public function __construct(
24
+ private readonly RemoteRegistry $remoteRegistry
25
+ ) {
26
+ parent::__construct();
27
+ }
28
+
29
+ protected function execute(
30
+ InputInterface $input,
31
+ OutputInterface $output
32
+ ): int {
33
+ $io = new SymfonyStyle($input, $output);
34
+
35
+ $io->text('Updating TER extension list...');
36
+
37
+ try {
38
+ foreach ($this->remoteRegistry->getListableRemotes() as $remote) {
39
+ $remote->getAvailablePackages(true);
40
+ }
41
+ } catch (ExtensionManagerException $exception) {
42
+ $io->error($exception->getMessage());
43
+
44
+ return Command::FAILURE;
45
+ }
46
+
47
+ $io->success('TER extension list successfully updated.');
48
+
49
+ return Command::SUCCESS;
50
+ }
51
+ }
@@ -0,0 +1,8 @@
1
+ services:
2
+ _defaults:
3
+ autowire: true
4
+ autoconfigure: true
5
+ public: false
6
+
7
+ RZ\Razorbootstrap\:
8
+ resource: '../Classes/*'
@@ -0,0 +1,24 @@
1
+ {
2
+ "name": "rafu1987/razorbootstrap",
3
+ "type": "typo3-cms-extension",
4
+ "description": "Temporary Razor installation bootstrap",
5
+ "license": "GPL-2.0-or-later",
6
+ "require": {
7
+ "typo3/cms-core": "^14.3",
8
+ "typo3/cms-extensionmanager": "^14.3"
9
+ },
10
+ "autoload": {
11
+ "psr-4": {
12
+ "RZ\\Razorbootstrap\\": "Classes/"
13
+ }
14
+ },
15
+ "extra": {
16
+ "typo3/cms": {
17
+ "extension-key": "razorbootstrap",
18
+ "version": "14.3.0",
19
+ "Package": {
20
+ "providesPackages": {}
21
+ }
22
+ }
23
+ }
24
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "generator-razor",
3
- "version": "14.0.25",
3
+ "version": "14.0.28",
4
4
  "description": "Yeoman generator for razor TYPO3 distribution",
5
5
  "license": "MIT",
6
6
  "main": "app/index.js",