generate-react-cli 11.0.2 → 11.0.3

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": "11.0.2",
3
+ "version": "11.0.3",
4
4
  "description": "A simple React CLI to generate components instantly and more.",
5
5
  "author": "Armin Broubakarian",
6
6
  "license": "MIT",
@@ -35,7 +35,7 @@
35
35
  "maintained node versions"
36
36
  ],
37
37
  "scripts": {
38
- "prepare": "husky install",
38
+ "prepare": "husky",
39
39
  "lint": "eslint .",
40
40
  "lint:fix": "eslint . --fix"
41
41
  },
@@ -43,22 +43,21 @@
43
43
  "chalk": "5.6.2",
44
44
  "commander": "14.0.3",
45
45
  "fs-extra": "11.3.3",
46
- "inquirer": "13.2.2",
47
- "lodash": "4.17.23",
48
- "replace": "1.2.2"
46
+ "inquirer": "13.3.0",
47
+ "lodash": "4.17.23"
49
48
  },
50
49
  "devDependencies": {
51
- "@antfu/eslint-config": "7.2.0",
52
- "@commitlint/cli": "20.3.1",
53
- "@commitlint/config-conventional": "20.3.1",
50
+ "@antfu/eslint-config": "7.6.1",
51
+ "@commitlint/cli": "20.4.2",
52
+ "@commitlint/config-conventional": "20.4.2",
54
53
  "@semantic-release/commit-analyzer": "13.0.1",
55
54
  "@semantic-release/git": "10.0.1",
56
- "@semantic-release/github": "12.0.5",
57
- "@semantic-release/npm": "13.1.4",
55
+ "@semantic-release/github": "12.0.6",
56
+ "@semantic-release/npm": "13.1.5",
58
57
  "@semantic-release/release-notes-generator": "14.1.0",
59
- "eslint": "9.39.2",
58
+ "eslint": "10.0.2",
60
59
  "husky": "9.1.7",
61
- "lint-staged": "16.2.7",
60
+ "lint-staged": "16.3.1",
62
61
  "semantic-release": "25.0.3"
63
62
  },
64
63
  "lint-staged": {
@@ -4,7 +4,6 @@ import camelCase from 'lodash/camelCase.js';
4
4
  import kebabCase from 'lodash/kebabCase.js';
5
5
  import snakeCase from 'lodash/snakeCase.js';
6
6
  import startCase from 'lodash/startCase.js';
7
- import replace from 'replace';
8
7
  import componentCssTemplate from '../templates/component/componentCssTemplate.js';
9
8
 
10
9
  import componentJsTemplate from '../templates/component/componentJsTemplate.js';
@@ -434,12 +433,13 @@ export function generateComponent(componentName, cmd, cliConfigFile) {
434
433
  } else {
435
434
  try {
436
435
  if (!cmd.dryRun) {
437
- outputFileSync(componentPath, template);
438
-
439
436
  // Replace all template placeholders with their corresponding component name formats
437
+ let processedTemplate = template;
440
438
  Object.entries(convertors).forEach(([pattern, replacement]) => {
441
- replace({ regex: pattern, replacement, paths: [componentPath], recursive: false, silent: true });
439
+ processedTemplate = processedTemplate.replaceAll(pattern, replacement);
442
440
  });
441
+
442
+ outputFileSync(componentPath, processedTemplate);
443
443
  }
444
444
 
445
445
  generatedFiles.push({ filename, status: 'created', path: componentPath });