@huyikai/vitepress-helper
Advanced tools
Comparing version 0.0.10 to 0.0.11
@@ -48,3 +48,3 @@ import { blodText } from './utils'; | ||
: undefined; | ||
packageInfo.devDependencies['@huyikai/vitepress-helper'] = '^0.0.10'; | ||
packageInfo.devDependencies['@huyikai/vitepress-helper'] = '^0.0.11'; | ||
packageInfo.devDependencies['@huyikai/local-cms'] = cms | ||
@@ -51,0 +51,0 @@ ? 'latest' |
#!/usr/bin/env node | ||
import{Command as e}from"commander";import o from"chalk";import{execSync as n}from"child_process";import i from"fs-extra";import t from"ora";import r from"path";import s from"figlet";import{fileURLToPath as a}from"url";import m from"inquirer";const l=e=>o.blue.bold(e),p=process.cwd(),c=t();const u=new e,d=r.dirname(a(import.meta.url)),h=r.join(d,"./../../package.json"),y=JSON.parse(i.readFileSync(h,"utf8"));u.name("VitePress-Helper").description("A Tool for Enhance VitePress Experience\r\n一个增强VitePress体验的工具").helpOption("-h, --help","Display help for command\r\n显示命令的帮助").version(y.version,"-v,-V, --version","Output current version information\r\n输出当前版本信息"),u.command("init").description("Guide to complete the initialization operation\r\n完成初始化操作的指南").summary("initialization\r\n初始化").action((async()=>{(async e=>{const{name:o,author:t,version:s,cms:a}=e;c.start("Installing..."),n("npm init -y"),n("npm install @huyikai/vitepress-helper",{stdio:"inherit"});const m=r.join(p,"node_modules/@huyikai/vitepress-helper/template"),u=r.join(p,"");i.copySync(m,u),(()=>{const e=r.join(p,"package.json");let n=JSON.parse(i.readFileSync(e).toString());n.name=o,n.author=t,n.version=s,n.scripts.cms=a?"node node_modules/@huyikai/local-cms/cms.js docs":void 0,n.devDependencies["@huyikai/vitepress-helper"]="^0.0.10",n.devDependencies["@huyikai/local-cms"]=a?"latest":void 0,i.writeFileSync(e,JSON.stringify(n,null,2))})(),n("npm i",{stdio:"inherit"}),c.succeed("Install Complete!!!"),console.log(`\r\nNow you can:\r\nrun ${l("npm run dev")} to preview`+(a?`\r\nrun ${l("npm run cms")} to manage content`:""))})(await m.prompt([{name:"name",message:"Project Name",type:"input",default:"my-docs"},{name:"author",description:"Input Author Name",message:"Author",default:"huyikai"},{name:"version",description:"Version",message:"Version",default:"1.0.0"},{name:"cms",message:"Do you need local CMS?",default:!0,type:"list",choices:[{name:"yes",value:!0},{name:"no",value:!1}]}]))})),u.usage("<command> [option]"),u.on("--help",(()=>{console.log(`\r\nRun ${l("vitepress-helper <command> --help")} for detailed usage of given command`),console.log(`\r\nGitHub: ${l("https://github.com/huyikai/vitepress-helper")}`),console.log(`\r\nHomePage: ${l("https://huyikai.github.io/vitepress-helper")}`),console.log("\r\n"+o.hex("#41B883").bgHex("#35495E").bold(s.textSync("VitePress-Helper",{font:"Standard",horizontalLayout:"default",verticalLayout:"default",width:80,whitespaceBreak:!1})))})),u.parse(process.argv); | ||
import{Command as e}from"commander";import o from"chalk";import{execSync as n}from"child_process";import i from"fs-extra";import t from"ora";import r from"path";import s from"figlet";import{fileURLToPath as a}from"url";import m from"inquirer";const l=e=>o.blue.bold(e),p=process.cwd(),c=t();const u=new e,d=r.dirname(a(import.meta.url)),h=r.join(d,"./../../package.json"),y=JSON.parse(i.readFileSync(h,"utf8"));u.name("VitePress-Helper").description("A Tool for Enhance VitePress Experience\r\n一个增强VitePress体验的工具").helpOption("-h, --help","Display help for command\r\n显示命令的帮助").version(y.version,"-v,-V, --version","Output current version information\r\n输出当前版本信息"),u.command("init").description("Guide to complete the initialization operation\r\n完成初始化操作的指南").summary("initialization\r\n初始化").action((async()=>{(async e=>{const{name:o,author:t,version:s,cms:a}=e;c.start("Installing..."),n("npm init -y"),n("npm install @huyikai/vitepress-helper",{stdio:"inherit"});const m=r.join(p,"node_modules/@huyikai/vitepress-helper/template"),u=r.join(p,"");i.copySync(m,u),(()=>{const e=r.join(p,"package.json");let n=JSON.parse(i.readFileSync(e).toString());n.name=o,n.author=t,n.version=s,n.scripts.cms=a?"node node_modules/@huyikai/local-cms/cms.js docs":void 0,n.devDependencies["@huyikai/vitepress-helper"]="^0.0.11",n.devDependencies["@huyikai/local-cms"]=a?"latest":void 0,i.writeFileSync(e,JSON.stringify(n,null,2))})(),n("npm i",{stdio:"inherit"}),c.succeed("Install Complete!!!"),console.log(`\r\nNow you can:\r\nrun ${l("npm run dev")} to preview`+(a?`\r\nrun ${l("npm run cms")} to manage content`:""))})(await m.prompt([{name:"name",message:"Project Name",type:"input",default:"my-docs"},{name:"author",description:"Input Author Name",message:"Author",default:"huyikai"},{name:"version",description:"Version",message:"Version",default:"1.0.0"},{name:"cms",message:"Do you need local CMS?",default:!0,type:"list",choices:[{name:"yes",value:!0},{name:"no",value:!1}]}]))})),u.usage("<command> [option]"),u.on("--help",(()=>{console.log(`\r\nRun ${l("vitepress-helper <command> --help")} for detailed usage of given command`),console.log(`\r\nGitHub: ${l("https://github.com/huyikai/vitepress-helper")}`),console.log(`\r\nHomePage: ${l("https://huyikai.github.io/vitepress-helper")}`),console.log("\r\n"+o.hex("#41B883").bgHex("#35495E").bold(s.textSync("VitePress-Helper",{font:"Standard",horizontalLayout:"default",verticalLayout:"default",width:80,whitespaceBreak:!1})))})),u.parse(process.argv); | ||
//# sourceMappingURL=index.js.map |
{ | ||
"name": "@huyikai/vitepress-helper", | ||
"version": "0.0.10", | ||
"version": "0.0.11", | ||
"private": false, | ||
@@ -47,2 +47,3 @@ "description": "This tool is designed to help you to use VitePress more easily.", | ||
"gray-matter": "^4.0.2", | ||
"inquirer": "^9.2.12", | ||
"tree-conver": "^0.0.95", | ||
@@ -49,0 +50,0 @@ "uuid": "^9.0.1" |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
94417
9
+ Addedinquirer@^9.2.12
+ Added@inquirer/figures@1.0.8(transitive)
+ Addedansi-escapes@4.3.2(transitive)
+ Addedansi-regex@5.0.1(transitive)
+ Addedansi-styles@4.3.0(transitive)
+ Addedbase64-js@1.5.1(transitive)
+ Addedbl@4.1.0(transitive)
+ Addedbuffer@5.7.1(transitive)
+ Addedchalk@4.1.2(transitive)
+ Addedchardet@0.7.0(transitive)
+ Addedcli-cursor@3.1.0(transitive)
+ Addedcli-spinners@2.9.2(transitive)
+ Addedcli-width@4.1.0(transitive)
+ Addedclone@1.0.4(transitive)
+ Addedcolor-convert@2.0.1(transitive)
+ Addedcolor-name@1.1.4(transitive)
+ Addeddefaults@1.0.4(transitive)
+ Addedemoji-regex@8.0.0(transitive)
+ Addedexternal-editor@3.1.0(transitive)
+ Addedhas-flag@4.0.0(transitive)
+ Addediconv-lite@0.4.24(transitive)
+ Addedieee754@1.2.1(transitive)
+ Addedinherits@2.0.4(transitive)
+ Addedinquirer@9.3.7(transitive)
+ Addedis-fullwidth-code-point@3.0.0(transitive)
+ Addedis-interactive@1.0.0(transitive)
+ Addedis-unicode-supported@0.1.0(transitive)
+ Addedlog-symbols@4.1.0(transitive)
+ Addedmimic-fn@2.1.0(transitive)
+ Addedmute-stream@1.0.0(transitive)
+ Addedonetime@5.1.2(transitive)
+ Addedora@5.4.1(transitive)
+ Addedos-tmpdir@1.0.2(transitive)
+ Addedreadable-stream@3.6.2(transitive)
+ Addedrestore-cursor@3.1.0(transitive)
+ Addedrun-async@3.0.0(transitive)
+ Addedrxjs@7.8.1(transitive)
+ Addedsafe-buffer@5.2.1(transitive)
+ Addedsafer-buffer@2.1.2(transitive)
+ Addedsignal-exit@3.0.7(transitive)
+ Addedstring-width@4.2.3(transitive)
+ Addedstring_decoder@1.3.0(transitive)
+ Addedstrip-ansi@6.0.1(transitive)
+ Addedsupports-color@7.2.0(transitive)
+ Addedtmp@0.0.33(transitive)
+ Addedtslib@2.8.1(transitive)
+ Addedtype-fest@0.21.3(transitive)
+ Addedutil-deprecate@1.0.2(transitive)
+ Addedwcwidth@1.0.1(transitive)
+ Addedwrap-ansi@6.2.0(transitive)
+ Addedyoctocolors-cjs@2.1.2(transitive)