panteao-ts 1.1.2 → 1.1.5
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/dist/cjs/index.js +17 -1
- package/dist/esm/index.js +17 -1
- package/package.json +1 -1
package/dist/cjs/index.js
CHANGED
|
@@ -151,7 +151,23 @@ class BdiClient extends events_1.EventEmitter {
|
|
|
151
151
|
}
|
|
152
152
|
}
|
|
153
153
|
const args = [this.project, '--port', String(this.port)];
|
|
154
|
-
this.process = child_process.spawn(this.binPath, args, { stdio:
|
|
154
|
+
this.process = child_process.spawn(this.binPath, args, { stdio: ["ignore", "pipe", "pipe"] });
|
|
155
|
+
const formatLog = (data) => {
|
|
156
|
+
const lines = data.toString().trim().split('\n');
|
|
157
|
+
for (const line of lines) {
|
|
158
|
+
if (!line.trim())
|
|
159
|
+
continue;
|
|
160
|
+
const match = line.match(/^\[(.*?)\]\s(.*)/);
|
|
161
|
+
if (match) {
|
|
162
|
+
console.log(`\x1b[36m[${match[1]}]\x1b[0m`, match[2]);
|
|
163
|
+
}
|
|
164
|
+
else {
|
|
165
|
+
console.log('\x1b[36m[MAS]\x1b[0m', line);
|
|
166
|
+
}
|
|
167
|
+
}
|
|
168
|
+
};
|
|
169
|
+
this.process.stdout?.on("data", formatLog);
|
|
170
|
+
this.process.stderr?.on("data", formatLog);
|
|
155
171
|
await new Promise((resolve) => setTimeout(resolve, 800));
|
|
156
172
|
}
|
|
157
173
|
else if (this.port === 0) {
|
package/dist/esm/index.js
CHANGED
|
@@ -115,7 +115,23 @@ export class BdiClient extends EventEmitter {
|
|
|
115
115
|
}
|
|
116
116
|
}
|
|
117
117
|
const args = [this.project, '--port', String(this.port)];
|
|
118
|
-
this.process = child_process.spawn(this.binPath, args, { stdio:
|
|
118
|
+
this.process = child_process.spawn(this.binPath, args, { stdio: ["ignore", "pipe", "pipe"] });
|
|
119
|
+
const formatLog = (data) => {
|
|
120
|
+
const lines = data.toString().trim().split('\n');
|
|
121
|
+
for (const line of lines) {
|
|
122
|
+
if (!line.trim())
|
|
123
|
+
continue;
|
|
124
|
+
const match = line.match(/^\[(.*?)\]\s(.*)/);
|
|
125
|
+
if (match) {
|
|
126
|
+
console.log(`\x1b[36m[${match[1]}]\x1b[0m`, match[2]);
|
|
127
|
+
}
|
|
128
|
+
else {
|
|
129
|
+
console.log('\x1b[36m[MAS]\x1b[0m', line);
|
|
130
|
+
}
|
|
131
|
+
}
|
|
132
|
+
};
|
|
133
|
+
this.process.stdout?.on("data", formatLog);
|
|
134
|
+
this.process.stderr?.on("data", formatLog);
|
|
119
135
|
await new Promise((resolve) => setTimeout(resolve, 800));
|
|
120
136
|
}
|
|
121
137
|
else if (this.port === 0) {
|