@riboseinc/anafero-cli 0.0.24 → 0.0.26
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/bootstrap.css +3 -8
- package/bootstrap.css.map +2 -2
- package/bootstrap.js +1795 -1654
- package/bootstrap.js.map +4 -4
- package/build-site.css +3 -8
- package/build-site.mjs +77 -64
- package/generate-to-filesystem.tsx +81 -65
- package/package.json +1 -1
- package/riboseinc-anafero-cli-0.0.26.tgz +0 -0
- package/riboseinc-anafero-cli-0.0.24.tgz +0 -0
package/build-site.css
CHANGED
|
@@ -31078,6 +31078,9 @@ tbody.vars_bd693cb4_hm005a_spectrum-Table-body .vars_bd693cb4_hm005a_spectrum-Ta
|
|
|
31078
31078
|
white-space: nowrap;
|
|
31079
31079
|
overflow: hidden;
|
|
31080
31080
|
text-overflow: ellipsis;
|
|
31081
|
+
display: flex;
|
|
31082
|
+
align-items: center;
|
|
31083
|
+
gap: 1em;
|
|
31081
31084
|
transition: margin-left .5s ease-in-out;
|
|
31082
31085
|
&.style_withNav {
|
|
31083
31086
|
margin-left: 330px !important;
|
|
@@ -31191,14 +31194,6 @@ tbody.vars_bd693cb4_hm005a_spectrum-Table-body .vars_bd693cb4_hm005a_spectrum-Ta
|
|
|
31191
31194
|
overflow: hidden;
|
|
31192
31195
|
text-align: right;
|
|
31193
31196
|
text-overflow: ellipsis;
|
|
31194
|
-
html[lang=ja] & {
|
|
31195
|
-
transform: unset;
|
|
31196
|
-
width: unset;
|
|
31197
|
-
height: unset;
|
|
31198
|
-
text-align: unset;
|
|
31199
|
-
writing-mode: vertical-rl;
|
|
31200
|
-
margin-top: 20px;
|
|
31201
|
-
}
|
|
31202
31197
|
}
|
|
31203
31198
|
}
|
|
31204
31199
|
.style_browserBarToolbar[data-orientation=vertical] {
|
package/build-site.mjs
CHANGED
|
@@ -294340,7 +294340,7 @@ function makeDummyInMemoryCache() {
|
|
|
294340
294340
|
has: (key) => {
|
|
294341
294341
|
return cache3[key] !== void 0;
|
|
294342
294342
|
},
|
|
294343
|
-
get: (key
|
|
294343
|
+
get: (key) => {
|
|
294344
294344
|
if (cache3[key] !== void 0) {
|
|
294345
294345
|
return cache3[key];
|
|
294346
294346
|
} else {
|
|
@@ -321476,28 +321476,54 @@ var build2 = Command_exports2.make(
|
|
|
321476
321476
|
...reportingOptions
|
|
321477
321477
|
},
|
|
321478
321478
|
({ targetDirectoryPath, pathPrefix, verbose, debug: debug3, revision, omitRevisionsNewerThanCurrent, currentRevision }) => pipe(
|
|
321479
|
-
Effect_exports.try(() =>
|
|
321480
|
-
|
|
321479
|
+
Effect_exports.try(() => {
|
|
321480
|
+
const config2 = parseReportingConfig({ verbose, debug: debug3 });
|
|
321481
|
+
return [
|
|
321482
|
+
config2,
|
|
321483
|
+
makeDummyInMemoryCache()
|
|
321484
|
+
];
|
|
321485
|
+
}),
|
|
321486
|
+
Effect_exports.flatMap(([reportingConfig, cache3]) => pipe(
|
|
321481
321487
|
Effect_exports.tryPromise({
|
|
321482
321488
|
try: () => new Promise((resolve4, reject) => {
|
|
321483
321489
|
const prefix = unpackOption(pathPrefix);
|
|
321484
321490
|
if (prefix && (!prefix.startsWith("/") || prefix.endsWith("/"))) {
|
|
321485
321491
|
throw new Error("Path prefix must have a leading slash and no trailing slash");
|
|
321486
321492
|
}
|
|
321493
|
+
function maybeDumpCache() {
|
|
321494
|
+
if (debug3) {
|
|
321495
|
+
try {
|
|
321496
|
+
console.warn("Dumping cache to cacheDump.json");
|
|
321497
|
+
fs4.writeFileSync(
|
|
321498
|
+
"cacheDump.json",
|
|
321499
|
+
JSON.stringify(cache3.dump(), null, 2),
|
|
321500
|
+
{ encoding: "utf-8" }
|
|
321501
|
+
);
|
|
321502
|
+
} catch (e2) {
|
|
321503
|
+
console.error("Cache dump could not be written!", e2);
|
|
321504
|
+
}
|
|
321505
|
+
}
|
|
321506
|
+
}
|
|
321507
|
+
process.on("SIGINT", maybeDumpCache);
|
|
321487
321508
|
render_default(/* @__PURE__ */ import_react128.default.createElement(Processor, { rootTaskName: "build site", onStart: async function({ onProgress }) {
|
|
321488
321509
|
try {
|
|
321489
|
-
const generator = generateSite(
|
|
321490
|
-
|
|
321491
|
-
|
|
321492
|
-
|
|
321493
|
-
|
|
321494
|
-
|
|
321495
|
-
|
|
321496
|
-
|
|
321497
|
-
|
|
321498
|
-
|
|
321510
|
+
const generator = generateSite(
|
|
321511
|
+
{
|
|
321512
|
+
revision: unpackOption(revision),
|
|
321513
|
+
omitRevisionsNewerThanCurrent: unpackOption(omitRevisionsNewerThanCurrent),
|
|
321514
|
+
currentRevision: unpackOption(currentRevision)
|
|
321515
|
+
},
|
|
321516
|
+
(task, progress) => onProgress(`build site|${task}`, progress),
|
|
321517
|
+
cache3,
|
|
321518
|
+
{
|
|
321519
|
+
pathPrefix: prefix,
|
|
321520
|
+
debug: {
|
|
321521
|
+
//dumpCache: debug || false,
|
|
321522
|
+
reactDevTools: debug3 || false,
|
|
321523
|
+
reactStrictMode: debug3 || false
|
|
321524
|
+
}
|
|
321499
321525
|
}
|
|
321500
|
-
|
|
321526
|
+
);
|
|
321501
321527
|
const [writeProgress, writingSubtask] = onProgress("build site|write files");
|
|
321502
321528
|
for await (const blobchunk of generator) {
|
|
321503
321529
|
const [subtask] = writingSubtask(Object.keys(blobchunk).join(",").replaceAll("|", ":"), { state: "writing" });
|
|
@@ -321509,6 +321535,9 @@ var build2 = Command_exports2.make(
|
|
|
321509
321535
|
resolve4(void 0);
|
|
321510
321536
|
} catch (e2) {
|
|
321511
321537
|
reject(e2);
|
|
321538
|
+
} finally {
|
|
321539
|
+
maybeDumpCache();
|
|
321540
|
+
process.removeListener("SIGINT", maybeDumpCache);
|
|
321512
321541
|
}
|
|
321513
321542
|
} }));
|
|
321514
321543
|
}),
|
|
@@ -321646,7 +321675,7 @@ global.document ??= {
|
|
|
321646
321675
|
evaluate: import_xpath2.default.evaluate
|
|
321647
321676
|
};
|
|
321648
321677
|
global.XPathResult ??= import_xpath2.default.XPathResult;
|
|
321649
|
-
async function* generateSite(revisionsToBuild, onProgress, opts) {
|
|
321678
|
+
async function* generateSite(revisionsToBuild, onProgress, cache3, opts) {
|
|
321650
321679
|
if (revisionsToBuild !== void 0) {
|
|
321651
321680
|
const [versionProgress] = onProgress("determine versions to build", {});
|
|
321652
321681
|
if (!await areWeInGitRepoRoot()) {
|
|
@@ -321685,56 +321714,40 @@ async function* generateSite(revisionsToBuild, onProgress, opts) {
|
|
|
321685
321714
|
join8(PACKAGE_ROOT, "./bootstrap.css")
|
|
321686
321715
|
)
|
|
321687
321716
|
};
|
|
321688
|
-
|
|
321689
|
-
|
|
321690
|
-
|
|
321691
|
-
|
|
321692
|
-
|
|
321693
|
-
|
|
321694
|
-
|
|
321695
|
-
|
|
321696
|
-
|
|
321697
|
-
|
|
321698
|
-
|
|
321699
|
-
|
|
321700
|
-
|
|
321701
|
-
|
|
321702
|
-
|
|
321703
|
-
|
|
321704
|
-
|
|
321705
|
-
|
|
321706
|
-
|
|
321707
|
-
|
|
321708
|
-
|
|
321709
|
-
|
|
321710
|
-
|
|
321711
|
-
|
|
321712
|
-
|
|
321713
|
-
|
|
321714
|
-
|
|
321715
|
-
|
|
321716
|
-
|
|
321717
|
-
|
|
321718
|
-
|
|
321719
|
-
|
|
321720
|
-
).window.document,
|
|
321721
|
-
getConfigOverride: async () => null
|
|
321722
|
-
}
|
|
321723
|
-
);
|
|
321724
|
-
} finally {
|
|
321725
|
-
if (opts?.debug?.dumpCache) {
|
|
321726
|
-
try {
|
|
321727
|
-
fs4.writeFileSync(
|
|
321728
|
-
"cacheDump.json",
|
|
321729
|
-
JSON.stringify(cache3.dump(), null, 2),
|
|
321730
|
-
{ encoding: "utf-8" }
|
|
321731
|
-
);
|
|
321732
|
-
console.info("cacheDump.json was written for content reader work inspection");
|
|
321733
|
-
} catch (e2) {
|
|
321734
|
-
console.warn("cacheDump.json could not be written");
|
|
321735
|
-
}
|
|
321717
|
+
yield* generateStaticSiteAssets(
|
|
321718
|
+
refsToBuild,
|
|
321719
|
+
revisionsToBuild.currentRevision,
|
|
321720
|
+
{
|
|
321721
|
+
reportProgress: onProgress,
|
|
321722
|
+
fetchBlob: readObject,
|
|
321723
|
+
fetchDependency,
|
|
321724
|
+
getDependencyCSS: (modID) => {
|
|
321725
|
+
const maybeCSS = getDependencySupportingFiles()[modID]?.["index.css"];
|
|
321726
|
+
return maybeCSS ?? null;
|
|
321727
|
+
},
|
|
321728
|
+
getDependencySource: (modID) => {
|
|
321729
|
+
const source = getDependencySources()[modID];
|
|
321730
|
+
if (!source) {
|
|
321731
|
+
console.error("Requested dependency source was not found", modID);
|
|
321732
|
+
throw new Error("Requested dependency source was not found");
|
|
321733
|
+
}
|
|
321734
|
+
return source;
|
|
321735
|
+
},
|
|
321736
|
+
getDOMStub: () => new import_jsdom2.JSDOM("<html></html>").window.document,
|
|
321737
|
+
cache: cache3,
|
|
321738
|
+
debug: {
|
|
321739
|
+
reactStrictMode: opts?.debug?.reactStrictMode || false,
|
|
321740
|
+
reactDevTools: opts?.debug?.reactDevTools || false
|
|
321741
|
+
},
|
|
321742
|
+
pathPrefix: opts?.pathPrefix,
|
|
321743
|
+
decodeXML: (blob) => new import_jsdom2.JSDOM(
|
|
321744
|
+
decoder3.decode(blob).replace("xmlns", "wtf"),
|
|
321745
|
+
// xpath
|
|
321746
|
+
{ contentType: "application/xhtml+xml" }
|
|
321747
|
+
).window.document,
|
|
321748
|
+
getConfigOverride: async () => null
|
|
321736
321749
|
}
|
|
321737
|
-
|
|
321750
|
+
);
|
|
321738
321751
|
} else {
|
|
321739
321752
|
throw new Error("Unversioned build is not supported yet");
|
|
321740
321753
|
}
|
|
@@ -27,7 +27,7 @@ import React from 'react';
|
|
|
27
27
|
import { render } from 'ink';
|
|
28
28
|
import { Processor } from './CLI.jsx';
|
|
29
29
|
import { type TaskProgressCallback } from 'anafero/progress.mjs';
|
|
30
|
-
import { makeDummyInMemoryCache } from 'anafero/cache.mjs';
|
|
30
|
+
import { type Cache, makeDummyInMemoryCache } from 'anafero/cache.mjs';
|
|
31
31
|
|
|
32
32
|
import { JSDOM } from 'jsdom';
|
|
33
33
|
import xpath from 'xpath';
|
|
@@ -96,28 +96,57 @@ const build = Command.
|
|
|
96
96
|
...reportingOptions,
|
|
97
97
|
},
|
|
98
98
|
({ targetDirectoryPath, pathPrefix, verbose, debug, revision, omitRevisionsNewerThanCurrent, currentRevision }) => pipe(
|
|
99
|
-
Effect.try(() =>
|
|
100
|
-
|
|
99
|
+
Effect.try(() => {
|
|
100
|
+
const config = parseReportingConfig({ verbose, debug })
|
|
101
|
+
return [
|
|
102
|
+
config,
|
|
103
|
+
makeDummyInMemoryCache(),
|
|
104
|
+
] as [
|
|
105
|
+
ReturnType<typeof parseReportingConfig>,
|
|
106
|
+
ReturnType<typeof makeDummyInMemoryCache>,
|
|
107
|
+
];
|
|
108
|
+
}),
|
|
109
|
+
Effect.flatMap(([reportingConfig, cache]) => pipe(
|
|
101
110
|
Effect.tryPromise({
|
|
102
111
|
try: () => new Promise((resolve, reject) => {
|
|
103
112
|
const prefix = unpackOption(pathPrefix);
|
|
104
113
|
if (prefix && (!prefix.startsWith('/') || prefix.endsWith('/'))) {
|
|
105
114
|
throw new Error("Path prefix must have a leading slash and no trailing slash");
|
|
106
115
|
}
|
|
116
|
+
function maybeDumpCache() {
|
|
117
|
+
if (debug) {
|
|
118
|
+
try {
|
|
119
|
+
console.warn("Dumping cache to cacheDump.json");
|
|
120
|
+
fs.writeFileSync(
|
|
121
|
+
'cacheDump.json',
|
|
122
|
+
JSON.stringify(cache.dump(), null, 2),
|
|
123
|
+
{ encoding: 'utf-8' },
|
|
124
|
+
);
|
|
125
|
+
} catch (e) {
|
|
126
|
+
console.error("Cache dump could not be written!", e);
|
|
127
|
+
}
|
|
128
|
+
}
|
|
129
|
+
}
|
|
130
|
+
process.on('SIGINT', maybeDumpCache);
|
|
107
131
|
render(<Processor rootTaskName="build site" onStart={async function ({ onProgress }) {
|
|
108
132
|
try {
|
|
109
|
-
const generator = generateSite(
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
pathPrefix: prefix,
|
|
115
|
-
debug: {
|
|
116
|
-
dumpCache: debug || false,
|
|
117
|
-
reactDevTools: debug || false,
|
|
118
|
-
reactStrictMode: debug || false,
|
|
133
|
+
const generator = generateSite(
|
|
134
|
+
{
|
|
135
|
+
revision: unpackOption(revision)!,
|
|
136
|
+
omitRevisionsNewerThanCurrent: unpackOption(omitRevisionsNewerThanCurrent)!,
|
|
137
|
+
currentRevision: unpackOption(currentRevision)!,
|
|
119
138
|
},
|
|
120
|
-
|
|
139
|
+
(task, progress) => onProgress(`build site|${task}`, progress),
|
|
140
|
+
cache,
|
|
141
|
+
{
|
|
142
|
+
pathPrefix: prefix,
|
|
143
|
+
debug: {
|
|
144
|
+
//dumpCache: debug || false,
|
|
145
|
+
reactDevTools: debug || false,
|
|
146
|
+
reactStrictMode: debug || false,
|
|
147
|
+
},
|
|
148
|
+
},
|
|
149
|
+
);
|
|
121
150
|
const [writeProgress, writingSubtask] = onProgress('build site|write files');
|
|
122
151
|
for await (const blobchunk of generator) {
|
|
123
152
|
const [subtask] = writingSubtask(Object.keys(blobchunk).join(',').replaceAll('|', ':'), { state: 'writing' });
|
|
@@ -129,6 +158,9 @@ const build = Command.
|
|
|
129
158
|
resolve(void 0);
|
|
130
159
|
} catch (e) {
|
|
131
160
|
reject(e);
|
|
161
|
+
} finally {
|
|
162
|
+
maybeDumpCache();
|
|
163
|
+
process.removeListener('SIGINT', maybeDumpCache);
|
|
132
164
|
}
|
|
133
165
|
}} />);
|
|
134
166
|
}),
|
|
@@ -354,10 +386,11 @@ async function getRefsToBuild(revisionsToBuild: VersionBuildConfig) {
|
|
|
354
386
|
async function * generateSite(
|
|
355
387
|
revisionsToBuild: VersionBuildConfig | undefined,
|
|
356
388
|
onProgress: TaskProgressCallback,
|
|
389
|
+
cache: Cache,
|
|
357
390
|
opts?: {
|
|
358
391
|
pathPrefix?: string | undefined;
|
|
359
392
|
debug?: {
|
|
360
|
-
dumpCache?: boolean;
|
|
393
|
+
//dumpCache?: boolean;
|
|
361
394
|
reactDevTools?: boolean;
|
|
362
395
|
reactStrictMode?: boolean;
|
|
363
396
|
};
|
|
@@ -404,57 +437,40 @@ async function * generateSite(
|
|
|
404
437
|
join(PACKAGE_ROOT, './bootstrap.css')),
|
|
405
438
|
};
|
|
406
439
|
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
getDependencyCSS: (modID) => {
|
|
418
|
-
const maybeCSS = getDependencySupportingFiles()[modID]?.['index.css'];
|
|
419
|
-
return maybeCSS ?? null;
|
|
420
|
-
},
|
|
421
|
-
getDependencySource: (modID) => {
|
|
422
|
-
const source = getDependencySources()[modID];
|
|
423
|
-
if (!source) {
|
|
424
|
-
console.error("Requested dependency source was not found", modID);
|
|
425
|
-
throw new Error("Requested dependency source was not found");
|
|
426
|
-
}
|
|
427
|
-
return source;
|
|
428
|
-
},
|
|
429
|
-
getDOMStub: (() => (new JSDOM('<html></html>')).window.document),
|
|
430
|
-
cache,
|
|
431
|
-
debug: {
|
|
432
|
-
reactStrictMode: opts?.debug?.reactStrictMode || false,
|
|
433
|
-
reactDevTools: opts?.debug?.reactDevTools || false,
|
|
434
|
-
},
|
|
435
|
-
pathPrefix: opts?.pathPrefix,
|
|
436
|
-
decodeXML: (blob) =>
|
|
437
|
-
new JSDOM(
|
|
438
|
-
decoder.decode(blob).replace('xmlns', 'wtf'), // xpath
|
|
439
|
-
{ contentType: 'application/xhtml+xml' },
|
|
440
|
-
).window.document,
|
|
441
|
-
getConfigOverride: async () => null,
|
|
440
|
+
yield * generateStaticSiteAssets(
|
|
441
|
+
refsToBuild,
|
|
442
|
+
revisionsToBuild.currentRevision,
|
|
443
|
+
{
|
|
444
|
+
reportProgress: onProgress,
|
|
445
|
+
fetchBlob: readObject,
|
|
446
|
+
fetchDependency,
|
|
447
|
+
getDependencyCSS: (modID) => {
|
|
448
|
+
const maybeCSS = getDependencySupportingFiles()[modID]?.['index.css'];
|
|
449
|
+
return maybeCSS ?? null;
|
|
442
450
|
},
|
|
443
|
-
|
|
444
|
-
|
|
445
|
-
|
|
446
|
-
|
|
447
|
-
|
|
448
|
-
|
|
449
|
-
|
|
450
|
-
|
|
451
|
-
|
|
452
|
-
|
|
453
|
-
|
|
454
|
-
|
|
455
|
-
|
|
456
|
-
|
|
457
|
-
|
|
451
|
+
getDependencySource: (modID) => {
|
|
452
|
+
const source = getDependencySources()[modID];
|
|
453
|
+
if (!source) {
|
|
454
|
+
console.error("Requested dependency source was not found", modID);
|
|
455
|
+
throw new Error("Requested dependency source was not found");
|
|
456
|
+
}
|
|
457
|
+
return source;
|
|
458
|
+
},
|
|
459
|
+
getDOMStub: (() => (new JSDOM('<html></html>')).window.document),
|
|
460
|
+
cache,
|
|
461
|
+
debug: {
|
|
462
|
+
reactStrictMode: opts?.debug?.reactStrictMode || false,
|
|
463
|
+
reactDevTools: opts?.debug?.reactDevTools || false,
|
|
464
|
+
},
|
|
465
|
+
pathPrefix: opts?.pathPrefix,
|
|
466
|
+
decodeXML: (blob) =>
|
|
467
|
+
new JSDOM(
|
|
468
|
+
decoder.decode(blob).replace('xmlns', 'wtf'), // xpath
|
|
469
|
+
{ contentType: 'application/xhtml+xml' },
|
|
470
|
+
).window.document,
|
|
471
|
+
getConfigOverride: async () => null,
|
|
472
|
+
},
|
|
473
|
+
);
|
|
458
474
|
} else {
|
|
459
475
|
throw new Error("Unversioned build is not supported yet");
|
|
460
476
|
}
|
package/package.json
CHANGED
|
Binary file
|
|
Binary file
|