@riboseinc/anafero-cli 0.0.2 → 0.0.4

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/build-site.mjs CHANGED
@@ -322259,7 +322259,8 @@ var build3 = Command_exports2.make(
322259
322259
  omitRevisionsNewerThanCurrent: unpackOption(omitRevisionsNewerThanCurrent),
322260
322260
  currentRevision: unpackOption(currentRevision)
322261
322261
  }, (task, progress) => onProgress(`build site|${task}`, progress), {
322262
- pathPrefix: prefix
322262
+ pathPrefix: prefix,
322263
+ dumpCache: debug3
322263
322264
  });
322264
322265
  const [writeProgress, writingSubtask] = onProgress("build site|write files");
322265
322266
  for await (const blobchunk of generator) {
@@ -322506,12 +322507,18 @@ async function* generateSite(revisionsToBuild, onProgress, opts) {
322506
322507
  }
322507
322508
  );
322508
322509
  } finally {
322509
- console.info("cacheDump.json was written for content reader work inspection");
322510
- fs4.writeFileSync(
322511
- "cacheDump.json",
322512
- JSON.stringify(cache3.dump(), null, 2),
322513
- { encoding: "utf-8" }
322514
- );
322510
+ if (opts?.dumpCache) {
322511
+ try {
322512
+ fs4.writeFileSync(
322513
+ "cacheDump.json",
322514
+ JSON.stringify(cache3.dump(), null, 2),
322515
+ { encoding: "utf-8" }
322516
+ );
322517
+ console.info("cacheDump.json was written for content reader work inspection");
322518
+ } catch (e2) {
322519
+ console.warn("cacheDump.json could not be written");
322520
+ }
322521
+ }
322515
322522
  }
322516
322523
  } else {
322517
322524
  throw new Error("Unversioned build is not supported yet");
@@ -112,6 +112,7 @@ const build = Command.
112
112
  currentRevision: unpackOption(currentRevision)!,
113
113
  }, (task, progress) => onProgress(`build site|${task}`, progress), {
114
114
  pathPrefix: prefix,
115
+ dumpCache: debug,
115
116
  });
116
117
  const [writeProgress, writingSubtask] = onProgress('build site|write files');
117
118
  for await (const blobchunk of generator) {
@@ -343,7 +344,7 @@ async function getRefsToBuild(revisionsToBuild: VersionBuildConfig) {
343
344
  async function * generateSite(
344
345
  revisionsToBuild: VersionBuildConfig | undefined,
345
346
  onProgress: TaskProgressCallback,
346
- opts?: { pathPrefix?: string | undefined },
347
+ opts?: { pathPrefix?: string | undefined, dumpCache?: boolean },
347
348
  ) {
348
349
  if (revisionsToBuild !== undefined) {
349
350
 
@@ -420,12 +421,18 @@ async function * generateSite(
420
421
  },
421
422
  );
422
423
  } finally {
423
- console.info("cacheDump.json was written for content reader work inspection");
424
- fs.writeFileSync(
425
- 'cacheDump.json',
426
- JSON.stringify(cache.dump(), null, 2),
427
- { encoding: 'utf-8' },
428
- );
424
+ if (opts?.dumpCache) {
425
+ try {
426
+ fs.writeFileSync(
427
+ 'cacheDump.json',
428
+ JSON.stringify(cache.dump(), null, 2),
429
+ { encoding: 'utf-8' },
430
+ );
431
+ console.info("cacheDump.json was written for content reader work inspection");
432
+ } catch (e) {
433
+ console.warn("cacheDump.json could not be written");
434
+ }
435
+ }
429
436
  }
430
437
  } else {
431
438
  throw new Error("Unversioned build is not supported yet");
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@riboseinc/anafero-cli",
3
3
  "type": "module",
4
- "version": "0.0.2",
4
+ "version": "0.0.4",
5
5
  "packageManager": "yarn@4.5.0",
6
6
  "bin": {
7
7
  "build-site": "build-site.mjs"
@@ -11,7 +11,7 @@
11
11
  "bp": "rm -f riboseinc-anafero-*.tgz; yarn build-generator -- --debug && npm pack",
12
12
  "build-generator-builder": "yarn esbuild build-generator.mts --log-level=debug --packages=external --platform=node --target=node18 --minify=false --bundle --format=esm --outfile=build-generator.mjs",
13
13
  "build-generator": "yarn node build-generator.mjs --",
14
- "clean-all": "rm -f anafero-*.tgz build-generator.mjs build-site.mjs bootstrap.js *.css",
14
+ "clean-all": "rm -f riboseinc-anafero-*.tgz build-generator.mjs build-site.mjs bootstrap.js *.css",
15
15
  "compile": "tsc --outdir compiled"
16
16
  },
17
17
  "dependencies": {
Binary file
@@ -0,0 +1,5 @@
1
+ //import { type Cache } from 'anafero/cache.mjs';
2
+ //
3
+ //
4
+ //export function makeSqliteCache(): Cache {
5
+ //}