generator-razor 14.0.33 → 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.
Files changed (2) hide show
  1. package/app/index.js +86 -50
  2. 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,72 +471,68 @@ export default class extends Generator {
432
471
  'typo3/sysext/core/bin/typo3'
433
472
  )
434
473
 
435
- const cwd = this.destinationRoot()
474
+ /*
475
+ * Bootstrap
476
+ */
436
477
 
437
478
  this.log('→ Activating razor bootstrap...')
438
479
 
439
- this.spawnSync(
480
+ await this._runCommand(
440
481
  typo3,
441
- ['extension:activate', 'razorbootstrap'],
442
- {
443
- cwd,
444
- stdio: 'inherit'
445
- }
482
+ ['extension:activate', 'razorbootstrap']
446
483
  )
447
484
 
448
485
  this.log('→ Updating TER extension list...')
449
486
 
450
- this.spawnSync(
487
+ await this._runCommand(
451
488
  typo3,
452
- ['razorbootstrap:ter:update'],
453
- {
454
- cwd,
455
- stdio: 'inherit'
456
- }
489
+ ['razorbootstrap:ter:update']
457
490
  )
458
491
 
459
492
  this.log('→ Removing razor bootstrap...')
460
493
 
461
- this.spawnSync(
494
+ await this._runCommand(
462
495
  typo3,
463
- ['extension:deactivate', 'razorbootstrap'],
464
- {
465
- cwd,
466
- stdio: 'inherit'
467
- }
496
+ ['extension:deactivate', 'razorbootstrap']
468
497
  )
469
498
 
470
499
  await fs.remove(
471
- this.destinationPath('typo3conf/ext/razorbootstrap')
500
+ razorBootstrapDestination
472
501
  )
473
502
 
503
+ /*
504
+ * Clear stale package / DI information
505
+ */
506
+
474
507
  this.log('→ Flushing TYPO3 caches...')
475
508
 
476
509
  await fs.remove(
477
510
  this.destinationPath('typo3temp/var/cache')
478
511
  )
479
512
 
480
- this.spawnSync(
513
+ await this._runCommand(
481
514
  typo3,
482
- ['cache:flush'],
483
- {
484
- cwd,
485
- stdio: 'inherit'
486
- }
515
+ ['cache:flush']
487
516
  )
488
517
 
518
+ /*
519
+ * Install Razor
520
+ */
521
+
489
522
  this.log('→ Activating razor...')
490
523
 
491
- this.spawnSync(
524
+ await this._runCommand(
492
525
  typo3,
493
- ['extension:activate', 'razor'],
494
- {
495
- cwd,
496
- stdio: 'inherit'
497
- }
526
+ ['extension:activate', 'razor']
498
527
  )
499
528
 
500
- const razorScript = this.destinationPath('razor.sh')
529
+ /*
530
+ * Razor's InstallService creates razor.sh
531
+ */
532
+
533
+ const razorScript = this.destinationPath(
534
+ 'razor.sh'
535
+ )
501
536
 
502
537
  if (!await fs.pathExists(razorScript)) {
503
538
  throw new Error(
@@ -505,31 +540,32 @@ export default class extends Generator {
505
540
  )
506
541
  }
507
542
 
508
- this.log('→ Starting razor installer...')
509
-
510
- await this.spawnCommand(
511
- 'bash',
512
- ['./razor.sh'],
513
- {
514
- cwd: this.destinationRoot()
515
- }
516
- )
517
-
518
543
  const orange = chalk.ansi256(208)
519
544
  const petrol = chalk.ansi256(24)
520
545
 
521
546
  this.log(orange(`
522
- ██████╗ ██████╗ ███╗ ██╗███████╗
523
- ██╔══██╗██╔═══██╗████╗ ██║██╔════╝
524
- ██║ ██║██║ ██║██╔██╗ ██║█████╗
525
- ██║ ██║██║ ██║██║╚██╗██║██╔══╝
526
- ██████╔╝╚██████╔╝██║ ╚████║███████╗
527
- ╚═════╝ ╚═════╝ ╚═╝ ╚═══╝╚══════╝
528
- `))
547
+ ██████╗ ██████╗ ███╗ ██╗███████╗
548
+ ██╔══██╗██╔═══██╗████╗ ██║██╔════╝
549
+ ██║ ██║██║ ██║██╔██╗ ██║█████╗
550
+ ██║ ██║██║ ██║██║╚██╗██║██╔══╝
551
+ ██████╔╝╚██████╔╝██║ ╚████║███████╗
552
+ ╚═════╝ ╚═════╝ ╚═╝ ╚═══╝╚══════╝
553
+ `))
529
554
 
530
555
  this.log(petrol(
531
556
  ` ${this.props.ProjectName} was generated successfully.\n`
532
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
+ )
533
569
  }
534
570
 
535
571
  async _fixProjectGroup () {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "generator-razor",
3
- "version": "14.0.33",
3
+ "version": "14.0.34",
4
4
  "description": "Yeoman generator for razor TYPO3 distribution",
5
5
  "license": "MIT",
6
6
  "main": "app/index.js",