@rigxyz/tapd 0.5.1 → 0.5.3
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/bin.js +16 -15
- package/dist/bin.js.map +1 -1
- package/dist/{chunk-LQWX63LP.js → chunk-QZHSLNCO.js} +32 -5
- package/dist/chunk-QZHSLNCO.js.map +1 -0
- package/dist/index.js +1 -1
- package/package.json +1 -1
- package/dist/chunk-LQWX63LP.js.map +0 -1
package/dist/bin.js
CHANGED
|
@@ -23,11 +23,12 @@ import {
|
|
|
23
23
|
readBindingConfig,
|
|
24
24
|
removeImport,
|
|
25
25
|
revoke,
|
|
26
|
+
safeResolveRigPath,
|
|
26
27
|
start
|
|
27
|
-
} from "./chunk-
|
|
28
|
+
} from "./chunk-QZHSLNCO.js";
|
|
28
29
|
|
|
29
30
|
// src/bin.ts
|
|
30
|
-
import { join as pathJoin, resolve
|
|
31
|
+
import { join as pathJoin, resolve } from "path";
|
|
31
32
|
import kleur from "kleur";
|
|
32
33
|
|
|
33
34
|
// src/defaults.ts
|
|
@@ -187,7 +188,7 @@ async function history(opts) {
|
|
|
187
188
|
// src/restore.ts
|
|
188
189
|
import { createHash } from "crypto";
|
|
189
190
|
import { existsSync as existsSync3, mkdirSync as mkdirSync2, renameSync, writeFileSync as writeFileSync2 } from "fs";
|
|
190
|
-
import { dirname as dirname2, join as join3
|
|
191
|
+
import { dirname as dirname2, join as join3 } from "path";
|
|
191
192
|
var PathNeverExistedError = class extends Error {
|
|
192
193
|
constructor(path) {
|
|
193
194
|
super(`No events for path "${path}" \u2014 never written through this binding.`);
|
|
@@ -234,6 +235,7 @@ function sha256Hex(bytes) {
|
|
|
234
235
|
return createHash("sha256").update(bytes).digest("hex");
|
|
235
236
|
}
|
|
236
237
|
async function restore(opts) {
|
|
238
|
+
const targetAbs = safeResolveRigPath(opts.rootDir, opts.path);
|
|
237
239
|
const events = await history({
|
|
238
240
|
rootDir: opts.rootDir,
|
|
239
241
|
path: opts.path,
|
|
@@ -257,7 +259,6 @@ async function restore(opts) {
|
|
|
257
259
|
if (actualHash !== writeEvent.hash) {
|
|
258
260
|
throw new HashMismatchError(opts.path, writeEvent.hash, actualHash);
|
|
259
261
|
}
|
|
260
|
-
const targetAbs = resolve(opts.rootDir, opts.path);
|
|
261
262
|
const overwrote = existsSync3(targetAbs);
|
|
262
263
|
mkdirSync2(dirname2(targetAbs), { recursive: true });
|
|
263
264
|
const tmp = `${targetAbs}.tap-restore-tmp.${Date.now().toString(36)}`;
|
|
@@ -278,7 +279,7 @@ import { existsSync as existsSync4 } from "fs";
|
|
|
278
279
|
import { join as join4 } from "path";
|
|
279
280
|
|
|
280
281
|
// src/version.ts
|
|
281
|
-
var TAPD_VERSION = "0.5.
|
|
282
|
+
var TAPD_VERSION = "0.5.3";
|
|
282
283
|
|
|
283
284
|
// src/status.ts
|
|
284
285
|
var STATE_KEY_LAST_APPLY_ERROR = "last_apply_error";
|
|
@@ -663,7 +664,7 @@ function collectPathGlobs(flags2) {
|
|
|
663
664
|
async function runMembers(positional2, flags2) {
|
|
664
665
|
const json = flags2.get("json") === true;
|
|
665
666
|
const sub = positional2[0];
|
|
666
|
-
const rootDir =
|
|
667
|
+
const rootDir = resolve(flags2.get("dir") ?? process.cwd());
|
|
667
668
|
const VALID_ROLES2 = /* @__PURE__ */ new Set(["owner", "editor", "viewer"]);
|
|
668
669
|
try {
|
|
669
670
|
if (sub === void 0 || sub === "list") {
|
|
@@ -759,7 +760,7 @@ async function runMembers(positional2, flags2) {
|
|
|
759
760
|
async function runInvite(positional2, flags2) {
|
|
760
761
|
const json = flags2.get("json") === true;
|
|
761
762
|
const sub = positional2[0];
|
|
762
|
-
const rootDir =
|
|
763
|
+
const rootDir = resolve(flags2.get("dir") ?? process.cwd());
|
|
763
764
|
try {
|
|
764
765
|
if (sub === void 0 || sub === "create") {
|
|
765
766
|
const ops = parseOps(flags2.get("ops"));
|
|
@@ -911,7 +912,7 @@ async function runJoin(positional2, flags2) {
|
|
|
911
912
|
throw err;
|
|
912
913
|
}
|
|
913
914
|
}
|
|
914
|
-
const rootDir =
|
|
915
|
+
const rootDir = resolve(flags2.get("dir") ?? process.cwd());
|
|
915
916
|
const deviceLabel = flags2.get("device-label");
|
|
916
917
|
let result;
|
|
917
918
|
try {
|
|
@@ -956,7 +957,7 @@ async function runJoin(positional2, flags2) {
|
|
|
956
957
|
}
|
|
957
958
|
async function runImport(positional2, flags2) {
|
|
958
959
|
const json = flags2.get("json") === true;
|
|
959
|
-
const rootDir =
|
|
960
|
+
const rootDir = resolve(flags2.get("dir") ?? process.cwd());
|
|
960
961
|
const sub = positional2[0];
|
|
961
962
|
if (sub === "remove") {
|
|
962
963
|
const name = positional2[1];
|
|
@@ -1079,7 +1080,7 @@ async function runImport(positional2, flags2) {
|
|
|
1079
1080
|
}
|
|
1080
1081
|
async function runStatus(flags2) {
|
|
1081
1082
|
const json = flags2.get("json") === true;
|
|
1082
|
-
const rootDir =
|
|
1083
|
+
const rootDir = resolve(flags2.get("dir") ?? process.cwd());
|
|
1083
1084
|
let report;
|
|
1084
1085
|
try {
|
|
1085
1086
|
report = await status({ rootDir });
|
|
@@ -1143,7 +1144,7 @@ async function runStatus(flags2) {
|
|
|
1143
1144
|
async function runUninit(flags2) {
|
|
1144
1145
|
const json = flags2.get("json") === true;
|
|
1145
1146
|
const purge = flags2.get("purge") === true;
|
|
1146
|
-
const rootDir =
|
|
1147
|
+
const rootDir = resolve(flags2.get("dir") ?? process.cwd());
|
|
1147
1148
|
let result;
|
|
1148
1149
|
try {
|
|
1149
1150
|
result = uninit({ rootDir, purge });
|
|
@@ -1200,7 +1201,7 @@ async function runUninit(flags2) {
|
|
|
1200
1201
|
}
|
|
1201
1202
|
}
|
|
1202
1203
|
async function runStart(flags2) {
|
|
1203
|
-
const rootDir =
|
|
1204
|
+
const rootDir = resolve(flags2.get("dir") ?? process.cwd());
|
|
1204
1205
|
const pollSeconds = flags2.has("poll-seconds") ? Number(flags2.get("poll-seconds")) : void 0;
|
|
1205
1206
|
const pidfilePath = flags2.get("no-pidfile") === true ? null : pathJoin(rootDir, DAEMON_PIDFILE_REL3);
|
|
1206
1207
|
let handle = null;
|
|
@@ -1246,7 +1247,7 @@ async function runStart(flags2) {
|
|
|
1246
1247
|
}
|
|
1247
1248
|
async function runHistory(flags2) {
|
|
1248
1249
|
const json = flags2.get("json") === true;
|
|
1249
|
-
const rootDir =
|
|
1250
|
+
const rootDir = resolve(flags2.get("dir") ?? process.cwd());
|
|
1250
1251
|
const path = flags2.get("path");
|
|
1251
1252
|
const asOf = flags2.get("as-of");
|
|
1252
1253
|
if (!path) {
|
|
@@ -1294,7 +1295,7 @@ async function runHistory(flags2) {
|
|
|
1294
1295
|
}
|
|
1295
1296
|
async function runRestore(flags2) {
|
|
1296
1297
|
const json = flags2.get("json") === true;
|
|
1297
|
-
const rootDir =
|
|
1298
|
+
const rootDir = resolve(flags2.get("dir") ?? process.cwd());
|
|
1298
1299
|
const path = flags2.get("path");
|
|
1299
1300
|
const asOf = flags2.get("as-of");
|
|
1300
1301
|
if (!path) {
|
|
@@ -1369,7 +1370,7 @@ async function runInit(flags2) {
|
|
|
1369
1370
|
throw err;
|
|
1370
1371
|
}
|
|
1371
1372
|
const relayUrl = flags2.get("relay") ?? process.env.RIG_RELAY_URL ?? DEFAULT_RELAY_URL;
|
|
1372
|
-
const rootDir =
|
|
1373
|
+
const rootDir = resolve(flags2.get("dir") ?? process.cwd());
|
|
1373
1374
|
const deviceLabel = flags2.get("device-label");
|
|
1374
1375
|
let result;
|
|
1375
1376
|
try {
|