Skip to content

Commit

Permalink
Merge branch 'main' into string_width
Browse files Browse the repository at this point in the history
  • Loading branch information
lionel-rowe committed Apr 3, 2023
2 parents 8fe3bd5 + 06e84de commit 23234b9
Show file tree
Hide file tree
Showing 19 changed files with 38 additions and 825 deletions.
8 changes: 4 additions & 4 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ jobs:
runs-on: ubuntu-22.04
strategy:
matrix:
module: [ { name: crypto, path: ./crypto/_wasm }, { name: varint, path: ./encoding/varint/_wasm } ]
module: [ crypto/_wasm ]
steps:
- name: Clone repository
uses: actions/checkout@v3
Expand All @@ -117,10 +117,10 @@ jobs:
run: |-
set -o errexit
shopt -s inherit_errexit
declare modifications="$(git diff --name-only HEAD~ -- ${{ matrix.module.path }})"
declare modifications="$(git diff --name-only HEAD~ -- ${{ matrix.module }})"
declare modified="$([[ "$modifications" ]] && echo true || echo false)"
echo "modified=$modified" >> $GITHUB_OUTPUT
echo "${{ matrix.module.name }} WASM source modified in this commit? $modified"
echo "${{ matrix.module }} WASM source modified in this commit? $modified"
echo "$modifications"
- name: Set up Deno
Expand All @@ -138,4 +138,4 @@ jobs:

- name: Rebuild Wasm and verify it hasn't changed
if: success() && steps.source.outputs.modified == 'true'
run: deno task build:${{ matrix.module.name }} --check
run: deno task build:${{ matrix.module }} --check
1 change: 0 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,5 @@
.vim
**/cov/
/crypto/_wasm/target
/encoding/varint/_wasm/target
deno.lock
/string_width/testdata/unicode_width_crate/target
3 changes: 1 addition & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -90,15 +90,14 @@ Ensure there is a related issue and it is referenced in the PR text.

_About CI checks_:

We currently have 7 checks on CI. Each PR should pass all of these checks to be
We currently have 6 checks on CI. Each PR should pass all of these checks to be
accepted.

- test with Deno canary on Windows
- test with Deno canary on Linux
- test with Deno canary on macOS
- lint
- wasm crypto check
- wasm varint check
- CLA

_For maintainers_:
Expand Down
11 changes: 11 additions & 0 deletions Releases.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,14 @@
### 0.182.0 / 2023.03.31

- feat(csv): add `CsvStringifyStream` (#3270)
- feat(fs): undo deprecation of `exists` and add permission and type check to it
(#2785)
- feat(fs/walk): WalkError class (#3054)
- feat: disposition on TextDelimiterStream (#3273)
- fix(csv/csv_stringify_stream): output headers based on `columns` option
(#3293)
- fix(encoding/base58): fix base58 decoding missing the first byte (#3275)

### 0.181.0 / 2023.03.22

- feat(front_matter): support +++ for TOML block (#3254)
Expand Down
1 change: 0 additions & 1 deletion _tools/check_deprecation.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ const EXCLUDED_PATHS = [
"http/_negotiation",
"crypto/_wasm",
"crypto/_fnv",
"encoding/varint/_wasm",
"encoding/_yaml",
"encoing/_toml",
"_tools",
Expand Down
1 change: 0 additions & 1 deletion _tools/check_licence.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ const EXCLUDED_DIRS = [
"**/fs/testdata",
"**/http/testdata",
"**/crypto/_wasm/target",
"**/encoding/varint/_wasm/target",
];

const ROOT = new URL("../", import.meta.url);
Expand Down
18 changes: 11 additions & 7 deletions bytes/bytes_list.ts
Original file line number Diff line number Diff line change
Expand Up @@ -129,15 +129,19 @@ export class BytesList {
const startIdx = this.getChunkIndex(start);
const endIdx = this.getChunkIndex(end - 1);
let written = 0;
for (let i = startIdx; i < endIdx; i++) {
const chunk = this.#chunks[i];
const len = chunk.end - chunk.start;
result.set(chunk.value.subarray(chunk.start, chunk.end), written);
for (let i = startIdx; i <= endIdx; i++) {
const {
value: chunkValue,
start: chunkStart,
end: chunkEnd,
offset: chunkOffset,
} = this.#chunks[i];
const readStart = chunkStart + (i === startIdx ? start - chunkOffset : 0);
const readEnd = i === endIdx ? end - chunkOffset + chunkStart : chunkEnd;
const len = readEnd - readStart;
result.set(chunkValue.subarray(readStart, readEnd), written);
written += len;
}
const last = this.#chunks[endIdx];
const rest = end - start - written;
result.set(last.value.subarray(last.start, last.start + rest), written);
return result;
}
/**
Expand Down
10 changes: 10 additions & 0 deletions bytes/bytes_list_test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,16 @@ Deno.test("[bytes] BytesList.add should throw if invalid range", () => {
});
Deno.test("[bytes] BytesList.slice", () => {
const arr = setup();

const arrWithContent = new BytesList();
const te = new TextEncoder();
const td = new TextDecoder();

arrWithContent.add(te.encode("Some dummy example "), 2, 13);
arrWithContent.add(te.encode("to show it does work now"), 5, 20);
assertEquals(td.decode(arrWithContent.slice(5, 9)), "mmy ");
assertEquals(td.decode(arrWithContent.slice(9, 13)), "exow");

assertEquals(
bytes.equals(arr.slice(0, 4), new Uint8Array([0, 1, 2, 3])),
true,
Expand Down
3 changes: 0 additions & 3 deletions deno.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@
"exclude": [
".git",
"crypto/_wasm/target",
"encoding/varint/_wasm/target",
"cov",
"jsonc/testdata",
"front_matter/testdata",
Expand All @@ -23,7 +22,6 @@
"exclude": [
".git",
"crypto/_wasm/target",
"encoding/varint/_wasm/target",
"jsonc/testdata",
"front_matter/testdata",
"cov",
Expand All @@ -40,7 +38,6 @@
"lint:check-assertions": "deno run --allow-read --allow-net ./_tools/check_assertions.ts",
"lint": "deno lint && deno task fmt:licence-headers --check && deno task lint:deprecations && deno task lint:doc-imports && deno task lint:check-assertions",
"build:crypto": "deno task --cwd crypto/_wasm wasmbuild",
"build:varint": "deno task --cwd encoding/varint/_wasm wasmbuild",
"wasmbuild": "deno run --unstable -A https://deno.land/x/wasmbuild@0.10.3/main.ts --js-ext mjs --sync"
}
}
2 changes: 0 additions & 2 deletions encoding/varint.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,6 @@
* @module
*/

export * from "./varint/mod.ts";

// This implementation is a port of https://deno.land/x/varint@v2.0.0 by @keithamus
// This module is browser compatible.

Expand Down
4 changes: 0 additions & 4 deletions encoding/varint/_wasm/.rustfmt.toml

This file was deleted.

126 changes: 0 additions & 126 deletions encoding/varint/_wasm/Cargo.lock

This file was deleted.

17 changes: 0 additions & 17 deletions encoding/varint/_wasm/Cargo.toml

This file was deleted.

Loading

0 comments on commit 23234b9

Please sign in to comment.