@fjell/registry 4.4.4 → 4.4.6

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 (55) hide show
  1. package/README.md +546 -0
  2. package/dist/Coordinate.cjs +8 -5
  3. package/dist/Coordinate.d.ts +1 -1
  4. package/dist/Coordinate.js +8 -5
  5. package/dist/Instance.cjs +4 -4
  6. package/dist/Instance.d.ts +3 -4
  7. package/dist/Instance.js +4 -4
  8. package/dist/Registry.cjs +99 -90
  9. package/dist/Registry.d.ts +3 -42
  10. package/dist/Registry.js +99 -90
  11. package/dist/RegistryHub.cjs +78 -0
  12. package/dist/RegistryHub.d.ts +3 -0
  13. package/dist/RegistryHub.js +74 -0
  14. package/dist/errors/CoordinateError.cjs +70 -0
  15. package/dist/errors/CoordinateError.d.ts +28 -0
  16. package/dist/errors/CoordinateError.js +63 -0
  17. package/dist/errors/InstanceError.cjs +101 -0
  18. package/dist/errors/InstanceError.d.ts +42 -0
  19. package/dist/errors/InstanceError.js +92 -0
  20. package/dist/errors/RegistryError.cjs +82 -0
  21. package/dist/errors/RegistryError.d.ts +31 -0
  22. package/dist/errors/RegistryError.js +75 -0
  23. package/dist/errors/RegistryHubError.cjs +92 -0
  24. package/dist/errors/RegistryHubError.d.ts +39 -0
  25. package/dist/errors/RegistryHubError.js +84 -0
  26. package/dist/errors/index.d.ts +4 -0
  27. package/dist/index.cjs +501 -112
  28. package/dist/index.cjs.map +1 -1
  29. package/dist/index.d.ts +3 -1
  30. package/dist/index.js +6 -2
  31. package/dist/types.d.ts +90 -0
  32. package/docs/TIMING_NODE_OPTIMIZATION.md +207 -0
  33. package/docs/TIMING_README.md +170 -0
  34. package/docs/memory-data/scaling-10-instances.json +526 -0
  35. package/docs/memory-data/scaling-100-instances.json +526 -0
  36. package/docs/memory-data/scaling-1000-instances.json +276 -0
  37. package/docs/memory-data/scaling-10000-instances.json +126 -0
  38. package/docs/memory-data/scaling-20-instances.json +526 -0
  39. package/docs/memory-data/scaling-200-instances.json +526 -0
  40. package/docs/memory-data/scaling-2000-instances.json +276 -0
  41. package/docs/memory-data/scaling-50-instances.json +526 -0
  42. package/docs/memory-data/scaling-500-instances.json +276 -0
  43. package/docs/memory-data/scaling-5000-instances.json +126 -0
  44. package/docs/memory-overhead.svg +120 -0
  45. package/docs/memory.md +430 -0
  46. package/docs/timing-range.svg +174 -0
  47. package/docs/timing.md +483 -0
  48. package/examples/README.md +187 -0
  49. package/examples/multi-level-keys.ts +374 -0
  50. package/examples/registry-hub-types.ts +437 -0
  51. package/examples/simple-example.ts +250 -0
  52. package/package.json +5 -3
  53. package/dist/Definition.cjs +0 -18
  54. package/dist/Definition.d.ts +0 -5
  55. package/dist/Definition.js +0 -14
