Skip to content

Commit

Permalink
refactor: codebase
Browse files Browse the repository at this point in the history
  • Loading branch information
selemondev committed Mar 13, 2024
1 parent 6698b7a commit c9b6abe
Show file tree
Hide file tree
Showing 6 changed files with 80 additions and 16 deletions.
30 changes: 30 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
<p align="center">
<img align="center" src="https://raw.githubusercontent.com/selemondev/create-vue-next/master/src/icon/create-vue-next.png" height="96" />
<h1 align="center">
create-vue-next
</h1>
</p>

## Create Vue Next CLI ✨

A CLI tool powered by Vite to scaffold Vue 3 projects without wasting time!.

## Usage

### npx

```bash
npx create-vue-next@latest <project-name>

OR

npx create-vue-next@latest <project-name> --<flag>
```

### yarn

```bash
yarn create-vue-next

```

20 changes: 15 additions & 5 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,24 @@
"type": "module",
"scripts": {
"dev": "esno src/index.ts",
"build:package": "tsup-node src/index.ts --format esm --clean --minify"
"build:package": "tsup-node src/index.ts --format esm --clean --minify",
"generate:release": "npx changelogen@latest --release"
},
"bin": {
"create-vue-next": "dist/index.js"
"create-vue-next": "./dist/index.js"
},
"keywords": [],
"author": "",
"license": "ISC",
"keywords": [
"create-vue-next",
"Vue CLI",
"Vue 3 CLI",
"Vite CLI",
"Vite",
"Vue 3",
"VueUse",
"TypeScript"
],
"author": "Selemondev",
"license": "MIT",
"devDependencies": {
"@types/ejs": "^3.1.5",
"@types/fs-extra": "^11.0.4",
Expand Down
34 changes: 29 additions & 5 deletions src/core/command/create-vue-next/install.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,13 @@ async function installDeps() {

const startTime: number = new Date().getTime();

if(options.useGitInit ) {
if (options.useGitInit) {
await cmdIgnore('git', ['init'])

await cmdIgnore('git', ['add .'])

await cmdIgnore('git', ['commit -m "Initialized by create-vue-next"'])
}
}


if (options.package && options.package !== 'none') {
Expand Down Expand Up @@ -52,13 +52,37 @@ async function installDeps() {
logger.info(
options.package === 'npm'
? `${options.package} run dev to start the dev server`
: `${options.package} dev to start the dev server`
: `${options.package} dev to start the dev server`,

options.useEslint && options.package === 'npm'
? `${options.package} run lint`
: `${options.package} lint`,

options.useVitest && options.package === 'npm'
? `${options.package} run test:unit`
: `${options.package} test:unit`,

options.useTypeScript && options.package === 'npm'
? `${options.package} run type-check`
: `${options.package} type-check`
)
} else {
logger.info(`npm install`)

console.log()

options.useEslint && logger.info('npm run lint')

options.useEslint && console.log()

options.useTypeScript && logger.info("npm run type-check")

options.useTypeScript && console.log()

options.useVitest && logger.info('npm run test:unit')

options.useVitest && console.log()

logger.info('npm run dev')
}
}
Expand Down
Binary file added src/icon/create-vue-next.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
10 changes: 5 additions & 5 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,12 @@ import options from './core/utils/vue/options';

async function main() {
program
.arguments('<project-name>')
// .arguments('<project-name>')
.version(packageJson.version)
.description(`Create Vue Next. The Next Generation Vue Scaffolding Tool ⚡`)
.action((name: string) => {
options.name = name.trim();
})
// .action((name: string) => {
// options.name = name.trim();
// })
.option(
'--ts, --typescript',
`
Expand Down Expand Up @@ -58,7 +58,7 @@ async function main() {
.option(
'--use-bun',
`
Explicitly tell the CLI to bootstrap the application using Bun
`
)
Expand Down
2 changes: 1 addition & 1 deletion tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
"strictNullChecks": true,
"esModuleInterop": true,
"skipDefaultLibCheck": true,
"skipLibCheck": true
"skipLibCheck": true,
}
}

0 comments on commit c9b6abe

Please sign in to comment.