generator-razor 14.0.37 → 14.0.38

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
@@ -507,8 +507,7 @@ export default class extends Generator {
507
507
  )
508
508
 
509
509
  /*
510
- * Update the TER extension list before resolving any
511
- * Razor dependencies.
510
+ * Update TER.
512
511
  */
513
512
  this.log('→ Updating TER extension list...')
514
513
 
@@ -518,11 +517,37 @@ export default class extends Generator {
518
517
  )
519
518
 
520
519
  /*
521
- * Install the complete Razor framework through
522
- * ExtensionManagementService.
520
+ * Download all dependencies without activating them.
521
+ */
522
+ this.log('→ Preparing razor dependencies...')
523
+
524
+ await this._runCommand(
525
+ typo3,
526
+ ['razorkickstart:prepare']
527
+ )
528
+
529
+ /*
530
+ * IMPORTANT:
531
+ *
532
+ * Start installation from a fresh TYPO3 bootstrap so newly downloaded
533
+ * extensions are available to dependency injection.
534
+ */
535
+ this.log('→ Preparing TYPO3 for razor installation...')
536
+
537
+ await fs.remove(
538
+ this.destinationPath('typo3temp/var/cache')
539
+ )
540
+
541
+ await this._runCommand(
542
+ typo3,
543
+ ['cache:flush']
544
+ )
545
+
546
+ /*
547
+ * This is a NEW PHP process.
523
548
  *
524
- * This resolves and installs Razor's TER dependencies,
525
- * Razor itself, the Razor extensions and Razor Bootstrap.
549
+ * Container, News, Content Blocks, etc. now physically existed before
550
+ * TYPO3 booted and can therefore participate in DI compilation.
526
551
  */
527
552
  this.log('→ Installing razor framework...')
528
553
 
@@ -26,7 +26,7 @@ use TYPO3\CMS\Extensionmanager\Service\ExtensionManagementService;
26
26
 
27
27
  #[AsCommand(
28
28
  name: 'razorkickstart:install',
29
- description: 'Installs Razor and all required dependencies'
29
+ description: 'Installs the complete Razor framework'
30
30
  )]
31
31
  final class InstallCommand extends Command
32
32
  {
@@ -48,24 +48,23 @@ final class InstallCommand extends Command
48
48
  'razorbootstrap'
49
49
  );
50
50
 
51
- $result = $this->extensionManagementService->installExtension(
52
- $extension
53
- );
51
+ $result = $this->extensionManagementService
52
+ ->installExtension($extension);
54
53
 
55
54
  if ($result === false) {
56
- $errors = $this->extensionManagementService
57
- ->getDependencyErrors();
58
-
59
55
  $io->error([
60
56
  'razor dependencies could not be resolved.',
61
- print_r($errors, true),
57
+ print_r(
58
+ $this->extensionManagementService->getDependencyErrors(),
59
+ true
60
+ ),
62
61
  ]);
63
62
 
64
63
  return Command::FAILURE;
65
64
  }
66
65
 
67
66
  $io->success(
68
- 'razor and all dependencies installed successfully.'
67
+ 'razor framework successfully installed.'
69
68
  );
70
69
 
71
70
  return Command::SUCCESS;
@@ -0,0 +1,81 @@
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:prepare',
29
+ description: 'Downloads all required Razor dependencies'
30
+ )]
31
+ final class PrepareCommand 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('Preparing Razor dependencies...');
46
+
47
+ $extension = $this->extensionManagementService->getExtension(
48
+ 'razorbootstrap'
49
+ );
50
+
51
+ /*
52
+ * Resolve and download dependencies, but do NOT activate them.
53
+ *
54
+ * Activation must happen in a fresh TYPO3 process so the
55
+ * newly downloaded extensions are part of the DI container.
56
+ */
57
+ $this->extensionManagementService
58
+ ->setAutomaticInstallationEnabled(false);
59
+
60
+ $result = $this->extensionManagementService
61
+ ->installExtension($extension);
62
+
63
+ if ($result === false) {
64
+ $io->error([
65
+ 'Razor dependencies could not be resolved.',
66
+ print_r(
67
+ $this->extensionManagementService->getDependencyErrors(),
68
+ true
69
+ ),
70
+ ]);
71
+
72
+ return Command::FAILURE;
73
+ }
74
+
75
+ $io->success(
76
+ 'Razor dependencies successfully prepared.'
77
+ );
78
+
79
+ return Command::SUCCESS;
80
+ }
81
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "generator-razor",
3
- "version": "14.0.37",
3
+ "version": "14.0.38",
4
4
  "description": "Yeoman generator for razor TYPO3 distribution",
5
5
  "license": "MIT",
6
6
  "main": "app/index.js",