create-vuepress-theme-plume 1.0.0-rc.106 → 1.0.0-rc.107
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 +18 -8
- package/package.json +4 -2
package/lib/index.js
CHANGED
|
@@ -93,7 +93,8 @@ async function createPackageJson(mode, pkg, {
|
|
|
93
93
|
siteName,
|
|
94
94
|
siteDescription,
|
|
95
95
|
bundler,
|
|
96
|
-
injectNpmScripts
|
|
96
|
+
injectNpmScripts,
|
|
97
|
+
useTs
|
|
97
98
|
}) {
|
|
98
99
|
if (mode === 1 /* create */) {
|
|
99
100
|
pkg.name = kebabCase(siteName);
|
|
@@ -101,8 +102,10 @@ async function createPackageJson(mode, pkg, {
|
|
|
101
102
|
pkg.version = "1.0.0";
|
|
102
103
|
pkg.description = siteDescription;
|
|
103
104
|
if (packageManager !== "npm") {
|
|
104
|
-
|
|
105
|
+
let version = await getPackageManagerVersion(packageManager);
|
|
105
106
|
if (version) {
|
|
107
|
+
if (packageManager === "yarn" && version.startsWith("1"))
|
|
108
|
+
version = "4.5.0";
|
|
106
109
|
pkg.packageManager = `${packageManager}@${version}`;
|
|
107
110
|
}
|
|
108
111
|
}
|
|
@@ -133,14 +136,15 @@ async function createPackageJson(mode, pkg, {
|
|
|
133
136
|
pkg.devDependencies[`@vuepress/bundler-${bundler}`] = `${meta.vuepress}`;
|
|
134
137
|
pkg.devDependencies.vuepress = `${meta.vuepress}`;
|
|
135
138
|
pkg.devDependencies["vuepress-theme-plume"] = `${context.version}`;
|
|
136
|
-
|
|
137
|
-
const deps = [];
|
|
139
|
+
const deps = ["http-server"];
|
|
138
140
|
if (!hasDep("vue"))
|
|
139
141
|
deps.push("vue");
|
|
140
142
|
if (bundler === "webpack" && !hasDep("sass-loader"))
|
|
141
143
|
deps.push("sass-loader");
|
|
142
144
|
if (!hasDep("sass-embedded"))
|
|
143
145
|
deps.push("sass-embedded");
|
|
146
|
+
if (useTs)
|
|
147
|
+
deps.push("typescript");
|
|
144
148
|
for (const dep of deps)
|
|
145
149
|
pkg.devDependencies[dep] = meta[dep];
|
|
146
150
|
return {
|
|
@@ -254,6 +258,12 @@ ${docs}/.vuepress/dist
|
|
|
254
258
|
fileList.push(...gitFiles);
|
|
255
259
|
}
|
|
256
260
|
}
|
|
261
|
+
if (data.packageManager === "yarn") {
|
|
262
|
+
fileList.push({
|
|
263
|
+
filepath: ".yarnrc.yml",
|
|
264
|
+
content: "nodeLinker: 'node-modules'\n"
|
|
265
|
+
});
|
|
266
|
+
}
|
|
257
267
|
if (data.deploy !== "custom" /* custom */) {
|
|
258
268
|
fileList.push(...await readFiles(getTemplate(`deploy/${data.deploy}`)));
|
|
259
269
|
}
|
|
@@ -507,7 +517,7 @@ async function run(mode, root) {
|
|
|
507
517
|
if (data.install) {
|
|
508
518
|
progress.message(t("spinner.install"));
|
|
509
519
|
try {
|
|
510
|
-
await execaCommand3(
|
|
520
|
+
await execaCommand3(`${pm} install`, { cwd });
|
|
511
521
|
} catch (e) {
|
|
512
522
|
console.error(`${colors.red("install dependencies error: ")}
|
|
513
523
|
`, e);
|
|
@@ -515,8 +525,8 @@ async function run(mode, root) {
|
|
|
515
525
|
}
|
|
516
526
|
}
|
|
517
527
|
const cdCommand = mode === 1 /* create */ ? colors.green(`cd ${data.root}`) : "";
|
|
518
|
-
const runCommand = colors.green(
|
|
519
|
-
const installCommand = colors.green(
|
|
528
|
+
const runCommand = colors.green(`${pm} run docs:dev`);
|
|
529
|
+
const installCommand = colors.green(`${pm} install`);
|
|
520
530
|
progress.stop(t("spinner.stop"));
|
|
521
531
|
if (mode === 1 /* create */) {
|
|
522
532
|
outro(`${t("spinner.command")}
|
|
@@ -538,5 +548,5 @@ var cli = cac("create-vuepress-theme-plume");
|
|
|
538
548
|
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));
|
|
539
549
|
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));
|
|
540
550
|
cli.help();
|
|
541
|
-
cli.version("1.0.0-rc.
|
|
551
|
+
cli.version("1.0.0-rc.106");
|
|
542
552
|
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.
|
|
4
|
+
"version": "1.0.0-rc.107",
|
|
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",
|
|
@@ -38,7 +38,9 @@
|
|
|
38
38
|
"vuepress": "2.0.0-rc.17",
|
|
39
39
|
"vue": "^3.5.10",
|
|
40
40
|
"sass-embedded": "^1.79.4",
|
|
41
|
-
"sass-loader": "^16.0.2"
|
|
41
|
+
"sass-loader": "^16.0.2",
|
|
42
|
+
"http-server": "^14.1.1",
|
|
43
|
+
"typescript": "^5.6.2"
|
|
42
44
|
},
|
|
43
45
|
"scripts": {
|
|
44
46
|
"build": "tsup"
|