Skip to content

Commit

Permalink
Merge pull request #21 from AfzalSabbir/development
Browse files Browse the repository at this point in the history
Feature: DUAL Library & SC mode enabled
  • Loading branch information
AfzalSabbir authored Feb 18, 2023
2 parents 4167ea5 + c8f6b50 commit c7a1a5d
Show file tree
Hide file tree
Showing 7 changed files with 12 additions and 12 deletions.
8 changes: 0 additions & 8 deletions built/lib/cli-user-options.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,14 +9,6 @@ declare const inquirerUserOptions: ({
default?: undefined;
validate?: undefined;
filter?: undefined;
} | {
type: string;
name: string;
message: string;
choices: string[];
default?: undefined;
validate?: undefined;
filter?: undefined;
} | {
type: string;
name: string;
Expand Down
5 changes: 4 additions & 1 deletion built/lib/cli-user-options.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,10 @@ const inquirerUserOptions = [
type: "list",
name: "type",
message: "Is this a single component or a library?",
choices: ["Single Component"],
choices: [
{ name: "Single Component", value: "component" },
{ name: "Library", value: "library" },
],
// filter(val) {
// return val.toLowerCase();
// },
Expand Down
1 change: 1 addition & 0 deletions built/lib/create-files.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ const createFile = (options, replaceData) => {
newOptions.componentNamePascalCase = Case.pascal(newOptions.componentName);
newOptions.componentNameKebabCase = Case.kebab(newOptions.componentName);
newOptions.ts = newOptions.language === "ts";
newOptions.component = newOptions.type === "component";
// read any file src/vite.config.js
const file = path.resolve(installFromStubsPath, replaceData.target.directory, replaceData.stubName);
const replace = fs.readFileSync(file, { encoding: "utf-8" });
Expand Down
5 changes: 4 additions & 1 deletion lib/cli-user-options.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,10 @@ const inquirerUserOptions = [
type: "list",
name: "type",
message: "Is this a single component or a library?",
choices: ["Single Component"],
choices: [
{ name: "Single Component", value: "component" },
{ name: "Library", value: "library" },
],
// filter(val) {
// return val.toLowerCase();
// },
Expand Down
1 change: 1 addition & 0 deletions lib/create-files.ts
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ const createFile = (options, replaceData) => {
newOptions.componentNamePascalCase = Case.pascal(newOptions.componentName);
newOptions.componentNameKebabCase = Case.kebab(newOptions.componentName);
newOptions.ts = newOptions.language === "ts";
newOptions.component = newOptions.type === "component";

// read any file src/vite.config.js
const file = path.resolve(
Expand Down
2 changes: 1 addition & 1 deletion stubs/src/App.vue.ejs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<script setup<% if (ts) { %> lang="ts"<% } %>>
import { <%= componentNamePascalCase %> } from './components/';
import <% if (!component) { %>{ <% } %><%= componentNamePascalCase %><% if (!component) { %> }<% } %> from './components/';
</script>

<template>
Expand Down
2 changes: 1 addition & 1 deletion stubs/src/components/index.js.ejs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/* eslint-disable import/prefer-default-export */

export { default as <%= componentNamePascalCase %> } from './<%= componentName %>.vue';
export { default<% if (!component) { %> as <%= componentNamePascalCase %><% } %> } from './<%= componentName %>.vue';

// Other components you plan to publish go here

0 comments on commit c7a1a5d

Please sign in to comment.