gutterpress 0.10.0 → 0.10.1-beta.2

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 (57) hide show
  1. package/README.md +3 -16
  2. package/dist/api/index.d.ts +10 -19
  3. package/dist/api/index.js +8 -64
  4. package/dist/{audit-cvarpa72.js → audit-dce99css.js} +5 -5
  5. package/dist/{build-6r502chw.js → build-bj4x0727.js} +5 -5
  6. package/dist/checks/source/index.d.ts +1 -0
  7. package/dist/checks/source/merge-markers.d.ts +3 -0
  8. package/dist/{cli-cqtggsng.js → cli-0z6zf98d.js} +2 -47
  9. package/dist/{cli-eq5naw4m.js → cli-7n848af2.js} +370 -1249
  10. package/dist/{cli-zfcryxg8.js → cli-eewynen9.js} +97 -60
  11. package/dist/{cli-k1065rkg.js → cli-w692g6dx.js} +75 -29
  12. package/dist/{cli-149edp6b.js → cli-ydpf09d9.js} +1 -1
  13. package/dist/cli.js +14 -15
  14. package/dist/{doctor-akvxbtjb.js → doctor-7nd6n2aa.js} +2 -2
  15. package/dist/{engine-ft4cr3ep.js → engine-57vw8zpd.js} +1 -1
  16. package/dist/{engine-b159tbns.js → engine-8kdwy0jz.js} +2 -2
  17. package/dist/{gutterpress-viewer-te8g5grx.js → gutterpress-viewer-tma1qwz2.js} +57 -15
  18. package/dist/{index-ycpvr0am.js → index-7hrvksrb.js} +4 -4
  19. package/dist/{index-mdefp0y5.js → index-dtrftayr.js} +75 -27
  20. package/dist/{index-ge7q9xj3.js → index-h1x7krkg.js} +771 -1482
  21. package/dist/{index-wq3r5pj7.js → index-p0ebr7dh.js} +94 -57
  22. package/dist/index.js +9 -65
  23. package/dist/lib/git-fs.d.ts +43 -0
  24. package/dist/lib/host-policy.d.ts +14 -2
  25. package/dist/lib/remote-auth/clone.d.ts +0 -21
  26. package/dist/lib/remote-auth/converge-merge.d.ts +24 -7
  27. package/dist/lib/remote-auth/generic-auth.d.ts +0 -22
  28. package/dist/lib/remote-auth/git-http.d.ts +1 -1
  29. package/dist/lib/remote-auth/github-auth.d.ts +2 -22
  30. package/dist/lib/remote-auth/operation-log.d.ts +4 -9
  31. package/dist/lib/remote-auth/sync-messages.d.ts +35 -12
  32. package/dist/lib/remote-auth/sync-types.d.ts +30 -101
  33. package/dist/lib/remote-auth/sync.d.ts +19 -21
  34. package/dist/lib/remote-auth/token-store.d.ts +0 -10
  35. package/dist/lib/remote-auth/transport.d.ts +42 -40
  36. package/dist/lib/source-provider.d.ts +12 -0
  37. package/dist/{lint-p2sw53d9.js → lint-c8ze8sqw.js} +5 -5
  38. package/dist/{new-hvq0x91q.js → new-xy2qc300.js} +5 -5
  39. package/dist/{plugin-pssmk0dx.js → plugin-g9hwzjsm.js} +5 -5
  40. package/dist/{preflight-4j00yd0g.js → preflight-prcvdvmk.js} +5 -5
  41. package/dist/{preview-bridge-fz7vpk8m.js → preview-bridge-2nnrs2hy.js} +15 -0
  42. package/dist/{preview-d4s6gk6p.js → preview-h479apj9.js} +5 -5
  43. package/dist/{preview-interface-0ssk8bmm.js → preview-interface-2f5v96hd.js} +411 -88
  44. package/dist/{preview-shell-c5mfa3q0.js → preview-shell-kyjq59d9.js} +80 -25
  45. package/dist/{publish-tkc26en7.js → publish-emk644a8.js} +5 -5
  46. package/dist/{source-provider-3tcj6qg2.js → source-provider-2j5x2hyw.js} +1 -1
  47. package/dist/{source-provider-vanafrt9.js → source-provider-kn41jmbs.js} +1 -1
  48. package/dist/{validate-w9vfefrw.js → validate-be54bdc6.js} +5 -5
  49. package/package.json +1 -1
  50. package/dist/lib/app-heartbeat.d.ts +0 -102
  51. package/dist/lib/remote-auth/image-clash.d.ts +0 -17
  52. package/dist/lib/remote-auth/recovery/classify.d.ts +0 -97
  53. package/dist/lib/remote-auth/recovery/inspect.d.ts +0 -75
  54. package/dist/lib/remote-auth/recovery/locks.d.ts +0 -20
  55. package/dist/lib/remote-auth/recovery/repair.d.ts +0 -29
  56. package/dist/lib/remote-auth/recovery/types.d.ts +0 -39
  57. package/dist/repair-2va4w12t.js +0 -137
