Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: upgrade to std@0.215.0 #674

Merged
merged 3 commits into from
Feb 18, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion ansi/colors.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import * as stdColors from "https://deno.land/std@0.196.0/fmt/colors.ts";
import * as stdColors from "https://deno.land/std@0.216.0/fmt/colors.ts";

type ExcludedColorMethods = "setColorEnabled" | "getColorEnabled";
type PropertyNames = keyof typeof stdColors;
Expand Down
5 changes: 3 additions & 2 deletions ansi/cursor_position.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import { cursorPosition } from "./ansi_escapes.ts";
import type { ReaderSync, WriterSync } from "./deps.ts";

/** Cursor position. */
export interface Cursor {
Expand All @@ -8,8 +9,8 @@ export interface Cursor {

/** Cursor position options. */
export interface CursorPositionOptions {
writer?: Deno.WriterSync;
reader?: Deno.ReaderSync & {
writer?: WriterSync;
reader?: ReaderSync & {
setRaw(mode: boolean, options?: Deno.SetRawOptions): void;
isTerminal(): boolean;
};
Expand Down
8 changes: 5 additions & 3 deletions ansi/deps.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
export {
encode as encodeBase64,
} from "https://deno.land/std@0.196.0/encoding/base64.ts";
export { encodeBase64 } from "https://deno.land/std@0.216.0/encoding/base64.ts";
export type {
ReaderSync,
WriterSync,
} from "https://deno.land/std@0.216.0/io/types.ts";
5 changes: 3 additions & 2 deletions ansi/tty.ts
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
import * as ansiEscapes from "./ansi_escapes.ts";
import type { Chain } from "./chain.ts";
import { Cursor, getCursorPosition } from "./cursor_position.ts";
import type { ReaderSync, WriterSync } from "./deps.ts";

/** Create new `Ansi` instance. */
export interface TtyOptions {
writer?: Deno.WriterSync;
reader?: Deno.ReaderSync & {
writer?: WriterSync;
reader?: ReaderSync & {
setRaw(mode: boolean, options?: Deno.SetRawOptions): void;
isTerminal(): boolean;
};
Expand Down
2 changes: 1 addition & 1 deletion command/deps.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,4 @@ export {
red,
setColorEnabled,
yellow,
} from "https://deno.land/std@0.196.0/fmt/colors.ts";
} from "https://deno.land/std@0.216.0/fmt/colors.ts";
2 changes: 1 addition & 1 deletion deno.jsonc
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
"coverage:prompt": "deno task test prompt --coverage=./dist/coverage/prompt/result && deno coverage --lcov ./dist/coverage/prompt/result > ./dist/coverage/prompt/cov.lcov",
"coverage:table": "deno task test table --coverage=./dist/coverage/table/result && deno coverage --lcov ./dist/coverage/table/result > ./dist/coverage/table/cov.lcov",
"coverage:testing": "deno task test testing --coverage=./dist/coverage/testing/result && deno coverage --lcov ./dist/coverage/testing/result > ./dist/coverage/testing/cov.lcov",
"update": "deno run --allow-read=./ --allow-net --allow-write=./ https://deno.land/x/deno_outdated@0.2.4/cli.ts --ignore README.md CHANGELOG.md CONTRIBUTING.md"
"update": "deno run --allow-read=./ --allow-net --allow-write=./ https://deno.land/x/deno_outdated@0.2.5/cli.ts --ignore README.md CHANGELOG.md CONTRIBUTING.md"
// "update": "deno run --allow-read=./ --allow-write=./ https://deno.land/x/udd@0.8.2/main.ts" globs are a bit weird in tasks: https://github.com/denoland/deno/discussions/15625
}
}
24 changes: 11 additions & 13 deletions dev_deps.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,30 +6,28 @@ export {
assertRejects,
assertStrictEquals,
assertThrows,
} from "https://deno.land/std@0.196.0/testing/asserts.ts";
} from "https://deno.land/std@0.216.0/assert/mod.ts";
export {
assertSpyCall,
assertSpyCalls,
spy,
} from "https://deno.land/std@0.196.0/testing/mock.ts";
export { assertSnapshot } from "https://deno.land/std@0.196.0/testing/snapshot.ts";
export { describe, it } from "https://deno.land/std@0.196.0/testing/bdd.ts";
} from "https://deno.land/std@0.216.0/testing/mock.ts";
export { assertSnapshot } from "https://deno.land/std@0.216.0/testing/snapshot.ts";
export { describe, it } from "https://deno.land/std@0.216.0/testing/bdd.ts";
export {
assertType,
type IsExact,
} from "https://deno.land/std@0.196.0/testing/types.ts";
} from "https://deno.land/std@0.216.0/testing/types.ts";
export {
bold,
red,
stripColor,
} from "https://deno.land/std@0.196.0/fmt/colors.ts";
export { dirname } from "https://deno.land/std@0.196.0/path/mod.ts";
export { expandGlob } from "https://deno.land/std@0.196.0/fs/expand_glob.ts";
export type { WalkEntry } from "https://deno.land/std@0.196.0/fs/walk.ts";
export { copy } from "https://deno.land/std@0.196.0/streams/copy.ts";
export { format } from "https://deno.land/std@0.196.0/datetime/format.ts";
export { gt } from "https://deno.land/std@0.196.0/semver/gt.ts";
export { lt } from "https://deno.land/std@0.196.0/semver/lt.ts";
} from "https://deno.land/std@0.216.0/fmt/colors.ts";
export { dirname } from "https://deno.land/std@0.216.0/path/dirname.ts";
export { expandGlob } from "https://deno.land/std@0.216.0/fs/expand_glob.ts";
export type { WalkEntry } from "https://deno.land/std@0.216.0/fs/walk.ts";
export { copy } from "https://deno.land/std@0.216.0/io/copy.ts";
export { format } from "https://deno.land/std@0.216.0/datetime/format.ts";

