Skip to content

Commit 59f43b5

Browse files
committed
Merge branch 'async-for-blobs' into rc
2 parents a912ceb + 12f0e75 commit 59f43b5

25 files changed

+1626
-25954
lines changed

.github/workflows/bun.yml

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
# This workflow will do a clean installation of node dependencies, cache/restore them, build the source code and run tests across different versions of node
2+
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-nodejs
3+
4+
name: Bun CI
5+
6+
on:
7+
push:
8+
pull_request:
9+
10+
jobs:
11+
build:
12+
runs-on: ubuntu-latest
13+
steps:
14+
- uses: actions/checkout@v4
15+
- uses: oven-sh/setup-bun@v1
16+
- run: bun install --frozen-lockfile
17+
- run: bun run build
18+
- run: bun test
19+
- run: bun run check

.github/workflows/node.js.yml

Lines changed: 29 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -1,34 +1,34 @@
1-
# This workflow will do a clean installation of node dependencies, cache/restore them, build the source code and run tests across different versions of node
2-
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-nodejs
1+
# # This workflow will do a clean installation of node dependencies, cache/restore them, build the source code and run tests across different versions of node
2+
# # For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-nodejs
33

4-
name: Node.js CI
4+
# name: Node.js CI
55

6-
on:
7-
push:
8-
branches: ["master"]
9-
pull_request:
10-
branches: ["master"]
6+
# on:
7+
# push:
8+
# branches: ["master"]
9+
# pull_request:
10+
# branches: ["master"]
1111

12-
jobs:
13-
build:
14-
runs-on: ubuntu-latest
12+
# jobs:
13+
# build:
14+
# runs-on: ubuntu-latest
1515

16-
strategy:
17-
matrix:
18-
node-version: [16.x, 18.x]
19-
# See supported Node.js release schedule at https://nodejs.org/en/about/releases/
16+
# strategy:
17+
# matrix:
18+
# node-version: [16.x, 18.x, 20.x]
19+
# # See supported Node.js release schedule at https://nodejs.org/en/about/releases/
2020

21-
steps:
22-
- uses: actions/checkout@v3
23-
- name: Use Node.js ${{ matrix.node-version }}
24-
uses: actions/setup-node@v3
25-
with:
26-
node-version: ${{ matrix.node-version }}
27-
cache: "npm"
28-
- run: npm ci
29-
- run: npm run build
30-
- run: npm run coverage
31-
- name: Publish code coverage to CodeClimate
32-
uses: paambaati/codeclimate-action@v3.2.0
33-
env:
34-
CC_TEST_REPORTER_ID: ${{secrets.CC_TEST_REPORTER_ID}}
21+
# steps:
22+
# - uses: actions/checkout@v3
23+
# - name: Use Node.js ${{ matrix.node-version }}
24+
# uses: actions/setup-node@v3
25+
# with:
26+
# node-version: ${{ matrix.node-version }}
27+
# cache: "npm"
28+
# - run: npm ci
29+
# - run: npm run build
30+
# - run: npm run coverage
31+
# - name: Publish code coverage to CodeClimate
32+
# uses: paambaati/codeclimate-action@v5.0.0
33+
# env:
34+
# CC_TEST_REPORTER_ID: ${{secrets.CC_TEST_REPORTER_ID}}

.github/workflows/prettier.yml

Lines changed: 7 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,16 @@
1-
# From https://til.simonwillison.net/github-actions/prettier-github-actions
21
name: Check JavaScript for conformance with Prettier
32

43
on:
54
push:
65
pull_request:
76

87
jobs:
9-
prettier:
8+
biome:
109
runs-on: ubuntu-latest
1110
steps:
12-
- name: Check out repo
13-
uses: actions/checkout@v3
14-
- uses: actions/cache@v3
15-
name: Configure npm caching
16-
with:
17-
path: ~/.npm
18-
key: ${{ runner.os }}-npm-${{ hashFiles('**/workflows/prettier.yml') }}
19-
restore-keys: |
20-
${{ runner.os }}-npm-
21-
- name: Run prettier
22-
run: |-
23-
npx prettier --check .
11+
- name: Checkout
12+
uses: actions/checkout@v4
13+
- name: Setup Biome
14+
uses: biomejs/setup-biome@v1
15+
- name: Run Biome
16+
run: biome ci .

