@atproto/lex-data 0.1.0-next.0 → 0.1.1
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 +10 -6
- package/dist/lib/nodejs-buffer.d.ts +6 -4
- package/dist/lib/nodejs-buffer.d.ts.map +1 -1
- package/dist/lib/nodejs-buffer.js.map +1 -1
- package/dist/uint8array-concat.js.map +1 -1
- package/package.json +1 -1
- package/src/lib/nodejs-buffer.ts +12 -4
- package/src/uint8array-concat.ts +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,18 +1,22 @@
|
|
|
1
1
|
# @atproto/lex-data
|
|
2
2
|
|
|
3
|
-
## 0.1.
|
|
3
|
+
## 0.1.1
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [#4954](https://github.com/bluesky-social/atproto/pull/4954) [`e6c6343`](https://github.com/bluesky-social/atproto/commit/e6c6343bd3727455bd0da12300bb4929a944e4f1) Thanks [@matthieusieben](https://github.com/matthieusieben)! - Fix typing of internal NodeJS buffer
|
|
8
|
+
|
|
9
|
+
## 0.1.0
|
|
4
10
|
|
|
5
11
|
### Minor Changes
|
|
6
12
|
|
|
7
|
-
- [#4929](https://github.com/bluesky-social/atproto/pull/4929) [`
|
|
13
|
+
- [#4929](https://github.com/bluesky-social/atproto/pull/4929) [`f01c59f`](https://github.com/bluesky-social/atproto/commit/f01c59f5bd3f75fb8b47a9eecd4858b84033fb7c) Thanks [@devinivy](https://github.com/devinivy)! - **BREAKING:** Drop support for Node.js 18 and 20. Node.js 22 is now the minimum supported version. Docker images now use Node.js 24.
|
|
8
14
|
|
|
9
|
-
- [#4943](https://github.com/bluesky-social/atproto/pull/4943) [`
|
|
15
|
+
- [#4943](https://github.com/bluesky-social/atproto/pull/4943) [`c459153`](https://github.com/bluesky-social/atproto/commit/c459153395a30ce89e050892c8fab7dc98e019b9) Thanks [@devinivy](https://github.com/devinivy)! - **BREAKING:** Convert to pure ESM. All packages now ship `"type": "module"` with ES module output and Node16 module resolution.
|
|
10
16
|
|
|
11
17
|
Node.js 22's `require()` compatibility layer can still load these packages in CommonJS code.
|
|
12
18
|
|
|
13
|
-
- [#4930](https://github.com/bluesky-social/atproto/pull/4930) [`
|
|
14
|
-
|
|
15
|
-
Internal: tsconfig `moduleResolution: "node"` is silenced via `ignoreDeprecations: "6.0"` for now; the proper migration to `node16`/`bundler` resolution is deferred.
|
|
19
|
+
- [#4930](https://github.com/bluesky-social/atproto/pull/4930) [`908bece`](https://github.com/bluesky-social/atproto/commit/908bece169258bff5ad121e5eec157d6ded6f705) Thanks [@devinivy](https://github.com/devinivy)! - Build with TypeScript 6.0.
|
|
16
20
|
|
|
17
21
|
## 0.0.15
|
|
18
22
|
|
|
@@ -5,13 +5,15 @@ type WithImplicitCoercion<T> = T | {
|
|
|
5
5
|
interface NodeJSBuffer<TArrayBuffer extends ArrayBufferLike = ArrayBufferLike> extends Uint8Array<TArrayBuffer> {
|
|
6
6
|
byteLength: number;
|
|
7
7
|
toString(encoding?: Encoding): string;
|
|
8
|
+
slice(start?: number, end?: number): NodeJSBuffer<ArrayBuffer>;
|
|
9
|
+
subarray(start?: number, end?: number): NodeJSBuffer<TArrayBuffer>;
|
|
8
10
|
}
|
|
9
11
|
interface NodeJSBufferConstructor {
|
|
10
12
|
new (input: string, encoding?: Encoding): NodeJSBuffer;
|
|
11
|
-
from(
|
|
12
|
-
from(
|
|
13
|
-
from<TArrayBuffer extends ArrayBufferLike>(arrayBuffer: WithImplicitCoercion<TArrayBuffer>, byteOffset?: number, length?: number):
|
|
14
|
-
concat(list: readonly Uint8Array[], totalLength?: number): NodeJSBuffer
|
|
13
|
+
from(string: WithImplicitCoercion<string>, encoding?: BufferEncoding): NodeJSBuffer<ArrayBuffer>;
|
|
14
|
+
from(arrayOrString: WithImplicitCoercion<ArrayLike<number> | string>): NodeJSBuffer<ArrayBuffer>;
|
|
15
|
+
from<TArrayBuffer extends ArrayBufferLike>(arrayBuffer: WithImplicitCoercion<TArrayBuffer>, byteOffset?: number, length?: number): NodeJSBuffer<TArrayBuffer>;
|
|
16
|
+
concat(list: readonly Uint8Array[], totalLength?: number): NodeJSBuffer<ArrayBuffer>;
|
|
15
17
|
byteLength(input: string, encoding?: Encoding): number;
|
|
16
18
|
prototype: NodeJSBuffer;
|
|
17
19
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"nodejs-buffer.d.ts","sourceRoot":"","sources":["../../src/lib/nodejs-buffer.ts"],"names":[],"mappings":"AAAA,KAAK,QAAQ,GAAG,MAAM,GAAG,QAAQ,GAAG,WAAW,CAAA;AAK/C,KAAK,oBAAoB,CAAC,CAAC,IAAI,CAAC,GAAG;IAAE,OAAO,IAAI,CAAC,CAAA;CAAE,CAAA;AAEnD,UAAU,YAAY,CAAC,YAAY,SAAS,eAAe,GAAG,eAAe,CAC3E,SAAQ,UAAU,CAAC,YAAY,CAAC;IAChC,UAAU,EAAE,MAAM,CAAA;IAClB,QAAQ,CAAC,QAAQ,CAAC,EAAE,QAAQ,GAAG,MAAM,CAAA;
|
|
1
|
+
{"version":3,"file":"nodejs-buffer.d.ts","sourceRoot":"","sources":["../../src/lib/nodejs-buffer.ts"],"names":[],"mappings":"AAAA,KAAK,QAAQ,GAAG,MAAM,GAAG,QAAQ,GAAG,WAAW,CAAA;AAK/C,KAAK,oBAAoB,CAAC,CAAC,IAAI,CAAC,GAAG;IAAE,OAAO,IAAI,CAAC,CAAA;CAAE,CAAA;AAEnD,UAAU,YAAY,CAAC,YAAY,SAAS,eAAe,GAAG,eAAe,CAC3E,SAAQ,UAAU,CAAC,YAAY,CAAC;IAChC,UAAU,EAAE,MAAM,CAAA;IAClB,QAAQ,CAAC,QAAQ,CAAC,EAAE,QAAQ,GAAG,MAAM,CAAA;IACrC,KAAK,CAAC,KAAK,CAAC,EAAE,MAAM,EAAE,GAAG,CAAC,EAAE,MAAM,GAAG,YAAY,CAAC,WAAW,CAAC,CAAA;IAC9D,QAAQ,CAAC,KAAK,CAAC,EAAE,MAAM,EAAE,GAAG,CAAC,EAAE,MAAM,GAAG,YAAY,CAAC,YAAY,CAAC,CAAA;CACnE;AAED,UAAU,uBAAuB;IAC/B,KAAK,KAAK,EAAE,MAAM,EAAE,QAAQ,CAAC,EAAE,QAAQ,GAAG,YAAY,CAAA;IACtD,IAAI,CACF,MAAM,EAAE,oBAAoB,CAAC,MAAM,CAAC,EACpC,QAAQ,CAAC,EAAE,cAAc,GACxB,YAAY,CAAC,WAAW,CAAC,CAAA;IAC5B,IAAI,CACF,aAAa,EAAE,oBAAoB,CAAC,SAAS,CAAC,MAAM,CAAC,GAAG,MAAM,CAAC,GAC9D,YAAY,CAAC,WAAW,CAAC,CAAA;IAC5B,IAAI,CAAC,YAAY,SAAS,eAAe,EACvC,WAAW,EAAE,oBAAoB,CAAC,YAAY,CAAC,EAC/C,UAAU,CAAC,EAAE,MAAM,EACnB,MAAM,CAAC,EAAE,MAAM,GACd,YAAY,CAAC,YAAY,CAAC,CAAA;IAC7B,MAAM,CACJ,IAAI,EAAE,SAAS,UAAU,EAAE,EAC3B,WAAW,CAAC,EAAE,MAAM,GACnB,YAAY,CAAC,WAAW,CAAC,CAAA;IAC5B,UAAU,CAAC,KAAK,EAAE,MAAM,EAAE,QAAQ,CAAC,EAAE,QAAQ,GAAG,MAAM,CAAA;IACtD,SAAS,EAAE,YAAY,CAAA;CACxB;AAMD,eAAO,MAAM,YAAY,EAAE,uBAAuB,GAAG,IAIT,CAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"nodejs-buffer.js","sourceRoot":"","sources":["../../src/lib/nodejs-buffer.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"nodejs-buffer.js","sourceRoot":"","sources":["../../src/lib/nodejs-buffer.ts"],"names":[],"mappings":"AAqCA,6EAA6E;AAC7E,6EAA6E;AAC7E,qBAAqB;AACrB,MAAM,MAAM,GAAG,aAAa,CAAC,CAAC,GAAG,EAAE,CAAC,IAAI,GAAG,GAAG,CAAC,MAAM,CAAC,CAAC,CAAC,GAAG,IAAI,CAAC,EAAc,CAAA;AAC9E,MAAM,CAAC,MAAM,YAAY,GACtB,UAAkB,EAAE,CAAC,MAAM,CAAC,EAAE,SAAS,YAAY,UAAU;IAC9D,YAAY,IAAK,UAAkB,CAAC,MAAM,CAAC;IACzC,CAAC,CAAG,UAAkB,CAAC,MAAM,CAA6B;IAC1D,CAAC,CAAC,iCAAiC,CAAC,IAAI,CAAA","sourcesContent":["type Encoding = 'utf8' | 'base64' | 'base64url'\n\n// Node's buffer module declares this type internally, but referencing it here\n// would couple this file to @types/node. Local copy keeps this module\n// standalone so it compiles in any environment (see tsconfig/isomorphic.json).\ntype WithImplicitCoercion<T> = T | { valueOf(): T }\n\ninterface NodeJSBuffer<TArrayBuffer extends ArrayBufferLike = ArrayBufferLike>\n extends Uint8Array<TArrayBuffer> {\n byteLength: number\n toString(encoding?: Encoding): string\n slice(start?: number, end?: number): NodeJSBuffer<ArrayBuffer>\n subarray(start?: number, end?: number): NodeJSBuffer<TArrayBuffer>\n}\n\ninterface NodeJSBufferConstructor {\n new (input: string, encoding?: Encoding): NodeJSBuffer\n from(\n string: WithImplicitCoercion<string>,\n encoding?: BufferEncoding,\n ): NodeJSBuffer<ArrayBuffer>\n from(\n arrayOrString: WithImplicitCoercion<ArrayLike<number> | string>,\n ): NodeJSBuffer<ArrayBuffer>\n from<TArrayBuffer extends ArrayBufferLike>(\n arrayBuffer: WithImplicitCoercion<TArrayBuffer>,\n byteOffset?: number,\n length?: number,\n ): NodeJSBuffer<TArrayBuffer>\n concat(\n list: readonly Uint8Array[],\n totalLength?: number,\n ): NodeJSBuffer<ArrayBuffer>\n byteLength(input: string, encoding?: Encoding): number\n prototype: NodeJSBuffer\n}\n\n// Avoids a direct reference to Node.js Buffer, which might not exist in some\n// environments (e.g. browsers, Deno, Bun) to prevent bundlers from trying to\n// include polyfills.\nconst BUFFER = /*#__PURE__*/ (() => 'Bu' + 'f'.repeat(2) + 'er')() as 'Buffer'\nexport const NodeJSBuffer: NodeJSBufferConstructor | null =\n (globalThis as any)?.[BUFFER]?.prototype instanceof Uint8Array &&\n 'byteLength' in (globalThis as any)[BUFFER]\n ? ((globalThis as any)[BUFFER] as NodeJSBufferConstructor)\n : /* v8 ignore next -- @preserve */ null\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"uint8array-concat.js","sourceRoot":"","sources":["../src/uint8array-concat.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,wBAAwB,CAAA;AAErD,MAAM,MAAM,GAAG,YAAY,CAAA;AAE3B,MAAM,CAAC,MAAM,aAAa,GAAG,MAAM;IACjC,CAAC,CAAC,SAAS,aAAa,CACpB,KAA4B;QAE5B,OAAO,MAAM,CAAC,MAAM,CAAC,KAAK,
|
|
1
|
+
{"version":3,"file":"uint8array-concat.js","sourceRoot":"","sources":["../src/uint8array-concat.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,wBAAwB,CAAA;AAErD,MAAM,MAAM,GAAG,YAAY,CAAA;AAE3B,MAAM,CAAC,MAAM,aAAa,GAAG,MAAM;IACjC,CAAC,CAAC,SAAS,aAAa,CACpB,KAA4B;QAE5B,OAAO,MAAM,CAAC,MAAM,CAAC,KAAK,CAAC,CAAA;IAC7B,CAAC;IACH,CAAC,CAAC,iCAAiC,CAAC,IAAI,CAAA;AAE1C,MAAM,UAAU,iBAAiB,CAC/B,KAA4B;IAE5B,IAAI,WAAW,GAAG,CAAC,CAAA;IACnB,KAAK,MAAM,GAAG,IAAI,KAAK;QAAE,WAAW,IAAI,GAAG,CAAC,MAAM,CAAA;IAClD,MAAM,MAAM,GAAG,IAAI,UAAU,CAAC,WAAW,CAAC,CAAA;IAC1C,IAAI,MAAM,GAAG,CAAC,CAAA;IACd,KAAK,MAAM,GAAG,IAAI,KAAK,EAAE,CAAC;QACxB,MAAM,CAAC,GAAG,CAAC,GAAG,EAAE,MAAM,CAAC,CAAA;QACvB,MAAM,IAAI,GAAG,CAAC,MAAM,CAAA;IACtB,CAAC;IACD,OAAO,MAAM,CAAA;AACf,CAAC","sourcesContent":["import { NodeJSBuffer } from './lib/nodejs-buffer.js'\n\nconst Buffer = NodeJSBuffer\n\nexport const ui8ConcatNode = Buffer\n ? function ui8ConcatNode(\n array: readonly Uint8Array[],\n ): Uint8Array<ArrayBuffer> {\n return Buffer.concat(array)\n }\n : /* v8 ignore next -- @preserve */ null\n\nexport function ui8ConcatPonyfill(\n array: readonly Uint8Array[],\n): Uint8Array<ArrayBuffer> {\n let totalLength = 0\n for (const arr of array) totalLength += arr.length\n const result = new Uint8Array(totalLength)\n let offset = 0\n for (const arr of array) {\n result.set(arr, offset)\n offset += arr.length\n }\n return result\n}\n"]}
|
package/package.json
CHANGED
package/src/lib/nodejs-buffer.ts
CHANGED
|
@@ -9,20 +9,28 @@ interface NodeJSBuffer<TArrayBuffer extends ArrayBufferLike = ArrayBufferLike>
|
|
|
9
9
|
extends Uint8Array<TArrayBuffer> {
|
|
10
10
|
byteLength: number
|
|
11
11
|
toString(encoding?: Encoding): string
|
|
12
|
+
slice(start?: number, end?: number): NodeJSBuffer<ArrayBuffer>
|
|
13
|
+
subarray(start?: number, end?: number): NodeJSBuffer<TArrayBuffer>
|
|
12
14
|
}
|
|
13
15
|
|
|
14
16
|
interface NodeJSBufferConstructor {
|
|
15
17
|
new (input: string, encoding?: Encoding): NodeJSBuffer
|
|
16
18
|
from(
|
|
17
|
-
|
|
19
|
+
string: WithImplicitCoercion<string>,
|
|
20
|
+
encoding?: BufferEncoding,
|
|
21
|
+
): NodeJSBuffer<ArrayBuffer>
|
|
22
|
+
from(
|
|
23
|
+
arrayOrString: WithImplicitCoercion<ArrayLike<number> | string>,
|
|
18
24
|
): NodeJSBuffer<ArrayBuffer>
|
|
19
|
-
from(input: string, encoding?: Encoding): NodeJSBuffer<ArrayBuffer>
|
|
20
25
|
from<TArrayBuffer extends ArrayBufferLike>(
|
|
21
26
|
arrayBuffer: WithImplicitCoercion<TArrayBuffer>,
|
|
22
27
|
byteOffset?: number,
|
|
23
28
|
length?: number,
|
|
24
|
-
):
|
|
25
|
-
concat(
|
|
29
|
+
): NodeJSBuffer<TArrayBuffer>
|
|
30
|
+
concat(
|
|
31
|
+
list: readonly Uint8Array[],
|
|
32
|
+
totalLength?: number,
|
|
33
|
+
): NodeJSBuffer<ArrayBuffer>
|
|
26
34
|
byteLength(input: string, encoding?: Encoding): number
|
|
27
35
|
prototype: NodeJSBuffer
|
|
28
36
|
}
|
package/src/uint8array-concat.ts
CHANGED
|
@@ -6,7 +6,7 @@ export const ui8ConcatNode = Buffer
|
|
|
6
6
|
? function ui8ConcatNode(
|
|
7
7
|
array: readonly Uint8Array[],
|
|
8
8
|
): Uint8Array<ArrayBuffer> {
|
|
9
|
-
return Buffer.concat(array)
|
|
9
|
+
return Buffer.concat(array)
|
|
10
10
|
}
|
|
11
11
|
: /* v8 ignore next -- @preserve */ null
|
|
12
12
|
|