@smallpen/cli 0.1.0-alpha.14 → 0.1.0-alpha.15

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.
Files changed (2) hide show
  1. package/bin/smallpen.mjs +13 -1
  2. package/package.json +3 -3
package/bin/smallpen.mjs CHANGED
@@ -99,7 +99,9 @@ import {
99
99
  staleInstanceDiagnostics,
100
100
  } from "@smallpen/core";
101
101
  import {
102
+ BATCH_HISTORY_LIMITS,
102
103
  applyOperationBatch,
104
+ batchHistoryPath,
103
105
  defaultLibraryCacheRoot,
104
106
  fontVariantName,
105
107
  importDraft,
@@ -440,6 +442,8 @@ function printJson(value) {
440
442
  "libraryRevisions",
441
443
  "batchId",
442
444
  "alreadyApplied",
445
+ "history",
446
+ "historyWindow",
443
447
  "changed",
444
448
  "dryRun",
445
449
  "noChange",
@@ -1183,7 +1187,7 @@ async function writeReply(result, args) {
1183
1187
  ],
1184
1188
  }
1185
1189
  : {
1186
- ledgerPath: `${resolve(args[1])}.batches.json`,
1190
+ ledgerPath: await batchHistoryPath(resolve(args[1])),
1187
1191
  batchId: result.batchId,
1188
1192
  }),
1189
1193
  };
@@ -3235,6 +3239,13 @@ async function changesCommand(packagePath, args) {
3235
3239
  const revisions = {
3236
3240
  revision: product.revision,
3237
3241
  ...(foundation ? { foundationRevision: foundation.revision } : {}),
3242
+ historyWindow: packages.map((snapshot, index) => ({
3243
+ packageId: snapshot.manifest.packageId,
3244
+ ...BATCH_HISTORY_LIMITS,
3245
+ retainedBatches: histories[index].length,
3246
+ oldestRevision: histories[index][0]?.baseRevision,
3247
+ newestRevision: histories[index].at(-1)?.revision,
3248
+ })),
3238
3249
  };
3239
3250
  if (since === undefined) {
3240
3251
  const limit = integerOption(args, "--limit") || 10;
@@ -3265,6 +3276,7 @@ async function changesCommand(packagePath, args) {
3265
3276
  "unknown_revision",
3266
3277
  "This revision is not in the recorded history; read the current design with view instead",
3267
3278
  {
3279
+ historyWindow: revisions.historyWindow,
3268
3280
  nextOperations: [
3269
3281
  { argv: ["changes", packagePath, "--json"], operation: "smallpen.changes" },
3270
3282
  { argv: ["view", packagePath, "--as", "text", "--json"], operation: "smallpen.view" },
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@smallpen/cli",
3
- "version": "0.1.0-alpha.14",
3
+ "version": "0.1.0-alpha.15",
4
4
  "publishConfig": {
5
5
  "access": "public"
6
6
  },
@@ -15,8 +15,8 @@
15
15
  "bin"
16
16
  ],
17
17
  "dependencies": {
18
- "@smallpen/core": "0.1.0-alpha.14",
19
- "@smallpen/local-package": "0.1.0-alpha.14"
18
+ "@smallpen/core": "0.1.0-alpha.15",
19
+ "@smallpen/local-package": "0.1.0-alpha.15"
20
20
  },
21
21
  "repository": {
22
22
  "type": "git",