@fastcar/cli 0.1.2 → 0.1.4
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/bin/cli.js +239 -226
- package/package.json +1 -1
- package/skills/AGENTS.md +251 -0
- package/skills/fastcar-database/SKILL.md +436 -337
- package/skills/fastcar-framework/SKILL.md +577 -856
- package/skills/fastcar-rpc-microservices/SKILL.md +19 -69
- package/skills/fastcar-serverless/SKILL.md +48 -48
- package/skills/fastcar-toolkit/SKILL.md +22 -31
- package/skills/typescript-coding-style/SKILL.md +144 -0
- package/src/init.js +708 -700
- package/src/pack.js +7 -7
- package/src/skill.js +493 -364
- package/src/update.js +301 -0
- package/src/utils.js +2 -2
package/src/pack.js
CHANGED
|
@@ -101,8 +101,8 @@ async function packProject(projectPath, outputPath, packageManager) {
|
|
|
101
101
|
const version = packageJson.version || "0.0.0";
|
|
102
102
|
const folderName = path.basename(cwd);
|
|
103
103
|
const defaultOutputDir = outputPath || path.join(cwd, "dist");
|
|
104
|
-
const
|
|
105
|
-
const
|
|
104
|
+
const tgzFileName = `${projectName}-${version}.tgz`;
|
|
105
|
+
const tgzFilePath = path.join(defaultOutputDir, tgzFileName);
|
|
106
106
|
|
|
107
107
|
// 创建临时目录,使用项目文件夹名作为根目录名
|
|
108
108
|
const tempDir = path.join(cwd, `.pack-temp-${Date.now()}`);
|
|
@@ -143,17 +143,17 @@ async function packProject(projectPath, outputPath, packageManager) {
|
|
|
143
143
|
|
|
144
144
|
// 打包
|
|
145
145
|
console.log("📦 正在生成压缩包...");
|
|
146
|
-
if (fs.existsSync(
|
|
147
|
-
fs.rmSync(
|
|
146
|
+
if (fs.existsSync(tgzFilePath)) {
|
|
147
|
+
fs.rmSync(tgzFilePath);
|
|
148
148
|
}
|
|
149
|
-
await utils.zipFile(rootDir,
|
|
149
|
+
await utils.zipFile(rootDir, tgzFilePath);
|
|
150
150
|
|
|
151
151
|
console.log("✅ 打包完成!");
|
|
152
|
-
console.log(` 输出文件: ${
|
|
152
|
+
console.log(` 输出文件: ${tgzFilePath}`);
|
|
153
153
|
console.log(` 解压目录: ${folderName}/`);
|
|
154
154
|
|
|
155
155
|
// 计算文件大小
|
|
156
|
-
const stats = fs.statSync(
|
|
156
|
+
const stats = fs.statSync(tgzFilePath);
|
|
157
157
|
const sizeMB = (stats.size / 1024 / 1024).toFixed(2);
|
|
158
158
|
console.log(` 文件大小: ${sizeMB} MB`);
|
|
159
159
|
} catch (error) {
|