generator-razor 14.0.32 → 14.0.34
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 +86 -45
- package/package.json +1 -1
package/app/index.js
CHANGED
|
@@ -425,6 +425,45 @@ export default class extends Generator {
|
|
|
425
425
|
}
|
|
426
426
|
}
|
|
427
427
|
|
|
428
|
+
/*
|
|
429
|
+
* Restore razorbootstrap from the generator template.
|
|
430
|
+
*
|
|
431
|
+
* yarn --modules-folder and Razor's Initialisation/Extensions
|
|
432
|
+
* may have modified typo3conf/ext before this point.
|
|
433
|
+
*/
|
|
434
|
+
const templateVersion = this._getTemplateVersion()
|
|
435
|
+
|
|
436
|
+
const razorBootstrapSource = this.templatePath(
|
|
437
|
+
templateVersion,
|
|
438
|
+
'typo3conf/ext/razorbootstrap'
|
|
439
|
+
)
|
|
440
|
+
|
|
441
|
+
const razorBootstrapDestination = this.destinationPath(
|
|
442
|
+
'typo3conf/ext/razorbootstrap'
|
|
443
|
+
)
|
|
444
|
+
|
|
445
|
+
await fs.remove(
|
|
446
|
+
razorBootstrapDestination
|
|
447
|
+
)
|
|
448
|
+
|
|
449
|
+
await fs.copy(
|
|
450
|
+
razorBootstrapSource,
|
|
451
|
+
razorBootstrapDestination,
|
|
452
|
+
{
|
|
453
|
+
overwrite: true,
|
|
454
|
+
errorOnExist: false,
|
|
455
|
+
dereference: false
|
|
456
|
+
}
|
|
457
|
+
)
|
|
458
|
+
|
|
459
|
+
if (!await fs.pathExists(
|
|
460
|
+
path.join(razorBootstrapDestination, 'composer.json')
|
|
461
|
+
)) {
|
|
462
|
+
throw new Error(
|
|
463
|
+
'razorbootstrap was not copied from the generator template.'
|
|
464
|
+
)
|
|
465
|
+
}
|
|
466
|
+
|
|
428
467
|
await this._fixProjectGroup()
|
|
429
468
|
await this._fixWritableDirectoryPermissions()
|
|
430
469
|
|
|
@@ -432,67 +471,68 @@ export default class extends Generator {
|
|
|
432
471
|
'typo3/sysext/core/bin/typo3'
|
|
433
472
|
)
|
|
434
473
|
|
|
435
|
-
|
|
474
|
+
/*
|
|
475
|
+
* Bootstrap
|
|
476
|
+
*/
|
|
436
477
|
|
|
437
478
|
this.log('→ Activating razor bootstrap...')
|
|
438
479
|
|
|
439
|
-
this.
|
|
480
|
+
await this._runCommand(
|
|
440
481
|
typo3,
|
|
441
|
-
['extension:activate', 'razorbootstrap']
|
|
442
|
-
{
|
|
443
|
-
cwd
|
|
444
|
-
}
|
|
482
|
+
['extension:activate', 'razorbootstrap']
|
|
445
483
|
)
|
|
446
484
|
|
|
447
485
|
this.log('→ Updating TER extension list...')
|
|
448
486
|
|
|
449
|
-
this.
|
|
487
|
+
await this._runCommand(
|
|
450
488
|
typo3,
|
|
451
|
-
['razorbootstrap:ter:update']
|
|
452
|
-
{
|
|
453
|
-
cwd
|
|
454
|
-
}
|
|
489
|
+
['razorbootstrap:ter:update']
|
|
455
490
|
)
|
|
456
491
|
|
|
457
492
|
this.log('→ Removing razor bootstrap...')
|
|
458
493
|
|
|
459
|
-
this.
|
|
494
|
+
await this._runCommand(
|
|
460
495
|
typo3,
|
|
461
|
-
['extension:deactivate', 'razorbootstrap']
|
|
462
|
-
{
|
|
463
|
-
cwd
|
|
464
|
-
}
|
|
496
|
+
['extension:deactivate', 'razorbootstrap']
|
|
465
497
|
)
|
|
466
498
|
|
|
467
499
|
await fs.remove(
|
|
468
|
-
|
|
500
|
+
razorBootstrapDestination
|
|
469
501
|
)
|
|
470
502
|
|
|
503
|
+
/*
|
|
504
|
+
* Clear stale package / DI information
|
|
505
|
+
*/
|
|
506
|
+
|
|
471
507
|
this.log('→ Flushing TYPO3 caches...')
|
|
472
508
|
|
|
473
509
|
await fs.remove(
|
|
474
510
|
this.destinationPath('typo3temp/var/cache')
|
|
475
511
|
)
|
|
476
512
|
|
|
477
|
-
this.
|
|
513
|
+
await this._runCommand(
|
|
478
514
|
typo3,
|
|
479
|
-
['cache:flush']
|
|
480
|
-
{
|
|
481
|
-
cwd
|
|
482
|
-
}
|
|
515
|
+
['cache:flush']
|
|
483
516
|
)
|
|
484
517
|
|
|
518
|
+
/*
|
|
519
|
+
* Install Razor
|
|
520
|
+
*/
|
|
521
|
+
|
|
485
522
|
this.log('→ Activating razor...')
|
|
486
523
|
|
|
487
|
-
this.
|
|
524
|
+
await this._runCommand(
|
|
488
525
|
typo3,
|
|
489
|
-
['extension:activate', 'razor']
|
|
490
|
-
{
|
|
491
|
-
cwd
|
|
492
|
-
}
|
|
526
|
+
['extension:activate', 'razor']
|
|
493
527
|
)
|
|
494
528
|
|
|
495
|
-
|
|
529
|
+
/*
|
|
530
|
+
* Razor's InstallService creates razor.sh
|
|
531
|
+
*/
|
|
532
|
+
|
|
533
|
+
const razorScript = this.destinationPath(
|
|
534
|
+
'razor.sh'
|
|
535
|
+
)
|
|
496
536
|
|
|
497
537
|
if (!await fs.pathExists(razorScript)) {
|
|
498
538
|
throw new Error(
|
|
@@ -500,31 +540,32 @@ export default class extends Generator {
|
|
|
500
540
|
)
|
|
501
541
|
}
|
|
502
542
|
|
|
503
|
-
this.log('→ Starting razor installer...')
|
|
504
|
-
|
|
505
|
-
await this.spawnCommand(
|
|
506
|
-
'bash',
|
|
507
|
-
['./razor.sh'],
|
|
508
|
-
{
|
|
509
|
-
cwd: this.destinationRoot()
|
|
510
|
-
}
|
|
511
|
-
)
|
|
512
|
-
|
|
513
543
|
const orange = chalk.ansi256(208)
|
|
514
544
|
const petrol = chalk.ansi256(24)
|
|
515
545
|
|
|
516
546
|
this.log(orange(`
|
|
517
|
-
|
|
518
|
-
|
|
519
|
-
|
|
520
|
-
|
|
521
|
-
|
|
522
|
-
|
|
523
|
-
|
|
547
|
+
██████╗ ██████╗ ███╗ ██╗███████╗
|
|
548
|
+
██╔══██╗██╔═══██╗████╗ ██║██╔════╝
|
|
549
|
+
██║ ██║██║ ██║██╔██╗ ██║█████╗
|
|
550
|
+
██║ ██║██║ ██║██║╚██╗██║██╔══╝
|
|
551
|
+
██████╔╝╚██████╔╝██║ ╚████║███████╗
|
|
552
|
+
╚═════╝ ╚═════╝ ╚═╝ ╚═══╝╚══════╝
|
|
553
|
+
`))
|
|
524
554
|
|
|
525
555
|
this.log(petrol(
|
|
526
556
|
` ${this.props.ProjectName} was generated successfully.\n`
|
|
527
557
|
))
|
|
558
|
+
|
|
559
|
+
/*
|
|
560
|
+
* Hand over to Razor
|
|
561
|
+
*/
|
|
562
|
+
|
|
563
|
+
this.log('→ Starting razor installer...')
|
|
564
|
+
|
|
565
|
+
await this._runCommand(
|
|
566
|
+
'bash',
|
|
567
|
+
['./razor.sh']
|
|
568
|
+
)
|
|
528
569
|
}
|
|
529
570
|
|
|
530
571
|
async _fixProjectGroup () {
|