@specverse/engines 4.1.26 → 4.1.27
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.
|
@@ -446,10 +446,13 @@ import { fileURLToPath } from 'url';`,
|
|
|
446
446
|
|
|
447
447
|
// Copy template with variable substitution
|
|
448
448
|
const kebab = projectName.replace(/([a-z])([A-Z])/g, '$1-$2').toLowerCase();
|
|
449
|
-
// PascalCase: split on hyphens / underscores /
|
|
449
|
+
// PascalCase: split on hyphens / underscores / whitespace, capitalize each segment, join.
|
|
450
450
|
// 'audit-backend-only' -> 'AuditBackendOnly', 'my_app' -> 'MyApp', 'foo' -> 'Foo'.
|
|
451
|
+
// NOTE: regex char class is double-escaped because this whole handler
|
|
452
|
+
// is embedded as a string in the generator template \u2014 \\s here ends
|
|
453
|
+
// up as s in the emitted source.
|
|
451
454
|
const component = projectName
|
|
452
|
-
.split(/[-
|
|
455
|
+
.split(/[-_\\s]+/)
|
|
453
456
|
.filter(Boolean)
|
|
454
457
|
.map((s: string) => s.charAt(0).toUpperCase() + s.slice(1))
|
|
455
458
|
.join('');
|
|
@@ -501,10 +501,13 @@ import { fileURLToPath } from 'url';`,
|
|
|
501
501
|
|
|
502
502
|
// Copy template with variable substitution
|
|
503
503
|
const kebab = projectName.replace(/([a-z])([A-Z])/g, '$1-$2').toLowerCase();
|
|
504
|
-
// PascalCase: split on hyphens / underscores /
|
|
504
|
+
// PascalCase: split on hyphens / underscores / whitespace, capitalize each segment, join.
|
|
505
505
|
// 'audit-backend-only' -> 'AuditBackendOnly', 'my_app' -> 'MyApp', 'foo' -> 'Foo'.
|
|
506
|
+
// NOTE: regex char class is double-escaped because this whole handler
|
|
507
|
+
// is embedded as a string in the generator template — \\s here ends
|
|
508
|
+
// up as \s in the emitted source.
|
|
506
509
|
const component = projectName
|
|
507
|
-
.split(/[-_
|
|
510
|
+
.split(/[-_\\s]+/)
|
|
508
511
|
.filter(Boolean)
|
|
509
512
|
.map((s: string) => s.charAt(0).toUpperCase() + s.slice(1))
|
|
510
513
|
.join('');
|