@sugarat/create-theme 0.0.16 → 0.0.18
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/dist/index.js +3 -3
- package/dist/index.js.map +1 -1
- package/dist/template/docs/.vitepress/blog-theme.ts +18 -5
- package/dist/template/docs/.vitepress/config.mts +0 -6
- package/dist/template/docs/.vitepress/theme/index.ts +2 -0
- package/dist/template/package.json +5 -5
- package/package.json +13 -13
package/dist/index.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
var y=Object.create;var
|
|
2
|
+
var y=Object.create;var g=Object.defineProperty;var _=Object.getOwnPropertyDescriptor;var d=Object.getOwnPropertyNames;var h=Object.getPrototypeOf,v=Object.prototype.hasOwnProperty;var w=(o,n,e,m)=>{if(n&&typeof n=="object"||typeof n=="function")for(let r of d(n))!v.call(o,r)&&r!==e&&g(o,r,{get:()=>n[r],enumerable:!(m=_(n,r))||m.enumerable});return o};var a=(o,n,e)=>(e=o!=null?y(h(o)):{},w(n||!o||!o.__esModule?g(e,"default",{value:o,enumerable:!0}):e,o));var j=(o,n,e)=>new Promise((m,r)=>{var f=l=>{try{s(e.next(l))}catch(t){r(t)}},u=l=>{try{s(e.throw(l))}catch(t){r(t)}},s=l=>l.done?m(l.value):Promise.resolve(l.value).then(f,u);s((e=e.apply(o,n)).next())});var c=a(require("path")),i=a(require("process")),p=a(require("fs-extra"));function b(o){let n=c.default.join(__dirname,"template");p.default.copy(n,o,e=>j(this,null,function*(){if(yield p.default.copy(c.default.join(__dirname,"move/gitignore"),c.default.join(o,".gitignore")),yield p.default.copy(c.default.join(__dirname,"move/npmrc"),c.default.join(o,".npmrc")),e)console.error("An error occurred while copying template files:",e);else{console.log("\u{1F389} \u{1F389} created successfully!"),console.log(),console.log(`project in ${o}`),console.log();let m=`Done. Now run:
|
|
3
3
|
|
|
4
|
-
\u2460 cd ${
|
|
4
|
+
\u2460 cd ${c.default.parse(o).name}
|
|
5
5
|
\u2461 pnpm install
|
|
6
|
-
\u2462 pnpm run dev`;console.log(
|
|
6
|
+
\u2462 pnpm run dev`;console.log(m)}}))}console.log("Creating @sugarat/theme project...");console.log();var N=i.default.argv[2]||"my-blog";b(c.default.join(i.default.cwd(),N));
|
|
7
7
|
//# sourceMappingURL=index.js.map
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/index.ts"],"sourcesContent":["#!/usr/bin/env node\n\nimport
|
|
1
|
+
{"version":3,"sources":["../src/index.ts"],"sourcesContent":["#!/usr/bin/env node\n\nimport path from 'node:path'\nimport process from 'process'\nimport fs from 'fs-extra'\n\nfunction createThemeProject(destination) {\n const templatePath = path.join(__dirname, 'template')\n\n fs.copy(templatePath, destination, async (err) => {\n // 同步创建.gitignore文件和.npmrc文件\n await fs.copy(\n path.join(__dirname, 'move/gitignore'),\n path.join(destination, '.gitignore')\n )\n await fs.copy(\n path.join(__dirname, 'move/npmrc'),\n path.join(destination, '.npmrc')\n )\n if (err) {\n console.error('An error occurred while copying template files:', err)\n }\n else {\n console.log('🎉 🎉 created successfully!')\n console.log()\n\n console.log(`project in ${destination}`)\n\n console.log()\n\n const msg = `Done. Now run:\n\n ① cd ${path.parse(destination).name}\n ② pnpm install\n ③ pnpm run dev`\n\n console.log(msg)\n }\n })\n}\n\nconsole.log('Creating @sugarat/theme project...')\nconsole.log()\n\nconst projectName = process.argv[2] || 'my-blog'\ncreateThemeProject(path.join(process.cwd(), projectName))\n"],"mappings":";wpBAEA,IAAAA,EAAiB,mBACjBC,EAAoB,sBACpBC,EAAe,uBAEf,SAASC,EAAmBC,EAAa,CACvC,IAAMC,EAAe,EAAAC,QAAK,KAAK,UAAW,UAAU,EAEpD,EAAAC,QAAG,KAAKF,EAAcD,EAAoBI,GAAQC,EAAA,sBAUhD,GARA,MAAM,EAAAF,QAAG,KACP,EAAAD,QAAK,KAAK,UAAW,gBAAgB,EACrC,EAAAA,QAAK,KAAKF,EAAa,YAAY,CACrC,EACA,MAAM,EAAAG,QAAG,KACP,EAAAD,QAAK,KAAK,UAAW,YAAY,EACjC,EAAAA,QAAK,KAAKF,EAAa,QAAQ,CACjC,EACII,EACF,QAAQ,MAAM,kDAAmDA,CAAG,MAEjE,CACH,QAAQ,IAAI,2CAA6B,EACzC,QAAQ,IAAI,EAEZ,QAAQ,IAAI,cAAcJ,GAAa,EAEvC,QAAQ,IAAI,EAEZ,IAAMM,EAAM;AAAA;AAAA,eAER,EAAAJ,QAAK,MAAMF,CAAW,EAAE;AAAA;AAAA,wBAI5B,QAAQ,IAAIM,CAAG,CACjB,CACF,EAAC,CACH,CAEA,QAAQ,IAAI,oCAAoC,EAChD,QAAQ,IAAI,EAEZ,IAAMC,EAAc,EAAAC,QAAQ,KAAK,IAAM,UACvCT,EAAmB,EAAAG,QAAK,KAAK,EAAAM,QAAQ,IAAI,EAAGD,CAAW,CAAC","names":["import_node_path","import_process","import_fs_extra","createThemeProject","destination","templatePath","path","fs","err","__async","msg","projectName","process"]}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
// 主题独有配置
|
|
2
|
-
import { getThemeConfig } from '@sugarat/theme/node'
|
|
2
|
+
import { getThemeConfig } from '@sugarat/theme/node'
|
|
3
3
|
|
|
4
4
|
// 开启RSS支持(RSS配置)
|
|
5
5
|
// import type { Theme } from '@sugarat/theme'
|
|
@@ -15,16 +15,29 @@ import { getThemeConfig } from '@sugarat/theme/node';
|
|
|
15
15
|
// favicon: 'https://sugarat.top/favicon.ico',
|
|
16
16
|
// }
|
|
17
17
|
|
|
18
|
-
|
|
19
18
|
// 所有配置项,详见文档: https://theme.sugarat.top/
|
|
20
19
|
const blogTheme = getThemeConfig({
|
|
21
20
|
// 开启RSS支持
|
|
22
21
|
// RSS,
|
|
23
|
-
|
|
22
|
+
|
|
23
|
+
// 搜索
|
|
24
24
|
// 默认开启pagefind离线的全文搜索支持(如使用其它的可以设置为false)
|
|
25
25
|
// 如果npx pagefind 时间过长,可以手动将其安装为项目依赖 pnpm add pagefind
|
|
26
26
|
// search: false,
|
|
27
27
|
|
|
28
|
+
// 页脚
|
|
29
|
+
footer: {
|
|
30
|
+
// message: '下面 的内容和图标都是可以修改的噢(当然本条内容也是可以隐藏的)',
|
|
31
|
+
copyright: 'MIT License | 粥里有勺糖',
|
|
32
|
+
// icpRecord: {
|
|
33
|
+
// name: '蜀ICP备19011724号',
|
|
34
|
+
// link: 'https://beian.miit.gov.cn/'
|
|
35
|
+
// },
|
|
36
|
+
// securityRecord: {
|
|
37
|
+
// name: '公网安备xxxxx',
|
|
38
|
+
// link: 'https://www.beian.gov.cn/portal/index.do'
|
|
39
|
+
// },
|
|
40
|
+
},
|
|
28
41
|
// 主题色修改
|
|
29
42
|
themeColor: 'el-blue',
|
|
30
43
|
|
|
@@ -80,6 +93,6 @@ const blogTheme = getThemeConfig({
|
|
|
80
93
|
],
|
|
81
94
|
duration: 0,
|
|
82
95
|
},
|
|
83
|
-
})
|
|
96
|
+
})
|
|
84
97
|
|
|
85
|
-
export { blogTheme }
|
|
98
|
+
export { blogTheme }
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import { defineConfig } from '@sugarat/theme/node'
|
|
2
2
|
import { blogTheme } from './blog-theme'
|
|
3
3
|
|
|
4
|
-
|
|
5
4
|
// Vitepress 默认配置
|
|
6
5
|
// 详见文档:https://vitepress.dev/reference/site-config
|
|
7
6
|
export default defineConfig({
|
|
@@ -19,11 +18,6 @@ export default defineConfig({
|
|
|
19
18
|
lastUpdated: true,
|
|
20
19
|
themeConfig: {
|
|
21
20
|
lastUpdatedText: '上次更新于',
|
|
22
|
-
footer: {
|
|
23
|
-
message: '自定义底部内容',
|
|
24
|
-
copyright:
|
|
25
|
-
'MIT Licensed | <a target="_blank" href="https://theme.sugarat.top/"> @sugarat/theme </a>'
|
|
26
|
-
},
|
|
27
21
|
logo: '/logo.png',
|
|
28
22
|
// editLink: {
|
|
29
23
|
// pattern:
|
|
@@ -2,6 +2,8 @@
|
|
|
2
2
|
"name": "vitepress-blog",
|
|
3
3
|
"version": "1.0.0",
|
|
4
4
|
"private": true,
|
|
5
|
+
"author": "粥里有勺糖",
|
|
6
|
+
"license": "MIT",
|
|
5
7
|
"scripts": {
|
|
6
8
|
"dev": "vitepress dev docs",
|
|
7
9
|
"build": "vitepress build docs",
|
|
@@ -9,7 +11,7 @@
|
|
|
9
11
|
},
|
|
10
12
|
"dependencies": {
|
|
11
13
|
"@element-plus/icons-vue": "^2.1.0",
|
|
12
|
-
"@sugarat/theme": "^0.1
|
|
14
|
+
"@sugarat/theme": "^0.2.1",
|
|
13
15
|
"element-plus": "^2.3.8",
|
|
14
16
|
"vue": "^3.3.4"
|
|
15
17
|
},
|
|
@@ -19,8 +21,6 @@
|
|
|
19
21
|
"devDependencies": {
|
|
20
22
|
"sass": "^1.64.1",
|
|
21
23
|
"typescript": "^5.1.6",
|
|
22
|
-
"vitepress": "1.0.0-rc.
|
|
23
|
-
}
|
|
24
|
-
"author": "粥里有勺糖",
|
|
25
|
-
"license": "MIT"
|
|
24
|
+
"vitepress": "1.0.0-rc.17"
|
|
25
|
+
}
|
|
26
26
|
}
|
package/package.json
CHANGED
|
@@ -1,33 +1,33 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@sugarat/create-theme",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.18",
|
|
4
4
|
"description": "简约风的 Vitepress 博客主题,sugarat vitepress blog theme",
|
|
5
|
-
"
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
"files": [
|
|
9
|
-
"dist"
|
|
10
|
-
],
|
|
5
|
+
"author": "粥里有勺糖",
|
|
6
|
+
"license": "MIT",
|
|
7
|
+
"homepage": "https://github.com/ATQQ/sugar-blog/tree/master/packages/create-theme",
|
|
11
8
|
"repository": {
|
|
12
9
|
"type": "git",
|
|
13
10
|
"url": "git+https://github.com/ATQQ/sugar-blog.git"
|
|
14
11
|
},
|
|
15
|
-
"homepage": "https://github.com/ATQQ/sugar-blog/tree/master/packages/create-theme",
|
|
16
12
|
"keywords": [
|
|
17
13
|
"blog",
|
|
18
14
|
"vitepress",
|
|
19
15
|
"vitepress-blog",
|
|
20
16
|
"vitepress-theme"
|
|
21
17
|
],
|
|
22
|
-
"
|
|
23
|
-
|
|
24
|
-
"devDependencies": {
|
|
25
|
-
"rimraf": "^5.0.1",
|
|
26
|
-
"tsup": " ^6.5.0"
|
|
18
|
+
"bin": {
|
|
19
|
+
"create-theme": "./dist/index.js"
|
|
27
20
|
},
|
|
21
|
+
"files": [
|
|
22
|
+
"dist"
|
|
23
|
+
],
|
|
28
24
|
"dependencies": {
|
|
29
25
|
"fs-extra": "^11.1.1"
|
|
30
26
|
},
|
|
27
|
+
"devDependencies": {
|
|
28
|
+
"rimraf": "^5.0.1",
|
|
29
|
+
"tsup": " ^6.5.0"
|
|
30
|
+
},
|
|
31
31
|
"scripts": {
|
|
32
32
|
"dev": "tsup --watch --publicDir",
|
|
33
33
|
"build": "rimraf dist && tsup --minify --publicDir"
|