/* 3rd party */
export { default as sinon } from "https://cdn.skypack.dev/sinon@v13.0.2?dts";
2 changes: 1 addition & 1 deletion examples/ansi.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#!/usr/bin/env -S deno run

import { colors, tty } from "../ansi/mod.ts";
import { delay } from "https://deno.land/std@0.196.0/async/delay.ts";
import { delay } from "https://deno.land/std@0.216.0/async/delay.ts";

const error = colors.bold.red;
const warn = colors.bold.yellow;
Expand Down
2 changes: 1 addition & 1 deletion examples/ansi/custom.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#!/usr/bin/env -S deno run --allow-net=deno.land

import { rgb24 } from "https://deno.land/std@0.196.0/fmt/colors.ts";
import { rgb24 } from "https://deno.land/std@0.216.0/fmt/colors.ts";
import { tty } from "../../ansi/tty.ts";

const response = await fetch("https://deno.land/images/hashrock_simple.png");
Expand Down
2 changes: 1 addition & 1 deletion examples/ansi/demo.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#!/usr/bin/env -S deno run

import * as stdColors from "https://deno.land/std@0.196.0/fmt/colors.ts";
import * as stdColors from "https://deno.land/std@0.216.0/fmt/colors.ts";
import * as ansiEscapes from "../../ansi/ansi_escapes.ts";

