generator-razor 14.0.38 → 14.0.39
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
|
@@ -429,7 +429,7 @@ export default class extends Generator {
|
|
|
429
429
|
}
|
|
430
430
|
|
|
431
431
|
/*
|
|
432
|
-
* Restore temporary extensions from
|
|
432
|
+
* Restore temporary extensions from generator templates.
|
|
433
433
|
*
|
|
434
434
|
* Yarn and Razor's Initialisation/Extensions may have modified
|
|
435
435
|
* typo3conf/ext before this point.
|
|
@@ -497,7 +497,7 @@ export default class extends Generator {
|
|
|
497
497
|
* Activate Razor Kickstart.
|
|
498
498
|
*
|
|
499
499
|
* This extension has no external dependencies and provides
|
|
500
|
-
* the TER update and
|
|
500
|
+
* the TER update and installation commands.
|
|
501
501
|
*/
|
|
502
502
|
this.log('→ Activating razor kickstart...')
|
|
503
503
|
|
|
@@ -507,7 +507,7 @@ export default class extends Generator {
|
|
|
507
507
|
)
|
|
508
508
|
|
|
509
509
|
/*
|
|
510
|
-
* Update TER.
|
|
510
|
+
* Update TER extension list.
|
|
511
511
|
*/
|
|
512
512
|
this.log('→ Updating TER extension list...')
|
|
513
513
|
|
|
@@ -517,7 +517,9 @@ export default class extends Generator {
|
|
|
517
517
|
)
|
|
518
518
|
|
|
519
519
|
/*
|
|
520
|
-
*
|
|
520
|
+
* Resolve and download all missing TER dependencies.
|
|
521
|
+
*
|
|
522
|
+
* Nothing is activated by this command.
|
|
521
523
|
*/
|
|
522
524
|
this.log('→ Preparing razor dependencies...')
|
|
523
525
|
|
|
@@ -527,38 +529,47 @@ export default class extends Generator {
|
|
|
527
529
|
)
|
|
528
530
|
|
|
529
531
|
/*
|
|
530
|
-
*
|
|
532
|
+
* Activate all Razor packages in PackageStates.php.
|
|
531
533
|
*
|
|
532
|
-
*
|
|
533
|
-
*
|
|
534
|
+
* This command must only update package states. It must not
|
|
535
|
+
* perform TCA loading or extension setup in this process.
|
|
534
536
|
*/
|
|
535
|
-
this.log('→
|
|
536
|
-
|
|
537
|
-
await fs.remove(
|
|
538
|
-
this.destinationPath('typo3temp/var/cache')
|
|
539
|
-
)
|
|
537
|
+
this.log('→ Activating razor packages...')
|
|
540
538
|
|
|
541
539
|
await this._runCommand(
|
|
542
540
|
typo3,
|
|
543
|
-
['
|
|
541
|
+
['razorkickstart:install']
|
|
542
|
+
)
|
|
543
|
+
|
|
544
|
+
/*
|
|
545
|
+
* All dependencies now exist physically and are active in
|
|
546
|
+
* PackageStates.php.
|
|
547
|
+
*
|
|
548
|
+
* Remove the old DI/cache state before starting TYPO3 again.
|
|
549
|
+
*/
|
|
550
|
+
this.log('→ Preparing TYPO3 for razor setup...')
|
|
551
|
+
|
|
552
|
+
await fs.remove(
|
|
553
|
+
this.destinationPath('typo3temp/var/cache')
|
|
544
554
|
)
|
|
545
555
|
|
|
546
556
|
/*
|
|
547
|
-
*
|
|
557
|
+
* Fresh TYPO3 process.
|
|
548
558
|
*
|
|
549
|
-
*
|
|
550
|
-
*
|
|
559
|
+
* All Razor dependencies are already active when TYPO3 boots,
|
|
560
|
+
* so their services can participate in DI compilation before
|
|
561
|
+
* extension initialization and TCA loading starts.
|
|
551
562
|
*/
|
|
552
|
-
this.log('→
|
|
563
|
+
this.log('→ Setting up razor framework...')
|
|
553
564
|
|
|
554
565
|
await this._runCommand(
|
|
555
566
|
typo3,
|
|
556
|
-
['
|
|
567
|
+
['extension:setup']
|
|
557
568
|
)
|
|
558
569
|
|
|
559
570
|
/*
|
|
560
|
-
* Razor's InstallService should have
|
|
561
|
-
*
|
|
571
|
+
* Razor's InstallService should have run during extension setup
|
|
572
|
+
* and created razor.sh.
|
|
562
573
|
*/
|
|
563
574
|
const razorScript = this.destinationPath(
|
|
564
575
|
'razor.sh'
|
|
@@ -596,8 +607,8 @@ export default class extends Generator {
|
|
|
596
607
|
}
|
|
597
608
|
|
|
598
609
|
/*
|
|
599
|
-
* Clear package / DI caches after removing the
|
|
600
|
-
* extensions.
|
|
610
|
+
* Clear package / DI caches once more after removing the
|
|
611
|
+
* temporary extensions.
|
|
601
612
|
*/
|
|
602
613
|
this.log('→ Flushing TYPO3 caches...')
|
|
603
614
|
|
|
@@ -2,19 +2,6 @@
|
|
|
2
2
|
|
|
3
3
|
declare(strict_types=1);
|
|
4
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
5
|
namespace RZ\Razorkickstart\Command;
|
|
19
6
|
|
|
20
7
|
use Symfony\Component\Console\Attribute\AsCommand;
|
|
@@ -22,16 +9,20 @@ use Symfony\Component\Console\Command\Command;
|
|
|
22
9
|
use Symfony\Component\Console\Input\InputInterface;
|
|
23
10
|
use Symfony\Component\Console\Output\OutputInterface;
|
|
24
11
|
use Symfony\Component\Console\Style\SymfonyStyle;
|
|
12
|
+
use TYPO3\CMS\Core\Package\PackageManager;
|
|
13
|
+
use TYPO3\CMS\Extensionmanager\Domain\Model\DownloadQueue;
|
|
25
14
|
use TYPO3\CMS\Extensionmanager\Service\ExtensionManagementService;
|
|
26
15
|
|
|
27
16
|
#[AsCommand(
|
|
28
17
|
name: 'razorkickstart:install',
|
|
29
|
-
description: '
|
|
18
|
+
description: 'Activates the complete Razor framework'
|
|
30
19
|
)]
|
|
31
20
|
final class InstallCommand extends Command
|
|
32
21
|
{
|
|
33
22
|
public function __construct(
|
|
34
|
-
private readonly ExtensionManagementService $extensionManagementService
|
|
23
|
+
private readonly ExtensionManagementService $extensionManagementService,
|
|
24
|
+
private readonly DownloadQueue $downloadQueue,
|
|
25
|
+
private readonly PackageManager $packageManager
|
|
35
26
|
) {
|
|
36
27
|
parent::__construct();
|
|
37
28
|
}
|
|
@@ -42,31 +33,79 @@ final class InstallCommand extends Command
|
|
|
42
33
|
): int {
|
|
43
34
|
$io = new SymfonyStyle($input, $output);
|
|
44
35
|
|
|
45
|
-
$io->writeln('
|
|
36
|
+
$io->writeln('Preparing Razor package states...');
|
|
46
37
|
|
|
47
|
-
|
|
38
|
+
/*
|
|
39
|
+
* All TER dependencies have already been downloaded by
|
|
40
|
+
* razorkickstart:prepare.
|
|
41
|
+
*
|
|
42
|
+
* Resolve the complete installation queue again now that
|
|
43
|
+
* every extension is physically available.
|
|
44
|
+
*/
|
|
45
|
+
$this->extensionManagementService->markExtensionForInstallation(
|
|
48
46
|
'razorbootstrap'
|
|
49
47
|
);
|
|
50
48
|
|
|
51
|
-
$
|
|
52
|
-
->
|
|
49
|
+
$dependencyErrors = $this->extensionManagementService
|
|
50
|
+
->getDependencyErrors();
|
|
53
51
|
|
|
54
|
-
if ($
|
|
52
|
+
if ($dependencyErrors !== []) {
|
|
55
53
|
$io->error([
|
|
56
|
-
'
|
|
57
|
-
print_r(
|
|
58
|
-
$this->extensionManagementService->getDependencyErrors(),
|
|
59
|
-
true
|
|
60
|
-
),
|
|
54
|
+
'Razor dependencies could not be resolved.',
|
|
55
|
+
print_r($dependencyErrors, true),
|
|
61
56
|
]);
|
|
62
57
|
|
|
63
58
|
return Command::FAILURE;
|
|
64
59
|
}
|
|
65
60
|
|
|
61
|
+
/*
|
|
62
|
+
* Nothing should need downloading anymore.
|
|
63
|
+
*/
|
|
64
|
+
if (
|
|
65
|
+
!$this->downloadQueue->isQueueEmpty('download')
|
|
66
|
+
|| !$this->downloadQueue->isQueueEmpty('update')
|
|
67
|
+
) {
|
|
68
|
+
$io->error(
|
|
69
|
+
'Razor dependencies are not completely prepared.'
|
|
70
|
+
);
|
|
71
|
+
|
|
72
|
+
return Command::FAILURE;
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
$installQueue = $this->downloadQueue
|
|
76
|
+
->resetExtensionInstallStorage();
|
|
77
|
+
|
|
78
|
+
if ($installQueue === []) {
|
|
79
|
+
$io->error(
|
|
80
|
+
'No Razor extensions were found in the installation queue.'
|
|
81
|
+
);
|
|
82
|
+
|
|
83
|
+
return Command::FAILURE;
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
/*
|
|
87
|
+
* IMPORTANT:
|
|
88
|
+
*
|
|
89
|
+
* Do NOT use InstallUtility or PackageActivationService here.
|
|
90
|
+
*
|
|
91
|
+
* activatePackage() only updates PackageStates.php and does
|
|
92
|
+
* not immediately rebuild TCA. The actual TYPO3 setup happens
|
|
93
|
+
* in a fresh process afterwards.
|
|
94
|
+
*/
|
|
95
|
+
foreach (array_keys($installQueue) as $extensionKey) {
|
|
96
|
+
$io->writeln(
|
|
97
|
+
sprintf('Activating package %s...', $extensionKey)
|
|
98
|
+
);
|
|
99
|
+
|
|
100
|
+
$this->packageManager->activatePackage(
|
|
101
|
+
$extensionKey
|
|
102
|
+
);
|
|
103
|
+
}
|
|
104
|
+
|
|
66
105
|
$io->success(
|
|
67
|
-
'
|
|
106
|
+
'Razor package states successfully prepared.'
|
|
68
107
|
);
|
|
69
108
|
|
|
70
109
|
return Command::SUCCESS;
|
|
71
110
|
}
|
|
72
|
-
}
|
|
111
|
+
}
|
|
@@ -42,7 +42,7 @@ final class PrepareCommand extends Command
|
|
|
42
42
|
): int {
|
|
43
43
|
$io = new SymfonyStyle($input, $output);
|
|
44
44
|
|
|
45
|
-
$io->writeln('Preparing
|
|
45
|
+
$io->writeln('Preparing razor dependencies...');
|
|
46
46
|
|
|
47
47
|
$extension = $this->extensionManagementService->getExtension(
|
|
48
48
|
'razorbootstrap'
|