create-vuepress-theme-hope 2.0.0-beta.103 → 2.0.0-beta.104
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/index.js +1 -1
- package/package.json +2 -2
package/lib/index.js
CHANGED
|
@@ -61,6 +61,6 @@ node_modules/
|
|
|
61
61
|
${e}/.vuepress/.cache/
|
|
62
62
|
${e}/.vuepress/.temp/
|
|
63
63
|
${e}/.vuepress/dist/
|
|
64
|
-
`,j=e=>{const r=i(process.cwd(),".gitignore"),t=d(r)?f(r,{encoding:"utf-8"}):"";u(r,`${t}${R(e)}`,{encoding:"utf-8"})},Y=async(e,{packageManager:r,lang:t,message:s,preset:o})=>{const{workflow:a}=await c.prompt([{name:"workflow",type:"confirm",message:s.question.workflow,default:!0}]);if(o||(o=(await c.prompt([{name:"preset",type:"list",message:s.question.preset,choices:["blog","docs"]}])).preset),console.log(s.flow.generateTemplate),S(i(x,"../template/public"),i(process.cwd(),e,"
|
|
64
|
+
`,j=e=>{const r=i(process.cwd(),".gitignore"),t=d(r)?f(r,{encoding:"utf-8"}):"";u(r,`${t}${R(e)}`,{encoding:"utf-8"})},Y=async(e,{packageManager:r,lang:t,message:s,preset:o})=>{const{workflow:a}=await c.prompt([{name:"workflow",type:"confirm",message:s.question.workflow,default:!0}]);if(o||(o=(await c.prompt([{name:"preset",type:"list",message:s.question.preset,choices:["blog","docs"]}])).preset),console.log(s.flow.generateTemplate),S(i(x,"../template/public"),i(process.cwd(),e,"./.vuepress/public")),S(i(x,"../template",o),i(process.cwd(),e)),a){const n=i(process.cwd(),".github/workflows");h(n),u(i(n,"deploy-docs.yml"),J(r,e,t),{encoding:"utf-8"})}if(F())j(e);else if(N()){const{git:n}=await c.prompt([{name:"git",type:"confirm",message:s.question.git,default:!0}]);n&&(p("git init"),j(e))}},D=_(import.meta.url)("create-vuepress-theme-hope/package.json").version,U=e=>({"docs:build":`vuepress build ${e}`,"docs:clean-dev":`vuepress dev ${e} --clean-cache`,"docs:dev":`vuepress dev ${e}`}),V=async(e,r)=>{const t=i(process.cwd(),"package.json"),s=U(e),o={"@vuepress/client":"2.0.0-beta.51",vue:"^3.2.29",vuepress:"2.0.0-beta.51","vuepress-theme-hope":D};if(d(t)){console.log(r.flow.updatePackage);const a=JSON.parse(f(t,{encoding:"utf-8"}));g(a,{scripts:s,devDependencies:o}),u(t,`${JSON.stringify(a,null,2)}
|
|
65
65
|
`,{encoding:"utf-8"})}else{console.log(r.flow.createPackage);const a={...await c.prompt([{name:"name",type:"input",message:r.question.name,default:"vuepress-theme-hope-template",validate:n=>/^(?:@[a-z0-9-*~][a-z0-9-*._~]*\/)?[a-z0-9-~][a-z0-9-._~]*$/u.exec(n)?!0:r.error.name},{name:"version",type:"input",message:r.question.version,default:"2.0.0",validate:n=>/^[0-9]+\.[0-9]+\.(?:[0=9]+|[0-9]+-[a-z]+\.[0-9])$/u.exec(n)?!0:r.error.version},{name:"description",type:"input",message:r.question.description,default:"A project of vuepress-theme-hope"},{name:"license",type:"input",message:r.question.license,default:"MIT"}]),type:"module",scripts:s,devDependencies:o};u(t,`${JSON.stringify(a,null,2)}
|
|
66
66
|
`,{encoding:"utf-8"})}},L="https://registry.npmmirror.com/",B=e=>p(`${e} config get registry`).stdout,K=async(e,r)=>{const t=B(e);if(r==="简体中文"){const{registry:s}=await c.prompt([{name:"registry",type:"list",message:"选择你想使用的源",choices:["国内镜像源","当前源"]}]);return s==="国内镜像源"?L:t}return t},l=A("vuepress-theme-hope");l.command("[dir]","Generate a new vuepress-theme-hope project").option("-p, --preset <preset>","Choose preset to use").usage("pnpm create vuepress-theme-hope@next [dir] / npm init vuepress-theme-hope@next [dir]").example("docs").action(async(e,{preset:r=null})=>{if(!e)return l.outputHelp();const{lang:t,message:s}=await C();if(r&&!["doc","blog"].includes(r))return console.log(s.error.preset);const o=await E(s.question.packageManager);if(e.startsWith("[")&&e.endsWith("]"))return console.log(s.error.dir(o));const a=i(process.cwd(),e);if(d(a)&&m(a).length)return console.error(s.error.empty(e));await V(e,s),await Y(e,{packageManager:o,lang:t,message:s,preset:r});const n=o==="pnpm"?"":await K(o,t);console.log(s.flow.install),console.warn(s.hint.install),p(`${o} install ${n?"":`--registry ${n}`}`,{stdout:"inherit"}),console.log(s.hint.finish);const{choice:T}=await c.prompt([{name:"choice",type:"confirm",message:s.question.devServer,default:!0}]);T?(console.log(s.flow.devServer),await I(`${o} run docs:dev`,{stdout:"inherit"})):console.log(s.hint.devServer(o))}),l.help(()=>[{title:"pnpm create vuepress-theme-hope@next [dir] / npm init vuepress-theme-hope@next [dir]",body:"Create a vuepress-theme-hope template in [dir]"}]),l.version(D),l.parse();
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "create-vuepress-theme-hope",
|
|
3
|
-
"version": "2.0.0-beta.
|
|
3
|
+
"version": "2.0.0-beta.104",
|
|
4
4
|
"description": "Create vuepress-theme-hope demo project helper",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"create",
|
|
@@ -38,7 +38,7 @@
|
|
|
38
38
|
"dependencies": {
|
|
39
39
|
"cac": "6.7.14",
|
|
40
40
|
"execa": "6.1.0",
|
|
41
|
-
"inquirer": "9.1.
|
|
41
|
+
"inquirer": "9.1.2"
|
|
42
42
|
},
|
|
43
43
|
"devDependencies": {
|
|
44
44
|
"@types/inquirer": "9.0.1",
|