create-vuepress-theme-hope 2.0.0-beta.247 → 2.0.0-beta.249
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 +1 -1
- package/template/blog/config/en/theme.ts +4 -1
- package/template/blog/config/multi/theme.ts +4 -1
- package/template/blog/config/zh/theme.ts +4 -1
- package/template/blog/en/demo/markdown.md +3 -3
- package/template/blog/zh/demo/markdown.md +4 -4
- package/template/docs/config/en/theme.ts +4 -1
- package/template/docs/config/multi/theme.ts +4 -1
- package/template/docs/config/zh/theme.ts +4 -1
- package/template/docs/en/README.md +4 -4
- package/template/docs/en/demo/markdown.md +3 -3
- package/template/docs/zh/README.md +4 -4
- package/template/docs/zh/demo/markdown.md +3 -3
package/lib/index.js
CHANGED
|
@@ -64,6 +64,6 @@ ${e!=="pnpm"?` - name: ${s==="简体中文"?"安装依赖":"Install Deps"}
|
|
|
64
64
|
# ${s==="简体中文"?"这是文档部署到的分支名称":"This is the branch where the docs are deployed to"}
|
|
65
65
|
branch: gh-pages
|
|
66
66
|
folder: ${x(t,".vuepress/dist").replace(/\\/g,"/")}
|
|
67
|
-
`,V=/^(?:@[a-z0-9-*~][a-z0-9-*._~]*\/)?[a-z0-9-~][a-z0-9-._~]*$/u,L=/^[0-9]+\.[0-9]+\.(?:[0=9]+|[0-9]+-[a-z]+\.[0-9])$/u,B=Array.isArray,$=e=>Object.prototype.toString.call(e)==="[object Object]",k=(e,...t)=>{if(t.length===0)return e;const s=t.shift()||null;return s&&Object.entries(s).forEach(([a,o])=>{a==="__proto__"||a==="constructor"||($(e[a])&&$(o)?k(e[a],o):B(o)?e[a]=[...o]:$(o)?e[a]={...o}:e[a]=s[a])}),k(e,...t)},y=e=>{try{w(e)}catch{try{A(e,{recursive:!0})}catch{}}},G=(e,t)=>{const s=D(t);y(s);const a=C(e),o=I(t);a.pipe(o)},T=(e,t)=>{y(t),w(e,{withFileTypes:!0}).forEach(s=>{s.isFile()?G(`${e}/${s.name}`,`${t}/${s.name}`):s.isDirectory()&&T(`${e}/${s.name}`,`${t}/${s.name}`)})},c=(e,t)=>{S(e).isDirectory()?T(e,t):S(e).isFile()&&G(e,t)},K=(e=process.cwd())=>{try{return u("git status",{cwd:e}),!0}catch{return!1}},Q=()=>{try{return u("git --version"),!0}catch{return!1}},X=()=>{try{return u("pnpm --version",{stdio:"ignore"}).exitCode===0}catch{return!1}},Z=()=>{try{return u("yarn --version",{stdio:"ignore"}).exitCode===0}catch{return!1}},b=["npm"];Z()&&b.push("yarn"),X()&&b.push("pnpm");const ee=async e=>(await m.prompt([{name:"packageManager",type:"list",message:e,choices:b}])).packageManager,te=W(import.meta.url),p=D(te),_=async(e,{cwd:t=process.cwd(),packageManager:s,lang:a,message:o,preset:n})=>{const{i18n:l,workflow:d}=await m.prompt([{name:"i18n",type:"confirm",message:o.question.i18n,default:!1},{name:"workflow",type:"confirm",message:o.question.workflow,default:!0}]);n||(n=(await m.prompt([{name:"preset",type:"list",message:o.question.preset,choices:["blog","docs"]}])).preset),console.log(o.flow.generateTemplate);const i=n;if(c(r(p,"../template/public"),r(t,e,"./.vuepress/public")),c(r(p,"../template",i,"config/base"),r(t,e,".vuepress")),l?(c(r(p,"../template",i,"en"),r(t,e)),c(r(p,"../template",i,"zh"),r(t,e,"zh")),c(r(p,"../template",i,"config/multi"),r(t,e,".vuepress"))):a==="简体中文"?(c(r(p,"../template",i,"zh"),r(t,e)),c(r(p,"../template",i,"config/zh"),r(t,e,".vuepress"))):(c(r(p,"../template",i,"en"),r(t,e)),c(r(p,"../template",i,"config/en"),r(t,e,".vuepress"))),d){const h=r(t,".github/workflows");y(h),v(r(h,"deploy-docs.yml"),U(s,e,a),{encoding:"utf-8"})}if(K(t))M(e,t);else if(Q()){const{git:h}=await m.prompt([{name:"git",type:"confirm",message:o.question.git,default:!0}]);h&&(u("git init",{cwd:t}),M(e,t))}},E=R(import.meta.url)("create-vuepress-theme-hope/package.json").version,se=(e,t)=>({"docs:build":`vuepress build ${t}`,"docs:clean-dev":`vuepress dev ${t} --clean-cache`,"docs:dev":`vuepress dev ${t}`,"docs:update-package":`${e==="npm"?"npx":`${e} dlx`} vp-update`}),q=async(e,t,s,a=process.cwd())=>{const o=r(a,"package.json"),n=se(e,s),l={"@vuepress/client":"2.0.0-beta.
|
|
67
|
+
`,V=/^(?:@[a-z0-9-*~][a-z0-9-*._~]*\/)?[a-z0-9-~][a-z0-9-._~]*$/u,L=/^[0-9]+\.[0-9]+\.(?:[0=9]+|[0-9]+-[a-z]+\.[0-9])$/u,B=Array.isArray,$=e=>Object.prototype.toString.call(e)==="[object Object]",k=(e,...t)=>{if(t.length===0)return e;const s=t.shift()||null;return s&&Object.entries(s).forEach(([a,o])=>{a==="__proto__"||a==="constructor"||($(e[a])&&$(o)?k(e[a],o):B(o)?e[a]=[...o]:$(o)?e[a]={...o}:e[a]=s[a])}),k(e,...t)},y=e=>{try{w(e)}catch{try{A(e,{recursive:!0})}catch{}}},G=(e,t)=>{const s=D(t);y(s);const a=C(e),o=I(t);a.pipe(o)},T=(e,t)=>{y(t),w(e,{withFileTypes:!0}).forEach(s=>{s.isFile()?G(`${e}/${s.name}`,`${t}/${s.name}`):s.isDirectory()&&T(`${e}/${s.name}`,`${t}/${s.name}`)})},c=(e,t)=>{S(e).isDirectory()?T(e,t):S(e).isFile()&&G(e,t)},K=(e=process.cwd())=>{try{return u("git status",{cwd:e}),!0}catch{return!1}},Q=()=>{try{return u("git --version"),!0}catch{return!1}},X=()=>{try{return u("pnpm --version",{stdio:"ignore"}).exitCode===0}catch{return!1}},Z=()=>{try{return u("yarn --version",{stdio:"ignore"}).exitCode===0}catch{return!1}},b=["npm"];Z()&&b.push("yarn"),X()&&b.push("pnpm");const ee=async e=>(await m.prompt([{name:"packageManager",type:"list",message:e,choices:b}])).packageManager,te=W(import.meta.url),p=D(te),_=async(e,{cwd:t=process.cwd(),packageManager:s,lang:a,message:o,preset:n})=>{const{i18n:l,workflow:d}=await m.prompt([{name:"i18n",type:"confirm",message:o.question.i18n,default:!1},{name:"workflow",type:"confirm",message:o.question.workflow,default:!0}]);n||(n=(await m.prompt([{name:"preset",type:"list",message:o.question.preset,choices:["blog","docs"]}])).preset),console.log(o.flow.generateTemplate);const i=n;if(c(r(p,"../template/public"),r(t,e,"./.vuepress/public")),c(r(p,"../template",i,"config/base"),r(t,e,".vuepress")),l?(c(r(p,"../template",i,"en"),r(t,e)),c(r(p,"../template",i,"zh"),r(t,e,"zh")),c(r(p,"../template",i,"config/multi"),r(t,e,".vuepress"))):a==="简体中文"?(c(r(p,"../template",i,"zh"),r(t,e)),c(r(p,"../template",i,"config/zh"),r(t,e,".vuepress"))):(c(r(p,"../template",i,"en"),r(t,e)),c(r(p,"../template",i,"config/en"),r(t,e,".vuepress"))),d){const h=r(t,".github/workflows");y(h),v(r(h,"deploy-docs.yml"),U(s,e,a),{encoding:"utf-8"})}if(K(t))M(e,t);else if(Q()){const{git:h}=await m.prompt([{name:"git",type:"confirm",message:o.question.git,default:!0}]);h&&(u("git init",{cwd:t}),M(e,t))}},E=R(import.meta.url)("create-vuepress-theme-hope/package.json").version,se=(e,t)=>({"docs:build":`vuepress build ${t}`,"docs:clean-dev":`vuepress dev ${t} --clean-cache`,"docs:dev":`vuepress dev ${t}`,"docs:update-package":`${e==="npm"?"npx":`${e} dlx`} vp-update`}),q=async(e,t,s,a=process.cwd())=>{const o=r(a,"package.json"),n=se(e,s),l={"@vuepress/client":"2.0.0-beta.68",vue:"^3.3.8",vuepress:"2.0.0-beta.68","vuepress-theme-hope":E};if(f(o)){console.log(t.flow.updatePackage);const d=JSON.parse(j(o,{encoding:"utf-8"}));k(d,{scripts:n,devDependencies:l}),v(o,`${JSON.stringify(d,null,2)}
|
|
68
68
|
`,{encoding:"utf-8"})}else{console.log(t.flow.createPackage);const d={...await m.prompt([{name:"name",type:"input",message:t.question.name,default:"vuepress-theme-hope-template",validate:i=>V.exec(i)?!0:t.error.name},{name:"version",type:"input",message:t.question.version,default:"2.0.0",validate:i=>L.exec(i)?!0:t.error.version},{name:"description",type:"input",message:t.question.description,default:"A project of vuepress-theme-hope"},{name:"license",type:"input",message:t.question.license,default:"MIT"}]),type:"module",scripts:n,devDependencies:l};v(o,`${JSON.stringify(d,null,2)}
|
|
69
69
|
`,{encoding:"utf-8"})}},P="https://registry.npmmirror.com/",ae=e=>u(`${e} config get registry`).stdout,oe=async(e,t)=>{const s=ae(e);if(/https:\/\/registry\.npm\.taobao\.org\/?/.test(s)&&(console.error("npm.taobao.org is no longer available, resetting it to npmmirror.com"),u(`${e} config set registry ${P}`)),t==="简体中文"){const{registry:a}=await m.prompt([{name:"registry",type:"list",message:"选择你想使用的源",choices:["国内镜像源","当前源"]}]);return a==="国内镜像源"?P:s}return s},z=async(e,t)=>{if(!e)return g.outputHelp();const{lang:s,message:a}=await J();if(t&&!["docs","blog"].includes(t))return console.log(a.error.preset);const o=await ee(a.question.packageManager);if(e.startsWith("[")&&e.endsWith("]"))return console.log(a.error.updateDirMissing(o));const n=r(process.cwd(),e);return f(n)&&w(n).length?console.error(a.error.dirNotEmpty(e)):(y(n),{lang:s,message:a,packageManager:o})},N=async({cwd:e=process.cwd(),lang:t,message:s,packageManager:a})=>{const o=a==="pnpm"?"":await oe(a,t);console.log(s.flow.install),console.warn(s.hint.install),u(`${a} install ${o?`--registry ${o}`:""}`,{cwd:e,stdout:"inherit"}),console.log(s.hint.finish);const{choice:n}=await m.prompt([{name:"choice",type:"confirm",message:s.question.devServer,default:!0}]);n?(console.log(s.flow.devServer),await F(`${a} run docs:dev`,{cwd:e,stdout:"inherit"})):console.log(s.hint.devServer(a))},g=O("vuepress-theme-hope");g.command("[dir]","Generate a new vuepress-theme-hope project").option("-p, --preset <preset>","Choose preset to use").usage("pnpm create vuepress-theme-hope [dir] / yarn create vuepress-theme-hope [dir] / npm init vuepress-theme-hope [dir]").example("docs").action(async(e,{preset:t=null})=>{const s=r(process.cwd(),e),a=await z(e,t);if(a){const{lang:o,message:n,packageManager:l}=a;await q(l,n,"src",e),await _("src",{cwd:s,packageManager:l,lang:o,message:n,preset:t}),await N({cwd:s,lang:o,message:n,packageManager:l})}}),g.command("add [dir]","Add vuepress template to dir").alias("inject").option("-p, --preset <preset>","Choose preset to use").usage("pnpm create vuepress-theme-hope add [dir] / yarn create vuepress-theme-hope add [dir] / npm init vuepress-theme-hope add [dir]").example("docs").action(async(e,{preset:t=null})=>{const s=await z(e,t);if(s){const{lang:a,message:o,packageManager:n}=s;await q(n,o,e),await _(e,{packageManager:n,lang:a,message:o,preset:t}),await N({message:o,lang:a,packageManager:n})}}),g.help(()=>[{title:"pnpm create vuepress-theme-hope [dir] / yarn create vuepress-theme-hope [dir] / npm init vuepress-theme-hope [dir]",body:"Create a vuepress-theme-hope template in [dir]"},{title:"pnpm create vuepress-theme-hope inject [dir] / yarn create vuepress-theme-hope add [dir] / npm init vuepress-theme-hope inject [dir]",body:"Add vuepress-theme-hope template in [dir] under current project"}]),g.version(E),g.parse();
|
package/package.json
CHANGED
|
@@ -95,12 +95,15 @@ export default hopeTheme({
|
|
|
95
95
|
mdEnhance: {
|
|
96
96
|
align: true,
|
|
97
97
|
attrs: true,
|
|
98
|
-
card: true,
|
|
99
98
|
|
|
100
99
|
// install chart.js before enabling it
|
|
101
100
|
// chart: true,
|
|
102
101
|
|
|
103
102
|
codetabs: true,
|
|
103
|
+
|
|
104
|
+
// insert component easily
|
|
105
|
+
// component: true,
|
|
106
|
+
|
|
104
107
|
demo: true,
|
|
105
108
|
|
|
106
109
|
// install echarts before enabling it
|
|
@@ -128,12 +128,15 @@ export default hopeTheme({
|
|
|
128
128
|
mdEnhance: {
|
|
129
129
|
align: true,
|
|
130
130
|
attrs: true,
|
|
131
|
-
card: true,
|
|
132
131
|
|
|
133
132
|
// install chart.js before enabling it
|
|
134
133
|
// chart: true,
|
|
135
134
|
|
|
136
135
|
codetabs: true,
|
|
136
|
+
|
|
137
|
+
// insert component easily
|
|
138
|
+
// component: true,
|
|
139
|
+
|
|
137
140
|
demo: true,
|
|
138
141
|
|
|
139
142
|
// install echarts before enabling it
|
|
@@ -96,12 +96,15 @@ export default hopeTheme({
|
|
|
96
96
|
mdEnhance: {
|
|
97
97
|
align: true,
|
|
98
98
|
attrs: true,
|
|
99
|
-
card: true,
|
|
100
99
|
|
|
101
100
|
// install chart.js before enabling it
|
|
102
101
|
// chart: true,
|
|
103
102
|
|
|
104
103
|
codetabs: true,
|
|
104
|
+
|
|
105
|
+
// insert component easily
|
|
106
|
+
// component: true,
|
|
107
|
+
|
|
105
108
|
demo: true,
|
|
106
109
|
|
|
107
110
|
// install echarts before enabling it
|
|
@@ -187,9 +187,9 @@ Support setting color scheme and size
|
|
|
187
187
|
|
|
188
188
|
- [View Detail](https://theme-hope.vuejs.press/guide/markdown/image.html)
|
|
189
189
|
|
|
190
|
-
####
|
|
190
|
+
#### Component
|
|
191
191
|
|
|
192
|
-
```
|
|
192
|
+
```component VPCard
|
|
193
193
|
title: Mr.Hope
|
|
194
194
|
desc: Where there is light, there is hope
|
|
195
195
|
logo: https://mister-hope.com/logo.svg
|
|
@@ -197,7 +197,7 @@ link: https://mister-hope.com
|
|
|
197
197
|
color: rgba(253, 230, 138, 0.15)
|
|
198
198
|
```
|
|
199
199
|
|
|
200
|
-
- [View Detail](https://theme-hope.vuejs.press/guide/markdown/
|
|
200
|
+
- [View Detail](https://theme-hope.vuejs.press/guide/markdown/component.html)
|
|
201
201
|
|
|
202
202
|
#### Include files
|
|
203
203
|
|
|
@@ -161,15 +161,15 @@ npm i -D vuepress-theme-hope
|
|
|
161
161
|
|
|
162
162
|
- [查看详情](https://theme-hope.vuejs.press/zh/guide/markdown/tasklist.html)
|
|
163
163
|
|
|
164
|
-
|
|
164
|
+
#### 图片增强
|
|
165
165
|
|
|
166
166
|
支持为图片设置颜色模式和大小
|
|
167
167
|
|
|
168
168
|
- [查看详情](https://theme-hope.vuejs.press/zh/guide/markdown/image.html)
|
|
169
169
|
|
|
170
|
-
####
|
|
170
|
+
#### 组件
|
|
171
171
|
|
|
172
|
-
```
|
|
172
|
+
```component VPCard
|
|
173
173
|
title: Mr.Hope
|
|
174
174
|
desc: Where there is light, there is hope
|
|
175
175
|
logo: https://mister-hope.com/logo.svg
|
|
@@ -177,7 +177,7 @@ link: https://mister-hope.com
|
|
|
177
177
|
color: rgba(253, 230, 138, 0.15)
|
|
178
178
|
```
|
|
179
179
|
|
|
180
|
-
- [查看详情](https://theme-hope.vuejs.press/zh/guide/markdown/
|
|
180
|
+
- [查看详情](https://theme-hope.vuejs.press/zh/guide/markdown/component.html)
|
|
181
181
|
|
|
182
182
|
#### 导入文件
|
|
183
183
|
|
|
@@ -52,12 +52,15 @@ export default hopeTheme({
|
|
|
52
52
|
mdEnhance: {
|
|
53
53
|
align: true,
|
|
54
54
|
attrs: true,
|
|
55
|
-
card: true,
|
|
56
55
|
|
|
57
56
|
// install chart.js before enabling it
|
|
58
57
|
// chart: true,
|
|
59
58
|
|
|
60
59
|
codetabs: true,
|
|
60
|
+
|
|
61
|
+
// insert component easily
|
|
62
|
+
// component: true,
|
|
63
|
+
|
|
61
64
|
demo: true,
|
|
62
65
|
|
|
63
66
|
// install echarts before enabling it
|
|
@@ -77,12 +77,15 @@ export default hopeTheme({
|
|
|
77
77
|
mdEnhance: {
|
|
78
78
|
align: true,
|
|
79
79
|
attrs: true,
|
|
80
|
-
card: true,
|
|
81
80
|
|
|
82
81
|
// install chart.js before enabling it
|
|
83
82
|
// chart: true,
|
|
84
83
|
|
|
85
84
|
codetabs: true,
|
|
85
|
+
|
|
86
|
+
// insert component easily
|
|
87
|
+
// component: true,
|
|
88
|
+
|
|
86
89
|
demo: true,
|
|
87
90
|
|
|
88
91
|
// install echarts before enabling it
|
|
@@ -53,12 +53,15 @@ export default hopeTheme({
|
|
|
53
53
|
mdEnhance: {
|
|
54
54
|
align: true,
|
|
55
55
|
attrs: true,
|
|
56
|
-
card: true,
|
|
57
56
|
|
|
58
57
|
// install chart.js before enabling it
|
|
59
58
|
// chart: true,
|
|
60
59
|
|
|
61
60
|
codetabs: true,
|
|
61
|
+
|
|
62
|
+
// insert component easily
|
|
63
|
+
// component: true,
|
|
64
|
+
|
|
62
65
|
demo: true,
|
|
63
66
|
|
|
64
67
|
// install echarts before enabling it
|
|
@@ -90,10 +90,10 @@ highlights:
|
|
|
90
90
|
details: improve syntax to specify size and color scheme
|
|
91
91
|
link: https://theme-hope.vuejs.press/guide/markdown/image.html
|
|
92
92
|
|
|
93
|
-
- title:
|
|
94
|
-
icon:
|
|
95
|
-
details:
|
|
96
|
-
link: https://theme-hope.vuejs.press/guide/markdown/
|
|
93
|
+
- title: Component Support
|
|
94
|
+
icon: puzzle-piece
|
|
95
|
+
details: Easily insert components in Markdown
|
|
96
|
+
link: https://theme-hope.vuejs.press/guide/markdown/component.html
|
|
97
97
|
|
|
98
98
|
- title: Chart Support
|
|
99
99
|
icon: chart-simple
|
|
@@ -187,9 +187,9 @@ Support setting color scheme and size
|
|
|
187
187
|
|
|
188
188
|
- [View Detail](https://theme-hope.vuejs.press/guide/markdown/image.html)
|
|
189
189
|
|
|
190
|
-
####
|
|
190
|
+
#### Component
|
|
191
191
|
|
|
192
|
-
```
|
|
192
|
+
```component VPCard
|
|
193
193
|
title: Mr.Hope
|
|
194
194
|
desc: Where there is light, there is hope
|
|
195
195
|
logo: https://mister-hope.com/logo.svg
|
|
@@ -197,7 +197,7 @@ link: https://mister-hope.com
|
|
|
197
197
|
color: rgba(253, 230, 138, 0.15)
|
|
198
198
|
```
|
|
199
199
|
|
|
200
|
-
- [View Detail](https://theme-hope.vuejs.press/guide/markdown/
|
|
200
|
+
- [View Detail](https://theme-hope.vuejs.press/guide/markdown/component.html)
|
|
201
201
|
|
|
202
202
|
#### Include files
|
|
203
203
|
|
|
@@ -90,10 +90,10 @@ highlights:
|
|
|
90
90
|
details: 使用改进的语法指定图片大小与颜色模式
|
|
91
91
|
link: https://theme-hope.vuejs.press/zh/guide/markdown/image.html
|
|
92
92
|
|
|
93
|
-
- title:
|
|
94
|
-
icon:
|
|
95
|
-
details: 在 Markdown
|
|
96
|
-
link: https://theme-hope.vuejs.press/zh/guide/markdown/
|
|
93
|
+
- title: 组件支持
|
|
94
|
+
icon: puzzle-piece
|
|
95
|
+
details: 在 Markdown 中轻松插入组件
|
|
96
|
+
link: https://theme-hope.vuejs.press/zh/guide/markdown/component.html
|
|
97
97
|
|
|
98
98
|
- title: 图表支持
|
|
99
99
|
icon: chart-simple
|
|
@@ -167,9 +167,9 @@ npm i -D vuepress-theme-hope
|
|
|
167
167
|
|
|
168
168
|
- [查看详情](https://theme-hope.vuejs.press/zh/guide/markdown/image.html)
|
|
169
169
|
|
|
170
|
-
####
|
|
170
|
+
#### 组件
|
|
171
171
|
|
|
172
|
-
```
|
|
172
|
+
```component VPCard
|
|
173
173
|
title: Mr.Hope
|
|
174
174
|
desc: Where there is light, there is hope
|
|
175
175
|
logo: https://mister-hope.com/logo.svg
|
|
@@ -177,7 +177,7 @@ link: https://mister-hope.com
|
|
|
177
177
|
color: rgba(253, 230, 138, 0.15)
|
|
178
178
|
```
|
|
179
179
|
|
|
180
|
-
- [查看详情](https://theme-hope.vuejs.press/zh/guide/markdown/
|
|
180
|
+
- [查看详情](https://theme-hope.vuejs.press/zh/guide/markdown/component.html)
|
|
181
181
|
|
|
182
182
|
#### 导入文件
|
|
183
183
|
|