@datashow/super-visual-cli 0.1.0-rc.2 → 0.1.0-rc.3
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/package.json +5 -5
- package/src/main.mjs +17 -13
- package/src/project.mjs +2 -0
- package/templates/blank/package.json +1 -1
- package/templates/hello-world/package.json +1 -1
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@datashow/super-visual-cli",
|
|
3
|
-
"version": "0.1.0-rc.
|
|
3
|
+
"version": "0.1.0-rc.3",
|
|
4
4
|
"description": "CLI for validating, compiling, packaging, verifying, and deploying Super Visual projects.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"bin": {
|
|
@@ -25,10 +25,10 @@
|
|
|
25
25
|
"access": "public"
|
|
26
26
|
},
|
|
27
27
|
"dependencies": {
|
|
28
|
-
"@datashow/super-visual-adapter-claude-dashboard": "0.1.0-rc.
|
|
29
|
-
"@datashow/super-visual-compiler": "0.1.0-rc.
|
|
30
|
-
"@datashow/super-visual-contracts": "0.1.0-rc.
|
|
31
|
-
"@datashow/super-visual-fabric": "0.1.0-rc.
|
|
28
|
+
"@datashow/super-visual-adapter-claude-dashboard": "0.1.0-rc.3",
|
|
29
|
+
"@datashow/super-visual-compiler": "0.1.0-rc.3",
|
|
30
|
+
"@datashow/super-visual-contracts": "0.1.0-rc.3",
|
|
31
|
+
"@datashow/super-visual-fabric": "0.1.0-rc.3",
|
|
32
32
|
"@fontsource/source-serif-4": "5.3.1",
|
|
33
33
|
"@nivo/bar": "0.99.0",
|
|
34
34
|
"@nivo/line": "0.99.0",
|
package/src/main.mjs
CHANGED
|
@@ -15,9 +15,10 @@ import { resolveProjectTarget, targetUpdate, writeProjectTarget } from "./projec
|
|
|
15
15
|
import { runSemanticPreviewTest, startSemanticPreview } from "./semantic-preview.mjs";
|
|
16
16
|
|
|
17
17
|
const run = promisify(execFile);
|
|
18
|
-
const VERSION = "0.1.0-rc.
|
|
18
|
+
const VERSION = "0.1.0-rc.3";
|
|
19
19
|
const FABRIC_ID_PATTERN = /^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i;
|
|
20
20
|
const SPINNER_FRAMES = ["|", "/", "-", "\\"];
|
|
21
|
+
const progressStream = process.stderr;
|
|
21
22
|
let activeProgress = null;
|
|
22
23
|
|
|
23
24
|
export class CliUserError extends Error {
|
|
@@ -51,28 +52,30 @@ function output(value, json) {
|
|
|
51
52
|
export function stopActiveProgress() {
|
|
52
53
|
if (!activeProgress) return;
|
|
53
54
|
clearInterval(activeProgress.timer);
|
|
54
|
-
|
|
55
|
+
progressStream.write(`\r${" ".repeat(activeProgress.width)}\r`);
|
|
55
56
|
activeProgress = null;
|
|
56
57
|
}
|
|
57
58
|
|
|
58
|
-
function writeInitProgress(event) {
|
|
59
|
-
if (event.status === "running"
|
|
59
|
+
export function writeInitProgress(event) {
|
|
60
|
+
if (event.status === "running") {
|
|
60
61
|
stopActiveProgress();
|
|
62
|
+
progressStream.write(`> ${event.message}\n`);
|
|
63
|
+
if (!progressStream.isTTY) return;
|
|
61
64
|
let frame = 0;
|
|
62
65
|
const render = () => {
|
|
63
|
-
const line = `${SPINNER_FRAMES[frame % SPINNER_FRAMES.length]}
|
|
64
|
-
|
|
66
|
+
const line = `${SPINNER_FRAMES[frame % SPINNER_FRAMES.length]} Working...`;
|
|
67
|
+
progressStream.write(`\r${line}`);
|
|
65
68
|
activeProgress.width = Math.max(activeProgress.width, line.length);
|
|
66
69
|
frame += 1;
|
|
67
70
|
};
|
|
68
|
-
activeProgress = { timer: null, width:
|
|
71
|
+
activeProgress = { timer: null, width: 12 };
|
|
69
72
|
render();
|
|
70
|
-
activeProgress.timer = setInterval(render,
|
|
73
|
+
activeProgress.timer = setInterval(render, 120);
|
|
71
74
|
return;
|
|
72
75
|
}
|
|
73
76
|
stopActiveProgress();
|
|
74
|
-
const marker = event.status === "passed" ? "✓" : "
|
|
75
|
-
|
|
77
|
+
const marker = event.status === "passed" ? "✓" : "!";
|
|
78
|
+
progressStream.write(`${marker} ${event.message}\n`);
|
|
76
79
|
}
|
|
77
80
|
|
|
78
81
|
function semanticInventory(model) {
|
|
@@ -322,7 +325,7 @@ function createProgram() {
|
|
|
322
325
|
validateFabricId(options.workspaceId, "--workspace-id");
|
|
323
326
|
validateFabricId(options.semanticModelId, "--semantic-model-id");
|
|
324
327
|
const json = jsonEnabled(command);
|
|
325
|
-
if (!json)
|
|
328
|
+
if (!json) progressStream.write(`\nSuper Visual init\n\n`);
|
|
326
329
|
let liveValidation = null;
|
|
327
330
|
if (options.workspaceId && options.semanticModelId && !options.skipLiveValidation) {
|
|
328
331
|
if (!json) writeInitProgress({ status: "running", message: "Verifying the Fabric workspace and Power BI semantic model (read-only)" });
|
|
@@ -346,9 +349,9 @@ function createProgram() {
|
|
|
346
349
|
};
|
|
347
350
|
if (!json) writeInitProgress({ status: "passed", message: `Verified workspace ${inspected.workspace.displayName} and semantic model ${inspected.semanticModel.displayName}` });
|
|
348
351
|
} else if (!json && options.skipLiveValidation) {
|
|
349
|
-
|
|
352
|
+
progressStream.write("! Live Fabric validation skipped by request\n");
|
|
350
353
|
} else if (!json) {
|
|
351
|
-
|
|
354
|
+
progressStream.write("! No complete Fabric binding supplied; live validation was not run\n");
|
|
352
355
|
}
|
|
353
356
|
const result = await initializeProject({
|
|
354
357
|
directory,
|
|
@@ -360,6 +363,7 @@ function createProgram() {
|
|
|
360
363
|
onProgress: json ? null : writeInitProgress,
|
|
361
364
|
});
|
|
362
365
|
if (options.workspaceId) {
|
|
366
|
+
if (!json) writeInitProgress({ status: "running", message: "Saving the reusable Fabric project binding" });
|
|
363
367
|
const saved = await writeProjectTarget(result.directory, targetUpdate({
|
|
364
368
|
...options,
|
|
365
369
|
workspaceName: options.workspaceName ?? liveValidation?.workspace.displayName,
|
package/src/project.mjs
CHANGED
|
@@ -286,9 +286,11 @@ export async function initializeProject({ directory, template = "blank", name, t
|
|
|
286
286
|
await writeFile(path.join(target, "README.md"), blankReadme(projectTitle));
|
|
287
287
|
}
|
|
288
288
|
if (app) {
|
|
289
|
+
onProgress?.({ status: "running", step: "application", message: `Importing React application from ${path.resolve(app)}` });
|
|
289
290
|
await installApplication(target, app, projectTitle);
|
|
290
291
|
onProgress?.({ status: "passed", step: "application", message: `Imported React application from ${path.resolve(app)}` });
|
|
291
292
|
}
|
|
293
|
+
onProgress?.({ status: "running", step: "source", message: "Synchronizing React source and report-source contract" });
|
|
292
294
|
const style = await readFile(path.join(target, "source", "report-design.less"), "utf8");
|
|
293
295
|
const designHash = createHash("sha256").update(style).digest("hex");
|
|
294
296
|
await replaceTemplateTokens(target, { DESIGN_HASH: designHash });
|