diff --git a/README.md b/README.md index 7fa14f6..198f482 100755 --- a/README.md +++ b/README.md @@ -9,11 +9,9 @@ Component Creator is an [open-source](https://github.com/dsbasko/component-creator) [extension](https://badgen.net/vs-marketplace/v/dsbasko.create-component-helper) for [Visual Studio Code](https://code.visualstudio.com), designed to easily creating components based on yours templates. -## Whats new in 2.2? +## Whats new in 2.2.1? -- Added a mask `{{concat}}` in the file name, indicating append buffer from template to this file; -- Added the ability to overwrite or ignore files that already exist in the selected path; -- Added Russian translation. You can choose in the extension settings. +- Fixed an error with incorrect processing `.` `-` `_` in the name of the component. ## Features diff --git a/package.json b/package.json index deabf9e..b24ddba 100755 --- a/package.json +++ b/package.json @@ -2,7 +2,7 @@ "name": "create-component-helper", "displayName": "Component Creator", "description": "🧬 Create file structure based on your templates", - "version": "2.2.0", + "version": "2.2.1", "engines": { "vscode": "^1.70.0" }, "icon": "assets/icon.png", "license": "MIT", diff --git a/src/handler/component-add.handle.ts b/src/handler/component-add.handle.ts index 1c47557..d7f9828 100644 --- a/src/handler/component-add.handle.ts +++ b/src/handler/component-add.handle.ts @@ -120,12 +120,12 @@ export class ComponentAddHandle { const normalizedComponentName = componentName.replace('\\\\', '/'); if (normalizedComponentName.includes('/')) { const parseComponent = parse(normalizedComponentName); - this.componentName = parseComponent.base; + this.componentName = parseComponent.base.replace(/[-_.]/g, ' '); this.contextPath = join(this.contextPath, parseComponent.dir); - return this; + return this; } - this.componentName = normalizedComponentName; + this.componentName = normalizedComponentName.replace(/[-_.]/g, ' '); return this; };