@basou/cli 0.73.1 → 0.74.0
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/index.js +46 -31
- package/dist/index.js.map +1 -1
- package/dist/program.js +46 -31
- package/dist/program.js.map +1 -1
- package/package.json +2 -2
package/dist/index.js
CHANGED
|
@@ -14047,6 +14047,18 @@ var BOARD_HTML = `<!doctype html>
|
|
|
14047
14047
|
(function () {
|
|
14048
14048
|
var S = null;
|
|
14049
14049
|
var lang = 'en';
|
|
14050
|
+
// The workspace of a portfolio the page is opened for (?ws=<key>), set
|
|
14051
|
+
// before anything is fetched: its board is read from its scoped routes, and
|
|
14052
|
+
// the page's links keep it. Null in single mode.
|
|
14053
|
+
var WS = null;
|
|
14054
|
+
function apiPath(sub) {
|
|
14055
|
+
return (WS === null ? '/api/' : '/api/ws/' + encodeURIComponent(WS) + '/') + sub;
|
|
14056
|
+
}
|
|
14057
|
+
function boardHref(query) {
|
|
14058
|
+
var parts = WS === null ? [] : ['ws=' + encodeURIComponent(WS)];
|
|
14059
|
+
if (query) parts.push(query);
|
|
14060
|
+
return '/board' + (parts.length > 0 ? '?' + parts.join('&') : '');
|
|
14061
|
+
}
|
|
14050
14062
|
function $(id) { return document.getElementById(id); }
|
|
14051
14063
|
function clear(node) { while (node.firstChild) node.removeChild(node.firstChild); }
|
|
14052
14064
|
function el(tag, attrs, children) {
|
|
@@ -14216,19 +14228,19 @@ var BOARD_HTML = `<!doctype html>
|
|
|
14216
14228
|
var page = d.page;
|
|
14217
14229
|
var list = page.records || [];
|
|
14218
14230
|
if (list.length > 0) recordLinks(nav, page, list);
|
|
14219
|
-
nav.appendChild(el('a', { href: '
|
|
14231
|
+
nav.appendChild(el('a', { href: boardHref('live=1'), text: S.live.measureNow }));
|
|
14220
14232
|
}
|
|
14221
14233
|
|
|
14222
14234
|
function recordLinks(nav, page, list) {
|
|
14223
14235
|
var link = function (id, label) {
|
|
14224
|
-
return el('a', { href: '
|
|
14236
|
+
return el('a', { href: boardHref('record=' + encodeURIComponent(id)), text: label });
|
|
14225
14237
|
};
|
|
14226
14238
|
// Around the record asked for, whether or not it could be drawn.
|
|
14227
14239
|
if (page.older) nav.appendChild(link(page.older, S.older));
|
|
14228
14240
|
if (page.newer) nav.appendChild(link(page.newer, S.newer));
|
|
14229
|
-
nav.appendChild(el('a', { href: '
|
|
14241
|
+
nav.appendChild(el('a', { href: boardHref(''), text: S.latest }));
|
|
14230
14242
|
var select = el('select', {
|
|
14231
|
-
onchange: function () { location.href = '
|
|
14243
|
+
onchange: function () { location.href = boardHref('record=' + encodeURIComponent(select.value)); }
|
|
14232
14244
|
});
|
|
14233
14245
|
var listed = list.some(function (r) { return r.id === page.id; });
|
|
14234
14246
|
if (!listed) {
|
|
@@ -14987,9 +14999,9 @@ var BOARD_HTML = `<!doctype html>
|
|
|
14987
14999
|
clear(nav);
|
|
14988
15000
|
// Asked for with ?live=1: lead back to the records, when there are any.
|
|
14989
15001
|
if (why === null) {
|
|
14990
|
-
getJson('
|
|
15002
|
+
getJson(apiPath('board')).then(function (b) {
|
|
14991
15003
|
var list = b && b.page && b.page.records ? b.page.records : [];
|
|
14992
|
-
if (drawn === liveDrawn && list.length > 0) nav.appendChild(el('a', { href: '
|
|
15004
|
+
if (drawn === liveDrawn && list.length > 0) nav.appendChild(el('a', { href: boardHref(''), text: S.live.toRecords }));
|
|
14993
15005
|
}).catch(function () {});
|
|
14994
15006
|
}
|
|
14995
15007
|
var root = $('board');
|
|
@@ -15012,16 +15024,17 @@ var BOARD_HTML = `<!doctype html>
|
|
|
15012
15024
|
// Measuring takes seconds, so the page says so until it is done.
|
|
15013
15025
|
function loadLive(why) {
|
|
15014
15026
|
setStatus(S ? S.live.measuring : '...', false);
|
|
15015
|
-
getJson('
|
|
15027
|
+
getJson(apiPath('board/live')).then(function (d) { drawLive(d, why); }).catch(failed);
|
|
15016
15028
|
}
|
|
15017
15029
|
|
|
15018
15030
|
var params = new URLSearchParams(location.search);
|
|
15031
|
+
WS = params.get('ws');
|
|
15019
15032
|
var record = params.get('record');
|
|
15020
15033
|
if (params.get('live') !== null) {
|
|
15021
15034
|
loadLive(null);
|
|
15022
15035
|
} else {
|
|
15023
15036
|
setStatus('...', false);
|
|
15024
|
-
getJson('
|
|
15037
|
+
getJson(apiPath('board' + (record ? '/' + encodeURIComponent(record) : ''))).then(draw).catch(failed);
|
|
15025
15038
|
}
|
|
15026
15039
|
})();
|
|
15027
15040
|
</script>
|
|
@@ -15287,7 +15300,7 @@ var VIEW_HTML = `<!doctype html>
|
|
|
15287
15300
|
state.canAct = true;
|
|
15288
15301
|
document.body.classList.remove('landing');
|
|
15289
15302
|
$('btn-back').style.display = 'none';
|
|
15290
|
-
|
|
15303
|
+
$('board-link').href = '/board';
|
|
15291
15304
|
$('board-link').style.display = '';
|
|
15292
15305
|
updateActionBar();
|
|
15293
15306
|
buildTabs();
|
|
@@ -15301,6 +15314,8 @@ var VIEW_HTML = `<!doctype html>
|
|
|
15301
15314
|
state.canAct = false;
|
|
15302
15315
|
document.body.classList.add('landing');
|
|
15303
15316
|
$('btn-back').style.display = 'none';
|
|
15317
|
+
// No workspace is open: there is no board to lead to.
|
|
15318
|
+
$('board-link').style.display = 'none';
|
|
15304
15319
|
setStatus('', false);
|
|
15305
15320
|
clear($('tabs'));
|
|
15306
15321
|
updateActionBar();
|
|
@@ -15415,6 +15430,10 @@ var VIEW_HTML = `<!doctype html>
|
|
|
15415
15430
|
state.canAct = true;
|
|
15416
15431
|
document.body.classList.remove('landing');
|
|
15417
15432
|
$('btn-back').style.display = '';
|
|
15433
|
+
// The board of the workspace open, read from its scoped routes. The cards
|
|
15434
|
+
// of the landing carry none of a board's figures.
|
|
15435
|
+
$('board-link').href = '/board?ws=' + encodeURIComponent(key);
|
|
15436
|
+
$('board-link').style.display = '';
|
|
15418
15437
|
updateActionBar();
|
|
15419
15438
|
setStatus('workspace: ' + label, false);
|
|
15420
15439
|
buildTabs();
|
|
@@ -15822,7 +15841,7 @@ async function handleGet(res, pathname, deps) {
|
|
|
15822
15841
|
sendHtml(res, VIEW_HTML);
|
|
15823
15842
|
return;
|
|
15824
15843
|
}
|
|
15825
|
-
if (pathname === "/board"
|
|
15844
|
+
if (pathname === "/board") {
|
|
15826
15845
|
sendHtml(res, BOARD_HTML);
|
|
15827
15846
|
return;
|
|
15828
15847
|
}
|
|
@@ -15843,8 +15862,8 @@ async function handleGet(res, pathname, deps) {
|
|
|
15843
15862
|
ws,
|
|
15844
15863
|
deps.nowProvider,
|
|
15845
15864
|
remoteUrlOf(deps),
|
|
15846
|
-
|
|
15847
|
-
|
|
15865
|
+
ws.board,
|
|
15866
|
+
ws.boardLive
|
|
15848
15867
|
)) {
|
|
15849
15868
|
sendError(res, 404, "Not found");
|
|
15850
15869
|
}
|
|
@@ -15858,8 +15877,8 @@ async function handleGet(res, pathname, deps) {
|
|
|
15858
15877
|
primaryWorkspace(deps),
|
|
15859
15878
|
deps.nowProvider,
|
|
15860
15879
|
remoteUrlOf(deps),
|
|
15861
|
-
|
|
15862
|
-
|
|
15880
|
+
flatBoardOf(deps),
|
|
15881
|
+
flatBoardLiveOf(deps)
|
|
15863
15882
|
)) {
|
|
15864
15883
|
sendError(res, 404, "Not found");
|
|
15865
15884
|
}
|
|
@@ -15867,11 +15886,11 @@ async function handleGet(res, pathname, deps) {
|
|
|
15867
15886
|
}
|
|
15868
15887
|
sendError(res, 404, "Not found");
|
|
15869
15888
|
}
|
|
15870
|
-
function
|
|
15871
|
-
return deps.mode === "single" ? deps.board : void 0;
|
|
15889
|
+
function flatBoardOf(deps) {
|
|
15890
|
+
return deps.mode === "single" ? primaryWorkspace(deps).board : void 0;
|
|
15872
15891
|
}
|
|
15873
|
-
function
|
|
15874
|
-
return deps.mode === "single" ? deps.boardLive : void 0;
|
|
15892
|
+
function flatBoardLiveOf(deps) {
|
|
15893
|
+
return deps.mode === "single" ? primaryWorkspace(deps).boardLive : void 0;
|
|
15875
15894
|
}
|
|
15876
15895
|
function remoteUrlOf(deps) {
|
|
15877
15896
|
return deps.remoteUrlOf ?? tryRemoteUrl;
|
|
@@ -16390,14 +16409,13 @@ async function buildSingleDeps(ctx, cwd) {
|
|
|
16390
16409
|
const repositoryRoot = await resolveBasouRootForCommand(cwd, "view");
|
|
16391
16410
|
const paths = basouPaths25(repositoryRoot);
|
|
16392
16411
|
await assertWorkspaceInitialized16(paths.root);
|
|
16393
|
-
const
|
|
16412
|
+
const built = await buildWorkspaceEntry(repositoryRoot, ctx);
|
|
16413
|
+
const entry = built.board !== void 0 ? built : { ...built, board: { why: "no_board" }, boardLive: liveBoardOf(repositoryRoot, ctx) };
|
|
16394
16414
|
return {
|
|
16395
16415
|
workspaces: [entry],
|
|
16396
16416
|
mode: "single",
|
|
16397
16417
|
nowProvider: nowProviderOf(ctx),
|
|
16398
|
-
...ctx.remoteUrlOf !== void 0 ? { remoteUrlOf: ctx.remoteUrlOf } : {}
|
|
16399
|
-
board: await viewBoardOf(repositoryRoot, paths),
|
|
16400
|
-
boardLive: liveBoardOf(repositoryRoot, ctx)
|
|
16418
|
+
...ctx.remoteUrlOf !== void 0 ? { remoteUrlOf: ctx.remoteUrlOf } : {}
|
|
16401
16419
|
};
|
|
16402
16420
|
}
|
|
16403
16421
|
function liveBoardOf(root, ctx) {
|
|
@@ -16418,13 +16436,8 @@ function sharedWhileRunning(run) {
|
|
|
16418
16436
|
return running;
|
|
16419
16437
|
};
|
|
16420
16438
|
}
|
|
16421
|
-
|
|
16422
|
-
|
|
16423
|
-
try {
|
|
16424
|
-
own = (await readManifest19(paths)).repos?.find((repo) => repo.path === ".");
|
|
16425
|
-
} catch {
|
|
16426
|
-
own = void 0;
|
|
16427
|
-
}
|
|
16439
|
+
function viewBoardOf(root, manifest) {
|
|
16440
|
+
const own = manifest.repos?.find((repo) => repo.path === ".");
|
|
16428
16441
|
if (own?.visibility !== "private") return { why: "no_board" };
|
|
16429
16442
|
return { recordsDir: join17(root, dirname9(DEFAULT_BOARD_PATH), "records") };
|
|
16430
16443
|
}
|
|
@@ -16466,7 +16479,9 @@ async function buildWorkspaceEntry(repoRoot, ctx, labelOverride) {
|
|
|
16466
16479
|
paths,
|
|
16467
16480
|
repoRoot,
|
|
16468
16481
|
importCtx,
|
|
16469
|
-
initialized: true
|
|
16482
|
+
initialized: true,
|
|
16483
|
+
board: viewBoardOf(repoRoot, manifest),
|
|
16484
|
+
boardLive: liveBoardOf(repoRoot, ctx)
|
|
16470
16485
|
};
|
|
16471
16486
|
} catch (error) {
|
|
16472
16487
|
const notFound = error instanceof Error && error.message === "YAML file not found";
|
|
@@ -16580,7 +16595,7 @@ function installExperimentalNotice(program2, names = EXPERIMENTAL_COMMANDS, writ
|
|
|
16580
16595
|
function readBuildStamp() {
|
|
16581
16596
|
if (false) return void 0;
|
|
16582
16597
|
try {
|
|
16583
|
-
return JSON.parse('{"version":"0.
|
|
16598
|
+
return JSON.parse('{"version":"0.74.0","commit":"31f16be","committedAt":"2026-10-23T12:42:48+09:00"}');
|
|
16584
16599
|
} catch {
|
|
16585
16600
|
return void 0;
|
|
16586
16601
|
}
|