@dws-std/registry 1.0.0 → 1.1.0

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 (3) hide show
  1. package/README.md +2 -0
  2. package/dist/index.js +3 -3
  3. package/package.json +49 -49
package/README.md CHANGED
@@ -30,6 +30,8 @@ One registry, no duplication.
30
30
  bun add @dws-std/registry
31
31
  ```
32
32
 
33
+ > **Peer dependency:** `@dws-std/error` must be installed alongside.
34
+
33
35
  ## ⚙️ Usage
34
36
 
35
37
  ### Registering instances
package/dist/index.js CHANGED
@@ -11,7 +11,7 @@ class Registry {
11
11
  static register(name, instance) {
12
12
  if (this._registry.has(name))
13
13
  throw new Exception(`Instance already registered: ${name}`, {
14
- code: REGISTRY_ERROR_KEYS.CLASS_INSTANCE_ALREADY_REGISTERED,
14
+ key: REGISTRY_ERROR_KEYS.CLASS_INSTANCE_ALREADY_REGISTERED,
15
15
  cause: name
16
16
  });
17
17
  this._registry.set(name, instance);
@@ -19,7 +19,7 @@ class Registry {
19
19
  static unregister(name) {
20
20
  if (!this._registry.delete(name))
21
21
  throw new Exception(`Instance not registered: ${name}`, {
22
- code: REGISTRY_ERROR_KEYS.CLASS_INSTANCE_NOT_REGISTERED,
22
+ key: REGISTRY_ERROR_KEYS.CLASS_INSTANCE_NOT_REGISTERED,
23
23
  cause: name
24
24
  });
25
25
  }
@@ -27,7 +27,7 @@ class Registry {
27
27
  const instance = this._registry.get(name);
28
28
  if (!instance)
29
29
  throw new Exception(`Instance not registered: ${name}`, {
30
- code: REGISTRY_ERROR_KEYS.CLASS_INSTANCE_NOT_REGISTERED,
30
+ key: REGISTRY_ERROR_KEYS.CLASS_INSTANCE_NOT_REGISTERED,
31
31
  cause: name
32
32
  });
33
33
  return instance;
package/package.json CHANGED
@@ -1,51 +1,51 @@
1
1
  {
2
- "name": "@dws-std/registry",
3
- "version": "1.0.0",
4
- "description": "Centralized, type-safe registry for managing named instances.",
5
- "keywords": [
6
- "bun",
7
- "dws",
8
- "registry",
9
- "type-safe"
10
- ],
11
- "license": "MIT",
12
- "author": "Dominus Web Services (DWS)",
13
- "repository": {
14
- "type": "git",
15
- "url": "https://github.com/Dominus-Web-Service/std",
16
- "directory": "packages/registry"
17
- },
18
- "files": [
19
- "dist"
20
- ],
21
- "type": "module",
22
- "exports": {
23
- ".": {
24
- "types": "./dist/index.d.ts",
25
- "default": "./dist/index.js"
26
- }
27
- },
28
- "scripts": {
29
- "build": "bun builder.ts",
30
- "docs": "bunx typedoc --tsconfig tsconfig.build.json",
31
- "fmt:check": "oxfmt --check",
32
- "fmt": "oxfmt",
33
- "lint:fix": "oxlint --type-aware --type-check --fix ./src",
34
- "lint:github": "oxlint --type-aware --type-check --format=github ./src",
35
- "lint": "oxlint --type-aware --type-check ./src",
36
- "test": "bun test --pass-with-no-tests --coverage"
37
- },
38
- "dependencies": {
39
- "@dws-std/error": "^2.0.0"
40
- },
41
- "devDependencies": {
42
- "@types/bun": "^1.3.10",
43
- "oxfmt": "^0.40.0",
44
- "oxlint": "^1.55.0",
45
- "oxlint-tsgolint": "^0.16.0",
46
- "typescript": "^5.9.3"
47
- },
48
- "peerDependencies": {
49
- "@dws-std/error": "^2.0.0"
50
- }
2
+ "name": "@dws-std/registry",
3
+ "version": "1.1.0",
4
+ "description": "Centralized, type-safe registry for managing named instances.",
5
+ "keywords": [
6
+ "bun",
7
+ "dws",
8
+ "registry",
9
+ "type-safe"
10
+ ],
11
+ "license": "MIT",
12
+ "author": "Dominus Web Services (DWS)",
13
+ "repository": {
14
+ "type": "git",
15
+ "url": "https://github.com/Dominus-Web-Service/std",
16
+ "directory": "packages/registry"
17
+ },
18
+ "files": [
19
+ "dist"
20
+ ],
21
+ "type": "module",
22
+ "exports": {
23
+ ".": {
24
+ "types": "./dist/index.d.ts",
25
+ "default": "./dist/index.js"
26
+ }
27
+ },
28
+ "scripts": {
29
+ "build": "bun builder.ts",
30
+ "docs": "bunx typedoc --tsconfig tsconfig.build.json",
31
+ "fmt:check": "oxfmt --check",
32
+ "fmt": "oxfmt",
33
+ "lint:fix": "oxlint --type-aware --type-check --fix ./src",
34
+ "lint:github": "oxlint --type-aware --type-check --format=github ./src",
35
+ "lint": "oxlint --type-aware --type-check ./src",
36
+ "test": "bun test --pass-with-no-tests --coverage"
37
+ },
38
+ "dependencies": {
39
+ "@dws-std/error": "^2.1.0"
40
+ },
41
+ "devDependencies": {
42
+ "@types/bun": "^1.3.10",
43
+ "oxfmt": "0.41.0",
44
+ "oxlint": "1.56.0",
45
+ "oxlint-tsgolint": "0.17.0",
46
+ "typescript": "^5.9.3"
47
+ },
48
+ "peerDependencies": {
49
+ "@dws-std/error": "^2.1.0"
50
+ }
51
51
  }