.github/workflows/release.yml

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -13,16 +13,13 @@ jobs:
1313
uses: actions/checkout@v3
1414
with:
1515
fetch-depth: 0
16-
- name: Setup Node.js
17-
uses: actions/setup-node@v3
18-
with:
19-
node-version: "lts/*"
16+
- uses: oven-sh/setup-bun@v1
2017
- name: Install dependencies
21-
run: npm ci
18+
run: bun install --frozen-lockfile
2219
- name: Build
23-
run: npm run build
20+
run: bun run build
2421
- name: Release
2522
env:
2623
GITHUB_TOKEN: ${{ secrets.SEMANTIC_RELEASE_GH_TOKEN }}
2724
NPM_TOKEN: ${{ secrets.SEMANTIC_RELEASE_NPM_TOKEN }}
28-
run: npx semantic-release
25+
run: bun run semantic-release

.npmignore

Whitespace-only changes.

.prettierignore

Lines changed: 0 additions & 3 deletions
This file was deleted.

.prettierrc.toml

Lines changed: 0 additions & 3 deletions
This file was deleted.

.vscode/settings.json

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,3 @@
11
{
2-
"standard.semistandard": true,
3-
"standard.usePackageJson": true,
4-
"standard.autoFixOnSave": true,
5-
"javascript.validate.enable": false,
6-
"eslint.autoFixOnSave": true
2+
"editor.defaultFormatter": "biomejs.biome"
73
}

CHANGELOG.md

Lines changed: 10 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,22 @@
1-
# [2.0.0-rc.1](https://github.com/peers/js-binarypack/compare/v1.0.3-rc.1...v2.0.0-rc.1) (2023-02-25)
1+
# [2.0.0](https://github.com/peers/js-binarypack/compare/v1.0.2...v2.0.0) (2023-06-22)
22

33

4-
### Features
4+
### Bug Fixes
55

6-
* return `ArrayBuffer` instead of `Blob` ([689eafd](https://github.com/peers/js-binarypack/commit/689eafd471fccb7eae0d68528b764d691e9d96b2))
6+
* empty TypedArray can now be packed ([3475f45](https://github.com/peers/js-binarypack/commit/3475f450a7bc97b757325cd54bc7ba7ffc84118b))
7+
* undefined will stay undefined instead of null ([83af274](https://github.com/peers/js-binarypack/commit/83af274ea82fdd44d93546f18cbcf547abe77804))
78

89

9-
### BREAKING CHANGES
10-
11-
* Return type of `pack` is now `ArrayBuffer`
10+
### Features
1211

13-
## [1.0.3-rc.1](https://github.com/peers/js-binarypack/compare/v1.0.2...v1.0.3-rc.1) (2023-02-25)
12+
* return `ArrayBuffer` instead of `Blob` ([6b70875](https://github.com/peers/js-binarypack/commit/6b70875b4d7db791fdd14a1f3ff3776d12febfb2))
1413

1514

16-
### Bug Fixes
15+
### Reverts
1716

18-
* empty TypedArray can now be packed ([3475f45](https://github.com/peers/js-binarypack/commit/3475f450a7bc97b757325cd54bc7ba7ffc84118b))
19-
* undefined will stay undefined instead of null ([83af274](https://github.com/peers/js-binarypack/commit/83af274ea82fdd44d93546f18cbcf547abe77804))
17+
* Revert "fix: undefined will stay undefined instead of null" ([da49137](https://github.com/peers/js-binarypack/commit/da4913787d9ab96845bd8e512d5f501574746a35))
2018

2119

22-
### Reverts
20+
### BREAKING CHANGES
2321

24-
* Revert "fix: undefined will stay undefined instead of null" ([da49137](https://github.com/peers/js-binarypack/commit/da4913787d9ab96845bd8e512d5f501574746a35))
22+
* Return type of `pack` is now `ArrayBuffer`

__test__/blobs.spec.ts

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
import { expect, describe, it } from "@jest/globals";
2+
3+
import { packAndUnpack } from "./util";
4+
5+
import { objWithBlob } from "./data";
6+
7+
describe("Blobs", () => {
8+
it("replaces Blobs with ArrayBuffer ", async () => {
9+
const objWithAB = {
10+
...objWithBlob,
11+
blob: await objWithBlob.blob.arrayBuffer(),
12+
};
13+
expect(await packAndUnpack(objWithBlob)).toStrictEqual(objWithAB);
14+
});
15+
});

0 commit comments

Comments
 (0)