add public fix and pnpm init asst

This commit is contained in:
2025-05-19 22:13:02 +08:00
parent a05f2cd291
commit 5cc1e33b29
9 changed files with 175 additions and 9 deletions

View File

@@ -72,6 +72,58 @@ export class AssistantInit extends AssistantConfig {
console.log(chalk.green('助手配置文件assistant-config.json创建成功'));
}
}
initPnpm() {
const pnpmPath = path.join(this.configDir, 'assistant-app', 'pnpm.yaml');
let create = false;
if (!checkFileExists(pnpmPath, true)) {
create = true;
fs.writeFileSync(
pnpmPath,
`packages:
- 'apps/**/*'
- 'pages/**/*'
`,
);
console.log(chalk.green('助手 pnpm.yaml 文件创建成功'));
}
const packagePath = path.join(this.configDir, 'assistant-app', 'package.json');
if (!checkFileExists(packagePath, true)) {
create = true;
fs.writeFileSync(
packagePath,
`{
"name": "assistant-app",
"version": "1.0.0",
"description": "assistant-app package pnpm, node pkgs projects",
"type": "module",
"scripts": {
"start": "pm2 start apps/code-center/dist/app.mjs --name code-center",
"proxy": "pm2 start apps/page-proxy/dist/app.mjs --name page-proxy"
},
"keywords": [],
"author": "",
"license": "ISC",
"dependencies": {
"@kevisual/router": "^0.0.20",
"@kevisual/use-config": "^1.0.17",
"ioredis": "^5.6.1",
"minio": "^8.0.5",
"pg": "^8.16.0",
"pm2": "^6.0.6",
"sequelize": "^6.37.7",
"sqlite3": "^5.1.7",
"socket.io": "^4.8.1",
"dotenv": "^16.5.0"
}
}
`,
);
console.log(chalk.green('助手 package.json 文件创建成功'));
}
return {
create,
};
}
protected getDefaultInitAssistantConfig() {
return {
description: '助手配置文件',

View File

@@ -0,0 +1,25 @@
{
"name": "assistant-app",
"version": "1.0.0",
"description": "assistant-app package pnpm, node pkgs projects",
"type": "module",
"scripts": {
"start": "pm2 start apps/code-center/dist/app.mjs --name code-center",
"proxy": "pm2 start apps/page-proxy/dist/app.mjs --name page-proxy"
},
"keywords": [],
"author": "",
"license": "ISC",
"dependencies": {
"@kevisual/router": "^0.0.20",
"@kevisual/use-config": "^1.0.17",
"ioredis": "^5.6.1",
"minio": "^8.0.5",
"pg": "^8.16.0",
"pm2": "^6.0.6",
"sequelize": "^6.37.7",
"sqlite3": "^5.1.7",
"socket.io": "^4.8.1",
"dotenv": "^16.5.0"
}
}