From de11388c7bbbe52717f8d7ee298a245a9d0802ea Mon Sep 17 00:00:00 2001 From: Tom Anderson Date: Tue, 7 May 2024 15:45:11 +1000 Subject: [PATCH 1/5] ensure documentation labels default export --- package-lock.json | 29 +++++++++++++++++++++++++++-- package.json | 3 ++- 2 files changed, 29 insertions(+), 3 deletions(-) diff --git a/package-lock.json b/package-lock.json index 908784d..10cfaee 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "windpipe", - "version": "0.6.0", + "version": "0.7.0", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "windpipe", - "version": "0.6.0", + "version": "0.7.0", "license": "ISC", "devDependencies": { "@changesets/cli": "^2.27.1", @@ -24,6 +24,7 @@ "typedoc": "^0.25.7", "typedoc-material-theme": "^1.0.2", "typedoc-plugin-extras": "^3.0.0", + "typedoc-plugin-rename-defaults": "^0.7.0", "typescript": "^5.3.3", "typescript-eslint": "^7.6.0", "vitest": "^1.2.0" @@ -7333,6 +7334,30 @@ "typedoc": "0.25.x" } }, + "node_modules/typedoc-plugin-rename-defaults": { + "version": "0.7.0", + "resolved": "https://registry.npmjs.org/typedoc-plugin-rename-defaults/-/typedoc-plugin-rename-defaults-0.7.0.tgz", + "integrity": "sha512-NudSQ1o/XLHNF9c4y7LzIZxfE9ltz09yCDklBPJpP5VMRvuBpYGIbQ0ZgmPz+EIV8vPx9Z/OyKwzp4HT2vDtfg==", + "dev": true, + "dependencies": { + "camelcase": "^8.0.0" + }, + "peerDependencies": { + "typedoc": "0.22.x || 0.23.x || 0.24.x || 0.25.x" + } + }, + "node_modules/typedoc-plugin-rename-defaults/node_modules/camelcase": { + "version": "8.0.0", + "resolved": "https://registry.npmjs.org/camelcase/-/camelcase-8.0.0.tgz", + "integrity": "sha512-8WB3Jcas3swSvjIeA2yvCJ+Miyz5l1ZmB6HFb9R1317dt9LCQoswg/BGrmAmkWVEszSrrg4RwmO46qIm2OEnSA==", + "dev": true, + "engines": { + "node": ">=16" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, "node_modules/typedoc/node_modules/brace-expansion": { "version": "2.0.1", "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-2.0.1.tgz", diff --git a/package.json b/package.json index ac1fb6a..b8f1487 100644 --- a/package.json +++ b/package.json @@ -7,7 +7,7 @@ "lint": "tsc && eslint .", "format": "eslint --fix .", "build": "tsup ./src/index.ts", - "doc": "typedoc ./src --media ./media --plugin typedoc-plugin-extras --favicon ./media/favicon.ico --footerLastModified true --plugin typedoc-material-theme --themeColor '#03284e'", + "doc": "typedoc ./src --media ./media --plugin typedoc-plugin-extras --favicon ./media/favicon.ico --footerLastModified true --plugin typedoc-material-theme --themeColor '#03284e' --plugin typedoc-plugin-rename-defaults", "test": "vitest", "ci:release": "npm run build && changeset publish" }, @@ -56,6 +56,7 @@ "typedoc": "^0.25.7", "typedoc-material-theme": "^1.0.2", "typedoc-plugin-extras": "^3.0.0", + "typedoc-plugin-rename-defaults": "^0.7.0", "typescript": "^5.3.3", "typescript-eslint": "^7.6.0", "vitest": "^1.2.0" From 6933c181dcc807e312c03b9237911e5dc440b9f5 Mon Sep 17 00:00:00 2001 From: Tom Anderson Date: Tue, 7 May 2024 15:45:21 +1000 Subject: [PATCH 2/5] clean up exported types --- src/index.ts | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/src/index.ts b/src/index.ts index 7ebbff5..3efb18f 100644 --- a/src/index.ts +++ b/src/index.ts @@ -1,10 +1,19 @@ import { Stream } from "./stream"; // Export all useful types for atoms -export type { Atom, AtomOk, AtomError, AtomUnknown } from "./atom"; +export type { + Atom, + AtomOk, + AtomError, + AtomUnknown, + VALUE, + ERROR, + UNKNOWN, + MaybeAtom, +} from "./atom"; // Re-export all utility types -export type * from "./util"; +export type { MaybePromise, Truthy, CallbackOrStream } from "./util"; // Export the `StreamEnd` type export type { StreamEnd } from "./stream"; From 160486839eefb6b4c6472d4e1678eee9d9e70086 Mon Sep 17 00:00:00 2001 From: Tom Anderson Date: Tue, 7 May 2024 15:46:37 +1000 Subject: [PATCH 3/5] extra documentation on template parameters --- src/stream/index.ts | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/stream/index.ts b/src/stream/index.ts index 71b93b8..af53647 100644 --- a/src/stream/index.ts +++ b/src/stream/index.ts @@ -14,6 +14,10 @@ import { HigherOrderStream } from "./higher-order"; export type { StreamEnd } from "./base"; +/** + * @template T - Type of the 'values' on the stream. + * @template E - Type of the 'errors' on the stream. + */ export class Stream extends HigherOrderStream { // Re-export atom utilities for convenience /** From 022efeaaf4f653341cf53a30cf95b9d4cc7e8480 Mon Sep 17 00:00:00 2001 From: Tom Anderson Date: Tue, 7 May 2024 15:47:43 +1000 Subject: [PATCH 4/5] add changesets --- .changeset/pink-vans-exercise.md | 5 +++++ 1 file changed, 5 insertions(+) create mode 100644 .changeset/pink-vans-exercise.md diff --git a/.changeset/pink-vans-exercise.md b/.changeset/pink-vans-exercise.md new file mode 100644 index 0000000..99841dc --- /dev/null +++ b/.changeset/pink-vans-exercise.md @@ -0,0 +1,5 @@ +--- +"windpipe": patch +--- + +Improve exported API and generated docs From 7d01214349ab3b664a4b2758dceb22af557ca360 Mon Sep 17 00:00:00 2001 From: Tom Anderson Date: Tue, 7 May 2024 15:51:58 +1000 Subject: [PATCH 5/5] Update src/index.ts Co-authored-by: Ewan Breakey --- src/index.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/index.ts b/src/index.ts index 3efb18f..a4e9d0a 100644 --- a/src/index.ts +++ b/src/index.ts @@ -12,7 +12,7 @@ export type { MaybeAtom, } from "./atom"; -// Re-export all utility types +// Re-export useful utility types export type { MaybePromise, Truthy, CallbackOrStream } from "./util"; // Export the `StreamEnd` type