barnard59-base 2.5.1 → 3.0.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.
package/CHANGELOG.md CHANGED
@@ -1,5 +1,21 @@
1
1
  # barnard59-base
2
2
 
3
+ ## 3.0.0
4
+
5
+ ### Major Changes
6
+
7
+ - [#399](https://github.com/zazuko/barnard59/pull/399) [`e5b0100`](https://github.com/zazuko/barnard59/commit/e5b01008eefe180859da3dc940fdb1b90a866abe) Thanks [@tpluscode](https://github.com/tpluscode)! - Removed `readable-stream` and replaced all usages with `node:stream`
8
+
9
+ ### Patch Changes
10
+
11
+ - [#398](https://github.com/zazuko/barnard59/pull/398) [`6a7c8af`](https://github.com/zazuko/barnard59/commit/6a7c8afbbc5889c581db05d1654e38f75e914218) Thanks [@tpluscode](https://github.com/tpluscode)! - Updated `glob` to v13
12
+
13
+ ## 2.5.2
14
+
15
+ ### Patch Changes
16
+
17
+ - 8a6c1ae: Updated OpenTelemetry packages
18
+
3
19
  ## 2.5.1
4
20
 
5
21
  ### Patch Changes
package/Readable.js CHANGED
@@ -1,4 +1,4 @@
1
- import Readable from 'readable-stream'
1
+ import { Readable } from 'node:stream'
2
2
 
3
3
  /**
4
4
  * @param {any[]} array
package/batch.js CHANGED
@@ -1,4 +1,4 @@
1
- import { Transform } from 'readable-stream'
1
+ import { Transform } from 'node:stream'
2
2
 
3
3
  /**
4
4
  * @param {number} [size]
package/combine.js CHANGED
@@ -1,10 +1,10 @@
1
1
  import duplexify from 'duplexify'
2
2
 
3
3
  /**
4
- * Limit the amount of chunks in a pipe.
5
- * @returns {import('stream').Duplex} A transform stream.
6
- * @param {(import('stream').Duplex)[]} streams
7
- * @param {*} options
4
+ * Limit the number of chunks in a pipe.
5
+ * @returns {import('node:stream').Duplex} A transform stream.
6
+ * @param {import('node:stream').Duplex[]} streams
7
+ * @param {*} [options]
8
8
  */
9
9
  function combine(streams, options) {
10
10
  if (streams.length === 0) {
package/concat.js CHANGED
@@ -1,8 +1,8 @@
1
- import { finished, Readable } from 'readable-stream'
1
+ import { finished, Readable } from 'node:stream'
2
2
 
3
3
  class ConcatStream extends Readable {
4
4
  /**
5
- * @param {(import('stream').Duplex)[]} streams
5
+ * @param {import('node:stream').Duplex[]} streams
6
6
  * @param {{
7
7
  * objectMode?: boolean
8
8
  * }} [options]
@@ -47,7 +47,7 @@ class ConcatStream extends Readable {
47
47
  }
48
48
 
49
49
  /**
50
- * @param {(import('stream').Duplex)[]} streams
50
+ * @param {import('node:stream').Duplex[]} streams
51
51
  * @return {Readable}
52
52
  */
53
53
  function factory(...streams) {
@@ -55,7 +55,7 @@ function factory(...streams) {
55
55
  }
56
56
 
57
57
  /**
58
- * @param {(import('stream').Duplex)[]} streams
58
+ * @param {import('node:stream').Duplex[]} streams
59
59
  * @return {Readable}
60
60
  */
61
61
  const object = (...streams) => {
package/dev-nul.js CHANGED
@@ -1,4 +1,4 @@
1
- import { Writable } from 'readable-stream'
1
+ import { Writable } from 'node:stream'
2
2
 
3
3
  class Nul extends Writable {
4
4
  constructor() {
package/filter.js CHANGED
@@ -12,7 +12,7 @@ import { obj } from 'through2'
12
12
  * @this {import('barnard59-core').Context}
13
13
  * @param {Filter<T, A>} func
14
14
  * @param {A} args
15
- * @return {import('stream').Transform}
15
+ * @return {import('node:stream').Transform}
16
16
  */
17
17
  function filter(func, ...args) {
18
18
  return obj((chunk, encoding, callback) => {
package/flatten.js CHANGED
@@ -11,7 +11,7 @@ import { obj } from 'through2'
11
11
  */
12
12
 
13
13
  /**
14
- * @return {import('stream').Transform} Transform
14
+ * @return {import('node:stream').Transform} Transform
15
15
  */
16
16
  function flatten() {
17
17
  return obj(function (/** IterableLike */ chunk, encoding, callback) {
package/forEach.js CHANGED
@@ -1,9 +1,9 @@
1
1
  import { promisify } from 'node:util'
2
+ import * as stream from 'node:stream'
2
3
  import { context } from '@opentelemetry/api'
3
- import stream from 'readable-stream'
4
4
  import ReadableToReadable from 'readable-to-readable'
5
5
 
6
- const { finished, Duplex } = stream
6
+ const finished = promisify(stream.finished)
7
7
 
8
8
  /**
9
9
  * @typedef {Pick<import('barnard59-core').Context, 'createPipeline' | 'variables'> & {
@@ -11,7 +11,7 @@ const { finished, Duplex } = stream
11
11
  * variable: string
12
12
  * }} ForEachOptions
13
13
  *
14
- * @typedef {import('stream').Duplex & {
14
+ * @typedef {import('node:stream').Duplex & {
15
15
  * pipeline: import('barnard59-core').Pipeline
16
16
  * }} PipelineStream
17
17
  */
@@ -20,7 +20,7 @@ async function nextLoop() {
20
20
  return new Promise(resolve => setTimeout(resolve, 0))
21
21
  }
22
22
 
23
- class ForEach extends Duplex {
23
+ class ForEach extends stream.Duplex {
24
24
  /**
25
25
  * @param {ForEachOptions} context
26
26
  */
@@ -81,7 +81,7 @@ class ForEach extends Duplex {
81
81
  this.subPipeline.stream.end(chunk)
82
82
  }
83
83
 
84
- await promisify(finished)(this.subPipeline.stream)
84
+ await finished(this.subPipeline.stream)
85
85
 
86
86
  this.pull = null
87
87
 
@@ -96,7 +96,7 @@ class ForEach extends Duplex {
96
96
  }
97
97
 
98
98
  async _read() {
99
- if (this._writableState.finished) {
99
+ if (this.writableFinished) {
100
100
  return this.push(null)
101
101
  }
102
102
 
package/glob.js CHANGED
@@ -1,7 +1,7 @@
1
+ import { Readable } from 'node:stream'
1
2
  import { SpanStatusCode } from '@opentelemetry/api'
2
3
  import { glob as globFn } from 'glob'
3
4
  import onetime from 'onetime'
4
- import { Readable } from 'readable-stream'
5
5
  import tracer from './lib/tracer.js'
6
6
 
7
7
  /**
package/json.js CHANGED
@@ -1,4 +1,4 @@
1
- import { Transform } from 'readable-stream'
1
+ import { Transform } from 'node:stream'
2
2
 
3
3
  class JsonParse extends Transform {
4
4
  constructor() {
package/map.js CHANGED
@@ -23,7 +23,7 @@ import transform from 'parallel-transform'
23
23
  * @this {import('barnard59-core').Context}
24
24
  * @param {MapOptions<From, To, Args>} options Transform function or complex options
25
25
  * @param {Args} args Additional arguments to pass to the transform function
26
- * @return {import('stream').Transform}
26
+ * @return {import('node:stream').Transform}
27
27
  * @template From, To
28
28
  * @template {Array<unknown>} Args
29
29
  */
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "barnard59-base",
3
- "version": "2.5.1",
3
+ "version": "3.0.0",
4
4
  "description": "Linked Data pipelines",
5
5
  "main": "index.js",
6
6
  "type": "module",
@@ -23,27 +23,25 @@
23
23
  },
24
24
  "homepage": "https://github.com/zazuko/barnard59",
25
25
  "dependencies": {
26
- "@opentelemetry/api": "^1.0.1",
26
+ "@opentelemetry/api": "^1.9.1",
27
27
  "duplexify": "^4.1.1",
28
- "glob": "^12",
28
+ "glob": "^13.0.6",
29
29
  "onetime": "^6.0.0",
30
30
  "parallel-transform": "^1.2.0",
31
- "readable-stream": "^3.0.6",
32
31
  "readable-to-readable": "^0.1.3",
33
32
  "through2": "^4.0.2"
34
33
  },
35
34
  "devDependencies": {
36
35
  "@types/duplexify": "^3.6.4",
37
36
  "@types/parallel-transform": "^1.1.4",
38
- "@types/readable-stream": "^4.0.11",
39
37
  "@types/readable-to-readable": "^0.1.0",
40
38
  "@types/through2": "^2.0.41",
41
- "barnard59-core": "^6.0.0",
39
+ "barnard59-core": "^7.0.0",
42
40
  "chai": "^4.3.10",
43
41
  "get-stream": "^6.0.1",
44
42
  "into-stream": "^7.0.0",
45
43
  "is-stream": "^3.0.0",
46
- "rimraf": "^3.0.2",
44
+ "rimraf": "^6.1.3",
47
45
  "sinon": "^17.0.0"
48
46
  },
49
47
  "engines": {
package/process.js CHANGED
@@ -1,4 +1,4 @@
1
- import { Transform } from 'readable-stream'
1
+ import { Transform } from 'node:stream'
2
2
 
3
3
  class StdOut extends Transform {
4
4
  /**
@@ -21,7 +21,7 @@ export function stdout() {
21
21
  }
22
22
 
23
23
  /**
24
- * @return {import('stream').Readable}
24
+ * @return {import('node:stream').Readable}
25
25
  */
26
26
  export function stdin() {
27
27
  return process.stdin
@@ -1,7 +1,7 @@
1
1
  import { deepStrictEqual, strictEqual } from 'node:assert'
2
+ import { Readable } from 'node:stream'
2
3
  import { array } from 'get-stream'
3
4
  import { isReadableStream as isReadable, isWritableStream as isWritable } from 'is-stream'
4
- import { Readable } from 'readable-stream'
5
5
  import batch from '../batch.js'
6
6
 
7
7
  describe('batch', () => {
@@ -1,7 +1,7 @@
1
1
  import { deepStrictEqual, strictEqual, rejects } from 'assert'
2
+ import { Readable } from 'node:stream'
2
3
  import getStream, { array } from 'get-stream'
3
4
  import { isReadableStream as isReadable, isWritableStream as isWritable } from 'is-stream'
4
- import { Readable } from 'readable-stream'
5
5
  import concat, { object } from '../concat.js'
6
6
 
7
7
  describe('concat', () => {
@@ -1,6 +1,6 @@
1
1
  import { deepStrictEqual } from 'assert'
2
+ import { Readable } from 'node:stream'
2
3
  import { array } from 'get-stream'
3
- import { Readable } from 'readable-stream'
4
4
  import filter from '../filter.js'
5
5
 
6
6
  describe('filter', () => {
@@ -1,7 +1,7 @@
1
1
  import { deepStrictEqual, strictEqual } from 'assert'
2
+ import { Readable } from 'node:stream'
2
3
  import { array } from 'get-stream'
3
4
  import { isReadableStream as isReadable, isWritableStream as isWritable } from 'is-stream'
4
- import { Readable } from 'readable-stream'
5
5
  import flatten from '../flatten.js'
6
6
 
7
7
  describe('flatten', () => {
package/test/map.test.js CHANGED
@@ -1,7 +1,7 @@
1
1
  import { deepStrictEqual } from 'assert'
2
+ import { Readable } from 'node:stream'
2
3
  import getStream, { array } from 'get-stream'
3
4
  import intoStream from 'into-stream'
4
- import { Readable } from 'readable-stream'
5
5
  import map from '../map.js'
6
6
 
7
7
  describe('map', () => {
package/toReadable.js CHANGED
@@ -1,4 +1,4 @@
1
- import Readable from 'readable-stream'
1
+ import Readable from 'node:stream'
2
2
 
3
3
  class ToReadable extends Readable {
4
4
  constructor(content, { objectMode = false } = {}) {
package/toString.js CHANGED
@@ -1,4 +1,4 @@
1
- import { Transform } from 'readable-stream'
1
+ import { Transform } from 'node:stream'
2
2
 
3
3
  class ToString extends Transform {
4
4
  constructor() {
@@ -11,7 +11,7 @@ class ToString extends Transform {
11
11
  /**
12
12
  * @param {Uint8Array | string} chunk
13
13
  * @param {BufferEncoding} encoding
14
- * @param {import('stream').TransformCallback} callback
14
+ * @param {import('node:stream').TransformCallback} callback
15
15
  */
16
16
  _transform(chunk, encoding, callback) {
17
17
  callback(null, chunk.toString())
package/Readable.d.ts DELETED
@@ -1,6 +0,0 @@
1
- /**
2
- * @param {any[]} array
3
- * @return {ReturnType<Readable.from>}
4
- */
5
- export function from(...array: any[]): ReturnType<typeof Readable.from>;
6
- import Readable from 'readable-stream';
package/batch.d.ts DELETED
@@ -1,7 +0,0 @@
1
- export default batch;
2
- /**
3
- * @param {number} [size]
4
- * @return {Transform}
5
- */
6
- declare function batch(size?: number | undefined): Transform;
7
- import { Transform } from 'readable-stream';
package/combine.d.ts DELETED
@@ -1,8 +0,0 @@
1
- export default combine;
2
- /**
3
- * Limit the amount of chunks in a pipe.
4
- * @returns {import('stream').Duplex} A transform stream.
5
- * @param {(import('stream').Duplex)[]} streams
6
- * @param {*} options
7
- */
8
- declare function combine(streams: (import('stream').Duplex)[], options: any): import('stream').Duplex;
package/concat.d.ts DELETED
@@ -1,15 +0,0 @@
1
- export default factory;
2
- /**
3
- * @param {(import('stream').Duplex)[]} streams
4
- * @return {Readable}
5
- */
6
- declare function factory(...streams: (import('stream').Duplex)[]): Readable;
7
- declare namespace factory {
8
- export { object };
9
- }
10
- /**
11
- * @param {(import('stream').Duplex)[]} streams
12
- * @return {Readable}
13
- */
14
- export function object(...streams: (import('stream').Duplex)[]): Readable;
15
- import { Readable } from 'readable-stream';
package/dev-nul.d.ts DELETED
@@ -1,6 +0,0 @@
1
- export default factory;
2
- /**
3
- * @return {Writable}
4
- */
5
- declare function factory(): Writable;
6
- import { Writable } from 'readable-stream';
package/filter.d.ts DELETED
@@ -1,19 +0,0 @@
1
- export default filter;
2
- /**
3
- * <T, A>
4
- */
5
- export type Filter<T, A extends unknown[]> = (this: import('barnard59-core').Context, chunk: T, encoding: string, ...args: A) => boolean | Promise<boolean>;
6
- /**
7
- * @typedef {(this: import('barnard59-core').Context, chunk: T, encoding: string, ...args: A) => boolean | Promise<boolean>} Filter<T, A>
8
- * @template T
9
- * @template {Array<unknown>} A
10
- */
11
- /**
12
- * @template T
13
- * @template {Array<unknown>} A
14
- * @this {import('barnard59-core').Context}
15
- * @param {Filter<T, A>} func
16
- * @param {A} args
17
- * @return {import('stream').Transform}
18
- */
19
- declare function filter<T, A extends unknown[]>(this: import("barnard59-core").Context, func: Filter<T, A>, ...args: A): import('stream').Transform;
package/flatten.d.ts DELETED
@@ -1,17 +0,0 @@
1
- export default flatten;
2
- export type ForEachCallback = (item: unknown) => void;
3
- export type IterableLike = Iterable<unknown> | {
4
- forEach(cb: ForEachCallback): void;
5
- };
6
- /**
7
- * @callback ForEachCallback
8
- * @param {unknown} item
9
- * @return {void}
10
- */
11
- /**
12
- * @typedef {Iterable<unknown> | { forEach(cb: ForEachCallback): void }} IterableLike
13
- */
14
- /**
15
- * @return {import('stream').Transform} Transform
16
- */
17
- declare function flatten(): import('stream').Transform;
package/forEach.d.ts DELETED
@@ -1,40 +0,0 @@
1
- export default factory;
2
- export type ForEachOptions = Pick<import('barnard59-core').Context, 'createPipeline' | 'variables'> & {
3
- pipeline: PipelineStream;
4
- variable: string;
5
- };
6
- export type PipelineStream = import('stream').Duplex & {
7
- pipeline: import('barnard59-core').Pipeline;
8
- };
9
- /**
10
- * @this {import('barnard59-core').Context}
11
- * @param {PipelineStream} pipeline
12
- * @param {string} variable
13
- * @return {ForEach}
14
- */
15
- declare function factory(this: import("barnard59-core").Context, pipeline: PipelineStream, variable: string): ForEach;
16
- declare class ForEach extends stream.Duplex {
17
- /**
18
- * @param {ForEachOptions} context
19
- */
20
- constructor({ createPipeline, pipeline, variable, variables }: ForEachOptions);
21
- _read(): Promise<boolean | undefined>;
22
- /**
23
- * @param {*} chunk
24
- * @param {string} encoding
25
- * @param {(error?: (Error | null)) => void} callback
26
- */
27
- _write(chunk: any, encoding: string, callback: (error?: (Error | null)) => void): Promise<void>;
28
- createPipeline: (ptr: import("clownface").GraphPointer, arg?: Partial<import("barnard59-core").PipelineOptions> | undefined) => import("barnard59-core").Pipeline;
29
- ptr: import("clownface").GraphPointer;
30
- variable: string;
31
- variables: Map<string, unknown>;
32
- pull: ReadableToReadable.ReadFunction | null;
33
- set subPipeline(subPipeline: import("barnard59-core").Pipeline);
34
- /**
35
- * @type import('barnard59-core').Pipeline
36
- */
37
- get subPipeline(): import("barnard59-core").Pipeline;
38
- }
39
- import stream from 'readable-stream';
40
- import ReadableToReadable from 'readable-to-readable';
package/glob.d.ts DELETED
@@ -1,10 +0,0 @@
1
- export default glob;
2
- /**
3
- * @this {import('barnard59-core').Context}
4
- * @param {{ pattern: string } & Omit<import('glob').GlobOptions, 'withFileTypes'>} options
5
- * @return {Readable}
6
- */
7
- declare function glob(this: import("barnard59-core").Context, { pattern, ...options }: {
8
- pattern: string;
9
- } & Omit<import('glob').GlobOptions, 'withFileTypes'>): Readable;
10
- import { Readable } from 'readable-stream';
package/index.d.ts DELETED
@@ -1,15 +0,0 @@
1
- export { default as combine } from "./combine.js";
2
- export { default as filter } from "./filter.js";
3
- export { default as flatten } from "./flatten.js";
4
- export { default as forEach } from "./forEach.js";
5
- export { default as glob } from "./glob.js";
6
- export { default as limit } from "./limit.js";
7
- export { default as map } from "./map.js";
8
- export { default as nul } from "./dev-nul.js";
9
- export { default as offset } from "./offset.js";
10
- export * from "./process.js";
11
- export { default as toString } from "./toString.js";
12
- export { default as batch } from "./batch.js";
13
- export { from as streamValues } from "./Readable.js";
14
- export { default as concat, object as concatObject } from "./concat.js";
15
- export { parse as jsonParse, stringify as jsonStringify } from "./json.js";
package/json.d.ts DELETED
@@ -1,9 +0,0 @@
1
- /**
2
- * @return {Transform}
3
- */
4
- export function parse(): Transform;
5
- /**
6
- * @return {Transform}
7
- */
8
- export function stringify(): Transform;
9
- import { Transform } from 'readable-stream';
package/lib/tracer.d.ts DELETED
@@ -1,2 +0,0 @@
1
- export default tracer;
2
- declare const tracer: import("@opentelemetry/api").Tracer;
package/limit.d.ts DELETED
@@ -1,5 +0,0 @@
1
- /**
2
- * Limit the amount of chunks in a pipe.
3
- * @param {number} limit Limit the amount of chunks passed through the pipe.
4
- */
5
- export default function limit(limit: number): (stream: AsyncIterable<any>) => AsyncGenerator<any, void, unknown>;
package/map.d.ts DELETED
@@ -1,33 +0,0 @@
1
- /**
2
- * @typedef {(this: import('barnard59-core').Context, chunk: From, ...args: Args) => Promise<To> | To} MapCallback
3
- * @template From, To
4
- * @template {Array<unknown>} Args
5
- */
6
- /**
7
- * @typedef {{
8
- * map: MapCallback<From, To, Args>
9
- * concurrency?: number
10
- * ordered?: boolean
11
- * objectMode?: boolean
12
- * }|MapCallback<From, To, Args>} MapOptions
13
- * @template From, To
14
- * @template {Array<unknown>} Args
15
- */
16
- /**
17
- * Processes chunks with a transform function
18
- *
19
- * @this {import('barnard59-core').Context}
20
- * @param {MapOptions<From, To, Args>} options Transform function or complex options
21
- * @param {Args} args Additional arguments to pass to the transform function
22
- * @return {import('stream').Transform}
23
- * @template From, To
24
- * @template {Array<unknown>} Args
25
- */
26
- export default function map<From, To, Args extends unknown[]>(this: import("barnard59-core").Context, options: MapOptions<From, To, Args>, ...args: Args): import('stream').Transform;
27
- export type MapCallback<From, To, Args extends unknown[]> = (this: import('barnard59-core').Context, chunk: From, ...args: Args) => Promise<To> | To;
28
- export type MapOptions<From, To, Args extends unknown[]> = {
29
- map: MapCallback<From, To, Args>;
30
- concurrency?: number;
31
- ordered?: boolean;
32
- objectMode?: boolean;
33
- } | MapCallback<From, To, Args>;
package/offset.d.ts DELETED
@@ -1,5 +0,0 @@
1
- /**
2
- * Limit the amount of chunks in a pipe.
3
- * @param {number} offset
4
- */
5
- export default function _default(offset: number): (stream: AsyncIterable<any>) => AsyncGenerator<any, void, unknown>;
package/process.d.ts DELETED
@@ -1,9 +0,0 @@
1
- /**
2
- * @return {Transform}
3
- */
4
- export function stdout(): Transform;
5
- /**
6
- * @return {import('stream').Readable}
7
- */
8
- export function stdin(): import('stream').Readable;
9
- import { Transform } from 'readable-stream';
package/toString.d.ts DELETED
@@ -1,6 +0,0 @@
1
- export default factory;
2
- /**
3
- * @return {Transform}
4
- */
5
- declare function factory(): Transform;
6
- import { Transform } from 'readable-stream';