generator-razor 14.0.16 → 14.0.18

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
@@ -21,8 +21,8 @@ export default class extends Generator {
21
21
  }
22
22
 
23
23
  async prompting () {
24
- const orange = chalk.hex('#ff8700').bold
25
- const petrol = chalk.hex('#006792')
24
+ const orange = chalk.ansi256(208)
25
+ const petrol = chalk.ansi256(24)
26
26
 
27
27
  this.log(orange(`
28
28
  ██████╗ █████╗ ███████╗ ██████╗ ██████╗
@@ -305,6 +305,17 @@ export default class extends Generator {
305
305
  value: 12
306
306
  }],
307
307
  store: true
308
+ }, {
309
+ type: 'select',
310
+ name: 'Picture',
311
+ message: 'Download TYPO3 picture extension?',
312
+ choices: [{
313
+ name: 'No',
314
+ value: false
315
+ }, {
316
+ name: 'Yes',
317
+ value: true
318
+ }]
308
319
  }]
309
320
 
310
321
  this.props = await this.prompt(prompts)
@@ -351,14 +362,19 @@ export default class extends Generator {
351
362
  async install () {
352
363
  const branch = this._getRazorBranch()
353
364
 
354
- const razorPackage =
365
+ const packages = [
355
366
  `ssh://git@github.com/rafu1987/razor.git#${branch}`
367
+ ]
356
368
 
357
- const picturePackage = await this._getLatestGithubReleasePackage(
358
- 'b13',
359
- 'picture',
360
- 'picture'
361
- )
369
+ if (this.props.Picture) {
370
+ const picturePackage = await this._getLatestGithubReleasePackage(
371
+ 'b13',
372
+ 'picture',
373
+ 'picture'
374
+ )
375
+
376
+ packages.push(picturePackage)
377
+ }
362
378
 
363
379
  await this._runCommand('yarn', [
364
380
  'add',
@@ -366,8 +382,7 @@ export default class extends Generator {
366
382
  '--no-lockfile',
367
383
  '--modules-folder',
368
384
  'typo3conf/ext/',
369
- razorPackage,
370
- picturePackage
385
+ ...packages
371
386
  ])
372
387
  }
373
388
 
@@ -399,9 +414,10 @@ export default class extends Generator {
399
414
  }
400
415
 
401
416
  await this._fixProjectGroup()
417
+ await this._fixWritableDirectoryPermissions()
402
418
 
403
- const orange = chalk.hex('#ff8700').bold
404
- const petrol = chalk.hex('#006792')
419
+ const orange = chalk.ansi256(208)
420
+ const petrol = chalk.ansi256(24)
405
421
 
406
422
  this.log(orange(`
407
423
  ██████╗ ██████╗ ███╗ ██╗███████╗
@@ -453,6 +469,40 @@ export default class extends Generator {
453
469
  await processPath(destination)
454
470
  }
455
471
 
472
+ async _fixWritableDirectoryPermissions() {
473
+ const writableDirectories = [
474
+ 'fileadmin',
475
+ 'typo3temp',
476
+ 'typo3conf'
477
+ ]
478
+
479
+ for (const directory of writableDirectories) {
480
+ await this._chmodDirectoriesRecursive(
481
+ this.destinationPath(directory)
482
+ )
483
+ }
484
+ }
485
+
486
+ async _chmodDirectoriesRecursive(directory) {
487
+ if (!await fs.pathExists(directory)) {
488
+ return
489
+ }
490
+
491
+ await fs.chmod(directory, 0o2775)
492
+
493
+ const entries = await fs.readdir(directory, {
494
+ withFileTypes: true
495
+ })
496
+
497
+ for (const entry of entries) {
498
+ if (entry.isDirectory()) {
499
+ await this._chmodDirectoriesRecursive(
500
+ path.join(directory, entry.name)
501
+ )
502
+ }
503
+ }
504
+ }
505
+
456
506
  async _getTypo3Releases () {
457
507
  const url = 'https://get.typo3.org/json'
458
508
 
@@ -748,12 +798,11 @@ export default class extends Generator {
748
798
  encryptionKey
749
799
  )
750
800
 
751
- const passwordHash = await argon2.hash(
752
- this.props.Pass,
753
- {
754
- type: argon2.argon2i
755
- }
756
- )
801
+ const passwordHash = await argon2.hash(this.props.Pass, {
802
+ type: this._getTemplateVersion() === '143'
803
+ ? argon2.argon2id
804
+ : argon2.argon2i
805
+ })
757
806
 
758
807
  content = this._substituteMarker(
759
808
  content,
@@ -887,12 +936,11 @@ export default class extends Generator {
887
936
  this.props.User
888
937
  )
889
938
 
890
- const passwordHash = await argon2.hash(
891
- this.props.Pass,
892
- {
893
- type: argon2.argon2i
894
- }
895
- )
939
+ const passwordHash = await argon2.hash(this.props.Pass, {
940
+ type: this._getTemplateVersion() === '143'
941
+ ? argon2.argon2id
942
+ : argon2.argon2i
943
+ })
896
944
 
897
945
  sql = this._substituteMarker(
898
946
  sql,
@@ -5,7 +5,7 @@ return [
5
5
  'explicitADmode' => 'explicitAllow',
6
6
  'installToolPassword' => '###PASS###',
7
7
  'passwordHashing' => [
8
- 'className' => 'TYPO3\\CMS\\Core\\Crypto\\PasswordHashing\\Argon2iPasswordHash',
8
+ 'className' => 'TYPO3\\CMS\\Core\\Crypto\\PasswordHashing\\Argon2idPasswordHash',
9
9
  'options' => [],
10
10
  ],
11
11
  ],
@@ -44,7 +44,7 @@ return [
44
44
  'debug' => false,
45
45
  'disableNoCacheParameter' => true,
46
46
  'passwordHashing' => [
47
- 'className' => 'TYPO3\\CMS\\Core\\Crypto\\PasswordHashing\\Argon2iPasswordHash',
47
+ 'className' => 'TYPO3\\CMS\\Core\\Crypto\\PasswordHashing\\Argon2idPasswordHash',
48
48
  'options' => [],
49
49
  ],
50
50
  ],
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "generator-razor",
3
- "version": "14.0.16",
3
+ "version": "14.0.18",
4
4
  "description": "Yeoman generator for razor TYPO3 distribution",
5
5
  "license": "MIT",
6
6
  "main": "app/index.js",