-
Notifications
You must be signed in to change notification settings - Fork 36
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
13 changed files
with
508 additions
and
0 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -6,6 +6,7 @@ | |
"deduped", | ||
"deindent", | ||
"estree", | ||
"nocheck", | ||
"RAWTEXT", | ||
"RCDATA", | ||
"unref", | ||
|
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,40 @@ | ||
import fs from "fs"; | ||
import fse from "fs-extra"; | ||
|
||
const red = (s: string) => `\x1b[31m${s}\x1b[0m`; | ||
const green = (s: string) => `\x1b[32m${s}\x1b[0m`; | ||
const blue = (s: string) => `\x1b[34m${s}\x1b[0m`; | ||
|
||
const targetDirPath = 'example/playground' | ||
|
||
// check if target path is empty | ||
if (!targetDirPath) { | ||
console.log("Please specify the target path!"); | ||
process.exit(1); | ||
} | ||
|
||
// check if target path exists. auto create if not | ||
if (fs.existsSync(targetDirPath)) { | ||
const files = fs.readdirSync(targetDirPath); | ||
if (files.length) { | ||
console.log(""); | ||
console.log(`${red("Oops!")} Target directory is not empty!`); | ||
console.log(""); | ||
process.exit(1); | ||
} | ||
} else { | ||
fs.mkdirSync(targetDirPath, { recursive: true }); | ||
} | ||
|
||
// copy template files | ||
const templateDirPath = `tools/chibivue-playground/template`; | ||
fse.copySync(templateDirPath, targetDirPath); | ||
|
||
// message | ||
console.log(""); | ||
console.log("----------------------------------------------------------"); | ||
console.log( | ||
`${green("chibivue project created!")} ${blue(">>>")} ${targetDirPath}` | ||
); | ||
console.log(`Enjoy your learning! 😎`); | ||
console.log("----------------------------------------------------------"); |
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,12 @@ | ||
<!DOCTYPE html> | ||
<html lang="en"> | ||
<head> | ||
<meta charset="UTF-8" /> | ||
<meta name="viewport" content="width=device-width, initial-scale=1.0" /> | ||
</head> | ||
|
||
<body> | ||
<div id="app"></div> | ||
<script type="module" src="src/main.ts"></script> | ||
</body> | ||
</html> |
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,15 @@ | ||
{ | ||
"name": "chibi-vue", | ||
"version": "1.0.0", | ||
"type": "module", | ||
"scripts": { | ||
"dev": "vite" | ||
}, | ||
"author": "Ubugeeei <[email protected]>", | ||
"devDependencies": { | ||
"vite": "^3.0.9" | ||
}, | ||
"volta": { | ||
"node": "18.14.0" | ||
} | ||
} |
Oops, something went wrong.