wuchale 0.22.9 → 0.22.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/dist/cli/check.js +3 -2
- package/dist/hub.js +9 -6
- package/package.json +1 -1
package/dist/cli/check.js
CHANGED
|
@@ -15,10 +15,11 @@ const checkErrMsgs = {
|
|
|
15
15
|
unequalLength: 'Unequal length',
|
|
16
16
|
};
|
|
17
17
|
export async function check(config, root, full) {
|
|
18
|
-
//
|
|
19
|
-
const hub = new Hub(() => config, root, 0, readOnlyFS);
|
|
18
|
+
// disable ai as this is a check, not persisted
|
|
19
|
+
const hub = new Hub(() => ({ ...config, ai: null }), root, 0, readOnlyFS);
|
|
20
20
|
await hub.init('cli');
|
|
21
21
|
const { checked, errors, syncs } = await hub.check(full);
|
|
22
|
+
// console.log because if the user invokes this command, they want full info regardless of config
|
|
22
23
|
for (const err of errors) {
|
|
23
24
|
console.error(`${color.magenta(err.adapter)}: ${color.red(checkErrMsgs[err.type])}`);
|
|
24
25
|
console.error(` ${color.grey('Source:')} ${err.source}`);
|
package/dist/hub.js
CHANGED
|
@@ -263,17 +263,20 @@ export class Hub {
|
|
|
263
263
|
}
|
|
264
264
|
return updated;
|
|
265
265
|
}
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
const handlers = Array.from(this.#handlers.values());
|
|
266
|
+
#getSortedHandlersForDirectVisit = () => {
|
|
267
|
+
const handlers = [...this.#handlers.values()];
|
|
269
268
|
// owner adapter handlers should run last for cleanup
|
|
270
269
|
handlers.sort((a, b) => {
|
|
271
270
|
const aOwner = a.sharedState.ownerKey === a.key;
|
|
272
271
|
const bOwner = b.sharedState.ownerKey === b.key;
|
|
273
272
|
return aOwner === bOwner ? 0 : aOwner ? 1 : -1;
|
|
274
273
|
});
|
|
274
|
+
return handlers;
|
|
275
|
+
};
|
|
276
|
+
async directVisit(clean, watch, sync) {
|
|
277
|
+
!watch && this.#log.info('Extracting...');
|
|
275
278
|
const existingFilesByOwner = new Map();
|
|
276
|
-
for (const handler of
|
|
279
|
+
for (const handler of this.#getSortedHandlersForDirectVisit()) {
|
|
277
280
|
await this.#directVisitHandler(handler, clean, sync, existingFilesByOwner);
|
|
278
281
|
}
|
|
279
282
|
if (!watch) {
|
|
@@ -328,9 +331,9 @@ export class Hub {
|
|
|
328
331
|
const syncs = [];
|
|
329
332
|
let checkedItems = 0;
|
|
330
333
|
const existingFilesByOwner = new Map();
|
|
331
|
-
for (const handler of this.#
|
|
334
|
+
for (const handler of this.#getSortedHandlersForDirectVisit()) {
|
|
332
335
|
const state = handler.sharedState;
|
|
333
|
-
if (full && (await this.#directVisitHandler(handler,
|
|
336
|
+
if (full && (await this.#directVisitHandler(handler, false, false, existingFilesByOwner))) {
|
|
334
337
|
syncs.push(handler.key);
|
|
335
338
|
}
|
|
336
339
|
if (state.ownerKey !== handler.key) {
|