@@ -1,137 +0,0 @@
1
- import {
2
- classifyFromHealth,
3
- inspectRepo,
4
- isAppHeartbeatFresh,
5
- isUnbornRepo,
6
- repairRepo,
7
- verifyRepoReadable
8
- } from "./cli-eq5naw4m.js";
9
- import {
10
- FileTokenStore,
11
- defaultConfigDir
12
- } from "./cli-cqtggsng.js";
13
- import {
14
- UsageError,
15
- rejectExtraPositionals,
16
- rejectUnknownFlags
17
- } from "./cli-149edp6b.js";
18
- import"./cli-zfcryxg8.js";
19
- import"./cli-c41yr7he.js";
20
- import"./cli-46ycxe6r.js";
21
- import"./cli-k1065rkg.js";
22
- import"./cli-v5mp7a6q.js";
23
- import"./cli-37x76zdn.js";
24
-
25
- // src/commands/repair.ts
26
- import { defineCommand } from "citty";
27
- import * as readline from "node:readline/promises";
28
- import path from "node:path";
29
- async function promptYesNo(question) {
30
- if (!process.stdin.isTTY)
31
- return false;
32
- const rl = readline.createInterface({ input: process.stdin, output: process.stdout });
33
- try {
34
- const answer = (await rl.question(`${question} [y/N] `)).trim().toLowerCase();
35
- return answer === "y" || answer === "yes";
36
- } finally {
37
- rl.close();
38
- }
39
- }
40
- var commandArgs = {
41
- dir: {
42
- type: "positional",
43
- description: "Project directory (defaults to the current directory)",
44
- required: false
45
- },
46
- check: {
47
- type: "boolean",
48
- description: "Diagnose only — never change anything (exit 1 when repair is needed)",
49
- default: false
50
- },
51
- yes: {
52
- type: "boolean",
53
- description: "Approve the repair without prompting",
54
- default: false
55
- },
56
- force: {
57
- type: "boolean",
58
- description: "Repair even if the Gutterpress app appears to have this project open",
59
- default: false
60
- }
61
- };
62
- var repair_default = defineCommand({
63
- meta: {
64
- name: "repair",
65
- description: "Diagnose and repair the project's version history"
66
- },
67
- args: commandArgs,
68
- async run({ args, rawArgs }) {
69
- try {
70
- rejectUnknownFlags(rawArgs, commandArgs, "repair");
71
- rejectExtraPositionals(args._, 1, "repair");
72
- } catch (error) {
73
- if (error instanceof UsageError) {
74
- console.error(error.message);
75
- process.exitCode = error.exitCode;
76
- return;
77
- }
78
- throw error;
79
- }
80
- const openedDir = path.resolve(args.dir ?? ".");
81
- const health = await inspectRepo({ repoDir: openedDir });
82
- let needsRepair = classifyFromHealth(health, { minLockAgeMs: 0 }) !== null;
83
- if (!needsRepair && health.hasGitDir) {
84
- try {
85
- await verifyRepoReadable(openedDir);
86
- } catch {
87
- if (!isUnbornRepo(openedDir))
88
- needsRepair = true;
89
- }
90
- }
91
- if (!health.hasGitDir)
92
- needsRepair = true;
93
- if (!needsRepair) {
94
- console.log("Your project's version history looks healthy. Nothing to repair.");
95
- return;
96
- }
97
- console.log("Found a problem with this project's version history.");
98
- if (args.check) {
99
- console.log("\nRun `gutterpress repair` to fix it. Your files will not be changed.");
100
- process.exitCode = 1;
101
- return;
102
- }
103
- if (!args.force && await isAppHeartbeatFresh(openedDir)) {
104
- console.log(`
105
- The Gutterpress app appears to have this project open. Close it first, or re-run with --force.`);
106
- process.exitCode = 1;
107
- return;
108
- }
109
- if (!args.yes) {
110
- console.log(`
111
- The repair never changes your project files. If history has to be rebuilt,
112
- ` + `the old history folder is kept on disk as a backup and your saved versions
113
- ` + "are brought back into it wherever they are still readable.");
114
- if (!await promptYesNo("Repair now?")) {
115
- console.log("Nothing was changed.");
116
- process.exitCode = 1;
117
- return;
118
- }
119
- }
120
- const result = await repairRepo({
121
- projectDir: openedDir,
122
- tokenStore: new FileTokenStore(defaultConfigDir())
123
- });
124
- console.log(`
125
- ${result.message}`);
126
- for (const action of result.actions)
127
- console.log(` - ${action}`);
128
- if (result.damagedGitBackupPath) {
129
- console.log(` - Old history kept at: ${result.damagedGitBackupPath}`);
130
- }
131
- if (result.status !== "repaired")
132
- process.exitCode = 1;
133
- }
134
- });
135
- export {
136
- repair_default as default
137
- };