@atproto/common 0.6.0-next.0 → 0.6.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 CHANGED
@@ -1,25 +1,34 @@
1
1
  # @atproto/common
2
2
 
3
- ## 0.6.0-next.0
3
+ ## 0.6.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)! - Add back support for any `Uint8Array` as input to the `ui8ToArrayBuffer` helper
8
+
9
+ - Updated dependencies [[`e6c6343`](https://github.com/bluesky-social/atproto/commit/e6c6343bd3727455bd0da12300bb4929a944e4f1)]:
10
+ - @atproto/lex-data@0.1.1
11
+
12
+ ## 0.6.0
4
13
 
5
14
  ### Minor Changes
6
15
 
7
- - [#4929](https://github.com/bluesky-social/atproto/pull/4929) [`bb7491c`](https://github.com/bluesky-social/atproto/commit/bb7491c29e06181e1d2f8cf6eb454f9bb8ab961b) 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.
16
+ - [`affb50c`](https://github.com/bluesky-social/atproto/commit/affb50c040b497a12631df99a6310f8e78cab557) Thanks [@devinivy](https://github.com/devinivy)! - **BREAKING:** `ui8ToArrayBuffer(bytes)` now requires `Uint8Array<ArrayBuffer>` (rather than `Uint8Array`, which defaults to `<ArrayBufferLike>`). Most callers can pass the value through unchanged; in the rare case of a `SharedArrayBuffer`-backed `Uint8Array`, copy into a regular `Uint8Array` first.
8
17
 
9
- - [#4943](https://github.com/bluesky-social/atproto/pull/4943) [`07ae5d4`](https://github.com/bluesky-social/atproto/commit/07ae5d4452df51e045e0239da7a04cf0bc154028) 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.
18
+ - [#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.
10
19
 
11
- Node.js 22's `require()` compatibility layer can still load these packages in CommonJS code.
20
+ - [#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.
12
21
 
13
- - [#4930](https://github.com/bluesky-social/atproto/pull/4930) [`042df15`](https://github.com/bluesky-social/atproto/commit/042df15087c0e62cd1e715fcbf58852fab875af9) Thanks [@devinivy](https://github.com/devinivy)! - Build with TypeScript 6.0. Emitted `.d.ts` files now use TypeScript 6's stricter `Uint8Array<ArrayBuffer>` typing in places where Web/Node APIs require buffer-backed (not shared-memory) byte arrays. Consumers compiling against these types on older TypeScript should see no runtime impact, but may need to widen or cast in spots that previously relied on `Uint8Array` defaulting to `<ArrayBufferLike>`.
22
+ Node.js 22's `require()` compatibility layer can still load these packages in CommonJS code.
14
23
 
15
- Internal: tsconfig `moduleResolution: "node"` is silenced via `ignoreDeprecations: "6.0"` for now; the proper migration to `node16`/`bundler` resolution is deferred.
24
+ - [#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
25
 
17
26
  ### Patch Changes
18
27
 
19
- - Updated dependencies [[`bb7491c`](https://github.com/bluesky-social/atproto/commit/bb7491c29e06181e1d2f8cf6eb454f9bb8ab961b), [`07ae5d4`](https://github.com/bluesky-social/atproto/commit/07ae5d4452df51e045e0239da7a04cf0bc154028), [`042df15`](https://github.com/bluesky-social/atproto/commit/042df15087c0e62cd1e715fcbf58852fab875af9)]:
20
- - @atproto/common-web@0.5.0-next.0
21
- - @atproto/lex-cbor@0.1.0-next.0
22
- - @atproto/lex-data@0.1.0-next.0
28
+ - Updated dependencies [[`f01c59f`](https://github.com/bluesky-social/atproto/commit/f01c59f5bd3f75fb8b47a9eecd4858b84033fb7c), [`c459153`](https://github.com/bluesky-social/atproto/commit/c459153395a30ce89e050892c8fab7dc98e019b9), [`908bece`](https://github.com/bluesky-social/atproto/commit/908bece169258bff5ad121e5eec157d6ded6f705)]:
29
+ - @atproto/common-web@0.5.0
30
+ - @atproto/lex-cbor@0.1.0
31
+ - @atproto/lex-data@0.1.0
23
32
 
24
33
  ## 0.5.16
25
34
 
package/dist/buffers.d.ts CHANGED
@@ -1,3 +1,3 @@
1
1
  export declare function ui8ToBuffer(bytes: Uint8Array): Buffer;
2
- export declare function ui8ToArrayBuffer(bytes: Uint8Array<ArrayBuffer>): ArrayBuffer;
2
+ export declare function ui8ToArrayBuffer(bytes: Uint8Array): ArrayBuffer;
3
3
  //# sourceMappingURL=buffers.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"buffers.d.ts","sourceRoot":"","sources":["../src/buffers.ts"],"names":[],"mappings":"AAAA,wBAAgB,WAAW,CAAC,KAAK,EAAE,UAAU,GAAG,MAAM,CAErD;AAED,wBAAgB,gBAAgB,CAAC,KAAK,EAAE,UAAU,CAAC,WAAW,CAAC,GAAG,WAAW,CAK5E"}
1
+ {"version":3,"file":"buffers.d.ts","sourceRoot":"","sources":["../src/buffers.ts"],"names":[],"mappings":"AAAA,wBAAgB,WAAW,CAAC,KAAK,EAAE,UAAU,GAAG,MAAM,CAErD;AAED,wBAAgB,gBAAgB,CAAC,KAAK,EAAE,UAAU,GAAG,WAAW,CAS/D"}
package/dist/buffers.js CHANGED
@@ -2,6 +2,9 @@ export function ui8ToBuffer(bytes) {
2
2
  return Buffer.from(bytes.buffer, bytes.byteOffset, bytes.byteLength);
3
3
  }
4
4
  export function ui8ToArrayBuffer(bytes) {
5
- return bytes.buffer.slice(bytes.byteOffset, bytes.byteLength + bytes.byteOffset);
5
+ if (bytes.buffer instanceof ArrayBuffer) {
6
+ return bytes.buffer.slice(bytes.byteOffset, bytes.byteLength + bytes.byteOffset);
7
+ }
8
+ return new Uint8Array(bytes).buffer;
6
9
  }
7
10
  //# sourceMappingURL=buffers.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"buffers.js","sourceRoot":"","sources":["../src/buffers.ts"],"names":[],"mappings":"AAAA,MAAM,UAAU,WAAW,CAAC,KAAiB;IAC3C,OAAO,MAAM,CAAC,IAAI,CAAC,KAAK,CAAC,MAAM,EAAE,KAAK,CAAC,UAAU,EAAE,KAAK,CAAC,UAAU,CAAC,CAAA;AACtE,CAAC;AAED,MAAM,UAAU,gBAAgB,CAAC,KAA8B;IAC7D,OAAO,KAAK,CAAC,MAAM,CAAC,KAAK,CACvB,KAAK,CAAC,UAAU,EAChB,KAAK,CAAC,UAAU,GAAG,KAAK,CAAC,UAAU,CACpC,CAAA;AACH,CAAC","sourcesContent":["export function ui8ToBuffer(bytes: Uint8Array): Buffer {\n return Buffer.from(bytes.buffer, bytes.byteOffset, bytes.byteLength)\n}\n\nexport function ui8ToArrayBuffer(bytes: Uint8Array<ArrayBuffer>): ArrayBuffer {\n return bytes.buffer.slice(\n bytes.byteOffset,\n bytes.byteLength + bytes.byteOffset,\n )\n}\n"]}
1
+ {"version":3,"file":"buffers.js","sourceRoot":"","sources":["../src/buffers.ts"],"names":[],"mappings":"AAAA,MAAM,UAAU,WAAW,CAAC,KAAiB;IAC3C,OAAO,MAAM,CAAC,IAAI,CAAC,KAAK,CAAC,MAAM,EAAE,KAAK,CAAC,UAAU,EAAE,KAAK,CAAC,UAAU,CAAC,CAAA;AACtE,CAAC;AAED,MAAM,UAAU,gBAAgB,CAAC,KAAiB;IAChD,IAAI,KAAK,CAAC,MAAM,YAAY,WAAW,EAAE,CAAC;QACxC,OAAO,KAAK,CAAC,MAAM,CAAC,KAAK,CACvB,KAAK,CAAC,UAAU,EAChB,KAAK,CAAC,UAAU,GAAG,KAAK,CAAC,UAAU,CACpC,CAAA;IACH,CAAC;IAED,OAAO,IAAI,UAAU,CAAC,KAAK,CAAC,CAAC,MAAM,CAAA;AACrC,CAAC","sourcesContent":["export function ui8ToBuffer(bytes: Uint8Array): Buffer {\n return Buffer.from(bytes.buffer, bytes.byteOffset, bytes.byteLength)\n}\n\nexport function ui8ToArrayBuffer(bytes: Uint8Array): ArrayBuffer {\n if (bytes.buffer instanceof ArrayBuffer) {\n return bytes.buffer.slice(\n bytes.byteOffset,\n bytes.byteLength + bytes.byteOffset,\n )\n }\n\n return new Uint8Array(bytes).buffer\n}\n"]}
package/jest.config.cjs CHANGED
@@ -4,11 +4,18 @@ module.exports = {
4
4
  transform: {
5
5
  '^.+\\.(t|j)s$': [
6
6
  '@swc/jest',
7
- { jsc: { transform: {} }, module: { type: 'es6' } },
7
+ {
8
+ jsc: {
9
+ parser: { syntax: 'typescript', importAttributes: true },
10
+ experimental: { keepImportAttributes: true },
11
+ transform: {},
12
+ },
13
+ module: { type: 'es6' },
14
+ },
8
15
  ],
9
16
  },
10
17
  extensionsToTreatAsEsm: ['.ts'],
11
18
  transformIgnorePatterns: [],
12
- setupFiles: ['<rootDir>/../../jest.setup.ts'],
19
+ setupFiles: ['<rootDir>/../../test.setup.ts'],
13
20
  moduleNameMapper: { '^(\\.\\.?\\/.+)\\.js$': ['$1.ts', '$1.js'] },
14
21
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atproto/common",
3
- "version": "0.6.0-next.0",
3
+ "version": "0.6.1",
4
4
  "license": "MIT",
5
5
  "description": "Shared web-platform-friendly code for atproto libraries",
6
6
  "keywords": [
@@ -18,9 +18,9 @@
18
18
  "dependencies": {
19
19
  "multiformats": "^13.0.0",
20
20
  "pino": "^8.21.0",
21
- "@atproto/lex-cbor": "^0.1.0-next.0",
22
- "@atproto/common-web": "^0.5.0-next.0",
23
- "@atproto/lex-data": "^0.1.0-next.0"
21
+ "@atproto/common-web": "^0.5.0",
22
+ "@atproto/lex-cbor": "^0.1.0",
23
+ "@atproto/lex-data": "^0.1.1"
24
24
  },
25
25
  "devDependencies": {
26
26
  "jest": "^30.0.0",
package/src/buffers.ts CHANGED
@@ -2,9 +2,13 @@ export function ui8ToBuffer(bytes: Uint8Array): Buffer {
2
2
  return Buffer.from(bytes.buffer, bytes.byteOffset, bytes.byteLength)
3
3
  }
4
4
 
5
- export function ui8ToArrayBuffer(bytes: Uint8Array<ArrayBuffer>): ArrayBuffer {
6
- return bytes.buffer.slice(
7
- bytes.byteOffset,
8
- bytes.byteLength + bytes.byteOffset,
9
- )
5
+ export function ui8ToArrayBuffer(bytes: Uint8Array): ArrayBuffer {
6
+ if (bytes.buffer instanceof ArrayBuffer) {
7
+ return bytes.buffer.slice(
8
+ bytes.byteOffset,
9
+ bytes.byteLength + bytes.byteOffset,
10
+ )
11
+ }
12
+
13
+ return new Uint8Array(bytes).buffer
10
14
  }