@@ -0,0 +1,92 @@
1
+ 'use strict';
2
+
3
+ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
4
+
5
+ const RegistryError = require('./RegistryError.cjs');
6
+
7
+ function _define_property(obj, key, value) {
8
+ if (key in obj) {
9
+ Object.defineProperty(obj, key, {
10
+ value: value,
11
+ enumerable: true,
12
+ configurable: true,
13
+ writable: true
14
+ });
15
+ } else {
16
+ obj[key] = value;
17
+ }
18
+ return obj;
19
+ }
20
+ /**
21
+ * Base class for registry hub-related errors
22
+ */ class RegistryHubError extends RegistryError.RegistryError {
23
+ constructor(message, hubType, context){
24
+ const enrichedContext = hubType ? {
25
+ ...context,
26
+ hubType
27
+ } : context;
28
+ super(message, '', enrichedContext), _define_property(this, "hubType", void 0);
29
+ this.hubType = hubType;
30
+ }
31
+ }
32
+ /**
33
+ * Thrown when attempting to register a registry with a type that already exists
34
+ */ class DuplicateRegistryTypeError extends RegistryHubError {
35
+ constructor(type, context){
36
+ super(`Registry already registered under type: ${type}. ` + `Each registry type must be unique within a registry hub.`, '', {
37
+ ...context,
38
+ duplicateType: type
39
+ }), _define_property(this, "duplicateType", void 0);
40
+ this.duplicateType = type;
41
+ }
42
+ }
43
+ /**
44
+ * Thrown when attempting to access a registry type that doesn't exist
45
+ */ class RegistryTypeNotFoundError extends RegistryHubError {
46
+ constructor(requestedType, availableTypes = [], context){
47
+ let message = `No registry registered under type: ${requestedType}`;
48
+ if (availableTypes.length > 0) {
49
+ message += `. Available types: [${availableTypes.join(', ')}]`;
50
+ }
51
+ super(message, '', {
52
+ ...context,
53
+ requestedType,
54
+ availableTypes
55
+ }), _define_property(this, "requestedType", void 0), _define_property(this, "availableTypes", void 0);
56
+ this.requestedType = requestedType;
57
+ this.availableTypes = availableTypes;
58
+ }
59
+ }
60
+ /**
61
+ * Thrown when a registry factory function fails to create a valid registry
62
+ */ class RegistryFactoryError extends RegistryHubError {
63
+ constructor(type, factoryError, context){
64
+ super(`Registry factory failed to create registry of type '${type}': ${factoryError.message}`, '', {
65
+ ...context,
66
+ attemptedType: type,
67
+ originalError: factoryError.message
68
+ }), _define_property(this, "factoryError", void 0), _define_property(this, "attemptedType", void 0);
69
+ this.factoryError = factoryError;
70
+ this.attemptedType = type;
71
+ }
72
+ }
73
+ /**
74
+ * Thrown when a factory returns an invalid registry object
75
+ */ class InvalidRegistryFactoryResultError extends RegistryHubError {
76
+ constructor(type, factoryResult, context){
77
+ super(`Registry factory returned invalid registry for type '${type}'. ` + `Expected registry with 'type', 'get', 'register', and 'createInstance' properties, ` + `got: ${typeof factoryResult}`, '', {
78
+ ...context,
79
+ attemptedType: type,
80
+ factoryResult: typeof factoryResult
81
+ }), _define_property(this, "factoryResult", void 0), _define_property(this, "attemptedType", void 0);
82
+ this.factoryResult = factoryResult;
83
+ this.attemptedType = type;
84
+ }
85
+ }
86
+
87
+ exports.DuplicateRegistryTypeError = DuplicateRegistryTypeError;
88
+ exports.InvalidRegistryFactoryResultError = InvalidRegistryFactoryResultError;
89
+ exports.RegistryFactoryError = RegistryFactoryError;
90
+ exports.RegistryHubError = RegistryHubError;
91
+ exports.RegistryTypeNotFoundError = RegistryTypeNotFoundError;
92
+ //# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiUmVnaXN0cnlIdWJFcnJvci5janMiLCJzb3VyY2VzIjpbXSwic291cmNlc0NvbnRlbnQiOltdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiOzs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7OzsifQ==
@@ -0,0 +1,39 @@
1
+ import { RegistryError } from './RegistryError';
2
+ /**
3
+ * Base class for registry hub-related errors
4
+ */
5
+ export declare abstract class RegistryHubError extends RegistryError {
6
+ readonly hubType?: string;
7
+ constructor(message: string, hubType?: string, context?: Record<string, any>);
8
+ }
9
+ /**
10
+ * Thrown when attempting to register a registry with a type that already exists
11
+ */
12
+ export declare class DuplicateRegistryTypeError extends RegistryHubError {
13
+ readonly duplicateType: string;
14
+ constructor(type: string, context?: Record<string, any>);
15
+ }
16
+ /**
17
+ * Thrown when attempting to access a registry type that doesn't exist
18
+ */
19
+ export declare class RegistryTypeNotFoundError extends RegistryHubError {
20
+ readonly requestedType: string;
21
+ readonly availableTypes: string[];
22
+ constructor(requestedType: string, availableTypes?: string[], context?: Record<string, any>);
23
+ }
24
+ /**
25
+ * Thrown when a registry factory function fails to create a valid registry
26
+ */
27
+ export declare class RegistryFactoryError extends RegistryHubError {
28
+ readonly factoryError: Error;
29
+ readonly attemptedType: string;
30
+ constructor(type: string, factoryError: Error, context?: Record<string, any>);
31
+ }
32
+ /**
33
+ * Thrown when a factory returns an invalid registry object
34
+ */
35
+ export declare class InvalidRegistryFactoryResultError extends RegistryHubError {
36
+ readonly factoryResult: any;
37
+ readonly attemptedType: string;
38
+ constructor(type: string, factoryResult: any, context?: Record<string, any>);
39
+ }
@@ -0,0 +1,84 @@
1
+ import { RegistryError } from './RegistryError.js';
2
+
3
+ function _define_property(obj, key, value) {
4
+ if (key in obj) {
5
+ Object.defineProperty(obj, key, {
6
+ value: value,
7
+ enumerable: true,
8
+ configurable: true,
9
+ writable: true
10
+ });
11
+ } else {
12
+ obj[key] = value;
13
+ }
14
+ return obj;
15
+ }
16
+ /**
17
+ * Base class for registry hub-related errors
18
+ */ class RegistryHubError extends RegistryError {
19
+ constructor(message, hubType, context){
20
+ const enrichedContext = hubType ? {
21
+ ...context,
22
+ hubType
23
+ } : context;
24
+ super(message, '', enrichedContext), _define_property(this, "hubType", void 0);
25
+ this.hubType = hubType;
26
+ }
27
+ }
28
+ /**
29
+ * Thrown when attempting to register a registry with a type that already exists
30
+ */ class DuplicateRegistryTypeError extends RegistryHubError {
31
+ constructor(type, context){
32
+ super(`Registry already registered under type: ${type}. ` + `Each registry type must be unique within a registry hub.`, '', {
33
+ ...context,
34
+ duplicateType: type
35
+ }), _define_property(this, "duplicateType", void 0);
36
+ this.duplicateType = type;
37
+ }
38
+ }
39
+ /**
40
+ * Thrown when attempting to access a registry type that doesn't exist
41
+ */ class RegistryTypeNotFoundError extends RegistryHubError {
42
+ constructor(requestedType, availableTypes = [], context){
43
+ let message = `No registry registered under type: ${requestedType}`;
44
+ if (availableTypes.length > 0) {
45
+ message += `. Available types: [${availableTypes.join(', ')}]`;
46
+ }
47
+ super(message, '', {
48
+ ...context,
49
+ requestedType,
50
+ availableTypes
51
+ }), _define_property(this, "requestedType", void 0), _define_property(this, "availableTypes", void 0);
52
+ this.requestedType = requestedType;
53
+ this.availableTypes = availableTypes;
54
+ }
55
+ }
56
+ /**
57
+ * Thrown when a registry factory function fails to create a valid registry
58
+ */ class RegistryFactoryError extends RegistryHubError {
59
+ constructor(type, factoryError, context){
60
+ super(`Registry factory failed to create registry of type '${type}': ${factoryError.message}`, '', {
61
+ ...context,
62
+ attemptedType: type,
63
+ originalError: factoryError.message
64
+ }), _define_property(this, "factoryError", void 0), _define_property(this, "attemptedType", void 0);
65
+ this.factoryError = factoryError;
66
+ this.attemptedType = type;
67
+ }
68
+ }
69
+ /**
70
+ * Thrown when a factory returns an invalid registry object
71
+ */ class InvalidRegistryFactoryResultError extends RegistryHubError {
72
+ constructor(type, factoryResult, context){
73
+ super(`Registry factory returned invalid registry for type '${type}'. ` + `Expected registry with 'type', 'get', 'register', and 'createInstance' properties, ` + `got: ${typeof factoryResult}`, '', {
74
+ ...context,
75
+ attemptedType: type,
76
+ factoryResult: typeof factoryResult
77
+ }), _define_property(this, "factoryResult", void 0), _define_property(this, "attemptedType", void 0);
78
+ this.factoryResult = factoryResult;
79
+ this.attemptedType = type;
80
+ }
81
+ }
82
+
83
+ export { DuplicateRegistryTypeError, InvalidRegistryFactoryResultError, RegistryFactoryError, RegistryHubError, RegistryTypeNotFoundError };
84
+ //# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiUmVnaXN0cnlIdWJFcnJvci5qcyIsInNvdXJjZXMiOltdLCJzb3VyY2VzQ29udGVudCI6W10sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiI7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7OzsifQ==
@@ -0,0 +1,4 @@
1
+ export * from './RegistryError';
2
+ export * from './InstanceError';
3
+ export * from './CoordinateError';
4
+ export * from './RegistryHubError';