@syncbridge/common 0.13.4 → 0.13.7

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/constants.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- export declare const version = "1";
1
+ export declare const version = "0.13.7";
2
2
  export declare const CLASS_METADATA: unique symbol;
3
3
  export declare const CLASS_TYPE: unique symbol;
4
4
  export declare const VARIABLE_CONTAINER: unique symbol;
package/constants.js CHANGED
@@ -1,4 +1,4 @@
1
- export const version = '0.13.4';
1
+ export const version = '0.13.7';
2
2
  export const CLASS_METADATA = Symbol.for('CLASS_METADATA');
3
3
  export const CLASS_TYPE = Symbol.for('CLASS_TYPE');
4
4
  export const VARIABLE_CONTAINER = Symbol.for('VARIABLE_CONTAINER');
package/package.json CHANGED
@@ -1,18 +1,23 @@
1
1
  {
2
2
  "name": "@syncbridge/common",
3
- "version": "0.13.4",
3
+ "version": "0.13.7",
4
4
  "description": "SyncBridge Common utilities",
5
5
  "author": "Panates Inc",
6
6
  "license": "MIT",
7
+ "repository": {
8
+ "type": "git",
9
+ "url": "git+https://github.com/panates/syncbridge-public.git",
10
+ "directory": "packages/common"
11
+ },
7
12
  "dependencies": {
8
- "@jsopen/objects": "^2.2.3",
13
+ "@jsopen/objects": "^2.3.4",
9
14
  "fast-deep-equal": "^3.1.3",
10
15
  "node-events-async": "^1.5.2",
11
16
  "caller-callsite": "^6.0.0",
12
17
  "reflect-metadata": "^0.2.2",
13
18
  "semver": "^7.8.5",
14
- "ts-gems": "^3.12.0",
15
- "valgen": "^6.2.2"
19
+ "ts-gems": "^4.0.4",
20
+ "valgen": "^7.0.3"
16
21
  },
17
22
  "peerDependencies": {
18
23
  "@opra/common": ">=1.17.1 <2"
@@ -33,4 +38,4 @@
33
38
  "publishConfig": {
34
39
  "access": "public"
35
40
  }
36
- }
41
+ }
@@ -102,7 +102,7 @@ export class ExtensionRegistry extends AsyncEventEmitter {
102
102
  getComponent(uri, version = '*') {
103
103
  const cmp = this.findComponent(uri, version);
104
104
  if (!cmp) {
105
- throw new SbError(`Component "${uri}@${version}" not found in registry`);
105
+ throw new SbError(`Component "${uri}${version ? `:${version}` : ''}" not found in registry`);
106
106
  }
107
107
  return cmp;
108
108
  }
@@ -120,7 +120,7 @@ export class ExtensionRegistry extends AsyncEventEmitter {
120
120
  getProcessor(uri, version = '*') {
121
121
  const cmp = this.findProcessor(uri, version);
122
122
  if (!cmp) {
123
- throw new SbError(`Processor "${uri}@${version}" not found in registry`);
123
+ throw new SbError(`Processor "${uri}${version ? `:${version}` : ''}" not found in registry`);
124
124
  }
125
125
  return cmp;
126
126
  }
@@ -241,10 +241,10 @@ export class ExtensionRegistry extends AsyncEventEmitter {
241
241
  pkgVersions[i] = pkg;
242
242
  else
243
243
  pkgVersions.push(pkg);
244
- pkgVersions.sort((a, b) => a.version.localeCompare(b.version));
244
+ pkgVersions.sort((a, b) => semver.compare(b.version, a.version));
245
245
  if (pkg.components?.length) {
246
246
  for (const cmp of pkg.components) {
247
- if (this.findProcessor(cmp.uri))
247
+ if (this.findProcessor(cmp.uri, '*'))
248
248
  throw new SbError(`Component "${cmp.uri}" is already registered as a processor.`);
249
249
  /** Store to components */
250
250
  const id = uriToId(cmp.uri);
@@ -274,7 +274,7 @@ export class ExtensionRegistry extends AsyncEventEmitter {
274
274
  }
275
275
  if (pkg.processors?.length) {
276
276
  for (const prc of pkg.processors) {
277
- if (this.findComponent(prc.uri))
277
+ if (this.findComponent(prc.uri, '*'))
278
278
  throw new SbError(`Processor "${prc.uri}" is already registered as a component.`);
279
279
  /** Store to processors */
280
280
  const id = uriToId(prc.uri);
@@ -286,8 +286,10 @@ export class ExtensionRegistry extends AsyncEventEmitter {
286
286
  i = items.findIndex(v => v.version === prc.version);
287
287
  if (i >= 0)
288
288
  items[i] = prc;
289
- else
289
+ else {
290
290
  items.push(prc);
291
+ items.sort((a, b) => semver.compare(b.version, a.version));
292
+ }
291
293
  /** Store to componentsByClassName */
292
294
  items = this.processors.get(prc.className);
293
295
  if (!items) {
@@ -297,8 +299,10 @@ export class ExtensionRegistry extends AsyncEventEmitter {
297
299
  i = items.findIndex(v => v.version === prc.version);
298
300
  if (i >= 0)
299
301
  items[i] = prc;
300
- else
302
+ else {
301
303
  items.push(prc);
304
+ items.sort((a, b) => semver.compare(b.version, a.version));
305
+ }
302
306
  this.emitSafe('register-processor', prc);
303
307
  }
304
308
  }