@blocklet/component-studio-cli 0.4.152 → 0.4.153

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.
@@ -58,15 +58,16 @@ async function createDevServer(projectPath, _options) {
58
58
  let shouldInstallProjectDeps = await checkShouldInstallDependencies(projectPath);
59
59
  // 5. 安装依赖
60
60
  if (shouldInstallWorkspaceDeps || shouldInstallProjectDeps) {
61
+ const installDeps = {};
61
62
  if (shouldInstallProjectDeps) {
62
- await installDependencies({
63
- Project: projectPath,
64
- });
63
+ installDeps.Project = projectPath;
65
64
  }
66
65
  if (shouldInstallWorkspaceDeps) {
67
- await installDependencies({
68
- Workspace: workspacePath,
69
- });
66
+ installDeps.Workspace = workspacePath;
67
+ }
68
+ const result = await installDependencies(installDeps);
69
+ if (!result) {
70
+ process.exit(1);
70
71
  }
71
72
  }
72
73
  const devServerSpinner = ora({ text: 'Creating development server...', color: 'blue' }).start();
@@ -107,7 +107,7 @@ export async function installDependencies(dirs, operation = 'install') {
107
107
  let errorOutput = '';
108
108
  const process = spawn('pnpm', ['update:deps'], {
109
109
  cwd: dirPath,
110
- stdio: ['inherit', 'pipe', 'pipe'], // 将 stdout 和 stderr 设为 pipe
110
+ stdio: 'inherit',
111
111
  });
112
112
  // 收集错误输出
113
113
  process.stderr?.on('data', (data) => {
@@ -125,7 +125,7 @@ export async function installDependencies(dirs, operation = 'install') {
125
125
  resolve();
126
126
  }
127
127
  else {
128
- reject(new Error(`${dirType} dependencies install failed with code ${code}.\nError details:\n${errorOutput?.trimStart()}`));
128
+ reject(new Error(`${dirType} dependencies install failed with code ${code}. ${errorOutput ? `\nError details:\n${errorOutput?.trimStart()}` : ''}}`));
129
129
  }
130
130
  });
131
131
  process.on('error', (error) => {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@blocklet/component-studio-cli",
3
- "version": "0.4.152",
3
+ "version": "0.4.153",
4
4
  "description": "CLI for Component Studio",
5
5
  "publishConfig": {
6
6
  "access": "public"