From 613191b817dd67b4263698ec00ea846d36699c1b Mon Sep 17 00:00:00 2001 From: Benjamin Fischer Date: Thu, 25 Jul 2024 22:42:16 +0200 Subject: [PATCH] docs(examples): use workspace specifier for imports --- examples/ansi.ts | 4 +- examples/ansi/color_themes.ts | 2 +- examples/ansi/colors.ts | 2 +- examples/ansi/countdown.ts | 4 +- examples/ansi/cursor_position.ts | 2 +- examples/ansi/custom.ts | 2 +- examples/ansi/demo.ts | 2 +- examples/ansi/functional.ts | 2 +- examples/ansi/image.ts | 2 +- examples/ansi/link.ts | 2 +- examples/command.ts | 2 +- examples/command/action_handler.ts | 2 +- examples/command/action_options.ts | 2 +- examples/command/arguments_syntax.ts | 2 +- examples/command/arguments_syntax_variadic.ts | 2 +- examples/command/collect_options.ts | 2 +- examples/command/common_option_types.ts | 2 +- examples/command/conflicting_options.ts | 2 +- examples/command/custom_option_processing.ts | 2 +- examples/command/custom_option_type.ts | 2 +- examples/command/custom_option_type_class.ts | 7 +- .../custom_option_type_class_completion.ts | 2 +- .../command/custom_option_type_completion.ts | 2 +- examples/command/default_option_value.ts | 2 +- examples/command/demo.ts | 6 +- examples/command/depending_options.ts | 2 +- examples/command/dotted_options.ts | 2 +- examples/command/enum_option_type.ts | 3 +- examples/command/environment_variables.ts | 2 +- .../command/environment_variables_override.ts | 2 +- examples/command/examples.ts | 2 +- examples/command/general_error_handling.ts | 2 +- examples/command/generic_parent_types.ts | 3 +- examples/command/global_commands.ts | 2 +- examples/command/global_custom_type.ts | 2 +- examples/command/global_options.ts | 2 +- examples/command/grouped_options.ts | 2 +- examples/command/help.ts | 2 +- examples/command/help_option_and_command.ts | 4 +- examples/command/hidden_commands.ts | 2 +- examples/command/hidden_options.ts | 2 +- examples/command/list_option_type.ts | 2 +- examples/command/negatable_options.ts | 2 +- examples/command/options.ts | 2 +- examples/command/required_options.ts | 2 +- examples/command/shell-completions.ts | 4 +- examples/command/standalone_options.ts | 2 +- examples/command/stop_early.ts | 2 +- examples/command/sub_commands.ts | 2 +- examples/command/throw.ts | 2 +- examples/command/upgrade_command.ts | 12 ++-- examples/command/usage.ts | 2 +- examples/command/validation_error_handling.ts | 2 +- examples/command/variadic_arguments.ts | 2 +- examples/command/variadic_options.ts | 2 +- examples/command/version_options.ts | 2 +- examples/flags.ts | 2 +- examples/flags/collect.ts | 2 +- examples/flags/custom_option_processing.ts | 2 +- examples/flags/dotted_options.ts | 2 +- examples/flags/error_handling.ts | 2 +- examples/flags/flags.ts | 2 +- examples/flags/options.ts | 2 +- examples/flags/value.ts | 2 +- examples/keycode.ts | 2 +- examples/keycode/example.ts.ts | 2 +- examples/keycode/read_key.ts | 2 +- examples/keypress.ts | 2 +- examples/keypress/async_iterator.ts | 2 +- .../keypress/async_iterator_with_events.ts | 2 +- examples/keypress/event_target.ts | 2 +- examples/keypress/event_target_propagation.ts | 2 +- examples/keypress/promise.ts | 2 +- examples/prompt.ts | 2 +- examples/prompt/checkbox.ts | 2 +- examples/prompt/confirm.ts | 2 +- examples/prompt/custom_prompts.ts | 66 ------------------- examples/prompt/dynamic_prompts.ts | 8 +-- examples/prompt/input.ts | 2 +- examples/prompt/list.ts | 2 +- examples/prompt/number.ts | 2 +- examples/prompt/os_signals.ts | 4 +- examples/prompt/prompt_demo.ts | 18 ++--- examples/prompt/prompt_list.ts | 10 +-- examples/prompt/secret.ts | 2 +- examples/prompt/secret_hidden.ts | 2 +- examples/prompt/select.ts | 2 +- examples/prompt/suggestions.ts | 2 +- examples/prompt/suggestions_list.ts | 2 +- examples/prompt/suggestions_list_prompt.ts | 2 +- examples/prompt/toggle.ts | 2 +- examples/table.ts | 2 +- examples/table/basic_usage.ts | 2 +- examples/table/colspan_and_rowspan.ts | 3 +- examples/table/columns.ts | 2 +- examples/table/consume_words.ts | 2 +- examples/table/header_and_body.ts | 2 +- examples/table/random_table_demo.ts | 5 +- examples/table/rows_and_cells.ts | 4 +- examples/table/table_options.ts | 2 +- examples/table/using_as_array.ts | 2 +- 101 files changed, 128 insertions(+), 205 deletions(-) delete mode 100755 examples/prompt/custom_prompts.ts diff --git a/examples/ansi.ts b/examples/ansi.ts index 55a2c449..a0d441d9 100644 --- a/examples/ansi.ts +++ b/examples/ansi.ts @@ -1,8 +1,8 @@ #!/usr/bin/env -S deno run +import { colors } from "@cliffy/ansi/colors"; +import { tty } from "@cliffy/ansi/tty"; import { delay } from "@std/async/delay"; -import { colors } from "../ansi/colors.ts"; -import { tty } from "../ansi/tty.ts"; const error = colors.bold.red; const warn = colors.bold.yellow; diff --git a/examples/ansi/color_themes.ts b/examples/ansi/color_themes.ts index 1840ae6d..7c0681e5 100755 --- a/examples/ansi/color_themes.ts +++ b/examples/ansi/color_themes.ts @@ -1,6 +1,6 @@ #!/usr/bin/env -S deno run -import { colors } from "../../ansi/colors.ts"; +import { colors } from "@cliffy/ansi/colors"; // Define theme colors. const error = colors.bold.red; diff --git a/examples/ansi/colors.ts b/examples/ansi/colors.ts index 086b1cd8..b463d775 100755 --- a/examples/ansi/colors.ts +++ b/examples/ansi/colors.ts @@ -1,6 +1,6 @@ #!/usr/bin/env -S deno run -import { colors } from "../../ansi/colors.ts"; +import { colors } from "@cliffy/ansi/colors"; console.log( colors.bold.underline.rgb24("Welcome to Deno.Land!", 0xff3333), diff --git a/examples/ansi/countdown.ts b/examples/ansi/countdown.ts index e0bbe82a..1c38e0a4 100755 --- a/examples/ansi/countdown.ts +++ b/examples/ansi/countdown.ts @@ -1,7 +1,7 @@ #!/usr/bin/env -S deno run --allow-net=deno.land -import { colors } from "../../ansi/colors.ts"; -import { tty } from "../../ansi/tty.ts"; +import { colors } from "@cliffy/ansi/colors"; +import { tty } from "@cliffy/ansi/tty"; for await (const i of [3, 2, 1]) { console.log(i); diff --git a/examples/ansi/cursor_position.ts b/examples/ansi/cursor_position.ts index e02d8242..df5e1c91 100755 --- a/examples/ansi/cursor_position.ts +++ b/examples/ansi/cursor_position.ts @@ -1,6 +1,6 @@ #!/usr/bin/env -S deno run -import { getCursorPosition } from "../../ansi/cursor_position.ts"; +import { getCursorPosition } from "@cliffy/ansi/cursor-position"; Deno.stdout.writeSync(new TextEncoder().encode("Hallo world!")); console.log("\ngetCursorPosition:", getCursorPosition()); diff --git a/examples/ansi/custom.ts b/examples/ansi/custom.ts index 776caf4a..0e8db0d1 100755 --- a/examples/ansi/custom.ts +++ b/examples/ansi/custom.ts @@ -1,7 +1,7 @@ #!/usr/bin/env -S deno run --allow-net=deno.land import { rgb24 } from "@std/fmt/colors"; -import { tty } from "../../ansi/tty.ts"; +import { tty } from "@cliffy/ansi/tty"; const response = await fetch("https://deno.land/images/hashrock_simple.png"); const imageBuffer: ArrayBuffer = await response.arrayBuffer(); diff --git a/examples/ansi/demo.ts b/examples/ansi/demo.ts index 9779c1fa..7bc05f1a 100755 --- a/examples/ansi/demo.ts +++ b/examples/ansi/demo.ts @@ -1,7 +1,7 @@ #!/usr/bin/env -S deno run import * as stdColors from "@std/fmt/colors"; -import * as ansiEscapes from "../../ansi/ansi_escapes.ts"; +import * as ansiEscapes from "@cliffy/ansi/ansi-escapes"; const ansiEscapeNames1: Array = [ "bel", diff --git a/examples/ansi/functional.ts b/examples/ansi/functional.ts index 7301ca69..76747166 100755 --- a/examples/ansi/functional.ts +++ b/examples/ansi/functional.ts @@ -1,6 +1,6 @@ #!/usr/bin/env -S deno run -import { cursorTo, eraseDown, image, link } from "../../ansi/ansi_escapes.ts"; +import { cursorTo, eraseDown, image, link } from "@cliffy/ansi/ansi-escapes"; const response = await fetch("https://deno.land/images/hashrock_simple.png"); const imageBuffer: ArrayBuffer = await response.arrayBuffer(); diff --git a/examples/ansi/image.ts b/examples/ansi/image.ts index d35993ae..5a51d4e6 100755 --- a/examples/ansi/image.ts +++ b/examples/ansi/image.ts @@ -1,6 +1,6 @@ #!/usr/bin/env -S deno run --allow-net=deno.land -import { image } from "../../ansi/ansi_escapes.ts"; +import { image } from "@cliffy/ansi/ansi-escapes"; const response = await fetch("https://deno.land/images/hashrock_simple.png"); const imageBuffer: ArrayBuffer = await response.arrayBuffer(); diff --git a/examples/ansi/link.ts b/examples/ansi/link.ts index c25bc9a7..ae878037 100755 --- a/examples/ansi/link.ts +++ b/examples/ansi/link.ts @@ -1,5 +1,5 @@ #!/usr/bin/env -S deno run --allow-net=deno.land -import { link } from "../../ansi/ansi_escapes.ts"; +import { link } from "@cliffy/ansi/ansi-escapes"; console.log(link("Click me.", "https://deno.land")); diff --git a/examples/command.ts b/examples/command.ts index 401eb332..d974ddf9 100644 --- a/examples/command.ts +++ b/examples/command.ts @@ -1,6 +1,6 @@ #!/usr/bin/env -S deno run --allow-net=localhost:8080,deno.land -import { Command } from "../command/mod.ts"; +import { Command } from "@cliffy/command"; await new Command() .name("reverse-proxy") diff --git a/examples/command/action_handler.ts b/examples/command/action_handler.ts index 9ead80f4..c51869bc 100755 --- a/examples/command/action_handler.ts +++ b/examples/command/action_handler.ts @@ -1,6 +1,6 @@ #!/usr/bin/env -S deno run -import { Command } from "../../command/mod.ts"; +import { Command } from "@cliffy/command"; await new Command() .name("rm") diff --git a/examples/command/action_options.ts b/examples/command/action_options.ts index 15009d23..bd66e09f 100755 --- a/examples/command/action_options.ts +++ b/examples/command/action_options.ts @@ -1,6 +1,6 @@ #!/usr/bin/env -S deno run -import { Command } from "../../command/command.ts"; +import { Command } from "@cliffy/command"; await new Command() .version("0.1.0") diff --git a/examples/command/arguments_syntax.ts b/examples/command/arguments_syntax.ts index e84ead1f..71d28f11 100755 --- a/examples/command/arguments_syntax.ts +++ b/examples/command/arguments_syntax.ts @@ -1,6 +1,6 @@ #!/usr/bin/env -S deno run -import { Command } from "../../command/command.ts"; +import { Command } from "@cliffy/command"; const { args } = await new Command() .arguments(" [output:string]") diff --git a/examples/command/arguments_syntax_variadic.ts b/examples/command/arguments_syntax_variadic.ts index 8d9ccc51..fbd73a4f 100755 --- a/examples/command/arguments_syntax_variadic.ts +++ b/examples/command/arguments_syntax_variadic.ts @@ -1,6 +1,6 @@ #!/usr/bin/env -S deno run -import { Command } from "../../command/mod.ts"; +import { Command } from "@cliffy/command"; await new Command() .command("rmdir ", "Remove directories.") diff --git a/examples/command/collect_options.ts b/examples/command/collect_options.ts index 459306e8..b49879be 100755 --- a/examples/command/collect_options.ts +++ b/examples/command/collect_options.ts @@ -1,6 +1,6 @@ #!/usr/bin/env -S deno run -import { Command } from "../../command/command.ts"; +import { Command } from "@cliffy/command"; const { options } = await new Command() .option("-c, --color ", "read from file ...", { collect: true }) diff --git a/examples/command/common_option_types.ts b/examples/command/common_option_types.ts index f0afdc04..72317fd0 100755 --- a/examples/command/common_option_types.ts +++ b/examples/command/common_option_types.ts @@ -1,6 +1,6 @@ #!/usr/bin/env -S deno run -import { Command } from "../../command/command.ts"; +import { Command } from "@cliffy/command"; const { options } = await new Command() // Env value must be always required. diff --git a/examples/command/conflicting_options.ts b/examples/command/conflicting_options.ts index 244efa3e..ed37ed6e 100755 --- a/examples/command/conflicting_options.ts +++ b/examples/command/conflicting_options.ts @@ -1,6 +1,6 @@ #!/usr/bin/env -S deno run -import { Command } from "../../command/command.ts"; +import { Command } from "@cliffy/command"; const { options } = await new Command() .option("-f, --file ", "read from file ...") diff --git a/examples/command/custom_option_processing.ts b/examples/command/custom_option_processing.ts index 23dda32d..da18a111 100755 --- a/examples/command/custom_option_processing.ts +++ b/examples/command/custom_option_processing.ts @@ -1,6 +1,6 @@ #!/usr/bin/env -S deno run -import { Command, ValidationError } from "../../command/mod.ts"; +import { Command, ValidationError } from "@cliffy/command"; const { options } = await new Command() .option( diff --git a/examples/command/custom_option_type.ts b/examples/command/custom_option_type.ts index d5619002..5b43177e 100755 --- a/examples/command/custom_option_type.ts +++ b/examples/command/custom_option_type.ts @@ -1,6 +1,6 @@ #!/usr/bin/env -S deno run -import { ArgumentValue, Command } from "../../command/mod.ts"; +import { ArgumentValue, Command } from "@cliffy/command"; const colors = ["red", "blue", "yellow"]; diff --git a/examples/command/custom_option_type_class.ts b/examples/command/custom_option_type_class.ts index 00dbba50..deef927b 100755 --- a/examples/command/custom_option_type_class.ts +++ b/examples/command/custom_option_type_class.ts @@ -1,11 +1,6 @@ #!/usr/bin/env -S deno run -import { - ArgumentValue, - Command, - Type, - ValidationError, -} from "../../command/mod.ts"; +import { ArgumentValue, Command, Type, ValidationError } from "@cliffy/command"; class ColorType extends Type { private readonly colors = ["red", "blue", "yellow"]; diff --git a/examples/command/custom_option_type_class_completion.ts b/examples/command/custom_option_type_class_completion.ts index 2bf995e3..b9e61eb8 100755 --- a/examples/command/custom_option_type_class_completion.ts +++ b/examples/command/custom_option_type_class_completion.ts @@ -1,6 +1,6 @@ #!/usr/bin/env -S deno run -import { Command, StringType } from "../../command/mod.ts"; +import { Command, StringType } from "@cliffy/command"; class EmailType extends StringType { complete(): string[] { diff --git a/examples/command/custom_option_type_completion.ts b/examples/command/custom_option_type_completion.ts index d9e079ad..ad2d4ad1 100755 --- a/examples/command/custom_option_type_completion.ts +++ b/examples/command/custom_option_type_completion.ts @@ -1,6 +1,6 @@ #!/usr/bin/env -S deno run -import { Command } from "../../command/command.ts"; +import { Command } from "@cliffy/command"; await new Command() .option("-e, --email ", "Your email address.") diff --git a/examples/command/default_option_value.ts b/examples/command/default_option_value.ts index 5d377a0f..8049a371 100755 --- a/examples/command/default_option_value.ts +++ b/examples/command/default_option_value.ts @@ -1,6 +1,6 @@ #!/usr/bin/env -S deno run -import { Command } from "../../command/command.ts"; +import { Command } from "@cliffy/command"; const { options } = await new Command() .option("-c, --cheese [type:string]", "add the specified type of cheese", { diff --git a/examples/command/demo.ts b/examples/command/demo.ts index b3fc4af9..e1e2f4b8 100755 --- a/examples/command/demo.ts +++ b/examples/command/demo.ts @@ -1,8 +1,8 @@ #!/usr/bin/env -S deno run -import { Command } from "../../command/command.ts"; -import { CompletionsCommand } from "../../command/completions/completions_command.ts"; -import { HelpCommand } from "../../command/help/help_command.ts"; +import { Command } from "@cliffy/command"; +import { CompletionsCommand } from "@cliffy/command/completions"; +import { HelpCommand } from "@cliffy/command/help"; await new Command() .name("cliffy") diff --git a/examples/command/depending_options.ts b/examples/command/depending_options.ts index 88718c5a..66b2a957 100755 --- a/examples/command/depending_options.ts +++ b/examples/command/depending_options.ts @@ -1,6 +1,6 @@ #!/usr/bin/env -S deno run -import { Command } from "../../command/command.ts"; +import { Command } from "@cliffy/command"; const { options } = await new Command() .option("-u, --audio-codec ", "description ...") diff --git a/examples/command/dotted_options.ts b/examples/command/dotted_options.ts index 8bd0ace7..dd9e893d 100755 --- a/examples/command/dotted_options.ts +++ b/examples/command/dotted_options.ts @@ -1,6 +1,6 @@ #!/usr/bin/env -S deno run -import { Command } from "../../command/command.ts"; +import { Command } from "@cliffy/command"; const { options } = await new Command() .option( diff --git a/examples/command/enum_option_type.ts b/examples/command/enum_option_type.ts index bc4c139f..2902a3e5 100755 --- a/examples/command/enum_option_type.ts +++ b/examples/command/enum_option_type.ts @@ -1,7 +1,6 @@ #!/usr/bin/env -S deno run -import { Command } from "../../command/command.ts"; -import { EnumType } from "../../command/types/enum.ts"; +import { Command, EnumType } from "@cliffy/command"; enum Animal { Dog = "dog", diff --git a/examples/command/environment_variables.ts b/examples/command/environment_variables.ts index 6fa56c8a..8d6b7ef9 100755 --- a/examples/command/environment_variables.ts +++ b/examples/command/environment_variables.ts @@ -1,6 +1,6 @@ #!/usr/bin/env -S deno run -A -import { Command } from "../../command/command.ts"; +import { Command } from "@cliffy/command"; await new Command() .env("SOME_ENV_VAR=", "Description ...") diff --git a/examples/command/environment_variables_override.ts b/examples/command/environment_variables_override.ts index 9f98a890..1429c2bd 100755 --- a/examples/command/environment_variables_override.ts +++ b/examples/command/environment_variables_override.ts @@ -1,6 +1,6 @@ #!/usr/bin/env -S deno run -A -import { Command } from "../../command/command.ts"; +import { Command } from "@cliffy/command"; await new Command() .env( diff --git a/examples/command/examples.ts b/examples/command/examples.ts index eb3a113b..6e267a8e 100755 --- a/examples/command/examples.ts +++ b/examples/command/examples.ts @@ -1,7 +1,7 @@ #!/usr/bin/env -S deno run +import { Command } from "@cliffy/command"; import { red } from "@std/fmt/colors"; -import { Command } from "../../command/command.ts"; await new Command() .name("examples") diff --git a/examples/command/general_error_handling.ts b/examples/command/general_error_handling.ts index e2c6f7bd..107871f6 100755 --- a/examples/command/general_error_handling.ts +++ b/examples/command/general_error_handling.ts @@ -1,4 +1,4 @@ -import { Command } from "../../command/command.ts"; +import { Command } from "@cliffy/command"; const cmd = new Command() .option("-p, --pizza-type ", "Flavour of pizza.") diff --git a/examples/command/generic_parent_types.ts b/examples/command/generic_parent_types.ts index fefec3ad..92c43219 100755 --- a/examples/command/generic_parent_types.ts +++ b/examples/command/generic_parent_types.ts @@ -1,7 +1,6 @@ #!/usr/bin/env -S deno run -import { Command } from "../../command/command.ts"; -import { EnumType } from "../../command/types/enum.ts"; +import { Command, EnumType } from "@cliffy/command"; const colorType = new EnumType(["red", "blue"]); diff --git a/examples/command/global_commands.ts b/examples/command/global_commands.ts index 53fb58d5..b4ef1179 100755 --- a/examples/command/global_commands.ts +++ b/examples/command/global_commands.ts @@ -1,6 +1,6 @@ #!/usr/bin/env -S deno run -import { Command } from "../../command/command.ts"; +import { Command } from "@cliffy/command"; await new Command() .command("global [val:string]", "global ...") diff --git a/examples/command/global_custom_type.ts b/examples/command/global_custom_type.ts index 15699f08..a3f1e27f 100755 --- a/examples/command/global_custom_type.ts +++ b/examples/command/global_custom_type.ts @@ -1,6 +1,6 @@ #!/usr/bin/env -S deno run -import { Command, EnumType } from "../../command/mod.ts"; +import { Command, EnumType } from "@cliffy/command"; await new Command() .globalType("color", new EnumType(["red", "blue", "yellow"])) diff --git a/examples/command/global_options.ts b/examples/command/global_options.ts index e71db6fc..616e40c3 100755 --- a/examples/command/global_options.ts +++ b/examples/command/global_options.ts @@ -1,6 +1,6 @@ #!/usr/bin/env -S deno run -import { Command } from "../../command/command.ts"; +import { Command } from "@cliffy/command"; await new Command() .option("-l, --local [val:string]", "Only available on this command.") diff --git a/examples/command/grouped_options.ts b/examples/command/grouped_options.ts index 52f52333..7dfb3076 100755 --- a/examples/command/grouped_options.ts +++ b/examples/command/grouped_options.ts @@ -1,6 +1,6 @@ #!/usr/bin/env -S deno run -import { Command } from "../../command/command.ts"; +import { Command } from "@cliffy/command"; await new Command() .version("0.1.0") diff --git a/examples/command/help.ts b/examples/command/help.ts index 97cc1786..0465c6f6 100755 --- a/examples/command/help.ts +++ b/examples/command/help.ts @@ -1,6 +1,6 @@ #!/usr/bin/env -S deno run -import { Command } from "../../command/command.ts"; +import { Command } from "@cliffy/command"; await new Command() .name("help-option-and-command") diff --git a/examples/command/help_option_and_command.ts b/examples/command/help_option_and_command.ts index 65af9f74..79e213b1 100755 --- a/examples/command/help_option_and_command.ts +++ b/examples/command/help_option_and_command.ts @@ -1,7 +1,7 @@ #!/usr/bin/env -S deno run -import { HelpCommand } from "../../command/help/help_command.ts"; -import { Command } from "../../command/command.ts"; +import { Command } from "@cliffy/command"; +import { HelpCommand } from "@cliffy/command/help"; await new Command() .version("0.1.0") diff --git a/examples/command/hidden_commands.ts b/examples/command/hidden_commands.ts index 09c4c939..6a2602ba 100755 --- a/examples/command/hidden_commands.ts +++ b/examples/command/hidden_commands.ts @@ -1,6 +1,6 @@ #!/usr/bin/env -S deno run -import { Command } from "../../command/command.ts"; +import { Command } from "@cliffy/command"; await new Command() .command("top-secret", "Nobody knows about me!") diff --git a/examples/command/hidden_options.ts b/examples/command/hidden_options.ts index cd918fd8..495bb3d5 100755 --- a/examples/command/hidden_options.ts +++ b/examples/command/hidden_options.ts @@ -1,6 +1,6 @@ #!/usr/bin/env -S deno run -import { Command } from "../../command/command.ts"; +import { Command } from "@cliffy/command"; await new Command() .option("-H, --hidden [hidden:boolean]", "Nobody knows about me!", { diff --git a/examples/command/list_option_type.ts b/examples/command/list_option_type.ts index 8ea86c48..66db29bf 100755 --- a/examples/command/list_option_type.ts +++ b/examples/command/list_option_type.ts @@ -1,6 +1,6 @@ #!/usr/bin/env -S deno run -import { Command } from "../../command/command.ts"; +import { Command } from "@cliffy/command"; const { options } = await new Command() // comma separated list diff --git a/examples/command/negatable_options.ts b/examples/command/negatable_options.ts index d0649aa4..113976b6 100755 --- a/examples/command/negatable_options.ts +++ b/examples/command/negatable_options.ts @@ -1,6 +1,6 @@ #!/usr/bin/env -S deno run -import { Command } from "../../command/command.ts"; +import { Command } from "@cliffy/command"; const { options } = await new Command() // default value will be automatically set to true if no --check option exists diff --git a/examples/command/options.ts b/examples/command/options.ts index cf03ac7b..9f5fc230 100755 --- a/examples/command/options.ts +++ b/examples/command/options.ts @@ -1,6 +1,6 @@ #!/usr/bin/env -S deno run -import { Command } from "../../command/command.ts"; +import { Command } from "@cliffy/command"; const { options } = await new Command() .option("-s, --silent", "disable output.") diff --git a/examples/command/required_options.ts b/examples/command/required_options.ts index 6d4923dd..2873e590 100755 --- a/examples/command/required_options.ts +++ b/examples/command/required_options.ts @@ -1,6 +1,6 @@ #!/usr/bin/env -S deno run -import { Command } from "../../command/command.ts"; +import { Command } from "@cliffy/command"; await new Command() .allowEmpty(false) diff --git a/examples/command/shell-completions.ts b/examples/command/shell-completions.ts index 6ebc0619..6aef59a1 100755 --- a/examples/command/shell-completions.ts +++ b/examples/command/shell-completions.ts @@ -1,7 +1,7 @@ #!/usr/bin/env deno run -import { Command } from "../../command/command.ts"; -import { CompletionsCommand } from "../../command/completions/completions_command.ts"; +import { Command } from "@cliffy/command"; +import { CompletionsCommand } from "@cliffy/command/completions"; await new Command() .throwErrors() diff --git a/examples/command/standalone_options.ts b/examples/command/standalone_options.ts index 92b5c277..3816375b 100755 --- a/examples/command/standalone_options.ts +++ b/examples/command/standalone_options.ts @@ -1,6 +1,6 @@ #!/usr/bin/env -S deno run -import { Command } from "../../command/command.ts"; +import { Command } from "@cliffy/command"; await new Command() .option("-s, --standalone [value:boolean]", "Some standalone option.", { diff --git a/examples/command/stop_early.ts b/examples/command/stop_early.ts index acb47075..cd783b59 100755 --- a/examples/command/stop_early.ts +++ b/examples/command/stop_early.ts @@ -1,6 +1,6 @@ #!/usr/bin/env -S deno run -import { Command } from "../../command/command.ts"; +import { Command } from "@cliffy/command"; await new Command() .option("-d, --debug-level ", "Debug level.") diff --git a/examples/command/sub_commands.ts b/examples/command/sub_commands.ts index 6f054154..7b1cf440 100755 --- a/examples/command/sub_commands.ts +++ b/examples/command/sub_commands.ts @@ -1,6 +1,6 @@ #!/usr/bin/env -S deno run -import { Command } from "../../command/command.ts"; +import { Command } from "@cliffy/command"; // Sub-command implemented using action handler (description is supplied separately to `.command()`) await new Command() diff --git a/examples/command/throw.ts b/examples/command/throw.ts index 23cb7f6a..05ee98c9 100755 --- a/examples/command/throw.ts +++ b/examples/command/throw.ts @@ -1,6 +1,6 @@ #!/usr/bin/env deno run -import { Command, ValidationError } from "../../command/mod.ts"; +import { Command, ValidationError } from "@cliffy/command"; const { options, cmd } = await new Command() .error((_error, _cmd) => { diff --git a/examples/command/upgrade_command.ts b/examples/command/upgrade_command.ts index 5e10d3b9..642a2cbd 100755 --- a/examples/command/upgrade_command.ts +++ b/examples/command/upgrade_command.ts @@ -1,11 +1,11 @@ #!/usr/bin/env -S deno run --allow-net --allow-run --allow-read --no-check -import { CompletionsCommand } from "../../command/completions/mod.ts"; -import { Command } from "../../command/mod.ts"; -import { UpgradeCommand } from "../../command/upgrade/mod.ts"; -import { DenoLandProvider } from "../../command/upgrade/provider/deno_land.ts"; -import { GithubProvider } from "../../command/upgrade/provider/github.ts"; -import { NestLandProvider } from "../../command/upgrade/provider/nest_land.ts"; +import { Command } from "@cliffy/command"; +import { CompletionsCommand } from "@cliffy/command/completions"; +import { UpgradeCommand } from "@cliffy/command/upgrade"; +import { DenoLandProvider } from "@cliffy/command/upgrade/provider/deno-land"; +import { GithubProvider } from "@cliffy/command/upgrade/provider/github"; +import { NestLandProvider } from "@cliffy/command/upgrade/provider/nest-land"; await new Command() .name("codeview") diff --git a/examples/command/usage.ts b/examples/command/usage.ts index 727279ed..4701acfd 100755 --- a/examples/command/usage.ts +++ b/examples/command/usage.ts @@ -1,6 +1,6 @@ #!/usr/bin/env -S deno run -import { Command } from "../../command/command.ts"; +import { Command } from "@cliffy/command"; await new Command() .name("cliffy") diff --git a/examples/command/validation_error_handling.ts b/examples/command/validation_error_handling.ts index f28745f6..0a94ea46 100755 --- a/examples/command/validation_error_handling.ts +++ b/examples/command/validation_error_handling.ts @@ -1,4 +1,4 @@ -import { Command, ValidationError } from "../../command/mod.ts"; +import { Command, ValidationError } from "@cliffy/command"; const cmd = new Command() .throwErrors() // <-- throw also validation errors. diff --git a/examples/command/variadic_arguments.ts b/examples/command/variadic_arguments.ts index 444ca806..b8bd4c66 100755 --- a/examples/command/variadic_arguments.ts +++ b/examples/command/variadic_arguments.ts @@ -1,6 +1,6 @@ #!/usr/bin/env -S deno run -import { Command } from "../../command/command.ts"; +import { Command } from "@cliffy/command"; const { args: dirs } = await new Command() .description("Remove directories.") diff --git a/examples/command/variadic_options.ts b/examples/command/variadic_options.ts index 8ceefa80..69452c31 100755 --- a/examples/command/variadic_options.ts +++ b/examples/command/variadic_options.ts @@ -1,6 +1,6 @@ #!/usr/bin/env -S deno run -import { Command } from "../../command/command.ts"; +import { Command } from "@cliffy/command"; const { options } = await new Command() .version("0.1.0") diff --git a/examples/command/version_options.ts b/examples/command/version_options.ts index 4434061c..4414c599 100755 --- a/examples/command/version_options.ts +++ b/examples/command/version_options.ts @@ -1,6 +1,6 @@ #!/usr/bin/env -S deno run -import { Command } from "../../command/command.ts"; +import { Command } from "@cliffy/command"; await new Command() .version("0.1.0") diff --git a/examples/flags.ts b/examples/flags.ts index d38ef950..e76264e1 100644 --- a/examples/flags.ts +++ b/examples/flags.ts @@ -1,6 +1,6 @@ #!/usr/bin/env -S deno run -import { parseFlags } from "../flags/mod.ts"; +import { parseFlags } from "@cliffy/flags"; const { flags } = parseFlags(Deno.args, { stopEarly: true, diff --git a/examples/flags/collect.ts b/examples/flags/collect.ts index 7066425e..85a17559 100755 --- a/examples/flags/collect.ts +++ b/examples/flags/collect.ts @@ -1,6 +1,6 @@ #!/usr/bin/env -S deno run -import { parseFlags } from "../../flags/mod.ts"; +import { parseFlags } from "@cliffy/flags"; const { flags } = parseFlags(Deno.args, { flags: [{ diff --git a/examples/flags/custom_option_processing.ts b/examples/flags/custom_option_processing.ts index cd9e9930..060a6a8e 100755 --- a/examples/flags/custom_option_processing.ts +++ b/examples/flags/custom_option_processing.ts @@ -1,6 +1,6 @@ #!/usr/bin/env -S deno run -import { ArgumentValue, parseFlags } from "../../flags/mod.ts"; +import { ArgumentValue, parseFlags } from "@cliffy/flags"; const result = parseFlags(Deno.args, { flags: [{ diff --git a/examples/flags/dotted_options.ts b/examples/flags/dotted_options.ts index dbf7feb4..91b3476f 100755 --- a/examples/flags/dotted_options.ts +++ b/examples/flags/dotted_options.ts @@ -1,6 +1,6 @@ #!/usr/bin/env -S deno run -import { parseFlags } from "../../flags/flags.ts"; +import { parseFlags } from "@cliffy/flags"; const result = parseFlags(Deno.args, { allowEmpty: true, diff --git a/examples/flags/error_handling.ts b/examples/flags/error_handling.ts index d361ad7f..33bda693 100755 --- a/examples/flags/error_handling.ts +++ b/examples/flags/error_handling.ts @@ -1,6 +1,6 @@ #!/usr/bin/env -S deno run -import { parseFlags, ValidationError } from "../../flags/mod.ts"; +import { parseFlags, ValidationError } from "@cliffy/flags"; try { const flags = parseFlags(Deno.args, { diff --git a/examples/flags/flags.ts b/examples/flags/flags.ts index cab07bd5..8a681acd 100755 --- a/examples/flags/flags.ts +++ b/examples/flags/flags.ts @@ -1,5 +1,5 @@ #!/usr/bin/env -S deno run -import { parseFlags } from "../../flags/flags.ts"; +import { parseFlags } from "@cliffy/flags"; console.log(parseFlags(Deno.args)); diff --git a/examples/flags/options.ts b/examples/flags/options.ts index a9477199..529263f5 100755 --- a/examples/flags/options.ts +++ b/examples/flags/options.ts @@ -1,6 +1,6 @@ #!/usr/bin/env -S deno run -import { parseFlags } from "../../flags/flags.ts"; +import { parseFlags } from "@cliffy/flags"; const { flags } = parseFlags(Deno.args, { flags: [{ diff --git a/examples/flags/value.ts b/examples/flags/value.ts index 975b8363..4229e0db 100755 --- a/examples/flags/value.ts +++ b/examples/flags/value.ts @@ -1,6 +1,6 @@ #!/usr/bin/env -S deno run -import { parseFlags, ValidationError } from "../../flags/mod.ts"; +import { parseFlags, ValidationError } from "@cliffy/flags"; const { flags } = parseFlags(Deno.args, { flags: [{ diff --git a/examples/keycode.ts b/examples/keycode.ts index 99a16d1c..44b7850b 100644 --- a/examples/keycode.ts +++ b/examples/keycode.ts @@ -1,6 +1,6 @@ #!/usr/bin/env -S deno run -import { KeyCode, parse } from "../keycode/mod.ts"; +import { KeyCode, parse } from "@cliffy/keycode"; while (true) { const data = new Uint8Array(8); diff --git a/examples/keycode/example.ts.ts b/examples/keycode/example.ts.ts index 0ccfee96..5f1ce035 100755 --- a/examples/keycode/example.ts.ts +++ b/examples/keycode/example.ts.ts @@ -1,6 +1,6 @@ #!/usr/bin/env -S deno run -import { parse } from "../../keycode/key_code.ts"; +import { parse } from "@cliffy/keycode"; console.log( parse( diff --git a/examples/keycode/read_key.ts b/examples/keycode/read_key.ts index 0e47a621..07452f17 100755 --- a/examples/keycode/read_key.ts +++ b/examples/keycode/read_key.ts @@ -1,6 +1,6 @@ #!/usr/bin/env -S deno run -import { KeyCode, parse } from "../../keycode/key_code.ts"; +import { KeyCode, parse } from "@cliffy/keycode"; async function* keypress(): AsyncGenerator { while (true) { diff --git a/examples/keypress.ts b/examples/keypress.ts index 949ff529..61f2b71f 100644 --- a/examples/keypress.ts +++ b/examples/keypress.ts @@ -1,6 +1,6 @@ #!/usr/bin/env -S deno run -import { keypress, KeyPressEvent } from "../keypress/mod.ts"; +import { keypress, KeyPressEvent } from "@cliffy/keypress"; /** Promise */ const event: KeyPressEvent = await keypress(); diff --git a/examples/keypress/async_iterator.ts b/examples/keypress/async_iterator.ts index 348ee140..f9f0129d 100755 --- a/examples/keypress/async_iterator.ts +++ b/examples/keypress/async_iterator.ts @@ -1,6 +1,6 @@ #!/usr/bin/env -S deno run -import { keypress } from "../../keypress/mod.ts"; +import { keypress } from "@cliffy/keypress"; for await (const event of keypress()) { console.log( diff --git a/examples/keypress/async_iterator_with_events.ts b/examples/keypress/async_iterator_with_events.ts index f3f21479..d84b1f7f 100755 --- a/examples/keypress/async_iterator_with_events.ts +++ b/examples/keypress/async_iterator_with_events.ts @@ -1,6 +1,6 @@ #!/usr/bin/env -S deno run -import { keypress, KeyPressEvent } from "../../keypress/mod.ts"; +import { keypress, KeyPressEvent } from "@cliffy/keypress"; keypress().addEventListener("keydown", (event: KeyPressEvent) => { console.log("# event"); diff --git a/examples/keypress/event_target.ts b/examples/keypress/event_target.ts index 4943ef78..abee55ff 100755 --- a/examples/keypress/event_target.ts +++ b/examples/keypress/event_target.ts @@ -1,6 +1,6 @@ #!/usr/bin/env -S deno run -import { keypress, KeyPressEvent } from "../../keypress/mod.ts"; +import { keypress, KeyPressEvent } from "@cliffy/keypress"; keypress().addEventListener("keydown", (event: KeyPressEvent) => { console.log( diff --git a/examples/keypress/event_target_propagation.ts b/examples/keypress/event_target_propagation.ts index f09bd194..f0b176d0 100755 --- a/examples/keypress/event_target_propagation.ts +++ b/examples/keypress/event_target_propagation.ts @@ -1,6 +1,6 @@ #!/usr/bin/env -S deno run -import { keypress, KeyPressEvent } from "../../keypress/mod.ts"; +import { keypress, KeyPressEvent } from "@cliffy/keypress"; // Register an event listener that is called an every keydown event. keypress().addEventListener("keydown", (event: KeyPressEvent) => { diff --git a/examples/keypress/promise.ts b/examples/keypress/promise.ts index ddb2a159..46bcba23 100755 --- a/examples/keypress/promise.ts +++ b/examples/keypress/promise.ts @@ -1,6 +1,6 @@ #!/usr/bin/env -S deno run -import { keypress, KeyPressEvent } from "../../keypress/mod.ts"; +import { keypress, KeyPressEvent } from "@cliffy/keypress"; const event: KeyPressEvent = await keypress(); diff --git a/examples/prompt.ts b/examples/prompt.ts index ff8d8e63..6f466b04 100644 --- a/examples/prompt.ts +++ b/examples/prompt.ts @@ -1,6 +1,6 @@ #!/usr/bin/env -S deno run -import { Confirm, Input, Number, Secret } from "../prompt/mod.ts"; +import { Confirm, Input, Number, Secret } from "@cliffy/prompt"; let hostname: string, port: number, password: string; diff --git a/examples/prompt/checkbox.ts b/examples/prompt/checkbox.ts index 74c4a67c..b318e113 100755 --- a/examples/prompt/checkbox.ts +++ b/examples/prompt/checkbox.ts @@ -1,6 +1,6 @@ #!/usr/bin/env -S deno run -import { Checkbox } from "../../prompt/checkbox.ts"; +import { Checkbox } from "@cliffy/prompt/checkbox"; const title: Array = await Checkbox.prompt({ message: "Pick some books", diff --git a/examples/prompt/confirm.ts b/examples/prompt/confirm.ts index d2d96824..b21f0099 100755 --- a/examples/prompt/confirm.ts +++ b/examples/prompt/confirm.ts @@ -1,6 +1,6 @@ #!/usr/bin/env -S deno run -import { Confirm } from "../../prompt/confirm.ts"; +import { Confirm } from "@cliffy/prompt/confirm"; const confirmed: boolean = await Confirm.prompt("Can you confirm?"); diff --git a/examples/prompt/custom_prompts.ts b/examples/prompt/custom_prompts.ts deleted file mode 100755 index 62a5c5db..00000000 --- a/examples/prompt/custom_prompts.ts +++ /dev/null @@ -1,66 +0,0 @@ -#!/usr/bin/env -S deno run - -import { BufReader } from "@std/io/buf-reader"; -import { tty } from "../../ansi/tty.ts"; -import { Figures } from "../../prompt/_figures.ts"; -import { prompt } from "../../prompt/prompt.ts"; -import { Input } from "../../prompt/input.ts"; - -const result = await prompt([{ - name: "text", - message: `Enter some text`, - // build-in prompt - type: Input, -}, { - // @TODO: Fix custom prompt example. - // name: "customText", - // message: `Enter more text`, - // // using an object/method as custom prompt - // type: { - // async prompt(options: { message: string }): Promise { - // const message = ` ? ${options.message} ${Figures.POINTER_SMALL} `; - // await Deno.stdout.write(new TextEncoder().encode(message)); - // - // const result = await new BufReader(Deno.stdin).readLine(); - // - // return result ? new TextDecoder().decode(result.line) : ""; - // }, - // }, - // }, { - name: "customNumber", - message: `Enter a number`, - // using a class as custom prompt - type: class CustomPrompt { - static async prompt( - options: { message: string }, - error?: string, - ): Promise { - const message = ` ? ${options.message} ${Figures.POINTER_SMALL} `; - await Deno.stdout.write(new TextEncoder().encode(message)); - - if (error) { - tty.cursorSave(); - await Deno.stdout.write(new TextEncoder().encode("\n " + error)); - tty.cursorRestore(); - } - - const readLineResult = await new BufReader(Deno.stdin).readLine(); - const result = Number( - readLineResult ? new TextDecoder().decode(readLineResult.line) : null, - ); - - if (isNaN(result)) { - tty.cursorLeft.cursorUp.eraseDown(); - return this.prompt(options, `${result} is not a number.`); - } - - return result; - } - }, -}]); - -console.log(result); - -// if ( result.foo ) {} // error: Property 'foo' does not exist -// if ( result.customText && isNaN( result.customText ) ) {} // error: Argument of type 'string' is not assignable to parameter of type 'number'. -// if ( result.customNumber && isNaN( result.customNumber ) ) {} // no error: customNumber is of type number diff --git a/examples/prompt/dynamic_prompts.ts b/examples/prompt/dynamic_prompts.ts index d0b40ef9..a7fa30cd 100755 --- a/examples/prompt/dynamic_prompts.ts +++ b/examples/prompt/dynamic_prompts.ts @@ -1,9 +1,9 @@ #!/usr/bin/env -S deno run -import { prompt } from "../../prompt/prompt.ts"; -import { Checkbox } from "../../prompt/checkbox.ts"; -import { Confirm } from "../../prompt/confirm.ts"; -import { Number } from "../../prompt/number.ts"; +import { prompt } from "@cliffy/prompt"; +import { Checkbox } from "@cliffy/prompt/checkbox"; +import { Confirm } from "@cliffy/prompt/confirm"; +import { Number } from "@cliffy/prompt/number"; const result = await prompt([{ name: "animals", diff --git a/examples/prompt/input.ts b/examples/prompt/input.ts index df96f81b..eef37a2e 100755 --- a/examples/prompt/input.ts +++ b/examples/prompt/input.ts @@ -1,6 +1,6 @@ #!/usr/bin/env -S deno run -import { Input } from "../../prompt/input.ts"; +import { Input } from "@cliffy/prompt/input"; const name: string = await Input.prompt("What's your github user name?"); diff --git a/examples/prompt/list.ts b/examples/prompt/list.ts index a165b171..14b37afc 100755 --- a/examples/prompt/list.ts +++ b/examples/prompt/list.ts @@ -1,6 +1,6 @@ #!/usr/bin/env -S deno run -import { List } from "../../prompt/list.ts"; +import { List } from "@cliffy/prompt/list"; const keywords: string[] = await List.prompt("Enter some keywords"); diff --git a/examples/prompt/number.ts b/examples/prompt/number.ts index 737b798d..13d21f2f 100755 --- a/examples/prompt/number.ts +++ b/examples/prompt/number.ts @@ -1,6 +1,6 @@ #!/usr/bin/env -S deno run -import { Number } from "../../prompt/number.ts"; +import { Number } from "@cliffy/prompt/number"; const age: number = await Number.prompt("How old are you?"); diff --git a/examples/prompt/os_signals.ts b/examples/prompt/os_signals.ts index c90a1346..5f0f9d68 100755 --- a/examples/prompt/os_signals.ts +++ b/examples/prompt/os_signals.ts @@ -1,7 +1,7 @@ #!/usr/bin/env -S deno run -import { tty } from "../../ansi/tty.ts"; -import { Toggle } from "../../prompt/toggle.ts"; +import { tty } from "@cliffy/ansi/tty"; +import { Toggle } from "@cliffy/prompt/toggle"; Deno.addSignalListener("SIGINT", () => { tty.cursorLeft.eraseDown.cursorShow(); diff --git a/examples/prompt/prompt_demo.ts b/examples/prompt/prompt_demo.ts index f748fae4..76e6dcd9 100755 --- a/examples/prompt/prompt_demo.ts +++ b/examples/prompt/prompt_demo.ts @@ -1,15 +1,15 @@ #!/usr/bin/env -S deno run +import { prompt } from "@cliffy/prompt"; +import { Checkbox } from "@cliffy/prompt/checkbox"; +import { Input } from "@cliffy/prompt/input"; +import { List } from "@cliffy/prompt/list"; +import { Number } from "@cliffy/prompt/number"; +import { Secret } from "@cliffy/prompt/secret"; +import { Select } from "@cliffy/prompt/select"; +import { Toggle } from "@cliffy/prompt/toggle"; +import { tty } from "@cliffy/ansi/tty"; import { rgb24 } from "@std/fmt/colors"; -import { tty } from "../../ansi/tty.ts"; -import { prompt } from "../../prompt/prompt.ts"; -import { Checkbox } from "../../prompt/checkbox.ts"; -import { Input } from "../../prompt/input.ts"; -import { List } from "../../prompt/list.ts"; -import { Number } from "../../prompt/number.ts"; -import { Secret } from "../../prompt/secret.ts"; -import { Select } from "../../prompt/select.ts"; -import { Toggle } from "../../prompt/toggle.ts"; import { colors } from "./data/colors.ts"; import { firstNames } from "./data/first_names.ts"; diff --git a/examples/prompt/prompt_list.ts b/examples/prompt/prompt_list.ts index 86959bfa..f8ca8c00 100755 --- a/examples/prompt/prompt_list.ts +++ b/examples/prompt/prompt_list.ts @@ -1,10 +1,10 @@ #!/usr/bin/env -S deno run -import { prompt, PromptOptions } from "../../prompt/prompt.ts"; -import { Input } from "../../prompt/input.ts"; -import { Number } from "../../prompt/number.ts"; -import { Confirm } from "../../prompt/confirm.ts"; -import { Checkbox } from "../../prompt/checkbox.ts"; +import { prompt, PromptOptions } from "@cliffy/prompt"; +import { Input } from "@cliffy/prompt/input"; +import { Number } from "@cliffy/prompt/number"; +import { Confirm } from "@cliffy/prompt/confirm"; +import { Checkbox } from "@cliffy/prompt/checkbox"; const animalsPrompt: PromptOptions< "animals", diff --git a/examples/prompt/secret.ts b/examples/prompt/secret.ts index d93e1bde..72b5107b 100755 --- a/examples/prompt/secret.ts +++ b/examples/prompt/secret.ts @@ -1,6 +1,6 @@ #!/usr/bin/env -S deno run -import { Secret } from "../../prompt/secret.ts"; +import { Secret } from "@cliffy/prompt/secret"; const password: string = await Secret.prompt("Enter your password"); diff --git a/examples/prompt/secret_hidden.ts b/examples/prompt/secret_hidden.ts index 9b965fac..3c3f77c6 100755 --- a/examples/prompt/secret_hidden.ts +++ b/examples/prompt/secret_hidden.ts @@ -1,6 +1,6 @@ #!/usr/bin/env -S deno run -import { Secret } from "../../prompt/secret.ts"; +import { Secret } from "@cliffy/prompt/secret"; const password: string = await Secret.prompt({ message: "Enter your password", diff --git a/examples/prompt/select.ts b/examples/prompt/select.ts index 9ff71eeb..6a51cdfd 100755 --- a/examples/prompt/select.ts +++ b/examples/prompt/select.ts @@ -1,6 +1,6 @@ #!/usr/bin/env -S deno run -import { Select } from "../../prompt/select.ts"; +import { Select } from "@cliffy/prompt/select"; const title: string = await Select.prompt({ message: "Pick a book", diff --git a/examples/prompt/suggestions.ts b/examples/prompt/suggestions.ts index 40afeca2..e7507d58 100755 --- a/examples/prompt/suggestions.ts +++ b/examples/prompt/suggestions.ts @@ -1,6 +1,6 @@ #!/usr/bin/env -S deno run -import { Input } from "../../prompt/input.ts"; +import { Input } from "@cliffy/prompt/input"; import { colors } from "./data/colors.ts"; const colorNames: Array = Object.values(colors); diff --git a/examples/prompt/suggestions_list.ts b/examples/prompt/suggestions_list.ts index 15265f25..13b050a0 100755 --- a/examples/prompt/suggestions_list.ts +++ b/examples/prompt/suggestions_list.ts @@ -1,6 +1,6 @@ #!/usr/bin/env -S deno run -import { Input } from "../../prompt/input.ts"; +import { Input } from "@cliffy/prompt/input"; import { colors } from "./data/colors.ts"; const colorNames: Array = Object.keys(colors); diff --git a/examples/prompt/suggestions_list_prompt.ts b/examples/prompt/suggestions_list_prompt.ts index 78a80365..e131348b 100755 --- a/examples/prompt/suggestions_list_prompt.ts +++ b/examples/prompt/suggestions_list_prompt.ts @@ -1,6 +1,6 @@ #!/usr/bin/env -S deno run -import { List } from "../../prompt/list.ts"; +import { List } from "@cliffy/prompt/list"; import { colors } from "./data/colors.ts"; const colorNames: Array = Object.keys(colors); diff --git a/examples/prompt/toggle.ts b/examples/prompt/toggle.ts index 3b4738ee..b20963d9 100755 --- a/examples/prompt/toggle.ts +++ b/examples/prompt/toggle.ts @@ -1,6 +1,6 @@ #!/usr/bin/env -S deno run -import { Toggle } from "../../prompt/toggle.ts"; +import { Toggle } from "@cliffy/prompt/toggle"; const confirmed: boolean = await Toggle.prompt("Can you confirm?"); diff --git a/examples/table.ts b/examples/table.ts index 601c1872..058461f9 100644 --- a/examples/table.ts +++ b/examples/table.ts @@ -1,6 +1,6 @@ #!/usr/bin/env -S deno run -import { Cell, Table } from "../table/mod.ts"; +import { Cell, Table } from "@cliffy/table"; const table = new Table( [ diff --git a/examples/table/basic_usage.ts b/examples/table/basic_usage.ts index 80b09cff..83fd5865 100755 --- a/examples/table/basic_usage.ts +++ b/examples/table/basic_usage.ts @@ -1,6 +1,6 @@ #!/usr/bin/env -S deno run -import { Table } from "../../table/table.ts"; +import { Table } from "@cliffy/table"; const table: Table = new Table( ["Baxter Herman", "Oct 1, 2020", "Harderwijk", "Slovenia"], diff --git a/examples/table/colspan_and_rowspan.ts b/examples/table/colspan_and_rowspan.ts index 309c60fe..a3992ce8 100755 --- a/examples/table/colspan_and_rowspan.ts +++ b/examples/table/colspan_and_rowspan.ts @@ -1,7 +1,6 @@ #!/usr/bin/env -S deno run -import { Cell } from "../../table/cell.ts"; -import { Table } from "../../table/table.ts"; +import { Cell, Table } from "@cliffy/table"; Table.from([ [ diff --git a/examples/table/columns.ts b/examples/table/columns.ts index 8c0641dd..543d47f7 100755 --- a/examples/table/columns.ts +++ b/examples/table/columns.ts @@ -1,6 +1,6 @@ #!/usr/bin/env -S deno run -import { Table } from "../../table/table.ts"; +import { Table } from "@cliffy/table"; new Table() .columns([{ diff --git a/examples/table/consume_words.ts b/examples/table/consume_words.ts index 7fd5baa5..e11bdd98 100644 --- a/examples/table/consume_words.ts +++ b/examples/table/consume_words.ts @@ -1,4 +1,4 @@ -import { consumeWords } from "../../table/consume_words.ts"; +import { consumeWords } from "@cliffy/table"; const maxLength = 50; let text = diff --git a/examples/table/header_and_body.ts b/examples/table/header_and_body.ts index a2bb0c34..1f88e0f5 100755 --- a/examples/table/header_and_body.ts +++ b/examples/table/header_and_body.ts @@ -1,6 +1,6 @@ #!/usr/bin/env -S deno run -import { Table } from "../../table/table.ts"; +import { Table } from "@cliffy/table"; new Table() .header(["Name", "Date", "City", "Country"]) diff --git a/examples/table/random_table_demo.ts b/examples/table/random_table_demo.ts index 75d79ac8..540d33b4 100755 --- a/examples/table/random_table_demo.ts +++ b/examples/table/random_table_demo.ts @@ -1,5 +1,7 @@ #!/usr/bin/env -S deno run +import { Cell, CellType, Table } from "@cliffy/table"; +import { tty } from "@cliffy/ansi/tty"; import { blue, bold, @@ -12,9 +14,6 @@ import { underline, yellow, } from "@std/fmt/colors"; -import { tty } from "../../ansi/tty.ts"; -import { Cell, CellType } from "../../table/cell.ts"; -import { Table } from "../../table/table.ts"; tty.cursorHide(); diff --git a/examples/table/rows_and_cells.ts b/examples/table/rows_and_cells.ts index 0cb63214..1ac4cd8c 100755 --- a/examples/table/rows_and_cells.ts +++ b/examples/table/rows_and_cells.ts @@ -1,8 +1,6 @@ #!/usr/bin/env -S deno run -import { Cell } from "../../table/cell.ts"; -import { Row } from "../../table/row.ts"; -import { Table } from "../../table/table.ts"; +import { Cell, Row, Table } from "@cliffy/table"; new Table() .header(Row.from(["Name", "Date", "City", "Country"]).border()) diff --git a/examples/table/table_options.ts b/examples/table/table_options.ts index 7c8790b5..e040422d 100755 --- a/examples/table/table_options.ts +++ b/examples/table/table_options.ts @@ -1,6 +1,6 @@ #!/usr/bin/env -S deno run -import { Table } from "../../table/table.ts"; +import { Table } from "@cliffy/table"; new Table() .header(["Name", "Date", "City", "Country"]) diff --git a/examples/table/using_as_array.ts b/examples/table/using_as_array.ts index 2eb0d158..6efece77 100755 --- a/examples/table/using_as_array.ts +++ b/examples/table/using_as_array.ts @@ -1,6 +1,6 @@ #!/usr/bin/env -S deno run -import { Table } from "../../table/table.ts"; +import { Table } from "@cliffy/table"; const table: Table = Table.from([ ["Baxter Herman", "Oct 1, 2020", "Harderwijk", "Slovenia"],