@thi.ng/fibers 1.0.0 → 1.0.2

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**: 2024-04-11T12:32:44Z
3
+ - **Last updated**: 2024-04-23T07:02:18Z
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.
@@ -9,6 +9,12 @@ See [Conventional Commits](https://conventionalcommits.org/) for commit guidelin
9
9
  **Note:** Unlisted _patch_ versions only involve non-code or otherwise excluded changes
10
10
  and/or version bumps of transitive dependencies.
11
11
 
12
+ ### [1.0.1](https://github.com/thi-ng/umbrella/tree/@thi.ng/fibers@1.0.1) (2024-04-20)
13
+
14
+ #### ♻️ Refactoring
15
+
16
+ - update type usage ([9df7cb0](https://github.com/thi-ng/umbrella/commit/9df7cb0))
17
+
12
18
  # [1.0.0](https://github.com/thi-ng/umbrella/tree/@thi.ng/fibers@1.0.0) (2024-04-11)
13
19
 
14
20
  #### 🛑 Breaking changes
package/README.md CHANGED
@@ -204,7 +204,7 @@ values are being read, essentially a memory management issue).
204
204
  #### Buffering behaviors
205
205
 
206
206
  The following channel buffer types/behaviors are included (from the
207
- [thi.ng/buffers](https://thi.ng/buffers) package), all accepting a max. capacity
207
+ [thi.ng/buffers](https://github.com/thi-ng/umbrella/tree/develop/packages/buffers) package), all accepting a max. capacity
208
208
  and all implementing the
209
209
  [IReadWriteBuffer](https://docs.thi.ng/umbrella/fibers/interfaces/IReadWriteBuffer.html)
210
210
  interface required by the channel:
@@ -386,10 +386,10 @@ import * as fib from "@thi.ng/fibers";
386
386
  Browser ESM import:
387
387
 
388
388
  ```html
389
- <script type="module" src="https://cdn.skypack.dev/@thi.ng/fibers"></script>
389
+ <script type="module" src="https://esm.run/@thi.ng/fibers"></script>
390
390
  ```
391
391
 
392
- [Skypack documentation](https://docs.skypack.dev/)
392
+ [JSDelivr documentation](https://www.jsdelivr.com/)
393
393
 
394
394
  For Node.js REPL:
395
395
 
package/csp.d.ts CHANGED
@@ -1,3 +1,4 @@
1
+ import type { Maybe } from "@thi.ng/api";
1
2
  import type { IReadWriteBuffer } from "@thi.ng/buffers";
2
3
  import { DroppingBuffer } from "@thi.ng/buffers/dropping";
3
4
  import { FIFOBuffer } from "@thi.ng/buffers/fifo";
@@ -35,7 +36,7 @@ export declare class Channel<T> {
35
36
  * const val = yield* chan.read();
36
37
  * ```
37
38
  */
38
- read(): Fiber<T | undefined>;
39
+ read(): Fiber<Maybe<T>>;
39
40
  /**
40
41
  * Returns a new fiber which attempts to write the given `value` to the
41
42
  * channel and "blocks" until channel is writable (which depends on the
package/fiber.d.ts CHANGED
@@ -1,8 +1,8 @@
1
- import type { Event as $Event, Fn, Fn0, IDeref, IID, IIDGen, INotify, Listener, Nullable } from "@thi.ng/api";
1
+ import type { Event as $Event, Fn, Fn0, IDeref, IID, IIDGen, INotify, Listener, Maybe, Nullable } from "@thi.ng/api";
2
2
  import type { ILogger } from "@thi.ng/logger";
3
3
  import { type FiberEventType, type FiberFactory, type FiberOpts, type MaybeFiber, type State } from "./api.js";
4
4
  export declare const setDefaultIDGen: (gen: IIDGen<string>) => IIDGen<string>;
5
- export declare class Fiber<T = any> implements IDeref<T | undefined>, IID<string>, INotify<FiberEventType> {
5
+ export declare class Fiber<T = any> implements IDeref<Maybe<T>>, IID<string>, INotify<FiberEventType> {
6
6
  /**
7
7
  * This fiber's user provided or generated ID.
8
8
  */
@@ -20,7 +20,7 @@ export declare class Fiber<T = any> implements IDeref<T | undefined>, IID<string
20
20
  error?: Error;
21
21
  logger?: ILogger;
22
22
  user?: Partial<Pick<FiberOpts, "init" | "deinit" | "catch">>;
23
- _promise?: Promise<T | undefined>;
23
+ _promise?: Promise<Maybe<T>>;
24
24
  constructor(gen?: Nullable<FiberFactory<T> | Generator<unknown, T>>, opts?: Partial<FiberOpts>);
25
25
  /**
26
26
  * Co-routine which blocks whilst this fiber (incl. its children) is active.
@@ -42,7 +42,7 @@ export declare class Fiber<T = any> implements IDeref<T | undefined>, IID<string
42
42
  *
43
43
  * @param delay
44
44
  */
45
- promise(delay?: number): Promise<T | undefined>;
45
+ promise(delay?: number): Promise<Maybe<T>>;
46
46
  /**
47
47
  * Returns this fiber's result value (if any). Only available if the fiber
48
48
  * completed successfully and produced a value (either by returning a value
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@thi.ng/fibers",
3
- "version": "1.0.0",
3
+ "version": "1.0.2",
4
4
  "description": "Process hierarchies & operators for cooperative multitasking",
5
5
  "type": "module",
6
6
  "module": "./index.js",
@@ -27,7 +27,7 @@
27
27
  "build": "yarn build:esbuild && yarn build:decl",
28
28
  "build:decl": "tsc --declaration --emitDeclarationOnly",
29
29
  "build:esbuild": "esbuild --format=esm --platform=neutral --target=es2022 --tsconfig=tsconfig.json --outdir=. src/**/*.ts",
30
- "clean": "rimraf --glob '*.js' '*.d.ts' '*.map' doc",
30
+ "clean": "bun ../../tools/src/clean-package.ts",
31
31
  "doc": "typedoc --excludePrivate --excludeInternal --out doc src/index.ts",
32
32
  "doc:ae": "mkdir -p .ae/doc .ae/temp && api-extractor run --local --verbose",
33
33
  "doc:readme": "bun ../../tools/src/module-stats.ts && bun ../../tools/src/readme.ts",
@@ -36,20 +36,19 @@
36
36
  "tool:tangle": "../../node_modules/.bin/tangle src/**/*.ts"
37
37
  },
38
38
  "dependencies": {
39
- "@thi.ng/api": "^8.10.1",
40
- "@thi.ng/arrays": "^2.9.3",
41
- "@thi.ng/bench": "^3.5.3",
42
- "@thi.ng/buffers": "^0.1.0",
43
- "@thi.ng/checks": "^3.6.1",
44
- "@thi.ng/errors": "^2.5.4",
45
- "@thi.ng/idgen": "^2.2.38",
46
- "@thi.ng/logger": "^3.0.9",
47
- "@thi.ng/random": "^3.7.3"
39
+ "@thi.ng/api": "^8.11.1",
40
+ "@thi.ng/arrays": "^2.9.5",
41
+ "@thi.ng/bench": "^3.5.5",
42
+ "@thi.ng/buffers": "^0.1.2",
43
+ "@thi.ng/checks": "^3.6.3",
44
+ "@thi.ng/errors": "^2.5.6",
45
+ "@thi.ng/idgen": "^2.2.40",
46
+ "@thi.ng/logger": "^3.0.11",
47
+ "@thi.ng/random": "^3.7.5"
48
48
  },
49
49
  "devDependencies": {
50
50
  "@microsoft/api-extractor": "^7.43.0",
51
51
  "esbuild": "^0.20.2",
52
- "rimraf": "^5.0.5",
53
52
  "typedoc": "^0.25.12",
54
53
  "typescript": "^5.4.3"
55
54
  },
@@ -110,5 +109,5 @@
110
109
  "status": "alpha",
111
110
  "year": 2023
112
111
  },
113
- "gitHead": "18a0c063a7b33d790e5bc2486c106f45f663ac28\n"
112
+ "gitHead": "5dd66c18a3862a3af69a5b2f49563f7cbdd960c2\n"
114
113
  }