Skip to content

Commit 8297d91

Browse files
committed
chore: 修复部分问题
1 parent 77b651c commit 8297d91

5 files changed

Lines changed: 57 additions & 5 deletions

File tree

packages/create-fes-app/.local

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
Used in bin/create-fes-app.js to determine if it is in the local debug state.
1+
Used in bin/create-fes-app.mjs to determine if it is in the local debug state.

packages/create-fes-app/package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@
4040
"fs-extra": "^11.3.1",
4141
"glob": "^11.0.3",
4242
"mustache": "^4.2.0",
43+
"ora": "^8.2.0",
4344
"semver": "^7.7.2",
4445
"validate-npm-package-name": "^6.0.2"
4546
},

packages/create-fes-app/src/main.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ import { join, relative, resolve } from 'node:path';
22
import process from 'node:process';
33
import { defineCommand } from 'citty';
44
import consola from 'consola';
5+
import ora from 'ora';
56

67
import validate from 'validate-npm-package-name';
78
import pkg from '../package.json' assert { type: 'json' };
@@ -80,14 +81,15 @@ export const main = defineCommand({
8081

8182
const targetDir = resolve(cwd, projectName || '.');
8283
if (template === 'pc' || template === 'h5') {
84+
const spinner = ora('项目生成中加载中...').start();
8385
copyDirectory({
8486
context: {
8587
version: pkg.version,
8688
},
8789
path: join(__dirname, `../templates/app/${template}`),
8890
target: targetDir,
8991
});
90-
consola.success(`Project ${projectName} created successfully!`);
92+
spinner.succeed('项目创建成功');
9193
consola.box([
9294
`cd ${projectName}`,
9395
'pnpm i',

packages/create-fes-app/src/utils/gen.ts

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
import { readFileSync, statSync } from 'node:fs';
22
import { join, relative } from 'node:path';
3-
import consola from 'consola';
43
import { copySync, outputFileSync } from 'fs-extra/esm';
54
import { globSync } from 'glob';
65
import Mustache from 'mustache';
@@ -15,7 +14,6 @@ function copyTpl(opts: {
1514
const tpl = readFileSync(opts.templatePath, 'utf-8');
1615
const content = Mustache.render(tpl, opts.context);
1716

18-
consola.success(`Write: ${relative(getWorkPath(), opts.target)}`);
1917
outputFileSync(opts.target, content, 'utf-8');
2018
}
2119

@@ -42,7 +40,6 @@ export function copyDirectory(opts: {
4240
});
4341
}
4442

45-
consola.success(`Copy: ${file}`);
4643
const absTarget = join(opts.target, file);
4744
copySync(absFile, absTarget);
4845
});

pnpm-lock.yaml

Lines changed: 52 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)