-
Notifications
You must be signed in to change notification settings - Fork 122
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
15 changed files
with
133 additions
and
80 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,6 @@ | ||
.DS_Store | ||
node_modules | ||
/bin | ||
/dist | ||
package-lock.json | ||
|
||
|
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,6 @@ | ||
module.exports = { | ||
export default { | ||
name: '', | ||
version: '', | ||
components: { | ||
elementPlus: false | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
declare module '*.json' { | ||
const value: JSON; | ||
export default value; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
import fs = require('fs'); | ||
import chalk = require('chalk'); | ||
|
||
export default function(name: string): Promise<boolean> { | ||
return new Promise ((resolve) => { | ||
fs.access(name, error => { | ||
if (error) { | ||
console.log(chalk.red( | ||
`The ${name} folder already exists in the current directory. Please try to use another project name!` | ||
)); | ||
process.exit(1); | ||
} else { | ||
resolve(true); | ||
} | ||
}); | ||
}); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
import fs = require('fs-extra'); | ||
import path = require("path"); | ||
import options from "../options"; | ||
|
||
export default async function (): Promise<void> { | ||
const packageFile = path.resolve(__dirname, '../../package.json'); | ||
|
||
const packageCode = await fs.readFile(packageFile); | ||
const packageJson = JSON.parse(packageCode.toString()) | ||
options.version = packageJson.version; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
#! /usr/bin/env node | ||
|
||
import program = require('commander'); | ||
import hasDir from './utils/hasDir'; | ||
import creator from './creator'; | ||
import packageVersion from './utils/packageVersion'; | ||
import options from './options'; | ||
|
||
async function run() { | ||
await packageVersion(); | ||
program.version(options.version) | ||
.usage('<command> [options]'); | ||
|
||
program.command('create <app-name>') | ||
.description('create a new project with vue3 + typescript by x-build') | ||
.action(async (name) => { | ||
await hasDir(name); | ||
creator(name); | ||
}); | ||
|
||
program.parse(process.argv); | ||
} | ||
|
||
run(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
{ | ||
"compileOnSave": true, | ||
"compilerOptions": { | ||
"target": "ES2018", | ||
"module": "commonjs", | ||
"moduleResolution": "node", | ||
"experimentalDecorators": true, | ||
"emitDecoratorMetadata": true, | ||
"inlineSourceMap":true, | ||
"noImplicitThis": true, | ||
"noUnusedLocals": true, | ||
"stripInternal": true, | ||
"pretty": true, | ||
"declaration": true, | ||
"outDir": "bin", | ||
"baseUrl": "./", | ||
"paths": { | ||
"*": ["src/*"] | ||
} | ||
}, | ||
"exclude": [ | ||
"bin", | ||
"documents", | ||
"template", | ||
] | ||
} |