pushwork 1.0.5 → 1.0.11
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/README.md +87 -335
- package/babel.config.js +5 -0
- package/dist/cli/commands.d.ts +9 -15
- package/dist/cli/commands.d.ts.map +1 -1
- package/dist/cli/commands.js +37 -170
- package/dist/cli/commands.js.map +1 -1
- package/dist/cli/output.d.ts +11 -25
- package/dist/cli/output.d.ts.map +1 -1
- package/dist/cli/output.js +55 -61
- package/dist/cli/output.js.map +1 -1
- package/dist/cli.js +208 -213
- package/dist/cli.js.map +1 -1
- package/dist/commands.d.ts +51 -0
- package/dist/commands.d.ts.map +1 -0
- package/dist/commands.js +799 -0
- package/dist/commands.js.map +1 -0
- package/dist/core/change-detection.d.ts +7 -23
- package/dist/core/change-detection.d.ts.map +1 -1
- package/dist/core/change-detection.js +108 -122
- package/dist/core/change-detection.js.map +1 -1
- package/dist/core/config.d.ts +81 -0
- package/dist/core/config.d.ts.map +1 -0
- package/dist/core/config.js +296 -0
- package/dist/core/config.js.map +1 -0
- package/dist/core/index.d.ts +1 -0
- package/dist/core/index.d.ts.map +1 -1
- package/dist/core/index.js +1 -1
- package/dist/core/index.js.map +1 -1
- package/dist/core/move-detection.d.ts +4 -3
- package/dist/core/move-detection.d.ts.map +1 -1
- package/dist/core/move-detection.js +8 -7
- package/dist/core/move-detection.js.map +1 -1
- package/dist/core/snapshot.d.ts +0 -4
- package/dist/core/snapshot.d.ts.map +1 -1
- package/dist/core/snapshot.js +2 -11
- package/dist/core/snapshot.js.map +1 -1
- package/dist/core/sync-engine.d.ts +41 -12
- package/dist/core/sync-engine.d.ts.map +1 -1
- package/dist/core/sync-engine.js +522 -359
- package/dist/core/sync-engine.js.map +1 -1
- package/dist/index.d.ts +0 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +0 -6
- package/dist/index.js.map +1 -1
- package/dist/types/config.d.ts +24 -88
- package/dist/types/config.d.ts.map +1 -1
- package/dist/types/config.js +6 -0
- package/dist/types/config.js.map +1 -1
- package/dist/types/documents.d.ts +15 -2
- package/dist/types/documents.d.ts.map +1 -1
- package/dist/types/documents.js.map +1 -1
- package/dist/types/index.d.ts.map +1 -1
- package/dist/types/index.js +0 -3
- package/dist/types/index.js.map +1 -1
- package/dist/types/snapshot.d.ts +0 -21
- package/dist/types/snapshot.d.ts.map +1 -1
- package/dist/types/snapshot.js +0 -14
- package/dist/types/snapshot.js.map +1 -1
- package/dist/utils/content.d.ts.map +1 -1
- package/dist/utils/content.js +2 -6
- package/dist/utils/content.js.map +1 -1
- package/dist/utils/directory.d.ts +24 -0
- package/dist/utils/directory.d.ts.map +1 -0
- package/dist/utils/directory.js +56 -0
- package/dist/utils/directory.js.map +1 -0
- package/dist/utils/fs.d.ts +15 -2
- package/dist/utils/fs.d.ts.map +1 -1
- package/dist/utils/fs.js +53 -20
- package/dist/utils/fs.js.map +1 -1
- package/dist/utils/index.d.ts +1 -0
- package/dist/utils/index.d.ts.map +1 -1
- package/dist/utils/index.js +1 -3
- package/dist/utils/index.js.map +1 -1
- package/dist/utils/keyhive.d.ts +9 -0
- package/dist/utils/keyhive.d.ts.map +1 -0
- package/dist/utils/keyhive.js +26 -0
- package/dist/utils/keyhive.js.map +1 -0
- package/dist/utils/mime-types.d.ts.map +1 -1
- package/dist/utils/mime-types.js +11 -4
- package/dist/utils/mime-types.js.map +1 -1
- package/dist/utils/network-sync.d.ts +16 -7
- package/dist/utils/network-sync.d.ts.map +1 -1
- package/dist/utils/network-sync.js +158 -99
- package/dist/utils/network-sync.js.map +1 -1
- package/dist/utils/output.d.ts +129 -0
- package/dist/utils/output.d.ts.map +1 -0
- package/dist/utils/output.js +375 -0
- package/dist/utils/output.js.map +1 -0
- package/dist/utils/repo-factory.d.ts +2 -6
- package/dist/utils/repo-factory.d.ts.map +1 -1
- package/dist/utils/repo-factory.js +8 -31
- package/dist/utils/repo-factory.js.map +1 -1
- package/dist/utils/string-similarity.js +2 -2
- package/dist/utils/string-similarity.js.map +1 -1
- package/dist/utils/trace.d.ts +19 -0
- package/dist/utils/trace.d.ts.map +1 -0
- package/dist/utils/trace.js +68 -0
- package/dist/utils/trace.js.map +1 -0
- package/package.json +21 -11
- package/src/cli.ts +276 -308
- package/src/commands.ts +988 -0
- package/src/core/change-detection.ts +226 -246
- package/src/{config/index.ts → core/config.ts} +65 -82
- package/src/core/index.ts +1 -1
- package/src/core/move-detection.ts +10 -8
- package/src/core/snapshot.ts +2 -12
- package/src/core/sync-engine.ts +630 -478
- package/src/index.ts +0 -10
- package/src/types/config.ts +28 -93
- package/src/types/documents.ts +16 -2
- package/src/types/index.ts +0 -5
- package/src/types/snapshot.ts +0 -23
- package/src/utils/content.ts +2 -6
- package/src/utils/directory.ts +73 -0
- package/src/utils/fs.ts +57 -23
- package/src/utils/index.ts +1 -5
- package/src/utils/mime-types.ts +12 -4
- package/src/utils/network-sync.ts +216 -138
- package/src/utils/output.ts +450 -0
- package/src/utils/repo-factory.ts +13 -44
- package/src/utils/string-similarity.ts +2 -2
- package/src/utils/trace.ts +70 -0
- package/test/integration/exclude-patterns.test.ts +6 -15
- package/test/integration/fuzzer.test.ts +308 -391
- package/test/integration/in-memory-sync.test.ts +435 -0
- package/test/integration/init-sync.test.ts +89 -0
- package/test/integration/sync-deletion.test.ts +2 -61
- package/test/integration/sync-flow.test.ts +4 -24
- package/test/jest.setup.ts +34 -0
- package/test/unit/deletion-behavior.test.ts +3 -14
- package/test/unit/enhanced-mime-detection.test.ts +0 -22
- package/test/unit/snapshot.test.ts +2 -29
- package/test/unit/sync-convergence.test.ts +3 -198
- package/test/unit/sync-timing.test.ts +0 -44
- package/test/unit/utils.test.ts +0 -2
- package/tsconfig.json +3 -3
- package/bench/filesystem.bench.ts +0 -78
- package/bench/hashing.bench.ts +0 -60
- package/bench/move-detection.bench.ts +0 -130
- package/bench/runner.ts +0 -49
- package/dist/browser/browser-sync-engine.d.ts +0 -64
- package/dist/browser/browser-sync-engine.d.ts.map +0 -1
- package/dist/browser/browser-sync-engine.js +0 -303
- package/dist/browser/browser-sync-engine.js.map +0 -1
- package/dist/browser/filesystem-adapter.d.ts +0 -84
- package/dist/browser/filesystem-adapter.d.ts.map +0 -1
- package/dist/browser/filesystem-adapter.js +0 -413
- package/dist/browser/filesystem-adapter.js.map +0 -1
- package/dist/browser/index.d.ts +0 -36
- package/dist/browser/index.d.ts.map +0 -1
- package/dist/browser/index.js +0 -90
- package/dist/browser/index.js.map +0 -1
- package/dist/browser/types.d.ts +0 -70
- package/dist/browser/types.d.ts.map +0 -1
- package/dist/browser/types.js +0 -6
- package/dist/browser/types.js.map +0 -1
- package/dist/config/remote-manager.d.ts +0 -65
- package/dist/config/remote-manager.d.ts.map +0 -1
- package/dist/config/remote-manager.js +0 -243
- package/dist/config/remote-manager.js.map +0 -1
- package/dist/core/isomorphic-snapshot.d.ts +0 -58
- package/dist/core/isomorphic-snapshot.d.ts.map +0 -1
- package/dist/core/isomorphic-snapshot.js +0 -204
- package/dist/core/isomorphic-snapshot.js.map +0 -1
- package/dist/platform/browser-filesystem.d.ts +0 -26
- package/dist/platform/browser-filesystem.d.ts.map +0 -1
- package/dist/platform/browser-filesystem.js +0 -91
- package/dist/platform/browser-filesystem.js.map +0 -1
- package/dist/platform/filesystem.d.ts +0 -29
- package/dist/platform/filesystem.d.ts.map +0 -1
- package/dist/platform/filesystem.js +0 -65
- package/dist/platform/filesystem.js.map +0 -1
- package/dist/platform/node-filesystem.d.ts +0 -21
- package/dist/platform/node-filesystem.d.ts.map +0 -1
- package/dist/platform/node-filesystem.js +0 -93
- package/dist/platform/node-filesystem.js.map +0 -1
- package/dist/utils/fs-browser.d.ts +0 -57
- package/dist/utils/fs-browser.d.ts.map +0 -1
- package/dist/utils/fs-browser.js +0 -311
- package/dist/utils/fs-browser.js.map +0 -1
- package/dist/utils/fs-node.d.ts +0 -53
- package/dist/utils/fs-node.d.ts.map +0 -1
- package/dist/utils/fs-node.js +0 -220
- package/dist/utils/fs-node.js.map +0 -1
- package/dist/utils/isomorphic.d.ts +0 -29
- package/dist/utils/isomorphic.d.ts.map +0 -1
- package/dist/utils/isomorphic.js +0 -139
- package/dist/utils/isomorphic.js.map +0 -1
- package/dist/utils/pure.d.ts +0 -25
- package/dist/utils/pure.d.ts.map +0 -1
- package/dist/utils/pure.js +0 -112
- package/dist/utils/pure.js.map +0 -1
- package/src/cli/commands.ts +0 -1030
- package/src/cli/index.ts +0 -2
- package/src/cli/output.ts +0 -244
- package/test/README-TESTING-GAPS.md +0 -174
package/dist/cli.js
CHANGED
|
@@ -4,291 +4,286 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
4
4
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
5
5
|
};
|
|
6
6
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
7
|
-
const
|
|
7
|
+
const extra_typings_1 = require("@commander-js/extra-typings");
|
|
8
8
|
const chalk_1 = __importDefault(require("chalk"));
|
|
9
|
-
const commands_1 = require("./
|
|
10
|
-
/**
|
|
11
|
-
* Wrapper for command actions with consistent error handling
|
|
12
|
-
*/
|
|
13
|
-
function withErrorHandling(fn) {
|
|
14
|
-
return async (...args) => {
|
|
15
|
-
try {
|
|
16
|
-
await fn(...args);
|
|
17
|
-
}
|
|
18
|
-
catch (error) {
|
|
19
|
-
console.error(chalk_1.default.red(`Error: ${error}`));
|
|
20
|
-
process.exit(1);
|
|
21
|
-
}
|
|
22
|
-
};
|
|
23
|
-
}
|
|
24
|
-
const program = new commander_1.Command();
|
|
25
|
-
// get the version from the package.json
|
|
9
|
+
const commands_1 = require("./commands");
|
|
26
10
|
const version = require("../package.json").version;
|
|
27
|
-
program
|
|
11
|
+
const program = new extra_typings_1.Command()
|
|
28
12
|
.name("pushwork")
|
|
29
13
|
.description("Bidirectional directory synchronization using Automerge CRDTs")
|
|
30
|
-
.version(version);
|
|
14
|
+
.version(version, "-V, --version", "output the version number");
|
|
31
15
|
// Init command
|
|
32
16
|
program
|
|
33
17
|
.command("init")
|
|
34
|
-
.
|
|
18
|
+
.summary("Initialize sync in a directory")
|
|
35
19
|
.argument("[path]", "Directory path to initialize (default: current directory)", ".")
|
|
36
|
-
.option("--sync-server <url>", "Custom sync server URL
|
|
37
|
-
.
|
|
38
|
-
|
|
39
|
-
.
|
|
40
|
-
|
|
41
|
-
pushwork init # Initialize current directory
|
|
42
|
-
pushwork init ./my-folder # Initialize specific directory
|
|
43
|
-
pushwork init --debug # Show performance breakdown
|
|
44
|
-
pushwork init --sync-server ws://localhost:3030 --sync-server-storage-id 1d89eba7-f7a4-4e8e-80f2-5f4e2406f507
|
|
45
|
-
|
|
46
|
-
Note: Custom sync server options must always be used together.`)
|
|
47
|
-
.action(withErrorHandling(async (path, cmdOptions) => {
|
|
48
|
-
await (0, commands_1.init)(path, {
|
|
49
|
-
syncServer: cmdOptions.syncServer,
|
|
50
|
-
syncServerStorageId: cmdOptions.syncServerStorageId,
|
|
51
|
-
debug: cmdOptions.debug || false,
|
|
52
|
-
});
|
|
53
|
-
}));
|
|
20
|
+
.option("--sync-server <url> <storage-id...>", "Custom sync server URL and storage ID")
|
|
21
|
+
.action(async (path, opts) => {
|
|
22
|
+
const [syncServer, syncServerStorageId] = validateSyncServer(opts.syncServer);
|
|
23
|
+
await (0, commands_1.init)(path, { syncServer, syncServerStorageId });
|
|
24
|
+
});
|
|
54
25
|
// Clone command
|
|
55
26
|
program
|
|
56
27
|
.command("clone")
|
|
57
|
-
.
|
|
28
|
+
.summary("Clone an existing synced directory")
|
|
58
29
|
.argument("<url>", "AutomergeUrl of root directory to clone (format: automerge:XXXXX)")
|
|
59
30
|
.argument("<path>", "Target directory path")
|
|
60
|
-
.option("-f, --force", "Overwrite existing directory")
|
|
61
|
-
.option("--sync-server <url>", "Custom sync server URL
|
|
62
|
-
.option("
|
|
63
|
-
.
|
|
64
|
-
|
|
65
|
-
pushwork clone automerge:abc123 ./my-clone
|
|
66
|
-
pushwork clone automerge:abc123 ./my-clone -f
|
|
67
|
-
pushwork clone automerge:abc123 ./my-clone --sync-server ws://localhost:3030 --sync-server-storage-id 1d89eba7-f7a4-4e8e-80f2-5f4e2406f507
|
|
68
|
-
|
|
69
|
-
Note: Custom sync server options must always be used together.`)
|
|
70
|
-
.action(withErrorHandling(async (url, path, options) => {
|
|
31
|
+
.option("-f, --force", "Overwrite existing directory", false)
|
|
32
|
+
.option("--sync-server <url> <storage-id...>", "Custom sync server URL and storage ID")
|
|
33
|
+
.option("-v, --verbose", "Verbose output", false)
|
|
34
|
+
.action(async (url, path, opts) => {
|
|
35
|
+
const [syncServer, syncServerStorageId] = validateSyncServer(opts.syncServer);
|
|
71
36
|
await (0, commands_1.clone)(url, path, {
|
|
72
|
-
force:
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
syncServerStorageId: options.syncServerStorageId,
|
|
37
|
+
force: opts.force,
|
|
38
|
+
verbose: opts.verbose,
|
|
39
|
+
syncServer,
|
|
40
|
+
syncServerStorageId,
|
|
77
41
|
});
|
|
78
|
-
})
|
|
42
|
+
});
|
|
79
43
|
// Commit command
|
|
80
44
|
program
|
|
81
45
|
.command("commit")
|
|
82
|
-
.
|
|
46
|
+
.summary("Save local changes to Automerge documents")
|
|
83
47
|
.argument("[path]", "Directory path to commit (default: current directory)", ".")
|
|
84
|
-
.
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
Examples:
|
|
88
|
-
pushwork commit # Commit changes in current directory
|
|
89
|
-
pushwork commit ./my-folder # Commit changes in specific directory
|
|
90
|
-
pushwork commit --dry-run # Preview what would be committed`)
|
|
91
|
-
.action(withErrorHandling(async (path, cmdOptions) => {
|
|
92
|
-
await (0, commands_1.commit)(path, {
|
|
93
|
-
dryRun: cmdOptions.dryRun || false,
|
|
94
|
-
debug: cmdOptions.debug || false,
|
|
95
|
-
});
|
|
96
|
-
}));
|
|
48
|
+
.action(async (path, _opts) => {
|
|
49
|
+
await (0, commands_1.commit)(path);
|
|
50
|
+
});
|
|
97
51
|
// Sync command
|
|
98
52
|
program
|
|
99
53
|
.command("sync")
|
|
100
|
-
.
|
|
54
|
+
.summary("Run full bidirectional synchronization")
|
|
101
55
|
.argument("[path]", "Directory path to sync (default: current directory)", ".")
|
|
102
|
-
.option("--dry-run", "Show what would be done without applying changes")
|
|
103
|
-
.option("-v, --verbose", "Verbose output")
|
|
104
|
-
.
|
|
105
|
-
.addHelpText("after", `
|
|
106
|
-
Examples:
|
|
107
|
-
pushwork sync # Sync current directory
|
|
108
|
-
pushwork sync ./my-folder # Sync specific directory
|
|
109
|
-
pushwork sync --dry-run # Preview changes without applying
|
|
110
|
-
pushwork sync -v # Sync with verbose output
|
|
111
|
-
pushwork sync --debug # Show performance breakdown`)
|
|
112
|
-
.action(withErrorHandling(async (path, cmdOptions) => {
|
|
56
|
+
.option("--dry-run", "Show what would be done without applying changes", false)
|
|
57
|
+
.option("-v, --verbose", "Verbose output", false)
|
|
58
|
+
.action(async (path, opts) => {
|
|
113
59
|
await (0, commands_1.sync)(path, {
|
|
114
|
-
dryRun:
|
|
115
|
-
verbose:
|
|
116
|
-
debug: cmdOptions.debug || false,
|
|
60
|
+
dryRun: opts.dryRun,
|
|
61
|
+
verbose: opts.verbose,
|
|
117
62
|
});
|
|
118
|
-
})
|
|
63
|
+
});
|
|
119
64
|
// Diff command
|
|
120
65
|
program
|
|
121
66
|
.command("diff")
|
|
122
|
-
.
|
|
67
|
+
.summary("Show changes in working directory")
|
|
123
68
|
.argument("[path]", "Limit diff to specific path (default: current directory)", ".")
|
|
124
|
-
.option("--
|
|
125
|
-
.
|
|
126
|
-
.addHelpText("after", `
|
|
127
|
-
Examples:
|
|
128
|
-
pushwork diff # Show all changes
|
|
129
|
-
pushwork diff ./src # Show changes in src directory
|
|
130
|
-
pushwork diff --name-only # List changed files only
|
|
131
|
-
pushwork diff --tool meld # Use external diff tool`)
|
|
132
|
-
.action(withErrorHandling(async (path, options) => {
|
|
69
|
+
.option("--name-only", "Show only changed file names", false)
|
|
70
|
+
.action(async (path, opts) => {
|
|
133
71
|
await (0, commands_1.diff)(path, {
|
|
134
|
-
|
|
135
|
-
nameOnly: options.nameOnly || false,
|
|
136
|
-
dryRun: false,
|
|
137
|
-
verbose: false,
|
|
72
|
+
nameOnly: opts.nameOnly,
|
|
138
73
|
});
|
|
139
|
-
})
|
|
74
|
+
});
|
|
140
75
|
// Status command
|
|
141
76
|
program
|
|
142
77
|
.command("status")
|
|
143
|
-
.
|
|
78
|
+
.summary("Show sync status summary")
|
|
144
79
|
.argument("[path]", "Directory path (default: current directory)", ".")
|
|
145
|
-
.option("--
|
|
146
|
-
.
|
|
147
|
-
Examples:
|
|
148
|
-
pushwork status # Show status for current directory
|
|
149
|
-
pushwork status ./my-folder # Show status for specific directory`)
|
|
150
|
-
.action(withErrorHandling(async (path, cmdOptions) => {
|
|
80
|
+
.option("-v, --verbose", "Show detailed status including document info and all tracked files", false)
|
|
81
|
+
.action(async (path, opts) => {
|
|
151
82
|
await (0, commands_1.status)(path, {
|
|
152
|
-
|
|
83
|
+
verbose: opts.verbose,
|
|
153
84
|
});
|
|
154
|
-
})
|
|
85
|
+
});
|
|
155
86
|
// Log command
|
|
156
87
|
program
|
|
157
88
|
.command("log")
|
|
158
|
-
.
|
|
89
|
+
.summary("Show sync history (experimental)")
|
|
159
90
|
.argument("[path]", "Show history for specific file or directory (default: current directory)", ".")
|
|
160
|
-
.option("--oneline", "Compact one-line per sync format")
|
|
91
|
+
.option("--oneline", "Compact one-line per sync format", false)
|
|
161
92
|
.option("--since <date>", "Show syncs since date")
|
|
162
93
|
.option("--limit <n>", "Limit number of syncs shown", "10")
|
|
163
|
-
.
|
|
164
|
-
Examples:
|
|
165
|
-
pushwork log # Show recent sync history
|
|
166
|
-
pushwork log --limit 20 # Show last 20 syncs
|
|
167
|
-
pushwork log --oneline # Compact format
|
|
168
|
-
|
|
169
|
-
Note: This command is experimental and shows limited history.`)
|
|
170
|
-
.action(withErrorHandling(async (path, options) => {
|
|
94
|
+
.action(async (path, opts) => {
|
|
171
95
|
await (0, commands_1.log)(path, {
|
|
172
|
-
oneline:
|
|
173
|
-
since:
|
|
174
|
-
limit: parseInt(
|
|
175
|
-
dryRun: false,
|
|
176
|
-
verbose: false,
|
|
96
|
+
oneline: opts.oneline,
|
|
97
|
+
since: opts.since,
|
|
98
|
+
limit: parseInt(opts.limit),
|
|
177
99
|
});
|
|
178
|
-
})
|
|
100
|
+
});
|
|
179
101
|
// Checkout command
|
|
180
102
|
program
|
|
181
103
|
.command("checkout")
|
|
182
|
-
.
|
|
104
|
+
.summary("Restore to previous sync (experimental)")
|
|
183
105
|
.argument("<sync-id>", "Sync ID to restore to")
|
|
184
106
|
.argument("[path]", "Specific path to restore (default: current directory)", ".")
|
|
185
|
-
.option("-f, --force", "Force checkout even if there are uncommitted changes")
|
|
186
|
-
.
|
|
187
|
-
Examples:
|
|
188
|
-
pushwork checkout abc123 # Restore to sync abc123
|
|
189
|
-
pushwork checkout abc123 -f # Force restore
|
|
190
|
-
|
|
191
|
-
Note: This command is experimental and not fully implemented yet.`)
|
|
192
|
-
.action(withErrorHandling(async (syncId, path, options) => {
|
|
107
|
+
.option("-f, --force", "Force checkout even if there are uncommitted changes", false)
|
|
108
|
+
.action(async (syncId, path, opts) => {
|
|
193
109
|
await (0, commands_1.checkout)(syncId, path, {
|
|
194
|
-
force:
|
|
195
|
-
dryRun: false,
|
|
196
|
-
verbose: false,
|
|
110
|
+
force: opts.force,
|
|
197
111
|
});
|
|
198
|
-
})
|
|
112
|
+
});
|
|
199
113
|
// URL command
|
|
200
114
|
program
|
|
201
115
|
.command("url")
|
|
202
|
-
.
|
|
203
|
-
.argument("[path]", "Directory path", ".")
|
|
204
|
-
.
|
|
205
|
-
Examples:
|
|
206
|
-
pushwork url # Show URL for current directory
|
|
207
|
-
pushwork url ./repo # Show URL for specific directory
|
|
208
|
-
|
|
209
|
-
Note: This command outputs only the URL, making it useful for scripts.`)
|
|
210
|
-
.action(withErrorHandling(async (path) => {
|
|
116
|
+
.summary("Show the Automerge root URL")
|
|
117
|
+
.argument("[path]", "Directory path (default: current directory)", ".")
|
|
118
|
+
.action(async (path) => {
|
|
211
119
|
await (0, commands_1.url)(path);
|
|
212
|
-
})
|
|
213
|
-
//
|
|
120
|
+
});
|
|
121
|
+
// Remove command
|
|
214
122
|
program
|
|
215
|
-
.command("
|
|
216
|
-
.
|
|
123
|
+
.command("rm")
|
|
124
|
+
.summary("Remove local pushwork data")
|
|
217
125
|
.argument("[path]", "Directory path (default: current directory)", ".")
|
|
218
|
-
.
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
pushwork debug # Show debug info for current directory
|
|
222
|
-
pushwork debug --verbose # Show verbose debug info including full document contents
|
|
223
|
-
pushwork debug ./repo # Show debug info for specific directory
|
|
224
|
-
|
|
225
|
-
This command displays internal document state, including the lastSyncAt timestamp
|
|
226
|
-
that gets updated when sync operations make changes.`)
|
|
227
|
-
.action(withErrorHandling(async (path, options) => {
|
|
228
|
-
await (0, commands_1.debug)(path, {
|
|
229
|
-
verbose: options.verbose || false,
|
|
230
|
-
});
|
|
231
|
-
}));
|
|
126
|
+
.action(async (path) => {
|
|
127
|
+
await (0, commands_1.rm)(path);
|
|
128
|
+
});
|
|
232
129
|
// List command
|
|
233
130
|
program
|
|
234
131
|
.command("ls")
|
|
235
|
-
.
|
|
132
|
+
.summary("List tracked files")
|
|
236
133
|
.argument("[path]", "Directory path (default: current directory)", ".")
|
|
237
|
-
.option("-
|
|
238
|
-
.
|
|
239
|
-
.addHelpText("after", `
|
|
240
|
-
Examples:
|
|
241
|
-
pushwork ls # List all tracked files
|
|
242
|
-
pushwork ls -l # List with Automerge URLs
|
|
243
|
-
pushwork ls ./my-folder # List files in specific directory`)
|
|
244
|
-
.action(withErrorHandling(async (path, cmdOptions) => {
|
|
134
|
+
.option("-v, --verbose", "Show with Automerge URLs", false)
|
|
135
|
+
.action(async (path, opts) => {
|
|
245
136
|
await (0, commands_1.ls)(path, {
|
|
246
|
-
|
|
247
|
-
debug: cmdOptions.debug || false,
|
|
137
|
+
verbose: opts.verbose,
|
|
248
138
|
});
|
|
249
|
-
})
|
|
139
|
+
});
|
|
250
140
|
// Config command
|
|
251
141
|
program
|
|
252
142
|
.command("config")
|
|
253
|
-
.
|
|
143
|
+
.summary("View or edit configuration")
|
|
254
144
|
.argument("[path]", "Directory path (default: current directory)", ".")
|
|
255
|
-
.option("--list", "Show full configuration")
|
|
256
|
-
.option("--get <key>", "Get specific config value (dot notation, e.g., sync.
|
|
257
|
-
.
|
|
258
|
-
.addHelpText("after", `
|
|
259
|
-
Examples:
|
|
260
|
-
pushwork config # Show basic configuration
|
|
261
|
-
pushwork config --list # Show full configuration as JSON
|
|
262
|
-
pushwork config --get sync_server # Get specific config value
|
|
263
|
-
pushwork config --get defaults.exclude_patterns # Get nested value`)
|
|
264
|
-
.action(withErrorHandling(async (path, cmdOptions) => {
|
|
145
|
+
.option("--list", "Show full configuration", false)
|
|
146
|
+
.option("--get <key>", "Get specific config value (dot notation, e.g., sync.move_detection_threshold)")
|
|
147
|
+
.action(async (path, opts) => {
|
|
265
148
|
await (0, commands_1.config)(path, {
|
|
266
|
-
list:
|
|
267
|
-
get:
|
|
268
|
-
debug: cmdOptions.debug || false,
|
|
149
|
+
list: opts.list,
|
|
150
|
+
get: opts.get,
|
|
269
151
|
});
|
|
270
|
-
}));
|
|
271
|
-
// Global error handler
|
|
272
|
-
process.on("unhandledRejection", (reason, promise) => {
|
|
273
|
-
console.error(chalk_1.default.red("Unhandled Rejection at:"), promise, chalk_1.default.red("reason:"), reason);
|
|
274
|
-
process.exit(1);
|
|
275
152
|
});
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
153
|
+
// Watch command
|
|
154
|
+
program
|
|
155
|
+
.command("watch")
|
|
156
|
+
.summary("Watch directory for changes, build, and sync")
|
|
157
|
+
.argument("[path]", "Directory path to sync (default: current directory)", ".")
|
|
158
|
+
.option("--script <command>", "Build script to run before syncing", "pnpm build")
|
|
159
|
+
.option("--dir <dir>", "Directory to watch for changes (relative to working directory)", "src")
|
|
160
|
+
.option("-v, --verbose", "Show build script output", false)
|
|
161
|
+
.action(async (path, opts) => {
|
|
162
|
+
await (0, commands_1.watch)(path, {
|
|
163
|
+
script: opts.script,
|
|
164
|
+
watchDir: opts.dir,
|
|
165
|
+
verbose: opts.verbose,
|
|
166
|
+
});
|
|
167
|
+
});
|
|
168
|
+
// Completion command (hidden from help)
|
|
169
|
+
program.command("completion", { hidden: true }).action(() => {
|
|
170
|
+
// Generate completion dynamically from registered commands
|
|
171
|
+
const commands = program.commands
|
|
172
|
+
.filter((cmd) => cmd.name() !== "completion") // Exclude self
|
|
173
|
+
.map((cmd) => {
|
|
174
|
+
const name = cmd.name();
|
|
175
|
+
const desc = (cmd.summary() || cmd.description() || "").replace(/'/g, "\\'");
|
|
176
|
+
return `'${name}:${desc}'`;
|
|
177
|
+
})
|
|
178
|
+
.join(" ");
|
|
179
|
+
// Generate option completions for each command
|
|
180
|
+
const commandCases = program.commands
|
|
181
|
+
.filter((cmd) => cmd.name() !== "completion")
|
|
182
|
+
.map((cmd) => {
|
|
183
|
+
const options = cmd.options
|
|
184
|
+
.filter((opt) => opt.flags !== "-h, --help") // Exclude help
|
|
185
|
+
.map((opt) => {
|
|
186
|
+
// Parse flags like "-v, --verbose" or "--dry-run"
|
|
187
|
+
const flags = opt.flags.split(",").map((f) => f.trim());
|
|
188
|
+
const desc = (opt.description || "")
|
|
189
|
+
.replace(/'/g, "\\'")
|
|
190
|
+
.replace(/\n/g, " ");
|
|
191
|
+
// For options with arguments like "--sync-server <url>"
|
|
192
|
+
// Extract just the flag part
|
|
193
|
+
const cleanFlags = flags.map((f) => f.split(/\s+/)[0]);
|
|
194
|
+
if (cleanFlags.length > 1) {
|
|
195
|
+
// Multiple flags (short and long): '(-v --verbose)'{-v,--verbose}'[description]'
|
|
196
|
+
const short = cleanFlags[0];
|
|
197
|
+
const long = cleanFlags[1];
|
|
198
|
+
return `'(${short} ${long})'{${short},${long}}'[${desc}]'`;
|
|
199
|
+
}
|
|
200
|
+
else {
|
|
201
|
+
// Single flag: '--flag[description]'
|
|
202
|
+
return `'${cleanFlags[0]}[${desc}]'`;
|
|
203
|
+
}
|
|
204
|
+
})
|
|
205
|
+
.join(" \\\n ");
|
|
206
|
+
return options
|
|
207
|
+
? ` ${cmd.name()})
|
|
208
|
+
_arguments \\
|
|
209
|
+
${options}
|
|
210
|
+
;;`
|
|
211
|
+
: "";
|
|
212
|
+
})
|
|
213
|
+
.filter(Boolean)
|
|
214
|
+
.join("\n");
|
|
215
|
+
const completionScript = `
|
|
216
|
+
# pushwork completion for zsh
|
|
217
|
+
_pushwork() {
|
|
218
|
+
local -a commands
|
|
219
|
+
commands=(${commands})
|
|
220
|
+
|
|
221
|
+
_arguments -C \\
|
|
222
|
+
'1: :->command' \\
|
|
223
|
+
'*::arg:->args'
|
|
224
|
+
|
|
225
|
+
case $state in
|
|
226
|
+
command)
|
|
227
|
+
_describe 'command' commands
|
|
228
|
+
;;
|
|
229
|
+
args)
|
|
230
|
+
case $words[1] in
|
|
231
|
+
${commandCases}
|
|
232
|
+
esac
|
|
233
|
+
;;
|
|
234
|
+
esac
|
|
235
|
+
}
|
|
236
|
+
|
|
237
|
+
compdef _pushwork pushwork
|
|
238
|
+
`.trim();
|
|
239
|
+
console.log(completionScript);
|
|
240
|
+
});
|
|
241
|
+
// Helper to validate and extract sync server options
|
|
242
|
+
function validateSyncServer(syncServerOpt) {
|
|
243
|
+
if (!syncServerOpt) {
|
|
244
|
+
return [undefined, undefined];
|
|
245
|
+
}
|
|
246
|
+
if (syncServerOpt.length < 2) {
|
|
247
|
+
console.error(chalk_1.default.red("Error: --sync-server requires both URL and storage ID"));
|
|
248
|
+
process.exit(1);
|
|
249
|
+
}
|
|
250
|
+
const [syncServer, syncServerStorageId] = syncServerOpt;
|
|
251
|
+
return [syncServer, syncServerStorageId];
|
|
252
|
+
}
|
|
253
|
+
process.on("unhandledRejection", (error) => {
|
|
254
|
+
console.log(chalk_1.default.bgRed.white(" ERROR "));
|
|
255
|
+
if (error instanceof Error && error.stack) {
|
|
256
|
+
console.log(chalk_1.default.red(error.stack));
|
|
257
|
+
}
|
|
258
|
+
else {
|
|
259
|
+
console.error(chalk_1.default.red(error));
|
|
284
260
|
}
|
|
285
|
-
console.error(chalk_1.default.red("Uncaught Exception:"), error);
|
|
286
261
|
process.exit(1);
|
|
287
262
|
});
|
|
288
|
-
//
|
|
289
|
-
program
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
263
|
+
// Configure help colors using Commander v13's built-in color support
|
|
264
|
+
program
|
|
265
|
+
.configureHelp({
|
|
266
|
+
styleTitle: (str) => chalk_1.default.bold(str),
|
|
267
|
+
styleCommandText: (str) => chalk_1.default.white(str),
|
|
268
|
+
styleCommandDescription: (str) => chalk_1.default.dim(str),
|
|
269
|
+
styleOptionText: (str) => chalk_1.default.green(str),
|
|
270
|
+
styleArgumentText: (str) => chalk_1.default.cyan(str),
|
|
271
|
+
subcommandTerm: (cmd) => {
|
|
272
|
+
const opts = cmd.options
|
|
273
|
+
.filter((opt) => opt.flags !== "-h, --help")
|
|
274
|
+
.map((opt) => opt.short || opt.long)
|
|
275
|
+
.join(", ");
|
|
276
|
+
const name = chalk_1.default.white(cmd.name());
|
|
277
|
+
const args = cmd.registeredArguments
|
|
278
|
+
.map((arg) => arg.required
|
|
279
|
+
? chalk_1.default.cyan(`<${arg.name()}>`)
|
|
280
|
+
: chalk_1.default.dim(`[${arg.name()}]`))
|
|
281
|
+
.join(" ");
|
|
282
|
+
return [name, args, opts && chalk_1.default.dim(`[${opts}]`)]
|
|
283
|
+
.filter(Boolean)
|
|
284
|
+
.join(" ");
|
|
285
|
+
},
|
|
286
|
+
})
|
|
287
|
+
.addHelpText("after", chalk_1.default.dim('\nEnable tab completion by adding this to your ~/.zshrc:\neval "$(pushwork completion)"'));
|
|
288
|
+
program.parseAsync();
|
|
294
289
|
//# sourceMappingURL=cli.js.map
|
package/dist/cli.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cli.js","sourceRoot":"","sources":["../src/cli.ts"],"names":[],"mappings":";;;;;;
|
|
1
|
+
{"version":3,"file":"cli.js","sourceRoot":"","sources":["../src/cli.ts"],"names":[],"mappings":";;;;;;AAGA,+DAAsD;AACtD,kDAA0B;AAC1B,yCAcoB;AAEpB,MAAM,OAAO,GAAG,OAAO,CAAC,iBAAiB,CAAC,CAAC,OAAO,CAAC;AACnD,MAAM,OAAO,GAAG,IAAI,uBAAO,EAAE;KAC1B,IAAI,CAAC,UAAU,CAAC;KAChB,WAAW,CAAC,+DAA+D,CAAC;KAC5E,OAAO,CAAC,OAAO,EAAE,eAAe,EAAE,2BAA2B,CAAC,CAAC;AAElE,eAAe;AACf,OAAO;KACJ,OAAO,CAAC,MAAM,CAAC;KACf,OAAO,CAAC,gCAAgC,CAAC;KACzC,QAAQ,CACP,QAAQ,EACR,2DAA2D,EAC3D,GAAG,CACJ;KACA,MAAM,CACL,qCAAqC,EACrC,uCAAuC,CACxC;KACA,MAAM,CAAC,KAAK,EAAE,IAAI,EAAE,IAAI,EAAE,EAAE;IAC3B,MAAM,CAAC,UAAU,EAAE,mBAAmB,CAAC,GAAG,kBAAkB,CAC1D,IAAI,CAAC,UAAU,CAChB,CAAC;IACF,MAAM,IAAA,eAAI,EAAC,IAAI,EAAE,EAAE,UAAU,EAAE,mBAAmB,EAAE,CAAC,CAAC;AACxD,CAAC,CAAC,CAAC;AAEL,gBAAgB;AAChB,OAAO;KACJ,OAAO,CAAC,OAAO,CAAC;KAChB,OAAO,CAAC,oCAAoC,CAAC;KAC7C,QAAQ,CACP,OAAO,EACP,mEAAmE,CACpE;KACA,QAAQ,CAAC,QAAQ,EAAE,uBAAuB,CAAC;KAC3C,MAAM,CAAC,aAAa,EAAE,8BAA8B,EAAE,KAAK,CA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./types";
|
|
2
|
+
/**
|
|
3
|
+
* Initialize sync in a directory
|
|
4
|
+
*/
|
|
5
|
+
export declare function init(targetPath: string, options?: InitOptions): Promise<void>;
|
|
6
|
+
/**
|
|
7
|
+
* Run bidirectional sync
|
|
8
|
+
*/
|
|
9
|
+
export declare function sync(targetPath: string | undefined, options: SyncOptions): Promise<void>;
|
|
10
|
+
/**
|
|
11
|
+
* Show differences between local and remote
|
|
12
|
+
*/
|
|
13
|
+
export declare function diff(targetPath: string | undefined, options: DiffOptions): Promise<void>;
|
|
14
|
+
/**
|
|
15
|
+
* Show sync status
|
|
16
|
+
*/
|
|
17
|
+
export declare function status(targetPath?: string, options?: StatusOptions): Promise<void>;
|
|
18
|
+
/**
|
|
19
|
+
* Show sync history
|
|
20
|
+
*/
|
|
21
|
+
export declare function log(targetPath: string | undefined, _options: LogOptions): Promise<void>;
|
|
22
|
+
/**
|
|
23
|
+
* Checkout/restore from previous sync
|
|
24
|
+
*/
|
|
25
|
+
export declare function checkout(syncId: string, targetPath: string | undefined, _options: CheckoutOptions): Promise<void>;
|
|
26
|
+
/**
|
|
27
|
+
* Clone an existing synced directory from an AutomergeUrl
|
|
28
|
+
*/
|
|
29
|
+
export declare function clone(rootUrl: string, targetPath: string, options: CloneOptions): Promise<void>;
|
|
30
|
+
/**
|
|
31
|
+
* Get the root URL for the current pushwork repository
|
|
32
|
+
*/
|
|
33
|
+
export declare function url(targetPath?: string): Promise<void>;
|
|
34
|
+
/**
|
|
35
|
+
* Remove local pushwork data and log URL for recovery
|
|
36
|
+
*/
|
|
37
|
+
export declare function rm(targetPath?: string): Promise<void>;
|
|
38
|
+
export declare function commit(targetPath: string, _options?: CommandOptions): Promise<void>;
|
|
39
|
+
/**
|
|
40
|
+
* List tracked files
|
|
41
|
+
*/
|
|
42
|
+
export declare function ls(targetPath?: string, options?: CommandOptions): Promise<void>;
|
|
43
|
+
/**
|
|
44
|
+
* View or edit configuration
|
|
45
|
+
*/
|
|
46
|
+
export declare function config(targetPath?: string, options?: ConfigOptions): Promise<void>;
|
|
47
|
+
/**
|
|
48
|
+
* Watch a directory and sync after build script completes
|
|
49
|
+
*/
|
|
50
|
+
export declare function watch(targetPath?: string, options?: WatchOptions): Promise<void>;
|
|
51
|
+
//# sourceMappingURL=commands.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"commands.d.ts","sourceRoot":"","sources":["../src/commands.ts"],"names":[],"mappings":"AAMA,OAAO,EACL,YAAY,EACZ,WAAW,EACX,WAAW,EACX,UAAU,EACV,eAAe,EACf,WAAW,EACX,aAAa,EACb,aAAa,EACb,YAAY,EAGZ,cAAc,EACf,MAAM,SAAS,CAAC;AAwHjB;;GAEG;AACH,wBAAsB,IAAI,CACxB,UAAU,EAAE,MAAM,EAClB,OAAO,GAAE,WAAgB,GACxB,OAAO,CAAC,IAAI,CAAC,CA2Df;AAED;;GAEG;AACH,wBAAsB,IAAI,CACxB,UAAU,oBAAM,EAChB,OAAO,EAAE,WAAW,GACnB,OAAO,CAAC,IAAI,CAAC,CAiGf;AAED;;GAEG;AACH,wBAAsB,IAAI,CACxB,UAAU,oBAAM,EAChB,OAAO,EAAE,WAAW,GACnB,OAAO,CAAC,IAAI,CAAC,CAgGf;AAED;;GAEG;AACH,wBAAsB,MAAM,CAC1B,UAAU,GAAE,MAAY,EACxB,OAAO,GAAE,aAAkB,GAC1B,OAAO,CAAC,IAAI,CAAC,CAyEf;AAED;;GAEG;AACH,wBAAsB,GAAG,CACvB,UAAU,oBAAM,EAChB,QAAQ,EAAE,UAAU,GACnB,OAAO,CAAC,IAAI,CAAC,CAqBf;AAED;;GAEG;AACH,wBAAsB,QAAQ,CAC5B,MAAM,EAAE,MAAM,EACd,UAAU,oBAAM,EAChB,QAAQ,EAAE,eAAe,GACxB,OAAO,CAAC,IAAI,CAAC,CASf;AAED;;GAEG;AACH,wBAAsB,KAAK,CACzB,OAAO,EAAE,MAAM,EACf,UAAU,EAAE,MAAM,EAClB,OAAO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