generator-razor 14.0.36 → 14.0.37

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
@@ -407,6 +407,9 @@ export default class extends Generator {
407
407
  this.destinationPath('typo3conf/ext/.yarn-integrity')
408
408
  )
409
409
 
410
+ /*
411
+ * Copy Razor extensions provided by the Razor repository.
412
+ */
410
413
  if (this._usesModernTypo3Structure()) {
411
414
  const extensionsSource = this.destinationPath(
412
415
  'typo3conf/ext/razor/Initialisation/Extensions'
@@ -426,10 +429,10 @@ export default class extends Generator {
426
429
  }
427
430
 
428
431
  /*
429
- * Restore temporary extensions from generator templates.
432
+ * Restore temporary extensions from the generator templates.
430
433
  *
431
- * They are copied here because Yarn and Razor's
432
- * Initialisation/Extensions may have modified typo3conf/ext.
434
+ * Yarn and Razor's Initialisation/Extensions may have modified
435
+ * typo3conf/ext before this point.
433
436
  */
434
437
  const templateVersion = this._getTemplateVersion()
435
438
 
@@ -478,10 +481,6 @@ export default class extends Generator {
478
481
 
479
482
  /*
480
483
  * Start TYPO3 with completely fresh caches.
481
- *
482
- * Important before activating the first temporary extension,
483
- * otherwise stale configuration may still reference caches
484
- * removed in newer TYPO3 versions.
485
484
  */
486
485
  this.log('→ Preparing TYPO3 caches...')
487
486
 
@@ -495,15 +494,22 @@ export default class extends Generator {
495
494
  )
496
495
 
497
496
  /*
498
- * Razor Kickstart
497
+ * Activate Razor Kickstart.
498
+ *
499
+ * This extension has no external dependencies and provides
500
+ * the TER update and Razor installation commands.
499
501
  */
500
- this.log('→ Activating Razor kickstart...')
502
+ this.log('→ Activating razor kickstart...')
501
503
 
502
504
  await this._runCommand(
503
505
  typo3,
504
506
  ['extension:activate', 'razorkickstart']
505
507
  )
506
508
 
509
+ /*
510
+ * Update the TER extension list before resolving any
511
+ * Razor dependencies.
512
+ */
507
513
  this.log('→ Updating TER extension list...')
508
514
 
509
515
  await this._runCommand(
@@ -512,29 +518,44 @@ export default class extends Generator {
512
518
  )
513
519
 
514
520
  /*
515
- * Razor Bootstrap
521
+ * Install the complete Razor framework through
522
+ * ExtensionManagementService.
516
523
  *
517
- * Now that the TER extension list is current, TYPO3 can safely
518
- * resolve and download Razor's dependencies.
524
+ * This resolves and installs Razor's TER dependencies,
525
+ * Razor itself, the Razor extensions and Razor Bootstrap.
519
526
  */
520
- this.log('→ Activating Razor bootstrap...')
527
+ this.log('→ Installing razor framework...')
521
528
 
522
529
  await this._runCommand(
523
530
  typo3,
524
- ['extension:activate', 'razorbootstrap']
531
+ ['razorkickstart:install']
532
+ )
533
+
534
+ /*
535
+ * Razor's InstallService should have created razor.sh
536
+ * during dependency installation / activation.
537
+ */
538
+ const razorScript = this.destinationPath(
539
+ 'razor.sh'
525
540
  )
526
541
 
542
+ if (!await fs.pathExists(razorScript)) {
543
+ throw new Error(
544
+ 'razor.sh was not created during Razor installation.'
545
+ )
546
+ }
547
+
527
548
  /*
528
- * Remove temporary extensions.
549
+ * Remove temporary helper extensions.
529
550
  */
530
- this.log('→ Removing Razor bootstrap...')
551
+ this.log('→ Removing razor bootstrap...')
531
552
 
532
553
  await this._runCommand(
533
554
  typo3,
534
555
  ['extension:deactivate', 'razorbootstrap']
535
556
  )
536
557
 
537
- this.log('→ Removing Razor kickstart...')
558
+ this.log('→ Removing razor kickstart...')
538
559
 
539
560
  await this._runCommand(
540
561
  typo3,
@@ -550,8 +571,8 @@ export default class extends Generator {
550
571
  }
551
572
 
552
573
  /*
553
- * Clear stale package / DI caches after removing the
554
- * temporary extensions.
574
+ * Clear package / DI caches after removing the temporary
575
+ * extensions.
555
576
  */
556
577
  this.log('→ Flushing TYPO3 caches...')
557
578
 
@@ -564,28 +585,6 @@ export default class extends Generator {
564
585
  ['cache:flush']
565
586
  )
566
587
 
567
- /*
568
- * Activate Razor.
569
- *
570
- * Razor's InstallService should create razor.sh.
571
- */
572
- this.log('→ Activating Razor...')
573
-
574
- await this._runCommand(
575
- typo3,
576
- ['extension:activate', 'razor']
577
- )
578
-
579
- const razorScript = this.destinationPath(
580
- 'razor.sh'
581
- )
582
-
583
- if (!await fs.pathExists(razorScript)) {
584
- throw new Error(
585
- 'razor.sh was not created during Razor installation.'
586
- )
587
- }
588
-
589
588
  /*
590
589
  * Hand over to the Razor installer.
591
590
  */
@@ -0,0 +1,73 @@
1
+ <?php
2
+
3
+ declare(strict_types=1);
4
+
5
+ /*
6
+ * This file is part of the TYPO3 CMS project.
7
+ *
8
+ * It is free software; you can redistribute it and/or modify it under
9
+ * the terms of the GNU General Public License, either version 2
10
+ * of the License, or any later version.
11
+ *
12
+ * For the full copyright and license information, please read the
13
+ * LICENSE.txt file that was distributed with this source code.
14
+ *
15
+ * The TYPO3 project - inspiring people to share!
16
+ */
17
+
18
+ namespace RZ\Razorkickstart\Command;
19
+
20
+ use Symfony\Component\Console\Attribute\AsCommand;
21
+ use Symfony\Component\Console\Command\Command;
22
+ use Symfony\Component\Console\Input\InputInterface;
23
+ use Symfony\Component\Console\Output\OutputInterface;
24
+ use Symfony\Component\Console\Style\SymfonyStyle;
25
+ use TYPO3\CMS\Extensionmanager\Service\ExtensionManagementService;
26
+
27
+ #[AsCommand(
28
+ name: 'razorkickstart:install',
29
+ description: 'Installs Razor and all required dependencies'
30
+ )]
31
+ final class InstallCommand extends Command
32
+ {
33
+ public function __construct(
34
+ private readonly ExtensionManagementService $extensionManagementService
35
+ ) {
36
+ parent::__construct();
37
+ }
38
+
39
+ protected function execute(
40
+ InputInterface $input,
41
+ OutputInterface $output
42
+ ): int {
43
+ $io = new SymfonyStyle($input, $output);
44
+
45
+ $io->writeln('Installing razor dependencies...');
46
+
47
+ $extension = $this->extensionManagementService->getExtension(
48
+ 'razorbootstrap'
49
+ );
50
+
51
+ $result = $this->extensionManagementService->installExtension(
52
+ $extension
53
+ );
54
+
55
+ if ($result === false) {
56
+ $errors = $this->extensionManagementService
57
+ ->getDependencyErrors();
58
+
59
+ $io->error([
60
+ 'razor dependencies could not be resolved.',
61
+ print_r($errors, true),
62
+ ]);
63
+
64
+ return Command::FAILURE;
65
+ }
66
+
67
+ $io->success(
68
+ 'razor and all dependencies installed successfully.'
69
+ );
70
+
71
+ return Command::SUCCESS;
72
+ }
73
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "generator-razor",
3
- "version": "14.0.36",
3
+ "version": "14.0.37",
4
4
  "description": "Yeoman generator for razor TYPO3 distribution",
5
5
  "license": "MIT",
6
6
  "main": "app/index.js",