wuchale 0.22.10 → 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.
Files changed (2) hide show
  1. package/dist/hub.js +8 -5
  2. package/package.json +1 -1
package/dist/hub.js CHANGED
@@ -263,17 +263,20 @@ export class Hub {
263
263
  }
264
264
  return updated;
265
265
  }
266
- async directVisit(clean, watch, sync) {
267
- !watch && this.#log.info('Extracting...');
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 handlers) {
279
+ for (const handler of this.#getSortedHandlersForDirectVisit()) {
277
280
  await this.#directVisitHandler(handler, clean, sync, existingFilesByOwner);
278
281
  }
279
282
  if (!watch) {
@@ -328,7 +331,7 @@ export class Hub {
328
331
  const syncs = [];
329
332
  let checkedItems = 0;
330
333
  const existingFilesByOwner = new Map();
331
- for (const handler of this.#handlers.values()) {
334
+ for (const handler of this.#getSortedHandlersForDirectVisit()) {
332
335
  const state = handler.sharedState;
333
336
  if (full && (await this.#directVisitHandler(handler, false, false, existingFilesByOwner))) {
334
337
  syncs.push(handler.key);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "wuchale",
3
- "version": "0.22.10",
3
+ "version": "0.22.11",
4
4
  "description": "Protobuf-like i18n from plain code",
5
5
  "scripts": {
6
6
  "dev": "tsc --watch",