Skip to content

Commit

Permalink
fix: fixing generating scss and testid name
Browse files Browse the repository at this point in the history
  • Loading branch information
schirrel committed Mar 28, 2022
1 parent c15c089 commit df6210f
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 5 deletions.
Binary file added dist/jsm-vue-component-generator-0.2.1.vsix
Binary file not shown.
Binary file added dist/jsm-vue-component-generator-0.2.2.vsix
Binary file not shown.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"name": "jsm-vue-component-generator",
"displayName": "JS+ Vue Componente Generator",
"description": "Create Vue components folder and files with JS+ style",
"version": "0.2.0",
"version": "0.2.2",
"publisher": "juntossomosmais",
"repository": {
"type": "git",
Expand Down
13 changes: 9 additions & 4 deletions src/builders/templates.ts
Original file line number Diff line number Diff line change
@@ -1,11 +1,16 @@
const camelCaseName = (name: string) =>
name.replace(/[A-Z]/g, (m) => "-" + m.toLowerCase());
const camelCaseName = (name: string) => {
name = name.charAt(0).toLowerCase() + name.slice(1);
name = name.replace(/[A-Z]/g, (m) => "-" + m.toLowerCase());

return name;
};

export const TEMPLATES = (name: string) => {
return {
vue: `<template>
<div class="${camelCaseName}" data-testid="${camelCaseName}>
</div>
<div class="${camelCaseName(name)}" data-testid="${camelCaseName(
name
)}"></div>
</template>
<script lang="ts">
import Vue from 'vue'
Expand Down

0 comments on commit df6210f

Please sign in to comment.