create-vuepress-theme-plume 1.0.0-rc.171 → 1.0.0-rc.173

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.
Files changed (2) hide show
  1. package/lib/index.js +20 -3
  2. package/package.json +5 -4
package/lib/index.js CHANGED
@@ -7,13 +7,14 @@ import { kebabCase, sleep } from "@pengzhanbo/utils";
7
7
  import spawn from "nano-spawn";
8
8
  import colors from "picocolors";
9
9
  import fs from "node:fs";
10
+ import _sortPackageJson from "sort-package-json";
10
11
  import { fileURLToPath } from "node:url";
11
12
  import fs$1 from "node:fs/promises";
12
13
  import handlebars from "handlebars";
13
14
  import { osLocale } from "os-locale";
14
15
 
15
16
  //#region package.json
16
- var version = "1.0.0-rc.170";
17
+ var version = "1.0.0-rc.172";
17
18
 
18
19
  //#endregion
19
20
  //#region src/constants.ts
@@ -107,6 +108,22 @@ const getTemplate = (dir) => resolve("templates", dir);
107
108
 
108
109
  //#endregion
109
110
  //#region src/packageJson.ts
111
+ function sortPackageJson(json) {
112
+ return _sortPackageJson(json, { sortOrder: [
113
+ "name",
114
+ "type",
115
+ "version",
116
+ "private",
117
+ "description",
118
+ "packageManager",
119
+ "author",
120
+ "license",
121
+ "scripts",
122
+ "devDependencies",
123
+ "dependencies",
124
+ "pnpm"
125
+ ] });
126
+ }
110
127
  async function createPackageJson(mode, pkg, { packageManager, docsDir, siteName, siteDescription, bundler, injectNpmScripts, useTs }) {
111
128
  if (mode === Mode.create) {
112
129
  pkg.name = kebabCase(siteName);
@@ -116,7 +133,7 @@ async function createPackageJson(mode, pkg, { packageManager, docsDir, siteName,
116
133
  if (packageManager !== "npm") {
117
134
  let version$1 = await getPackageManagerVersion(packageManager);
118
135
  if (version$1) {
119
- if (packageManager === "yarn" && version$1.startsWith("1")) version$1 = "4.6.0";
136
+ if (packageManager === "yarn" && version$1.startsWith("1")) version$1 = "4.10.3";
120
137
  pkg.packageManager = `${packageManager}@${version$1}`;
121
138
  if (packageManager === "pnpm" && version$1.startsWith("10")) pkg.pnpm = { onlyBuiltDependencies: ["@parcel/watcher", "esbuild"] };
122
139
  }
@@ -150,7 +167,7 @@ async function createPackageJson(mode, pkg, { packageManager, docsDir, siteName,
150
167
  for (const dep of deps) pkg.devDependencies[dep] = meta[dep];
151
168
  return {
152
169
  filepath: "package.json",
153
- content: JSON.stringify(pkg, null, 2)
170
+ content: JSON.stringify(sortPackageJson(pkg), null, 2)
154
171
  };
155
172
  }
156
173
  async function getUserInfo() {
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.171",
4
+ "version": "1.0.0-rc.173",
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",
@@ -31,12 +31,13 @@
31
31
  "@pengzhanbo/utils": "^2.1.0",
32
32
  "cac": "^6.7.14",
33
33
  "handlebars": "^4.7.8",
34
- "nano-spawn": "^1.0.3",
34
+ "nano-spawn": "^2.0.0",
35
35
  "os-locale": "^6.0.2",
36
- "picocolors": "^1.1.1"
36
+ "picocolors": "^1.1.1",
37
+ "sort-package-json": "^3.4.0"
37
38
  },
38
39
  "plume-deps": {
39
- "vuepress": "2.0.0-rc.24",
40
+ "vuepress": "2.0.0-rc.26",
40
41
  "vue": "^3.5.22",
41
42
  "http-server": "^14.1.1",
42
43
  "typescript": "^5.9.3"