create-vuepress-theme-hope 2.0.0-beta.136 → 2.0.0-beta.138
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
CHANGED
|
@@ -61,6 +61,6 @@ ${e!=="pnpm"?` - name: ${t==="简体中文"?"安装依赖":"Install Deps"}
|
|
|
61
61
|
# ${t==="简体中文"?"这是文档部署到的分支名称":"This is the branch where the docs are deployed to"}
|
|
62
62
|
branch: gh-pages
|
|
63
63
|
folder: ${k(r,".vuepress/dist").replace(/\\/g,"/")}
|
|
64
|
-
`,v=(e,...r)=>{if(r.length===0)return e;const t=r.shift()||{};return Object.keys(t).forEach(s=>{typeof e[s]=="object"&&!Array.isArray(e[s])&&typeof t[s]=="object"&&!Array.isArray(t[s])?v(e[s],t[s]):typeof t[s]=="object"?Array.isArray(t[s])?e[s]=[...t[s]]:e[s]={...t[s]}:e[s]=t[s]}),v(e,...r)},m=e=>{try{h(e)}catch{P(e,{recursive:!0})}},j=(e,r)=>{const t=$(r);m(t);const s=C(e),o=N(r);s.pipe(o)},x=(e,r)=>{m(r),h(e,{withFileTypes:!0}).forEach(t=>{t.isFile()?j(`${e}/${t.name}`,`${r}/${t.name}`):t.isDirectory()&&x(`${e}/${t.name}`,`${r}/${t.name}`)})},S=(e,r)=>{w(e).isDirectory()?x(e,r):w(e).isFile()&&j(e,r)},J=(e=process.cwd())=>{try{return l("git status",{cwd:e}),!0}catch{return!1}},R=()=>{try{return l("git --version"),!0}catch{return!1}},Y=()=>{try{return l("pnpm --version",{stdio:"ignore"}).exitCode===0}catch{return!1}},U=()=>{try{return l("yarn --version",{stdio:"ignore"}).exitCode===0}catch{return!1}},y=["npm"];U()&&y.push("yarn"),Y()&&y.push("pnpm");const V=async e=>(await p.prompt([{name:"packageManager",type:"list",message:e,choices:y}])).packageManager,L=z(import.meta.url),D=$(L),M=async(e,{cwd:r=process.cwd(),packageManager:t,lang:s,message:o,preset:n})=>{const{workflow:i}=await p.prompt([{name:"workflow",type:"confirm",message:o.question.workflow,default:!0}]);if(n||(n=(await p.prompt([{name:"preset",type:"list",message:o.question.preset,choices:["blog","docs"]}])).preset),console.log(o.flow.generateTemplate),S(a(D,"../template/public"),a(r,e,"./.vuepress/public")),S(a(D,"../template",n),a(r,e)),i){const c=a(r,".github/workflows");m(c),d(a(c,"deploy-docs.yml"),H(t,e,s),{encoding:"utf-8"})}if(J(r))b(e,r);else if(R()){const{git:c}=await p.prompt([{name:"git",type:"confirm",message:o.question.git,default:!0}]);c&&(l("git init",{cwd:r}),b(e,r))}},T=F(import.meta.url)("create-vuepress-theme-hope/package.json").version,B=e=>({"docs:build":`vuepress build ${e}`,"docs:clean-dev":`vuepress dev ${e} --clean-cache`,"docs:dev":`vuepress dev ${e}`}),G=async(e,r,t=process.cwd())=>{const s=a(t,"package.json"),o=B(r),n={"@vuepress/client":"2.0.0-beta.
|
|
64
|
+
`,v=(e,...r)=>{if(r.length===0)return e;const t=r.shift()||{};return Object.keys(t).forEach(s=>{typeof e[s]=="object"&&!Array.isArray(e[s])&&typeof t[s]=="object"&&!Array.isArray(t[s])?v(e[s],t[s]):typeof t[s]=="object"?Array.isArray(t[s])?e[s]=[...t[s]]:e[s]={...t[s]}:e[s]=t[s]}),v(e,...r)},m=e=>{try{h(e)}catch{P(e,{recursive:!0})}},j=(e,r)=>{const t=$(r);m(t);const s=C(e),o=N(r);s.pipe(o)},x=(e,r)=>{m(r),h(e,{withFileTypes:!0}).forEach(t=>{t.isFile()?j(`${e}/${t.name}`,`${r}/${t.name}`):t.isDirectory()&&x(`${e}/${t.name}`,`${r}/${t.name}`)})},S=(e,r)=>{w(e).isDirectory()?x(e,r):w(e).isFile()&&j(e,r)},J=(e=process.cwd())=>{try{return l("git status",{cwd:e}),!0}catch{return!1}},R=()=>{try{return l("git --version"),!0}catch{return!1}},Y=()=>{try{return l("pnpm --version",{stdio:"ignore"}).exitCode===0}catch{return!1}},U=()=>{try{return l("yarn --version",{stdio:"ignore"}).exitCode===0}catch{return!1}},y=["npm"];U()&&y.push("yarn"),Y()&&y.push("pnpm");const V=async e=>(await p.prompt([{name:"packageManager",type:"list",message:e,choices:y}])).packageManager,L=z(import.meta.url),D=$(L),M=async(e,{cwd:r=process.cwd(),packageManager:t,lang:s,message:o,preset:n})=>{const{workflow:i}=await p.prompt([{name:"workflow",type:"confirm",message:o.question.workflow,default:!0}]);if(n||(n=(await p.prompt([{name:"preset",type:"list",message:o.question.preset,choices:["blog","docs"]}])).preset),console.log(o.flow.generateTemplate),S(a(D,"../template/public"),a(r,e,"./.vuepress/public")),S(a(D,"../template",n),a(r,e)),i){const c=a(r,".github/workflows");m(c),d(a(c,"deploy-docs.yml"),H(t,e,s),{encoding:"utf-8"})}if(J(r))b(e,r);else if(R()){const{git:c}=await p.prompt([{name:"git",type:"confirm",message:o.question.git,default:!0}]);c&&(l("git init",{cwd:r}),b(e,r))}},T=F(import.meta.url)("create-vuepress-theme-hope/package.json").version,B=e=>({"docs:build":`vuepress build ${e}`,"docs:clean-dev":`vuepress dev ${e} --clean-cache`,"docs:dev":`vuepress dev ${e}`}),G=async(e,r,t=process.cwd())=>{const s=a(t,"package.json"),o=B(r),n={"@vuepress/client":"2.0.0-beta.56",vue:"^3.2.45",vuepress:"2.0.0-beta.56","vuepress-theme-hope":T};if(g(s)){console.log(e.flow.updatePackage);const i=JSON.parse(f(s,{encoding:"utf-8"}));v(i,{scripts:o,devDependencies:n}),d(s,`${JSON.stringify(i,null,2)}
|
|
65
65
|
`,{encoding:"utf-8"})}else{console.log(e.flow.createPackage);const i={...await p.prompt([{name:"name",type:"input",message:e.question.name,default:"vuepress-theme-hope-template",validate:c=>/^(?:@[a-z0-9-*~][a-z0-9-*._~]*\/)?[a-z0-9-~][a-z0-9-._~]*$/u.exec(c)?!0:e.error.name},{name:"version",type:"input",message:e.question.version,default:"2.0.0",validate:c=>/^[0-9]+\.[0-9]+\.(?:[0=9]+|[0-9]+-[a-z]+\.[0-9])$/u.exec(c)?!0:e.error.version},{name:"description",type:"input",message:e.question.description,default:"A project of vuepress-theme-hope"},{name:"license",type:"input",message:e.question.license,default:"MIT"}]),type:"module",scripts:o,devDependencies:n};d(s,`${JSON.stringify(i,null,2)}
|
|
66
66
|
`,{encoding:"utf-8"})}},K="https://registry.npmmirror.com/",Q=e=>l(`${e} config get registry`).stdout,X=async(e,r)=>{const t=Q(e);if(r==="简体中文"){const{registry:s}=await p.prompt([{name:"registry",type:"list",message:"选择你想使用的源",choices:["国内镜像源","当前源"]}]);return s==="国内镜像源"?K:t}return t},q=async(e,r)=>{if(!e)return u.outputHelp();const{lang:t,message:s}=await O();if(r&&!["docs","blog"].includes(r))return console.log(s.error.preset);const o=await V(s.question.packageManager);if(e.startsWith("[")&&e.endsWith("]"))return console.log(s.error.updateDirMissing(o));const n=a(process.cwd(),e);return g(n)&&h(n).length?console.error(s.error.dirNotEmpty(e)):(m(n),{lang:t,message:s,packageManager:o})},A=async({cwd:e=process.cwd(),lang:r,message:t,packageManager:s})=>{const o=s==="pnpm"?"":await X(s,r);console.log(t.flow.install),console.warn(t.hint.install),l(`${s} install ${o?`--registry ${o}`:""}`,{cwd:e,stdout:"inherit"}),console.log(t.hint.finish);const{choice:n}=await p.prompt([{name:"choice",type:"confirm",message:t.question.devServer,default:!0}]);n?(console.log(t.flow.devServer),await I(`${s} run docs:dev`,{cwd:e,stdout:"inherit"})):console.log(t.hint.devServer(s))},u=E("vuepress-theme-hope");u.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})=>{const t=a(process.cwd(),e),s=await q(e,r);if(s){const{lang:o,message:n,packageManager:i}=s;await G(n,"src",e),await M("src",{cwd:t,packageManager:i,lang:o,message:n,preset:r}),await A({cwd:t,lang:o,message:n,packageManager:i})}}),u.command("inject [dir]","Add vuepress template to dir").option("-p, --preset <preset>","Choose preset to use").usage("pnpm create vuepress-theme-hope@next inject [dir] / npm init vuepress-theme-hope@next inject [dir]").example("docs").action(async(e,{preset:r=null})=>{const t=await q(e,r);if(t){const{lang:s,message:o,packageManager:n}=t;await G(o,e),await M(e,{packageManager:n,lang:s,message:o,preset:r}),await A({message:o,lang:s,packageManager:n})}}),u.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]"},{title:"pnpm create vuepress-theme-hope@next inject [dir] / npm init vuepress-theme-hope@next inject [dir]",body:"Add vuepress-theme-hope template in [dir] under current project"}]),u.version(T),u.parse();
|
package/package.json
CHANGED
|
@@ -116,9 +116,7 @@ export default hopeTheme({
|
|
|
116
116
|
},
|
|
117
117
|
|
|
118
118
|
plugins: {
|
|
119
|
-
blog:
|
|
120
|
-
autoExcerpt: true,
|
|
121
|
-
},
|
|
119
|
+
blog: true,
|
|
122
120
|
|
|
123
121
|
// If you don’t need comment feature, you can remove following option
|
|
124
122
|
// The following config is for demo ONLY, if you need comment feature, please generate and use your own config, see comment plugin documentation for details.
|
|
@@ -84,48 +84,6 @@ A custom details container
|
|
|
84
84
|
|
|
85
85
|
:::
|
|
86
86
|
|
|
87
|
-
:::: details Code
|
|
88
|
-
|
|
89
|
-
```md
|
|
90
|
-
::: v-pre
|
|
91
|
-
|
|
92
|
-
Safely use {{ variable }} in Markdown.
|
|
93
|
-
|
|
94
|
-
:::
|
|
95
|
-
|
|
96
|
-
::: info Custom Title
|
|
97
|
-
|
|
98
|
-
A custom information container
|
|
99
|
-
|
|
100
|
-
:::
|
|
101
|
-
|
|
102
|
-
::: tip Custom Title
|
|
103
|
-
|
|
104
|
-
A custom tip container
|
|
105
|
-
|
|
106
|
-
:::
|
|
107
|
-
|
|
108
|
-
::: warning Custom Title
|
|
109
|
-
|
|
110
|
-
A custom warning container
|
|
111
|
-
|
|
112
|
-
:::
|
|
113
|
-
|
|
114
|
-
::: danger Custom Title
|
|
115
|
-
|
|
116
|
-
A custom danger container
|
|
117
|
-
|
|
118
|
-
:::
|
|
119
|
-
|
|
120
|
-
::: details Custom Title
|
|
121
|
-
|
|
122
|
-
A custom details container
|
|
123
|
-
|
|
124
|
-
:::
|
|
125
|
-
```
|
|
126
|
-
|
|
127
|
-
::::
|
|
128
|
-
|
|
129
87
|
- [View Detail](https://vuepress-theme-hope.github.io/v2/guide/markdown/container.html)
|
|
130
88
|
|
|
131
89
|
#### Tabs
|
|
@@ -84,48 +84,6 @@ const a = 1;
|
|
|
84
84
|
|
|
85
85
|
:::
|
|
86
86
|
|
|
87
|
-
:::: details 代码
|
|
88
|
-
|
|
89
|
-
```md
|
|
90
|
-
::: v-pre
|
|
91
|
-
|
|
92
|
-
安全的在 Markdown 中使用 {{ variable }}。
|
|
93
|
-
|
|
94
|
-
:::
|
|
95
|
-
|
|
96
|
-
::: info 自定义标题
|
|
97
|
-
|
|
98
|
-
信息容器
|
|
99
|
-
|
|
100
|
-
:::
|
|
101
|
-
|
|
102
|
-
::: tip 自定义标题
|
|
103
|
-
|
|
104
|
-
提示容器
|
|
105
|
-
|
|
106
|
-
:::
|
|
107
|
-
|
|
108
|
-
::: warning 自定义标题
|
|
109
|
-
|
|
110
|
-
警告容器
|
|
111
|
-
|
|
112
|
-
:::
|
|
113
|
-
|
|
114
|
-
::: danger 自定义标题
|
|
115
|
-
|
|
116
|
-
危险容器
|
|
117
|
-
|
|
118
|
-
:::
|
|
119
|
-
|
|
120
|
-
::: details 自定义标题
|
|
121
|
-
|
|
122
|
-
详情容器
|
|
123
|
-
|
|
124
|
-
:::
|
|
125
|
-
```
|
|
126
|
-
|
|
127
|
-
::::
|
|
128
|
-
|
|
129
87
|
- [查看详情](https://vuepress-theme-hope.github.io/v2/zh/guide/markdown/container.html)
|
|
130
88
|
|
|
131
89
|
#### 代码块
|
|
@@ -84,48 +84,6 @@ A custom details container
|
|
|
84
84
|
|
|
85
85
|
:::
|
|
86
86
|
|
|
87
|
-
:::: details Code
|
|
88
|
-
|
|
89
|
-
```md
|
|
90
|
-
::: v-pre
|
|
91
|
-
|
|
92
|
-
Safely use {{ variable }} in Markdown.
|
|
93
|
-
|
|
94
|
-
:::
|
|
95
|
-
|
|
96
|
-
::: info Custom Title
|
|
97
|
-
|
|
98
|
-
A custom information container
|
|
99
|
-
|
|
100
|
-
:::
|
|
101
|
-
|
|
102
|
-
::: tip Custom Title
|
|
103
|
-
|
|
104
|
-
A custom tip container
|
|
105
|
-
|
|
106
|
-
:::
|
|
107
|
-
|
|
108
|
-
::: warning Custom Title
|
|
109
|
-
|
|
110
|
-
A custom warning container
|
|
111
|
-
|
|
112
|
-
:::
|
|
113
|
-
|
|
114
|
-
::: danger Custom Title
|
|
115
|
-
|
|
116
|
-
A custom danger container
|
|
117
|
-
|
|
118
|
-
:::
|
|
119
|
-
|
|
120
|
-
::: details Custom Title
|
|
121
|
-
|
|
122
|
-
A custom details container
|
|
123
|
-
|
|
124
|
-
:::
|
|
125
|
-
```
|
|
126
|
-
|
|
127
|
-
::::
|
|
128
|
-
|
|
129
87
|
- [View Detail](https://vuepress-theme-hope.github.io/v2/guide/markdown/container.html)
|
|
130
88
|
|
|
131
89
|
#### Tabs
|
|
@@ -84,48 +84,6 @@ const a = 1;
|
|
|
84
84
|
|
|
85
85
|
:::
|
|
86
86
|
|
|
87
|
-
:::: details 代码
|
|
88
|
-
|
|
89
|
-
```md
|
|
90
|
-
::: v-pre
|
|
91
|
-
|
|
92
|
-
安全的在 Markdown 中使用 {{ variable }}。
|
|
93
|
-
|
|
94
|
-
:::
|
|
95
|
-
|
|
96
|
-
::: info 自定义标题
|
|
97
|
-
|
|
98
|
-
信息容器
|
|
99
|
-
|
|
100
|
-
:::
|
|
101
|
-
|
|
102
|
-
::: tip 自定义标题
|
|
103
|
-
|
|
104
|
-
提示容器
|
|
105
|
-
|
|
106
|
-
:::
|
|
107
|
-
|
|
108
|
-
::: warning 自定义标题
|
|
109
|
-
|
|
110
|
-
警告容器
|
|
111
|
-
|
|
112
|
-
:::
|
|
113
|
-
|
|
114
|
-
::: danger 自定义标题
|
|
115
|
-
|
|
116
|
-
危险容器
|
|
117
|
-
|
|
118
|
-
:::
|
|
119
|
-
|
|
120
|
-
::: details 自定义标题
|
|
121
|
-
|
|
122
|
-
详情容器
|
|
123
|
-
|
|
124
|
-
:::
|
|
125
|
-
```
|
|
126
|
-
|
|
127
|
-
::::
|
|
128
|
-
|
|
129
87
|
- [查看详情](https://vuepress-theme-hope.github.io/v2/zh/guide/markdown/container.html)
|
|
130
88
|
|
|
131
89
|
#### 代码块
|