const ansiEscapeNames1: Array<keyof typeof ansiEscapes> = [
Expand Down
2 changes: 1 addition & 1 deletion examples/command.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#!/usr/bin/env -S deno run --allow-net=localhost:8080,deno.land

import { Command } from "../command/mod.ts";
import { serve } from "https://deno.land/std@0.196.0/http/server.ts";
import { serve } from "https://deno.land/std@0.216.0/http/server.ts";

await new Command()
.name("reverse-proxy")
Expand Down
2 changes: 1 addition & 1 deletion examples/command/examples.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#!/usr/bin/env -S deno run

import { red } from "https://deno.land/std@0.196.0/fmt/colors.ts";
import { red } from "https://deno.land/std@0.216.0/fmt/colors.ts";
import { Command } from "../../command/command.ts";

await new Command()
Expand Down
2 changes: 1 addition & 1 deletion examples/prompt/custom_prompts.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#!/usr/bin/env -S deno run

import { BufReader } from "https://deno.land/std@0.196.0/io/buf_reader.ts";
import { BufReader } from "https://deno.land/std@0.216.0/io/buf_reader.ts";
import { tty } from "../../ansi/tty.ts";
import { Figures } from "../../prompt/_figures.ts";
import { prompt } from "../../prompt/prompt.ts";
Expand Down
2 changes: 1 addition & 1 deletion examples/prompt/prompt_demo.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#!/usr/bin/env -S deno run

import { rgb24 } from "https://deno.land/std@0.196.0/fmt/colors.ts";
import { rgb24 } from "https://deno.land/std@0.216.0/fmt/colors.ts";
import { tty } from "../../ansi/tty.ts";
import { prompt } from "../../prompt/prompt.ts";
import { Checkbox } from "../../prompt/checkbox.ts";
Expand Down
2 changes: 1 addition & 1 deletion examples/table/random_table_demo.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import {
strikethrough,
underline,
yellow,
} from "https://deno.land/std@0.196.0/fmt/colors.ts";
} from "https://deno.land/std@0.216.0/fmt/colors.ts";
import { tty } from "../../ansi/tty.ts";
import { Cell, CellType } from "../../table/cell.ts";
import { Table } from "../../table/table.ts";
Expand Down
12 changes: 7 additions & 5 deletions prompt/_generic_prompt.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,10 @@ import {
dim,
green,
italic,
type Reader,
red,
stripColor,
type WriterSync,
yellow,
} from "./deps.ts";
import { Figures } from "./_figures.ts";
Expand Down Expand Up @@ -65,17 +67,17 @@ export interface GenericPromptOptions<TValue, TRawValue> {
indent?: string;
/** Keymap to assign key names to prompt actions. */
keys?: GenericPromptKeys;
/** Enable cbreak mode. For more information see [Deno.SetRawOptions](https://deno.land/api@v1.35.3?s=Deno.SetRawOptions). */
/** Enable cbreak mode. For more information see [Deno.SetRawOptions](https://deno.land/api@v1.40.5?s=Deno.SetRawOptions). */
cbreak?: boolean;
/** Change the prompt prefix. Default is: `yellow("? ")`. */
prefix?: string;
/** Change the prompt input stream. */
reader?: Deno.Reader & {
reader?: Reader & {
setRaw(mode: boolean, options?: Deno.SetRawOptions): void;
isTerminal(): boolean;
};
/** Change the prompt output stream. */
writer?: Deno.WriterSync;
writer?: WriterSync;
}

/** Generic prompt settings. */
Expand All @@ -86,11 +88,11 @@ export interface GenericPromptSettings<TValue, TRawValue>
prefix: string;
cbreak: boolean;
tty: Tty;
reader: Deno.Reader & {
reader: Reader & {
setRaw(mode: boolean, options?: Deno.SetRawOptions): void;
isTerminal(): boolean;
};
writer: Deno.WriterSync;
writer: WriterSync;
}

/** Prompt validation return tape. */
Expand Down
10 changes: 8 additions & 2 deletions prompt/deps.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,15 @@ export {
stripColor,
underline,
yellow,
} from "https://deno.land/std@0.196.0/fmt/colors.ts";
} from "https://deno.land/std@0.216.0/fmt/colors.ts";
export {
dirname,
join,
normalize,
} from "https://deno.land/std@0.196.0/path/mod.ts";
} from "https://deno.land/std@0.216.0/path/mod.ts";
export type {
Reader,
ReaderSync,
Writer,
WriterSync,
} from "https://deno.land/std@0.216.0/io/types.ts";
4 changes: 2 additions & 2 deletions table/deps.ts
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
export { stripColor } from "https://deno.land/std@0.196.0/fmt/colors.ts";
export { unicodeWidth } from "https://deno.land/std@0.196.0/console/unicode_width.ts";
export { stripColor } from "https://deno.land/std@0.216.0/fmt/colors.ts";
export { unicodeWidth } from "https://deno.land/std@0.216.0/console/unicode_width.ts";
2 changes: 1 addition & 1 deletion table/test/ansi_regex_source_test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import { assertEquals } from "../../dev_deps.ts";
Deno.test(`table - ansiRegexSource`, () => {
const DIGITS = String.raw`\d+`;
// All open and close ANSI codes taken from calls to `code(...)` in
// https://deno.land/std@0.196.0/fmt/colors.ts
// https://deno.land/std@0.216.0/fmt/colors.ts
const ansiCodes = [
{ open: [0], close: 0 },
{ open: [1], close: 22 },
Expand Down
8 changes: 4 additions & 4 deletions testing/deps.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
export { AssertionError } from "https://deno.land/std@0.196.0/testing/asserts.ts";
export { assertSnapshot } from "https://deno.land/std@0.196.0/testing/snapshot.ts";
export { red } from "https://deno.land/std@0.196.0/fmt/colors.ts";
export { AssertionError } from "https://deno.land/std@0.216.0/assert/assertion_error.ts";
export { assertSnapshot } from "https://deno.land/std@0.216.0/testing/snapshot.ts";
export { red } from "https://deno.land/std@0.216.0/fmt/colors.ts";
export {
basename,
dirname,
fromFileUrl,
} from "https://deno.land/std@0.196.0/path/mod.ts";
} from "https://deno.land/std@0.216.0/path/mod.ts";
Loading