generate-react-cli 9.0.1 → 9.1.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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "generate-react-cli",
3
- "version": "9.0.1",
3
+ "version": "9.1.0",
4
4
  "description": "A simple React CLI to generate components instantly and more.",
5
5
  "repository": "https://github.com/arminbro/generate-react-cli",
6
6
  "bugs": "https://github.com/arminbro/generate-react-cli/issues",
@@ -57,7 +57,7 @@
57
57
  "@semantic-release/release-notes-generator": "14.0.3",
58
58
  "eslint": "8.57.1",
59
59
  "eslint-config-airbnb-base": "15.0.0",
60
- "eslint-config-prettier": "9.1.0",
60
+ "eslint-config-prettier": "9.1.2",
61
61
  "eslint-plugin-prettier": "5.5.4",
62
62
  "husky": "9.1.7",
63
63
  "prettier": "3.6.2",
package/readme.md CHANGED
@@ -317,6 +317,7 @@ export default TemplateName;
317
317
  | `template-name` | component name in kebab-case |
318
318
  | `template_name` | component name in snake_case |
319
319
  | `TEMPLATE_NAME` | component name in uppercase SNAKE_CASE |
320
+ | `TEMPLATENAME` | component name in full UPPERCASE |
320
321
 
321
322
  #### Example of a custom test template file:
322
323
 
@@ -418,6 +418,7 @@ export function generateComponent(componentName, cmd, cliConfigFile) {
418
418
  'template-name': kebabCase(componentName),
419
419
  template_name: snakeCase(componentName),
420
420
  TEMPLATE_NAME: snakeCase(componentName).toUpperCase(),
421
+ TEMPLATENAME: componentName.toUpperCase(),
421
422
  };
422
423
 
423
424
  const { componentPath, filename, template } = generateTemplate({
@@ -490,6 +491,15 @@ export function generateComponent(componentName, cmd, cliConfigFile) {
490
491
  recursive: false,
491
492
  silent: true,
492
493
  });
494
+
495
+ // Will replace the TEMPLATENAME in uppercase SNAKE_CASE
496
+ replace({
497
+ regex: 'TEMPLATENAME',
498
+ replacement: convertors['TEMPLATENAME'],
499
+ paths: [componentPath],
500
+ recursive: false,
501
+ silent: true,
502
+ });
493
503
  }
494
504
 
495
505
  console.log(chalk.green(`${filename} was successfully created at ${componentPath}`));