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