pushwork 1.0.7 → 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/babel.config.js +5 -0
- package/dist/cli/commands.d.ts +61 -0
- package/dist/cli/commands.d.ts.map +1 -0
- package/dist/cli/commands.js +661 -0
- package/dist/cli/commands.js.map +1 -0
- package/dist/cli/index.d.ts +2 -0
- package/dist/cli/index.d.ts.map +1 -0
- package/dist/cli/index.js +19 -0
- package/dist/cli/index.js.map +1 -0
- package/dist/cli/output.d.ts +61 -0
- package/dist/cli/output.d.ts.map +1 -0
- package/dist/cli/output.js +176 -0
- package/dist/cli/output.js.map +1 -0
- package/dist/config/index.d.ts +71 -0
- package/dist/config/index.d.ts.map +1 -0
- package/dist/config/index.js +314 -0
- package/dist/config/index.js.map +1 -0
- package/dist/core/change-detection.d.ts +5 -0
- package/dist/core/change-detection.d.ts.map +1 -1
- package/dist/core/change-detection.js +36 -8
- package/dist/core/change-detection.js.map +1 -1
- package/dist/core/sync-engine.d.ts +36 -1
- package/dist/core/sync-engine.d.ts.map +1 -1
- package/dist/core/sync-engine.js +350 -90
- package/dist/core/sync-engine.js.map +1 -1
- package/dist/utils/content-similarity.d.ts +53 -0
- package/dist/utils/content-similarity.d.ts.map +1 -0
- package/dist/utils/content-similarity.js +155 -0
- package/dist/utils/content-similarity.js.map +1 -0
- package/dist/utils/directory.d.ts +15 -1
- package/dist/utils/directory.d.ts.map +1 -1
- package/dist/utils/directory.js +22 -3
- package/dist/utils/directory.js.map +1 -1
- package/dist/utils/fs.d.ts.map +1 -1
- package/dist/utils/fs.js +1 -2
- package/dist/utils/fs.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/network-sync.d.ts +16 -1
- package/dist/utils/network-sync.d.ts.map +1 -1
- package/dist/utils/network-sync.js +103 -0
- package/dist/utils/network-sync.js.map +1 -1
- package/package.json +12 -2
- package/src/core/change-detection.ts +47 -9
- package/src/core/sync-engine.ts +440 -98
- package/src/utils/directory.ts +27 -4
- package/src/utils/fs.ts +1 -2
- package/src/utils/network-sync.ts +137 -1
- package/test/integration/in-memory-sync.test.ts +435 -0
- package/test/integration/init-sync.test.ts +89 -89
- package/dist/.pushwork/automerge/3P/Dm3ekE2pmjGnWvDaG3vSR7ww98/snapshot/aa2349c94955ea561f698720142f9d884a6872d9f82dc332d578c216beb0df0e +0 -0
- package/dist/.pushwork/automerge/st/orage-adapter-id +0 -1
- package/dist/.pushwork/config.json +0 -15
- package/dist/.pushwork/snapshot.json +0 -7
package/babel.config.js
ADDED
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
import { Repo } from "@automerge/automerge-repo";
|
|
2
|
+
import { CloneOptions, SyncOptions, DiffOptions, LogOptions, CheckoutOptions, DirectoryConfig } from "../types";
|
|
3
|
+
import { SyncEngine } from "../core";
|
|
4
|
+
/**
|
|
5
|
+
* Shared context that commands can use
|
|
6
|
+
*/
|
|
7
|
+
export interface CommandContext {
|
|
8
|
+
repo: Repo;
|
|
9
|
+
syncEngine: SyncEngine;
|
|
10
|
+
config: DirectoryConfig;
|
|
11
|
+
workingDir: string;
|
|
12
|
+
}
|
|
13
|
+
/**
|
|
14
|
+
* Shared pre-action that ensures repository and sync engine are properly initialized
|
|
15
|
+
* This function always works, with or without network connectivity
|
|
16
|
+
*/
|
|
17
|
+
export declare function setupCommandContext(workingDir?: string, customSyncServer?: string, customStorageId?: string, enableNetwork?: boolean): Promise<CommandContext>;
|
|
18
|
+
/**
|
|
19
|
+
* Safely shutdown a repository with proper error handling
|
|
20
|
+
*/
|
|
21
|
+
export declare function safeRepoShutdown(repo: Repo, context?: string): Promise<void>;
|
|
22
|
+
/**
|
|
23
|
+
* Initialize sync in a directory
|
|
24
|
+
*/
|
|
25
|
+
export declare function init(targetPath: string, syncServer?: string, syncServerStorageId?: string): Promise<void>;
|
|
26
|
+
/**
|
|
27
|
+
* Run bidirectional sync
|
|
28
|
+
*/
|
|
29
|
+
export declare function sync(options: SyncOptions): Promise<void>;
|
|
30
|
+
/**
|
|
31
|
+
* Show differences between local and remote
|
|
32
|
+
*/
|
|
33
|
+
export declare function diff(targetPath: string | undefined, options: DiffOptions): Promise<void>;
|
|
34
|
+
/**
|
|
35
|
+
* Show sync status
|
|
36
|
+
*/
|
|
37
|
+
export declare function status(): Promise<void>;
|
|
38
|
+
/**
|
|
39
|
+
* Show sync history
|
|
40
|
+
*/
|
|
41
|
+
export declare function log(targetPath: string | undefined, options: LogOptions): Promise<void>;
|
|
42
|
+
/**
|
|
43
|
+
* Checkout/restore from previous sync
|
|
44
|
+
*/
|
|
45
|
+
export declare function checkout(syncId: string, targetPath: string | undefined, options: CheckoutOptions): Promise<void>;
|
|
46
|
+
/**
|
|
47
|
+
* Clone an existing synced directory from an AutomergeUrl
|
|
48
|
+
*/
|
|
49
|
+
export declare function clone(rootUrl: string, targetPath: string, options: CloneOptions): Promise<void>;
|
|
50
|
+
/**
|
|
51
|
+
* Get the root URL for the current pushwork repository
|
|
52
|
+
*/
|
|
53
|
+
export declare function url(targetPath?: string): Promise<void>;
|
|
54
|
+
export declare function commit(targetPath: string, dryRun?: boolean): Promise<void>;
|
|
55
|
+
/**
|
|
56
|
+
* Debug command to inspect internal document state
|
|
57
|
+
*/
|
|
58
|
+
export declare function debug(targetPath?: string, options?: {
|
|
59
|
+
verbose?: boolean;
|
|
60
|
+
}): Promise<void>;
|
|
61
|
+
//# sourceMappingURL=commands.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"commands.d.ts","sourceRoot":"","sources":["../../src/cli/commands.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,IAAI,EAAgB,MAAM,2BAA2B,CAAC;AAG/D,OAAO,EACL,YAAY,EACZ,WAAW,EACX,WAAW,EACX,UAAU,EACV,eAAe,EACf,eAAe,EAEhB,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