Skip to content

Commit

Permalink
Merge branch 'master' into npm
Browse files Browse the repository at this point in the history
  • Loading branch information
AfzalSabbir committed Feb 18, 2023
2 parents 305222b + dd90349 commit 8d91859
Show file tree
Hide file tree
Showing 9 changed files with 22 additions and 13 deletions.
9 changes: 9 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,15 @@ All notable changes to this project will be documented in this file. This projec
to [Semantic Versioning](http://semver.org/). This changelog was generated
with [github_changelog_generator](https://github.com/marketplace/actions/generate-changelog).

## [0.1.1-alpha-0] - 2023-02-18

### Features
- [x] `Library` & `Single Component` mode enabled

## Changed
- Bumped `package.json` version to `0.1.1-alpha-0`


## [0.1.0-alpha-5] - 2023-02-11

### Fixed
Expand Down
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 package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "vue-sfc-vite",
"version": "0.1.0-alpha-5",
"version": "0.1.1-alpha-0",
"description": "Vue SFC Vite is a Vue 3 SFC template for Vite",
"keywords": [
"vue",
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 8d91859

Please sign in to comment.