create-vuepress-theme-plume 1.0.0-rc.105 → 1.0.0-rc.106

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
@@ -39,17 +39,6 @@ import { execaCommand } from "execa";
39
39
  import path2 from "node:path";
40
40
  import { fileURLToPath } from "node:url";
41
41
 
42
- // src/utils/depsVersion.ts
43
- var api = "https://api.pengzhanbo.cn/npm/dependencies/version";
44
- async function getDependenciesVersion(dependencies, version = "latest") {
45
- const result = await fetch(api, {
46
- method: "POST",
47
- headers: { "content-type": "application/json" },
48
- body: JSON.stringify({ dependencies, version })
49
- }).then((res) => res.json());
50
- return result;
51
- }
52
-
53
42
  // src/utils/fs.ts
54
43
  import fs from "node:fs/promises";
55
44
  import path from "node:path";
@@ -138,22 +127,22 @@ async function createPackageJson(mode, pkg, {
138
127
  }
139
128
  }
140
129
  pkg.devDependencies ??= {};
130
+ const hasDep = (dep) => pkg.devDependencies?.[dep] || pkg.dependencies?.[dep];
141
131
  const context = await readJsonFile(resolve("package.json"));
142
- const meta = context["theme-plume"];
132
+ const meta = context["plume-deps"];
133
+ pkg.devDependencies[`@vuepress/bundler-${bundler}`] = `${meta.vuepress}`;
143
134
  pkg.devDependencies.vuepress = `${meta.vuepress}`;
144
135
  pkg.devDependencies["vuepress-theme-plume"] = `${context.version}`;
145
- pkg.devDependencies[`@vuepress/bundler-${bundler}`] = `${meta.vuepress}`;
146
136
  pkg.devDependencies["http-server"] = "^14.1.1";
147
137
  const deps = [];
148
- if (!pkg.dependencies?.vue && !pkg.devDependencies.vue)
138
+ if (!hasDep("vue"))
149
139
  deps.push("vue");
150
- if (bundler === "webpack" && !pkg.dependencies?.["sass-loader"] && !pkg.devDependencies["sass-loader"])
140
+ if (bundler === "webpack" && !hasDep("sass-loader"))
151
141
  deps.push("sass-loader");
152
- if (!pkg.dependencies?.["sass-embedded"] && !pkg.devDependencies["sass-embedded"])
142
+ if (!hasDep("sass-embedded"))
153
143
  deps.push("sass-embedded");
154
- const dv = await getDependenciesVersion(deps);
155
- for (const [d, v] of Object.entries(dv))
156
- pkg.devDependencies[d] = `^${v}`;
144
+ for (const dep of deps)
145
+ pkg.devDependencies[dep] = meta[dep];
157
146
  return {
158
147
  filepath: "package.json",
159
148
  content: JSON.stringify(pkg, null, 2)
@@ -549,5 +538,5 @@ var cli = cac("create-vuepress-theme-plume");
549
538
  cli.command("[root]", "create a new vuepress-theme-plume project / \u521B\u5EFA\u65B0\u7684 vuepress-theme-plume \u9879\u76EE").action((root) => run(1 /* create */, root));
550
539
  cli.command("init [root]", "Initial vuepress-theme-plume in the existing project / \u5728\u73B0\u6709\u9879\u76EE\u4E2D\u521D\u59CB\u5316 vuepress-theme-plume").action((root) => run(0 /* init */, root));
551
540
  cli.help();
552
- cli.version("1.0.0-rc.104");
541
+ cli.version("1.0.0-rc.105");
553
542
  cli.parse();
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "create-vuepress-theme-plume",
3
3
  "type": "module",
4
- "version": "1.0.0-rc.105",
4
+ "version": "1.0.0-rc.106",
5
5
  "description": "The cli for create vuepress-theme-plume's project",
6
6
  "author": "pengzhanbo <q942450674@outlook.com> (https://github.com/pengzhanbo/)",
7
7
  "license": "MIT",
@@ -34,8 +34,11 @@
34
34
  "handlebars": "^4.7.8",
35
35
  "picocolors": "^1.1.0"
36
36
  },
37
- "theme-plume": {
38
- "vuepress": "2.0.0-rc.15"
37
+ "plume-deps": {
38
+ "vuepress": "2.0.0-rc.17",
39
+ "vue": "^3.5.10",
40
+ "sass-embedded": "^1.79.4",
41
+ "sass-loader": "^16.0.2"
39
42
  },
40
43
  "scripts": {
41
44
  "build": "tsup"
@@ -1,5 +1,5 @@
1
- import { defineUserConfig } from 'vuepress'
2
1
  import { {{ bundler }}Bundler } from '@vuepress/bundler-{{ bundler }}'
2
+ import { defineUserConfig } from 'vuepress'
3
3
  import { plumeTheme } from 'vuepress-theme-plume'
4
4
 
5
5
  export default defineUserConfig({
@@ -32,7 +32,7 @@ export default defineUserConfig({
32
32
  * @see https://theme-plume.vuejs.press/config/plugins/code-highlight/
33
33
  */
34
34
  // shiki: {
35
- // // 强烈建议预设代码块高亮语言,插件默认加载所有语言会产生不必要的时间开销
35
+ // 强烈建议预设代码块高亮语言,插件默认加载所有语言会产生不必要的时间开销
36
36
  // languages: ['shell', 'bash', 'typescript', 'javascript'],
37
37
  // },
38
38
 
@@ -50,8 +50,8 @@ npm run docs:preview
50
50
  npm run vp-update
51
51
  ```
52
52
  {{/if}}
53
- {{#if (equal deploy "github")}}
54
53
 
54
+ {{#if (equal deploy "github")}}
55
55
  ## Deploy to GitHub Pages
56
56
 
57
57
  The plume theme has been created with GitHub Actions: `.github/workflows/docs-deploy.yml`. You also need to make the following settings in the GitHub repository:
@@ -50,8 +50,8 @@ npm run docs:preview
50
50
  npm run vp-update
51
51
  ```
52
52
  {{/if}}
53
- {{#if (equal deploy "github")}}
54
53
 
54
+ {{#if (equal deploy "github")}}
55
55
  ## 部署到 GitHub Pages
56
56
 
57
57
  主题已创建 github actions: `.github/workflows/docs-deploy.yml`,你还需要在 github 仓库中进行以下设置: