@blocklet/component-studio-cli 0.4.154 → 0.4.156

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.
@@ -75,6 +75,10 @@ async function createDevServer(projectPath, _options) {
75
75
  cwd: workspacePath,
76
76
  stdio: 'inherit',
77
77
  detached: false,
78
+ env: {
79
+ ...process.env,
80
+ NODE_ENV: 'development',
81
+ },
78
82
  });
79
83
  // 确保子进程能正确接收和处理信号
80
84
  process.on('SIGINT', () => {
@@ -105,22 +105,26 @@ export async function installDependencies(dirs, operation = 'install') {
105
105
  const installPromises = Object.entries(dirs).map(([dirType, dirPath]) => {
106
106
  return new Promise((resolve, reject) => {
107
107
  let errorOutput = '';
108
- const process = spawn('pnpm', ['update:deps'], {
108
+ const depProcess = spawn('pnpm', ['update:deps'], {
109
109
  cwd: dirPath,
110
- stdio: 'inherit',
110
+ stdio: ['inherit', 'pipe', 'pipe'], // 将 stdout 和 stderr 设为 pipe
111
+ env: {
112
+ ...process.env,
113
+ NODE_ENV: 'development',
114
+ },
111
115
  });
112
116
  // 收集错误输出
113
- process.stderr?.on('data', (data) => {
117
+ depProcess.stderr?.on('data', (data) => {
114
118
  errorOutput += data.toString();
115
119
  });
116
120
  // 收集标准输出(可能包含错误信息)
117
- process.stdout?.on('data', (data) => {
121
+ depProcess.stdout?.on('data', (data) => {
118
122
  const output = data.toString();
119
123
  if (output.toLowerCase().includes('error')) {
120
124
  errorOutput += output;
121
125
  }
122
126
  });
123
- process.on('close', (code) => {
127
+ depProcess.on('close', (code) => {
124
128
  if (code === 0) {
125
129
  resolve();
126
130
  }
@@ -128,7 +132,7 @@ export async function installDependencies(dirs, operation = 'install') {
128
132
  reject(new Error(`${dirType} dependencies install failed with code ${code}. ${errorOutput ? `\nError details:\n${errorOutput?.trimStart()}` : ''}}`));
129
133
  }
130
134
  });
131
- process.on('error', (error) => {
135
+ depProcess.on('error', (error) => {
132
136
  reject(new Error(`${dirType} process error: ${error.message}\n${errorOutput}`));
133
137
  });
134
138
  });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@blocklet/component-studio-cli",
3
- "version": "0.4.154",
3
+ "version": "0.4.156",
4
4
  "description": "CLI for Component Studio",
5
5
  "publishConfig": {
6
6
  "access": "public"
@@ -16,7 +16,7 @@
16
16
  "lint:skip": "echo 'skip lint'",
17
17
  "lint:fix": "biome check --apply .",
18
18
  "format": "biome format --write .",
19
- "prepare": "simple-git-hooks",
19
+ "prepare": "npx -y simple-git-hooks",
20
20
  "bump-version": "zx --quiet scripts/bump-version.mjs",
21
21
  "update:deps": "npx -y taze -r -n '/arcblock|ocap|abtnode|blocklet|did-connect|did-comment|nedb/' -w -f && pnpm install && pnpm run deduplicate",
22
22
  "deduplicate": "pnpm dedupe"
@@ -23,7 +23,7 @@
23
23
  "clean": "node scripts/build-clean.mjs",
24
24
  "bundle": "echo 'skip bundle'",
25
25
  "bundle:client": "vite build",
26
- "prepare": "simple-git-hooks",
26
+ "prepare": "npx -y simple-git-hooks",
27
27
  "bump-version": "zx --quiet scripts/bump-version.mjs",
28
28
  "dev-front": "vite serve .",
29
29
  "build-lib": "node -r dotenv-flow/config -e \"require('@blocklet/pages-kit-block-studio/build-lib')\"",
@@ -1 +0,0 @@
1
- NODE_ENV="development"