Skip to content

Commit

Permalink
Merge branch 'main' into lint_json_docs
Browse files Browse the repository at this point in the history
  • Loading branch information
kt3k authored Jun 18, 2024
2 parents 0e60d0a + 8ec230f commit 15c0bac
Show file tree
Hide file tree
Showing 121 changed files with 4,768 additions and 1,712 deletions.
428 changes: 202 additions & 226 deletions .github/dependency_graph.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
222 changes: 222 additions & 0 deletions Releases.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,225 @@
### 2024.06.17

#### @std/async 1.0.0-rc.1 (prerelease)

- BREAKING(async): stop exporting ERROR_WHILE_MAPPING_MESSAGE (#5041)
- docs(async): improve module docs (#5039)
- docs(async): avoid memory leak in example (#5040)
- chore(async): release `[email protected]` (#5035)
- chore(async): mark `Tuple` and `TupleOf` as `@internal` (#5042)

#### @std/cli 0.224.7 (patch)

- refactor(cli): minor cleanups (#5052)
- test(cli): improve spinner test coverage (#5047)
- test(cli): improve test coverage (#5046)

#### @std/http 0.224.5 (patch)

- feat(http): support partitioned cookies (#5044)

#### @std/msgpack 1.0.0-rc.1 (prerelease)

- chore(msgpack): release `[email protected]` (#5030)

#### @std/path 1.0.0-rc.2 (prerelease)

- test(path): improve test coverage (#5038)

#### @std/streams 0.224.5 (patch)

- chore(streams): remove unused test util (#5048)

#### @std/testing 0.225.2 (patch)

- docs(testing): improve the docs of `@std/testing` (#5033)
- refactor(testing): remove use of `public` keyword (#5051)

#### @std/ulid 1.0.0-rc.2 (prerelease)

- refactor(ulid): remove `len` argument from `encodeTime()` and `encodeRandom()`
(#5054)

### 2024.06.12

#### @std/assert 1.0.0-rc.2 (prerelease)

- fix(assert): fix tolerance calculation when comparing negative values (#5019)

#### @std/data-structures 1.0.0-rc.1 (prerelease)

- chore(data-structures): release `[email protected]` (#4987)

#### @std/fs 0.229.3 (patch)

- docs(fs): improve documentation (#4788)

#### @std/ini 0.225.1 (patch)

- docs(ini): improve ini docs (#5020)

#### @std/msgpack 0.224.3 (patch)

- docs(msgpack): complete documentation (#5029)
- test(msgpack): add test cases for `encode()` (#5028)
- test(msgpack): add `decode()` test cases (#5027)

#### @std/net 0.224.3 (patch)

- docs(net): complete documentation (#4982)

#### @std/regexp 1.0.0-rc.1 (prerelease)

- docs(regexp): complete documentation (#5023)
- chore(regexp): release `[email protected]` (#5024)

#### @std/text 1.0.0-rc.1 (prerelease)

- refactor(text): minor cleanups and improvements (#5025)
- chore(text): release `[email protected]` (#5026)

#### @std/ulid 1.0.0-rc.1 (prerelease)

- refactor(ulid): improve error types and messages (#5022)
- chore(ulid): release `[email protected]` (#4997)

#### @std/url 1.0.0-rc.1 (prerelease)

- chore(url): release `[email protected]` (#4981)

### 2024.06.06

#### @std/archive 0.224.1 (patch)

- refactor(archive): cleanup use of `@std/assert` (#4975)

#### @std/assert 1.0.0-rc.1 (prerelease)

- BREAKING(assert): make `unreachable()` consistent with `@std/assert` (#4943)
- BREAKING(assert): `assertAlmostEquals()` sets useful tolerance automatically
(#4460)
- docs(assert): remove outdated API docs (#4937)
- refactor(assert): minor cleanups (#4941)
- chore(assert): release `[email protected]` (#4934)

#### @std/async 0.224.2 (patch)

- refactor(async): cleanup use of `@std/assert` (#4950)

#### @std/bytes 1.0.0 (major)

- chore(bytes): release `[email protected]` (#4746)

#### @std/cli 0.224.6 (patch)

- docs(cli,encoding,fmt,jsonc,path,semver,testing,text,toml,url): remove "This
module is browser compatible" note (#4945)
- refactor(cli): cleanup use of `@std/assert` (#4966)

#### @std/csv 0.224.3 (patch)

- refactor(csv): cleanup use of `@std/assert` (#4976)

#### @std/data-structures 0.225.2 (patch)

- refactor(data-structures): remove use of `public` keyword (#4983)

#### @std/datetime 0.224.1 (patch)

- docs(datetime): trim module documentation (#4971)

#### @std/encoding 1.0.0-rc.2 (prerelease)

- docs(cli,encoding,fmt,jsonc,path,semver,testing,text,toml,url): remove "This
module is browser compatible" note (#4945)

#### @std/fmt 0.225.4 (patch)

- docs(cli,encoding,fmt,jsonc,path,semver,testing,text,toml,url): remove "This
module is browser compatible" note (#4945)

#### @std/fs 0.229.2 (patch)

- refactor(fs): cleanup use of `@std/assert` (#4948)

#### @std/html 1.0.0-rc.1 (prerelease)

- chore(html): release `[email protected]` (#4962)

#### @std/http 0.224.4 (patch)

- refactor(http): cleanup use of `@std/assert` (#4974)

#### @std/io 0.224.1 (patch)

- refactor(io): cleanup use of `@std/assert` (#4979)

#### @std/jsonc 0.224.2 (patch)

- docs(cli,encoding,fmt,jsonc,path,semver,testing,text,toml,url): remove "This
module is browser compatible" note (#4945)
- refactor(jsonc): cleanup use of `@std/assert` (#4968)

#### @std/log 0.224.2 (patch)

- refactor(log): cleanup use of `@std/assert` (#4973)

#### @std/path 1.0.0-rc.1 (prerelease)

- BREAKING(path): remove `path.posix` and `path.win32` (#4953)
- BREAKING(path): remove separator argument from `common()` (#4947)
- BREAKING(path): remove `GlobToRegExpOptions.os` and `OSType` export (#4928)
- docs(path): fix typo in `normalize` doc (#4959)
- docs(path): improve `join` jsdoc (#4958)
- docs(path): fix typo (#4956)
- docs(cli,encoding,fmt,jsonc,path,semver,testing,text,toml,url): remove "This
module is browser compatible" note (#4945)
- refactor(path): clean `isWindows` logic (#4972)
- refactor(path): cleanup `join()` implementations (#4946)
- test(path): improve `windows.parse()` test (#4952)
- test(path): improve `normalizeGlob()` test coverage (#4940)
- test(path): improve `normalize()` coverage (#4939)
- chore(path): release `[email protected]` (#4951)
- chore(path): use `assertPath()` in `windows.join()` (#4960)

#### @std/semver 0.224.3 (patch)

- docs(cli,encoding,fmt,jsonc,path,semver,testing,text,toml,url): remove "This
module is browser compatible" note (#4945)

#### @std/streams 0.224.4 (patch)

- refactor(streams): cleanup use of `@std/assert` (#4980)

#### @std/testing 0.225.1 (patch)

- docs(cli,encoding,fmt,jsonc,path,semver,testing,text,toml,url): remove "This
module is browser compatible" note (#4945)

#### @std/text 0.224.3 (patch)

- docs(cli,encoding,fmt,jsonc,path,semver,testing,text,toml,url): remove "This
module is browser compatible" note (#4945)
- refactor(text): cleanup use of `@std/assert` (#4977)

#### @std/toml 1.0.0-rc.1 (prerelease)

- BREAKING(toml): rename `FormatOptions` to `StringifyOptions` (#4963)
- docs(cli,encoding,fmt,jsonc,path,semver,testing,text,toml,url): remove "This
module is browser compatible" note (#4945)
- chore(toml): release `[email protected]` (#4969)
- chore(toml): minor cleanup (#4964)

#### @std/url 0.224.1 (patch)

- docs(url): complete documentation (#4965)
- docs(cli,encoding,fmt,jsonc,path,semver,testing,text,toml,url): remove "This
module is browser compatible" note (#4945)

#### @std/webgpu 0.224.4 (patch)

- refactor(webgpu): cleanup use of `@std/assert` (#4978)

### 2024.06.03

#### @std/assert 0.226.0 (minor)
Expand Down
10 changes: 2 additions & 8 deletions _tools/check_circular_package_dependencies.ts
Original file line number Diff line number Diff line change
Expand Up @@ -218,7 +218,7 @@ function checkCircularDeps(

/** Formats label for diagram */
function formatLabel(mod: string) {
return '"' + mod.replace(/_/g, "_\\n") + '"';
return '"' + mod.replace(/_/g, "-\\n") + '"';
}

/** Returns node style (in DOT language) for each state */
Expand All @@ -238,7 +238,7 @@ if (Deno.args.includes("--graph")) {
const info = deps[mod]!;
lines.push(` ${formatLabel(mod)} ${stateToNodeStyle(info.state)};`);
for (const dep of info.set) {
lines.push(` ${formatLabel(mod)} -> ${dep};`);
lines.push(` ${formatLabel(mod)} -> ${formatLabel(dep)};`);
}
}
lines.push("}");
Expand All @@ -247,12 +247,6 @@ if (Deno.args.includes("--graph")) {
const svg = await graphviz.graphviz.dot(graph, "svg");
console.log("Writing dependency graph image to .github/dependency_graph.svg");
await Deno.writeTextFile(".github/dependency_graph.svg", svg);
} else if (Deno.args.includes("--table")) {
console.log("| Package | Status |");
console.log("| --------------- | ---------- |");
for (const [mod, info] of Object.entries(deps)) {
console.log(`| ${mod.padEnd(15)} | ${info.state.padEnd(10)} |`);
}
} else if (Deno.args.includes("--all-imports")) {
for (const [mod, entrypoints] of Object.entries(ENTRYPOINTS)) {
for (const path of entrypoints) {
Expand Down
13 changes: 12 additions & 1 deletion _tools/check_docs.ts
Original file line number Diff line number Diff line change
Expand Up @@ -43,18 +43,28 @@ const ENTRY_POINTS = [
"../fmt/duration.ts",
"../fmt/printf.ts",
"../front_matter/mod.ts",
"../fs/mod.ts",
"../html/mod.ts",
"../http/mod.ts",
"../ini/mod.ts",
"../internal/mod.ts",
"../json/mod.ts",
"../jsonc/mod.ts",
"../media_types/mod.ts",
"../msgpack/mod.ts",
"../net/mod.ts",
"../path/mod.ts",
"../path/posix/mod.ts",
"../path/windows/mod.ts",
"../regexp/mod.ts",
"../semver/mod.ts",
"../streams/mod.ts",
"../text/mod.ts",
"../testing/bdd.ts",
"../testing/mock.ts",
"../testing/snapshot.ts",
"../testing/time.ts",
"../testing/types.ts",
"../toml/mod.ts",
"../ulid/mod.ts",
"../url/mod.ts",
Expand All @@ -63,7 +73,8 @@ const ENTRY_POINTS = [
] as const;

const TS_SNIPPET = /```ts[\s\S]*?```/g;
const ASSERTION_IMPORT = /import \{.*\} from "@std\/assert(?:\/.*)?";/gm;
const ASSERTION_IMPORT =
/from "@std\/(assert(\/[a-z-]+)?|testing\/(mock|snapshot|types))"/g;
const NEWLINE = "\n";
const diagnostics: DocumentError[] = [];
const snippetPromises: Promise<void>[] = [];
Expand Down
2 changes: 1 addition & 1 deletion archive/deno.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@std/archive",
"version": "0.224.0",
"version": "0.224.1",
"exports": {
".": "./mod.ts",
"./tar": "./tar.ts",
Expand Down
2 changes: 1 addition & 1 deletion assert/assert_almost_equals.ts
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ export function assertAlmostEquals(
}
const delta = Math.abs(expected - actual);
if (tolerance === undefined) {
tolerance = isFinite(expected) ? expected * 1e-7 : 1e-7;
tolerance = isFinite(expected) ? Math.abs(expected * 1e-7) : 1e-7;
}
if (delta <= tolerance) {
return;
Expand Down
2 changes: 2 additions & 0 deletions assert/assert_almost_equals_test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,9 @@ Deno.test("assertAlmostEquals() matches values within default precision range",
assertAlmostEquals(NaN, NaN);
assertAlmostEquals(Number.NaN, Number.NaN);
assertAlmostEquals(9e20, 9.0000000001e20);
assertAlmostEquals(-9e20, -9.0000000001e20);
assertAlmostEquals(1.000000001e-8, 1.000000002e-8);
assertAlmostEquals(-1.000000001e-8, -1.000000002e-8);
});

Deno.test("assertAlmostEquals() throws values outside default precision range", () => {
Expand Down
2 changes: 1 addition & 1 deletion assert/deno.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@std/assert",
"version": "1.0.0-rc.1",
"version": "1.0.0-rc.2",
"exports": {
".": "./mod.ts",
"./assert": "./assert.ts",
Expand Down
13 changes: 8 additions & 5 deletions async/debounce.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,12 +26,15 @@ export interface DebouncedFunction<T extends Array<unknown>> {
* ```ts no-eval
* import { debounce } from "@std/async/debounce";
*
* await Array.fromAsync(
* Deno.watchFs('./'),
* debounce((event) => {
* console.log('[%s] %s', event.kind, event.paths[0]);
* }, 200),
* const log = debounce(
* (event: Deno.FsEvent) =>
* console.log("[%s] %s", event.kind, event.paths[0]),
* 200,
* );
*
* for await (const event of Deno.watchFs("./")) {
* log(event);
* }
* // wait 200ms ...
* // output: Function debounced after 200ms with baz
* ```
Expand Down
2 changes: 1 addition & 1 deletion async/deno.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@std/async",
"version": "0.224.1",
"version": "1.0.0-rc.1",
"exports": {
".": "./mod.ts",
"./abortable": "./abortable.ts",
Expand Down
5 changes: 3 additions & 2 deletions async/mod.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,9 @@
// This module is browser compatible.

/**
* Provide help with asynchronous tasks like delays, debouncing, deferring, or
* pooling.
* Provide helpers with asynchronous tasks like {@linkcode delay | delays},
* {@linkcode debounce | debouncing}, {@linkcode retry | retrying}, or
* {@linkcode pooledMap | pooling}.
*
* ```ts no-assert
* import { delay } from "@std/async/delay";
Expand Down
2 changes: 1 addition & 1 deletion async/pool.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
// This module is browser compatible.

/** Error message emitted from the thrown error while mapping. */
export const ERROR_WHILE_MAPPING_MESSAGE = "Threw while mapping.";
const ERROR_WHILE_MAPPING_MESSAGE = "Threw while mapping.";

/**
* pooledMap transforms values from an (async) iterable into another async
Expand Down
4 changes: 2 additions & 2 deletions async/pool_test.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// Copyright 2018-2024 the Deno authors. All rights reserved. MIT license.
import { delay } from "./delay.ts";
import { ERROR_WHILE_MAPPING_MESSAGE, pooledMap } from "./pool.ts";
import { pooledMap } from "./pool.ts";
import {
assert,
assertEquals,
Expand Down Expand Up @@ -38,7 +38,7 @@ Deno.test("pooledMap() handles errors", async () => {
}
},
AggregateError,
ERROR_WHILE_MAPPING_MESSAGE,
"Threw while mapping.",
);
assertEquals(error.errors.length, 2);
assertStringIncludes(error.errors[0].stack, "Error: Bad number: 1");
Expand Down
Loading

0 comments on commit 15c0bac

Please sign in to comment.