@thi.ng/system 2.1.34 → 2.1.35

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/CHANGELOG.md CHANGED
@@ -1,6 +1,6 @@
1
1
  # Change Log
2
2
 
3
- - **Last updated**: 2022-12-06T17:16:38Z
3
+ - **Last updated**: 2022-12-16T12:52:25Z
4
4
  - **Generator**: [thi.ng/monopub](https://thi.ng/monopub)
5
5
 
6
6
  All notable changes to this project will be documented in this file.
package/README.md CHANGED
@@ -1,10 +1,10 @@
1
1
  <!-- This file is generated - DO NOT EDIT! -->
2
2
 
3
- # ![system](https://media.thi.ng/umbrella/banners-20220914/thing-system.svg?9d062154)
3
+ # ![@thi.ng/system](https://media.thi.ng/umbrella/banners-20220914/thing-system.svg?9d062154)
4
4
 
5
5
  [![npm version](https://img.shields.io/npm/v/@thi.ng/system.svg)](https://www.npmjs.com/package/@thi.ng/system)
6
6
  ![npm downloads](https://img.shields.io/npm/dm/@thi.ng/system.svg)
7
- [![Twitter Follow](https://img.shields.io/twitter/follow/thing_umbrella.svg?style=flat-square&label=twitter)](https://twitter.com/thing_umbrella)
7
+ [![Mastodon Follow](https://img.shields.io/mastodon/follow/109331703950160316?domain=https%3A%2F%2Fmastodon.thi.ng&style=social)](https://mastodon.thi.ng/@toxi)
8
8
 
9
9
  This project is part of the
10
10
  [@thi.ng/umbrella](https://github.com/thi-ng/umbrella/) monorepo.
@@ -17,13 +17,11 @@ This project is part of the
17
17
  - [Example system](#example-system)
18
18
  - [System visualization](#system-visualization)
19
19
  - [Authors](#authors)
20
- - [Maintainer](#maintainer)
21
- - [Contributors](#contributors)
22
20
  - [License](#license)
23
21
 
24
22
  ## About
25
23
 
26
- Minimal and explicit dependency-injection & lifecycle container for stateful app components.
24
+ Minimal and explicit dependency-injection & lifecycle container for stateful app components
27
25
 
28
26
  Inspired by Stuart Sierra's
29
27
  [component](https://github.com/stuartsierra/component) framework for
@@ -51,11 +49,8 @@ ES module import:
51
49
 
52
50
  For Node.js REPL:
53
51
 
54
- ```text
55
- # with flag only for < v16
56
- node --experimental-repl-await
57
-
58
- > const system = await import("@thi.ng/system");
52
+ ```js
53
+ const system = await import("@thi.ng/system");
59
54
  ```
60
55
 
61
56
  Package sizes (brotli'd, pre-treeshake): ESM: 387 bytes
@@ -91,7 +86,7 @@ interface FooSys {
91
86
  // `ILifecycle` interface...
92
87
 
93
88
  class Logger implements ILifecycle {
94
-
89
+
95
90
  info(msg: string) {
96
91
  console.log(`[info] ${msg}`);
97
92
  }
@@ -100,7 +95,7 @@ class Logger implements ILifecycle {
100
95
  this.info("start logger");
101
96
  return true;
102
97
  }
103
-
98
+
104
99
  async stop() {
105
100
  this.info("stop logger");
106
101
  return true;
@@ -110,7 +105,7 @@ class Logger implements ILifecycle {
110
105
  // DB requires a logger & cache
111
106
 
112
107
  class DB implements ILifecycle {
113
-
108
+
114
109
  constructor(protected logger: Logger, protected cache: Cache) {}
115
110
 
116
111
  async start() {
@@ -132,7 +127,7 @@ class Cache implements ILifecycle {
132
127
  this.logger.info("start cache");
133
128
  return true;
134
129
  }
135
-
130
+
136
131
  async stop() {
137
132
  this.logger.info("stop cache");
138
133
  return true;
@@ -224,13 +219,8 @@ Resulting visualization:
224
219
 
225
220
  ## Authors
226
221
 
227
- ### Maintainer
228
-
229
- - Karsten Schmidt ([@postspectacular](https://github.com/postspectacular))
230
-
231
- ### Contributors
232
-
233
- - Kevin Nolan ([@allforabit](https://github.com/allforabit))
222
+ - [Karsten Schmidt](https://thi.ng) (Main author)
223
+ - [Kevin Nolan](https://github.com/allforabit)
234
224
 
235
225
  If this project contributes to an academic publication, please cite it as:
236
226
 
@@ -245,4 +235,4 @@ If this project contributes to an academic publication, please cite it as:
245
235
 
246
236
  ## License
247
237
 
248
- &copy; 2020 - 2022 Karsten Schmidt // Apache Software License 2.0
238
+ &copy; 2020 - 2022 Karsten Schmidt // Apache License 2.0
package/api.d.ts CHANGED
@@ -26,11 +26,11 @@ export interface ILifecycle {
26
26
  * Defines the participants of a system. Maps component names to their
27
27
  * respective types
28
28
  */
29
- export declare type SystemMap<T> = Record<Keys<T>, ILifecycle>;
29
+ export type SystemMap<T> = Record<Keys<T>, ILifecycle>;
30
30
  /**
31
31
  * Component initialization function.
32
32
  */
33
- export declare type ComponentFactory<T extends SystemMap<T>> = Fn<T, ILifecycle>;
33
+ export type ComponentFactory<T extends SystemMap<T>> = Fn<T, ILifecycle>;
34
34
  export interface SystemSpec<T extends SystemMap<T>> {
35
35
  factory: ComponentFactory<T>;
36
36
  deps?: Keys<T>[];
@@ -40,7 +40,7 @@ export interface SystemSpec<T extends SystemMap<T>> {
40
40
  * component dependencies. The generic type arg `T` is used to infer &
41
41
  * validate all specs.
42
42
  */
43
- export declare type SystemSpecs<T extends SystemMap<T>> = Record<Keys<T>, SystemSpec<T>>;
43
+ export type SystemSpecs<T extends SystemMap<T>> = Record<Keys<T>, SystemSpec<T>>;
44
44
  /** @internal */
45
45
  export declare let LOGGER: ILogger;
46
46
  /**
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@thi.ng/system",
3
- "version": "2.1.34",
3
+ "version": "2.1.35",
4
4
  "description": "Minimal and explicit dependency-injection & lifecycle container for stateful app components",
5
5
  "type": "module",
6
6
  "module": "./index.js",
@@ -21,7 +21,10 @@
21
21
  "url": "https://patreon.com/thing_umbrella"
22
22
  }
23
23
  ],
24
- "author": "Karsten Schmidt <k+npm@thi.ng>",
24
+ "author": "Karsten Schmidt (https://thi.ng)",
25
+ "contributors": [
26
+ "Kevin Nolan (https://github.com/allforabit)"
27
+ ],
25
28
  "license": "Apache-2.0",
26
29
  "scripts": {
27
30
  "build": "yarn clean && tsc --declaration",
@@ -34,17 +37,17 @@
34
37
  "test": "testament test"
35
38
  },
36
39
  "dependencies": {
37
- "@thi.ng/api": "^8.5.1",
38
- "@thi.ng/dgraph": "^2.1.30",
39
- "@thi.ng/logger": "^1.4.4"
40
+ "@thi.ng/api": "^8.6.0",
41
+ "@thi.ng/dgraph": "^2.1.31",
42
+ "@thi.ng/logger": "^1.4.5"
40
43
  },
41
44
  "devDependencies": {
42
- "@microsoft/api-extractor": "^7.33.5",
43
- "@thi.ng/testament": "^0.3.6",
45
+ "@microsoft/api-extractor": "^7.33.7",
46
+ "@thi.ng/testament": "^0.3.7",
44
47
  "rimraf": "^3.0.2",
45
48
  "tools": "^0.0.1",
46
- "typedoc": "^0.23.20",
47
- "typescript": "^4.8.4"
49
+ "typedoc": "^0.23.22",
50
+ "typescript": "^4.9.4"
48
51
  },
49
52
  "keywords": [
50
53
  "clojure",
@@ -81,5 +84,5 @@
81
84
  "thi.ng": {
82
85
  "year": 2020
83
86
  },
84
- "gitHead": "54c5f22520162bac0d58426a3f86ca636e797f71\n"
87
+ "gitHead": "f445a9cc8022bcdebbf6ff91fd66ced016d72f01\n"
85
88
  }