pushwork 1.0.0 → 1.0.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/README.md +23 -21
- package/dist/cli/commands.d.ts +6 -0
- package/dist/cli/commands.d.ts.map +1 -1
- package/dist/cli/commands.js +114 -4
- package/dist/cli/commands.js.map +1 -1
- package/dist/cli.js +27 -0
- package/dist/cli.js.map +1 -1
- package/dist/core/change-detection.d.ts.map +1 -1
- package/dist/core/change-detection.js +27 -9
- package/dist/core/change-detection.js.map +1 -1
- package/dist/core/move-detection.d.ts.map +1 -1
- package/dist/core/move-detection.js +8 -2
- package/dist/core/move-detection.js.map +1 -1
- package/dist/core/sync-engine.d.ts +4 -0
- package/dist/core/sync-engine.d.ts.map +1 -1
- package/dist/core/sync-engine.js +263 -7
- package/dist/core/sync-engine.js.map +1 -1
- package/dist/types/documents.d.ts +2 -0
- package/dist/types/documents.d.ts.map +1 -1
- package/dist/types/documents.js.map +1 -1
- package/dist/utils/fs.d.ts.map +1 -1
- package/dist/utils/fs.js +7 -1
- package/dist/utils/fs.js.map +1 -1
- package/dist/utils/network-sync.d.ts.map +1 -1
- package/dist/utils/network-sync.js +16 -3
- package/dist/utils/network-sync.js.map +1 -1
- package/package.json +30 -30
- package/src/cli/commands.ts +162 -8
- package/src/cli.ts +40 -0
- package/src/core/change-detection.ts +25 -12
- package/src/core/move-detection.ts +8 -2
- package/src/core/sync-engine.ts +270 -7
- package/src/types/documents.ts +2 -0
- package/src/utils/fs.ts +7 -3
- package/src/utils/network-sync.ts +19 -3
- package/test/integration/clone-test.sh +0 -0
- package/test/integration/conflict-resolution-test.sh +0 -0
- package/test/integration/debug-both-nested.sh +74 -0
- package/test/integration/debug-concurrent-nested.sh +87 -0
- package/test/integration/debug-nested.sh +73 -0
- package/test/integration/deletion-behavior-test.sh +0 -0
- package/test/integration/deletion-sync-test-simple.sh +0 -0
- package/test/integration/deletion-sync-test.sh +0 -0
- package/test/integration/full-integration-test.sh +0 -0
- package/test/integration/fuzzer.test.ts +865 -0
- package/test/integration/manual-sync-test.sh +84 -0
- package/test/run-tests.sh +0 -0
- package/test/unit/sync-convergence.test.ts +493 -0
- package/tools/browser-sync/README.md +0 -116
- package/tools/browser-sync/package.json +0 -44
- package/tools/browser-sync/patchwork.json +0 -1
- package/tools/browser-sync/pnpm-lock.yaml +0 -4202
- package/tools/browser-sync/src/components/BrowserSyncTool.tsx +0 -599
- package/tools/browser-sync/src/index.ts +0 -20
- package/tools/browser-sync/src/polyfills.ts +0 -31
- package/tools/browser-sync/src/styles.css +0 -290
- package/tools/browser-sync/src/types.ts +0 -27
- package/tools/browser-sync/vite.config.ts +0 -25
|
@@ -1,290 +0,0 @@
|
|
|
1
|
-
/* Browser Sync Tool Styles */
|
|
2
|
-
.browser-sync-tool {
|
|
3
|
-
display: flex;
|
|
4
|
-
flex-direction: column;
|
|
5
|
-
height: 100%;
|
|
6
|
-
background: #ffffff;
|
|
7
|
-
}
|
|
8
|
-
|
|
9
|
-
.browser-sync-header {
|
|
10
|
-
padding: 1rem;
|
|
11
|
-
border-bottom: 1px solid #e5e7eb;
|
|
12
|
-
background: #f9fafb;
|
|
13
|
-
}
|
|
14
|
-
|
|
15
|
-
.browser-sync-title {
|
|
16
|
-
font-size: 1.25rem;
|
|
17
|
-
font-weight: 600;
|
|
18
|
-
color: #111827;
|
|
19
|
-
margin: 0 0 0.5rem 0;
|
|
20
|
-
}
|
|
21
|
-
|
|
22
|
-
.browser-sync-subtitle {
|
|
23
|
-
font-size: 0.875rem;
|
|
24
|
-
color: #6b7280;
|
|
25
|
-
margin: 0;
|
|
26
|
-
}
|
|
27
|
-
|
|
28
|
-
.browser-sync-content {
|
|
29
|
-
flex: 1;
|
|
30
|
-
display: flex;
|
|
31
|
-
flex-direction: column;
|
|
32
|
-
overflow: hidden;
|
|
33
|
-
}
|
|
34
|
-
|
|
35
|
-
.browser-sync-main {
|
|
36
|
-
flex: 1;
|
|
37
|
-
padding: 1rem;
|
|
38
|
-
overflow-y: auto;
|
|
39
|
-
}
|
|
40
|
-
|
|
41
|
-
.status-card {
|
|
42
|
-
background: #ffffff;
|
|
43
|
-
border: 1px solid #e5e7eb;
|
|
44
|
-
border-radius: 0.5rem;
|
|
45
|
-
padding: 1rem;
|
|
46
|
-
margin-bottom: 1rem;
|
|
47
|
-
}
|
|
48
|
-
|
|
49
|
-
.status-header {
|
|
50
|
-
display: flex;
|
|
51
|
-
align-items: center;
|
|
52
|
-
gap: 0.5rem;
|
|
53
|
-
margin-bottom: 0.75rem;
|
|
54
|
-
}
|
|
55
|
-
|
|
56
|
-
.status-title {
|
|
57
|
-
font-weight: 500;
|
|
58
|
-
color: #111827;
|
|
59
|
-
}
|
|
60
|
-
|
|
61
|
-
.status-indicator {
|
|
62
|
-
width: 8px;
|
|
63
|
-
height: 8px;
|
|
64
|
-
border-radius: 50%;
|
|
65
|
-
}
|
|
66
|
-
|
|
67
|
-
.status-indicator.connected {
|
|
68
|
-
background: #10b981;
|
|
69
|
-
}
|
|
70
|
-
|
|
71
|
-
.status-indicator.disconnected {
|
|
72
|
-
background: #ef4444;
|
|
73
|
-
}
|
|
74
|
-
|
|
75
|
-
.status-indicator.pending {
|
|
76
|
-
background: #f59e0b;
|
|
77
|
-
}
|
|
78
|
-
|
|
79
|
-
.button {
|
|
80
|
-
display: inline-flex;
|
|
81
|
-
align-items: center;
|
|
82
|
-
gap: 0.5rem;
|
|
83
|
-
padding: 0.5rem 1rem;
|
|
84
|
-
border: 1px solid #d1d5db;
|
|
85
|
-
border-radius: 0.375rem;
|
|
86
|
-
background: #ffffff;
|
|
87
|
-
color: #374151;
|
|
88
|
-
font-size: 0.875rem;
|
|
89
|
-
font-weight: 500;
|
|
90
|
-
cursor: pointer;
|
|
91
|
-
transition: all 0.2s;
|
|
92
|
-
}
|
|
93
|
-
|
|
94
|
-
.button:hover {
|
|
95
|
-
background: #f3f4f6;
|
|
96
|
-
border-color: #9ca3af;
|
|
97
|
-
}
|
|
98
|
-
|
|
99
|
-
.button:disabled {
|
|
100
|
-
opacity: 0.5;
|
|
101
|
-
cursor: not-allowed;
|
|
102
|
-
}
|
|
103
|
-
|
|
104
|
-
.button.primary {
|
|
105
|
-
background: #2563eb;
|
|
106
|
-
border-color: #2563eb;
|
|
107
|
-
color: #ffffff;
|
|
108
|
-
}
|
|
109
|
-
|
|
110
|
-
.button.primary:hover {
|
|
111
|
-
background: #1d4ed8;
|
|
112
|
-
border-color: #1d4ed8;
|
|
113
|
-
}
|
|
114
|
-
|
|
115
|
-
.button.danger {
|
|
116
|
-
background: #dc2626;
|
|
117
|
-
border-color: #dc2626;
|
|
118
|
-
color: #ffffff;
|
|
119
|
-
}
|
|
120
|
-
|
|
121
|
-
.button.danger:hover {
|
|
122
|
-
background: #b91c1c;
|
|
123
|
-
border-color: #b91c1c;
|
|
124
|
-
}
|
|
125
|
-
|
|
126
|
-
.file-list {
|
|
127
|
-
border: 1px solid #e5e7eb;
|
|
128
|
-
border-radius: 0.375rem;
|
|
129
|
-
max-height: 200px;
|
|
130
|
-
overflow-y: auto;
|
|
131
|
-
}
|
|
132
|
-
|
|
133
|
-
.file-item {
|
|
134
|
-
display: flex;
|
|
135
|
-
align-items: center;
|
|
136
|
-
gap: 0.5rem;
|
|
137
|
-
padding: 0.5rem;
|
|
138
|
-
border-bottom: 1px solid #f3f4f6;
|
|
139
|
-
}
|
|
140
|
-
|
|
141
|
-
.file-item:last-child {
|
|
142
|
-
border-bottom: none;
|
|
143
|
-
}
|
|
144
|
-
|
|
145
|
-
.file-icon {
|
|
146
|
-
width: 16px;
|
|
147
|
-
height: 16px;
|
|
148
|
-
color: #6b7280;
|
|
149
|
-
}
|
|
150
|
-
|
|
151
|
-
.file-name {
|
|
152
|
-
flex: 1;
|
|
153
|
-
font-size: 0.875rem;
|
|
154
|
-
color: #374151;
|
|
155
|
-
}
|
|
156
|
-
|
|
157
|
-
.file-size {
|
|
158
|
-
font-size: 0.75rem;
|
|
159
|
-
color: #9ca3af;
|
|
160
|
-
}
|
|
161
|
-
|
|
162
|
-
.empty-state {
|
|
163
|
-
display: flex;
|
|
164
|
-
flex-direction: column;
|
|
165
|
-
align-items: center;
|
|
166
|
-
justify-content: center;
|
|
167
|
-
padding: 3rem 1rem;
|
|
168
|
-
text-align: center;
|
|
169
|
-
color: #6b7280;
|
|
170
|
-
}
|
|
171
|
-
|
|
172
|
-
.empty-state-icon {
|
|
173
|
-
width: 48px;
|
|
174
|
-
height: 48px;
|
|
175
|
-
margin-bottom: 1rem;
|
|
176
|
-
color: #d1d5db;
|
|
177
|
-
}
|
|
178
|
-
|
|
179
|
-
.empty-state-title {
|
|
180
|
-
font-size: 1.125rem;
|
|
181
|
-
font-weight: 500;
|
|
182
|
-
color: #374151;
|
|
183
|
-
margin-bottom: 0.5rem;
|
|
184
|
-
}
|
|
185
|
-
|
|
186
|
-
.empty-state-description {
|
|
187
|
-
font-size: 0.875rem;
|
|
188
|
-
margin-bottom: 1.5rem;
|
|
189
|
-
}
|
|
190
|
-
|
|
191
|
-
.settings-panel {
|
|
192
|
-
border-top: 1px solid #e5e7eb;
|
|
193
|
-
padding: 1rem;
|
|
194
|
-
background: #f9fafb;
|
|
195
|
-
}
|
|
196
|
-
|
|
197
|
-
.settings-row {
|
|
198
|
-
display: flex;
|
|
199
|
-
align-items: center;
|
|
200
|
-
justify-content: space-between;
|
|
201
|
-
margin-bottom: 0.75rem;
|
|
202
|
-
}
|
|
203
|
-
|
|
204
|
-
.settings-row:last-child {
|
|
205
|
-
margin-bottom: 0;
|
|
206
|
-
}
|
|
207
|
-
|
|
208
|
-
.settings-label {
|
|
209
|
-
font-size: 0.875rem;
|
|
210
|
-
font-weight: 500;
|
|
211
|
-
color: #374151;
|
|
212
|
-
}
|
|
213
|
-
|
|
214
|
-
.toggle {
|
|
215
|
-
position: relative;
|
|
216
|
-
width: 44px;
|
|
217
|
-
height: 24px;
|
|
218
|
-
}
|
|
219
|
-
|
|
220
|
-
.toggle input {
|
|
221
|
-
opacity: 0;
|
|
222
|
-
width: 0;
|
|
223
|
-
height: 0;
|
|
224
|
-
}
|
|
225
|
-
|
|
226
|
-
.toggle-slider {
|
|
227
|
-
position: absolute;
|
|
228
|
-
cursor: pointer;
|
|
229
|
-
top: 0;
|
|
230
|
-
left: 0;
|
|
231
|
-
right: 0;
|
|
232
|
-
bottom: 0;
|
|
233
|
-
background-color: #d1d5db;
|
|
234
|
-
transition: 0.2s;
|
|
235
|
-
border-radius: 24px;
|
|
236
|
-
}
|
|
237
|
-
|
|
238
|
-
.toggle-slider:before {
|
|
239
|
-
position: absolute;
|
|
240
|
-
content: "";
|
|
241
|
-
height: 18px;
|
|
242
|
-
width: 18px;
|
|
243
|
-
left: 3px;
|
|
244
|
-
bottom: 3px;
|
|
245
|
-
background-color: white;
|
|
246
|
-
transition: 0.2s;
|
|
247
|
-
border-radius: 50%;
|
|
248
|
-
}
|
|
249
|
-
|
|
250
|
-
.toggle input:checked + .toggle-slider {
|
|
251
|
-
background-color: #2563eb;
|
|
252
|
-
}
|
|
253
|
-
|
|
254
|
-
.toggle input:checked + .toggle-slider:before {
|
|
255
|
-
transform: translateX(20px);
|
|
256
|
-
}
|
|
257
|
-
|
|
258
|
-
.sync-progress {
|
|
259
|
-
display: flex;
|
|
260
|
-
align-items: center;
|
|
261
|
-
gap: 0.5rem;
|
|
262
|
-
padding: 0.75rem;
|
|
263
|
-
background: #eff6ff;
|
|
264
|
-
border: 1px solid #bfdbfe;
|
|
265
|
-
border-radius: 0.375rem;
|
|
266
|
-
margin-bottom: 1rem;
|
|
267
|
-
}
|
|
268
|
-
|
|
269
|
-
.sync-spinner {
|
|
270
|
-
animation: spin 1s linear infinite;
|
|
271
|
-
}
|
|
272
|
-
|
|
273
|
-
@keyframes spin {
|
|
274
|
-
from {
|
|
275
|
-
transform: rotate(0deg);
|
|
276
|
-
}
|
|
277
|
-
to {
|
|
278
|
-
transform: rotate(360deg);
|
|
279
|
-
}
|
|
280
|
-
}
|
|
281
|
-
|
|
282
|
-
.error-message {
|
|
283
|
-
padding: 0.75rem;
|
|
284
|
-
background: #fef2f2;
|
|
285
|
-
border: 1px solid #fecaca;
|
|
286
|
-
border-radius: 0.375rem;
|
|
287
|
-
color: #b91c1c;
|
|
288
|
-
font-size: 0.875rem;
|
|
289
|
-
margin-bottom: 1rem;
|
|
290
|
-
}
|
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
import { AutomergeUrl } from "@automerge/automerge-repo";
|
|
2
|
-
|
|
3
|
-
export interface FolderDoc {
|
|
4
|
-
"@patchwork": { type: "folder" };
|
|
5
|
-
docs: Array<{
|
|
6
|
-
name: string;
|
|
7
|
-
type: "file" | "folder";
|
|
8
|
-
url: AutomergeUrl;
|
|
9
|
-
}>;
|
|
10
|
-
}
|
|
11
|
-
|
|
12
|
-
export interface SyncStatus {
|
|
13
|
-
isConnected: boolean;
|
|
14
|
-
hasDirectoryAccess: boolean;
|
|
15
|
-
lastSync: Date | null;
|
|
16
|
-
filesCount: number;
|
|
17
|
-
syncInProgress: boolean;
|
|
18
|
-
error: string | null;
|
|
19
|
-
}
|
|
20
|
-
|
|
21
|
-
export interface SyncSettings {
|
|
22
|
-
autoSync: boolean;
|
|
23
|
-
syncInterval: number; // in seconds
|
|
24
|
-
excludePatterns: string[];
|
|
25
|
-
syncServerUrl: string;
|
|
26
|
-
syncServerStorageId: string;
|
|
27
|
-
}
|
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
import { defineConfig } from "vite";
|
|
2
|
-
import react from "@vitejs/plugin-react";
|
|
3
|
-
import cssInjectedByJsPlugin from "vite-plugin-css-injected-by-js";
|
|
4
|
-
import topLevelAwait from "vite-plugin-top-level-await";
|
|
5
|
-
import wasm from "vite-plugin-wasm";
|
|
6
|
-
|
|
7
|
-
import { EXTERNAL_DEPENDENCIES } from "@patchwork/sdk/shared-dependencies";
|
|
8
|
-
|
|
9
|
-
export default defineConfig({
|
|
10
|
-
base: "./",
|
|
11
|
-
plugins: [topLevelAwait(), wasm(), react(), cssInjectedByJsPlugin()],
|
|
12
|
-
build: {
|
|
13
|
-
rollupOptions: {
|
|
14
|
-
external: EXTERNAL_DEPENDENCIES,
|
|
15
|
-
input: "./src/index.ts",
|
|
16
|
-
output: {
|
|
17
|
-
format: "es",
|
|
18
|
-
entryFileNames: "[name].js",
|
|
19
|
-
chunkFileNames: "assets/[name]-[hash].js",
|
|
20
|
-
assetFileNames: "assets/[name][extname]",
|
|
21
|
-
},
|
|
22
|
-
preserveEntrySignatures: "strict",
|
|
23
|
-
},
|
|
24
|
-
},
|
|
25
|
-
});
|