@cedarjs/cli 3.0.0-canary.13234 → 3.0.0-canary.13237
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/commands/dev/devHandler.js +30 -1
- package/package.json +11 -11
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import fs from "node:fs";
|
|
2
2
|
import path from "node:path";
|
|
3
|
+
import { Writable } from "node:stream";
|
|
3
4
|
import concurrently from "concurrently";
|
|
4
5
|
import { recordTelemetryAttributes } from "@cedarjs/cli-helpers";
|
|
5
6
|
import { shutdownPort } from "@cedarjs/internal/dist/dev";
|
|
@@ -177,10 +178,38 @@ const handler = async ({
|
|
|
177
178
|
}
|
|
178
179
|
}
|
|
179
180
|
const filteredJobs = jobs.filter((job) => !job.runWhen || job.runWhen());
|
|
181
|
+
class FilterEmptyLinesStream extends Writable {
|
|
182
|
+
buffer = "";
|
|
183
|
+
_write(chunk, _encoding, callback) {
|
|
184
|
+
this.buffer += chunk.toString();
|
|
185
|
+
const lines = this.buffer.split("\n");
|
|
186
|
+
this.buffer = lines.pop() || "";
|
|
187
|
+
for (const line of lines) {
|
|
188
|
+
const strippedLine = line.replace(/\x1B\[[0-9;]*[a-zA-Z]/g, "");
|
|
189
|
+
const isEmptyPrefixLine = /^[^|]+\|\s*$/.test(strippedLine);
|
|
190
|
+
if (!isEmptyPrefixLine) {
|
|
191
|
+
process.stdout.write(line + "\n");
|
|
192
|
+
}
|
|
193
|
+
}
|
|
194
|
+
callback();
|
|
195
|
+
}
|
|
196
|
+
_final(callback) {
|
|
197
|
+
if (this.buffer.length > 0) {
|
|
198
|
+
const strippedLine = this.buffer.replace(/\x1B\[[0-9;]*[a-zA-Z]/g, "");
|
|
199
|
+
const isEmptyPrefixLine = /^[^|]+\|\s*$/.test(strippedLine);
|
|
200
|
+
if (!isEmptyPrefixLine) {
|
|
201
|
+
process.stdout.write(this.buffer);
|
|
202
|
+
}
|
|
203
|
+
}
|
|
204
|
+
callback();
|
|
205
|
+
}
|
|
206
|
+
}
|
|
207
|
+
const outputStream = new FilterEmptyLinesStream();
|
|
180
208
|
const { result } = concurrently(filteredJobs, {
|
|
181
209
|
prefix: "{name} |",
|
|
182
210
|
timestampFormat: "HH:mm:ss",
|
|
183
|
-
handleInput: true
|
|
211
|
+
handleInput: true,
|
|
212
|
+
outputStream
|
|
184
213
|
});
|
|
185
214
|
result.catch((e) => {
|
|
186
215
|
if (e?.message) {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@cedarjs/cli",
|
|
3
|
-
"version": "3.0.0-canary.
|
|
3
|
+
"version": "3.0.0-canary.13237+cc0cb771f",
|
|
4
4
|
"description": "The CedarJS Command Line",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -33,15 +33,15 @@
|
|
|
33
33
|
"dependencies": {
|
|
34
34
|
"@babel/preset-typescript": "7.28.5",
|
|
35
35
|
"@babel/runtime-corejs3": "7.28.4",
|
|
36
|
-
"@cedarjs/api-server": "3.0.0-canary.
|
|
37
|
-
"@cedarjs/cli-helpers": "3.0.0-canary.
|
|
38
|
-
"@cedarjs/fastify-web": "3.0.0-canary.
|
|
39
|
-
"@cedarjs/internal": "3.0.0-canary.
|
|
40
|
-
"@cedarjs/prerender": "3.0.0-canary.
|
|
41
|
-
"@cedarjs/project-config": "3.0.0-canary.
|
|
42
|
-
"@cedarjs/structure": "3.0.0-canary.
|
|
43
|
-
"@cedarjs/telemetry": "3.0.0-canary.
|
|
44
|
-
"@cedarjs/web-server": "3.0.0-canary.
|
|
36
|
+
"@cedarjs/api-server": "3.0.0-canary.13237",
|
|
37
|
+
"@cedarjs/cli-helpers": "3.0.0-canary.13237",
|
|
38
|
+
"@cedarjs/fastify-web": "3.0.0-canary.13237",
|
|
39
|
+
"@cedarjs/internal": "3.0.0-canary.13237",
|
|
40
|
+
"@cedarjs/prerender": "3.0.0-canary.13237",
|
|
41
|
+
"@cedarjs/project-config": "3.0.0-canary.13237",
|
|
42
|
+
"@cedarjs/structure": "3.0.0-canary.13237",
|
|
43
|
+
"@cedarjs/telemetry": "3.0.0-canary.13237",
|
|
44
|
+
"@cedarjs/web-server": "3.0.0-canary.13237",
|
|
45
45
|
"@listr2/prompt-adapter-enquirer": "2.0.16",
|
|
46
46
|
"@opentelemetry/api": "1.8.0",
|
|
47
47
|
"@opentelemetry/core": "1.22.0",
|
|
@@ -103,5 +103,5 @@
|
|
|
103
103
|
"publishConfig": {
|
|
104
104
|
"access": "public"
|
|
105
105
|
},
|
|
106
|
-
"gitHead": "
|
|
106
|
+
"gitHead": "cc0cb771f8804d722a117344599c7249cc229745"
|
|
107
107
|
}
|