generator-razor 3.2.3 → 4.0.0

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
@@ -293,12 +293,19 @@ module.exports = class extends Generator {
293
293
  version = '95'
294
294
  } else if (rzr.Version.indexOf('11.5') !== -1) {
295
295
  version = '115'
296
+ } else if (rzr.Version.indexOf('12.4') !== -1) {
297
+ version = '124'
296
298
  }
297
299
 
298
300
  this._createSymlinks(this, path, () => {
299
301
  copydir(t.templatePath(version), t.destinationPath('./'), () => {
300
- t._localconf(t)
301
- t._localSettings(t)
302
+ if (version === '124') {
303
+ t._localconf12(t)
304
+ t._local12Settings(t)
305
+ } else {
306
+ t._localconf(t)
307
+ t._localSettings(t)
308
+ }
302
309
 
303
310
  t._createDb((response) => {
304
311
  t._processSqlFile(t, response, () => {
@@ -318,6 +325,8 @@ module.exports = class extends Generator {
318
325
  branch = 'razor9'
319
326
  } else if (rzr.Version.indexOf('11.5') !== -1) {
320
327
  branch = 'razor11'
328
+ } else if (rzr.Version.indexOf('12.4') !== -1) {
329
+ branch = 'razor12-dev'
321
330
  }
322
331
 
323
332
  // yarn settings
@@ -335,7 +344,7 @@ module.exports = class extends Generator {
335
344
  fs.unlink('typo3conf/ext/.yarn-integrity', () => {})
336
345
 
337
346
  // Copy razor extensions after install to typo3conf/ext/, starting with TYPO3 >= 11.5.x
338
- if (rzr.Version.indexOf('11.5') !== -1) {
347
+ if (rzr.Version.indexOf('11.5') !== -1 || rzr.Version.indexOf('12.4') !== -1) {
339
348
  fs.copy('typo3conf/ext/razor/Initialisation/Extensions', 'typo3conf/ext')
340
349
  }
341
350
  }
@@ -350,8 +359,9 @@ module.exports = class extends Generator {
350
359
  const releases9 = body['9']['releases']
351
360
  const releases10 = body['10']['releases']
352
361
  const releases11 = body['11']['releases']
362
+ const releases12 = body['12']['releases']
353
363
 
354
- const releasesObj = t._mergeOptions(releases11, releases10, releases9)
364
+ const releasesObj = t._mergeOptions(releases12, releases11, releases10, releases9)
355
365
 
356
366
  const keys = Object.keys(releasesObj)
357
367
  const len = keys.length
@@ -359,7 +369,7 @@ module.exports = class extends Generator {
359
369
 
360
370
  // Filter out only 11.5.x 10.4.x, 9.5.x
361
371
  for (let i = 0; i < len; i++) {
362
- if (keys[i].indexOf('9.5.') !== -1 || keys[i].indexOf('10.4.') !== -1 || keys[i].indexOf('11.5.') !== -1) {
372
+ if (keys[i].indexOf('9.5.') !== -1 || keys[i].indexOf('10.4.') !== -1 || keys[i].indexOf('11.5.') !== -1 || keys[i].indexOf('12.4.') !== -1) {
363
373
  arr.push({
364
374
  name: keys[i],
365
375
  value: keys[i]
@@ -372,14 +382,15 @@ module.exports = class extends Generator {
372
382
  })
373
383
  }
374
384
 
375
- _mergeOptions (obj1, obj2, obj3) {
376
- const obj4 = {}
385
+ _mergeOptions (obj1, obj2, obj3, obj4) {
386
+ const obj5 = {}
377
387
 
378
- for (let attrname in obj1) { obj4[attrname] = obj1[attrname] }
379
- for (let attrname in obj2) { obj4[attrname] = obj2[attrname] }
380
- for (let attrname in obj3) { obj4[attrname] = obj3[attrname] }
388
+ for (let attrname in obj1) { obj5[attrname] = obj1[attrname] }
389
+ for (let attrname in obj2) { obj5[attrname] = obj2[attrname] }
390
+ for (let attrname in obj3) { obj5[attrname] = obj3[attrname] }
391
+ for (let attrname in obj4) { obj5[attrname] = obj4[attrname] }
381
392
 
382
- return obj4
393
+ return obj5
383
394
  }
384
395
 
385
396
  _createSymlinks (t, path, callback) {
@@ -413,7 +424,29 @@ module.exports = class extends Generator {
413
424
  })
414
425
 
415
426
  if (err) {
416
- console.error('error setting localconf settings')
427
+ console.error('error setting LocalConfiguration.php')
428
+ }
429
+ })
430
+ }
431
+
432
+ _localconf12 (t) {
433
+ fs.readFile('typo3conf/system/local.php', 'utf8', (err, content) => {
434
+ let newContent = t._substituteMarker(content, '###DBNEW###', rzr.DbNew.toLowerCase(), true)
435
+ newContent = t._substituteMarker(newContent, '###HOST###', rzr.DbHostname, true)
436
+ newContent = t._substituteMarker(newContent, '###PROJECTNAME###', rzr.ProjectName, true)
437
+
438
+ const encryptionKey = crypto.randomBytes((96 + 1) / 2).toString('hex')
439
+ newContent = t._substituteMarker(newContent, '###ENCRYPTION_KEY###', encryptionKey, true)
440
+
441
+ const hash = argon2.hash(rzr.Pass)
442
+ hash.then(function (res) {
443
+ newContent = t._substituteMarker(newContent, '###PASS###', res, true)
444
+
445
+ t._localconfWrite12(newContent)
446
+ })
447
+
448
+ if (err) {
449
+ console.error('error setting settings.php')
417
450
  }
418
451
  })
419
452
  }
@@ -422,6 +455,10 @@ module.exports = class extends Generator {
422
455
  fs.writeFile('typo3conf/LocalConfiguration.php', content, 'utf8', () => {})
423
456
  }
424
457
 
458
+ _localconf12Write (content) {
459
+ fs.writeFile('typo3conf/system/settings.php', content, 'utf8', () => {})
460
+ }
461
+
425
462
  _localSettings (t) {
426
463
  if (rzr.Transport === 'smtp') {
427
464
  let encryptVariable = '###SMTP_ENCRYPT###'
@@ -449,6 +486,33 @@ module.exports = class extends Generator {
449
486
  }
450
487
  }
451
488
 
489
+ _local12Settings (t) {
490
+ if (rzr.Transport === 'smtp') {
491
+ let encryptVariable = '###SMTP_ENCRYPT###'
492
+ if (rzr.Encrypt === true || rzr.Encrypt === false) {
493
+ encryptVariable = "'###SMTP_ENCRYPT###'"
494
+ }
495
+
496
+ fs.readFile('typo3conf/system/local.php', 'utf8', (err, content) => {
497
+ let newContent = t._substituteMarker(content, '###TRANSPORT###', rzr.Transport, true)
498
+ newContent = t._substituteMarker(newContent, encryptVariable, rzr.Encrypt, true)
499
+ newContent = t._substituteMarker(newContent, '###SMTP_PASS###', rzr.SmtpPass, true)
500
+ newContent = t._substituteMarker(newContent, '###SMTP_SERVER###', rzr.SmtpServer, true)
501
+ newContent = t._substituteMarker(newContent, '###SMTP_USER###', rzr.SmtpUser, true)
502
+ newContent = t._substituteMarker(newContent, '###SMTP_EMAIL###', rzr.SmtpEmail, true)
503
+ newContent = t._substituteMarker(newContent, '###SMTP_NAME###', rzr.SmtpName, true)
504
+
505
+ fs.writeFile('typo3conf/system/local.php', newContent, 'utf8', () => {})
506
+
507
+ if (err) {
508
+ console.error('error setting local settings')
509
+ }
510
+ })
511
+ } else {
512
+ fs.unlink('typo3conf/system/local.php', () => {})
513
+ }
514
+ }
515
+
452
516
  _createDb (callback) {
453
517
  const charset = 'utf8mb4'
454
518
  const collate = 'utf8mb4_unicode_ci'
@@ -1,3 +1,3 @@
1
1
  <FilesMatch \.php$>
2
- SetHandler proxy:fcgi://php73:9000
2
+ SetHandler proxy:fcgi://php74:9000
3
3
  </FilesMatch>
@@ -1,5 +1,5 @@
1
1
  <FilesMatch \.php$>
2
- SetHandler proxy:fcgi://php73:9000
2
+ SetHandler proxy:fcgi://php74:9000
3
3
  </FilesMatch>
4
4
 
5
5
  # ----------------------------------------------------------------------
@@ -3,7 +3,7 @@
3
3
  # ------------------------------------------------------------------------------
4
4
 
5
5
  <FilesMatch \.php$>
6
- SetHandler proxy:fcgi://php74:9000
6
+ SetHandler proxy:fcgi://php80:9000
7
7
  </FilesMatch>
8
8
 
9
9
  # ------------------------------------------------------------------------------
@@ -46,8 +46,7 @@ RewriteCond %{HTTP_USER_AGENT} "Mozilla.*Gecko.*Firefox/([1-9]|[1-2][0-9])[^0-9]
46
46
  RewriteCond %{HTTP_USER_AGENT} "^Firefox[\/\s]([1-9]|[1-2][0-9])[^0-9]" [NC,OR]
47
47
  RewriteCond %{HTTP_USER_AGENT} "AppleWebKit.*Version\/[1-8]\.[0-9\.]*\ Safari" [NC,OR]
48
48
  RewriteCond %{HTTP_USER_AGENT} "AppleWebKit.*Version\/[1-8]\.[0-9\.]*\ Mobile\/[A-z0-9]+\ Safari" [NC,OR]
49
- RewriteCond %{HTTP_USER_AGENT} "(MSIE\ |Trident.+rv:)[1-9][1-9]" [NC]
50
- #RewriteCond %{HTTP_USER_AGENT} "MSIE ([6-9]|10)" [NC]
49
+ RewriteCond %{HTTP_USER_AGENT} (MSIE|Trident) [NC]
51
50
  RewriteRule .* browser-support.html [L]
52
51
 
53
52
  # ----------------------------------------------------------------------
@@ -200,6 +199,7 @@ AddEncoding gzip .gzip
200
199
  application/rss+xml \
201
200
  application/schema+json \
202
201
  application/vnd.geo+json \
202
+ application/geo+json \
203
203
  application/vnd.ms-fontobject \
204
204
  application/x-font-ttf \
205
205
  application/x-javascript \
@@ -208,6 +208,8 @@ AddEncoding gzip .gzip
208
208
  application/xml \
209
209
  font/eot \
210
210
  font/opentype \
211
+ font/otf \
212
+ font/ttf \
211
213
  image/bmp \
212
214
  image/svg+xml \
213
215
  image/vnd.microsoft.icon \
@@ -248,6 +250,7 @@ AddEncoding gzip .gzip
248
250
  ExpiresByType application/ld+json "access plus 0 seconds"
249
251
  ExpiresByType application/schema+json "access plus 0 seconds"
250
252
  ExpiresByType application/vnd.geo+json "access plus 0 seconds"
253
+ ExpiresByType application/geo+json "access plus 0 seconds"
251
254
  ExpiresByType application/xml "access plus 0 seconds"
252
255
  ExpiresByType text/xml "access plus 0 seconds"
253
256
 
@@ -267,9 +270,13 @@ AddEncoding gzip .gzip
267
270
  ExpiresByType text/cache-manifest "access plus 0 seconds"
268
271
 
269
272
  ExpiresByType audio/ogg "access plus 1 month"
273
+ ExpiresByType image/apng "access plus 1 month"
274
+ ExpiresByType image/avif "access plus 1 month"
275
+ ExpiresByType image/avif-sequence "access plus 1 month"
270
276
  ExpiresByType image/bmp "access plus 1 year"
271
277
  ExpiresByType image/gif "access plus 1 year"
272
278
  ExpiresByType image/jpeg "access plus 1 year"
279
+ ExpiresByType image/jxl "access plus 1 month"
273
280
  ExpiresByType image/png "access plus 1 year"
274
281
  ExpiresByType image/svg+xml "access plus 1 month"
275
282
  ExpiresByType image/webp "access plus 1 month"
@@ -281,14 +288,18 @@ AddEncoding gzip .gzip
281
288
  ExpiresByType application/rdf+xml "access plus 1 hour"
282
289
  ExpiresByType application/rss+xml "access plus 1 hour"
283
290
 
291
+ ExpiresByType font/collection "access plus 1 month"
284
292
  ExpiresByType application/vnd.ms-fontobject "access plus 1 month"
285
293
  ExpiresByType font/eot "access plus 1 month"
286
294
  ExpiresByType font/opentype "access plus 1 month"
295
+ ExpiresByType font/otf "access plus 1 month"
287
296
  ExpiresByType application/x-font-ttf "access plus 1 month"
297
+ ExpiresByType font/ttf "access plus 1 month"
288
298
  ExpiresByType application/font-woff "access plus 1 month"
289
299
  ExpiresByType application/x-font-woff "access plus 1 month"
290
300
  ExpiresByType font/woff "access plus 1 month"
291
301
  ExpiresByType application/font-woff2 "access plus 1 month"
302
+ ExpiresByType font/woff2 "access plus 1 month"
292
303
 
293
304
  ExpiresByType text/x-cross-domain-policy "access plus 1 week"
294
305
 
@@ -332,7 +343,10 @@ AddEncoding gzip .gzip
332
343
 
333
344
  AddType audio/mp4 f4a f4b m4a
334
345
  AddType audio/ogg oga ogg opus
346
+ AddType image/avif avif
347
+ AddType image/avif-sequence avifs
335
348
  AddType image/bmp bmp
349
+ AddType image/jxl jxl
336
350
  AddType image/webp webp
337
351
  AddType video/mp4 f4v f4p m4v mp4
338
352
  AddType video/ogg ogv
@@ -609,7 +623,6 @@ RewriteRule ^.*\.sfc$ %{ENV:CWD}index.php?eID=sfc_manifest [QSA,L]
609
623
  RewriteCond %{REQUEST_FILENAME} !-f
610
624
  RewriteCond %{REQUEST_FILENAME} !-d
611
625
  RewriteCond %{REQUEST_FILENAME} !-l
612
- RewriteCond %{REQUEST_URI} ^/typo3/.*$
613
626
  RewriteRule ^typo3/(.*)$ %{ENV:CWD}typo3/index.php [QSA,L]
614
627
 
615
628
  # If the file/symlink/directory does not exist => Redirect to index.php.
@@ -3,7 +3,7 @@
3
3
  # ------------------------------------------------------------------------------
4
4
 
5
5
  <FilesMatch \.php$>
6
- SetHandler proxy:fcgi://php74:9000
6
+ SetHandler proxy:fcgi://php80:9000
7
7
  </FilesMatch>
8
8
 
9
9
  # ------------------------------------------------------------------------------
@@ -46,8 +46,7 @@ RewriteCond %{HTTP_USER_AGENT} "Mozilla.*Gecko.*Firefox/([1-9]|[1-2][0-9])[^0-9]
46
46
  RewriteCond %{HTTP_USER_AGENT} "^Firefox[\/\s]([1-9]|[1-2][0-9])[^0-9]" [NC,OR]
47
47
  RewriteCond %{HTTP_USER_AGENT} "AppleWebKit.*Version\/[1-8]\.[0-9\.]*\ Safari" [NC,OR]
48
48
  RewriteCond %{HTTP_USER_AGENT} "AppleWebKit.*Version\/[1-8]\.[0-9\.]*\ Mobile\/[A-z0-9]+\ Safari" [NC,OR]
49
- RewriteCond %{HTTP_USER_AGENT} "(MSIE\ |Trident.+rv:)[1-9][1-9]" [NC]
50
- #RewriteCond %{HTTP_USER_AGENT} "MSIE ([6-9]|10)" [NC]
49
+ RewriteCond %{HTTP_USER_AGENT} (MSIE|Trident) [NC]
51
50
  RewriteRule .* browser-support.html [L]
52
51
 
53
52
  # ----------------------------------------------------------------------
@@ -200,6 +199,7 @@ AddEncoding gzip .gzip
200
199
  application/rss+xml \
201
200
  application/schema+json \
202
201
  application/vnd.geo+json \
202
+ application/geo+json \
203
203
  application/vnd.ms-fontobject \
204
204
  application/x-font-ttf \
205
205
  application/x-javascript \
@@ -208,6 +208,8 @@ AddEncoding gzip .gzip
208
208
  application/xml \
209
209
  font/eot \
210
210
  font/opentype \
211
+ font/otf \
212
+ font/ttf \
211
213
  image/bmp \
212
214
  image/svg+xml \
213
215
  image/vnd.microsoft.icon \
@@ -248,6 +250,7 @@ AddEncoding gzip .gzip
248
250
  ExpiresByType application/ld+json "access plus 0 seconds"
249
251
  ExpiresByType application/schema+json "access plus 0 seconds"
250
252
  ExpiresByType application/vnd.geo+json "access plus 0 seconds"
253
+ ExpiresByType application/geo+json "access plus 0 seconds"
251
254
  ExpiresByType application/xml "access plus 0 seconds"
252
255
  ExpiresByType text/xml "access plus 0 seconds"
253
256
 
@@ -267,9 +270,13 @@ AddEncoding gzip .gzip
267
270
  ExpiresByType text/cache-manifest "access plus 0 seconds"
268
271
 
269
272
  ExpiresByType audio/ogg "access plus 1 month"
273
+ ExpiresByType image/apng "access plus 1 month"
274
+ ExpiresByType image/avif "access plus 1 month"
275
+ ExpiresByType image/avif-sequence "access plus 1 month"
270
276
  ExpiresByType image/bmp "access plus 1 year"
271
277
  ExpiresByType image/gif "access plus 1 year"
272
278
  ExpiresByType image/jpeg "access plus 1 year"
279
+ ExpiresByType image/jxl "access plus 1 month"
273
280
  ExpiresByType image/png "access plus 1 year"
274
281
  ExpiresByType image/svg+xml "access plus 1 month"
275
282
  ExpiresByType image/webp "access plus 1 month"
@@ -281,14 +288,18 @@ AddEncoding gzip .gzip
281
288
  ExpiresByType application/rdf+xml "access plus 1 hour"
282
289
  ExpiresByType application/rss+xml "access plus 1 hour"
283
290
 
291
+ ExpiresByType font/collection "access plus 1 month"
284
292
  ExpiresByType application/vnd.ms-fontobject "access plus 1 month"
285
293
  ExpiresByType font/eot "access plus 1 month"
286
294
  ExpiresByType font/opentype "access plus 1 month"
295
+ ExpiresByType font/otf "access plus 1 month"
287
296
  ExpiresByType application/x-font-ttf "access plus 1 month"
297
+ ExpiresByType font/ttf "access plus 1 month"
288
298
  ExpiresByType application/font-woff "access plus 1 month"
289
299
  ExpiresByType application/x-font-woff "access plus 1 month"
290
300
  ExpiresByType font/woff "access plus 1 month"
291
301
  ExpiresByType application/font-woff2 "access plus 1 month"
302
+ ExpiresByType font/woff2 "access plus 1 month"
292
303
 
293
304
  ExpiresByType text/x-cross-domain-policy "access plus 1 week"
294
305
 
@@ -332,7 +343,10 @@ AddEncoding gzip .gzip
332
343
 
333
344
  AddType audio/mp4 f4a f4b m4a
334
345
  AddType audio/ogg oga ogg opus
346
+ AddType image/avif avif
347
+ AddType image/avif-sequence avifs
335
348
  AddType image/bmp bmp
349
+ AddType image/jxl jxl
336
350
  AddType image/webp webp
337
351
  AddType video/mp4 f4v f4p m4v mp4
338
352
  AddType video/ogg ogv
@@ -609,7 +623,6 @@ RewriteRule ^.*\.sfc$ %{ENV:CWD}index.php?eID=sfc_manifest [QSA,L]
609
623
  RewriteCond %{REQUEST_FILENAME} !-f
610
624
  RewriteCond %{REQUEST_FILENAME} !-d
611
625
  RewriteCond %{REQUEST_FILENAME} !-l
612
- RewriteCond %{REQUEST_URI} ^/typo3/.*$
613
626
  RewriteRule ^typo3/(.*)$ %{ENV:CWD}typo3/index.php [QSA,L]
614
627
 
615
628
  # If the file/symlink/directory does not exist => Redirect to index.php.